neo-cmp-cli 1.8.5 → 1.8.6-beta.2
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/{src → bin}/index.js +18 -13
- package/bin/neo.js +1 -1
- package/package.json +3 -2
- package/src/main.js +15 -0
- package/src/utils/cmpUtils/createCmpByTemplate.js +1 -1
- package/src/utils/projectUtils/createCmpProjectByTemplate.js +1 -1
- package/template/antd-custom-cmp-template/neo.config.js +2 -2
- package/template/echarts-custom-cmp-template/neo.config.js +2 -2
- package/template/empty-custom-cmp-template/neo.config.js +2 -2
- package/template/neo-custom-cmp-template/neo.config.js +2 -2
- package/template/react-ts-custom-cmp-template/neo.config.js +2 -2
- package/test/demo.js +2 -2
- package/test/deprecate-versions.js +1 -1
package/{src → bin}/index.js
RENAMED
|
@@ -3,21 +3,26 @@ const yargs = require('yargs'); // 命令行工具
|
|
|
3
3
|
const chalk = require('chalk'); // 带样式的log输出
|
|
4
4
|
const inquirer = require('inquirer'); // 问答式交互
|
|
5
5
|
const ora = require('ora');
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
const {
|
|
7
|
+
neoInit,
|
|
8
|
+
neoInitByCopy,
|
|
9
|
+
inspect,
|
|
10
|
+
neoConfigInit,
|
|
11
|
+
validateProjectName,
|
|
12
|
+
getCmpTypeByDir,
|
|
13
|
+
NeoService,
|
|
14
|
+
NeoLoginService,
|
|
15
|
+
hasNeoProject,
|
|
16
|
+
consoleTag,
|
|
17
|
+
errorLog,
|
|
18
|
+
successLog
|
|
19
|
+
} = require('../dist/main.js');
|
|
20
|
+
const mainAction = require('../dist/main.js'); // 构建方法
|
|
18
21
|
// neo 的 package 文件
|
|
19
22
|
const neoPackage = require('../package.json');
|
|
20
|
-
|
|
23
|
+
|
|
24
|
+
// 获取当前项目根目录下的配置文件
|
|
25
|
+
const curConfig = mainAction.projectConfig;
|
|
21
26
|
|
|
22
27
|
const titleTip = function (msg) {
|
|
23
28
|
return chalk.green(chalk.bold(msg));
|
package/bin/neo.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
require('
|
|
2
|
+
require('./index');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neo-cmp-cli",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.6-beta.2",
|
|
4
4
|
"description": "Neo 自定义组件开发工具,支持react 和 vue2.0技术栈。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neo-cli",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"main": "src/main.js",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"neo": "neo",
|
|
17
|
+
"build2esm": "neo build2esm",
|
|
17
18
|
"format": "prettier --write \"src/**/**/*.{js,jsx,vue,tsx,ts,scss,less,json}\""
|
|
18
19
|
},
|
|
19
20
|
"files": [
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"adm-zip": "^0.5.10",
|
|
45
|
-
"akfun": "^5.1.
|
|
46
|
+
"akfun": "^5.1.21",
|
|
46
47
|
"axios": "^0.27.2",
|
|
47
48
|
"babel-plugin-import": "^1.13.8",
|
|
48
49
|
"chalk": "^4.0.0",
|
package/src/main.js
CHANGED
|
@@ -18,6 +18,12 @@ const deleteCmp = require('./utils/cmpUtils/deleteCmp');
|
|
|
18
18
|
const openProject = require('./utils/projectUtils/openProject');
|
|
19
19
|
const { configureNeoBuild } = require('./utils/configureNeoBuild');
|
|
20
20
|
const { errorLog, successLog } = require('./utils/common');
|
|
21
|
+
// 导出工具函数
|
|
22
|
+
const { validateProjectName } = require('./utils/projectNameValidator.js');
|
|
23
|
+
const getCmpTypeByDir = require('./utils/cmpUtils/getCmpTypeByDir.js');
|
|
24
|
+
const NeoService = require('./neo/neoService.js');
|
|
25
|
+
const NeoLoginService = require('./neo/neoLogin.js');
|
|
26
|
+
const hasNeoProject = require('./utils/projectUtils/hasNeoProject.js');
|
|
21
27
|
|
|
22
28
|
const getValue = (originValue, defaultValue) => {
|
|
23
29
|
return originValue !== undefined ? originValue : defaultValue;
|
|
@@ -77,6 +83,15 @@ module.exports = {
|
|
|
77
83
|
neoInitByCopy,
|
|
78
84
|
inspect,
|
|
79
85
|
neoConfigInit,
|
|
86
|
+
projectConfig: curConfig,
|
|
87
|
+
consoleTag,
|
|
88
|
+
errorLog,
|
|
89
|
+
successLog,
|
|
90
|
+
validateProjectName,
|
|
91
|
+
getCmpTypeByDir,
|
|
92
|
+
NeoService,
|
|
93
|
+
NeoLoginService,
|
|
94
|
+
hasNeoProject,
|
|
80
95
|
createCmpProjectByTemplate,
|
|
81
96
|
createCmpByTemplate,
|
|
82
97
|
dev: () => {
|
|
@@ -9,7 +9,7 @@ const hasNeoProject = require('./hasNeoProject');
|
|
|
9
9
|
const cmpTemplateList = {
|
|
10
10
|
'react-ts': {
|
|
11
11
|
projectName: 'empty-custom-cmp-template',
|
|
12
|
-
dir: path.resolve(__dirname, '
|
|
12
|
+
dir: path.resolve(__dirname, '../../../template/empty-custom-cmp-template')
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -9,8 +9,8 @@ function resolve(dir) {
|
|
|
9
9
|
// 包括生产和开发的环境配置信息
|
|
10
10
|
module.exports = {
|
|
11
11
|
settings: {
|
|
12
|
-
enableESLint:
|
|
13
|
-
enableESLintFix:
|
|
12
|
+
enableESLint: false, // 调试模式是否开启ESLint,默认开启ESLint检测代码格式
|
|
13
|
+
enableESLintFix: false, // 是否自动修正代码格式,默认不自动修正
|
|
14
14
|
enableStyleLint: false, // 是否开启StyleLint,默认开启ESLint检测代码格式
|
|
15
15
|
enableStyleLintFix: false, // 是否需要StyleLint自动修正代码格式
|
|
16
16
|
},
|
|
@@ -9,8 +9,8 @@ function resolve(dir) {
|
|
|
9
9
|
// 包括生产和开发的环境配置信息
|
|
10
10
|
module.exports = {
|
|
11
11
|
settings: {
|
|
12
|
-
enableESLint:
|
|
13
|
-
enableESLintFix:
|
|
12
|
+
enableESLint: false, // 调试模式是否开启ESLint,默认开启ESLint检测代码格式
|
|
13
|
+
enableESLintFix: false, // 是否自动修正代码格式,默认不自动修正
|
|
14
14
|
enableStyleLint: false, // 是否开启StyleLint,默认开启ESLint检测代码格式
|
|
15
15
|
enableStyleLintFix: false, // 是否需要StyleLint自动修正代码格式
|
|
16
16
|
},
|
|
@@ -9,8 +9,8 @@ function resolve(dir) {
|
|
|
9
9
|
// 包括生产和开发的环境配置信息
|
|
10
10
|
module.exports = {
|
|
11
11
|
settings: {
|
|
12
|
-
enableESLint:
|
|
13
|
-
enableESLintFix:
|
|
12
|
+
enableESLint: false, // 调试模式是否开启ESLint,默认开启ESLint检测代码格式
|
|
13
|
+
enableESLintFix: false, // 是否自动修正代码格式,默认不自动修正
|
|
14
14
|
enableStyleLint: false, // 是否开启StyleLint,默认开启ESLint检测代码格式
|
|
15
15
|
enableStyleLintFix: false, // 是否需要StyleLint自动修正代码格式
|
|
16
16
|
},
|
|
@@ -10,8 +10,8 @@ function resolve(dir) {
|
|
|
10
10
|
// 包括生产和开发的环境配置信息
|
|
11
11
|
module.exports = {
|
|
12
12
|
settings: {
|
|
13
|
-
enableESLint:
|
|
14
|
-
enableESLintFix:
|
|
13
|
+
enableESLint: false, // 调试模式是否开启ESLint,默认开启ESLint检测代码格式
|
|
14
|
+
enableESLintFix: false, // 是否自动修正代码格式,默认不自动修正
|
|
15
15
|
enableStyleLint: false, // 是否开启StyleLint,默认开启ESLint检测代码格式
|
|
16
16
|
enableStyleLintFix: false, // 是否需要StyleLint自动修正代码格式
|
|
17
17
|
},
|
|
@@ -9,8 +9,8 @@ function resolve(dir) {
|
|
|
9
9
|
// 包括生产和开发的环境配置信息
|
|
10
10
|
module.exports = {
|
|
11
11
|
settings: {
|
|
12
|
-
enableESLint:
|
|
13
|
-
enableESLintFix:
|
|
12
|
+
enableESLint: false, // 调试模式是否开启ESLint,默认开启ESLint检测代码格式
|
|
13
|
+
enableESLintFix: false, // 是否自动修正代码格式,默认不自动修正
|
|
14
14
|
enableStyleLint: false, // 是否开启StyleLint,默认开启ESLint检测代码格式
|
|
15
15
|
enableStyleLintFix: false, // 是否需要StyleLint自动修正代码格式
|
|
16
16
|
},
|
package/test/demo.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const {neoInit, neoConfigInit, inspect, preview, debug, build2lib, build2esm, neoInitByCopy, previewCmp } = require('../
|
|
1
|
+
const {neoInit, neoConfigInit, inspect, preview, debug, build2lib, build2esm, neoInitByCopy, previewCmp } = require('../dist/main');
|
|
2
2
|
const getEntries = require('../src/utils/projectUtils/getEntries');
|
|
3
3
|
const getEntriesWithAutoRegister = require('../src/utils/projectUtils/getEntriesWithAutoRegister');
|
|
4
|
-
|
|
4
|
+
inspect('dev');
|
|
5
5
|
// neoInitByCopy('react-ts', 'test123');
|
|
6
6
|
|
|
7
7
|
// previewCmp('info-card');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { execSync } = require('child_process');
|
|
2
2
|
|
|
3
3
|
// 所有需要废弃的版本
|
|
4
|
-
const versionsToDeprecate = ["1.
|
|
4
|
+
const versionsToDeprecate = ["1.8.6-beta.1", "1.8.6-beta.2"];
|
|
5
5
|
|
|
6
6
|
const packageName = 'neo-cmp-cli';
|
|
7
7
|
const deprecateMessage = '此版本为开发中版本(存在 bug),请升级到最新版本。';
|