propshaft 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bdd01776a4cf66e324271ccb59f41d8473b2863c75ace4d2d75f7295e2fad36
4
- data.tar.gz: c1e8d1e3a3bfaee8ee77bd53b760bc272df4d25f4fc4c494eb14e99bc125acd9
3
+ metadata.gz: 14ffc5b071d45f08f18e5f52fa2668f4630debf23d501c08e000d309c3a9b8fd
4
+ data.tar.gz: c210e3cd12d58e3df3c2a20c2b42d182ee66e13ae3d6653fd05272b3ad513e37
5
5
  SHA512:
6
- metadata.gz: fddd9f7d38b01958b449f966143894f065d8a0c35a51dcd0b5234230daf3ac7897107289af615f6484d253f883d6c2c5351a6281b1fd0f9465efd3df0d92e6ad
7
- data.tar.gz: 26f5105052b942c55f41f6f049eb3e28c1200231a51edad58c41645b936f51fbe98721ae1823b2ec293243c369cadb657368be4afee35747450fb01d948cee93
6
+ metadata.gz: bea78212ba31154621e6878b7e721abbc787e0594da6dadf6d6e587b213c9f587d6d554e74f5b79d361944ae43514c82efa30b49978d4faa776e21774ceb4fd6
7
+ data.tar.gz: 46de0996122fe99868d6a74a1d4f3c37c8897c6b760e0a7de9db36cc8794995ea6c753d792fd21ddde22d2d9fa1fd599aef055d94a42da49b36e1badeb5f5ca9
data/README.md CHANGED
@@ -12,7 +12,7 @@ So that's what Propshaft doesn't do. Here's what it does provide:
12
12
 
13
13
  ## Installation
14
14
 
15
- With Rails 7+, you can start a new application with propshaft using `rails new myapp -a propshaft`. For existing applications, check the [upgrade guide](https://github.com/rails/propshaft/blob/main/UPGRADING.md) which contains step-by-step instructions.
15
+ With Rails 8, Propshaft is the default asset pipeline for new applications. With Rails 7, you can start a new application with propshaft using `rails new myapp -a propshaft`. For existing applications, check the [upgrade guide](https://github.com/rails/propshaft/blob/main/UPGRADING.md) which contains step-by-step instructions.
16
16
 
17
17
  ## Usage
18
18
 
@@ -47,11 +47,6 @@ On the other hand, if you're already bundling JavaScript and CSS through a Node-
47
47
  But for greenfield apps using the default import-map approach, Propshaft can also work well, if you're able to deal with vanilla CSS.
48
48
 
49
49
 
50
- ## Will Propshaft replace Sprockets as the Rails default?
51
-
52
- Most likely, but Sprockets needs to be supported as well for a long time to come. Plenty of apps and gems were built on Sprocket features, and they won't be migrating soon. Still working out the compatibility story. This is very much beta software at the moment.
53
-
54
-
55
50
  ## License
56
51
 
57
52
  Propshaft is released under the [MIT License](https://opensource.org/licenses/MIT).
@@ -6,8 +6,8 @@ class Propshaft::Asset
6
6
 
7
7
  class << self
8
8
  def extract_path_and_digest(digested_path)
9
- digest = digested_path[/-([0-9a-zA-Z]{7,128})\.(?!digested)([^.]|.map)+\z/, 1]
10
- path = digest ? digested_path.sub("-#{digest}", "") : digested_path
9
+ digest = digested_path[/-([0-9a-zA-Z]{7,128})\.(?!digested)([^.]|.map)+\z/, 1]
10
+ path = digest ? digested_path.sub("-#{digest}", "") : digested_path
11
11
 
12
12
  [path, digest]
13
13
  end
@@ -1,5 +1,6 @@
1
1
  require "rails"
2
2
  require "active_support/ordered_options"
3
+ require "propshaft"
3
4
  require "propshaft/quiet_assets"
4
5
 
5
6
  module Propshaft
@@ -31,6 +32,9 @@ module Propshaft
31
32
  end
32
33
 
33
34
  config.after_initialize do |app|
35
+ # Prioritize assets from within the application over assets of the same path from engines/gems.
36
+ config.assets.paths.sort_by! { |path| path.to_s.start_with?(Rails.root.to_s) ? 0 : 1 }
37
+
34
38
  config.assets.relative_url_root ||= app.config.relative_url_root
35
39
  config.assets.output_path ||=
36
40
  Pathname.new(File.join(app.config.paths["public"].first, app.config.assets.prefix))
@@ -1,3 +1,3 @@
1
1
  module Propshaft
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: propshaft
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-09 00:00:00.000000000 Z
11
+ date: 2024-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack