diff options
Diffstat (limited to 'actiontext')
-rw-r--r-- | actiontext/Rakefile | 2 | ||||
-rw-r--r-- | actiontext/app/javascript/actiontext/attachment_upload.js | 2 | ||||
-rw-r--r-- | actiontext/app/models/action_text/rich_text.rb | 2 | ||||
-rw-r--r-- | actiontext/lib/templates/installer.rb | 7 | ||||
-rw-r--r-- | actiontext/package.json | 6 | ||||
-rw-r--r-- | actiontext/test/dummy/app/javascript/packs/application.js | 2 | ||||
-rw-r--r-- | actiontext/yarn.lock | 11 |
7 files changed, 12 insertions, 20 deletions
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" 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/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 diff --git a/actiontext/lib/templates/installer.rb b/actiontext/lib/templates/installer.rb index ee5a5af75b..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.exists?(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" |