snowpack 1.0.0.alpha2 → 1.0.0.alpha3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -1
- data/README.md +1 -1
- data/exe/snowpack +1 -1
- data/lib/snowpack/application.rb +5 -1
- data/lib/snowpack/cli/standalone/commands.rb +1 -0
- data/lib/snowpack/cli/standalone/commands/version.rb +20 -0
- data/lib/snowpack/slice.rb +7 -1
- data/lib/snowpack/version.rb +1 -1
- data/lib/snowpack/web/endpoint_resolver.rb +7 -5
- data/lib/snowpack/web/rack_logger.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b73852c042508833bb0d5cf04a80d648d552b2255f4e9585a7d290e91247b862
|
4
|
+
data.tar.gz: 2153b9dfc250ff043de4c7e52eec8b9a17adc68dcae16186a27c462de81176ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d81b54d0dbe7ac74a588208de5c64c8ac36744d59783fcb620556a9f1aa9d3098ee06e1bdced00d221b417230a6ade208daa68c71d1a3f6d3cf2ebad1b34dece
|
7
|
+
data.tar.gz: 3c0864c755e84e3b4d112f382ed60a6ea20f5ed88f41e70fbcd386996794fed52adebf39153c46d6efb9ce6a097e1c710564634a3511df500a592dff8eb8100d
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,25 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [1.0.0.
|
3
|
+
## [1.0.0.alpha3] - 2019-07-11
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- Add `snowpack version` subcommand for standalone executable
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- Add Application.slice_paths method, this can be overridden in subclasses to allow selective ignoring of some slices (this is not a perfect final solution, but helps in the interim)
|
12
|
+
- Slice.finalize! exits gracefully if Slice already finalized
|
13
|
+
- Slice.finalize! passes all its arguments to super
|
14
|
+
- Add Slice's default system_dir (if it exists) when inheriting from Snowpack::Slice
|
15
|
+
- Use internal error class in Web::EndpointResolver, allowing snowpack apps to work without hanami-controller installed
|
16
|
+
|
17
|
+
### Fixed
|
18
|
+
|
19
|
+
- Fix bug with recersive filtering in RackLogger
|
20
|
+
- Remove require of bundler/setup preventing `snowpack` executable from working in some circumstances
|
21
|
+
|
22
|
+
## [1.0.0.alpha2] - 2019-07-01
|
4
23
|
|
5
24
|
### Changed
|
6
25
|
|
data/README.md
CHANGED
data/exe/snowpack
CHANGED
data/lib/snowpack/application.rb
CHANGED
@@ -39,7 +39,7 @@ module Snowpack
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.load_slices
|
42
|
-
@slices ||=
|
42
|
+
@slices ||= slice_paths
|
43
43
|
.map(&method(:load_slice))
|
44
44
|
.compact
|
45
45
|
.to_h
|
@@ -73,6 +73,10 @@ module Snowpack
|
|
73
73
|
|
74
74
|
private
|
75
75
|
|
76
|
+
def self.slice_paths
|
77
|
+
Dir[File.join(config.root, config.slices_dir, "*")]
|
78
|
+
end
|
79
|
+
|
76
80
|
def self.load_slice(base_path)
|
77
81
|
base_path = Pathname(base_path)
|
78
82
|
full_defn_path = Dir["#{base_path}/system/**/slice.rb"].first
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "snowpack/version"
|
4
|
+
require "snowpack/cli/command"
|
5
|
+
|
6
|
+
module Snowpack
|
7
|
+
module CLI
|
8
|
+
module Standalone
|
9
|
+
module Commands
|
10
|
+
class Version < Command
|
11
|
+
def call(*)
|
12
|
+
out.puts "Snowpack #{Snowpack::VERSION}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
register "version", Version, aliases: ["-v", "--version"]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/snowpack/slice.rb
CHANGED
@@ -26,6 +26,10 @@ module Snowpack
|
|
26
26
|
if File.directory?(slice_path)
|
27
27
|
klass.config.root = slice_path if File.directory?(slice_path)
|
28
28
|
klass.load_paths! "lib"
|
29
|
+
|
30
|
+
if File.directory?(File.join(klass.config.root, klass.config.system_dir))
|
31
|
+
klass.load_paths! klass.config.system_dir
|
32
|
+
end
|
29
33
|
end
|
30
34
|
|
31
35
|
klass.import application: app
|
@@ -47,7 +51,9 @@ module Snowpack
|
|
47
51
|
finalize!
|
48
52
|
end
|
49
53
|
|
50
|
-
def self.finalize!
|
54
|
+
def self.finalize!(*)
|
55
|
+
return self if finalized?
|
56
|
+
|
51
57
|
# Force `after :configure` hooks to run
|
52
58
|
configure do; end
|
53
59
|
|
data/lib/snowpack/version.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# FIXME: This is for the NotCallableEndpointError. It would be good if this
|
4
|
-
# could be require-able without having to bring in all the routing files
|
5
|
-
require "hanami/routing"
|
6
|
-
|
7
3
|
module Snowpack
|
8
4
|
module Web
|
9
5
|
class EndpointResolver
|
6
|
+
class NotCallableEndpointError < StandardError
|
7
|
+
def initialize(endpoint)
|
8
|
+
super("#{endpoint.inspect} isn't compatible with Rack. Please make sure it implements #call.")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
10
12
|
attr_reader :application
|
11
13
|
attr_reader :container
|
12
14
|
attr_reader :base_namespace
|
@@ -42,7 +44,7 @@ module Snowpack
|
|
42
44
|
end
|
43
45
|
|
44
46
|
unless endpoint.respond_to?(:call)
|
45
|
-
raise
|
47
|
+
raise NotCallableEndpointError.new(endpoint)
|
46
48
|
end
|
47
49
|
|
48
50
|
endpoint
|
@@ -60,9 +60,9 @@ module Snowpack
|
|
60
60
|
if filter_params.include?(k)
|
61
61
|
h.update(k => FILTERED)
|
62
62
|
elsif v.is_a?(Hash)
|
63
|
-
h.update(k =>
|
63
|
+
h.update(k => filter(v))
|
64
64
|
elsif v.is_a?(Array)
|
65
|
-
h.update(k => v.map { |m| m.is_a?(Hash) ?
|
65
|
+
h.update(k => v.map { |m| m.is_a?(Hash) ? filter(m) : m })
|
66
66
|
else
|
67
67
|
h[k] = v
|
68
68
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snowpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.alpha3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Riley
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-07-
|
12
|
+
date: 2019-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-inflector
|
@@ -219,6 +219,7 @@ files:
|
|
219
219
|
- lib/snowpack/cli/standalone/cli.rb
|
220
220
|
- lib/snowpack/cli/standalone/commands.rb
|
221
221
|
- lib/snowpack/cli/standalone/commands/new.rb
|
222
|
+
- lib/snowpack/cli/standalone/commands/version.rb
|
222
223
|
- lib/snowpack/components.rb
|
223
224
|
- lib/snowpack/components/formalist.rb
|
224
225
|
- lib/snowpack/components/persistence.rb
|