nickthecook / archyve

GNU Affero General Public License v3.0
79 stars 10 forks source link

Fix the problem with pinned JS imports missing at runtime #56

Closed oxaroky02 closed 1 month ago

oxaroky02 commented 1 month ago

Turns out importmap pin ... creates files that go into vendor/javascript. Our previous .gitignore was too greedy and ignored the entire vendor/ folder. (It's entirely we might be able to trace this a PR from me a long time ago. 😊 )

$ bundle exec bin/importmap pin @stimulus-components/clipboard
Pinning "@stimulus-components/clipboard" to vendor/javascript/@stimulus-components/clipboard.js via download from https://ga.jspm.io/npm:@stimulus-components/clipboard@5.0.0/dist/stimulus-clipboard.mjs
Pinning "@hotwired/stimulus" to vendor/javascript/@hotwired/stimulus.js via download from https://ga.jspm.io/npm:@hotwired/stimulus@3.2.2/dist/stimulus.js
$ cd ..
$ diff -rq archyve-fork-clean archyve-fork-clean-pre-imppin
Files archyve-fork-clean/.git/index and archyve-fork-clean-pre-imppin/.git/index differ
Only in archyve-fork-clean/tmp/cache/bootsnap/compile-cache-iseq/04: 34731153506424
Only in archyve-fork-clean/tmp/cache/bootsnap/compile-cache-iseq/44: bfb34fc801b0d3
Only in archyve-fork-clean/tmp/cache/bootsnap/compile-cache-iseq/b2: eb6ac68a0f8df3
Only in archyve-fork-clean/vendor/javascript: @hotwired--stimulus.js
Only in archyve-fork-clean/vendor/javascript: @stimulus-components--clipboard.js
oxaroky02 commented 1 month ago

Hold on ... I think this is the wrong fix.

The files in vendor/javascript are copies of files from the dependencies, which means they could become stale if we put them in the repo and the upstream modules get updates.