kn-cli 1.0.126 → 1.0.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webpack.config.js +3 -3
- package/package.json +1 -1
- package/templates/template_admin/dev.sh +2 -1
- package/templates/template_admin/package.json +1 -1
- package/templates/template_admin/public/src/_antd.less +1 -1
- package/templates/template_admin/public/src/{_reset.less → _reset.module.less} +2 -2
- package/templates/template_admin/public/src/components/antd/tooltip/detail/index.jsx +1 -1
- package/templates/template_admin/public/src/components/antd/tooltip/detail/{index.less → index.module.less} +1 -1
- package/templates/template_admin/public/src/components/antd/tooltip/index.jsx +1 -1
- package/templates/template_admin/public/src/components/antd/tooltip/{index.less → index.module.less} +1 -1
- package/templates/template_admin/public/src/components/auth/index.jsx +1 -1
- package/templates/template_admin/public/src/components/badge/index.jsx +1 -1
- package/templates/template_admin/public/src/components/debug/index.jsx +1 -1
- package/templates/template_admin/public/src/components/empty/index.jsx +1 -1
- package/templates/template_admin/public/src/components/iconFont/index.jsx +1 -1
- package/templates/template_admin/public/src/components/image/index.jsx +1 -1
- package/templates/template_admin/public/src/components/image/preview.jsx +1 -1
- package/templates/template_admin/public/src/components/layout/basic/index.jsx +1 -1
- package/templates/template_admin/public/src/components/layout/basic/{index.less → index.module.less} +2 -2
- package/templates/template_admin/public/src/components/layout/index.jsx +1 -1
- package/templates/template_admin/public/src/components/layout/{index.less → index.module.less} +2 -2
- package/templates/template_admin/public/src/components/leftMenu/index.jsx +1 -1
- package/templates/template_admin/public/src/components/leftMenu/{index.less → index.module.less} +2 -2
- package/templates/template_admin/public/src/components/link/index.jsx +1 -1
- package/templates/template_admin/public/src/components/link/{index.less → index.module.less} +1 -1
- package/templates/template_admin/public/src/components/menuIcon/index.jsx +1 -1
- package/templates/template_admin/public/src/components/page/pageLoading/index.jsx +1 -1
- package/templates/template_admin/public/src/components/popup/index.jsx +1 -1
- package/templates/template_admin/public/src/components/table/column.jsx +1 -1
- package/templates/template_admin/public/src/components/table/index.jsx +1 -1
- package/templates/template_admin/public/src/components/text/index.jsx +1 -1
- package/templates/template_admin/public/src/components/toast/index.jsx +1 -1
- package/templates/template_admin/public/src/components/toast/{index.less → index.module.less} +1 -1
- package/templates/template_admin/public/src/components/topMenu/index.jsx +1 -1
- package/templates/template_admin/public/src/components/topMenu/{index.less → index.module.less} +2 -2
- package/templates/template_admin/public/src/components/topMenu/topBar/index.jsx +1 -1
- package/templates/template_admin/public/src/components/topMenu/topBar/{index.less → index.module.less} +1 -1
- package/templates/template_admin/public/src/components/video/index.jsx +1 -1
- package/templates/template_admin/public/src/components/video/preview.jsx +1 -1
- package/templates/template_admin/public/src/index.jsx +1 -1
- package/templates/template_admin/public/src/pages/auth/user/create/index.jsx +1 -1
- package/templates/template_admin/public/src/pages/components/layout/index.jsx +1 -1
- package/templates/template_admin/public/src/pages/components/layout/{index.less → index.module.less} +1 -1
- package/templates/template_admin/public/src/pages/components/layout/titleBar/index.jsx +1 -1
- package/templates/template_admin/public/src/pages/components/layout/titleBar/{index.less → index.module.less} +1 -1
- package/templates/template_admin/public/src/pages/error/permission.jsx +1 -1
- package/templates/template_admin/public/src/pages/home.jsx +1 -1
- package/templates/template_admin/public/src/pages/login/index.jsx +1 -1
- package/templates/template_admin/public/src/pages/login/{index.less → index.module.less} +1 -1
- package/templates/template_admin/public/src/pages/pageTemplate.jsx +1 -1
- package/templates/template_admin/renamejstojsx.js +45 -0
- package/templates/template_admin/renameless.js +53 -0
- package/templates/template_admin/webpack.api.js +54 -14
- /package/templates/template_admin/public/src/{_mixin.less → _mixin.module.less} +0 -0
- /package/templates/template_admin/public/src/{_variable.less → _variable.module.less} +0 -0
- /package/templates/template_admin/public/src/assets/iconfont/{iconfont.less → iconfont.module.less} +0 -0
- /package/templates/template_admin/public/src/components/auth/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/badge/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/debug/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/empty/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/iconFont/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/image/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/menuIcon/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/page/pageLoading/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/popup/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/table/{column.less → column.module.less} +0 -0
- /package/templates/template_admin/public/src/components/table/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/text/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/components/video/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/dictionary/{index.js → index.jsx} +0 -0
- /package/templates/template_admin/public/src/pages/auth/user/create/{index.less → index.module.less} +0 -0
- /package/templates/template_admin/public/src/pages/error/{permission.less → permission.module.less} +0 -0
- /package/templates/template_admin/public/src/pages/{home.less → home.module.less} +0 -0
- /package/templates/template_admin/public/src/provider/{menu.less → menu.module.less} +0 -0
package/build/webpack.config.js
CHANGED
|
@@ -178,7 +178,7 @@ if(process.env.build_env == 'localdebug'){
|
|
|
178
178
|
|
|
179
179
|
const rules= [
|
|
180
180
|
{
|
|
181
|
-
test: /\.js[x]?$/,
|
|
181
|
+
test: /\.[m]?js[x]?$/,
|
|
182
182
|
exclude: /node_modules/,
|
|
183
183
|
use: LOADER_JS,
|
|
184
184
|
},
|
|
@@ -289,7 +289,7 @@ if(CLI_CONFIG.rules){
|
|
|
289
289
|
if(CLI_CONFIG.rules.compileNpmPackage){
|
|
290
290
|
let JS_LIST= CLI_CONFIG.rules.compileNpmPackage.join('|');
|
|
291
291
|
rules.push({
|
|
292
|
-
test: /\.js[x]?$/,
|
|
292
|
+
test: /\.[m]?js[x]?$/,
|
|
293
293
|
include: new RegExp(`(${JS_LIST})`),
|
|
294
294
|
use: LOADER_JS
|
|
295
295
|
},)
|
|
@@ -521,9 +521,9 @@ const config={
|
|
|
521
521
|
output: output,
|
|
522
522
|
resolve: {
|
|
523
523
|
modules: [
|
|
524
|
+
'node_modules',
|
|
524
525
|
path.resolve(dirname,'node_modules'),
|
|
525
526
|
path.resolve(webpackPath, 'node_modules'),
|
|
526
|
-
'node_modules',
|
|
527
527
|
],
|
|
528
528
|
extensions: ['.jsx', '.js', '.json','.mjs'],
|
|
529
529
|
alias: {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { Modal } from "@/components/antd";
|
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
import Popup from "@/components/popup";
|
|
7
7
|
import { LayoutLanguage } from "@/components/layout/provider";
|
|
8
|
-
import styles from './index.less';
|
|
8
|
+
import styles from './index.module.less';
|
|
9
9
|
import { useEffect } from "react";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -7,7 +7,7 @@ import ProviderApp from '@/provider/app';
|
|
|
7
7
|
|
|
8
8
|
import {useLoading} from '@/hooks/index';
|
|
9
9
|
// @ts-ignore
|
|
10
|
-
import styles from './index.less';
|
|
10
|
+
import styles from './index.module.less';
|
|
11
11
|
import { AUTH_DEBUG_OPEN } from '@/config';
|
|
12
12
|
import Page403 from '@/pages/error/403';
|
|
13
13
|
|
|
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
|
|
|
3
3
|
import { Image } from '@/components/antd';
|
|
4
4
|
import ShowPreview from './preview';
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import styles from './index.less';
|
|
6
|
+
import styles from './index.module.less';
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
import imgFail from '@/assets/images/loadFail.png';
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ import { Image,Button,Space } from '@/components/antd';
|
|
|
4
4
|
import { CloseOutlined } from '@ant-design/icons';
|
|
5
5
|
import Popup from '@/components/popup';
|
|
6
6
|
// @ts-ignore
|
|
7
|
-
import styles from './index.less';
|
|
7
|
+
import styles from './index.module.less';
|
|
8
8
|
|
|
9
9
|
const ModalPreview = (props) => {
|
|
10
10
|
const { destory,data=[] } = props;
|
|
@@ -2,7 +2,7 @@ import React,{useCallback} from 'react';
|
|
|
2
2
|
// @ts-ignore
|
|
3
3
|
import { Table } from '@/components/antd';
|
|
4
4
|
// @ts-ignore
|
|
5
|
-
import styles from './index.less';
|
|
5
|
+
import styles from './index.module.less';
|
|
6
6
|
import Column from './column';
|
|
7
7
|
|
|
8
8
|
export const SCROLL_CONFIG={x:'max-content',y:550}
|
|
@@ -3,7 +3,7 @@ import React, { useEffect, useState, useRef } from 'react';
|
|
|
3
3
|
import { Tooltip } from '@/components/antd';
|
|
4
4
|
import { getStrByteLen } from '@/utils';
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import styles from './index.less';
|
|
6
|
+
import styles from './index.module.less';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* 获取字符串末尾字节数的字符串、所在位置
|
|
@@ -3,7 +3,7 @@ import ReactDom from 'react-dom';
|
|
|
3
3
|
import { CloseOutlined } from '@ant-design/icons';
|
|
4
4
|
import Popup from '@/components/popup';
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import styles from './index.less';
|
|
6
|
+
import styles from './index.module.less';
|
|
7
7
|
|
|
8
8
|
const ModalPreview = (props) => {
|
|
9
9
|
const { destory, src } = props;
|
|
@@ -5,7 +5,7 @@ import { useNavigate } from 'react-router-dom';
|
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
import imgArrow from '@/assets/images/arrow.png';
|
|
7
7
|
// @ts-ignore
|
|
8
|
-
import styles from './index.less';
|
|
8
|
+
import styles from './index.module.less';
|
|
9
9
|
|
|
10
10
|
const TitleBar = (props) => {
|
|
11
11
|
const { optionLeft, optionRight,label,showBack,className='' } = props;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
// --- 配置区 ---
|
|
6
|
+
// 将这里的 'public/src' 修改为你实际的源码目录
|
|
7
|
+
const TARGET_DIR = './public/src';
|
|
8
|
+
|
|
9
|
+
// 获取绝对路径
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const rootPath = path.resolve(__dirname, TARGET_DIR);
|
|
12
|
+
|
|
13
|
+
const FILE_LIST=[
|
|
14
|
+
'dictionary/index.js',
|
|
15
|
+
'pages/bullet/gdtAssets/audienceManage/targetTemplate/dxbTemplate/weiChatPcMarket/components/index.js',
|
|
16
|
+
'pages/bullet/kuaiShou/creativeTag/create/index.js',
|
|
17
|
+
'pages/bullet/material/word/wordManagement/create/index.js',
|
|
18
|
+
'utils/version.js',
|
|
19
|
+
'pages/components/select/userState/index.js',
|
|
20
|
+
'pages/bullet/material/word/wordManagement/index.js',
|
|
21
|
+
'pages/components/select/userZero/index.js',
|
|
22
|
+
'pages/bullet/selfLandingPage/landingPage/htmlModal/index.js',
|
|
23
|
+
'pages/dashboard/components/batchGlobalModal/formItemsConfig.js',
|
|
24
|
+
'pages/equipment/tag/create/index.js'
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
let count = 0;
|
|
28
|
+
FILE_LIST.forEach(file=>{
|
|
29
|
+
const filePath = rootPath+'/'+file;
|
|
30
|
+
console.log(`🚀 开始处理: ${filePath}`);
|
|
31
|
+
const stats = fs.statSync(filePath);
|
|
32
|
+
if (stats.isFile()) {
|
|
33
|
+
const newFilePath = filePath.replace(/\.js$/, '.jsx');
|
|
34
|
+
// 执行重命名
|
|
35
|
+
try {
|
|
36
|
+
// fs.renameSync(filePath, newFilePath);
|
|
37
|
+
console.log(`✅ Renamed: ${file} -> ${path.basename(newFilePath)}`);
|
|
38
|
+
count++;
|
|
39
|
+
} catch (err) {
|
|
40
|
+
console.error(`❌ Failed: ${file}`, err);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
console.log(`\n✨ 完成!共重命名了 ${count} 个文件。`);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
// --- 配置区 ---
|
|
6
|
+
// 将这里的 'public/src' 修改为你实际的源码目录
|
|
7
|
+
const TARGET_DIR = './public/src';
|
|
8
|
+
|
|
9
|
+
// 获取绝对路径
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const rootPath = path.resolve(__dirname, TARGET_DIR);
|
|
12
|
+
|
|
13
|
+
let count = 0;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 递归遍历并重命名
|
|
17
|
+
* @param {string} dir
|
|
18
|
+
*/
|
|
19
|
+
function walk(dir) {
|
|
20
|
+
const files = fs.readdirSync(dir);
|
|
21
|
+
|
|
22
|
+
files.forEach((file) => {
|
|
23
|
+
const filePath = path.join(dir, file);
|
|
24
|
+
const stats = fs.statSync(filePath);
|
|
25
|
+
|
|
26
|
+
if (stats.isDirectory()) {
|
|
27
|
+
// 递归进入子目录
|
|
28
|
+
walk(filePath);
|
|
29
|
+
} else if (stats.isFile()) {
|
|
30
|
+
// 匹配逻辑:以 .less 结尾,但不是以 .module.less 结尾
|
|
31
|
+
if (file.endsWith('.less') && !file.endsWith('.module.less')) {
|
|
32
|
+
const newFilePath = filePath.replace(/\.less$/, '.module.less');
|
|
33
|
+
|
|
34
|
+
// 执行重命名
|
|
35
|
+
try {
|
|
36
|
+
fs.renameSync(filePath, newFilePath);
|
|
37
|
+
console.log(`✅ Renamed: ${file} -> ${path.basename(newFilePath)}`);
|
|
38
|
+
count++;
|
|
39
|
+
} catch (err) {
|
|
40
|
+
console.error(`❌ Failed: ${file}`, err);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
console.log(`🚀 开始处理目录: ${rootPath}`);
|
|
48
|
+
if (fs.existsSync(rootPath)) {
|
|
49
|
+
walk(rootPath);
|
|
50
|
+
console.log(`\n✨ 完成!共重命名了 ${count} 个文件。`);
|
|
51
|
+
} else {
|
|
52
|
+
console.error(`❌ 错误:目录 ${rootPath} 不存在,请检查配置。`);
|
|
53
|
+
}
|
|
@@ -21,36 +21,76 @@ const configs = {
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
const API_PROXY= {
|
|
24
|
-
'/
|
|
25
|
-
target:
|
|
24
|
+
'/uatapi':{
|
|
25
|
+
target:'https://uat-zeus.kingnet.com/',
|
|
26
26
|
changeOrigin: true,
|
|
27
|
-
logLevel: '
|
|
27
|
+
logLevel: 'error',
|
|
28
28
|
pathRewrite: {
|
|
29
|
-
'^/
|
|
29
|
+
'^/uatapi': '', // rewrite path
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
'/devapi
|
|
32
|
+
'/devapi':{
|
|
33
33
|
target:'https://dev-zeus.kingnet.com/',
|
|
34
34
|
changeOrigin: true,
|
|
35
|
-
logLevel: '
|
|
35
|
+
logLevel: 'error',
|
|
36
36
|
pathRewrite: {
|
|
37
|
-
'^/devapi': '
|
|
37
|
+
'^/devapi': '', // rewrite path
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
|
-
'/preapi
|
|
40
|
+
'/preapi': {
|
|
41
41
|
target:'https://pre-zeus.kingnet.com/',
|
|
42
42
|
changeOrigin: true,
|
|
43
|
-
logLevel: '
|
|
43
|
+
logLevel: 'error',
|
|
44
44
|
pathRewrite: {
|
|
45
|
-
'^/preapi': '
|
|
46
|
-
}
|
|
45
|
+
'^/preapi': '', // rewrite path
|
|
46
|
+
}
|
|
47
47
|
},
|
|
48
|
-
'/prodapi
|
|
48
|
+
'/prodapi': {
|
|
49
49
|
target:'https://zeus.kingnet.com/',
|
|
50
50
|
changeOrigin: true,
|
|
51
|
-
logLevel: '
|
|
51
|
+
logLevel: 'error',
|
|
52
|
+
pathRewrite: {
|
|
53
|
+
'^/prodapi': '', // rewrite path
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
'/report-api': {
|
|
57
|
+
target: 'http://192.168.100.22:8085/api-report',
|
|
58
|
+
changeOrigin: true,
|
|
59
|
+
logLevel: 'error',
|
|
60
|
+
pathRewrite: {
|
|
61
|
+
'^/report-api': '', // rewrite path
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
'/uat-report-api': {
|
|
65
|
+
target: 'https://uat-zeus.kingnet.com/api-report',
|
|
66
|
+
changeOrigin: true,
|
|
67
|
+
logLevel: 'error',
|
|
68
|
+
pathRewrite: {
|
|
69
|
+
'^/uat-report-api': '', // rewrite path
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
'/dev-report-api': {
|
|
73
|
+
target: 'https://dev-zeus.kingnet.com/api-report',
|
|
74
|
+
changeOrigin: true,
|
|
75
|
+
logLevel: 'error',
|
|
76
|
+
pathRewrite: {
|
|
77
|
+
'^/dev-report-api': '', // rewrite path
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
'/prod-report-api': {
|
|
81
|
+
target: 'https://zeus.kingnet.com/api-report',
|
|
82
|
+
changeOrigin: true,
|
|
83
|
+
logLevel: 'error',
|
|
84
|
+
pathRewrite: {
|
|
85
|
+
'^/prod-report-api': '', // rewrite path
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
'/pre-report-api': {
|
|
89
|
+
target: 'https://pre-zeus.kingnet.com/api-report',
|
|
90
|
+
changeOrigin: true,
|
|
91
|
+
logLevel: 'error',
|
|
52
92
|
pathRewrite: {
|
|
53
|
-
'^/
|
|
93
|
+
'^/pre-report-api': '', // rewrite path
|
|
54
94
|
},
|
|
55
95
|
},
|
|
56
96
|
};
|
|
File without changes
|
|
File without changes
|
/package/templates/template_admin/public/src/assets/iconfont/{iconfont.less → iconfont.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/auth/{index.less → index.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/badge/{index.less → index.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/debug/{index.less → index.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/empty/{index.less → index.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/iconFont/{index.less → index.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/image/{index.less → index.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/menuIcon/{index.less → index.module.less}
RENAMED
|
File without changes
|
|
File without changes
|
/package/templates/template_admin/public/src/components/popup/{index.less → index.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/table/{column.less → column.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/table/{index.less → index.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/text/{index.less → index.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/components/video/{index.less → index.module.less}
RENAMED
|
File without changes
|
|
File without changes
|
/package/templates/template_admin/public/src/pages/auth/user/create/{index.less → index.module.less}
RENAMED
|
File without changes
|
/package/templates/template_admin/public/src/pages/error/{permission.less → permission.module.less}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|