feat: add @status-im/js

Signed-off-by: yqrashawn <namy.19@gmail.com>
This commit is contained in:
yqrashawn 2023-05-09 16:00:17 +08:00
parent b1bb906857
commit b4eaf40a14
No known key found for this signature in database
GPG Key ID: E394C5D9A8E535A6
6 changed files with 2795 additions and 3 deletions

3
.gitignore vendored
View File

@ -26,3 +26,6 @@ benchmarks/graphs
# Jetbrains
.idea
/status-js-sdk/sdk.js
/status-js-sdk/sdk.js.LICENSE.txt

View File

@ -4,11 +4,14 @@
"private": true,
"scripts": {
"start": "node ./bin/www",
"postinstall": "yarn run build:@status-im/js",
"build:@status-im/js": "yarn run webpack --config status-js-sdk/webpack.config.js",
"watch": "NODE_ENV=development nodemon ./bin/www",
"docker": "yarn run tests && docker build -t statusteam/universal-links-handler:deploy .",
"tests": "node -r esm tests/main.js | tap-color"
},
"dependencies": {
"@status-im/js": "^0.2.0",
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"ejs": "~2.5.7",
@ -16,6 +19,7 @@
"http-errors": "~1.6.2",
"idna-uts46-hx": "^3.2.2",
"is-html": "^2.0.0",
"isomorphic-ws": "^5.0.0",
"js-status-chat-name": "git+https://github.com/status-im/js-status-chat-name.git#v0.1.2",
"morgan": "^1.9.1",
"multibase": "^1.0.1",
@ -29,6 +33,12 @@
"nodemon": "^1.17.5",
"supertest": "^4.0.2",
"tap-color": "^1.2.0",
"webpack": "^5.82.0",
"webpack-cli": "^5.1.0",
"zora": "^3.1.8"
},
"optionalDependencies": {
"bufferutil": "^4.0.7",
"utf-8-validate": "^6.0.3"
}
}

1
status-js-sdk/helper.js Normal file
View File

@ -0,0 +1 @@
module.exports = require("@status-im/js/dist/index.cjs");

1
status-js-sdk/index.js Normal file
View File

@ -0,0 +1 @@
const status = require("./sdk.js");

View File

@ -0,0 +1,15 @@
module.exports = {
target: "node",
mode: "production",
entry: __dirname + "/helper.js",
output: {
path: __dirname,
filename: "sdk.js",
library: { type: "commonjs2" },
},
resolve: {
// to load js-waku based on its `exports.import` in package.json
conditionNames: ["require", "import"],
},
// optimization: { minimize: false },
};

2768
yarn.lock

File diff suppressed because it is too large Load Diff