Skip to content

Commit

Permalink
Various packaging improvements aimed toward a better npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
noahgibbs committed Aug 10, 2024
1 parent b949f1e commit e976180
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/space_shoes/host/packaging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def build_packed_wasm_file(pack_root: ".", out_file:)
end

Dir.chdir(pack_root) do
# Delete any possible temp build files
["rubies", "build", "spacewalk.js", "ruby.wasm", "packed_ruby.wasm"].each do |build_file|
FileUtils.rm_rf build_file
end

# Use the packaging dir's Bundler setup, not what the outer program was run with
Bundler.with_unbundled_env do
FileUtils.rm out_file if File.exist?(out_file)
Expand Down
1 change: 1 addition & 0 deletions npm/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
packed_ruby.wasm
spacewalk.js
binaryen
2 changes: 1 addition & 1 deletion npm/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ set -e
# How do we want to install wasm-opt?

cp ../packaging/packed_ruby.wasm .
~/Desktop/binaryen-version_117/bin/wasm-opt packed_ruby.wasm -Os -o packed_ruby.wasm
~/Desktop/binaryen-version_118/bin/wasm-opt packed_ruby.wasm -Os -o packed_ruby.wasm
cp ../test/cache/spacewalk.js .
#npm publish --access public
2 changes: 1 addition & 1 deletion space_shoes.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
spec.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(File.expand_path(f) == __FILE__) ||
f.start_with?(*%w[bin/ test/ spec/ features/ .git appveyor Gemfile])
f.start_with?(*%w[bin/ test/ spec/ features/ .git npm/ appveyor Gemfile])
end
end
spec.bindir = "exe"
Expand Down

0 comments on commit e976180

Please sign in to comment.