neo-cmp-cli 1.0.18 → 1.0.19
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
CHANGED
package/src/module/previewCmp.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
1
|
const fs = require('fs');
|
|
3
2
|
const akfun = require('akfun');
|
|
4
3
|
const { consoleTag } = require('../utils/neoParams'); // 输出标记
|
|
5
|
-
const { resolveToCurrentRoot
|
|
6
|
-
const getConfigObj = require('../utils/getConfigObj');
|
|
4
|
+
const { resolveToCurrentRoot } = require('../utils/pathUtils');
|
|
7
5
|
const getCmpPreview = require('../utils/getCmpPreview');
|
|
8
6
|
|
|
9
|
-
// 获取当前项目的package文件
|
|
10
|
-
const currentPackageJsonDir = catchCurPackageJson();
|
|
11
|
-
const currentPackageJson = getConfigObj(currentPackageJsonDir);
|
|
12
|
-
|
|
13
7
|
/**
|
|
14
8
|
* 用于预览指定自定义组件
|
|
15
9
|
*/
|
|
@@ -35,7 +29,7 @@ module.exports = (config, cmpName, defaultComponentsDir = './src/components') =>
|
|
|
35
29
|
if (!fs.existsSync(tempDir)) {
|
|
36
30
|
fs.mkdirSync(tempDir);
|
|
37
31
|
}
|
|
38
|
-
const tempCmpDir = `${tempDir}/${
|
|
32
|
+
const tempCmpDir = `${tempDir}/${cmpName}`;
|
|
39
33
|
if (!fs.existsSync(tempCmpDir)) {
|
|
40
34
|
fs.mkdirSync(tempCmpDir);
|
|
41
35
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": "wibetter",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"preview": "neo preview",
|
|
13
|
+
"preview": "neo preview --cmpType=info-card",
|
|
14
14
|
"linkDebug": "neo linkDebug",
|
|
15
15
|
"publish2oss": "neo publish2oss",
|
|
16
16
|
"format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@commitlint/cli": "^8.3.5",
|
|
46
46
|
"@commitlint/config-conventional": "^9.1.1",
|
|
47
|
-
"neo-cmp-cli": "^1.0.
|
|
47
|
+
"neo-cmp-cli": "^1.0.19",
|
|
48
48
|
"husky": "^4.2.5",
|
|
49
49
|
"lint-staged": "^10.2.9",
|
|
50
50
|
"prettier": "^2.0.5"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": "wibetter",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"preview": "neo preview",
|
|
13
|
+
"preview": "neo preview --cmpType=info-card",
|
|
14
14
|
"linkDebug": "neo linkDebug",
|
|
15
15
|
"publish2oss": "neo publish2oss",
|
|
16
16
|
"format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@commitlint/config-conventional": "^9.1.1",
|
|
48
48
|
"@types/react": "^16.9.11",
|
|
49
49
|
"@types/react-dom": "^16.9.15",
|
|
50
|
-
"neo-cmp-cli": "^1.0.
|
|
50
|
+
"neo-cmp-cli": "^1.0.19",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": "wibetter",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"preview": "neo preview",
|
|
13
|
+
"preview": "neo preview --cmpType=info-card",
|
|
14
14
|
"linkDebug": "neo linkDebug",
|
|
15
15
|
"publish2oss": "neo publish2oss",
|
|
16
16
|
"format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@commitlint/cli": "^8.3.5",
|
|
46
46
|
"@commitlint/config-conventional": "^9.1.1",
|
|
47
|
-
"neo-cmp-cli": "^1.0.
|
|
47
|
+
"neo-cmp-cli": "^1.0.19",
|
|
48
48
|
"husky": "^4.2.5",
|
|
49
49
|
"lint-staged": "^10.2.9",
|
|
50
50
|
"prettier": "^2.0.5",
|