@yarn-tool/fix-all 2.0.19 → 2.0.22

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 CHANGED
@@ -3,6 +3,50 @@
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.22](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/fix-all@2.0.21...@yarn-tool/fix-all@2.0.22) (2022-09-27)
7
+
8
+
9
+
10
+ ### 🐛 Bug Fixes
11
+
12
+ * use `newFakeRootData` ([1ba4502](https://github.com/bluelovers/ws-yarn-workspaces/commit/1ba4502ba5fd2fa8200d50a745b4ed8a2bf7b310))
13
+ * resolve exports ([39a8f85](https://github.com/bluelovers/ws-yarn-workspaces/commit/39a8f85ad96679173723eaeb88c432e665fd83ea))
14
+
15
+
16
+ ### ✨ Features
17
+
18
+ * update script ([cb56d8a](https://github.com/bluelovers/ws-yarn-workspaces/commit/cb56d8a03cfff3222b00394716c5de533209e04c))
19
+ * fix tsdx ([55b6ec2](https://github.com/bluelovers/ws-yarn-workspaces/commit/55b6ec2c8a335b8bdd49eb3b10c0869d621b47bb))
20
+
21
+
22
+ ### 📌 Dependencies
23
+
24
+ * update deps ([b56f33e](https://github.com/bluelovers/ws-yarn-workspaces/commit/b56f33eaffc42cd0fa0b0d5f0641e7dca56857d4))
25
+ * update deps ([266efb0](https://github.com/bluelovers/ws-yarn-workspaces/commit/266efb0683a5849490baa5ee93316ef0699e67ca))
26
+
27
+
28
+
29
+ ## [2.0.21](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/fix-all@2.0.19...@yarn-tool/fix-all@2.0.21) (2022-09-22)
30
+
31
+
32
+
33
+ ### 🔖 Miscellaneous
34
+
35
+ * . ([51b521c](https://github.com/bluelovers/ws-yarn-workspaces/commit/51b521c5bb7fa8c49260db811872a6629054d6d5))
36
+ * . ([1ac61b0](https://github.com/bluelovers/ws-yarn-workspaces/commit/1ac61b03a8318108034d9b17145d9df8e8dd7ef7))
37
+
38
+
39
+
40
+ ## [2.0.20](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/fix-all@2.0.19...@yarn-tool/fix-all@2.0.20) (2022-09-22)
41
+
42
+
43
+
44
+ ### 🔖 Miscellaneous
45
+
46
+ * . ([1ac61b0](https://github.com/bluelovers/ws-yarn-workspaces/commit/1ac61b03a8318108034d9b17145d9df8e8dd7ef7))
47
+
48
+
49
+
6
50
  ## [2.0.19](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/fix-all@2.0.18...@yarn-tool/fix-all@2.0.19) (2022-09-12)
7
51
 
8
52
  **Note:** Version bump only for package @yarn-tool/fix-all
package/lib/pkg/index.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports._initPkgListableByRootData = exports._runEachPackagesAsync = exports._handler = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ws_pkg_list_1 = require("ws-pkg-list");
6
+ const find_root_1 = require("@yarn-tool/find-root");
6
7
  const npm_package_json_loader_1 = require("npm-package-json-loader");
7
8
  const pkg_entry_util_1 = require("@yarn-tool/pkg-entry-util");
8
9
  const lazy_aggregate_error_1 = require("lazy-aggregate-error");
@@ -17,9 +18,10 @@ const types_1 = require("@ts-type/package-dts/lib/package-json/types");
17
18
  const normalize_deps_value_1 = require("@yarn-tool/normalize-deps-value");
18
19
  const getRootCopyStaticFiles_1 = require("@yarn-tool/static-file/lib/root/getRootCopyStaticFiles");
19
20
  const static_file_1 = require("@yarn-tool/static-file");
20
- const pkg_scripts_1 = require("@yarn-tool/pkg-entry-util/lib/preset/pkg-scripts");
21
- const path_is_same_1 = require("path-is-same");
21
+ const pkg_scripts_1 = require("@yarn-tool/pkg-entry-util/lib/preset/scripts/pkg-scripts");
22
22
  const dummy_1 = require("@yarn-tool/pkg-entry-util/lib/util/scripts/dummy");
23
+ const is_tsdx_1 = require("@yarn-tool/setup-module-env/lib/preset/tsdx/is-tsdx");
24
+ const fix_1 = require("@yarn-tool/setup-module-env/lib/preset/tsdx/fix");
23
25
  function _handler(cwd, ...argv) {
24
26
  return {
25
27
  ...(0, ws_pkg_list_1.normalizeListableRowExtra)(argv[0], cwd),
@@ -42,17 +44,20 @@ function _runEachPackagesAsync(list, options) {
42
44
  const err = new lazy_aggregate_error_1.AggregateErrorExtra();
43
45
  const promiseLogger = logger((async () => {
44
46
  var _a, _b;
45
- const pkg = new npm_package_json_loader_1.PackageJsonLoader(row.manifestLocation);
46
- const file_map = (0, getRootCopyStaticFiles_1.getRootCopyStaticFilesAuto)({
47
- ...rootData,
48
- isRoot: false,
47
+ const _rootDataFake = (0, find_root_1.newFakeRootData)(rootData, {
48
+ pkg: row.location,
49
49
  });
50
+ const { isRoot, isWorkspace } = _rootDataFake;
51
+ const pkg = new npm_package_json_loader_1.PackageJsonLoader(row.manifestLocation);
52
+ const file_map = (0, getRootCopyStaticFiles_1.getRootCopyStaticFilesAuto)(_rootDataFake);
50
53
  (0, static_file_1.copyStaticFiles)({
51
54
  cwd: row.location,
52
55
  file_map,
53
56
  });
54
57
  try {
55
- (0, pkg_entry_util_1.pkgExportsVerify)(pkg.data);
58
+ (0, pkg_entry_util_1.pkgExportsVerify)(pkg.data, {
59
+ cwd: row.location,
60
+ });
56
61
  }
57
62
  catch (e) {
58
63
  err.push(e);
@@ -63,6 +68,11 @@ function _runEachPackagesAsync(list, options) {
63
68
  hostedGitInfo,
64
69
  branch,
65
70
  });
71
+ if ((0, is_tsdx_1.isTsdxPackage)(pkg.data)) {
72
+ (0, fix_1.fixTsdxPackage)(pkg.data, {
73
+ rootData: _rootDataFake,
74
+ });
75
+ }
66
76
  (0, fix_ws_versions_1.fixPkgDepsVersionsCore)(pkg.data, cache);
67
77
  types_1.packageJsonDependenciesFields
68
78
  .forEach(field => {
@@ -77,8 +87,8 @@ function _runEachPackagesAsync(list, options) {
77
87
  ...(0, pkg_scripts_1.defaultPkgScripts)(),
78
88
  ...((_a = pkg.data.scripts) !== null && _a !== void 0 ? _a : {}),
79
89
  };
80
- if ((0, path_is_same_1.pathIsSame)(rootData.root, row.location)) {
81
- if ((0, path_is_same_1.pathIsSame)(rootData.ws, row.location)) {
90
+ if (isRoot) {
91
+ if (isWorkspace) {
82
92
  }
83
93
  else {
84
94
  }
@@ -91,9 +101,15 @@ function _runEachPackagesAsync(list, options) {
91
101
  pkg.data = (0, sort_package_json3_1.sortPackageJson)(pkg.data);
92
102
  pkg.autofix();
93
103
  pkg.write();
94
- })().catch(e => err.push(e)), row.name);
104
+ })().catch(e => {
105
+ e.row = row;
106
+ err.push(e);
107
+ }), row.name);
95
108
  return promiseLogger
96
- .catch(e => err.push(e))
109
+ .catch(e => {
110
+ e.row = row;
111
+ err.push(e);
112
+ })
97
113
  .then(() => {
98
114
  if (err.length) {
99
115
  debug_color2_1.console.error(err);
@@ -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;AACrD,gEAAyF;AACzF,uEAA4F;AAC5F,0EAAqE;AACrE,mGAAoG;AACpG,wDAAyD;AACzD,kFAAqF;AACrF,+CAA0C;AAC1C,4EAA2F;AAG3F,SAAgB,QAAQ,CAAC,GAAW,EAAE,GAAG,IAAgD;IAExF,OAAO;QACN,GAAG,IAAA,uCAAyB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;QAC1C,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;KACZ,CAAA;AACF,CAAC;AAND,4BAMC;AAID,SAAgB,qBAAqB,CAAC,IAAc,EACnD,OAAuH;IAGvH,MAAM,EACL,QAAQ,EACR,sBAAsB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AAC,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,CAAC;aACnB;QACF,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CACD;AACH,CAAC;AAtHD,sDAsHC;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';\nimport { packageJsonDependenciesFields } from '@ts-type/package-dts/lib/package-json/types';\nimport { normalizeDepsValue } from '@yarn-tool/normalize-deps-value';\nimport { getRootCopyStaticFilesAuto } from '@yarn-tool/static-file/lib/root/getRootCopyStaticFiles';\nimport { copyStaticFiles } from '@yarn-tool/static-file';\nimport { defaultPkgScripts } from '@yarn-tool/pkg-entry-util/lib/preset/pkg-scripts';\nimport { pathIsSame } from 'path-is-same';\nimport { isDummyEchoMaybeOrEmpty } from '@yarn-tool/pkg-entry-util/lib/util/scripts/dummy';\nimport { EnumScriptsEntry } from '@yarn-tool/pkg-entry-util/lib/field/scripts';\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\tconst file_map = getRootCopyStaticFilesAuto({\n\t\t\t\t\t...rootData,\n\t\t\t\t\tisRoot: false,\n\t\t\t\t});\n\n\t\t\t\tcopyStaticFiles({\n\t\t\t\t\tcwd: row.location,\n\t\t\t\t\tfile_map,\n\t\t\t\t});\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\tpackageJsonDependenciesFields\n\t\t\t\t\t.forEach(field => {\n\n\t\t\t\t\t\tObject.keys(pkg.data[field] ?? {})\n\t\t\t\t\t\t\t.forEach(name => {\n\t\t\t\t\t\t\t\tconst _value = normalizeDepsValue(pkg.data[field][name]);\n\t\t\t\t\t\t\t\tpkg.data[field][name] = _value;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t;\n\n\t\t\t\t\t})\n\t\t\t\t;\n\n\t\t\t\tpkg.data.scripts = {\n\t\t\t\t\t...defaultPkgScripts(),\n\t\t\t\t\t...(pkg.data.scripts ?? {}),\n\t\t\t\t};\n\n\t\t\t\tif (pathIsSame(rootData.root, row.location))\n\t\t\t\t{\n\t\t\t\t\tif (pathIsSame(rootData.ws, row.location))\n\t\t\t\t\t{\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!pkg.data.scripts['_preversion']?.length && isDummyEchoMaybeOrEmpty(pkg.data.scripts.preversion))\n\t\t\t\t\t{\n\t\t\t\t\t\tpkg.data.scripts.preversion = EnumScriptsEntry.preversion;\n\t\t\t\t\t}\n\t\t\t\t}\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);\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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,6CAAoH;AACpH,oDAA4E;AAC5E,qEAA4D;AAC5D,8DAA6D;AAC7D,+DAA2D;AAC3D,gEAAgC;AAChC,uDAA+D;AAC/D,gDAAoD;AACpD,+CAAuC;AAEvC,gEAA0F;AAE1F,2DAAqD;AACrD,gEAAyF;AACzF,uEAA4F;AAC5F,0EAAqE;AACrE,mGAAoG;AACpG,wDAAyD;AACzD,0FAA6F;AAE7F,4EAA2F;AAE3F,iFAAoF;AACpF,yEAAiF;AAEjF,SAAgB,QAAQ,CAAC,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AAC,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, newFakeRootData } 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';\nimport { packageJsonDependenciesFields } from '@ts-type/package-dts/lib/package-json/types';\nimport { normalizeDepsValue } from '@yarn-tool/normalize-deps-value';\nimport { getRootCopyStaticFilesAuto } from '@yarn-tool/static-file/lib/root/getRootCopyStaticFiles';\nimport { copyStaticFiles } from '@yarn-tool/static-file';\nimport { defaultPkgScripts } from '@yarn-tool/pkg-entry-util/lib/preset/scripts/pkg-scripts';\nimport { pathIsSame } from 'path-is-same';\nimport { isDummyEchoMaybeOrEmpty } from '@yarn-tool/pkg-entry-util/lib/util/scripts/dummy';\nimport { EnumScriptsEntry } from '@yarn-tool/pkg-entry-util/lib/field/scripts';\nimport { isTsdxPackage } from '@yarn-tool/setup-module-env/lib/preset/tsdx/is-tsdx';\nimport { fixTsdxPackage } from '@yarn-tool/setup-module-env/lib/preset/tsdx/fix';\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\t\t\t\tconst _rootDataFake = newFakeRootData(rootData, {\n\t\t\t\t\tpkg: row.location,\n\t\t\t\t});\n\n\t\t\t\tconst { isRoot, isWorkspace } = _rootDataFake;\n\n\t\t\t\tconst pkg = new PackageJsonLoader(row.manifestLocation);\n\n\t\t\t\tconst file_map = getRootCopyStaticFilesAuto(_rootDataFake);\n\n\t\t\t\tcopyStaticFiles({\n\t\t\t\t\tcwd: row.location,\n\t\t\t\t\tfile_map,\n\t\t\t\t});\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tpkgExportsVerify(pkg.data, {\n\t\t\t\t\t\tcwd: row.location,\n\t\t\t\t\t});\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\tif (isTsdxPackage(pkg.data))\n\t\t\t\t{\n\t\t\t\t\tfixTsdxPackage(pkg.data, {\n\t\t\t\t\t\trootData: _rootDataFake,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tfixPkgDepsVersionsCore(pkg.data, cache);\n\n\t\t\t\tpackageJsonDependenciesFields\n\t\t\t\t\t.forEach(field => {\n\n\t\t\t\t\t\tObject.keys(pkg.data[field] ?? {})\n\t\t\t\t\t\t\t.forEach(name => {\n\t\t\t\t\t\t\t\tconst _value = normalizeDepsValue(pkg.data[field][name]);\n\t\t\t\t\t\t\t\tpkg.data[field][name] = _value;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t;\n\n\t\t\t\t\t})\n\t\t\t\t;\n\n\t\t\t\tpkg.data.scripts = {\n\t\t\t\t\t...defaultPkgScripts(),\n\t\t\t\t\t...(pkg.data.scripts ?? {}),\n\t\t\t\t};\n\n\t\t\t\tif (isRoot)\n\t\t\t\t{\n\t\t\t\t\tif (isWorkspace)\n\t\t\t\t\t{\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!pkg.data.scripts['_preversion']?.length && isDummyEchoMaybeOrEmpty(pkg.data.scripts.preversion))\n\t\t\t\t\t{\n\t\t\t\t\t\tpkg.data.scripts.preversion = EnumScriptsEntry.preversion;\n\t\t\t\t\t}\n\t\t\t\t}\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 => {\n\t\t\t\te.row = row;\n\t\t\t\terr.push(e);\n\t\t\t}), row.name)\n\n\t\t\treturn promiseLogger\n\t\t\t\t.catch(e => {\n\t\t\t\t\te.row = row;\n\t\t\t\t\terr.push(e);\n\t\t\t\t})\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);\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/lib/root/index.js CHANGED
@@ -7,8 +7,8 @@ const pkg_git_info_1 = require("@yarn-tool/pkg-git-info");
7
7
  const npm_package_json_loader_1 = require("npm-package-json-loader");
8
8
  const ws_scope_1 = require("@yarn-tool/ws-scope");
9
9
  const sort_package_json3_1 = require("sort-package-json3");
10
- const ws_root_scripts_1 = require("@yarn-tool/pkg-entry-util/lib/preset/ws-root-scripts");
11
- const dummy_1 = require("@yarn-tool/pkg-entry-util/lib/preset/dummy");
10
+ const ws_root_scripts_1 = require("@yarn-tool/pkg-entry-util/lib/preset/scripts/ws-root-scripts");
11
+ const dummy_1 = require("@yarn-tool/pkg-entry-util/lib/preset/scripts/dummy");
12
12
  const pkg_deps_add_1 = require("@yarn-tool/pkg-deps-add");
13
13
  function _fixRoot(options) {
14
14
  let { rootData, branch, overwriteHostedGitInfo, hostedGitInfo, targetDir } = options;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","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AC;IAEH,MAAM,CAAC,OAAO,CAAC,IAAA,wBAAgB,EAAC,IAAA,6CAA2B,GAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;;;QAExF,YAAA,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,EAAC,GAAG,wCAAH,GAAG,IAAM,KAAK,EAAC;IACnD,CAAC,CAAC,CAAC;IAEH;QACC,6BAA6B;QAC7B,aAAa;QACb,sBAAsB;KACtB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;;;QAChB,MAAM,MAAM,GAAG,IAAA,0CAA2B,EAAC,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE;YACtE,iBAAiB;YACjB,cAAc;SACd,EAAE,IAAI,CAAC,CAAC;QAET,IAAI,CAAC,MAAM,CAAC,OAAO,EACnB;YACC,YAAA,OAAO,CAAC,aAAa,CAAC,IAAI,EAAC,eAAe,uCAAf,eAAe,GAAK,EAAE,EAAC;YAClD,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;SACvD;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,aAAa,CAAC,IAAI,GAAG,IAAA,oCAAe,EAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAEzE,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAE9B,IAAI,GAAG,GAAG,IAAI,0BAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnD,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,IAAI,EAAE,CAAC;IAEX,OAAO,OAAO,CAAA;AACf,CAAC;AA3CD,gCA2CC","sourcesContent":["import { ITSRequiredPick } from 'ts-type/lib/type/record';\nimport { fillPkgHostedInfo, IFillPkgHostedInfoOptions } from '@yarn-tool/pkg-hosted-info';\nimport { join } from 'upath2';\nimport { npmHostedGitInfoLazy } from '@yarn-tool/pkg-git-info';\nimport { PackageJsonLoader } from 'npm-package-json-loader';\nimport { WorkspacesScope } from '@yarn-tool/ws-scope';\nimport { sortPackageJson } from 'sort-package-json3';\nimport { defaultWorkspaceRootScripts } from '@yarn-tool/pkg-entry-util/lib/preset/ws-root-scripts';\nimport { fillDummyScripts } from '@yarn-tool/pkg-entry-util/lib/preset/dummy';\nimport { _checkDependenciesExistsAll } from '@yarn-tool/pkg-deps-add';\n\nexport function _fixRoot(options: Required<IFillPkgHostedInfoOptions>)\n{\n\tlet { rootData, branch, overwriteHostedGitInfo, hostedGitInfo, targetDir } = options;\n\n\tconst root_file_package_json = join(targetDir, 'package.json');\n\n\tlet root_pkg_json = new PackageJsonLoader(root_file_package_json);\n\n\thostedGitInfo ??= npmHostedGitInfoLazy();\n\n\tif (hostedGitInfo)\n\t{\n\t\tfillPkgHostedInfo(root_pkg_json.data, {\n\t\t\ttargetDir,\n\t\t\trootData,\n\t\t\thostedGitInfo,\n\t\t\tbranch,\n\t\t\toverwriteHostedGitInfo,\n\t\t});\n\n\t\troot_pkg_json.data = sortPackageJson(root_pkg_json.data);\n\n\t\troot_pkg_json.write();\n\t}\n\n\treturn {\n\t\troot_file_package_json,\n\t\troot_pkg_json,\n\t\ttargetDir,\n\t\trootData,\n\t\thostedGitInfo,\n\t\tbranch,\n\t\toverwriteHostedGitInfo,\n\t}\n}\n\nexport function _fixWsRoot(options: ITSRequiredPick<IFillPkgHostedInfoOptions, 'hostedGitInfo' | 'rootData' | 'overwriteHostedGitInfo' | 'branch'>)\n{\n\tif (!options.rootData.ws?.length)\n\t{\n\t\tthrow new Error(`Invalid workspaces`)\n\t}\n\n\tlet runtime = _fixRoot({\n\t\t...options,\n\t\ttargetDir: options.rootData.ws,\n\t});\n\n\tObject.entries(fillDummyScripts(defaultWorkspaceRootScripts())).forEach(([key, value]) =>\n\t{\n\t\truntime.root_pkg_json.data.scripts[key] ??= value;\n\t});\n\n\t[\n\t\t'@yarn-tool/ws-find-up-paths',\n\t\t'@types/node',\n\t\t'@bluelovers/tsconfig',\n\t].forEach(name => {\n\t\tconst _check = _checkDependenciesExistsAll(runtime.root_pkg_json.data, [\n\t\t\t'devDependencies',\n\t\t\t'dependencies',\n\t\t], name);\n\n\t\tif (!_check._exists)\n\t\t{\n\t\t\truntime.root_pkg_json.data.devDependencies ??= {};\n\t\t\truntime.root_pkg_json.data.devDependencies[name] = '*';\n\t\t}\n\t});\n\n\truntime.root_pkg_json.data = sortPackageJson(runtime.root_pkg_json.data);\n\n\truntime.root_pkg_json.write();\n\n\tlet wss = new WorkspacesScope(runtime.rootData.ws);\n\twss.syncValue();\n\twss.save();\n\n\treturn runtime\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,gEAA0F;AAC1F,mCAA8B;AAC9B,0DAA+D;AAC/D,qEAA4D;AAC5D,kDAAsD;AACtD,2DAAqD;AACrD,kGAA2G;AAC3G,8EAAsF;AACtF,0DAAsE;AAEtE,SAAgB,QAAQ,CAAC,OAA4C;IAEpE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,sBAAsB,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAErF,MAAM,sBAAsB,GAAG,IAAA,aAAI,EAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAE/D,IAAI,aAAa,GAAG,IAAI,2CAAiB,CAAC,sBAAsB,CAAC,CAAC;IAElE,aAAa,aAAb,aAAa,cAAb,aAAa,IAAb,aAAa,GAAK,IAAA,mCAAoB,GAAE,EAAC;IAEzC,IAAI,aAAa,EACjB;QACC,IAAA,mCAAiB,EAAC,aAAa,CAAC,IAAI,EAAE;YACrC,SAAS;YACT,QAAQ;YACR,aAAa;YACb,MAAM;YACN,sBAAsB;SACtB,CAAC,CAAC;QAEH,aAAa,CAAC,IAAI,GAAG,IAAA,oCAAe,EAAC,aAAa,CAAC,IAAI,CAAC,CAAC;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Aa,CAAC,IAAI,GAAG,IAAA,oCAAe,EAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAEzE,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAE9B,IAAI,GAAG,GAAG,IAAI,0BAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnD,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,IAAI,EAAE,CAAC;IAEX,OAAO,OAAO,CAAA;AACf,CAAC;AA3CD,gCA2CC","sourcesContent":["import { ITSRequiredPick } from 'ts-type/lib/type/record';\nimport { fillPkgHostedInfo, IFillPkgHostedInfoOptions } from '@yarn-tool/pkg-hosted-info';\nimport { join } from 'upath2';\nimport { npmHostedGitInfoLazy } from '@yarn-tool/pkg-git-info';\nimport { PackageJsonLoader } from 'npm-package-json-loader';\nimport { WorkspacesScope } from '@yarn-tool/ws-scope';\nimport { sortPackageJson } from 'sort-package-json3';\nimport { defaultWorkspaceRootScripts } from '@yarn-tool/pkg-entry-util/lib/preset/scripts/ws-root-scripts';\nimport { fillDummyScripts } from '@yarn-tool/pkg-entry-util/lib/preset/scripts/dummy';\nimport { _checkDependenciesExistsAll } from '@yarn-tool/pkg-deps-add';\n\nexport function _fixRoot(options: Required<IFillPkgHostedInfoOptions>)\n{\n\tlet { rootData, branch, overwriteHostedGitInfo, hostedGitInfo, targetDir } = options;\n\n\tconst root_file_package_json = join(targetDir, 'package.json');\n\n\tlet root_pkg_json = new PackageJsonLoader(root_file_package_json);\n\n\thostedGitInfo ??= npmHostedGitInfoLazy();\n\n\tif (hostedGitInfo)\n\t{\n\t\tfillPkgHostedInfo(root_pkg_json.data, {\n\t\t\ttargetDir,\n\t\t\trootData,\n\t\t\thostedGitInfo,\n\t\t\tbranch,\n\t\t\toverwriteHostedGitInfo,\n\t\t});\n\n\t\troot_pkg_json.data = sortPackageJson(root_pkg_json.data);\n\n\t\troot_pkg_json.write();\n\t}\n\n\treturn {\n\t\troot_file_package_json,\n\t\troot_pkg_json,\n\t\ttargetDir,\n\t\trootData,\n\t\thostedGitInfo,\n\t\tbranch,\n\t\toverwriteHostedGitInfo,\n\t}\n}\n\nexport function _fixWsRoot(options: ITSRequiredPick<IFillPkgHostedInfoOptions, 'hostedGitInfo' | 'rootData' | 'overwriteHostedGitInfo' | 'branch'>)\n{\n\tif (!options.rootData.ws?.length)\n\t{\n\t\tthrow new Error(`Invalid workspaces`)\n\t}\n\n\tlet runtime = _fixRoot({\n\t\t...options,\n\t\ttargetDir: options.rootData.ws,\n\t});\n\n\tObject.entries(fillDummyScripts(defaultWorkspaceRootScripts())).forEach(([key, value]) =>\n\t{\n\t\truntime.root_pkg_json.data.scripts[key] ??= value;\n\t});\n\n\t[\n\t\t'@yarn-tool/ws-find-up-paths',\n\t\t'@types/node',\n\t\t'@bluelovers/tsconfig',\n\t].forEach(name => {\n\t\tconst _check = _checkDependenciesExistsAll(runtime.root_pkg_json.data, [\n\t\t\t'devDependencies',\n\t\t\t'dependencies',\n\t\t], name);\n\n\t\tif (!_check._exists)\n\t\t{\n\t\t\truntime.root_pkg_json.data.devDependencies ??= {};\n\t\t\truntime.root_pkg_json.data.devDependencies[name] = '*';\n\t\t}\n\t});\n\n\truntime.root_pkg_json.data = sortPackageJson(runtime.root_pkg_json.data);\n\n\truntime.root_pkg_json.write();\n\n\tlet wss = new WorkspacesScope(runtime.rootData.ws);\n\twss.syncValue();\n\twss.save();\n\n\treturn runtime\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarn-tool/fix-all",
3
- "version": "2.0.19",
3
+ "version": "2.0.22",
4
4
  "description": "auto check/fix workspaces/package",
5
5
  "keywords": [
6
6
  "yarn",
@@ -58,32 +58,32 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@ts-type/package-dts": "^2.0.5",
61
- "@yarn-tool/find-root": "^2.0.6",
62
- "@yarn-tool/fix-ws-versions": "^2.0.6",
63
- "@yarn-tool/normalize-deps-value": "^1.0.4",
61
+ "@yarn-tool/find-root": "^2.0.7",
62
+ "@yarn-tool/fix-ws-versions": "^2.0.9",
63
+ "@yarn-tool/normalize-deps-value": "^1.0.5",
64
64
  "@yarn-tool/pkg-git-info": "^1.0.36",
65
- "@yarn-tool/pkg-hosted-info": "^2.0.8",
66
- "@yarn-tool/static-file": "^2.0.9",
67
- "@yarn-tool/write-package-json": "^1.0.5",
68
- "@yarn-tool/ws-scope": "^2.0.6",
69
- "array-hyper-unique": "^2.0.8",
65
+ "@yarn-tool/pkg-hosted-info": "^2.0.9",
66
+ "@yarn-tool/static-file": "^2.0.10",
67
+ "@yarn-tool/write-package-json": "^1.0.6",
68
+ "@yarn-tool/ws-scope": "^2.0.7",
69
+ "array-hyper-unique": "^2.1.2",
70
70
  "bluebird": "^3.7.2",
71
- "cache-path": "^3.0.6",
71
+ "cache-path": "^3.0.7",
72
72
  "debug-color2": "^1.3.2",
73
73
  "fs-extra": "^10.1.0",
74
- "lazy-aggregate-error": "^1.0.16",
74
+ "lazy-aggregate-error": "^1.0.18",
75
75
  "lodash": "^4.17.21",
76
- "npm-package-json-loader": "^2.0.13",
76
+ "npm-package-json-loader": "^2.0.16",
77
77
  "progress-estimator": "^0.3.0",
78
- "sort-package-json3": "^2.0.6",
78
+ "sort-package-json3": "^2.0.7",
79
79
  "ts-type": "^2.1.10",
80
80
  "tslib": ">=2",
81
81
  "upath2": "^3.1.15",
82
- "ws-pkg-list": "^2.0.6"
82
+ "ws-pkg-list": "^2.0.7"
83
83
  },
84
84
  "packageManager": "yarn@1.22.19",
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "f1ecaa59749bcb8c8ecd9f4ef17b3522bf9337c1"
88
+ "gitHead": "46d4d576f34d2d5218822811286119ea7a44d08b"
89
89
  }