ruby_npm 0.1.0.pre.2 → 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: e2bfe773251ad6e3ecc36c59141e678453a331374495e5b66e6f8bf12c95e7ce
4
- data.tar.gz: 03d9787e1482c0ee0fc340d0afde445b9c85477a7db2797b08803359d0ccf35f
3
+ metadata.gz: e75c704c75f98d8bd697d81b26fb18734acaecf0354500cb2fa30343d8a29ea6
4
+ data.tar.gz: 2225b03171613b5bc7fa239bcc4b4c6dc78bfe6591de856024d7846464c52022
5
5
  SHA512:
6
- metadata.gz: c9321625dc5612716ee0c2e24058dfd2ef650e9ceb146937d7e861f13a02b1bb3f694dc8de201734db430ecb682b21ebdec62b6d300fee3fdb3bb9fa84f1b8a2
7
- data.tar.gz: c047104cd3bc039ad9bb6887480d8038c204733ce6f115801f8e4c6adcee32654898b9862d0d6f667907bcf033e6cf3e1161bbc82951cd84973535d2ba881047
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.2)
4
+ ruby_npm (0.1.0.pre.4)
5
5
  immutable-struct (~> 2.4)
6
6
  lino (~> 3.0)
7
7
 
@@ -59,12 +59,12 @@ GEM
59
59
  rb-inotify (~> 0.9, >= 0.9.10)
60
60
  lumberjack (1.2.8)
61
61
  method_source (1.0.0)
62
- minitest (5.16.3)
62
+ minitest (5.17.0)
63
63
  nenv (0.3.0)
64
64
  notiffany (0.1.3)
65
65
  nenv (~> 0.1)
66
66
  shellany (~> 0.0)
67
- octokit (4.25.1)
67
+ octokit (6.0.1)
68
68
  faraday (>= 1, < 3)
69
69
  sawyer (~> 0.9)
70
70
  open4 (1.3.4)
@@ -85,15 +85,15 @@ GEM
85
85
  rake_factory (0.31.0)
86
86
  activesupport (>= 4)
87
87
  rake (~> 13.0)
88
- rake_github (0.9.0)
88
+ rake_github (0.11.0)
89
89
  colored2 (~> 3.1)
90
- octokit (~> 4.16)
90
+ octokit (>= 4.16, < 7.0)
91
91
  rake_factory (~> 0.23)
92
92
  sshkey (~> 2.0)
93
- rake_gpg (0.16.0)
94
- rake_factory (>= 0.23, < 1)
95
- ruby_gpg2 (>= 0.6, < 1)
96
- rake_ssh (0.6.0)
93
+ rake_gpg (0.18.0)
94
+ rake_factory (~> 0.23)
95
+ ruby_gpg2 (~> 0.6)
96
+ rake_ssh (0.8.0)
97
97
  colored2 (~> 3.1)
98
98
  rake_factory (~> 0.23)
99
99
  sshkey (~> 2.0)
@@ -115,17 +115,17 @@ GEM
115
115
  diff-lcs (>= 1.2.0, < 2.0)
116
116
  rspec-support (~> 3.12.0)
117
117
  rspec-support (3.12.0)
118
- rubocop (1.41.1)
118
+ rubocop (1.42.0)
119
119
  json (~> 2.3)
120
120
  parallel (~> 1.10)
121
121
  parser (>= 3.1.2.1)
122
122
  rainbow (>= 2.2.2, < 4.0)
123
123
  regexp_parser (>= 1.8, < 3.0)
124
124
  rexml (>= 3.2.5, < 4.0)
125
- rubocop-ast (>= 1.23.0, < 2.0)
125
+ rubocop-ast (>= 1.24.1, < 2.0)
126
126
  ruby-progressbar (~> 1.7)
127
127
  unicode-display_width (>= 1.4.0, < 3.0)
128
- rubocop-ast (1.24.0)
128
+ rubocop-ast (1.24.1)
129
129
  parser (>= 3.1.1.0)
130
130
  rubocop-rake (0.6.0)
131
131
  rubocop (~> 1.0)
@@ -182,4 +182,4 @@ DEPENDENCIES
182
182
  yard
183
183
 
184
184
  BUNDLED WITH
185
- 2.4.1
185
+ 2.4.2
@@ -74,7 +74,7 @@ module RubyNPM
74
74
  .for_command(@binary)
75
75
  .with_environment_variables(environment)
