PeculiarVentures / webcrypto-core

A input validation layer for WebCrypto polyfills.
MIT License
28 stars 13 forks source link

Can't compile it #2

Closed punkeel closed 7 years ago

punkeel commented 7 years ago

Compile the source code using the following command:

npm run build NOTE: Command creates webcrypto-core.js and webcrypto-core.min.js files in build folder

What if this doesn't happen?

root@8f4d4b4f2670:/webcrypto-core# ls
README.md  build  index.d.ts  index.js  node_modules  npm-debug.log  package.json  rollup.config.js  src  test  tsconfig.json  tslint.json
root@8f4d4b4f2670:/webcrypto-core# rm -rf build
root@8f4d4b4f2670:/webcrypto-core# npm run build
npm info it worked if it ends with ok
npm info using npm@3.8.9
npm info using node@v6.2.0
npm info lifecycle webcrypto-core@0.1.3~prebuild: webcrypto-core@0.1.3
npm info lifecycle webcrypto-core@0.1.3~build: webcrypto-core@0.1.3

> webcrypto-core@0.1.3 build /webcrypto-core
> tsc && rollup -c

npm info lifecycle webcrypto-core@0.1.3~postbuild: webcrypto-core@0.1.3
npm info ok
root@8f4d4b4f2670:/webcrypto-core# ls -lah build/
total 44K
drwxr-xr-x 7 root root  148 Dec 22 01:29 .
drwxr-xr-x 7 root root 4.0K Dec 22 01:29 ..
drwxr-xr-x 2 root root   22 Dec 22 01:29 aes
-rw-r--r-- 1 root root  363 Dec 22 01:29 alg.js
-rw-r--r-- 1 root root 6.4K Dec 22 01:29 base.js
-rw-r--r-- 1 root root 1.4K Dec 22 01:29 base64url.js
drwxr-xr-x 2 root root   22 Dec 22 01:29 ec
-rw-r--r-- 1 root root 3.3K Dec 22 01:29 error.js
drwxr-xr-x 2 root root   22 Dec 22 01:29 hmac
-rw-r--r-- 1 root root  402 Dec 22 01:29 index.js
drwxr-xr-x 2 root root   22 Dec 22 01:29 rsa
drwxr-xr-x 2 root root   22 Dec 22 01:29 sha
-rw-r--r-- 1 root root  15K Dec 22 01:29 subtle.js
root@8f4d4b4f2670:/webcrypto-core# ls -lah build/*
-rw-r--r-- 1 root root  363 Dec 22 01:29 build/alg.js
-rw-r--r-- 1 root root 6.4K Dec 22 01:29 build/base.js
-rw-r--r-- 1 root root 1.4K Dec 22 01:29 build/base64url.js
-rw-r--r-- 1 root root 3.3K Dec 22 01:29 build/error.js
-rw-r--r-- 1 root root  402 Dec 22 01:29 build/index.js
-rw-r--r-- 1 root root  15K Dec 22 01:29 build/subtle.js

build/aes:
total 8.0K
drwxr-xr-x 2 root root   22 Dec 22 01:29 .
drwxr-xr-x 7 root root  148 Dec 22 01:29 ..
-rw-r--r-- 1 root root 7.9K Dec 22 01:29 crypto.js

build/ec:
total 8.0K
drwxr-xr-x 2 root root   22 Dec 22 01:29 .
drwxr-xr-x 7 root root  148 Dec 22 01:29 ..
-rw-r--r-- 1 root root 6.9K Dec 22 01:29 crypto.js

build/hmac:
total 4.0K
drwxr-xr-x 2 root root   22 Dec 22 01:29 .
drwxr-xr-x 7 root root  148 Dec 22 01:29 ..
-rw-r--r-- 1 root root 3.5K Dec 22 01:29 crypto.js

build/rsa:
total 12K
drwxr-xr-x 2 root root   22 Dec 22 01:29 .
drwxr-xr-x 7 root root  148 Dec 22 01:29 ..
-rw-r--r-- 1 root root 9.4K Dec 22 01:29 crypto.js

build/sha:
total 4.0K
drwxr-xr-x 2 root root   22 Dec 22 01:29 .
drwxr-xr-x 7 root root  148 Dec 22 01:29 ..
-rw-r--r-- 1 root root 1.6K Dec 22 01:29 crypto.js

npm run minify fails, too:

npm info it worked if it ends with ok
npm info using npm@3.8.9
npm info using node@v6.2.0
npm ERR! Linux 4.2.5-xxxx-grs-ipv6-64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "minify"
npm ERR! node v6.2.0
npm ERR! npm  v3.8.9

npm ERR! missing script: minify
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /webcrypto-core/npm-debug.log
microshine commented 7 years ago

@PunKeel I can't repeat your error I removed build folder first

npm run build

image

I think you don't need to use rollup here. I made this build for other our project.

webcrypto-core is abstract module. It doesn't have any crypto functions. The base idea of this project is to check and prepare incoming data for crypto implementations with webcrypto interface.

microshine commented 7 years ago

I updated build script for rollup

punkeel commented 7 years ago

build failed because I couldn't find any "final.js" file, not because of an exception

minify (https://github.com/PeculiarVentures/webcrypto-core/blob/master/README.md#minify) threw an error, and I assume it still does: no script is defined for it

Thanks for the explanation, I got what I wanted (I assume?) by building the liner project, the minified final file being in index.js 👍 This issue might be closed if you want to

microshine commented 7 years ago

Thank you for your issuer. I'll fix it