@yarn-tool/fix-all 1.0.16 → 2.0.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/CHANGELOG.md +11 -0
- package/lib/pkg/index.js +5 -1
- package/lib/pkg/index.js.map +1 -1
- package/package.json +12 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.0](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/fix-all@1.0.16...@yarn-tool/fix-all@2.0.0) (2022-07-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ✨ Features
|
|
10
|
+
|
|
11
|
+
* fix-ws-versions ([bee725c](https://github.com/bluelovers/ws-yarn-workspaces/commit/bee725ca321e52176f488afc5b939568e694a73a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.0.16](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/fix-all@1.0.15...@yarn-tool/fix-all@1.0.16) (2022-06-28)
|
|
7
18
|
|
|
8
19
|
|
package/lib/pkg/index.js
CHANGED
|
@@ -12,6 +12,7 @@ const logger_1 = require("debug-color2/logger");
|
|
|
12
12
|
const debug_color2_1 = require("debug-color2");
|
|
13
13
|
const pkg_hosted_info_1 = require("@yarn-tool/pkg-hosted-info");
|
|
14
14
|
const sort_package_json3_1 = require("sort-package-json3");
|
|
15
|
+
const fix_ws_versions_1 = require("@yarn-tool/fix-ws-versions");
|
|
15
16
|
function _handler(cwd, ...argv) {
|
|
16
17
|
return {
|
|
17
18
|
...(0, ws_pkg_list_1.normalizeListableRowExtra)(argv[0], cwd),
|
|
@@ -22,10 +23,12 @@ exports._handler = _handler;
|
|
|
22
23
|
function _runEachPackagesAsync(list, options) {
|
|
23
24
|
const { rootData, overwriteHostedGitInfo, hostedGitInfo, branch, } = options;
|
|
24
25
|
let logger;
|
|
26
|
+
let cache = {};
|
|
25
27
|
return bluebird_1.default.resolve(list)
|
|
26
|
-
.tap(() => {
|
|
28
|
+
.tap((listable) => {
|
|
27
29
|
logger = (0, cli_progress_1.createProgressEstimator)(rootData.root);
|
|
28
30
|
logger_1.consoleLogger.info(`auto check/fix packages`);
|
|
31
|
+
cache.listable = listable;
|
|
29
32
|
})
|
|
30
33
|
.mapSeries(async (row) => {
|
|
31
34
|
//console.dir(row);
|
|
@@ -44,6 +47,7 @@ function _runEachPackagesAsync(list, options) {
|
|
|
44
47
|
hostedGitInfo,
|
|
45
48
|
branch,
|
|
46
49
|
});
|
|
50
|
+
(0, fix_ws_versions_1.fixPkgDepsVersionsCore)(pkg.data, cache);
|
|
47
51
|
pkg.data = (0, sort_package_json3_1.sortPackageJson)(pkg.data);
|
|
48
52
|
pkg.autofix();
|
|
49
53
|
pkg.write();
|
package/lib/pkg/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,6CAAoH;AAEpH,qEAA4D;AAC5D,8DAA6D;AAC7D,+DAA2D;AAC3D,gEAAgC;AAChC,uDAA+D;AAC/D,gDAAoD;AACpD,+CAAuC;AAEvC,gEAA0F;AAE1F,2DAAqD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,6CAAoH;AAEpH,qEAA4D;AAC5D,8DAA6D;AAC7D,+DAA2D;AAC3D,gEAAgC;AAChC,uDAA+D;AAC/D,gDAAoD;AACpD,+CAAuC;AAEvC,gEAA0F;AAE1F,2DAAqD;AACrD,gEAAyF;AAEzF,SAAgB,QAAQ,CAAC,GAAW,EAAE,GAAG,IAAgD;IAExF,OAAO;QACN,GAAG,IAAA,uCAAyB,EAAC,IAAI,CAAC,CAAC,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AAA,oCAAe,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAErC,GAAG,CAAC,OAAO,EAAE,CAAC;YACd,GAAG,CAAC,KAAK,EAAE,CAAC;QAEb,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;QAEvC,OAAO,aAAa;aAClB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACvB,IAAI,CAAC,GAAG,EAAE;YAEV,IAAI,GAAG,CAAC,MAAM,EACd;gBACC,sBAAO,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC9B;QACF,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CACD;AACH,CAAC;AAvED,sDAuEC;AAED,SAAgB,0BAA0B,CAAC,QAA4D;IAEtG,IAAI,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC;IAExB,IAAI,QAAQ,CAAC,YAAY,EACzB;QACC,OAAO,IAAA,2BAAa,EAAC,GAAG,EAAE;YACzB,OAAO,CAAC,GAAG,IAAI;gBAEd,OAAO,QAAQ,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;YAC9B,CAAC;SACD,CAAC,CAAA;KACF;IAED,OAAO,IAAA,oCAAsB,EAAC;QAC7B,GAAG;KACH,EAAE,GAAG,EAAE;QACP,OAAO,CAAC,GAAG,IAAI;YAEd,OAAO,QAAQ,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAC9B,CAAC;KACD,CAAC,CAAA;AACH,CAAC;AAtBD,gEAsBC","sourcesContent":["import { IOptionsPkgListable, normalizeListableRowExtra, wsPkgListable, wsPkgListableFromPaths } from 'ws-pkg-list';\nimport { IFindRootReturnType } from '@yarn-tool/find-root';\nimport { PackageJsonLoader } from 'npm-package-json-loader';\nimport { pkgExportsVerify } from '@yarn-tool/pkg-entry-util';\nimport { AggregateErrorExtra } from 'lazy-aggregate-error';\nimport Bluebird from 'bluebird';\nimport { createProgressEstimator } from '../util/cli-progress';\nimport { consoleLogger } from 'debug-color2/logger';\nimport { console } from 'debug-color2';\nimport { ProgressEstimator } from 'progress-estimator';\nimport { fillPkgHostedInfo, IFillPkgHostedInfoOptions } from '@yarn-tool/pkg-hosted-info';\nimport { ITSRequiredPick } from 'ts-type/lib/type/record';\nimport { sortPackageJson } from 'sort-package-json3';\nimport { fixPkgDepsVersionsCore, ICache, ICacheInput } from '@yarn-tool/fix-ws-versions';\n\nexport function _handler(cwd: string, ...argv: Parameters<IOptionsPkgListable[\"handler\"]>)\n{\n\treturn {\n\t\t...normalizeListableRowExtra(argv[0], cwd),\n\t\tpkg: argv[1],\n\t}\n}\n\nexport type IEntry = ReturnType<typeof _handler>\n\nexport function _runEachPackagesAsync(list: IEntry[],\n\toptions: ITSRequiredPick<IFillPkgHostedInfoOptions, 'overwriteHostedGitInfo' | 'branch' | 'rootData' | 'hostedGitInfo'>,\n)\n{\n\tconst {\n\t\trootData,\n\t\toverwriteHostedGitInfo,\n\t\thostedGitInfo,\n\t\tbranch,\n\t} = options;\n\n\tlet logger: ProgressEstimator;\n\tlet cache: ICacheInput<IEntry> = {} as any;\n\n\treturn Bluebird.resolve(list)\n\t\t.tap((listable) =>\n\t\t{\n\t\t\tlogger = createProgressEstimator(rootData.root);\n\n\t\t\tconsoleLogger.info(`auto check/fix packages`);\n\n\t\t\tcache.listable = listable;\n\n\t\t})\n\t\t.mapSeries(async (row) =>\n\t\t{\n\t\t\t//console.dir(row);\n\n\t\t\tconst err = new AggregateErrorExtra();\n\n\t\t\tconst promiseLogger = logger((async () =>\n\t\t\t{\n\n\t\t\t\tconst pkg = new PackageJsonLoader(row.manifestLocation);\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tpkgExportsVerify(pkg.data);\n\t\t\t\t}\n\t\t\t\tcatch (e)\n\t\t\t\t{\n\t\t\t\t\terr.push(e);\n\t\t\t\t}\n\n\t\t\t\tfillPkgHostedInfo(pkg.data, {\n\t\t\t\t\ttargetDir: row.location,\n\t\t\t\t\toverwriteHostedGitInfo,\n\t\t\t\t\thostedGitInfo,\n\t\t\t\t\tbranch,\n\t\t\t\t});\n\n\t\t\t\tfixPkgDepsVersionsCore(pkg.data, cache);\n\n\t\t\t\tpkg.data = sortPackageJson(pkg.data);\n\n\t\t\t\tpkg.autofix();\n\t\t\t\tpkg.write();\n\n\t\t\t})().catch(e => err.push(e)), row.name)\n\n\t\t\treturn promiseLogger\n\t\t\t\t.catch(e => err.push(e))\n\t\t\t\t.then(() =>\n\t\t\t\t{\n\t\t\t\t\tif (err.length)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.error(err.toString());\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t\t;\n}\n\nexport function _initPkgListableByRootData(rootData: Pick<IFindRootReturnType, 'root' | 'hasWorkspace'>)\n{\n\tlet cwd = rootData.root;\n\n\tif (rootData.hasWorkspace)\n\t{\n\t\treturn wsPkgListable(cwd, {\n\t\t\thandler(...argv)\n\t\t\t{\n\t\t\t\treturn _handler(cwd, ...argv)\n\t\t\t},\n\t\t})\n\t}\n\n\treturn wsPkgListableFromPaths([\n\t\tcwd,\n\t], cwd, {\n\t\thandler(...argv)\n\t\t{\n\t\t\treturn _handler(cwd, ...argv)\n\t\t},\n\t})\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/fix-all",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "auto check/fix workspaces/package",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yarn",
|
|
@@ -54,26 +54,27 @@
|
|
|
54
54
|
"tsc:showConfig": "ynpx get-current-tsconfig -p"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@yarn-tool/find-root": "^
|
|
57
|
+
"@yarn-tool/find-root": "^2.0.0",
|
|
58
|
+
"@yarn-tool/fix-ws-versions": "^2.0.0",
|
|
58
59
|
"@yarn-tool/pkg-git-info": "^1.0.30",
|
|
59
|
-
"@yarn-tool/pkg-hosted-info": "^
|
|
60
|
-
"@yarn-tool/ws-scope": "^
|
|
60
|
+
"@yarn-tool/pkg-hosted-info": "^2.0.0",
|
|
61
|
+
"@yarn-tool/ws-scope": "^2.0.0",
|
|
61
62
|
"bluebird": "^3.7.2",
|
|
62
|
-
"cache-path": "^
|
|
63
|
+
"cache-path": "^3.0.0",
|
|
63
64
|
"debug-color2": "^1.2.7",
|
|
64
65
|
"fs-extra": "^10.1.0",
|
|
65
66
|
"lazy-aggregate-error": "^1.0.11",
|
|
66
|
-
"npm-package-json-loader": "^
|
|
67
|
+
"npm-package-json-loader": "^2.0.0",
|
|
67
68
|
"progress-estimator": "^0.3.0",
|
|
68
|
-
"sort-package-json3": "^
|
|
69
|
-
"ts-type": "^2.1.
|
|
69
|
+
"sort-package-json3": "^2.0.0",
|
|
70
|
+
"ts-type": "^2.1.8",
|
|
70
71
|
"tslib": "^2",
|
|
71
72
|
"upath2": "^3.1.13",
|
|
72
|
-
"ws-pkg-list": "^
|
|
73
|
+
"ws-pkg-list": "^2.0.0"
|
|
73
74
|
},
|
|
75
|
+
"packageManager": "yarn@1.22.19",
|
|
74
76
|
"publishConfig": {
|
|
75
77
|
"access": "public"
|
|
76
78
|
},
|
|
77
|
-
"
|
|
78
|
-
"gitHead": "a260a5883751a75c98c5adfa1ba237f8b6d24e67"
|
|
79
|
+
"gitHead": "23d27e44fa6fbe632e0e277cd476e7dd56e0f7f2"
|
|
79
80
|
}
|