neo-cmp-cli 1.6.3 → 1.6.6
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/package.json +1 -1
- package/src/neo/neoService.js +5 -1
- package/src/template/antd-custom-cmp-template/package.json +1 -1
- package/src/template/echarts-custom-cmp-template/package.json +1 -1
- package/src/template/empty-custom-cmp-template/package.json +1 -1
- package/src/template/neo-custom-cmp-template/package.json +1 -1
- package/src/template/react-custom-cmp-template/package.json +1 -1
- package/src/template/react-ts-custom-cmp-template/package.json +1 -1
- package/src/template/vue2-custom-cmp-template/package.json +1 -1
- package/src/utils/autoEntryRootDir.js +1 -1
- package/src/utils/cmpUtils/createCmpByZip.js +1 -3
- package/src/utils/common.js +5 -5
- package/test/deprecate-versions.js +1 -1
package/package.json
CHANGED
package/src/neo/neoService.js
CHANGED
|
@@ -147,7 +147,11 @@ class NeoService {
|
|
|
147
147
|
const { access_token, expires_in } = response.data || {};
|
|
148
148
|
|
|
149
149
|
if (!access_token) {
|
|
150
|
-
errorLog(
|
|
150
|
+
errorLog(
|
|
151
|
+
'获取 token 失败(授权配置错误):响应中未包含 access_token,' +
|
|
152
|
+
JSON.stringify(response.data),
|
|
153
|
+
spinner
|
|
154
|
+
);
|
|
151
155
|
process.exit(1);
|
|
152
156
|
}
|
|
153
157
|
|
|
@@ -62,7 +62,7 @@ module.exports = function (projectPath, options = {}) {
|
|
|
62
62
|
|
|
63
63
|
// 输出 shell 命令让用户执行(这样可以真正改变 shell 的工作目录)
|
|
64
64
|
if (outputShellCommand) {
|
|
65
|
-
const command = `
|
|
65
|
+
const command = `neo open -n ${projectName}`;
|
|
66
66
|
// 输出提示信息
|
|
67
67
|
console.log('\n' + '='.repeat(60));
|
|
68
68
|
console.log('💡 提示:要切换到项目目录,请执行以下命令:');
|
|
@@ -273,9 +273,7 @@ module.exports = async function (cmpZipUrl, cmpName, componentBaseDir = './src/c
|
|
|
273
273
|
const newDeps = Object.keys(newPackageJsonDeps);
|
|
274
274
|
if (newDeps.length > 0) {
|
|
275
275
|
warningLog(
|
|
276
|
-
`检测到 package.json 中新增了 ${
|
|
277
|
-
newDeps.length
|
|
278
|
-
} 个依赖包:${newDeps.join(', ')}`
|
|
276
|
+
`检测到 package.json 中新增了 ${newDeps.length} 个依赖包:${newDeps.join(', ')}`
|
|
279
277
|
);
|
|
280
278
|
warningLog(
|
|
281
279
|
`为确保组件正常运行,请执行以下命令安装依赖:npm install 或 yarn install`
|
package/src/utils/common.js
CHANGED
|
@@ -51,13 +51,13 @@ function errorLog(message, spinner) {
|
|
|
51
51
|
const errorMessage = `${consoleTag} ${chalk.red(message)}`;
|
|
52
52
|
if (spinner) {
|
|
53
53
|
spinner.fail(errorMessage);
|
|
54
|
-
} else {
|
|
54
|
+
} else {
|
|
55
55
|
console.error(errorMessage);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// 输出黄色字体的警告日志
|
|
60
|
-
function warningLog(message) {
|
|
60
|
+
function warningLog(message, spinner) {
|
|
61
61
|
const warningMessage = `${consoleTag} ${chalk.yellow(message)}`;
|
|
62
62
|
if (spinner) {
|
|
63
63
|
spinner.warn(warningMessage);
|
|
@@ -67,7 +67,7 @@ function warningLog(message) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// 输出绿色字体的成功日志
|
|
70
|
-
function successLog(message) {
|
|
70
|
+
function successLog(message, spinner) {
|
|
71
71
|
const successMessage = `${consoleTag} ${chalk.green(message)}`;
|
|
72
72
|
if (spinner) {
|
|
73
73
|
spinner.succeed(successMessage);
|
|
@@ -84,11 +84,11 @@ function successLog(message) {
|
|
|
84
84
|
function parseTsConfigWithTypeScript(configPath) {
|
|
85
85
|
try {
|
|
86
86
|
const configFile = ts.readConfigFile(configPath, ts.sys.readFile);
|
|
87
|
-
|
|
87
|
+
|
|
88
88
|
if (configFile.error) {
|
|
89
89
|
throw new Error(`解析 tsconfig.json 失败: ${configFile.error.messageText}`);
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
return configFile.config;
|
|
93
93
|
} catch (error) {
|
|
94
94
|
if (error.code === 'MODULE_NOT_FOUND') {
|