rails_node_module_linker 0.2.0 → 0.2.1

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: a715e5efda2b9c74f8b0148969279ef882137cfbd2099e4c4f8dbab139ad703c
4
- data.tar.gz: ec17edf684bc7ee2e471f46cc09c4c14aa1872de15b5ab2eccc69e1ef0a4f41f
3
+ metadata.gz: 2fe4a363af81d398260fe1d33b9863884214d19af9f7570066c5f706ce59e3a2
4
+ data.tar.gz: 2fac7fc22667dd1086250b857561cc3446de5f25cec376f98f1c7a3d12726c4a
5
5
  SHA512:
6
- metadata.gz: 35db5fd4280b252f45f8e0e2556d2b0fc37667d9430aec7566a7a42e4b80b6f01bef25f191eb32f3dfd69be30f9a17969919b0f3cf253d6f187882c9afca0015
7
- data.tar.gz: a6553ee7db4b1fc3adc47c88936eb2e89ee00a0787b07598c814407a24c9ad578de120cd15a9458634d46782b9b98691e7835618f4b805a654bb38b1c77baa98
6
+ metadata.gz: 622bbedc8438d3a3d959a230e2aeb2933ab7ecf748e2bfa9423c1a107e4e43547528eac7a722a17e4af24439c6d374c4031eaafba881d17b9294635de7cd634f
7
+ data.tar.gz: 5ce4f0a8983b967d9c65f9bddad406662c41a3d3d921580161db8d309adf4868b5e2ea14f5e1159e67cf75fe25186224f13b43173f23c456bf19543b0dcaf995
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.3.8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.1] - 2025-08-21
4
+
5
+ - Adds force_link setting
6
+ - Fixes linking bug of broken symlink
7
+ - Improves emoji selection in console output
8
+ - Adds ruby Version file
9
+
3
10
  ## [0.2.0] - 2025-05-17
4
11
 
5
12
  - Adds ability to change the `destination_path`
data/README.md CHANGED
@@ -24,6 +24,7 @@ gem install rails_node_module_linker
24
24
  Rails.application.config.to_prepare do
25
25
  RailsNodeModuleLinker.config.symlinked_node_modules_config = 'config/symlinked_node_modules.yml'
26
26
  RailsNodeModuleLinker.config.destination_path = 'public/node_modules'
27
+ RailsNodeModuleLinker.config.force_link = false
27
28
  RailsNodeModuleLinker.config.use_emojis = true
28
29
  end
29
30
  ```
@@ -58,7 +59,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
58
59
 
59
60
  ## Contributing
60
61
 
61
- Bug reports and pull requests are welcome on GitHub [here](https://github.com/anthony0030/rails_node_module_linker). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/anthony0030/rails_node_module_linker/blob/master/CODE_OF_CONDUCT.md).
62
+ Bug reports and pull requests are welcome on [GitHub](https://github.com/anthony0030/rails_node_module_linker). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/anthony0030/rails_node_module_linker/blob/master/CODE_OF_CONDUCT.md).
62
63
 
63
64
  ## License
64
65
 
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RailsNodeModuleLinker::Config
4
- attr_accessor :symlinked_node_modules_config, :destination_path, :use_emojis
4
+ attr_accessor :symlinked_node_modules_config, :destination_path, :force_link, :use_emojis
5
5
 
6
6
  def initialize
7
7
  # * Default configuration values
8
8
  @symlinked_node_modules_config = 'config/symlinked_node_modules.yml'
9
9
  @destination_path = 'public/node_modules'
10
+ @force_link = false
10
11
  @use_emojis = true
11
12
 
12
13
  # TODO: make source folder customizable
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsNodeModuleLinker
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
@@ -53,8 +53,9 @@ namespace :rails_node_module_linker do
53
53
  node_modules_to_link.each do |package|
54
54
  source = Rails.root.join('node_modules', package)
55
55
  destination = node_modules_destination_path.join(package)
56
+ force_link = RailsNodeModuleLinker.config.force_link
56
57
 
57
- unless source.exist?
58
+ if !source.exist? && !force_link && !destination.symlink?
58
59
  log_with_emoji("🚫 Source does not exist: #{source} (skipping)")
59
60
 
60
61
  next
@@ -64,10 +65,11 @@ namespace :rails_node_module_linker do
64
65
  if File.exist?(destination.readlink)
65
66
  log_with_emoji("✅ Already linked: #{destination}")
66
67
  next
67
- else
68
- log_with_emoji(" Broken symlink detected: #{destination} (removing)")
68
+ elsif !force_link
69
+ log_with_emoji("⛓️‍💥 Broken symlink detected: #{destination} (removing)")
69
70
 
70
71
  FileUtils.rm(destination)
72
+ next
71
73
  end
72
74
  elsif destination.exist?
73
75
  log_with_emoji("❌ Destination exists but is not a symlink: #{destination} (skipping)")
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_node_module_linker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Veaudry
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-08-21 00:00:00.000000000 Z
11
12
  dependencies: []
12
13
  description: Exposees wanted node_modules to the public directory for Rails apps that
13
14
  have transitioned from Sprockets to Propshaft.
@@ -19,6 +20,7 @@ extra_rdoc_files: []
19
20
  files:
20
21
  - ".rspec"
21
22
  - ".rubocop.yml"
23
+ - ".ruby-version"
22
24
  - ".vscode/settings.json"
23
25
  - CHANGELOG.md
24
26
  - CODE_OF_CONDUCT.md
@@ -39,6 +41,7 @@ metadata:
39
41
  source_code_uri: https://github.com/anthony0030/rails_node_module_linker
40
42
  changelog_uri: https://github.com/anthony0030/rails_node_module_linker/blob/main/CHANGELOG.md
41
43
  rubygems_mfa_required: 'true'
44
+ post_install_message:
42
45
  rdoc_options: []
43
46
  require_paths:
44
47
  - lib
@@ -53,7 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
56
  - !ruby/object:Gem::Version
54
57
  version: '0'
55
58
  requirements: []
56
- rubygems_version: 3.6.8
59
+ rubygems_version: 3.5.22
60
+ signing_key:
57
61
  specification_version: 4
58
62
  summary: Link node modules into the public folder of a Rails app using Propshaft
59
63
  test_files: []