调整模板 debugPanel移到oak-frontend-base

This commit is contained in:
wkj 2024-01-16 14:23:56 +08:00
parent 72f6cc7e65
commit 510d635fcd
6 changed files with 4 additions and 47 deletions

View File

@ -89,20 +89,10 @@ async function createWechatMpBoilplate(dir, isDev, isUpdate) {
(0, file_handle_1.checkFileExistsAndCreate)(oakConfigPathWithWeChatMp, oakConfigWithWeChatMp, enum_1.checkFileExistsAndCreateType.FILE, isUpdate);
}
async function createWebBoilplate(dir, isDev, isUpdate) {
// 获取web项目app.json内容
const appJsonWithWeb = (0, template_1.appJsonContentWithWeb)(isDev);
// 获取web项目oak.config.json内容
const oakConfigWithWeb = (0, template_1.oakConfigContentWithWeb)();
const appJsonPathWithWeb = (0, path_1.join)(dir, 'src', 'app.json');
// web项目oak.config.json路径
const oakConfigPathWithWeb = (0, path_1.join)(dir, 'src', config_1.USER_CONFIG_FILE_NAME);
// 创建web项目app.json
// checkFileExistsAndCreate(
// appJsonPathWithWeb,
// appJsonWithWeb,
// checkFileExistsAndCreateType.FILE,
// isUpdate
// );
// 创建web项目oak.config.json
(0, file_handle_1.checkFileExistsAndCreate)(oakConfigPathWithWeb, oakConfigWithWeb, enum_1.checkFileExistsAndCreateType.FILE, isUpdate);
}

1
lib/template.d.ts vendored
View File

@ -9,5 +9,4 @@ export declare function tsConfigWebJsonContent(): string;
export declare function projectConfigContentWithWeChatMp(oakConfigName: string, projectname: string, miniVersion: string): string;
export declare function appJsonContentWithWeChatMp(isDev: boolean): string;
export declare function oakConfigContentWithWeChatMp(): string;
export declare function appJsonContentWithWeb(isDev: boolean): string;
export declare function oakConfigContentWithWeb(): string;

View File

@ -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.tsConfigBuildPathsJsonContent = exports.tsConfigBuildJsonContent = exports.tsConfigJsonContent = exports.packageJsonContent = void 0;
exports.oakConfigContentWithWeb = exports.oakConfigContentWithWeChatMp = exports.appJsonContentWithWeChatMp = exports.projectConfigContentWithWeChatMp = exports.tsConfigWebJsonContent = exports.tsConfigMpJsonContent = exports.tsConfigPathsJsonContent = exports.tsConfigBuildPathsJsonContent = exports.tsConfigBuildJsonContent = exports.tsConfigJsonContent = exports.packageJsonContent = void 0;
const child_process_1 = require("child_process");
/**
* 利用npm info获得相应库的最新版本
@ -587,7 +587,7 @@ function appJsonContentWithWeChatMp(isDev) {
},
"usingComponents": {
"oak-message": "@oak-frontend-base/components/message/index",
"oak-debugPanel": "@oak-general-business/components/func/debugPanel/index"
"oak-debugPanel": "@oak-frontend-base/components/func/debugPanel/index"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
@ -601,15 +601,6 @@ function oakConfigContentWithWeChatMp() {
}`;
}
exports.oakConfigContentWithWeChatMp = oakConfigContentWithWeChatMp;
function appJsonContentWithWeb(isDev) {
const pages = [
'@project/pages/login/index',
];
return `{
"pages": ${JSON.stringify(pages, null, 4)}
}`;
}
exports.appJsonContentWithWeb = appJsonContentWithWeb;
function oakConfigContentWithWeb() {
return `{
"theme": {

View File

@ -24,7 +24,6 @@ import {
appJsonContentWithWeChatMp,
projectConfigContentWithWeChatMp,
oakConfigContentWithWeChatMp,
appJsonContentWithWeb,
oakConfigContentWithWeb,
} from './template';
import { PromptInput } from './interface';
@ -153,24 +152,12 @@ async function createWebBoilplate(
isDev: boolean,
isUpdate?: boolean
) {
// 获取web项目app.json内容
const appJsonWithWeb = appJsonContentWithWeb(isDev);
// 获取web项目oak.config.json内容
const oakConfigWithWeb = oakConfigContentWithWeb();
const appJsonPathWithWeb = join(dir, 'src', 'app.json');
// web项目oak.config.json路径
const oakConfigPathWithWeb = join(dir, 'src', USER_CONFIG_FILE_NAME);
// 创建web项目app.json
// checkFileExistsAndCreate(
// appJsonPathWithWeb,
// appJsonWithWeb,
// checkFileExistsAndCreateType.FILE,
// isUpdate
// );
// 创建web项目oak.config.json
checkFileExistsAndCreate(
oakConfigPathWithWeb,

View File

@ -601,7 +601,7 @@ export function appJsonContentWithWeChatMp(isDev: boolean) {
},
"usingComponents": {
"oak-message": "@oak-frontend-base/components/message/index",
"oak-debugPanel": "@oak-general-business/components/func/debugPanel/index"
"oak-debugPanel": "@oak-frontend-base/components/func/debugPanel/index"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
@ -615,14 +615,6 @@ export function oakConfigContentWithWeChatMp() {
}`;
}
export function appJsonContentWithWeb(isDev: boolean) {
const pages = [
'@project/pages/login/index',
];
return `{
"pages": ${JSON.stringify(pages, null, 4)}
}`;
}
export function oakConfigContentWithWeb() {
return `{

View File

@ -1,8 +1,6 @@
import React, { lazy } from 'react';
const Message = lazy(() => import('oak-frontend-base/es/components/message'));
const DebugPanel = lazy(
() => import('oak-general-business/es/components/func/debugPanel')
);
const DebugPanel = lazy(() => import('oak-frontend-base/es/components/func/debugPanel'));
type AppContainerProps = {
children?: React.ReactNode;