hanami-assets 2.1.0.rc2 → 2.1.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/hanami/assets/base_url.rb +0 -5
- data/lib/hanami/assets/config.rb +2 -9
- data/lib/hanami/assets/errors.rb +0 -7
- data/lib/hanami/assets/version.rb +1 -1
- data/lib/hanami/assets.rb +13 -9
- metadata +6 -8
- data/bin/hanami-assets +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 524bcdefad223b559accd2e027f37b4a2b28af80ac8db368ece9c18d6676dcd6
|
4
|
+
data.tar.gz: 9baf4a521bbe0549503d2b79bb4ef38b0a65aeb141f2f9299c599edb7e78f2f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6203631c1b5a42cd593e35f37a2274803c0a651e3d81f479a2c5c4ffb60e1df781397b26d087a5d36fd71435222ba7770c9c83b5458d3be55ab52f578501190
|
7
|
+
data.tar.gz: 3ae4c5aceccd0062ce40c73fe259320074bf14300bcc5aebd5d290af5ff1bce7db086c9b37317bc1ac8bcce07c7b52c91bd28dd85d882c35e7a586529fd84fc4
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
# Hanami::Assets
|
2
2
|
Assets management for Ruby web applications
|
3
3
|
|
4
|
+
## v2.1.0.rc3 - 2024-02-16
|
5
|
+
### Changed
|
6
|
+
- [Tim Riley] Require a `root:` argument when initializing `Hanami::Assets`. This should be the directory containing the compiled assets and their `assets.json` manifest file.
|
7
|
+
- [Tim Riley] Removed `manifest_path` setting; the manifest path is no longer user-configurable.
|
8
|
+
- [Tim Riley] Replaced `package_manager_run_command` setting with `node_command` setting.
|
9
|
+
- [Tim Riley] Removed unused `sources`, `entry_point_patterns` and `destination` settings.
|
10
|
+
- [Tim Riley] Removed `bin/hanami-assets` executable.
|
11
|
+
|
4
12
|
## v2.1.0.rc2 - 2023-11-08
|
5
13
|
|
6
14
|
## v2.1.0.rc1 - 2023-11-01
|
data/lib/hanami/assets/config.rb
CHANGED
@@ -17,12 +17,12 @@ module Hanami
|
|
17
17
|
BASE_URL = ""
|
18
18
|
private_constant :BASE_URL
|
19
19
|
|
20
|
-
# @!attribute [rw]
|
20
|
+
# @!attribute [rw] node_command
|
21
21
|
# @return [String]
|
22
22
|
#
|
23
23
|
# @api public
|
24
24
|
# @since 2.1.0
|
25
|
-
setting :
|
25
|
+
setting :node_command, default: "node"
|
26
26
|
|
27
27
|
# @!attribute [rw] path_prefix
|
28
28
|
# @return [String]
|
@@ -51,13 +51,6 @@ module Hanami
|
|
51
51
|
# @since 2.1.0
|
52
52
|
setting :base_url, constructor: -> url { BaseUrl.new(url.to_s) }
|
53
53
|
|
54
|
-
# @!attribute [rw] manifest_path
|
55
|
-
# @return [String, nil]
|
56
|
-
#
|
57
|
-
# @api public
|
58
|
-
# @since 2.1.0
|
59
|
-
setting :manifest_path
|
60
|
-
|
61
54
|
# @api public
|
62
55
|
# @since 2.1.0
|
63
56
|
def initialize(**values)
|
data/lib/hanami/assets/errors.rb
CHANGED
@@ -9,13 +9,6 @@ module Hanami
|
|
9
9
|
class Error < ::StandardError
|
10
10
|
end
|
11
11
|
|
12
|
-
# Error raised when assets config is not valid.
|
13
|
-
#
|
14
|
-
# @api public
|
15
|
-
# @since 2.1.0
|
16
|
-
class ConfigError < Error
|
17
|
-
end
|
18
|
-
|
19
12
|
# Error returned when the assets manifest file is missing.
|
20
13
|
#
|
21
14
|
# @api public
|
data/lib/hanami/assets.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "json"
|
4
|
+
require "pathname"
|
4
5
|
require "zeitwerk"
|
5
6
|
|
6
7
|
module Hanami
|
@@ -30,17 +31,22 @@ module Hanami
|
|
30
31
|
|
31
32
|
# @api private
|
32
33
|
# @since 2.1.0
|
33
|
-
|
34
|
-
private_constant :
|
34
|
+
MANIFEST_PATH = "assets.json"
|
35
|
+
private_constant :MANIFEST_PATH
|
35
36
|
|
36
37
|
# @api private
|
37
38
|
# @since 2.1.0
|
38
39
|
attr_reader :config
|
39
40
|
|
41
|
+
# @api private
|
42
|
+
# @since 2.1.0
|
43
|
+
attr_reader :root
|
44
|
+
|
40
45
|
# @api public
|
41
46
|
# @since 2.1.0
|
42
|
-
def initialize(config:)
|
47
|
+
def initialize(config:, root:)
|
43
48
|
@config = config
|
49
|
+
@root = Pathname(root)
|
44
50
|
end
|
45
51
|
|
46
52
|
# Returns the asset at the given path.
|
@@ -92,15 +98,13 @@ module Hanami
|
|
92
98
|
def manifest
|
93
99
|
return @manifest if instance_variable_defined?(:@manifest)
|
94
100
|
|
95
|
-
|
96
|
-
raise ConfigError, "no manifest_path configured"
|
97
|
-
end
|
101
|
+
full_manifest_path = root.join(MANIFEST_PATH)
|
98
102
|
|
99
|
-
unless
|
100
|
-
raise ManifestMissingError.new(
|
103
|
+
unless full_manifest_path.exist?
|
104
|
+
raise ManifestMissingError.new(full_manifest_path.to_s)
|
101
105
|
end
|
102
106
|
|
103
|
-
@manifest = JSON.parse(File.read(
|
107
|
+
@manifest = JSON.parse(File.read(full_manifest_path))
|
104
108
|
end
|
105
109
|
end
|
106
110
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0.
|
4
|
+
version: 2.1.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -145,15 +145,13 @@ dependencies:
|
|
145
145
|
description: Assets management for Ruby web applications
|
146
146
|
email:
|
147
147
|
- me@lucaguidi.com
|
148
|
-
executables:
|
149
|
-
- hanami-assets
|
148
|
+
executables: []
|
150
149
|
extensions: []
|
151
150
|
extra_rdoc_files: []
|
152
151
|
files:
|
153
152
|
- CHANGELOG.md
|
154
153
|
- LICENSE.md
|
155
154
|
- README.md
|
156
|
-
- bin/hanami-assets
|
157
155
|
- hanami-assets.gemspec
|
158
156
|
- lib/hanami-assets.rb
|
159
157
|
- lib/hanami/assets.rb
|
@@ -178,11 +176,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
176
|
version: '3.0'
|
179
177
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
178
|
requirements:
|
181
|
-
- - "
|
179
|
+
- - ">="
|
182
180
|
- !ruby/object:Gem::Version
|
183
|
-
version:
|
181
|
+
version: '0'
|
184
182
|
requirements: []
|
185
|
-
rubygems_version: 3.
|
183
|
+
rubygems_version: 3.5.6
|
186
184
|
signing_key:
|
187
185
|
specification_version: 4
|
188
186
|
summary: Assets management
|
data/bin/hanami-assets
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "optparse"
|
5
|
-
require "pathname"
|
6
|
-
|
7
|
-
options = {}
|
8
|
-
OptionParser.new do |opts|
|
9
|
-
opts.banner = "Usage: hanami-assets --config=path/to/config.rb"
|
10
|
-
|
11
|
-
opts.on("-c", "--config FILE", "Path to config") do |c|
|
12
|
-
options[:config] = c
|
13
|
-
end
|
14
|
-
end.parse!
|
15
|
-
|
16
|
-
config = options.fetch(:config) { raise ArgumentError.new("You must specify a configuration file") }
|
17
|
-
config = Pathname.new(config)
|
18
|
-
config.exist? or raise ArgumentError.new("Cannot find configuration file: #{config}")
|
19
|
-
|
20
|
-
require "hanami/assets"
|
21
|
-
load config
|
22
|
-
|
23
|
-
Hanami::Assets.deploy
|