Skip to content

Commit 6c0223b

Browse files
committed
fix: glue code was not being published to NPM
1 parent 1b49d13 commit 6c0223b

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

.npmignore

+2-11
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33
# Ignore everything,
44
/**/*
55

6-
# but include these folders
6+
# but include these.
77
!/assembly/**/*
8-
9-
# except for these files in the above folders.
10-
/src/**/*.spec.*
11-
/src/tests/**/*
12-
13-
# The following won't work as you think it would.
14-
# /**/*
15-
# !/build/**/*
16-
# !/src/**/*
17-
# /**/*.spec.*
8+
!/index.js

example/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const wasmModule = ASLoader.instantiateSync(
3838
imports,
3939
)
4040

41+
// Before doing anything, give the exports to ECMAssembly
4142
es.wasmExports = wasmModule.exports
4243

44+
// Now run anything (in this case, the example's tests/index.js file will call the exported functions).
4345
export default wasmModule.exports

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
"name": "ecmassembly",
33
"version": "0.1.1",
44
"type": "module",
5+
"home": "",
56
"scripts": {
67
"start": "npm run dev",
78
"build": "npm run asbuild",
89
"dev": "npm run asbuild:untouched && npm test && echo TODO: watch mode",
910
"asbuild:untouched": "asc assembly/index.ts --target debug --exportTable --exportRuntime",
1011
"asbuild:optimized": "asc assembly/index.ts --target release --exportTable --exportRuntime",
1112
"asbuild": "npm run asbuild:untouched && npm run asbuild:optimized",
12-
"test": "cd example && npm start"
13+
"test": "cd example && npm start",
14+
"release:patch": "npm version patch -m 'v%s' && npm publish && git push --follow-tags",
15+
"release:minor": "npm version minor -m 'v%s' && npm publish && git push --follow-tags",
16+
"release:major": "npm version major -m 'v%s' && npm publish && git push --follow-tags"
1317
},
1418
"dependencies": {
1519
"@assemblyscript/loader": "^0.18.11"

0 commit comments

Comments
 (0)