修改了一些编译的选项

This commit is contained in:
Xu Chang 2022-12-31 13:50:41 +08:00
parent 150e3b9358
commit 0a37d62eef
6 changed files with 224 additions and 167 deletions

View File

@ -164,9 +164,9 @@ async function create(dirName, cmd) {
(0, tip_style_1.Warn)((0, tip_style_1.warn)('Sorry, this script requires npm! Please install npm!')); (0, tip_style_1.Warn)((0, tip_style_1.warn)('Sorry, this script requires npm! Please install npm!'));
shelljs_1.default.exit(1); shelljs_1.default.exit(1);
} }
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`Waiting...`)}`); /* Success(`${success(`Waiting...`)}`);
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`Dependencies are now being installed`)}`); Success(`${success(`Dependencies are now being installed`)}`);
shelljs_1.default.cd(dirName).exec('npm install'); shell.cd(dirName).exec('npm install'); */
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`Successfully created project ${(0, tip_style_1.primary)(name)}, directory name is ${(0, tip_style_1.primary)(dirName)}`)}`); (0, tip_style_1.Success)(`${(0, tip_style_1.success)(`Successfully created project ${(0, tip_style_1.primary)(name)}, directory name is ${(0, tip_style_1.primary)(dirName)}`)}`);
} }
catch (err) { catch (err) {

View File

@ -18,21 +18,30 @@ async function make() {
(0, tip_style_1.Error)(`${(0, tip_style_1.error)(`build 执行失败`)}`); (0, tip_style_1.Error)(`${(0, tip_style_1.error)(`build 执行失败`)}`);
process.exit(1); process.exit(1);
} }
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`npm link oak-app-domain`)}`); /* Success(`${success(`npm link oak-app-domain`)}`);
const isWin = process.platform === 'win32';
const result2 = !isWin ? cross_spawn_1.default.sync('sudo', [`npm link ${process.cwd()}/src/oak-app-domain`], { const isWin = process.platform === 'win32';
stdio: 'inherit', const result2 = !isWin ? spawn.sync(
shell: true, 'sudo',
}) : cross_spawn_1.default.sync('npm', [`link ${process.cwd()}/src/oak-app-domain`], { [`npm link ${process.cwd()}/src/oak-app-domain`],
stdio: 'inherit', {
shell: true, stdio: 'inherit',
}); shell: true,
if (result2.status === 0) { }
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`link 执行完成`)}`); ) : spawn.sync(
} 'npm',
else { [`link ${process.cwd()}/src/oak-app-domain`],
(0, tip_style_1.Error)(`${(0, tip_style_1.error)(`link 执行失败`)}`); {
process.exit(1); stdio: 'inherit',
} shell: true,
}
);
if (result2.status === 0) {
Success(`${success(`link 执行完成`)}`);
} else {
Error(`${error(`link 执行失败`)}`);
process.exit(1);
} */
} }
exports.default = make; exports.default = make;

View File

