Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-cli into dev
This commit is contained in:
commit
6f3b196b96
|
|
@ -11,65 +11,72 @@ const { unset } = require('lodash');
|
||||||
const pageFiles = {};
|
const pageFiles = {};
|
||||||
const routerFiles = {};
|
const routerFiles = {};
|
||||||
|
|
||||||
function addFileWatcher(namespaceConfig, body, filename) {
|
/**
|
||||||
|
* 对nss所标识出的namespace下的(pages文件下的)文件,一旦有变更就重编译filename
|
||||||
|
* @param {*} filename
|
||||||
|
* @param {*} nss
|
||||||
|
*/
|
||||||
|
function addFileWatcher(filename, nss) {
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// 只有开发模式才需要监听
|
nss.forEach(
|
||||||
routerFiles[filename] = {
|
(ns) => {
|
||||||
namespaceConfig,
|
if (routerFiles[ns]) {
|
||||||
body,
|
routerFiles[ns].push(filename);
|
||||||
};
|
}
|
||||||
if (Object.keys(routerFiles).length === 1) {
|
else {
|
||||||
const pageSrcDir = join(AppPaths.appRootSrc, 'pages');
|
routerFiles[ns] = [filename];
|
||||||
|
const pageSrcDir = join(AppPaths.appRootSrc, 'pages', ns);
|
||||||
|
const isExists = fs.existsSync(pageSrcDir);
|
||||||
|
if (isExists) {
|
||||||
|
NodeWatch(pageSrcDir, { recursive: true }, (evt, name) => {
|
||||||
|
const { dir } = parse(name);
|
||||||
|
const indexJsonFile = join(dir, 'index.json');
|
||||||
|
const indexTsxFile = join(dir, 'index.tsx');
|
||||||
|
const webTsxFile = join(dir, 'web.tsx');
|
||||||
|
const webPcTsxFile = join(dir, 'web.pc.tsx');
|
||||||
|
if (evt === 'update' && !pageFiles[ns].hasOwnProperty(dir)) {
|
||||||
|
// 处理新增文件事件,删除事件webpack会自己处理,不处理也没什么问题
|
||||||
|
if (fs.existsSync(indexTsxFile) || fs.existsSync(webTsxFile) || fs.existsSync(webPcTsxFile)) {
|
||||||
|
let oakDisablePulldownRefresh = false;
|
||||||
|
if (fs.existsSync(indexJsonFile)) {
|
||||||
|
const {
|
||||||
|
enablePullDownRefresh = true,
|
||||||
|
} = require(indexJsonFile);
|
||||||
|
oakDisablePulldownRefresh = !enablePullDownRefresh;
|
||||||
|
}
|
||||||
|
const relativePath = relative(pageSrcDir, dir);
|
||||||
|
const newPageItem = {
|
||||||
|
path: relativePath.replace(/\\/g, '/'),
|
||||||
|
oakDisablePulldownRefresh,
|
||||||
|
};
|
||||||
|
pageFiles[ns][dir] = newPageItem;
|
||||||
|
|
||||||
NodeWatch(pageSrcDir, { recursive: true }, (evt, name) => {
|
const now = new Date();
|
||||||
const { dir } = parse(name);
|
routerFiles[ns].forEach(
|
||||||
const indexJsonFile = join(dir, 'index.json');
|
(file) => fs.utimes(file, now, now, () => undefined)
|
||||||
const indexTsxFile = join(dir, 'index.tsx');
|
);
|
||||||
const webTsxFile = join(dir, 'web.tsx');
|
}
|
||||||
const webPcTsxFile = join(dir, 'web.pc.tsx');
|
|
||||||
if (evt === 'update' && !pageFiles.hasOwnProperty(dir)) {
|
|
||||||
// 处理新增文件事件,删除事件webpack会自己处理,不处理也没什么问题
|
|
||||||
if (fs.existsSync(indexTsxFile) || fs.existsSync(webTsxFile) || fs.existsSync(webPcTsxFile)) {
|
|
||||||
let oakDisablePulldownRefresh = false;
|
|
||||||
if (fs.existsSync(indexJsonFile)) {
|
|
||||||
const {
|
|
||||||
enablePullDownRefresh = true,
|
|
||||||
} = require(indexJsonFile);
|
|
||||||
oakDisablePulldownRefresh = !enablePullDownRefresh;
|
|
||||||
}
|
}
|
||||||
const relativePath = relative(pageSrcDir, dir);
|
else if (evt === 'remove' && pageFiles.hasOwnProperty(dir)) {
|
||||||
const newPageItem = {
|
if (!(fs.existsSync(indexTsxFile) || fs.existsSync(webTsxFile) || fs.existsSync(webPcTsxFile))) {
|
||||||
path: relativePath.replace(/\\/g, '/'),
|
unset(pageFiles[ns], dir);
|
||||||
oakDisablePulldownRefresh,
|
|
||||||
};
|
|
||||||
pageFiles[dir] = newPageItem;
|
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
Object.keys(routerFiles).forEach(
|
routerFiles[ns].forEach(
|
||||||
(routerFilename) => {
|
(file) => fs.utimes(file, now, now, () => undefined)
|
||||||
fs.utimes(routerFilename, now, now, () => undefined);
|
);
|
||||||
}
|
}
|
||||||
);
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (evt === 'remove' && pageFiles.hasOwnProperty(dir)) {
|
}
|
||||||
if (!(fs.existsSync(indexTsxFile) || fs.existsSync(webTsxFile) || fs.existsSync(webPcTsxFile))) {
|
)
|
||||||
unset(pageFiles, dir);
|
|
||||||
|
|
||||||
const now = new Date();
|
|
||||||
Object.keys(routerFiles).forEach(
|
|
||||||
(routerFilename) => {
|
|
||||||
fs.utimes(routerFilename, now, now, () => undefined);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeRouterItem(page, namespace, first) {
|
function makeRouterItem(page, ns, namespacePath, first) {
|
||||||
const { path, oakDisablePulldownRefresh } = page;
|
const { path, oakDisablePulldownRefresh } = page;
|
||||||
return t.objectExpression(
|
return t.objectExpression(
|
||||||
[
|
[
|
||||||
|
|
@ -79,7 +86,7 @@ function makeRouterItem(page, namespace, first) {
|
||||||
),
|
),
|
||||||
t.objectProperty(
|
t.objectProperty(
|
||||||
t.identifier('namespace'),
|
t.identifier('namespace'),
|
||||||
t.stringLiteral(namespace),
|
t.stringLiteral(namespacePath),
|
||||||
),
|
),
|
||||||
t.objectProperty(
|
t.objectProperty(
|
||||||
t.identifier('meta'),
|
t.identifier('meta'),
|
||||||
|
|
@ -100,7 +107,7 @@ function makeRouterItem(page, namespace, first) {
|
||||||
t.arrowFunctionExpression(
|
t.arrowFunctionExpression(
|
||||||
[],
|
[],
|
||||||
t.callExpression(t.import(), [
|
t.callExpression(t.import(), [
|
||||||
t.stringLiteral(join('@project', 'pages', path, 'index').replace(/\\/g, '/'))
|
t.stringLiteral(join('@project', 'pages', ns, path, 'index').replace(/\\/g, '/'))
|
||||||
])
|
])
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
@ -114,39 +121,54 @@ function makeRouterItem(page, namespace, first) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function traversePages() {
|
function traversePages(nss) {
|
||||||
// pages从相应目录遍历获得
|
// pages从相应目录遍历获得
|
||||||
const pageSrcDir = join(AppPaths.appRootSrc, 'pages');
|
nss.forEach(
|
||||||
|
(ns) => {
|
||||||
|
if (!pageFiles.hasOwnProperty(ns)) {
|
||||||
|
pageFiles[ns] = {};
|
||||||
|
const pageSrcDir = join(AppPaths.appRootSrc, 'pages', ns);
|
||||||
|
|
||||||
const traverse = (dir, relativePath) => {
|
const traverse = (dir, relativePath) => {
|
||||||
const files = fs.readdirSync(dir);
|
const files = fs.readdirSync(dir);
|
||||||
files.forEach(
|
files.forEach((file) => {
|
||||||
(file) => {
|
const filepath = join(dir, file);
|
||||||
const filepath = join(dir, file);
|
const stat = fs.statSync(filepath);
|
||||||
const stat = fs.statSync(filepath);
|
if (
|
||||||
if (stat.isFile() && ['index.tsx', 'web.tsx', 'web.pc.tsx'].includes(file) && !pageFiles.hasOwnProperty(dir)) {
|
stat.isFile() &&
|
||||||
const indexJsonFile = join(dir, 'index.json');
|
['index.tsx', 'web.tsx', 'web.pc.tsx'].includes(
|
||||||
let oakDisablePulldownRefresh = false;
|
file
|
||||||
if (fs.existsSync(indexJsonFile)) {
|
) &&
|
||||||
const {
|
!pageFiles[ns].hasOwnProperty(dir)
|
||||||
enablePullDownRefresh = true,
|
) {
|
||||||
} = require(indexJsonFile);
|
const indexJsonFile = join(dir, 'index.json');
|
||||||
oakDisablePulldownRefresh = !enablePullDownRefresh;
|
let oakDisablePulldownRefresh = false;
|
||||||
}
|
if (fs.existsSync(indexJsonFile)) {
|
||||||
pageFiles[dir] = {
|
const {
|
||||||
path: relativePath.replace(/\\/g, '/'),
|
enablePullDownRefresh = true,
|
||||||
oakDisablePulldownRefresh,
|
} = require(indexJsonFile);
|
||||||
}
|
oakDisablePulldownRefresh =
|
||||||
}
|
!enablePullDownRefresh;
|
||||||
else if (stat.isDirectory()) {
|
}
|
||||||
const dir2 = join(dir, file);
|
pageFiles[ns][dir] = {
|
||||||
const relativePath2 = join(relativePath, file);
|
path: relativePath.replace(/\\/g, '/'),
|
||||||
traverse(dir2, relativePath2);
|
oakDisablePulldownRefresh,
|
||||||
|
};
|
||||||
|
} else if (stat.isDirectory()) {
|
||||||
|
const dir2 = join(dir, file);
|
||||||
|
const relativePath2 = join(relativePath, file);
|
||||||
|
traverse(dir2, relativePath2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const isExists = fs.existsSync(pageSrcDir);
|
||||||
|
if (isExists) {
|
||||||
|
traverse(pageSrcDir, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
}
|
||||||
};
|
);
|
||||||
traverse(pageSrcDir, '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
|
|
@ -198,6 +220,9 @@ module.exports = () => {
|
||||||
}
|
}
|
||||||
namespaceConfig[ns].path = path.replace(/\\/g, '/');
|
namespaceConfig[ns].path = path.replace(/\\/g, '/');
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
namespaceConfig[ns].path = `/${ns}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
namespaceConfig[ns].path = `/${ns}`;
|
namespaceConfig[ns].path = `/${ns}`;
|
||||||
|
|
@ -206,9 +231,7 @@ module.exports = () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Object.keys(pageFiles).length === 0) {
|
traversePages(nss);
|
||||||
traversePages();
|
|
||||||
}
|
|
||||||
|
|
||||||
const node = body.find(
|
const node = body.find(
|
||||||
ele => t.isVariableDeclaration(ele) && t.isIdentifier(ele.declarations[0].id) && ele.declarations[0].id.name === 'allRouters'
|
ele => t.isVariableDeclaration(ele) && t.isIdentifier(ele.declarations[0].id) && ele.declarations[0].id.name === 'allRouters'
|
||||||
|
|
@ -224,8 +247,8 @@ module.exports = () => {
|
||||||
const { path, notFound, first } = namespaceConfig[ns];
|
const { path, notFound, first } = namespaceConfig[ns];
|
||||||
|
|
||||||
const children = t.arrayExpression(
|
const children = t.arrayExpression(
|
||||||
Object.values(pageFiles).map(
|
Object.values(pageFiles[ns]).map(
|
||||||
(page) => makeRouterItem(page, path, first)
|
(page) => makeRouterItem(page, ns, path, first)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (notFound) {
|
if (notFound) {
|
||||||
|
|
@ -248,7 +271,7 @@ module.exports = () => {
|
||||||
t.arrowFunctionExpression(
|
t.arrowFunctionExpression(
|
||||||
[],
|
[],
|
||||||
t.callExpression(t.import(), [
|
t.callExpression(t.import(), [
|
||||||
t.stringLiteral(join('@project', 'pages', notFound, 'index').replace(/\\/g, '/'))
|
t.stringLiteral(join('@project', 'pages', ns, notFound, 'index').replace(/\\/g, '/'))
|
||||||
])
|
])
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
@ -298,7 +321,7 @@ module.exports = () => {
|
||||||
t.stringLiteral('react')
|
t.stringLiteral('react')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
addFileWatcher(namespaceConfig, body, filename);
|
addFileWatcher(filename, nss);
|
||||||
|
|
||||||
/* const { code } = transformFromAstSync(path.container);
|
/* const { code } = transformFromAstSync(path.container);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,13 +56,12 @@ function getClientEnvironment() {
|
||||||
// Useful for determining whether we’re running in production mode.
|
// Useful for determining whether we’re running in production mode.
|
||||||
// Most importantly, it switches React into the correct mode.
|
// Most importantly, it switches React into the correct mode.
|
||||||
NODE_ENV: process.env.NODE_ENV || 'development',
|
NODE_ENV: process.env.NODE_ENV || 'development',
|
||||||
// process.env.OAK_PLATFORM: wechatMp | wechatPublic | web | node
|
// process.env.OAK_PLATFORM: wechatMp | web | node
|
||||||
OAK_PLATFORM: 'wechatMp',
|
OAK_PLATFORM: 'wechatMp',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// Stringify all values so we can feed into webpack DefinePlugin
|
// Stringify all values so we can feed into webpack DefinePlugin
|
||||||
const stringified = {
|
const stringified = {
|
||||||
__DEV__: raw.NODE_ENV === 'development',
|
|
||||||
'process.env': Object.keys(raw).reduce((env, key) => {
|
'process.env': Object.keys(raw).reduce((env, key) => {
|
||||||
env[key] = JSON.stringify(raw[key]);
|
env[key] = JSON.stringify(raw[key]);
|
||||||
return env;
|
return env;
|
||||||
|
|
|
||||||
|
|
@ -88,13 +88,12 @@ function getClientEnvironment(publicUrl) {
|
||||||
// Whether or not react-refresh is enabled.
|
// Whether or not react-refresh is enabled.
|
||||||
// It is defined here so it is available in the webpackHotDevClient.
|
// It is defined here so it is available in the webpackHotDevClient.
|
||||||
FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
|
FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
|
||||||
// process.env.OAK_PLATFORM: wechatMp | wechatPublic | web | node
|
// process.env.OAK_PLATFORM: wechatMp | web | node
|
||||||
OAK_PLATFORM: 'web',
|
OAK_PLATFORM: 'web',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// Stringify all values so we can feed into webpack DefinePlugin
|
// Stringify all values so we can feed into webpack DefinePlugin
|
||||||
const stringified = {
|
const stringified = {
|
||||||
__DEV__: raw.NODE_ENV === 'development',
|
|
||||||
'process.env': Object.keys(raw).reduce((env, key) => {
|
'process.env': Object.keys(raw).reduce((env, key) => {
|
||||||
env[key] = JSON.stringify(raw[key]);
|
env[key] = JSON.stringify(raw[key]);
|
||||||
return env;
|
return env;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
|
||||||
"oak-memory-tree-store": "^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 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}",
|
||||||
|
|
@ -44,7 +44,7 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
|
||||||
"build:web": "${cliBinName} build --target web --mode production",
|
"build:web": "${cliBinName} build --target web --mode production",
|
||||||
"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 -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run copy-config-json",
|
||||||
"server:init": "${serverInitScript}",
|
"server:init": "${serverInitScript}",
|
||||||
"server:start": "${serverStartScript}",
|
"server:start": "${serverStartScript}",
|
||||||
"postinstall": "npm run make:domain"
|
"postinstall": "npm run make:domain"
|
||||||
|
|
@ -128,6 +128,7 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
"clean-webpack-plugin": "^4.0.0",
|
"clean-webpack-plugin": "^4.0.0",
|
||||||
"copy-webpack-plugin": "^10.2.4",
|
"copy-webpack-plugin": "^10.2.4",
|
||||||
|
"copyfiles": "^2.4.1",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^6.6.0",
|
"css-loader": "^6.6.0",
|
||||||
"css-minimizer-webpack-plugin": "^3.2.0",
|
"css-minimizer-webpack-plugin": "^3.2.0",
|
||||||
|
|
@ -178,6 +179,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",
|
||||||
|
"tsc-alias": "^1.8.2",
|
||||||
"tslib": "^2.4.0",
|
"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",
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ export function packageJsonContent({
|
||||||
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 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}",
|
||||||
|
|
@ -51,7 +51,7 @@ export function packageJsonContent({
|
||||||
"build:web": "${cliBinName} build --target web --mode production",
|
"build:web": "${cliBinName} build --target web --mode production",
|
||||||
"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 -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run copy-config-json",
|
||||||
"server:init": "${serverInitScript}",
|
"server:init": "${serverInitScript}",
|
||||||
"server:start": "${serverStartScript}",
|
"server:start": "${serverStartScript}",
|
||||||
"postinstall": "npm run make:domain"
|
"postinstall": "npm run make:domain"
|
||||||
|
|
@ -135,6 +135,7 @@ export function packageJsonContent({
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
"clean-webpack-plugin": "^4.0.0",
|
"clean-webpack-plugin": "^4.0.0",
|
||||||
"copy-webpack-plugin": "^10.2.4",
|
"copy-webpack-plugin": "^10.2.4",
|
||||||
|
"copyfiles": "^2.4.1",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^6.6.0",
|
"css-loader": "^6.6.0",
|
||||||
"css-minimizer-webpack-plugin": "^3.2.0",
|
"css-minimizer-webpack-plugin": "^3.2.0",
|
||||||
|
|
@ -185,6 +186,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",
|
||||||
|
"tsc-alias": "^1.8.2",
|
||||||
"tslib": "^2.4.0",
|
"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",
|
||||||
|
|
|
||||||
|
|
@ -1,194 +0,0 @@
|
||||||
:root[theme-color=cyan] {
|
|
||||||
--td-brand-color: #0594fa;
|
|
||||||
--td-brand-color-1: #d7eefe;
|
|
||||||
--td-brand-color-2: #aeddfd;
|
|
||||||
--td-brand-color-3: #84cafd;
|
|
||||||
--td-brand-color-4: #58b8fc;
|
|
||||||
--td-brand-color-5: #29a4fb;
|
|
||||||
--td-brand-color-6: #0594fa;
|
|
||||||
--td-brand-color-7: #29a4fb;
|
|
||||||
--td-brand-color-8: #0594fa;
|
|
||||||
--td-brand-color-9: #0378df;
|
|
||||||
--td-brand-color-10: #01409b;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=green] {
|
|
||||||
--td-brand-color-1: #e8f8f2;
|
|
||||||
--td-brand-color-2: #bcebdc;
|
|
||||||
--td-brand-color-3: #85dbbe;
|
|
||||||
--td-brand-color-4: #48c79c;
|
|
||||||
--td-brand-color-5: #00a870;
|
|
||||||
--td-brand-color-6: #078d5c;
|
|
||||||
--td-brand-color-7: #067945;
|
|
||||||
--td-brand-color-8: #00a870;
|
|
||||||
--td-brand-color-9: #044f2a;
|
|
||||||
--td-brand-color-10: #033017;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=yellow] {
|
|
||||||
--td-brand-color: #ebb105;
|
|
||||||
--td-brand-color-1: #fde9ab;
|
|
||||||
--td-brand-color-2: #fbd152;
|
|
||||||
--td-brand-color-3: #ebb105;
|
|
||||||
--td-brand-color-4: #dda204;
|
|
||||||
--td-brand-color-5: #ca8d03;
|
|
||||||
--td-brand-color-6: #b67803;
|
|
||||||
--td-brand-color-7: #fbd152;
|
|
||||||
--td-brand-color-8: #ebb105;
|
|
||||||
--td-brand-color-9: #dda204;
|
|
||||||
--td-brand-color-10: #603100;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=orange] {
|
|
||||||
--td-brand-color-1: #fce5d7;
|
|
||||||
--td-brand-color-2: #f8cdaf;
|
|
||||||
--td-brand-color-3: #f4b285;
|
|
||||||
--td-brand-color-4: #f19659;
|
|
||||||
--td-brand-color-5: #ed7b2f;
|
|
||||||
--td-brand-color-6: #e75510;
|
|
||||||
--td-brand-color-7: #f19659;
|
|
||||||
--td-brand-color-8: #ed7b2f;
|
|
||||||
--td-brand-color-9: #e75510;
|
|
||||||
--td-brand-color-10: #7f0a02;
|
|
||||||
--td-brand-color: #ed7b2f;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=red] {
|
|
||||||
--td-brand-color: #e34d59;
|
|
||||||
--td-brand-color-1: #fbe5e7;
|
|
||||||
--td-brand-color-2: #f7ccd0;
|
|
||||||
--td-brand-color-3: #f3b2b8;
|
|
||||||
--td-brand-color-4: #ef989f;
|
|
||||||
--td-brand-color-5: #ea7b84;
|
|
||||||
--td-brand-color-6: #e34d59;
|
|
||||||
--td-brand-color-7: #ea7b84;
|
|
||||||
--td-brand-color-8: #e34d59;
|
|
||||||
--td-brand-color-9: #e42c3a;
|
|
||||||
--td-brand-color-10: #8d0309;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=pink] {
|
|
||||||
--td-brand-color: #ed49b4;
|
|
||||||
--td-brand-color-1: #fce5f4;
|
|
||||||
--td-brand-color-2: #facae9;
|
|
||||||
--td-brand-color-3: #f7aede;
|
|
||||||
--td-brand-color-4: #f491d2;
|
|
||||||
--td-brand-color-5: #f172c5;
|
|
||||||
--td-brand-color-6: #ed49b4;
|
|
||||||
--td-brand-color-7: #f172c5;
|
|
||||||
--td-brand-color-8: #ed49b4;
|
|
||||||
--td-brand-color-9: #e80f9d;
|
|
||||||
--td-brand-color-10: #8f025e;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=purple] {
|
|
||||||
--td-brand-color: #834ec2;
|
|
||||||
--td-brand-color-1: #eee6f7;
|
|
||||||
--td-brand-color-2: #ddceee;
|
|
||||||
--td-brand-color-3: #ccb6e6;
|
|
||||||
--td-brand-color-4: #bb9edc;
|
|
||||||
--td-brand-color-5: #ab87d5;
|
|
||||||
--td-brand-color-6: #9a6fce;
|
|
||||||
--td-brand-color-7: #9a6fce;
|
|
||||||
--td-brand-color-8: #834ec2;
|
|
||||||
--td-brand-color-9: #783ac3;
|
|
||||||
--td-brand-color-10: #4c1397;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=cyan][theme-mode=dark] {
|
|
||||||
--td-brand-color: #29a4fb;
|
|
||||||
--td-brand-color-1: #01409b;
|
|
||||||
--td-brand-color-2: #0152b3;
|
|
||||||
--td-brand-color-3: #0264ca;
|
|
||||||
--td-brand-color-4: #0378df;
|
|
||||||
--td-brand-color-5: #0594fa;
|
|
||||||
--td-brand-color-6: #29a4fb;
|
|
||||||
--td-brand-color-7: #0594fa;
|
|
||||||
--td-brand-color-8: #29a4fb;
|
|
||||||
--td-brand-color-9: #58b8fc;
|
|
||||||
--td-brand-color-10: #d7eefe;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=green][theme-mode=dark] {
|
|
||||||
--td-brand-color: #03a56f;
|
|
||||||
--td-brand-color-1: #024b15;
|
|
||||||
--td-brand-color-2: #03965c;
|
|
||||||
--td-brand-color-3: #03a56f;
|
|
||||||
--td-brand-color-4: #04c383;
|
|
||||||
--td-brand-color-5: #03965c;
|
|
||||||
--td-brand-color-6: #03a56f;
|
|
||||||
--td-brand-color-7: #04c383;
|
|
||||||
--td-brand-color-8: #03a56f;
|
|
||||||
--td-brand-color-9: #05eb9f;
|
|
||||||
--td-brand-color-10: #91fdd9;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=yellow][theme-mode=dark] {
|
|
||||||
--td-brand-color: #ca8d03;
|
|
||||||
--td-brand-color-1: #603100;
|
|
||||||
--td-brand-color-2: #764101;
|
|
||||||
--td-brand-color-3: #8c5201;
|
|
||||||
--td-brand-color-4: #a16502;
|
|
||||||
--td-brand-color-5: #b67803;
|
|
||||||
--td-brand-color-6: #ca8d03;
|
|
||||||
--td-brand-color-7: #764101;
|
|
||||||
--td-brand-color-8: #ca8d03;
|
|
||||||
--td-brand-color-9: #a16502;
|
|
||||||
--td-brand-color-10: #fde9ab;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=orange][theme-mode=dark] {
|
|
||||||
--td-brand-color: #ed7b2f;
|
|
||||||
--td-brand-color-1: #692204;
|
|
||||||
--td-brand-color-2: #873105;
|
|
||||||
--td-brand-color-3: #a24006;
|
|
||||||
--td-brand-color-4: #c25110;
|
|
||||||
--td-brand-color-5: #d66724;
|
|
||||||
--td-brand-color-6: #ed8139;
|
|
||||||
--td-brand-color-7: #ff9852;
|
|
||||||
--td-brand-color-8: #ed7b2f;
|
|
||||||
--td-brand-color-9: #ed7b2f;
|
|
||||||
--td-brand-color-10: #fce5d7;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[theme-color=red][theme-mode=dark] {
|
|
||||||
--td-brand-color: #fb6e77;
|
|
||||||
--td-brand-color-1: #4f3335;
|
|
||||||
--td-brand-color-2: #960627;
|
|
||||||
--td-brand-color-3: #b01c37;
|
|
||||||
--td-brand-color-4: #c9384a;
|
|
||||||
--td-brand-color-5: #e35661;
|
|
||||||
--td-brand-color-6: #fb6e77;
|
|
||||||
--td-brand-color-7: #ff9195;
|
|
||||||
--td-brand-color-8: #fb6e77;
|
|
||||||
--td-brand-color-9: #ffd6d8;
|
|
||||||
--td-brand-color-10: #fff2f2;
|
|
||||||
}
|
|
||||||
|
|
||||||
root[theme-color=pink][theme-mode=dark] {
|
|
||||||
--td-brand-color: #ff70cf;
|
|
||||||
--td-brand-color-1: #5b374f;
|
|
||||||
--td-brand-color-2: #9b066d;
|
|
||||||
--td-brand-color-3: #bc088a;
|
|
||||||
--td-brand-color-4: #d435a0;
|
|
||||||
--td-brand-color-5: #ed53b7;
|
|
||||||
--td-brand-color-6: #ff70cf;
|
|
||||||
--td-brand-color-7: #ff99e4;
|
|
||||||
--td-brand-color-8: #ff70cf;
|
|
||||||
--td-brand-color-9: #ffdbfd;
|
|
||||||
--td-brand-color-10: #fff2ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
root[theme-color=purple][theme-mode=dark] {
|
|
||||||
--td-brand-color: #ab87d5;
|
|
||||||
--td-brand-color-1: #4c1397;
|
|
||||||
--td-brand-color-2: #6325b0;
|
|
||||||
--td-brand-color-3: #783ac3;
|
|
||||||
--td-brand-color-4: #834ec2;
|
|
||||||
--td-brand-color-5: #9a6fce;
|
|
||||||
--td-brand-color-6: #ab87d5;
|
|
||||||
--td-brand-color-7: #ab87d5;
|
|
||||||
--td-brand-color-8: #ab87d5;
|
|
||||||
--td-brand-color-9: #ccb6e6;
|
|
||||||
--td-brand-color-10: #eee6f7;
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
@import '@project/config/styles/web/index.less'; // 少量公共样式
|
@import '@project/config/styles/web/index.less'; // 少量公共样式
|
||||||
@import '@project/config/styles/web/theme.less';
|
|
||||||
Loading…
Reference in New Issue