yo-unit 0.17.7 → 0.19.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/dist/index.js +149597 -0
- package/dist/types/__tests__/GetYoUnitTest.test.d.ts +1 -0
- package/dist/types/index.d.ts +11 -0
- package/package.json +20 -7
- package/src/__tests__/GetYoUnitTest.js +0 -9
- package/src/index.js +0 -31
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import assert from "yeoman-assert";
|
|
2
|
+
interface YoTestOptions {
|
|
3
|
+
source: string | {
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
params?: Record<string, unknown>;
|
|
7
|
+
options?: Record<string, unknown>;
|
|
8
|
+
build?: (...args: unknown[]) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const YoTest: ({ source, params, options, build }: YoTestOptions) => any;
|
|
11
|
+
export { YoTest, assert };
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.19.0",
|
|
3
3
|
"name": "yo-unit",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
@@ -19,15 +19,28 @@
|
|
|
19
19
|
"yeoman-environment": "^3.x",
|
|
20
20
|
"yeoman-test": "^6.x"
|
|
21
21
|
},
|
|
22
|
-
"
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/bun": "^1.3.12",
|
|
24
|
+
"typescript": "^6.0.2"
|
|
25
|
+
},
|
|
26
|
+
"exports": {
|
|
27
|
+
"types": "./dist/types/index.d.ts",
|
|
28
|
+
"require": "./dist/index.js",
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
32
|
+
"main": "./dist/index.js",
|
|
33
|
+
"module": "./dist/index.js",
|
|
23
34
|
"scripts": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
35
|
+
"build:clean": "find ./dist -name '*.*' | xargs rm -rf",
|
|
36
|
+
"build:src": "bun build src/index.ts --outdir dist --target node --external parse-ini-string --external yeoman-generator",
|
|
37
|
+
"build:types": "bun tsc -p ./",
|
|
38
|
+
"build": "npm run build:clean && npm run build:src && npm run build:types",
|
|
39
|
+
"test": "npm run build && bun test --timeout 5000 ./src/__tests__/",
|
|
40
|
+
"prepublishOnly": "npm t"
|
|
28
41
|
},
|
|
29
42
|
"files": [
|
|
30
|
-
"
|
|
43
|
+
"dist",
|
|
31
44
|
"package.json",
|
|
32
45
|
"README.md"
|
|
33
46
|
],
|
package/src/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const PATH = require("path");
|
|
2
|
-
const { STRING } = require("reshow-constant");
|
|
3
|
-
|
|
4
|
-
// for test
|
|
5
|
-
const YoTestLib = require("yeoman-test");
|
|
6
|
-
const assert = require("yeoman-assert");
|
|
7
|
-
|
|
8
|
-
const YoTest = ({ source, params, options = {}, build }) => {
|
|
9
|
-
const isStringSource = STRING === typeof source;
|
|
10
|
-
source = isStringSource ? PATH.join(source) : source;
|
|
11
|
-
const sourceName = isStringSource ? source : source.name;
|
|
12
|
-
|
|
13
|
-
let chain = YoTestLib.create(source)
|
|
14
|
-
.withPrompts(params)
|
|
15
|
-
.withOptions(options)
|
|
16
|
-
.inTmpDir((dir) => {
|
|
17
|
-
console.log(`Build Dest on: ${dir}`);
|
|
18
|
-
console.log(`Source : ${sourceName}`);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
if (build) {
|
|
22
|
-
chain = chain.build(build);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return chain.run();
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
module.exports = {
|
|
29
|
-
YoTest,
|
|
30
|
-
assert,
|
|
31
|
-
};
|