Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bundled version in node (breaking changes) #78

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
run: npm ci
- name: Build
run: source emsdk/emsdk_env.sh && ./build.sh
- name: Bundle
run: npm run build
- name: Test
run: npm test
- name: Bundle
run: npm run build-bundle
- name: Package
run: npm pack
- name: Publish to npm
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ npm install argon2-browser

Then add this script to your HTML or use your favorite bundler:
```html
<script src="node_modules/argon2-browser/lib/argon2.js"></script>
<script src="node_modules/argon2-browser/dist/argon2.min.js"></script>
```

Alternatively, you can use the bundled version, this way you can include just one script:
```html
<script src="node_modules/argon2-browser/dist/argon2-bundled.js"></script>
<script src="node_modules/argon2-browser/dist/argon2-bundled.min.js"></script>
```

Calculate the hash:
Expand Down
5 changes: 0 additions & 5 deletions build-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ cmake --build .

shasum dist/argon2.js
shasum dist/argon2.wasm

perl -pi -e 's/"argon2.js.mem"/null/g' dist/argon2.js
perl -pi -e 's/$/if(typeof module!=="undefined")module.exports=Module;Module.unloadRuntime=function(){if(typeof self!=="undefined"){delete self.Module}Module=jsModule=wasmMemory=wasmTable=asm=buffer=HEAP8=HEAPU8=HEAP16=HEAPU16=HEAP32=HEAPU32=HEAPF32=HEAPF64=undefined;if(typeof module!=="undefined"){delete module.exports}};/' dist/argon2.js
perl -pi -e 's/typeof Module!=="undefined"\?Module:\{};/typeof self!=="undefined"&&typeof self.Module!=="undefined"?self.Module:{};var jsModule=Module;/g' dist/argon2.js
perl -pi -e 's/receiveInstantiatedSource\(output\)\{/receiveInstantiatedSource(output){Module=jsModule;if(typeof self!=="undefined")self.Module=Module;/g' dist/argon2.js
2 changes: 1 addition & 1 deletion examples/vanilla/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>Argon2 Browser VanillaJS Demo</title>
<script src="node_modules/argon2-browser/lib/argon2.js"></script>
<script src="node_modules/argon2-browser/dist/argon2.min.js"></script>
</head>
<body>
<h1>Argon2-Browser WebPack Demo</h1>
Expand Down
Loading