create-yarn-workspaces 2.0.6 → 2.0.9
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/CHANGELOG.md +50 -0
- package/jest.config.js +115 -23
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,56 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.9](https://github.com/bluelovers/ws-yarn-workspaces/compare/create-yarn-workspaces@2.0.8...create-yarn-workspaces@2.0.9) (2022-08-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### 💎 Styles
|
|
10
|
+
|
|
11
|
+
* normalize deps semver ([245f3cf](https://github.com/bluelovers/ws-yarn-workspaces/commit/245f3cf34408c3c7e0628a6e18127122dd3e0f44))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.0.8](https://github.com/bluelovers/ws-yarn-workspaces/compare/create-yarn-workspaces@2.0.7...create-yarn-workspaces@2.0.8) (2022-08-13)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### ✨ Features
|
|
21
|
+
|
|
22
|
+
* update preset scripts ([a286355](https://github.com/bluelovers/ws-yarn-workspaces/commit/a286355a578654937a660f7ad04d190a21f29e92))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### 🚨 Tests
|
|
26
|
+
|
|
27
|
+
* update jest.config.js and deps ([d1d501b](https://github.com/bluelovers/ws-yarn-workspaces/commit/d1d501ba059130bd8f90e6eaa266084110698011))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### 📌 Dependencies
|
|
31
|
+
|
|
32
|
+
* update deps ([58501f9](https://github.com/bluelovers/ws-yarn-workspaces/commit/58501f97494eb624779dffea7ac9d68e45e5e978))
|
|
33
|
+
* update deps ([c968045](https://github.com/bluelovers/ws-yarn-workspaces/commit/c96804598f63a5cd06507e3eaaa2e8b569b14b65))
|
|
34
|
+
* update deps ([a0b8755](https://github.com/bluelovers/ws-yarn-workspaces/commit/a0b875582efdc9829b0cdb6c9c819cace8b76e90))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## [2.0.7](https://github.com/bluelovers/ws-yarn-workspaces/compare/create-yarn-workspaces@2.0.6...create-yarn-workspaces@2.0.7) (2022-07-31)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### 🚨 Tests
|
|
44
|
+
|
|
45
|
+
* **preset:** use `@bluelovers/jest-config` ([e239ecf](https://github.com/bluelovers/ws-yarn-workspaces/commit/e239ecf606d82930c6036ec1241bf3b4a1095423))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### 📌 Dependencies
|
|
49
|
+
|
|
50
|
+
* update deps ([138af6b](https://github.com/bluelovers/ws-yarn-workspaces/commit/138af6b1e69373e04539badb61127172d9938e55))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
6
56
|
## [2.0.6](https://github.com/bluelovers/ws-yarn-workspaces/compare/create-yarn-workspaces@2.0.5...create-yarn-workspaces@2.0.6) (2022-07-29)
|
|
7
57
|
|
|
8
58
|
**Note:** Version bump only for package create-yarn-workspaces
|
package/jest.config.js
CHANGED
|
@@ -1,24 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//"jest-extended-extra",
|
|
12
|
-
//"jest-num-close-with",
|
|
13
|
-
],
|
|
14
|
-
transform: {
|
|
15
|
-
'^.+\\.ts$': 'ts-jest',
|
|
16
|
-
},
|
|
17
|
-
verbose: true,
|
|
18
|
-
/**
|
|
19
|
-
* if didn't set `coverageProvider` to `v8`
|
|
20
|
-
* with `collectCoverage` `true`, nodejs debug point maybe will fail
|
|
21
|
-
*/
|
|
22
|
-
coverageProvider: 'v8',
|
|
23
|
-
collectCoverage: false,
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
const { basename, extname, dirname } = require('path');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* // @type { import('@jest/types').Config.InitialOptions }
|
|
7
|
+
* @type { import('ts-jest').InitialOptionsTsJest }
|
|
8
|
+
*/
|
|
9
|
+
let jestConfig = {
|
|
10
|
+
|
|
24
11
|
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} name
|
|
15
|
+
* @returns {string}
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
function _requireResolve(name)
|
|
19
|
+
{
|
|
20
|
+
let result;
|
|
21
|
+
|
|
22
|
+
try
|
|
23
|
+
{
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
const { requireResolveExtra, requireResolveCore } = require('@yarn-tool/require-resolve');
|
|
26
|
+
|
|
27
|
+
const paths = [
|
|
28
|
+
requireResolveExtra('@bluelovers/tsdx').result,
|
|
29
|
+
requireResolveExtra('tsdx').result,
|
|
30
|
+
].filter(Boolean);
|
|
31
|
+
|
|
32
|
+
result = requireResolveCore(name, {
|
|
33
|
+
includeGlobal: true,
|
|
34
|
+
includeCurrentDirectory: true,
|
|
35
|
+
paths,
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
catch (e)
|
|
39
|
+
{
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
result = result || require.resolve(name);
|
|
44
|
+
|
|
45
|
+
console.info('[require.resolve]', name, '=>', result)
|
|
46
|
+
|
|
47
|
+
return result
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let _ok = true;
|
|
51
|
+
|
|
52
|
+
try
|
|
53
|
+
{
|
|
54
|
+
if (!jestConfig.preset)
|
|
55
|
+
{
|
|
56
|
+
|
|
57
|
+
let result = require('@yarn-tool/ws-find-up-paths').findUpPathsWorkspaces([
|
|
58
|
+
'jest-preset.js',
|
|
59
|
+
'jest.config.js',
|
|
60
|
+
], {
|
|
61
|
+
ignoreCurrentPackage: true,
|
|
62
|
+
onlyFiles: true,
|
|
63
|
+
}).result;
|
|
64
|
+
|
|
65
|
+
if (result)
|
|
66
|
+
{
|
|
67
|
+
let name = basename(result, extname(result))
|
|
68
|
+
|
|
69
|
+
switch (name)
|
|
70
|
+
{
|
|
71
|
+
case 'jest-preset':
|
|
72
|
+
jestConfig.preset = dirname(result);
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
jestConfig = {
|
|
76
|
+
...require(result),
|
|
77
|
+
jestConfig,
|
|
78
|
+
};
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
_ok = false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (e)
|
|
87
|
+
{
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
try
|
|
92
|
+
{
|
|
93
|
+
if (_ok && !jestConfig.preset)
|
|
94
|
+
{
|
|
95
|
+
let result = _requireResolve('@bluelovers/jest-config/package.json');
|
|
96
|
+
if (result)
|
|
97
|
+
{
|
|
98
|
+
jestConfig.preset = dirname(result);
|
|
99
|
+
_ok = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (e)
|
|
104
|
+
{
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (_ok && !jestConfig.preset)
|
|
109
|
+
{
|
|
110
|
+
jestConfig.preset = '@bluelovers/jest-config';
|
|
111
|
+
_ok = false;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
console.info(`jest.config.preset: ${jestConfig.preset}`);
|
|
115
|
+
|
|
116
|
+
module.exports = jestConfig
|
package/lib/index.js
CHANGED
|
@@ -17,13 +17,14 @@ function getDefaultPackageJson(name) {
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": (0, ws_root_scripts_1.defaultWorkspaceRootScripts)(),
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"ts-type": "^1.
|
|
21
|
-
"tslib": "^2
|
|
20
|
+
"ts-type": "^2.1.10",
|
|
21
|
+
"tslib": "^2",
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/jest": "^
|
|
25
|
-
"@bluelovers/tsconfig": "^1.0.
|
|
24
|
+
"@types/jest": "^28.1.6",
|
|
25
|
+
"@bluelovers/tsconfig": "^1.0.30",
|
|
26
26
|
"@types/node": "*",
|
|
27
|
+
"@yarn-tool/ws-find-up-paths": "*",
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
30
|
"lerna": "*",
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0FAAmG;AACnG,sEAA8E;AAE9E,SAAgB,qBAAqB,CAAC,IAAa;IAElD,IAAI,IAAI,GAAiB;QACxB,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,OAAO;QAClB,SAAS,EAAE,IAAI;QACf,gBAAgB,EAAE,cAAc;QAChC,YAAY,EAAE;YACb,YAAY;SACZ;QACD,QAAQ,EAAE;YACT,qBAAqB;SACrB;QACD,SAAS,EAAE,IAAA,6CAA2B,GAAE;QACxC,cAAc,EAAE;YACf,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,0FAAmG;AACnG,sEAA8E;AAE9E,SAAgB,qBAAqB,CAAC,IAAa;IAElD,IAAI,IAAI,GAAiB;QACxB,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,OAAO;QAClB,SAAS,EAAE,IAAI;QACf,gBAAgB,EAAE,cAAc;QAChC,YAAY,EAAE;YACb,YAAY;SACZ;QACD,QAAQ,EAAE;YACT,qBAAqB;SACrB;QACD,SAAS,EAAE,IAAA,6CAA2B,GAAE;QACxC,cAAc,EAAE;YACf,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,IAAI;SACb;QACD,iBAAiB,EAAE;YAClB,aAAa,EAAE,SAAS;YACxB,sBAAsB,EAAE,SAAS;YACjC,aAAa,EAAE,GAAG;YAClB,6BAA6B,EAAE,GAAG;SAClC;QACD,kBAAkB,EAAE;YACnB,OAAO,EAAE,GAAG;YACZ,MAAM,EAAE,GAAG;YACX,MAAM,EAAE,GAAG;YACX,YAAY,EAAE,GAAG;YACjB,SAAS,EAAE,GAAG;YACd,4BAA4B,EAAE,GAAG;YACjC,WAAW,EAAE,GAAG;YAChB,+CAA+C,EAAE,GAAG;SACpD;QACD,aAAa,EAAE,EAAE;KACV,CAAC;IAET,IAAA,wBAAgB,EAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAE7C,OAAO,IAAI,CAAC;AACb,CAAC;AAxCD,sDAwCC;AAED,SAAgB,kBAAkB;IAEjC,OAAO;QACN,OAAO,EAAE,uCAAuC;KAChD,CAAA;AACF,CAAC;AALD,gDAKC","sourcesContent":["import { IPackageJson } from '@ts-type/package-dts/package-json';\nimport { defaultWorkspaceRootScripts } from '@yarn-tool/pkg-entry-util/lib/preset/ws-root-scripts';\nimport { fillDummyScripts } from '@yarn-tool/pkg-entry-util/lib/preset/dummy';\n\nexport function getDefaultPackageJson(name?: string): IPackageJson\n{\n\tlet json: IPackageJson = {\n\t\t\"name\": name,\n\t\t\"version\": \"1.0.0\",\n\t\t\"private\": true,\n\t\t\"packageManager\": \"yarn@1.22.19\",\n\t\t\"workspaces\": [\n\t\t\t\"packages/*\",\n\t\t],\n\t\tkeywords: [\n\t\t\t\"create-by-yarn-tool\",\n\t\t],\n\t\t\"scripts\": defaultWorkspaceRootScripts(),\n\t\t\"dependencies\": {\n\t\t\t\"ts-type\": \"^2.1.10\",\n\t\t\t\"tslib\": \"^2\",\n\t\t},\n\t\t\"devDependencies\": {\n\t\t\t\"@types/jest\": \"^28.1.6\",\n\t\t\t\"@bluelovers/tsconfig\": \"^1.0.30\",\n\t\t\t\"@types/node\": \"*\",\n\t\t\t\"@yarn-tool/ws-find-up-paths\": \"*\",\n\t\t},\n\t\t\"peerDependencies\": {\n\t\t\t\"lerna\": \"*\",\n\t\t\t\"yarn\": \"*\",\n\t\t\t\"ynpx\": \"*\",\n\t\t\t\"typescript\": \"*\",\n\t\t\t\"ts-node\": \"*\",\n\t\t\t\"@yarn-tool/require-resolve\": \"*\",\n\t\t\t\"yarn-tool\": \"*\",\n\t\t\t\"@bluelovers/conventional-changelog-bluelovers\": \"*\",\n\t\t},\n\t\t\"resolutions\": {},\n\t} as any;\n\n\tfillDummyScripts(json.scripts, 'workspaces');\n\n\treturn json;\n}\n\nexport function getDefaultTsconfig()\n{\n\treturn {\n\t\textends: \"@bluelovers/tsconfig/esm/mapfile.json\",\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-yarn-workspaces",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "yarn create yarn-workspaces npx create-yarn-workspaces",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -47,20 +47,20 @@
|
|
|
47
47
|
},
|
|
48
48
|
"resolutions": {},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@ts-type/package-dts": "^2.0.
|
|
51
|
-
"@yarn-tool/find-root": "^2.0.
|
|
52
|
-
"@yarn-tool/pkg-entry-util": "^2.0.
|
|
53
|
-
"@yarn-tool/static-file": "^2.0.
|
|
54
|
-
"debug-color2": "^1.
|
|
55
|
-
"find-yarn-workspace-root2": "^1.2.
|
|
50
|
+
"@ts-type/package-dts": "^2.0.5",
|
|
51
|
+
"@yarn-tool/find-root": "^2.0.4",
|
|
52
|
+
"@yarn-tool/pkg-entry-util": "^2.0.8",
|
|
53
|
+
"@yarn-tool/static-file": "^2.0.3",
|
|
54
|
+
"debug-color2": "^1.3.1",
|
|
55
|
+
"find-yarn-workspace-root2": "^1.2.41",
|
|
56
56
|
"fs-extra": "^10.1.0",
|
|
57
|
-
"path-is-same": "^1.0.
|
|
58
|
-
"pkg-dir": "<
|
|
57
|
+
"path-is-same": "^1.0.19",
|
|
58
|
+
"pkg-dir": "<6 >=5",
|
|
59
59
|
"sort-package-json": "^1.57.0",
|
|
60
|
-
"sort-package-json3": "^2.0.
|
|
60
|
+
"sort-package-json3": "^2.0.3",
|
|
61
61
|
"tslib": "^2",
|
|
62
|
-
"upath2": "^3.1.
|
|
62
|
+
"upath2": "^3.1.15",
|
|
63
63
|
"yargs": "^17.5.1"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "1e294e0d844e53ead65f2cd9a501229de44d4bb5"
|
|
66
66
|
}
|