@ -6,20 +6,22 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
let oakDevDependencyStr; let oakDevDependencyStr;
if (isDev) { if (isDev) {
oakDependencyStr = `"oak-common-aspect": "file:../oak-common-aspect", oakDependencyStr = `"oak-common-aspect": "file:../oak-common-aspect",
"oak-db": "file:../oak-db",
"oak-domain": "file:../oak-domain", "oak-domain": "file:../oak-domain",
"oak-frontend-base": "file:../oak-frontend-base",
"oak-external-sdk": "file:../oak-external-sdk", "oak-external-sdk": "file:../oak-external-sdk",
"oak-frontend-base": "file:../oak-frontend-base",
"oak-general-business": "file:../oak-general-business", "oak-general-business": "file:../oak-general-business",
"oak-memory-tree-store": "file:../oak-memory-tree-store",`; "oak-memory-tree-store": "file:../oak-memory-tree-store",`;
oakDevDependencyStr = `"${cliName}": "file:../oak-cli",`; oakDevDependencyStr = `"${cliName}": "file:../oak-cli",`;
} }
else { else {
oakDependencyStr = `"oak-common-aspect": "^1.0.3", oakDependencyStr = `"oak-common-aspect": "^2.1.0",
"oak-domain": "^1.1.10", "oak-db": "^2.1.1",
"oak-frontend-base": "^1.0.13", "oak-domain": "^2.1.0",
"oak-general-business": "^1.0.12", "oak-external-sdk": "^1.0.5",
"oak-external-sdk": "^1.0.3", "oak-frontend-base": "^2.1.0",
"oak-memory-tree-store": "^1.0.5",`; "oak-general-business": "^2.1.0",
"oak-memory-tree-store": "^2.1.0",`;
oakDevDependencyStr = `"${cliName}": "^${cliVersion}",`; oakDevDependencyStr = `"${cliName}": "^${cliVersion}",`;
} }
const serverInitScript = isDev ? "cross-env NODE_ENV=development cross-env OAK_PLATFORM=server ts-node scripts/initServer.js" : "cross-env OAK_PLATFORM=server ts-node scripts/initServer.js"; const serverInitScript = isDev ? "cross-env NODE_ENV=development cross-env OAK_PLATFORM=server ts-node scripts/initServer.js" : "cross-env OAK_PLATFORM=server ts-node scripts/initServer.js";
@ -38,64 +40,83 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
"build-analyze:web": "${cliBinName} build --target web --mode production --analyze", "build-analyze:web": "${cliBinName} build --target web --mode production --analyze",
"build-sourcemap-analyze:web": "${cliBinName} build --target web --mode production --sourcemap --analyze", "build-sourcemap-analyze:web": "${cliBinName} build --target web --mode production --sourcemap --analyze",
"build": "tsc", "build": "tsc",
"server:init": ${serverInitScript}, "server:init": "${serverInitScript}",
"server:start": ${serverStartScript}, "server:start": "${serverStartScript}",
"postinstall": "npm run make:domain" "postinstall": "npm run make:domain"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "", "license": "",
"typings": "typings/index.d.ts",
"dependencies": { "dependencies": {
"@ant-design/icons": "^4.7.0", "@ant-design/cssinjs": "^1.1.0",
"antd": "^5.0.0", "@ant-design/icons": "^4.7.0",
"antd-mobile": "^5.24.1", "@icon-park/react": "^1.4.2",
"antd-mobile-icons": "^0.3.0", "@wangeditor/basic-modules": "^1.1.3",
"classnames": "^2.3.1", "@wangeditor/editor": "^5.1.14",
"crypto-browserify": "^3.12.0", "@wangeditor/editor-for-react": "^1.0.4",
"dayjs": "^1.11.5", "antd": "^5.0.3",
"i18next": "^20.6.1", "antd-mobile": "^5.26.0",
"i18next-browser-languagedetector": "^6.1.4", "antd-mobile-icons": "^0.3.0",
"i18next-chained-backend": "^3.0.2", "classnames": "^2.3.1",
"i18next-http-backend": "^1.4.1", "crypto-browserify": "^3.12.0",
"i18next-localstorage-backend": "^3.1.3", "crypto-js": "^4.1.1",
"i18next-resource-store-loader": "^0.1.2", "dayjs": "^1.11.5",
"lodash": "^4.17.21", "echarts": "^5.3.0",
"nprogress": "^0.2.0", "echarts-for-react": "^3.0.2",
"history": "^5.3.0",
"hmacsha1": "^1.0.0",
"i18next": "^20.6.1",
"i18next-browser-languagedetector": "^6.1.4",
"i18next-chained-backend": "^3.0.2",
"i18next-http-backend": "^1.4.1",
"i18next-localstorage-backend": "^3.1.3",
"i18next-resource-store-loader": "^0.1.2",
"js-base64": "^3.7.2",
"lodash": "^4.17.21",
"nprogress": "^0.2.0",
${oakDependencyStr} ${oakDependencyStr}
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.1.0", "react-dom": "^18.1.0",
"react-i18next": "^11.18.0", "react-i18next": "^11.18.0",
"react-image-gallery": "^1.2.11",
"react-responsive": "^9.0.0-beta.10", "react-responsive": "^9.0.0-beta.10",
"react-router-dom": "^6.3.0", "react-router-dom": "^6.4.0",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"react-slick": "^0.29.0",
"rmc-pull-to-refresh": "^1.0.13", "rmc-pull-to-refresh": "^1.0.13",
"slick-carousel": "^1.8.1",
"url": "^0.11.0", "url": "^0.11.0",
"uuid": "^8.3.2" "uuid": "^8.3.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.12.13", "@babel/cli": "^7.12.13",
"@babel/core": "^7.12.13", "@babel/core": "^7.12.13",
"@babel/plugin-proposal-class-properties": "^7.12.13", "@babel/plugin-proposal-class-properties": "^7.12.13",
"@babel/preset-env": "^7.12.13", "@babel/preset-env": "^7.12.13",
"@babel/preset-typescript": "^7.12.13", "@babel/preset-typescript": "^7.12.13",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
"@svgr/webpack": "^5.5.0", "@svgr/webpack": "^5.5.0",
"@testing-library/jest-dom": "^5.16.4", "@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0", "@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0", "@testing-library/user-event": "^13.5.0",
"@types/assert": "^1.5.6", "@types/assert": "^1.5.6",
"@types/fs-extra": "^9.0.13", "@types/crypto-js": "^4.1.1",
"@types/jest": "^27.5.2", "@types/fs-extra": "^9.0.13",
"@types/lodash": "^4.14.179", "@types/isomorphic-fetch": "^0.0.36",
"@types/luxon": "^2.3.2", "@types/jest": "^27.5.2",
"@types/mocha": "^8.2.0", "@types/lodash": "^4.14.179",
"@types/node": "^16.11.38", "@types/luxon": "^2.3.2",
"@types/nprogress": "^0.2.0", "@types/mocha": "^8.2.0",
"@types/react": "^18.0.12", "@types/node": "^16.11.38",
"@types/react-dom": "^18.0.5", "@types/nprogress": "^0.2.0",
"@types/shelljs": "^0.8.11", "@types/react": "^18.0.12",
"@types/uuid": "^8.3.0", "@types/react-dom": "^18.0.5",
"@types/wechat-miniprogram": "^3.4.0", "@types/react-image-gallery": "^1.2.0",
"@types/shelljs": "^0.8.11",
"@types/urlsafe-base64": "^1.0.28",
"@types/uuid": "^8.3.0",
"@types/wechat-miniprogram": "^3.4.0",
${oakDevDependencyStr} ${oakDevDependencyStr}
"assert": "^2.0.0", "assert": "^2.0.0",
"babel-jest": "^27.4.2", "babel-jest": "^27.4.2",
@ -103,8 +124,8 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
"babel-plugin-named-asset-import": "^0.3.8", "babel-plugin-named-asset-import": "^0.3.8",
"babel-preset-react-app": "^10.0.1", "babel-preset-react-app": "^10.0.1",
"bfj": "^7.0.2", "bfj": "^7.0.2",
"browserslist": "^4.18.1",
"browserify-zlib": "^0.2.0", "browserify-zlib": "^0.2.0",
"browserslist": "^4.18.1",
"camelcase": "^6.2.1", "camelcase": "^6.2.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0", "case-sensitive-paths-webpack-plugin": "^2.4.0",
"chalk": "^4.1.2", "chalk": "^4.1.2",
@ -160,6 +181,7 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
"terser-webpack-plugin": "^5.2.5", "terser-webpack-plugin": "^5.2.5",
"ts-loader": "^9.3.0", "ts-loader": "^9.3.0",
"ts-node": "^10.8.1", "ts-node": "^10.8.1",
"tslib": "^2.4.0",
"typescript": "^4.7.3", "typescript": "^4.7.3",
"ui-extract-webpack-plugin": "^1.0.0", "ui-extract-webpack-plugin": "^1.0.0",
"web-vitals": "^2.1.4", "web-vitals": "^2.1.4",
@ -242,6 +264,7 @@ function tsConfigBuildJsonContent() {
"experimentalDecorators": true, "experimentalDecorators": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
"importHelpers": true,
"lib": [ "lib": [
"dom", "dom",
"dom.iterable", "dom.iterable",
@ -295,6 +318,7 @@ function tsConfigMpJsonContent() {
"experimentalDecorators": true, "experimentalDecorators": true,
"strict": true, "strict": true,
"downlevelIteration": true, "downlevelIteration": true,
"importHelpers": true,
"lib": [ "lib": [
"dom", "dom",
"dom.iterable", "dom.iterable",

View File

@ -273,9 +273,9 @@ export async function create(dirName: string, cmd: any) {
Warn(warn('Sorry, this script requires npm! Please install npm!')); Warn(warn('Sorry, this script requires npm! Please install npm!'));
shell.exit(1); shell.exit(1);
} }
Success(`${success(`Waiting...`)}`); /* Success(`${success(`Waiting...`)}`);
Success(`${success(`Dependencies are now being installed`)}`); Success(`${success(`Dependencies are now being installed`)}`);
shell.cd(dirName).exec('npm install'); shell.cd(dirName).exec('npm install'); */
Success( Success(
`${success( `${success(

View File

@ -29,7 +29,7 @@ export default async function make() {
process.exit(1); process.exit(1);
} }
Success(`${success(`npm link oak-app-domain`)}`); /* Success(`${success(`npm link oak-app-domain`)}`);
const isWin = process.platform === 'win32'; const isWin = process.platform === 'win32';
const result2 = !isWin ? spawn.sync( const result2 = !isWin ? spawn.sync(
@ -53,5 +53,5 @@ export default async function make() {
} else { } else {
Error(`${error(`link 执行失败`)}`); Error(`${error(`link 执行失败`)}`);
process.exit(1); process.exit(1);
} } */
} }

View File

@ -1,37 +1,39 @@
import { PackageJsonInput } from './interface' import { PackageJsonInput } from './interface'
export function packageJsonContent({ export function packageJsonContent({
name, name,
version, version,
description, description,
cliVersion, cliVersion,
cliName, cliName,
cliBinName, cliBinName,
isDev, isDev,
}: PackageJsonInput) { }: PackageJsonInput) {
let oakDependencyStr; let oakDependencyStr;
let oakDevDependencyStr; let oakDevDependencyStr;
if (isDev) { if (isDev) {
oakDependencyStr = `"oak-common-aspect": "file:../oak-common-aspect", oakDependencyStr = `"oak-common-aspect": "file:../oak-common-aspect",
"oak-db": "file:../oak-db",
"oak-domain": "file:../oak-domain", "oak-domain": "file:../oak-domain",
"oak-frontend-base": "file:../oak-frontend-base",
"oak-external-sdk": "file:../oak-external-sdk", "oak-external-sdk": "file:../oak-external-sdk",
"oak-frontend-base": "file:../oak-frontend-base",
"oak-general-business": "file:../oak-general-business", "oak-general-business": "file:../oak-general-business",
"oak-memory-tree-store": "file:../oak-memory-tree-store",`; "oak-memory-tree-store": "file:../oak-memory-tree-store",`;
oakDevDependencyStr = `"${cliName}": "file:../oak-cli",` oakDevDependencyStr = `"${cliName}": "file:../oak-cli",`
} }
else { else {
oakDependencyStr = `"oak-common-aspect": "^1.0.3", oakDependencyStr = `"oak-common-aspect": "^2.1.0",
"oak-domain": "^1.1.10", "oak-db": "^2.1.1",
"oak-frontend-base": "^1.0.13", "oak-domain": "^2.1.0",
"oak-general-business": "^1.0.12", "oak-external-sdk": "^1.0.5",
"oak-external-sdk": "^1.0.3", "oak-frontend-base": "^2.1.0",
"oak-memory-tree-store": "^1.0.5",`; "oak-general-business": "^2.1.0",
oakDevDependencyStr = `"${cliName}": "^${cliVersion}",` "oak-memory-tree-store": "^2.1.0",`;
} oakDevDependencyStr = `"${cliName}": "^${cliVersion}",`
}
const serverInitScript = isDev ? "cross-env NODE_ENV=development cross-env OAK_PLATFORM=server ts-node scripts/initServer.js" : "cross-env OAK_PLATFORM=server ts-node scripts/initServer.js"; const serverInitScript = isDev ? "cross-env NODE_ENV=development cross-env OAK_PLATFORM=server ts-node scripts/initServer.js" : "cross-env OAK_PLATFORM=server ts-node scripts/initServer.js";
const serverStartScript = isDev ? "cross-env NODE_ENV=development cross-env OAK_PLATFORM=server ts-node scripts/startServer.js" : "cross-env OAK_PLATFORM=server ts-node scripts/startServer.js"; const serverStartScript = isDev ? "cross-env NODE_ENV=development cross-env OAK_PLATFORM=server ts-node scripts/startServer.js" : "cross-env OAK_PLATFORM=server ts-node scripts/startServer.js";
return `{ return `{
"name": "${name}", "name": "${name}",
"version": "${version}", "version": "${version}",
"description": "${description}", "description": "${description}",
@ -45,64 +47,83 @@ export function packageJsonContent({
"build-analyze:web": "${cliBinName} build --target web --mode production --analyze", "build-analyze:web": "${cliBinName} build --target web --mode production --analyze",
"build-sourcemap-analyze:web": "${cliBinName} build --target web --mode production --sourcemap --analyze", "build-sourcemap-analyze:web": "${cliBinName} build --target web --mode production --sourcemap --analyze",
"build": "tsc", "build": "tsc",
"server:init": ${serverInitScript}, "server:init": "${serverInitScript}",
"server:start": ${serverStartScript}, "server:start": "${serverStartScript}",
"postinstall": "npm run make:domain" "postinstall": "npm run make:domain"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "", "license": "",
"typings": "typings/index.d.ts",
"dependencies": { "dependencies": {
"@ant-design/icons": "^4.7.0", "@ant-design/cssinjs": "^1.1.0",
"antd": "^5.0.0", "@ant-design/icons": "^4.7.0",
"antd-mobile": "^5.24.1", "@icon-park/react": "^1.4.2",
"antd-mobile-icons": "^0.3.0", "@wangeditor/basic-modules": "^1.1.3",
"classnames": "^2.3.1", "@wangeditor/editor": "^5.1.14",
"crypto-browserify": "^3.12.0", "@wangeditor/editor-for-react": "^1.0.4",
"dayjs": "^1.11.5", "antd": "^5.0.3",
"i18next": "^20.6.1", "antd-mobile": "^5.26.0",
"i18next-browser-languagedetector": "^6.1.4", "antd-mobile-icons": "^0.3.0",
"i18next-chained-backend": "^3.0.2", "classnames": "^2.3.1",
"i18next-http-backend": "^1.4.1", "crypto-browserify": "^3.12.0",
"i18next-localstorage-backend": "^3.1.3", "crypto-js": "^4.1.1",
"i18next-resource-store-loader": "^0.1.2", "dayjs": "^1.11.5",
"lodash": "^4.17.21", "echarts": "^5.3.0",
"nprogress": "^0.2.0", "echarts-for-react": "^3.0.2",
"history": "^5.3.0",
"hmacsha1": "^1.0.0",
"i18next": "^20.6.1",
"i18next-browser-languagedetector": "^6.1.4",
"i18next-chained-backend": "^3.0.2",
"i18next-http-backend": "^1.4.1",
"i18next-localstorage-backend": "^3.1.3",
"i18next-resource-store-loader": "^0.1.2",
"js-base64": "^3.7.2",
"lodash": "^4.17.21",
"nprogress": "^0.2.0",
${oakDependencyStr} ${oakDependencyStr}
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.1.0", "react-dom": "^18.1.0",
"react-i18next": "^11.18.0", "react-i18next": "^11.18.0",
"react-image-gallery": "^1.2.11",
"react-responsive": "^9.0.0-beta.10", "react-responsive": "^9.0.0-beta.10",
"react-router-dom": "^6.3.0", "react-router-dom": "^6.4.0",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"react-slick": "^0.29.0",
"rmc-pull-to-refresh": "^1.0.13", "rmc-pull-to-refresh": "^1.0.13",
"slick-carousel": "^1.8.1",
"url": "^0.11.0", "url": "^0.11.0",
"uuid": "^8.3.2" "uuid": "^8.3.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.12.13", "@babel/cli": "^7.12.13",
"@babel/core": "^7.12.13", "@babel/core": "^7.12.13",
"@babel/plugin-proposal-class-properties": "^7.12.13", "@babel/plugin-proposal-class-properties": "^7.12.13",
"@babel/preset-env": "^7.12.13", "@babel/preset-env": "^7.12.13",
"@babel/preset-typescript": "^7.12.13", "@babel/preset-typescript": "^7.12.13",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
"@svgr/webpack": "^5.5.0", "@svgr/webpack": "^5.5.0",
"@testing-library/jest-dom": "^5.16.4", "@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0", "@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0", "@testing-library/user-event": "^13.5.0",
"@types/assert": "^1.5.6", "@types/assert": "^1.5.6",
"@types/fs-extra": "^9.0.13", "@types/crypto-js": "^4.1.1",
"@types/jest": "^27.5.2", "@types/fs-extra": "^9.0.13",
"@types/lodash": "^4.14.179", "@types/isomorphic-fetch": "^0.0.36",
"@types/luxon": "^2.3.2", "@types/jest": "^27.5.2",
"@types/mocha": "^8.2.0", "@types/lodash": "^4.14.179",
"@types/node": "^16.11.38", "@types/luxon": "^2.3.2",
"@types/nprogress": "^0.2.0", "@types/mocha": "^8.2.0",
"@types/react": "^18.0.12", "@types/node": "^16.11.38",
"@types/react-dom": "^18.0.5", "@types/nprogress": "^0.2.0",
"@types/shelljs": "^0.8.11", "@types/react": "^18.0.12",
"@types/uuid": "^8.3.0", "@types/react-dom": "^18.0.5",
"@types/wechat-miniprogram": "^3.4.0", "@types/react-image-gallery": "^1.2.0",
"@types/shelljs": "^0.8.11",
"@types/urlsafe-base64": "^1.0.28",
"@types/uuid": "^8.3.0",
"@types/wechat-miniprogram": "^3.4.0",
${oakDevDependencyStr} ${oakDevDependencyStr}
"assert": "^2.0.0", "assert": "^2.0.0",
"babel-jest": "^27.4.2", "babel-jest": "^27.4.2",
@ -110,8 +131,8 @@ export function packageJsonContent({
"babel-plugin-named-asset-import": "^0.3.8", "babel-plugin-named-asset-import": "^0.3.8",
"babel-preset-react-app": "^10.0.1", "babel-preset-react-app": "^10.0.1",
"bfj": "^7.0.2", "bfj": "^7.0.2",
"browserslist": "^4.18.1",
"browserify-zlib": "^0.2.0", "browserify-zlib": "^0.2.0",
"browserslist": "^4.18.1",
"camelcase": "^6.2.1", "camelcase": "^6.2.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0", "case-sensitive-paths-webpack-plugin": "^2.4.0",
"chalk": "^4.1.2", "chalk": "^4.1.2",
@ -167,6 +188,7 @@ export function packageJsonContent({
"terser-webpack-plugin": "^5.2.5", "terser-webpack-plugin": "^5.2.5",
"ts-loader": "^9.3.0", "ts-loader": "^9.3.0",
"ts-node": "^10.8.1", "ts-node": "^10.8.1",
"tslib": "^2.4.0",
"typescript": "^4.7.3", "typescript": "^4.7.3",
"ui-extract-webpack-plugin": "^1.0.0", "ui-extract-webpack-plugin": "^1.0.0",
"web-vitals": "^2.1.4", "web-vitals": "^2.1.4",
@ -193,7 +215,7 @@ export function packageJsonContent({
} }
export function tsConfigJsonContent() { export function tsConfigJsonContent() {
return `{ return `{
"extends": "./tsconfig.paths.json", "extends": "./tsconfig.paths.json",
"compilerOptions": { "compilerOptions": {
"jsx": "react-jsx", "jsx": "react-jsx",
@ -237,7 +259,7 @@ export function tsConfigJsonContent() {
} }
export function tsConfigBuildJsonContent() { export function tsConfigBuildJsonContent() {
return `{ return `{
"extends": "./tsconfig.paths.json", "extends": "./tsconfig.paths.json",
"compilerOptions": { "compilerOptions": {
"jsx": "react-jsx", "jsx": "react-jsx",
@ -249,6 +271,7 @@ export function tsConfigBuildJsonContent() {
"experimentalDecorators": true, "experimentalDecorators": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
"importHelpers": true,
"lib": [ "lib": [
"dom", "dom",
"dom.iterable", "dom.iterable",
@ -274,7 +297,7 @@ export function tsConfigBuildJsonContent() {
} }
export function tsConfigPathsJsonContent() { export function tsConfigPathsJsonContent() {
return `{ return `{
"compilerOptions": { "compilerOptions": {
"baseUrl": "./", "baseUrl": "./",
"paths": { "paths": {
@ -290,7 +313,7 @@ export function tsConfigPathsJsonContent() {
} }
export function tsConfigMpJsonContent() { export function tsConfigMpJsonContent() {
return `{ return `{
"extends": "./tsconfig.paths.json", "extends": "./tsconfig.paths.json",
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
@ -302,6 +325,7 @@ export function tsConfigMpJsonContent() {
"experimentalDecorators": true, "experimentalDecorators": true,
"strict": true, "strict": true,
"downlevelIteration": true, "downlevelIteration": true,
"importHelpers": true,
"lib": [ "lib": [
"dom", "dom",
"dom.iterable", "dom.iterable",
@ -328,7 +352,7 @@ export function tsConfigMpJsonContent() {
} }
export function tsConfigWebJsonContent() { export function tsConfigWebJsonContent() {
return `{ return `{
"extends": "./tsconfig.paths.json", "extends": "./tsconfig.paths.json",
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
@ -371,11 +395,11 @@ export function tsConfigWebJsonContent() {
export function projectConfigContentWithWeChatMp( export function projectConfigContentWithWeChatMp(
oakConfigName: string, oakConfigName: string,
projectname: string, projectname: string,
miniVersion: string miniVersion: string
) { ) {
return `{ return `{
"description": "项目配置文件", "description": "项目配置文件",
"packOptions": { "packOptions": {
"ignore": [{ "ignore": [{
@ -451,12 +475,12 @@ export function projectConfigContentWithWeChatMp(
} }
export function appJsonContentWithWeChatMp(isDev: boolean) { export function appJsonContentWithWeChatMp(isDev: boolean) {
const pages = [ const pages = [
'@project/pages/book/list/index', '@project/pages/book/list/index',
'@project/pages/book/upsert/index', '@project/pages/book/upsert/index',
'@project/pages/book/detail/index', '@project/pages/book/detail/index',
]; ];
return `{ return `{
"pages":${JSON.stringify(pages, null, 4)}, "pages":${JSON.stringify(pages, null, 4)},
"window":{ "window":{
"backgroundTextStyle":"light", "backgroundTextStyle":"light",
@ -475,29 +499,29 @@ export function appJsonContentWithWeChatMp(isDev: boolean) {
} }
export function oakConfigContentWithWeChatMp() { export function oakConfigContentWithWeChatMp() {
return `{ return `{
"theme": { "theme": {
} }
}`; }`;
} }
export function appJsonContentWithWeb(isDev: boolean) { export function appJsonContentWithWeb(isDev: boolean) {
const pages = [ const pages = [
'@project/pages/store/list/index', '@project/pages/store/list/index',
'@project/pages/store/upsert/index', '@project/pages/store/upsert/index',
'@project/pages/store/detail/index', '@project/pages/store/detail/index',
'@project/pages/book/list/index', '@project/pages/book/list/index',
'@project/pages/book/upsert/index', '@project/pages/book/upsert/index',
'@project/pages/book/detail/index', '@project/pages/book/detail/index',
'@oak-general-business/pages/login/index', '@oak-general-business/pages/login/index',
]; ];
return `{ return `{
"pages": ${JSON.stringify(pages, null, 4)} "pages": ${JSON.stringify(pages, null, 4)}
}`; }`;
} }
export function oakConfigContentWithWeb() { export function oakConfigContentWithWeb() {
return `{ return `{
"theme": { "theme": {
} }
}`; }`;