capistrano-nvm202x 4.0.0 → 4.1.0

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: e3c3ed95eafa76cbfd9bb7dffed225276e3e95cb5e502537965a6f342a8a16b4
4
- data.tar.gz: f7b3aebe4693e61a3c689f1f655d0b0a5403ea2c432664d72a28b6f8bc75374a
3
+ metadata.gz: 84158a441413724df3dc93474fb27a94e2a0b32a7782bffae0a74c1bfbe89e15
4
+ data.tar.gz: b46532d84ee584283fe2df10768c76fa9b065ce62fb9093519dfbc43aace422f
5
5
  SHA512:
6
- metadata.gz: 4fe0dabcf9519a0bfe83586240c4e832c7e4e8543d9b3326090ec4a3194bb25d997837f3af38347341ef98ee95a056708476dfea2bd4ba7a8c40714f0b7b190b
7
- data.tar.gz: 4ae1918e16334996187579a323fc33847539544e5e40268aaabd3608e66cf9f41496424f08e60d16571c3b5e25e5d4c8ab0a3a55312c05010add25282f620533
6
+ metadata.gz: 8e24c5915a67051525f901a2fa5fe76aafd3bafa0f69b29f05efa69a25b88207ab192e479cc9ea09c60fece8afdf7307bf7fab87f31ae052483a655209e73787
7
+ data.tar.gz: ece00c18118a48c98a1f6693b40046d4f122d2a6988534cb59dcc4c85e64325ba71c02df6d9ecf450812706acfdf7783858b621f2fb1176f9b7862a4350ec66f
data/README.md CHANGED
@@ -6,12 +6,8 @@ This gem provides idiomatic nvm (Node Version Manager) support for Capistrano 3.
6
6
 
7
7
  **NOTE:** this gem is different from [capistrano-nvm](https://github.com/koenpunt/capistrano-nvm). Not sure why, but `capistrano-nvm` doesn't play with `capistrano-rbenv` which was the reason to create `capistrano-nvm202x`.
8
8
 
9
- Current limitation: should be required after rbenv or after anything that adds environment variables.
10
-
11
9
  And also thanks a lot to [capistrano-rbenv](https://github.com/capistrano/rbenv) for the code this repo originates from.
12
10
 
13
- Note: Node version is not set explicitly as an environment variable, but the existence of version is checked. Otherwise it depends on NVM picking up the correct version. Please use `.rvmrc` to specify version. Options need testing.
14
-
15
11
  -----------------------------------
16
12
 
17
13
  (By original maintainer) Thanks a lot to [@yyuu](https://github.com/yyuu) for merging his gem with official one.
@@ -22,7 +18,6 @@ Add this line to your application's Gemfile:
22
18
 
23
19
  ~~~ruby
24
20
  gem 'capistrano', '~> 3.19', require: false
25
- gem 'capistrano-rbenv', require: false
26
21
  gem 'capistrano-nvm202x', require: false
27
22
  ~~~
28
23
 
@@ -33,13 +28,11 @@ And then execute:
33
28
  ## Usage
34
29
 
35
30
  # Capfile
36
- require "capistrano/rbenv"
37
- require "capistrano/nvm" # after rbenv
38
-
31
+ require "capistrano/nvm"
39
32
 
40
33
  # config/deploy.rb
41
34
  set :nvm_type, :user # or :system, depends on your nvm setup
42
- set :nvm_node, 'v20.17.0'
35
+ set :nvm_node, 'v23.1.0'
43
36
 
44
37
  # in case you want to set nvm version from the file:
45
38
  # set :nvm_node, File.read('.nvmrc').strip
@@ -47,18 +40,14 @@ And then execute:
47
40
  # optional configuration
48
41
  set :nvm_custom_path, '$HOME/.nvm' # sets custom `nvm_path`
49
42
  set :nvm_roles, :all
50
- set :nvm_prefix, "source #{fetch(:nvm_path)}/nvm.sh; " # set default command prefix
51
- set :nvm_map_bins, %w{rake gem bundle yarn rails} # commands for which prefix is added
52
-
53
-
54
- If your nvm is located in some custom path, you can use `nvm_custom_path` to set it.
43
+ set :nvm_map_bins, %w{corepack node npm npx yarn yarnpkg} # commands for which prefix is added
55
44
 
56
45
  ### Defining the node version
57
46
 
58
47
  To set the Node version explicitly, add `:nvm_node` to your Capistrano configuration:
59
48
 
60
49
  # config/deploy.rb
61
- set :nvm_node, 'v20.17.0'
50
+ set :nvm_node, 'v23.1.0'
62
51
 
63
52
  Alternatively, allow the remote host's `nvm` to determine the appropriate Node version](https://github.com/nvm-sh/nvm#usage) by omitting `:nvm_node`. This approach is useful if you have a `.nvmrc` file in your project.
64
53
 
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "capistrano-nvm202x"
7
- gem.version = '4.0.0'
7
+ gem.version = '4.1.0'
8
8
  gem.authors = ["Ivan Stana"]
9
9
  gem.email = ["^_^@myrtana.sk"]
10
10
  gem.description = %q{nvm integration for Capistrano}
@@ -15,12 +15,18 @@ namespace :nvm do
15
15
  end
16
16
 
17
17
  task :map_bins do
18
- SSHKit.config.default_env.merge!({ nvm_root: fetch(:nvm_path), node_version: fetch(:nvm_node) })
19
- nvm_prefix = fetch(:nvm_prefix, proc { "source #{fetch(:nvm_path)}/nvm.sh; " })
20
- SSHKit.config.command_map[:nvm] = "#{fetch(:nvm_path)}/nvm.sh"
18
+ nvm_binaries_path = "#{fetch(:nvm_node_dir)}/bin/"
21
19
 
20
+ SSHKit.config.default_env.merge!({
21
+ nvm_root: fetch(:nvm_path),
22
+ node_version: fetch(:nvm_node),
23
+ path: "#{nvm_binaries_path}:$PATH",
24
+ })
25
+
26
+ # cssbundling or anything calling yarn directly won't trigger this
27
+ # only running yarn via sshkit
22
28
  fetch(:nvm_map_bins).uniq.each do |command|
23
- SSHKit.config.command_map.prefix[command.to_sym].unshift(nvm_prefix)
29
+ SSHKit.config.command_map[command.to_sym] = "#{nvm_binaries_path}/#{command}"
24
30
  end
25
31
  end
26
32
  end
@@ -45,6 +51,6 @@ namespace :load do
45
51
  set :nvm_roles, fetch(:nvm_roles, :all)
46
52
 
47
53
  set :nvm_node_dir, -> { "#{fetch(:nvm_path)}/versions/node/#{fetch(:nvm_node)}" }
48
- set :nvm_map_bins, %w{rake gem bundle yarn rails}
54
+ set :nvm_map_bins, %w{corepack node npm npx yarn yarnpkg}
49
55
  end
50
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-nvm202x
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Stana
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-16 00:00:00.000000000 Z
11
+ date: 2024-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
- rubygems_version: 3.5.11
96
+ rubygems_version: 3.5.16
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: nvm integration for Capistrano