ruby_npm 0.1.0.pre.3 → 0.1.0.pre.4

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: 237ebd0f181a703bb4eab351730cebbda23dcb98925fa807b07e34d35e2f3252
4
- data.tar.gz: c27b634150d240bb86034e7c69a582b00426f9e7d1aae732a1464293711dea40
3
+ metadata.gz: e75c704c75f98d8bd697d81b26fb18734acaecf0354500cb2fa30343d8a29ea6
4
+ data.tar.gz: 2225b03171613b5bc7fa239bcc4b4c6dc78bfe6591de856024d7846464c52022
5
5
  SHA512:
6
- metadata.gz: 70d379c15bc4163adccdeb05fd083a57ce80808ae4d73da8025bf70ffe219e425d6d0747c52b88db2d765c72b6346451f03860c721d15d9aded0c2fc43167428
7
- data.tar.gz: b142252fd0bcdc4a5608352d265302c2f75975e8e116a6b7997d493c9e4df4821b6d342295392a9cf3241c1e54e18ce47d0ed53b03f92651355a174b58ec82c2
6
+ metadata.gz: e6583aebca78abd89cff43cf2f365d81095f5a9f452dab09c8dafd3c786968708e8536052984b2c0ed7958784312c5fa7b659ee030e2e270a44a3176cac60b2a
7
+ data.tar.gz: abcf86fcc58c3c0d9ea1e6c20f42f60a00bcc08d1013079bfc7be232ad1e6855f257d0a32da7f3b479b0ac16399a38fb48075289fd135737df2868a0988d83f5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_npm (0.1.0.pre.3)
4
+ ruby_npm (0.1.0.pre.4)
5
5
  immutable-struct (~> 2.4)
6
6
  lino (~> 3.0)
7
7
 
@@ -13,50 +13,31 @@ module RubyNPM
13
13
  # @!visibility private
14
14
  # rubocop:disable Metrics/MethodLength
15
15
  def options
16
- %w[
17
- --audit
18
- --bin-links
19
- --color
20
- --dry-run
21
- --force
22
- --foreground-scripts
23
- --fund
24
- --global
25
- --global-style
26
- --ignore-scripts
27
- --include
28
- --include-workspace-root
29
- --install-links
30
- --install-strategy
31
- --legacy-bundling
32
- --loglevel
33
- --logs-dir
34
- --logs-max
35
- --omit
36
- --package-lock
37
- --package-lock-only
38
- --production
39
- --quiet
40
- --save
41
- --save-bundle
42
- --save-dev
43
- --save-exact
44
- --save-optional
45
- --save-peer
46
- --save-prod
47
- --script-shell
48
- --silent
49
- --strict-peer-deps
50
- --tag
51
- --verbose
52
- --workspace
53
- --workspaces
54
- ] + super
16
+ super +
17
+ Options::Sets::WORKSPACE_OPTIONS +
18
+ Options::Sets::LOGGING_OPTIONS +
19
+ Options::Sets::GLOBAL_OPTIONS +
20
+ Options::Sets::DEPENDENCY_OPTIONS +
21
+ %w[
22
+ --audit
23
+ --bin-links
24
+ --fund
25
+ --global
26
+ --global-style
27
+ --install-links
28
+ --install-strategy
29
+ --json
30
+ --legacy-bundling
31
+ --package-lock
32
+ --package-lock-only
33
+ --strict-peer-deps
34
+ --tag
35
+ ]
55
36
  end
56
37
  # rubocop:enable Metrics/MethodLength
57
38
 
58
39
  def arguments(parameters)
59
- [parameters[:packages]]
40
+ [parameters[:package_specs]]
60
41
  end
61
42
  end
62
43
  end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base'
4
+
5
+ module RubyNPM
6
+ module Commands
7
+ class Publish < Base
8
+ # @!visibility private
9
+ def subcommands
10
+ %w[publish]
11
+ end
12
+
13
+ # @!visibility private
14
+ def options
15
+ super +
16
+ Options::Sets::WORKSPACE_OPTIONS +
17
+ Options::Sets::LOGGING_OPTIONS +
18
+ Options::Sets::GLOBAL_OPTIONS +
19
+ %w[
20
+ --access
21
+ --json
22
+ --otp
23
+ --tag
24
+ ]
25
+ end
26
+
27
+ def arguments(parameters)
28
+ [parameters[:package_spec]]
29
+ end
30
+ end
31
+ end
32
+ end
@@ -11,28 +11,17 @@ module RubyNPM
11
11
  end
