From 29bb990f97816f3e0fb086ec9985983c51a56a96 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Mon, 7 Jan 2019 17:04:58 -0500 Subject: Add load hook for ActionText::RichText --- actiontext/app/models/action_text/rich_text.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actiontext') diff --git a/actiontext/app/models/action_text/rich_text.rb b/actiontext/app/models/action_text/rich_text.rb index a577c991b9..705dd30983 100644 --- a/actiontext/app/models/action_text/rich_text.rb +++ b/actiontext/app/models/action_text/rich_text.rb @@ -25,3 +25,5 @@ module ActionText delegate :blank?, :empty?, :present?, to: :to_plain_text end end + +ActiveSupport.run_load_hooks :action_text_rich_text, ActionText::RichText -- cgit v1.2.3 From ce90ded4ca07a92b1bdf72c9296679b5d523383f Mon Sep 17 00:00:00 2001 From: Kevin Solorio Date: Tue, 8 Jan 2019 10:36:33 -0800 Subject: add new frameworks to tasks/release.rb The Frameworks collection was missing actiontext and actionmailbox, this would mean they are skipped when running any tasks that iterated through this collection changes include Breaking up frameworks declaration into multiple lines and put them in order. This should make adding to the list easier and if you need to scan it, they will be in order you would expect Add `package` task to both actiontext and actionmailbox --- actiontext/Rakefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actiontext') diff --git a/actiontext/Rakefile b/actiontext/Rakefile index 5cda013f96..36aed17282 100644 --- a/actiontext/Rakefile +++ b/actiontext/Rakefile @@ -4,6 +4,8 @@ require "bundler/setup" require "bundler/gem_tasks" require "rake/testtask" +task :package + Rake::TestTask.new do |t| t.libs << "test" t.pattern = "test/**/*_test.rb" -- cgit v1.2.3 From 5df737b7e8bb8843c55957a2aa036b3970059029 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Wed, 9 Jan 2019 12:00:08 +0900 Subject: Enable `Lint/DeprecatedClassMethods` cop to avoid using deprecated methods --- actiontext/lib/templates/installer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actiontext') diff --git a/actiontext/lib/templates/installer.rb b/actiontext/lib/templates/installer.rb index ee5a5af75b..dc549a8af3 100644 --- a/actiontext/lib/templates/installer.rb +++ b/actiontext/lib/templates/installer.rb @@ -14,7 +14,7 @@ run "yarn add https://github.com/rails/actiontext" APPLICATION_PACK_PATH = "app/javascript/packs/application.js" -if File.exists?(APPLICATION_PACK_PATH) && File.read(APPLICATION_PACK_PATH) !~ /import "actiontext"/ +if File.exist?(APPLICATION_PACK_PATH) && File.read(APPLICATION_PACK_PATH) !~ /import "actiontext"/ say "Adding import to default JavaScript pack" append_to_file APPLICATION_PACK_PATH, <<-EOS import "actiontext" -- cgit v1.2.3 From 86b489e3d6a9efbefbc62e8531d0f5850934d4e1 Mon Sep 17 00:00:00 2001 From: Javan Makhmali Date: Wed, 9 Jan 2019 08:09:51 -0500 Subject: Move all npm packages to @rails scope Fixes #33083 --- actiontext/app/javascript/actiontext/attachment_upload.js | 2 +- actiontext/lib/templates/installer.rb | 7 +++---- actiontext/package.json | 6 +++--- actiontext/test/dummy/app/javascript/packs/application.js | 2 +- actiontext/yarn.lock | 11 ----------- 5 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 actiontext/yarn.lock (limited to 'actiontext') diff --git a/actiontext/app/javascript/actiontext/attachment_upload.js b/actiontext/app/javascript/actiontext/attachment_upload.js index a716f1f589..77fbc97df6 100644 --- a/actiontext/app/javascript/actiontext/attachment_upload.js +++ b/actiontext/app/javascript/actiontext/attachment_upload.js @@ -1,4 +1,4 @@ -import { DirectUpload } from "activestorage" +import { DirectUpload } from "@rails/activestorage" export class AttachmentUpload { constructor(attachment, element) { diff --git a/actiontext/lib/templates/installer.rb b/actiontext/lib/templates/installer.rb index dc549a8af3..e7c6c2623e 100644 --- a/actiontext/lib/templates/installer.rb +++ b/actiontext/lib/templates/installer.rb @@ -8,15 +8,14 @@ say "Copying blob rendering partial to app/views/active_storage/blobs/_blob.html copy_file "#{__dir__}/../../app/views/active_storage/blobs/_blob.html.erb", "app/views/active_storage/blobs/_blob.html.erb" -# FIXME: Replace with release version on release say "Installing JavaScript dependency" -run "yarn add https://github.com/rails/actiontext" +run "yarn add @rails/actiontext" APPLICATION_PACK_PATH = "app/javascript/packs/application.js" -if File.exist?(APPLICATION_PACK_PATH) && File.read(APPLICATION_PACK_PATH) !~ /import "actiontext"/ +if File.exist?(APPLICATION_PACK_PATH) && File.read(APPLICATION_PACK_PATH) !~ /import "@rails\/actiontext"/ say "Adding import to default JavaScript pack" append_to_file APPLICATION_PACK_PATH, <<-EOS -import "actiontext" +import "@rails/actiontext" EOS end diff --git a/actiontext/package.json b/actiontext/package.json index b42838b1df..ec8f35fd3c 100644 --- a/actiontext/package.json +++ b/actiontext/package.json @@ -1,5 +1,5 @@ { - "name": "actiontext", + "name": "@rails/actiontext", "version": "6.0.0-alpha", "description": "Edit and display rich text in Rails applications", "main": "app/javascript/actiontext/index.js", @@ -21,7 +21,7 @@ ], "license": "MIT", "dependencies": { - "trix": ">=1.0.0", - "activestorage": "6.0.0-alpha" + "trix": "^1.0.0", + "@rails/activestorage": "^6.0.0-alpha" } } diff --git a/actiontext/test/dummy/app/javascript/packs/application.js b/actiontext/test/dummy/app/javascript/packs/application.js index 90eb1a1841..13ac17ed58 100644 --- a/actiontext/test/dummy/app/javascript/packs/application.js +++ b/actiontext/test/dummy/app/javascript/packs/application.js @@ -1 +1 @@ -import "actiontext" +import "@rails/actiontext" diff --git a/actiontext/yarn.lock b/actiontext/yarn.lock deleted file mode 100644 index f98622eb64..0000000000 --- a/actiontext/yarn.lock +++ /dev/null @@ -1,11 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"activestorage@>= 5.2.0-rc1": - version "5.2.0-rc1" - resolved "https://registry.yarnpkg.com/activestorage/-/activestorage-5.2.0-rc1.tgz#79898996eceb0f13575eff41fb109051fbfa49b0" - -trix@^0.11.1: - version "0.11.1" - resolved "https://registry.yarnpkg.com/trix/-/trix-0.11.1.tgz#ffe54f2757c2c2385b8424fd5c5d2ab712a09acc" -- cgit v1.2.3