Skip to content

Commit

Permalink
INCOMPLETE: webcrypto detection isn't working due to nodejs/node#45987
Browse files Browse the repository at this point in the history
feat: use built-in webcrypto and update for latest Node
  • Loading branch information
brettz9 committed Jan 6, 2023
1 parent b8cf507 commit b94ff80
Show file tree
Hide file tree
Showing 7 changed files with 1,317 additions and 1,416 deletions.
5 changes: 1 addition & 4 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {rollup} from 'rollup';
import {babel} from '@rollup/plugin-babel';
import {nodeResolve} from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import {terser} from 'rollup-plugin-terser';
import terser from '@rollup/plugin-terser';

// fs.promises is not available until Node 11 (and need for URL until 10.0.0)

Expand All @@ -32,8 +32,6 @@ const ws = fs.createWriteStream('index.js');
ws.write(prologue);
const moduleStrings = {};

(async () => { // eslint-disable-line padded-blocks

try {
await mkdir('dist');
} catch (err) {
Expand Down Expand Up @@ -147,7 +145,6 @@ ws.on('finish', async () => {
]);
console.log('Finished build');
});
})();

/**
* @external RollupOutput
Expand Down
61 changes: 30 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"lint": "npm run eslint --",
"start": "static -p 8085",
"rollup": "node ./build.js",
"mocha": "mocha --delay --require chai/register-expect.js --require chai/register-assert.js test/test-node.js",
"mocha": "mocha --require chai/register-expect.js --require chai/register-assert.js test/test-node.js",
"open-coverage": "open-cli http://localhost:8085/coverage/ && npm start",
"coverage": "rm -Rf node_modules/.cache && c8 npm run mocha",
"test-nocov": "npm run rollup && npm run eslint && npm run coverage",
Expand Down Expand Up @@ -77,49 +77,48 @@
"node": "^14.17.0 || >=16.0.0"
},
"devDependencies": {
"@babel/core": "^7.17.10",
"@babel/eslint-parser": "^7.17.0",
"@babel/preset-env": "^7.17.10",
"@babel/core": "^7.20.12",
"@babel/eslint-parser": "^7.19.1",
"@babel/preset-env": "^7.20.2",
"@brettz9/eslint-plugin": "^1.0.4",
"@brettz9/node-static": "^0.1.1",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.2.1",
"c8": "^7.11.2",
"canvas": "^2.9.1",
"chai": "^4.3.6",
"eslint": "^8.14.0",
"eslint-config-ash-nazg": "^33.1.0",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.3.0",
"c8": "^7.12.0",
"canvas": "^2.11.0",
"chai": "^4.3.7",
"eslint": "^8.31.0",
"eslint-config-ash-nazg": "^34.6.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-array-func": "^3.1.7",
"eslint-plugin-array-func": "^3.1.8",
"eslint-plugin-chai-expect": "^3.0.0",
"eslint-plugin-chai-friendly": "^0.7.2",
"eslint-plugin-compat": "^4.0.2",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-html": "^6.2.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.2.9",
"eslint-plugin-markdown": "^2.2.1",
"eslint-plugin-n": "^15.2.0",
"eslint-plugin-no-unsanitized": "^4.0.1",
"eslint-plugin-jsdoc": "^39.6.4",
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-n": "^15.6.0",
"eslint-plugin-no-unsanitized": "^4.0.2",
"eslint-plugin-no-use-extend-native": "^0.5.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-sonarjs": "^0.13.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-sonarjs": "^0.17.0",
"eslint-plugin-standard": "^4.1.0",
"eslint-plugin-unicorn": "^42.0.0",
"jsdom": "^19.0.0",
"mocha": "^9.2.2",
"node-webcrypto-ossl": "^2.1.3",
"open-cli": "^7.0.1",
"rollup": "^2.71.1",
"rollup-plugin-terser": "^7.0.2",
"socket.io": "^4.5.0",
"socket.io-client": "^4.5.0"
"eslint-plugin-unicorn": "^45.0.2",
"jsdom": "^20.0.3",
"mocha": "^10.2.0",
"open-cli": "^7.1.0",
"rollup": "^3.9.1",
"socket.io": "^4.5.4",
"socket.io-client": "^4.5.4"
},
"dependencies": {
"base64-arraybuffer-es6": "^1.0.0",
"typeson": "^7.0.2",
"whatwg-url": "^11.0.0"
"typeson": "^8.0.1",
"whatwg-url": "^12.0.0"
},
"tonicExample": "var Typeson = require('typeson');\nvar TSON = new Typeson().register(require('typeson-registry/dist/presets/builtin'));\n\nTSON.stringify({foo: new Date()}, null, 2);"
}
Loading

0 comments on commit b94ff80

Please sign in to comment.