增加tsconfog.build.paths.json生成和移除依赖库react-i18next
This commit is contained in:
parent
a0adb18bba
commit
aaf38f21cd
|
|
@ -116,6 +116,7 @@ async function create(dirName, cmd) {
|
|||
// 获取tsconfig.json内容
|
||||
const tsconfigJson = (0, template_1.tsConfigJsonContent)();
|
||||
const tsConfigBuildJson = (0, template_1.tsConfigBuildJsonContent)();
|
||||
const tsConfigBuildPathsJson = (0, template_1.tsConfigBuildPathsJsonContent)();
|
||||
const tsConfigPathsJson = (0, template_1.tsConfigPathsJsonContent)();
|
||||
const tsConfigMpJson = (0, template_1.tsConfigMpJsonContent)();
|
||||
const tsConfigWebJson = (0, template_1.tsConfigWebJsonContent)();
|
||||
|
|
@ -127,6 +128,8 @@ async function create(dirName, cmd) {
|
|||
const tsconfigJsonPath = `${rootPath}/tsconfig.json`;
|
||||
// tsconfig.build.json路径
|
||||
const tsConfigBuildJsonPath = `${rootPath}/tsconfig.build.json`;
|
||||
// tsconfig.build.paths.json路径
|
||||
const tsConfigBuildPathsJsonPath = `${rootPath}/tsconfig.build.paths.json`;
|
||||
// tsconfig.paths.json路径
|
||||
const tsconfigPathsJsonPath = `${rootPath}/tsconfig.paths.json`;
|
||||
// tsconfig.mp.json路径
|
||||
|
|
@ -150,6 +153,8 @@ async function create(dirName, cmd) {
|
|||
(0, file_handle_1.checkFileExistsAndCreate)(tsconfigJsonPath, tsconfigJson, enum_1.checkFileExistsAndCreateType.FILE);
|
||||
// 创建tsconfig.build.json
|
||||
(0, file_handle_1.checkFileExistsAndCreate)(tsConfigBuildJsonPath, tsConfigBuildJson, enum_1.checkFileExistsAndCreateType.FILE);
|
||||
// 创建tsconfig.build.paths.json
|
||||
(0, file_handle_1.checkFileExistsAndCreate)(tsConfigBuildPathsJsonPath, tsConfigBuildPathsJson, enum_1.checkFileExistsAndCreateType.FILE);
|
||||
// 创建tsconfig.paths.json
|
||||
(0, file_handle_1.checkFileExistsAndCreate)(tsconfigPathsJsonPath, tsConfigPathsJson, enum_1.checkFileExistsAndCreateType.FILE);
|
||||
// 创建tsconfig.mp.json
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { PackageJsonInput } from './interface';
|
|||
export declare function packageJsonContent({ name, version, description, cliVersion, cliName, cliBinName, isDev, }: PackageJsonInput): string;
|
||||
export declare function tsConfigJsonContent(): string;
|
||||
export declare function tsConfigBuildJsonContent(): string;
|
||||
export declare function tsConfigBuildPathsJsonContent(): string;
|
||||
export declare function tsConfigPathsJsonContent(): string;
|
||||
export declare function tsConfigMpJsonContent(): string;
|
||||
export declare function tsConfigWebJsonContent(): string;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.oakConfigContentWithWeb = exports.appJsonContentWithWeb = exports.oakConfigContentWithWeChatMp = exports.appJsonContentWithWeChatMp = exports.projectConfigContentWithWeChatMp = exports.tsConfigWebJsonContent = exports.tsConfigMpJsonContent = exports.tsConfigPathsJsonContent = exports.tsConfigBuildJsonContent = exports.tsConfigJsonContent = exports.packageJsonContent = void 0;
|
||||
exports.oakConfigContentWithWeb = exports.appJsonContentWithWeb = exports.oakConfigContentWithWeChatMp = exports.appJsonContentWithWeChatMp = exports.projectConfigContentWithWeChatMp = exports.tsConfigWebJsonContent = exports.tsConfigMpJsonContent = exports.tsConfigPathsJsonContent = exports.tsConfigBuildPathsJsonContent = exports.tsConfigBuildJsonContent = exports.tsConfigJsonContent = exports.packageJsonContent = void 0;
|
||||
function packageJsonContent({ name, version, description, cliVersion, cliName, cliBinName, isDev, }) {
|
||||
let oakDependencyStr;
|
||||
let oakDevDependencyStr;
|
||||
|
|
@ -51,14 +51,13 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
|
|||
"license": "",
|
||||
"typings": "typings/index.d.ts",
|
||||
"dependencies": {
|
||||
"@ant-design/cssinjs": "^1.1.0",
|
||||
"@ant-design/icons": "^4.7.0",
|
||||
"@icon-park/react": "^1.4.2",
|
||||
"@ant-design/cssinjs": "^1.16.2",
|
||||
"@ant-design/icons": "^5.2.6",
|
||||
"@wangeditor/basic-modules": "^1.1.3",
|
||||
"@wangeditor/editor": "^5.1.14",
|
||||
"@wangeditor/editor-for-react": "^1.0.4",
|
||||
"antd": "^5.0.3",
|
||||
"antd-mobile": "^5.26.0",
|
||||
"antd": "^5.8.3",
|
||||
"antd-mobile": "^5.32.0",
|
||||
"antd-mobile-icons": "^0.3.0",
|
||||
"classnames": "^2.3.1",
|
||||
"crypto-browserify": "^3.12.0",
|
||||
|
|
@ -68,19 +67,12 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
|
|||
"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}
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.1.0",
|
||||
"react-i18next": "^11.18.0",
|
||||
"react-image-gallery": "^1.2.11",
|
||||
"react-responsive": "^9.0.0-beta.10",
|
||||
"react-router-dom": "^6.4.0",
|
||||
|
|
@ -255,7 +247,7 @@ function tsConfigJsonContent() {
|
|||
exports.tsConfigJsonContent = tsConfigJsonContent;
|
||||
function tsConfigBuildJsonContent() {
|
||||
return `{
|
||||
"extends": "./tsconfig.paths.json",
|
||||
"extends": "./tsconfig.build.paths.json",
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
"module": "commonjs",
|
||||
|
|
@ -291,18 +283,66 @@ function tsConfigBuildJsonContent() {
|
|||
}`;
|
||||
}
|
||||
exports.tsConfigBuildJsonContent = tsConfigBuildJsonContent;
|
||||
function tsConfigBuildPathsJsonContent() {
|
||||
return `{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@project/*": [
|
||||
"src/*"
|
||||
],
|
||||
"@oak-app-domain": [
|
||||
"src/oak-app-domain/index"
|
||||
],
|
||||
"@oak-app-domain/*": [
|
||||
"src/oak-app-domain/*"
|
||||
],
|
||||
"@oak-general-business": [
|
||||
"node_modules/oak-general-business/lib/index"
|
||||
],
|
||||
"@oak-general-business/*": [
|
||||
"node_modules/oak-general-business/lib/*"
|
||||
],
|
||||
"@oak-frontend-base": [
|
||||
"node_modules/oak-frontend-base/lib/index"
|
||||
],
|
||||
"@oak-frontend-base/*": [
|
||||
"node_modules/oak-frontend-base/lib/*"
|
||||
],
|
||||
},
|
||||
"typeRoots": ["./typings"]
|
||||
}
|
||||
}`;
|
||||
}
|
||||
exports.tsConfigBuildPathsJsonContent = tsConfigBuildPathsJsonContent;
|
||||
function tsConfigPathsJsonContent() {
|
||||
return `{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"paths": {
|
||||
"@project/*": [
|
||||
"src/*"
|
||||
],
|
||||
"@oak-app-domain": [
|
||||
"src/oak-app-domain/index"
|
||||
],
|
||||
"@oak-app-domain/*": [
|
||||
"src/oak-app-domain/*"
|
||||
],
|
||||
"@oak-general-business": [
|
||||
"node_modules/oak-general-business/es/index"
|
||||
],
|
||||
"@oak-general-business/*": [
|
||||
"node_modules/oak-general-business/app/*"
|
||||
"node_modules/oak-general-business/es/*"
|
||||
],
|
||||
"@oak-frontend-base": [
|
||||
"node_modules/oak-frontend-base/es/index"
|
||||
],
|
||||
"@oak-frontend-base/*": [
|
||||
"node_modules/oak-frontend-base/es/*"
|
||||
],
|
||||
},
|
||||
"typeRoots": ["./typings"]
|
||||
}
|
||||
}`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import {
|
|||
packageJsonContent,
|
||||
tsConfigJsonContent,
|
||||
tsConfigBuildJsonContent,
|
||||
tsConfigBuildPathsJsonContent,
|
||||
tsConfigPathsJsonContent,
|
||||
tsConfigMpJsonContent,
|
||||
tsConfigWebJsonContent,
|
||||
|
|
@ -198,6 +199,7 @@ export async function create(dirName: string, cmd: any) {
|
|||
// 获取tsconfig.json内容
|
||||
const tsconfigJson = tsConfigJsonContent();
|
||||
const tsConfigBuildJson = tsConfigBuildJsonContent();
|
||||
const tsConfigBuildPathsJson = tsConfigBuildPathsJsonContent();
|
||||
const tsConfigPathsJson = tsConfigPathsJsonContent();
|
||||
const tsConfigMpJson = tsConfigMpJsonContent();
|
||||
const tsConfigWebJson = tsConfigWebJsonContent();
|
||||
|
|
@ -210,6 +212,8 @@ export async function create(dirName: string, cmd: any) {
|
|||
const tsconfigJsonPath = `${rootPath}/tsconfig.json`;
|
||||
// tsconfig.build.json路径
|
||||
const tsConfigBuildJsonPath = `${rootPath}/tsconfig.build.json`;
|
||||
// tsconfig.build.paths.json路径
|
||||
const tsConfigBuildPathsJsonPath = `${rootPath}/tsconfig.build.paths.json`;
|
||||
// tsconfig.paths.json路径
|
||||
const tsconfigPathsJsonPath = `${rootPath}/tsconfig.paths.json`;
|
||||
// tsconfig.mp.json路径
|
||||
|
|
@ -246,6 +250,12 @@ export async function create(dirName: string, cmd: any) {
|
|||
tsConfigBuildJson,
|
||||
checkFileExistsAndCreateType.FILE
|
||||
);
|
||||
// 创建tsconfig.build.paths.json
|
||||
checkFileExistsAndCreate(
|
||||
tsConfigBuildPathsJsonPath,
|
||||
tsConfigBuildPathsJson,
|
||||
checkFileExistsAndCreateType.FILE
|
||||
);
|
||||
// 创建tsconfig.paths.json
|
||||
checkFileExistsAndCreate(
|
||||
tsconfigPathsJsonPath,
|
||||
|
|
|
|||
|
|
@ -58,14 +58,13 @@ export function packageJsonContent({
|
|||
"license": "",
|
||||
"typings": "typings/index.d.ts",
|
||||
"dependencies": {
|
||||
"@ant-design/cssinjs": "^1.1.0",
|
||||
"@ant-design/icons": "^4.7.0",
|
||||
"@icon-park/react": "^1.4.2",
|
||||
"@ant-design/cssinjs": "^1.16.2",
|
||||
"@ant-design/icons": "^5.2.6",
|
||||
"@wangeditor/basic-modules": "^1.1.3",
|
||||
"@wangeditor/editor": "^5.1.14",
|
||||
"@wangeditor/editor-for-react": "^1.0.4",
|
||||
"antd": "^5.0.3",
|
||||
"antd-mobile": "^5.26.0",
|
||||
"antd": "^5.8.3",
|
||||
"antd-mobile": "^5.32.0",
|
||||
"antd-mobile-icons": "^0.3.0",
|
||||
"classnames": "^2.3.1",
|
||||
"crypto-browserify": "^3.12.0",
|
||||
|
|
@ -75,19 +74,12 @@ export function packageJsonContent({
|
|||
"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}
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.1.0",
|
||||
"react-i18next": "^11.18.0",
|
||||
"react-image-gallery": "^1.2.11",
|
||||
"react-responsive": "^9.0.0-beta.10",
|
||||
"react-router-dom": "^6.4.0",
|
||||
|
|
@ -262,7 +254,7 @@ export function tsConfigJsonContent() {
|
|||
|
||||
export function tsConfigBuildJsonContent() {
|
||||
return `{
|
||||
"extends": "./tsconfig.paths.json",
|
||||
"extends": "./tsconfig.build.paths.json",
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
"module": "commonjs",
|
||||
|
|
@ -298,18 +290,66 @@ export function tsConfigBuildJsonContent() {
|
|||
}`;
|
||||
}
|
||||
|
||||
export function tsConfigBuildPathsJsonContent() {
|
||||
return `{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@project/*": [
|
||||
"src/*"
|
||||
],
|
||||
"@oak-app-domain": [
|
||||
"src/oak-app-domain/index"
|
||||
],
|
||||
"@oak-app-domain/*": [
|
||||
"src/oak-app-domain/*"
|
||||
],
|
||||
"@oak-general-business": [
|
||||
"node_modules/oak-general-business/lib/index"
|
||||
],
|
||||
"@oak-general-business/*": [
|
||||
"node_modules/oak-general-business/lib/*"
|
||||
],
|
||||
"@oak-frontend-base": [
|
||||
"node_modules/oak-frontend-base/lib/index"
|
||||
],
|
||||
"@oak-frontend-base/*": [
|
||||
"node_modules/oak-frontend-base/lib/*"
|
||||
],
|
||||
},
|
||||
"typeRoots": ["./typings"]
|
||||
}
|
||||
}`;
|
||||
}
|
||||
|
||||
export function tsConfigPathsJsonContent() {
|
||||
return `{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"paths": {
|
||||
"@project/*": [
|
||||
"src/*"
|
||||
],
|
||||
"@oak-app-domain": [
|
||||
"src/oak-app-domain/index"
|
||||
],
|
||||
"@oak-app-domain/*": [
|
||||
"src/oak-app-domain/*"
|
||||
],
|
||||
"@oak-general-business": [
|
||||
"node_modules/oak-general-business/es/index"
|
||||
],
|
||||
"@oak-general-business/*": [
|
||||
"node_modules/oak-general-business/app/*"
|
||||
"node_modules/oak-general-business/es/*"
|
||||
],
|
||||
"@oak-frontend-base": [
|
||||
"node_modules/oak-frontend-base/es/index"
|
||||
],
|
||||
"@oak-frontend-base/*": [
|
||||
"node_modules/oak-frontend-base/es/*"
|
||||
],
|
||||
},
|
||||
"typeRoots": ["./typings"]
|
||||
}
|
||||
}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue