@yarn-tool/fix-all 2.0.10 → 2.0.13
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 +38 -0
- package/index.js +20 -0
- package/index.js.map +1 -1
- package/lib/pkg/index.js +11 -1
- package/lib/pkg/index.js.map +1 -1
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
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.13](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/fix-all@2.0.12...@yarn-tool/fix-all@2.0.13) (2022-08-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @yarn-tool/fix-all
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.0.12](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/fix-all@2.0.11...@yarn-tool/fix-all@2.0.12) (2022-08-19)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### 🐛 Bug Fixes
|
|
18
|
+
|
|
19
|
+
* show error info ([0f2ec79](https://github.com/bluelovers/ws-yarn-workspaces/commit/0f2ec7952b7fbbaee1ba99d53b511b600aeeb267))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### ✨ Features
|
|
23
|
+
|
|
24
|
+
* getRootCopyStaticFilesAuto ([2b857c0](https://github.com/bluelovers/ws-yarn-workspaces/commit/2b857c07566a6cdcb7018d9f1b9efbe4f0a5202b))
|
|
25
|
+
* copyStaticFiles ([d98f4a7](https://github.com/bluelovers/ws-yarn-workspaces/commit/d98f4a7f899454f165e8a11ddc76aa90906a9bf1))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### 📌 Dependencies
|
|
29
|
+
|
|
30
|
+
* update deps ([d0659ff](https://github.com/bluelovers/ws-yarn-workspaces/commit/d0659ff79f83d963ad2b4e07b3ad93757de7f48a))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## [2.0.11](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/fix-all@2.0.10...@yarn-tool/fix-all@2.0.11) (2022-08-18)
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package @yarn-tool/fix-all
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
## [2.0.10](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/fix-all@2.0.9...@yarn-tool/fix-all@2.0.10) (2022-08-15)
|
|
7
45
|
|
|
8
46
|
|
package/index.js
CHANGED
|
@@ -8,6 +8,9 @@ const index_1 = require("./lib/root/index");
|
|
|
8
8
|
const index_2 = require("./lib/pkg/index");
|
|
9
9
|
const logger_1 = require("debug-color2/logger");
|
|
10
10
|
const bluebird_1 = tslib_1.__importDefault(require("bluebird"));
|
|
11
|
+
const static_file_1 = require("@yarn-tool/static-file");
|
|
12
|
+
const wsCopyStaticFiles_1 = require("@yarn-tool/static-file/lib/ws/wsCopyStaticFiles");
|
|
13
|
+
const getRootCopyStaticFiles_1 = require("@yarn-tool/static-file/lib/root/getRootCopyStaticFiles");
|
|
11
14
|
function npmAutoFixAll(cwd, options) {
|
|
12
15
|
return bluebird_1.default.resolve().then(() => {
|
|
13
16
|
cwd !== null && cwd !== void 0 ? cwd : (cwd = process.cwd());
|
|
@@ -27,6 +30,23 @@ function npmAutoFixAll(cwd, options) {
|
|
|
27
30
|
console.log(`hasWorkspace:`, rootData.hasWorkspace);
|
|
28
31
|
let { branch, overwriteHostedGitInfo } = options !== null && options !== void 0 ? options : {};
|
|
29
32
|
cwd = rootData.cwd;
|
|
33
|
+
if (rootData.hasWorkspace) {
|
|
34
|
+
const file_map = (0, wsCopyStaticFiles_1.getWsCopyStaticFiles)();
|
|
35
|
+
(0, static_file_1.copyStaticFiles)({
|
|
36
|
+
cwd: rootData.ws,
|
|
37
|
+
file_map,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
else if (rootData.root) {
|
|
41
|
+
const file_map = (0, getRootCopyStaticFiles_1.getRootCopyStaticFilesAuto)({
|
|
42
|
+
...rootData,
|
|
43
|
+
isRoot: true,
|
|
44
|
+
});
|
|
45
|
+
(0, static_file_1.copyStaticFiles)({
|
|
46
|
+
cwd: rootData.root,
|
|
47
|
+
file_map,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
30
50
|
logger_1.consoleLogger.info(`check git info`);
|
|
31
51
|
const hostedGitInfo = (0, pkg_git_info_1.npmHostedGitInfoLazy)(cwd);
|
|
32
52
|
console.log(`homepage:`, hostedGitInfo.homepage);
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,oDAA8D;AAC9D,0DAA+D;AAC/D,4CAAwD;AACxD,2CAAoF;AACpF,gDAAoD;AACpD,gEAAgC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,oDAA8D;AAC9D,0DAA+D;AAC/D,4CAAwD;AACxD,2CAAoF;AACpF,gDAAoD;AACpD,gEAAgC;AAChC,wDAAyD;AACzD,uFAAuF;AACvF,mGAAoG;AAQpG,SAAgB,aAAa,CAAC,GAAW,EAAE,OAAwB;IAElE,OAAO,kBAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;QAEnC,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,OAAO,CAAC,GAAG,EAAE,EAAC;QAEtB,sBAAa,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;QAElC,IAAI,QAAQ,GAAG,IAAA,wBAAY,EAAC;YAC3B,GAAG;SAC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C,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;QAErD,sBAAa,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QAE5D,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEpC,IAAI,QAAQ,CAAC,YAAY,EACzB;YACC,IAAA,kBAAU,EAAC;gBACV,QAAQ;gBACR,aAAa;gBACb,MAAM;gBACN,sBAAsB;aACtB,CAAC,CAAA;SACF;aAED;YACC,IAAA,gBAAQ,EAAC;gBACR,QAAQ;gBACR,aAAa;gBACb,MAAM;gBACN,sBAAsB;gBACtB,SAAS,EAAE,QAAQ,CAAC,IAAI;aACxB,CAAC,CAAA;SACF;QAED,MAAM,IAAI,GAAG,IAAA,kCAA0B,EAAC,QAAQ,CAAC,CAAC;QAElD,OAAO,IAAA,6BAAqB,EAAC,IAAI,EAAE;YAClC,QAAQ;YACR,sBAAsB;YACtB,MAAM;YACN,aAAa;SACb,CAAC,CAAA;IACH,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAS,CAAC,CAAA;AAC9B,CAAC;AA7FD,sCA6FC;AAED,kBAAe,aAAa,CAAA","sourcesContent":["import { findRoot, findRootLazy } from '@yarn-tool/find-root';\nimport { npmHostedGitInfoLazy } from '@yarn-tool/pkg-git-info';\nimport { _fixRoot, _fixWsRoot } from './lib/root/index';\nimport { _initPkgListableByRootData, _runEachPackagesAsync } from './lib/pkg/index';\nimport { consoleLogger } from 'debug-color2/logger';\nimport Bluebird from 'bluebird';\nimport { copyStaticFiles } from '@yarn-tool/static-file';\nimport { getWsCopyStaticFiles } from '@yarn-tool/static-file/lib/ws/wsCopyStaticFiles';\nimport { getRootCopyStaticFilesAuto } from '@yarn-tool/static-file/lib/root/getRootCopyStaticFiles';\n\nexport interface INpmAutoFixAll\n{\n\toverwriteHostedGitInfo?: boolean;\n\tbranch?: string;\n}\n\nexport function npmAutoFixAll(cwd: string, options?: INpmAutoFixAll)\n{\n\treturn Bluebird.resolve().then(() =>\n\t{\n\t\tcwd ??= process.cwd();\n\n\t\tconsoleLogger.info(`cwd: ${cwd}`);\n\n\t\tlet rootData = findRootLazy({\n\t\t\tcwd,\n\t\t});\n\n\t\tif (!rootData?.root)\n\t\t{\n\t\t\tthrow new Error(`Invalid workspaces / package: ${cwd}`)\n\t\t}\n\n\t\tif (rootData.hasWorkspace && !rootData.isWorkspace)\n\t\t{\n\t\t\trootData = findRoot({\n\t\t\t\tcwd: rootData.root,\n\t\t\t});\n\t\t}\n\n\t\tconsole.log(`root:`, rootData.root);\n\t\tconsole.log(`hasWorkspace:`, rootData.hasWorkspace);\n\n\t\tlet { branch, overwriteHostedGitInfo } = options ?? {};\n\n\t\tcwd = rootData.cwd;\n\n\t\tif (rootData.hasWorkspace)\n\t\t{\n\t\t\tconst file_map = getWsCopyStaticFiles();\n\n\t\t\tcopyStaticFiles({\n\t\t\t\tcwd: rootData.ws,\n\t\t\t\tfile_map,\n\t\t\t});\n\t\t}\n\t\telse if (rootData.root)\n\t\t{\n\t\t\tconst file_map = getRootCopyStaticFilesAuto({\n\t\t\t\t...rootData,\n\t\t\t\tisRoot: true,\n\t\t\t});\n\n\t\t\tcopyStaticFiles({\n\t\t\t\tcwd: rootData.root,\n\t\t\t\tfile_map,\n\t\t\t});\n\t\t}\n\n\t\tconsoleLogger.info(`check git info`);\n\n\t\tconst hostedGitInfo = npmHostedGitInfoLazy(cwd);\n\n\t\tconsole.log(`homepage:`, hostedGitInfo.homepage);\n\t\tconsole.log(`repository:`, hostedGitInfo.repository);\n\n\t\tconsoleLogger.info(`auto fix root of workspaces / package`);\n\n\t\tconsole.log(`root:`, rootData.root);\n\n\t\tif (rootData.hasWorkspace)\n\t\t{\n\t\t\t_fixWsRoot({\n\t\t\t\trootData,\n\t\t\t\thostedGitInfo,\n\t\t\t\tbranch,\n\t\t\t\toverwriteHostedGitInfo,\n\t\t\t})\n\t\t}\n\t\telse\n\t\t{\n\t\t\t_fixRoot({\n\t\t\t\trootData,\n\t\t\t\thostedGitInfo,\n\t\t\t\tbranch,\n\t\t\t\toverwriteHostedGitInfo,\n\t\t\t\ttargetDir: rootData.root,\n\t\t\t})\n\t\t}\n\n\t\tconst list = _initPkgListableByRootData(rootData);\n\n\t\treturn _runEachPackagesAsync(list, {\n\t\t\trootData,\n\t\t\toverwriteHostedGitInfo,\n\t\t\tbranch,\n\t\t\thostedGitInfo,\n\t\t})\n\t}).then(() => void 0 as void)\n}\n\nexport default npmAutoFixAll\n"]}
|
package/lib/pkg/index.js
CHANGED
|
@@ -15,6 +15,8 @@ const sort_package_json3_1 = require("sort-package-json3");
|
|
|
15
15
|
const fix_ws_versions_1 = require("@yarn-tool/fix-ws-versions");
|
|
16
16
|
const types_1 = require("@ts-type/package-dts/lib/package-json/types");
|
|
17
17
|
const normalize_deps_value_1 = require("@yarn-tool/normalize-deps-value");
|
|
18
|
+
const getRootCopyStaticFiles_1 = require("@yarn-tool/static-file/lib/root/getRootCopyStaticFiles");
|
|
19
|
+
const static_file_1 = require("@yarn-tool/static-file");
|
|
18
20
|
function _handler(cwd, ...argv) {
|
|
19
21
|
return {
|
|
20
22
|
...(0, ws_pkg_list_1.normalizeListableRowExtra)(argv[0], cwd),
|
|
@@ -37,6 +39,14 @@ function _runEachPackagesAsync(list, options) {
|
|
|
37
39
|
const err = new lazy_aggregate_error_1.AggregateErrorExtra();
|
|
38
40
|
const promiseLogger = logger((async () => {
|
|
39
41
|
const pkg = new npm_package_json_loader_1.PackageJsonLoader(row.manifestLocation);
|
|
42
|
+
const file_map = (0, getRootCopyStaticFiles_1.getRootCopyStaticFilesAuto)({
|
|
43
|
+
...rootData,
|
|
44
|
+
isRoot: false,
|
|
45
|
+
});
|
|
46
|
+
(0, static_file_1.copyStaticFiles)({
|
|
47
|
+
cwd: row.location,
|
|
48
|
+
file_map,
|
|
49
|
+
});
|
|
40
50
|
try {
|
|
41
51
|
(0, pkg_entry_util_1.pkgExportsVerify)(pkg.data);
|
|
42
52
|
}
|
|
@@ -67,7 +77,7 @@ function _runEachPackagesAsync(list, options) {
|
|
|
67
77
|
.catch(e => err.push(e))
|
|
68
78
|
.then(() => {
|
|
69
79
|
if (err.length) {
|
|
70
|
-
debug_color2_1.console.error(err
|
|
80
|
+
debug_color2_1.console.error(err);
|
|
71
81
|
}
|
|
72
82
|
});
|
|
73
83
|
});
|
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;AACrD,gEAAyF;AACzF,uEAA4F;AAC5F,0EAAqE;
|
|
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;AAEzD,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,EACtB,aAAa,EACb,MAAM,GACN,GAAG,OAAO,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AAC,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';\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 = 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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/fix-all",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "auto check/fix workspaces/package",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yarn",
|
|
@@ -56,16 +56,17 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@yarn-tool/find-root": "^2.0.4",
|
|
58
58
|
"@yarn-tool/fix-ws-versions": "^2.0.4",
|
|
59
|
-
"@yarn-tool/normalize-deps-value": "^1.0.
|
|
59
|
+
"@yarn-tool/normalize-deps-value": "^1.0.2",
|
|
60
60
|
"@yarn-tool/pkg-git-info": "^1.0.33",
|
|
61
61
|
"@yarn-tool/pkg-hosted-info": "^2.0.5",
|
|
62
|
+
"@yarn-tool/static-file": "^2.0.4",
|
|
62
63
|
"@yarn-tool/ws-scope": "^2.0.4",
|
|
63
64
|
"bluebird": "^3.7.2",
|
|
64
65
|
"cache-path": "^3.0.4",
|
|
65
66
|
"debug-color2": "^1.3.1",
|
|
66
67
|
"fs-extra": "^10.1.0",
|
|
67
|
-
"lazy-aggregate-error": "^1.0.
|
|
68
|
-
"npm-package-json-loader": "^2.0.
|
|
68
|
+
"lazy-aggregate-error": "^1.0.12",
|
|
69
|
+
"npm-package-json-loader": "^2.0.10",
|
|
69
70
|
"progress-estimator": "^0.3.0",
|
|
70
71
|
"sort-package-json3": "^2.0.3",
|
|
71
72
|
"ts-type": "^2.1.10",
|
|
@@ -77,5 +78,5 @@
|
|
|
77
78
|
"publishConfig": {
|
|
78
79
|
"access": "public"
|
|
79
80
|
},
|
|
80
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "4f5021febb52ab520c1d96d3d58365afd7cc20ef"
|
|
81
82
|
}
|