npm_ext 0.1.0 → 0.1.2

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: e5702f247f1016652758c2e9bb04d04facde9fab3059825f0762d6b7dbd3cea0
4
- data.tar.gz: 1fe3355f069f3d85c70a966767eb35f151505b84b1dfd71d1f8257e3636f35cb
3
+ metadata.gz: 6b22aef9431b51fb055fc039ce7345a71679c247da3c1d01308696ce08dc32a0
4
+ data.tar.gz: c3932eb4ecca826574d7e1f2d123ff2d033f7538fe2227276e26a76d6f4d4cd2
5
5
  SHA512:
6
- metadata.gz: a7f89d25ba4c1d9a935ec6fa17ff4fd07fc5c7743d6738dd3b50b50177cae898cb244f1c759a81bc326b4ee80841940ed255a5565392b73b7fe1f441411935b3
7
- data.tar.gz: 618a0569dbc858ad42d8887443e642ee7f80cbe340b674ca1ff22f1071ab86add46fd8c65f719ebae7dd5e798c0af25a90eaeb887cecd73c813510ad4dc86c68
6
+ metadata.gz: fe7bd61bf6eeeb0c8e0a4980ad779e51ab8d116249547b4dfb8b97089670520e078f205d6f741edc4fd7a04ff6067276b1680d77a28ba6ad6a0832d1f80b94eb
7
+ data.tar.gz: 2026f7eebc502e2aa4f320523a34fa2911e45a01e9a10e1a0a52f599dc954648d2ef111338694176b66f5f20e5aa77bc6df0237aa974c19951d1210072754d1d
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ npm_ext-0.1.0.gem
data/lib/npm_ext/mkmf.rb CHANGED
@@ -43,13 +43,14 @@ module NpmExt
43
43
 
44
44
  def create_rollup_config(dir)
45
45
  parse_package_json(dir).map do |package|
46
- configs = "rollup.config.#{Digest::MD5.hexdigest(package.name.to_s)}.js"
46
+ hash = Digest::MD5.hexdigest(package.name.to_s)
47
+ configs = "rollup.config.#{hash}.js"
47
48
  File.write(configs, "module.exports = #{JSON.generate(
48
49
  {
49
50
  # TODO: if no file provided get the input file from package.json
50
51
  input: "node_modules/#{package.name}/#{package.file_to_bundle}",
51
52
  output: {
52
- file: "#{package.name}.npm_ext.js",
53
+ file: "#{hash}.npm_ext.so",
53
54
  name: package.name,
54
55
  format: "iife",
55
56
  },
@@ -66,12 +67,13 @@ module NpmExt
66
67
  configs = create_rollup_config(dir)
67
68
  File.write("Makefile", <<~MAKE)
68
69
  install:
69
- \tcp #{dir}/package*.json ./
70
+ \tcp #{dir}/package*.json ./ || :
70
71
  \tnpm ci
71
72
  \tnpm i #{ROLLUP_PACKAGES.join(" ")}
72
73
  #{configs.map { |x| "\tnpx rollup --config #{x}" }.join("\n")}
73
- \tcat *.npm_ext.js > npm_ext.so
74
- \tcp *.npm_ext.js ../../../../lib/
74
+ cleanup:
75
+ \trm -rf node_modules
76
+ \trm -rf rollup.config.*.js
75
77
  MAKE
76
78
  end
77
79
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NpmExt
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/npm_ext.gemspec CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.version = NpmExt::VERSION
8
8
  spec.authors = ["Alexandra Østermark"]
9
9
  spec.email = ["alex.cramt@gmail.com"]
10
+ spec.license = "MIT"
10
11
 
11
12
  spec.summary = ""
12
13
  spec.description = ""
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: npm_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandra Østermark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-25 00:00:00.000000000 Z
11
+ date: 2024-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_racer
@@ -42,7 +42,8 @@ files:
42
42
  - npm_ext.gemspec
43
43
  - sig/npm_ext.rbs
44
44
  homepage: https://github.com/cramt/npm_ext
45
- licenses: []
45
+ licenses:
46
+ - MIT
46
47
  metadata:
47
48
  homepage_uri: https://github.com/cramt/npm_ext
48
49
  source_code_uri: https://github.com/cramt/npm_ext