Skip to content

Commit

Permalink
fix: Conditionally use legacy ssl for newer node versions and our old…
Browse files Browse the repository at this point in the history
…er webpack

Switch to dynamic ENV file for conditional env vars
Closes #76
  • Loading branch information
mitchcapper committed Aug 1, 2023
1 parent 8382e60 commit b71554a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 0 additions & 2 deletions automation/ts-node.env

This file was deleted.

7 changes: 7 additions & 0 deletions automation/ts-node.env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let env_vars = {
TS_NODE_PROJECT:'./automation/tsconfig.json',
TS_NODE_FILES:true
};
if (process.version.match(/^v(\d+)/)[1]>16)
env_vars['NODE_OPTIONS']='--openssl-legacy-provider';
module.exports = env_vars;
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"scripts": {
"prebuild": "rimraf dist/*",
"build": "run-script-os",
"build:default": "env-cmd -f ./automation/ts-node.env node --max_old_space_size=4096 node_modules/.bin/webpack --config ./automation/webpack.prod.ts",
"build:windows": "env-cmd -f ./automation/ts-node.env node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js --config ./automation/webpack.prod.ts",
"build:default": "env-cmd -f ./automation/ts-node.env.js node --max_old_space_size=4096 node_modules/.bin/webpack --config ./automation/webpack.prod.ts",
"build:windows": "env-cmd -f ./automation/ts-node.env.js node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js --config ./automation/webpack.prod.ts",
"bundle-stats": "npm-run-all bundle-stats:build bundle-stats:show",
"bundle-stats:build": "run-script-os",
"bundle-stats:build:default": "npm run build:default -- --no-devtool --profile --json | tail -n +14 > stats.json",
Expand All @@ -22,11 +22,11 @@
"server:start": "cross-env OCLIF_TS_NODE=0 node .httptoolkit-server/httptoolkit-server/bin/run start",
"start": "npm-run-all --parallel --print-label start:server start:web",
"start:server": "npm-run-all server:setup server:start",
"start:web": "env-cmd -f ./automation/ts-node.env webpack-dev-server --config ./automation/webpack.dev.ts",
"start:web": "env-cmd -f ./automation/ts-node.env.js webpack-dev-server --config ./automation/webpack.dev.ts",
"start:prod": "npm-run-all build start:prod:webserver",
"start:prod:webserver": "static-server ./dist -o",
"test": "npm-run-all test:unit test:integration",
"test:unit": "env-cmd -f ./automation/ts-node.env karma start ./test/unit/karma.conf.js",
"test:unit": "env-cmd -f ./automation/ts-node.env.js karma start ./test/unit/karma.conf.js",
"test:unit:dev": "npm run test:unit -- --single-run=false --auto-watch",
"test:unit:debug": "npm run test:unit -- --single-run=false --browsers Chrome",
"test:integration": "npm-run-all server:setup build test:integration:run",
Expand Down

0 comments on commit b71554a

Please sign in to comment.