yo-unit 0.0.1 → 0.16.0
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 +5 -4
- package/src/index.js +5 -2
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0
|
|
2
|
+
"version": "0.16.0",
|
|
3
3
|
"name": "yo-unit",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"author": "Hill <hill@kimo.com>",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"reshow-constant": "
|
|
16
|
-
"reshow-unit": "
|
|
15
|
+
"reshow-constant": "^0.16.0",
|
|
16
|
+
"reshow-unit": "^0.16.0",
|
|
17
17
|
"yeoman-assert": "*",
|
|
18
18
|
"yeoman-environment": "*",
|
|
19
19
|
"yeoman-test": "*"
|
|
@@ -32,5 +32,6 @@
|
|
|
32
32
|
],
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=14"
|
|
35
|
-
}
|
|
35
|
+
},
|
|
36
|
+
"gitHead": "be1806f6f2d188920e2c36ff2c150e584ef7d7fc"
|
|
36
37
|
}
|
package/src/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const PATH = require("path");
|
|
1
2
|
const { STRING } = require("reshow-constant");
|
|
2
3
|
|
|
3
4
|
// for test
|
|
@@ -7,13 +8,15 @@ const assert = require("yeoman-assert");
|
|
|
7
8
|
const getYoUnit = () => {
|
|
8
9
|
return {
|
|
9
10
|
YoTest: ({ source, params, options = {}, build }) => {
|
|
10
|
-
|
|
11
|
+
const isStringSource = STRING === typeof source;
|
|
12
|
+
source = isStringSource ? PATH.join(source) : source;
|
|
13
|
+
const sourceName = isStringSource ? source : source.name;
|
|
11
14
|
return YoTest.create(source)
|
|
12
15
|
.withPrompts(params)
|
|
13
16
|
.withOptions(options)
|
|
14
17
|
.inTmpDir((dir) => {
|
|
15
18
|
console.log(`Build Dest on: ${dir}`);
|
|
16
|
-
console.log(`Source : ${
|
|
19
|
+
console.log(`Source : ${sourceName}`);
|
|
17
20
|
})
|
|
18
21
|
.build(build)
|
|
19
22
|
.run();
|