76
76
  .with_options_after_subcommands
77
- .with_option_separator('=')
77
+ .with_option_separator(' ')
78
78
  .with_appliables(@options.resolve(options, parameters))
79
79
  .with_subcommands(subcommands)
80
80
  .with_arguments(arguments(parameters).compact.flatten).build
@@ -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
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base'
4
+
5
+ module RubyNPM
6
+ module Commands
7
+ class RunScript < Base
8
+ # @!visibility private
9
+ def subcommands
10
+ %w[run-script]
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
+ --if-present
21
+ --json
22
+ --parseable
23
+ ]
24
+ end
25
+
26
+ def arguments(parameters)
27
+ script_arguments =
28
+ parameters[:arguments] ? ['--'] + parameters[:arguments] : []
29
+
30
+ [parameters[:script]] + script_arguments
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'commands/install'
4
+ require_relative 'commands/publish'
5
+ require_relative 'commands/run_script'
4
6
 
5
7
  module RubyNPM
6
8
  module Commands
@@ -1,39 +1,31 @@
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
- ],
10
-
11
- # string repeatable options
12
- {
13
- omit: '--omit',
14
- include: '--include'
15
- }.map do |key, name|
16
- definition(
17
- name: name, option_type: :standard, value_type: :string,
18
- repeatable: true, separator: ' ',
19
- override_keys: { singular: false, plural: key }
20
- )
21
- end,
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
22
19
 
20
+ LOGGING_DEFINITIONS = [
23
21
  # string options
24
22
  %w[
25
- --color
26
- --install-strategy
27
23
  --loglevel
28
24
  --logs-dir
29
25
  --logs-max
30
- --script-shell
31
- --tag
32
- --workspace
33
26
  ].map do |o|
34
27
  definition(
35
- name: o, option_type: :standard, value_type: :string,
36
- separator: ' '
28
+ name: o, option_type: :standard, value_type: :string
37
29
  )
38
30
  end,
39
31
 
@@ -44,25 +36,48 @@ module RubyNPM
44
36
  --verbose
45
37
  ].map do |o|
46
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
+ )
47
51
  end,
48
52
 
49
53
  # boolean options
50
54
  %w[
51
- --audit
52
- --bin-links
53
55
  --dry-run
54
56
  --force
55
57
  --foreground-scripts
56
- --fund
57
- --global
58
- --global-style
59
58
  --ignore-scripts
60
- --include-workspace-root
61
- --install-links
62
- --legacy-bundling
63
- --package-lock
64
- --package-lock-only
65
- --production
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 = [
67
+ # string repeatable options
68
+ {
69
+ omit: '--omit',
70
+ include: '--include'
71
+ }.map do |key, name|
72
+ definition(
73
+ name: name, option_type: :standard, value_type: :string,
74
+ repeatable: true,
75
+ override_keys: { singular: false, plural: key }
76
+ )
77
+ end,
78
+
79
+ # boolean options
80
+ %w[
66
81
  --save
67
82
  --save-bundle
68
83
  --save-dev
@@ -70,13 +85,66 @@ module RubyNPM
70
85
  --save-optional
71
86
  --save-peer
72
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 = [
107
+ # string options
108
+ %w[
109
+ --access
110
+ --install-strategy
111
+ --otp
112
+ --tag
113
+ ].map do |o|
114
+ definition(
115
+ name: o, option_type: :standard, value_type: :string
116
+ )
117
+ end,
118
+
119
+ # boolean options
120
+ %w[
121
+ --audit
122
+ --bin-links
123
+ --fund
124
+ --global
125
+ --global-style
126
+ --if-present
127
+ --install-links
128
+ --legacy-bundling
129
+ --package-lock
130
+ --package-lock-only
131
+ --parseable
73
132
  --strict-peer-deps
74
133
  ].map do |o|
75
134
  definition(
76
- name: o, option_type: :standard, value_type: :boolean,
77
- separator: ' '
135
+ name: o, option_type: :standard, value_type: :boolean
78
136
  )
79
137
  end
80
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
+ )
81
148
  end
149
+ # rubocop:enable Metrics/ModuleLength
82
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.2'
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.2
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,8 @@ 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
299
+ - lib/ruby_npm/commands/run_script.rb
298
300
  - lib/ruby_npm/errors.rb
299
301
  - lib/ruby_npm/errors/execution_error.rb
300
302
  - lib/ruby_npm/options.rb