Refactor: common code

This commit is contained in:
unitwk 2023-11-15 21:22:06 +08:00
parent b516b690b8
commit 54efaa3e09
10 changed files with 55 additions and 11 deletions

View File

@ -1,3 +1,5 @@
npm run preview-build
rd /s /q "production-code" rd /s /q "production-code"
rd /s /q ".\daemon\dist" rd /s /q ".\daemon\dist"
rd /s /q ".\daemon\production" rd /s /q ".\daemon\production"

View File

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
npm run preview-build
rm -rf production-code rm -rf production-code
rm -rf ./daemon/dist ./daemon/production rm -rf ./daemon/dist ./daemon/production

View File

@ -2,7 +2,7 @@
"name": "common", "name": "common",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc --project tsconfig.json" "build": "tsc --project tsconfig.json"

View File

@ -13,7 +13,7 @@
"@koa/router": "^10.0.0", "@koa/router": "^10.0.0",
"archiver": "^5.3.1", "archiver": "^5.3.1",
"axios": "^1.1.3", "axios": "^1.1.3",
"common": "file:../common/dist", "common": "file:../common",
"compressing": "^1.5.1", "compressing": "^1.5.1",
"crypto": "^1.0.1", "crypto": "^1.0.1",
"dockerode": "3.1.0", "dockerode": "3.1.0",
@ -63,6 +63,21 @@
"webpack-node-externals": "^3.0.0" "webpack-node-externals": "^3.0.0"
} }
}, },
"../common": {
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.9.0",
"@types/os-utils": "^0.0.4",
"archiver": "^6.0.1",
"compressing": "^1.10.0",
"fs-extra": "^11.1.1",
"node-stream-zip": "^1.15.0",
"os-utils": "^0.0.14",
"socket.io": "^4.7.2"
}
},
"../common/dist": { "../common/dist": {
"name": "common", "name": "common",
"version": "1.0.0", "version": "1.0.0",
@ -1517,7 +1532,7 @@
"dev": true "dev": true
}, },
"node_modules/common": { "node_modules/common": {
"resolved": "../common/dist", "resolved": "../common",
"link": true "link": true
}, },
"node_modules/compress-commons": { "node_modules/compress-commons": {
@ -6344,11 +6359,17 @@
"dev": true "dev": true
}, },
"common": { "common": {
"version": "file:../common/dist", "version": "file:../common",
"requires": { "requires": {
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^20.9.0", "@types/node": "^20.9.0",
"fs-extra": "^11.1.1" "@types/os-utils": "^0.0.4",
"archiver": "^6.0.1",
"compressing": "^1.10.0",
"fs-extra": "^11.1.1",
"node-stream-zip": "^1.15.0",
"os-utils": "^0.0.14",
"socket.io": "^4.7.2"
} }
}, },
"compress-commons": { "compress-commons": {

View File

@ -21,7 +21,7 @@
"@koa/router": "^10.0.0", "@koa/router": "^10.0.0",
"archiver": "^5.3.1", "archiver": "^5.3.1",
"axios": "^1.1.3", "axios": "^1.1.3",
"common": "file:../common/dist", "common": "file:../common",
"compressing": "^1.5.1", "compressing": "^1.5.1",
"crypto": "^1.0.1", "crypto": "^1.0.1",
"dockerode": "3.1.0", "dockerode": "3.1.0",

View File

@ -1,3 +1,5 @@
npm run preview-build
cd daemon cd daemon
call npm install call npm install

View File

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
npm run preview-build
cd daemon cd daemon
npm install npm install

View File

@ -2,7 +2,8 @@
"name": "mcsmanager-root", "name": "mcsmanager-root",
"version": "1.0.0", "version": "1.0.0",
"scripts": { "scripts": {
"i18n": "i18next-scanner --config i18-scanner.config.js" "i18n": "i18next-scanner --config i18-scanner.config.js",
"preview-build": "cd common && npm install && npm run build"
}, },
"dependencies": { "dependencies": {
"crc": "^4.3.2", "crc": "^4.3.2",

View File

@ -12,7 +12,7 @@
"@koa/router": "^10.0.0", "@koa/router": "^10.0.0",
"axios": "^0.27.2", "axios": "^0.27.2",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"common": "file:../common/dist", "common": "file:../common",
"crypto": "^1.0.1", "crypto": "^1.0.1",
"i18n": "^0.15.0", "i18n": "^0.15.0",
"i18next": "^21.8.14", "i18next": "^21.8.14",
@ -53,8 +53,24 @@
"webpack-node-externals": "^3.0.0" "webpack-node-externals": "^3.0.0"
} }
}, },
"../common": {
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.9.0",
"@types/os-utils": "^0.0.4",
"archiver": "^6.0.1",
"compressing": "^1.10.0",
"fs-extra": "^11.1.1",
"node-stream-zip": "^1.15.0",
"os-utils": "^0.0.14",
"socket.io": "^4.7.2"
}
},
"../common/dist": { "../common/dist": {
"version": "1.0.0", "version": "1.0.0",
"extraneous": true,
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
@ -1446,7 +1462,7 @@
"dev": true "dev": true
}, },
"node_modules/common": { "node_modules/common": {
"resolved": "../common/dist", "resolved": "../common",
"link": true "link": true
}, },
"node_modules/component-emitter": { "node_modules/component-emitter": {
@ -5891,7 +5907,7 @@
"dev": true "dev": true
}, },
"common": { "common": {
"version": "file:../common/dist", "version": "file:../common",
"requires": { "requires": {
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^20.9.0", "@types/node": "^20.9.0",

View File

@ -21,7 +21,7 @@
"@koa/router": "^10.0.0", "@koa/router": "^10.0.0",
"axios": "^0.27.2", "axios": "^0.27.2",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"common": "file:../common/dist", "common": "file:../common",
"crypto": "^1.0.1", "crypto": "^1.0.1",
"i18n": "^0.15.0", "i18n": "^0.15.0",
"i18next": "^21.8.14", "i18next": "^21.8.14",