ember-cli-rails-assets 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56b0e51245621258b937d06d80ec8a579a0a79757d82ca48543c6140a831a557
4
- data.tar.gz: c3e66e4300881a1627db2ef33e89cd4814a3cb9aaba1f664113bd3dd5caf3ba0
3
+ metadata.gz: f38df79bd5263f5e6d124fd2ddeff3e0f724a6a967e1c165d4799a946f557c51
4
+ data.tar.gz: 36afc4bff115269fa3cb626e5d52aed8f8a8cddfb09b13b8e621602a9b72ec3c
5
5
  SHA512:
6
- metadata.gz: e11ac7ab0892ee54e8c6de2e0bf410db8596de9e45efd40658bd6c5c2803ddb3a9eee354730327644f9445063e041f502415280d1ac93fd0de54eb697cfb07a1
7
- data.tar.gz: 6d5cbfadca8796f9596eaa67d5c8c3a9a6c36a45ea3f5751606ac617ea025064861210cebd97f04bf2ff14b65d202c049645577c08220da5bd3acf476f06a535
6
+ metadata.gz: '084c574b46d27829d332586bd8e3766ab3e4a1205a373d1c2d1b2a9e2f89e1924393b22b1ed418021e3c30e047ae92357b06c72d89bb5e6b796ec51f7693589c'
7
+ data.tar.gz: 521eee2cc26d824b6e6862b428213cfdd2b1f8bb2827c366d7a0b59688d066818d991a0b9e27065771d1c118a868247a47cf1b301da6cafad1f325c4b0679261
data/README.md CHANGED
@@ -33,8 +33,9 @@ $ bundle install
33
33
  To configure your project to use `ember-cli-rails`, follow the instructions
34
34
  listed in the [`ember-cli-rails` README][README].
35
35
 
36
- To configure your project to user `ember-cli-rails-assets`, ensure each Ember
37
- application's `ember-cli-build.js` includes the following values:
36
+ To configure a classic (Broccoli-based) Ember application to use
37
+ `ember-cli-rails-assets`, ensure its `ember-cli-build.js` includes the
38
+ following values:
38
39
 
39
40
  ```js
40
41
  // frontend/ember-cli-build.js
@@ -54,6 +55,21 @@ module.exports = function(defaults) {
54
55
 
55
56
  [README]: https://github.com/tricknotes/ember-cli-rails#readme
56
57
 
58
+ ### Vite-based applications
59
+
60
+ Vite-based applications (generated with `ember-cli >= 6.8`) require no build
61
+ configuration. For them, use `include_ember_script_tags` on its own: it emits
62
+ everything the application needs to boot — the configuration `<meta>` tag, the
63
+ stylesheet and `modulepreload` links, and the ES module script tags —
64
+ extracted from the generated `index.html`:
65
+
66
+ ```erb
67
+ <%= include_ember_script_tags :frontend %>
68
+ ```
69
+
70
+ `include_ember_stylesheet_tags` only supports classic applications, and raises
71
+ an error when called for a Vite-based application.
72
+
57
73
  ## Mount
58
74
 
59
75
  Mount the Ember application (in this example, the `frontend` application) to the
@@ -126,7 +142,9 @@ path to prepend:
126
142
 
127
143
  This project supports:
128
144
 
129
- * EmberCLI versions `>= 1.13.13`
145
+ * EmberCLI versions `>= 1.13.13` using the classic (Broccoli-based) build
146
+ * EmberCLI versions `>= 6.8` using the Vite-based build, with
147
+ `include_ember_script_tags` only
130
148
 
131
149
  ## Ruby and Rails support
132
150
 
@@ -1,3 +1,4 @@
1
+ require "ember_cli/assets/errors"
1
2
  require "ember_cli/assets/lookup"
2
3
  require "ember_cli/assets/paths"
3
4
 
@@ -16,9 +17,22 @@ module EmberCliRailsAssetsHelper
16
17
  end
17
18
 
18
19
  def include_ember_stylesheet_tags(name, prepend: "")
19
- EmberCli[name].build
20
+ app = EmberCli[name]
21
+ app.build
20
22
 
21
- assets = EmberCli::Assets::Lookup.new(EmberCli[name])
23
+ paths = EmberCli::Assets::Paths.new(app)
24
+
25
+ if paths.vite?
26
+ raise EmberCli::Assets::NotSupportedError, <<~MSG
27
+ `include_ember_stylesheet_tags` does not support Vite-based
28
+ applications (`ember-cli >= 6.8`).
29
+
30
+ `include_ember_script_tags` already emits their stylesheet tags,
31
+ so remove this call.
32
+ MSG
33
+ end
34
+
35
+ assets = EmberCli::Assets::Lookup.new(app)
22
36
 
23
37
  assets.stylesheet_assets.
24
38
  map { |src| [prepend, src].join }.
@@ -1,5 +1,6 @@
1
1
  module EmberCli
2
2
  module Assets
3
3
  class BuildError < StandardError; end
4
+ class NotSupportedError < StandardError; end
4
5
  end
5
6
  end
@@ -1,5 +1,5 @@
1
1
  module EmberCli
2
2
  module Assets
3
- VERSION = "0.8.0"
3
+ VERSION = "0.8.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember-cli-rails-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Doyle