12
12
 
13
13
  # @!visibility private
14
- # rubocop:disable Metrics/MethodLength
15
14
  def options
16
- %w[
17
- --color
18
- --foreground-scripts
19
- --if-present
20
- --ignore-scripts
21
- --include-workspace-root
22
- --json
23
- --loglevel
24
- --logs-dir
25
- --logs-max
26
- --parseable
27
- --quiet
28
- --script-shell
29
- --silent
30
- --verbose
31
- --workspace
32
- --workspaces
33
- ] + super
15
+ super +
16
+ Options::Sets::WORKSPACE_OPTIONS +
17
+ Options::Sets::LOGGING_OPTIONS +
18
+ Options::Sets::GLOBAL_OPTIONS +
19
+ %w[
20
+ --if-present
21
+ --json
22
+ --parseable
23
+ ]
34
24
  end
35
- # rubocop:enable Metrics/MethodLength
36
25
 
37
26
  def arguments(parameters)
38
27
  script_arguments =
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'commands/install'
4
+ require_relative 'commands/publish'
4
5
  require_relative 'commands/run_script'
5
6
 
6
7
  module RubyNPM
@@ -1,13 +1,69 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyNPM
4
+ # rubocop:disable Metrics/ModuleLength
4
5
  module Options
5
- DEFINITIONS = [
6
- # concrete definitions
7
- [
8
- workspaces
9
- ],
6
+ WORKSPACE_DEFINITIONS = [
7
+ workspaces,
8
+ definition(
9
+ name: '--workspace',
10
+ option_type: :standard,
11
+ value_type: :string
12
+ ),
13
+ definition(
14
+ name: '--include-workspace-root',
15
+ option_type: :standard,
16
+ value_type: :boolean
17
+ )
18
+ ].freeze
10
19
 
20
+ LOGGING_DEFINITIONS = [
21
+ # string options
22
+ %w[
23
+ --loglevel
24
+ --logs-dir
25
+ --logs-max
26
+ ].map do |o|
27
+ definition(
28
+ name: o, option_type: :standard, value_type: :string
29
+ )
30
+ end,
31
+
32
+ # flag options
33
+ %w[
34
+ --quiet
35
+ --silent
36
+ --verbose
37
+ ].map do |o|
38
+ definition(name: o, option_type: :flag, value_type: :boolean)
39
+ end
40
+ ].flatten.freeze
41
+
42
+ GLOBAL_DEFINITIONS = [
43
+ # string options
44
+ %w[
45
+ --color
46
+ --script-shell
47
+ ].map do |o|
48
+ definition(
49
+ name: o, option_type: :standard, value_type: :string
50
+ )
51
+ end,
52
+
53
+ # boolean options
54
+ %w[
55
+ --dry-run
56
+ --force
57
+ --foreground-scripts
58
+ --ignore-scripts
59
+ ].map do |o|
60
+ definition(
61
+ name: o, option_type: :standard, value_type: :boolean
62
+ )
63
+ end
64
+ ].flatten.freeze
65
+
66
+ DEPENDENCY_DEFINITIONS = [
11
67
  # string repeatable options
12
68
  {
13
69
  omit: '--omit',
@@ -20,58 +76,59 @@ module RubyNPM
20
76
  )
21
77
  end,
22
78
 
79
+ # boolean options
80
+ %w[
81
+ --save
82
+ --save-bundle
83
+ --save-dev
84
+ --save-exact
85
+ --save-optional
86
+ --save-peer
87
+ --save-prod
88
+ ].map do |o|
89
+ definition(
90
+ name: o, option_type: :standard, value_type: :boolean
91
+ )
92
+ end
93
+ ].flatten.freeze
94
+
95
+ OUTPUT_DEFINITIONS = [
96
+ # boolean options
97
+ %w[
98
+ --json
99
+ ].map do |o|
100
+ definition(
101
+ name: o, option_type: :standard, value_type: :boolean
102
+ )
103
+ end
104
+ ].flatten.freeze
105
+
106
+ OTHER_DEFINITIONS = [
23
107
  # string options
24
108
  %w[
25
- --color
109
+ --access
26
110
  --install-strategy
27
- --loglevel
28
- --logs-dir
29
- --logs-max
30
- --script-shell
111
+ --otp
31
112
  --tag
32
- --workspace
33
113
  ].map do |o|
34
114
  definition(
35
115
  name: o, option_type: :standard, value_type: :string
36
116
  )
37
117
  end,
38
118
 
39
- # flag options
40
- %w[
41
- --quiet
42
- --silent
43
- --verbose
44
- ].map do |o|
45
- definition(name: o, option_type: :flag, value_type: :boolean)
46
- end,
47
-
48
119
  # boolean options
49
120
  %w[
50
121
  --audit
51
122
  --bin-links
52
- --dry-run
53
- --force
54
- --foreground-scripts
55
123
  --fund
56
124
  --global
57
125
  --global-style
58
126
  --if-present
59
- --ignore-scripts
60
- --include-workspace-root
61
127
  --install-links
62
- --json
63
128
  --legacy-bundling
64
129
  --package-lock
65
130
  --package-lock-only
66
131
  --parseable
67
- --production
68
- --save
69
- --save-bundle
70
- --save-dev
71
- --save-exact
72
- --save-optional
73
- --save-peer
74
- --save-prod
75
132
  --strict-peer-deps
76
133
  ].map do |o|
77
134
  definition(
@@ -79,5 +136,15 @@ module RubyNPM
79
136
  )
80
137
  end
81
138
  ].flatten.freeze
139
+
140
+ DEFINITIONS = (
141
+ WORKSPACE_DEFINITIONS +
142
+ LOGGING_DEFINITIONS +
143
+ GLOBAL_DEFINITIONS +
144
+ DEPENDENCY_DEFINITIONS +
145
+ OUTPUT_DEFINITIONS +
146
+ OTHER_DEFINITIONS
147
+ )
82
148
  end
149
+ # rubocop:enable Metrics/ModuleLength
83
150
  end
@@ -3,6 +3,45 @@
3
3
  module RubyNPM
4
4
  module Options
5
5
  module Sets
6
+ WORKSPACE_OPTIONS = %w[
7
+ --include-workspace-root
8
+ --workspace
9
+ --workspaces
10
+ ].freeze
11
+
12
+ LOGGING_OPTIONS = %w[
13
+ --loglevel
14
+ --logs-dir
15
+ --logs-max
16
+ --quiet
17
+ --silent
18
+ --verbose
19
+ ].freeze
20
+
21
+ GLOBAL_OPTIONS = %w[
22
+ --color
23
+ --dry-run
24
+ --force
25
+ --foreground-scripts
26
+ --ignore-scripts
27
+ --script-shell
28
+ ].freeze
29
+
30
+ DEPENDENCY_OPTIONS = %w[
31
+ --include
32
+ --omit
33
+ --save
34
+ --save-bundle
35
+ --save-dev
36
+ --save-exact
37
+ --save-optional
38
+ --save-peer
39
+ --save-prod
40
+ ].freeze
41
+
42
+ OUTPUT_OPTIONS = %w[
43
+ --json
44
+ ].freeze
6
45
  end
7
46
  end
8
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyNPM
4
- VERSION = '0.1.0.pre.3'
4
+ VERSION = '0.1.0.pre.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_npm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.3
4
+ version: 0.1.0.pre.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-01 00:00:00.000000000 Z
11
+ date: 2023-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: immutable-struct
@@ -295,6 +295,7 @@ files:
295
295
  - lib/ruby_npm/commands.rb
296
296
  - lib/ruby_npm/commands/base.rb
297
297
  - lib/ruby_npm/commands/install.rb
298
+ - lib/ruby_npm/commands/publish.rb
298
299
  - lib/ruby_npm/commands/run_script.rb
299
300
  - lib/ruby_npm/errors.rb
300
301
  - lib/ruby_npm/errors/execution_error.rb