Skip to content

Commit b80ae1f

Browse files
Upgrade minimal node support version to 14 (#1266)
OKTA-504784 Upgrade minimal Node supported version to 14
1 parent eb8f40f commit b80ae1f

File tree

14 files changed

+27
-20
lines changed

14 files changed

+27
-20
lines changed

.bacon.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test_suites:
1616
- name: unit
1717
script_path: ../okta-auth-js/scripts
1818
sort_order: '2'
19-
timeout: '10'
19+
timeout: '20'
2020
script_name: unit
2121
criteria: MERGE
2222
queue_name: small

.eslintrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ module.exports = {
118118
'devDependencies': false
119119
}],
120120
'node/no-unsupported-features/es-builtins': ['error', {
121-
// features that are not supported before v12 are transformed in babel.cjs.js for commonjs output
122-
version: '>=12.0.0'
121+
// features that are not supported before v14 are transformed in babel.cjs.js for commonjs output
122+
version: '>=14.0.0'
123123
}],
124124
'import/no-commonjs': 'error',
125125
"jsdoc/check-tag-names": 0

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: node_js
22

33
node_js:
4-
- '12'
4+
- '14'
55

66
install:
77
- yarn install --frozen-lockfile

babel.cjs.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
[
77
'@babel/preset-env', {
88
'targets': {
9-
'node': 11
9+
'node': true
1010
},
1111
'modules': 'commonjs'
1212
}
@@ -15,9 +15,7 @@ module.exports = {
1515
'@babel/plugin-transform-typescript',
1616
'@babel/plugin-proposal-class-properties',
1717
// https://babeljs.io/docs/en/babel-plugin-transform-runtime#corejs
18-
['@babel/plugin-transform-runtime', {
19-
corejs: 3
20-
}],
18+
'@babel/plugin-transform-runtime',
2119
['@babel/plugin-transform-modules-commonjs', {
2220
'strict': true,
2321
'noInterop': false

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,11 @@
146146
"not IE_Mob 11"
147147
],
148148
"engines": {
149-
"node": ">=11.0",
149+
"node": ">=14.0",
150150
"yarn": "^1.7.0"
151151
},
152152
"dependencies": {
153153
"@babel/runtime": "^7.12.5",
154-
"@babel/runtime-corejs3": "^7.17.0",
155154
"@peculiar/webcrypto": "^1.4.0",
156155
"Base64": "1.1.0",
157156
"atob": "^2.1.2",

samples/generated/express-embedded-auth-with-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "1.0.0",
55
"main": "index.js",
66
"engines": {
7-
"node": ">=10.0.0"
7+
"node": ">=14.0.0"
88
},
99
"scripts": {
1010
"start": "node ./web-server/server.js",

samples/generated/express-embedded-sign-in-widget/package.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/templates/express-embedded-sign-in-widget/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "1.0.0",
55
"main": "index.js",
66
"engines": {
7-
"node": ">=10.0.0"
7+
"node": ">=14.0.0"
88
},
99
"scripts": {
1010
"start": "SIW_VERSION=${SIW_VERSION-{{ siwVersion }}{{append '}'}} node ./web-server/server.js",

samples/test/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"test:features": "RUN_CUCUMBER_TESTS=1 node ./runner"
1414
},
1515
"engines": {
16-
"node": ">=11.0",
16+
"node": ">=14.0",
1717
"yarn": "^1.7.0"
1818
},
1919
"dependencies": {

samples/test/steps/when.ts

+3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ When(
8888

8989
When(
9090
'she inputs the correct code from her {string}',
91+
{
92+
timeout: 30000,
93+
},
9194
async function(this: ActionContext, type: string) {
9295
let code = '';
9396
if (type === 'SMS') {

samples/test/support/management-api/createCredentials.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default async function (
3030
return Object.assign({}, a18nProfile, {
3131
firstName,
3232
lastName: lastName || `Mc${firstName}face`,
33-
password: crypto.randomBytes(16).toString('base64'),
33+
password: crypto.randomBytes(16).toString('base64') + 'Aa1',
3434
username: a18nProfile.emailAddress,
3535
email: a18nProfile.emailAddress,
3636
});

scripts/setup.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export PATH="${PATH}:$(yarn global bin)"
1010

1111
# Install required node version
1212
export NVM_DIR="/root/.nvm"
13-
NODE_VERSION="${1:-v12.22.0}"
13+
NODE_VERSION="${1:-v14.18.0}"
1414
setup_service node $NODE_VERSION
1515
# Use the cacert bundled with centos as okta root CA is self-signed and cause issues downloading from yarn
1616
setup_service yarn 1.21.1 /etc/pki/tls/certs/ca-bundle.crt
@@ -35,6 +35,12 @@ if ! yarn install --frozen-lockfile --ignore-scripts; then
3535
exit ${FAILED_SETUP}
3636
fi
3737

38+
# microtime was not built due to `--ignore-scripts` flag, build it manually
39+
cd ./node_modules/microtime
40+
yum install -y python3
41+
yarn
42+
cd ../..
43+
3844
# Build
3945
if ! yarn build; then
4046
echo "build failed! Exiting..."

test/support/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"lint": "eslint ."
77
},
88
"engines": {
9-
"node": ">=10.3",
9+
"node": ">=14.0",
1010
"yarn": "^1.7.0"
1111
},
1212
"dependencies": {

test/types/authStateManager.test-d.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ const authClient = new OktaAuth({});
2525
(async () => {
2626
const authStateManager = authClient.authStateManager;
2727

28-
authStateManager.subscribe((authState: AuthState) => {});
29-
authStateManager.unsubscribe((authState: AuthState) => {});
28+
const handler = (authState: AuthState) => {};
29+
authStateManager.subscribe(handler);
30+
authStateManager.unsubscribe(handler);
3031
authStateManager.unsubscribe();
3132

32-
authStateManager.updateAuthState();
33+
await authStateManager.updateAuthState();
3334

3435
const authState = authStateManager.getAuthState()!;
3536
expectType<AuthState>(authState);

0 commit comments

Comments
 (0)