mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-01-03 15:58:20 +08:00
[feature](webapp) add script command to accommodate different Node.js versions and change lerna + npm to pnpm workspaces (#61)
This commit is contained in:
1
webapp/packages/supersonic-fe/.gitignore
vendored
1
webapp/packages/supersonic-fe/.gitignore
vendored
@@ -20,6 +20,7 @@ yarn-error.log
|
||||
.idea
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
*bak
|
||||
.vscode
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
const commitId = execSync('git rev-parse HEAD').toString().trim();
|
||||
|
||||
const file = path.resolve(__dirname, './public/version.js');
|
||||
const data = {
|
||||
commitId: commitId,
|
||||
updateTime: new Date().toString(),
|
||||
};
|
||||
const feVersion = JSON.stringify(data, null, 4);
|
||||
// 异步写入数据到文件
|
||||
fs.writeFile(file, `feVersion=${feVersion}`, { encoding: 'utf8' }, (err) => {});
|
||||
console.log(`成功写入版本文件,版本信息为${feVersion}`);
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
npm i
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "npm i failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
npm run build:inner
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "build failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf dist.zip
|
||||
zip -r dist.zip ./dist/
|
||||
mkdir -p bin
|
||||
mv dist.zip bin/
|
||||
tar czf dist.tar.gz bin/dist.zip
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
npm i
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "npm i failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
npm run build:inner
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "build failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf dist.zip
|
||||
zip -r dist.zip ./dist/
|
||||
mkdir -p bin
|
||||
mv dist.zip bin/
|
||||
tar czf dist.tar.gz bin/dist.zip
|
||||
@@ -11,7 +11,7 @@ const { REACT_APP_ENV, RUN_TYPE } = process.env;
|
||||
|
||||
export default defineConfig({
|
||||
webpack5: {},
|
||||
mfsu: {},
|
||||
mfsu: false,
|
||||
define: {
|
||||
// 添加这个自定义的环境变量
|
||||
// 'process.env.REACT_APP_ENV': process.env.REACT_APP_ENV, // * REACT_APP_ENV 本地开发环境:dev,测试服:test,正式服:prod
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
"scripts": {
|
||||
"analyze": "cross-env ANALYZE=1 umi build",
|
||||
"build": "npm run build:os",
|
||||
"build:os": "node .writeVersion.js && cross-env REACT_APP_ENV=prod APP_TARGET=opensource umi build",
|
||||
"build:os-local": "node .writeVersion.js && cross-env REACT_APP_ENV=prod APP_TARGET=opensource RUN_TYPE=local umi build",
|
||||
"build:inner": "node .writeVersion.js && cross-env REACT_APP_ENV=prod APP_TARGET=inner umi build",
|
||||
"build:test": "node .writeVersion.js && cross-env REACT_APP_ENV=test umi build",
|
||||
"build:os": "cross-env REACT_APP_ENV=prod APP_TARGET=opensource umi build",
|
||||
"build:os-local": "cross-env REACT_APP_ENV=prod APP_TARGET=opensource RUN_TYPE=local umi build",
|
||||
"build:inner": "cross-env REACT_APP_ENV=prod APP_TARGET=inner umi build",
|
||||
"build:test": "cross-env REACT_APP_ENV=test umi build",
|
||||
"deploy": "npm run site && npm run gh-pages",
|
||||
"dev": "npm run start:osdev",
|
||||
"dev:os": "npm run start:osdev",
|
||||
@@ -61,7 +61,9 @@
|
||||
"@ant-design/pro-form": "^1.23.0",
|
||||
"@ant-design/pro-layout": "^6.38.22",
|
||||
"@ant-design/pro-table": "^2.80.6",
|
||||
"@antv/dom-util": "^2.0.4",
|
||||
"@antv/g6": "^4.8.14",
|
||||
"@antv/g6-core": "^0.8.21",
|
||||
"@antv/layout": "^0.3.20",
|
||||
"@antv/xflow": "^1.0.55",
|
||||
"@babel/runtime": "^7.22.5",
|
||||
@@ -96,7 +98,7 @@
|
||||
"react-split-pane": "^2.0.3",
|
||||
"react-syntax-highlighter": "^15.4.3",
|
||||
"sql-formatter": "^2.3.3",
|
||||
"supersonic-chat-sdk": "^0.5.28",
|
||||
"supersonic-chat-sdk": "^0.5.29",
|
||||
"umi": "3.5",
|
||||
"umi-request": "^1.0.8"
|
||||
},
|
||||
@@ -139,7 +141,7 @@
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0 <17.0.0"
|
||||
"node": ">=16.0.0 <20.0.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/react": "17.0.0"
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
"strict": true,
|
||||
"paths": {
|
||||
"@/*": ["./src/*"],
|
||||
"@@/*": ["./src/.umi/*"]
|
||||
"@@/*": ["./src/.umi/*"],
|
||||
"react": [ "./node_modules/@types/react" ]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
|
||||
Reference in New Issue
Block a user