Skip to content

Commit 75260a1

Browse files
author
Inwon Kim
committed
Upgrade node version
1 parent b93d8ed commit 75260a1

File tree

10 files changed

+589
-1081
lines changed

10 files changed

+589
-1081
lines changed

.github/workflows/lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v1
12-
- name: install node v16
12+
- name: install node v18
1313
uses: actions/setup-node@v1
1414
with:
15-
node-version: 16
15+
node-version: 18
1616
- name: yarn install
1717
run: yarn install
1818
- name: eslint
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
strategy:
2626
matrix:
27-
node-version: [16.x]
27+
node-version: [18.x]
2828
steps:
2929
- name: Checkout
3030
uses: actions/checkout@v2

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-node@v3
1717
with:
18-
node-version: 16
18+
node-version: 18
1919
registry-url: https://registry.npmjs.org/
2020
- uses: borales/actions-yarn@v3.0.0
2121
with:

lib/module/browser.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
import crypto from "./crypto";
22

3-
const XMLHttpRequest = globalThis.XMLHttpRequest;
4-
5-
export { crypto, XMLHttpRequest };
3+
export { crypto };

lib/module/node.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
const crypto = require("crypto");
2-
const XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
32

4-
export { crypto, XMLHttpRequest };
3+
export { crypto };

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"url": "https://github.com/icon-project/icon-sdk-js/"
2727
},
2828
"engines": {
29-
"node": ">=16.0.0",
29+
"node": ">=18.0.0",
3030
"yarn": "^1.22.10"
3131
},
3232
"keywords": [
@@ -78,20 +78,20 @@
7878
"mocha": "^8.3.2",
7979
"prettier": "^2.2.1",
8080
"typescript": "^4.2.4",
81-
"uglifyjs-webpack-plugin": "^2.2.0",
82-
"webpack": "^4.12.2",
83-
"webpack-cli": "^3.0.8",
81+
"webpack": "^5.74.0",
82+
"webpack-cli": "^4.10.0",
8483
"yargs": "^16.2.0"
8584
},
8685
"dependencies": {
8786
"bignumber.js": "^7.2.1",
8887
"bip66": "^1.1.5",
88+
"buffer": "^6.0.3",
89+
"crypto-browserify": "^3.12.0",
8990
"js-sha3": "^0.8.0",
90-
"node-fetch": "^3.2.10",
91+
"readable-stream": "^4.2.0",
9192
"secp256k1": "3.5.2",
9293
"utf8": "^3.0.0",
93-
"uuid": "^3.3.2",
94-
"xmlhttprequest": "^1.8.0"
94+
"uuid": "^3.3.2"
9595
},
9696
"browser": "./build/icon-sdk-js.web.min.js"
9797
}

quickstart/conf/webpack.dev.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@ module.exports = Merge(CommonConfig, {
99
new webpack.HotModuleReplacementPlugin(),
1010
],
1111
devServer: {
12-
publicPath: '/',
1312
port: 3000,
14-
contentBase: path.join(process.cwd(), 'dist'),
1513
host: '0.0.0.0',
1614
historyApiFallback: true,
17-
noInfo: false,
18-
stats: 'minimal',
1915
hot: true,
20-
}
21-
});
16+
},
17+
mode: "development"
18+
});

quickstart/mockData/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const PRIVATE_KEY_2 =
77
const TOKEN_ADDRESS = "cx4ae65c058d35b5bb8cef668be5113354448c0264";
88
const GOVERNANCE_ADDRESS = "cx0000000000000000000000000000000000000001";
99
const SCORE_INSTALL_ADDRESS = "cx0000000000000000000000000000000000000000";
10-
const NODE_URL = "https://test-ctz.solidwallet.io/api/v3";
11-
const DEBUG_URL = "https://test-ctz.solidwallet.io/api/debug/v3";
10+
const NODE_URL = "https://lisbon.net.solidwallet.io/api/v3";
11+
const DEBUG_URL = "https://lisbon.net.solidwallet.io/api/v3d";
1212
const KEYSTORE_FILE = {
1313
version: 3,
1414
id: "e00e113c-1e45-47e4-b732-10f3d1903d75",

quickstart/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
"babel-preset-env": "1.6.0",
3030
"clean-webpack-plugin": "0.1.16",
3131
"html-webpack-plugin": "^3.1.0",
32-
"webpack": "^4.29.3",
33-
"webpack-dev-server": "^3.1.14",
32+
"webpack": "^4.46.0",
33+
"webpack-cli": "^4.10.0",
34+
"webpack-dev-server": "^4.11.1",
3435
"webpack-merge": "4.1.0"
3536
},
3637
"dependencies": {

webpack.config.js

+18-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
const webpack = require('webpack');
55
const path = require('path');
6-
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
76
const { CheckerPlugin } = require('awesome-typescript-loader');
87
const { env } = require('yargs').argv; // use --env with webpack 2
98
const LIBRARY_NAME = 'icon-sdk-js';
@@ -37,7 +36,7 @@ const setPlugin = target =>
3736
const config = target => ({
3837
mode,
3938
entry: `${__dirname}/lib/index.ts`,
40-
devtool: 'inline',
39+
devtool: 'inline-source-map',
4140
target,
4241
output: {
4342
path: `${__dirname}/build`,
@@ -64,19 +63,24 @@ const config = target => ({
6463
},
6564
resolve: {
6665
modules: [path.resolve('./node_modules')],
67-
extensions: ['.json', '.js', '.ts']
66+
extensions: ['.json', '.js', '.ts'],
67+
fallback: {
68+
"crypto": require.resolve("crypto-browserify"),
69+
"buffer": require.resolve("buffer/"),
70+
"stream": require.resolve("readable-stream")
71+
}
6872
},
69-
// optimization: {
70-
// minimizer: [
71-
// new UglifyJsPlugin({
72-
// cache: true,
73-
// parallel: true,
74-
// uglifyOptions: {
75-
// mangle: true,
76-
// compress: true
77-
// }
78-
// })
79-
// ]
73+
// optimization: {
74+
// minimizer: [
75+
// new UglifyJsPlugin({
76+
// cache: true,
77+
// parallel: true,
78+
// uglifyOptions: {
79+
// mangle: true,
80+
// compress: true
81+
// }
82+
// })
83+
// ]
8084
// },
8185
plugins: setPlugin(target)
8286
});

0 commit comments

Comments
 (0)