@yarn-tool/pkg-entry-util 2.0.7 → 2.0.10

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,36 @@
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.10](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-entry-util@2.0.9...@yarn-tool/pkg-entry-util@2.0.10) (2022-08-19)
7
+
8
+
9
+ ### 🐛 Bug Fixes
10
+
11
+ * skip check './src/*' ([e2c48e2](https://github.com/bluelovers/ws-yarn-workspaces/commit/e2c48e2ef7a32700a6208e60766d0e43af623f45))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.0.9](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-entry-util@2.0.8...@yarn-tool/pkg-entry-util@2.0.9) (2022-08-18)
18
+
19
+
20
+ ### ✨ Features
21
+
22
+ * add `install:frozenLockfile` ([d7797f1](https://github.com/bluelovers/ws-yarn-workspaces/commit/d7797f13050343208b499895859924eecda42550))
23
+
24
+
25
+
26
+
27
+
28
+ ## [2.0.8](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-entry-util@2.0.7...@yarn-tool/pkg-entry-util@2.0.8) (2022-08-13)
29
+
30
+ **Note:** Version bump only for package @yarn-tool/pkg-entry-util
31
+
32
+
33
+
34
+
35
+
6
36
  ## [2.0.7](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-entry-util@2.0.6...@yarn-tool/pkg-entry-util@2.0.7) (2022-08-13)
7
37
 
8
38
 
@@ -34,6 +34,13 @@ function pkgExportsVerify(pkg, options) {
34
34
  [typeof value === 'string' ? value : Object.values(value)]
35
35
  .flat()
36
36
  .forEach(file => {
37
+ var _a;
38
+ /**
39
+ * skip check './src/*'
40
+ */
41
+ if ((_a = file.includes) === null || _a === void 0 ? void 0 : _a.call(file, '*')) {
42
+ return;
43
+ }
37
44
  const bool = (0, fs_extra_1.pathExistsSync)((0, path_1.resolve)(rootData.pkg, file));
38
45
  if (!bool) {
39
46
  list.push(`path of '${entry}' does not exist: '${file}'`);
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sourceRoot":"","sources":["exports.ts"],"names":[],"mappings":";;;AAEA,+BAA+B;AAC/B,uCAA0C;AAC1C,oDAAoD;AAEpD,SAAgB,4BAA4B,CAAoC,UAAa;;IAE5F,IAAI,OAAO,UAAU,KAAK,QAAQ,EAClC;QACC,MAAA,UAAU,CAAC,gBAAgB,qCAA3B,UAAU,CAAC,gBAAgB,IAAM,gBAAgB,EAAC;KAClD;IAED,OAAO,UAAU,CAAA;AAClB,CAAC;AARD,oEAQC;AAED,SAAgB,uBAAuB,CAAyB,GAAM;IAErE,4BAA4B,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAE1C,OAAO,GAAG,CAAA;AACX,CAAC;AALD,0DAKC;AAED,SAAgB,sBAAsB,CAAC,KAAmD,EACzF,KAAmD;IAGnD,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,KAAK,CAAC,CAAA;AACpD,CAAC;AALD,wDAKC;AAED,SAAgB,gBAAgB,CAAyB,GAAM,EAAE,OAEhE;IAEA,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,EACnC;QACC,MAAM,QAAQ,GAAG,IAAA,wBAAY,EAAC;YAC7B,GAAG,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG;SACjB,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,GAAG,EACzC;YACC,MAAM,IAAI,GAAa,EAAE,CAAC;YAE1B,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;iBACzB,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE;gBAE3B,IAAI,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,EACxC;oBACE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAc;yBACtE,IAAI,EAAE;yBACN,OAAO,CAAC,IAAI,CAAC,EAAE;wBAEf,MAAM,IAAI,GAAG,IAAA,yBAAc,EAAC,IAAA,cAAO,EAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;wBAEzD,IAAI,CAAC,IAAI,EACT;4BACC,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,sBAAsB,IAAI,GAAG,CAAC,CAAC;yBAC1D;oBAEF,CAAC,CAAC,CACF;iBACD;YACF,CAAC,CAAC,CACF;YAED,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EACnB;gBACC,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,4BAA4B,QAAQ,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAEhH,aAAa;gBACb,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;gBAChB,aAAa;gBACb,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBACxB,aAAa;gBACb,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC;gBAE7B,MAAM,GAAG,CAAC;aACV;SACD;KAED;IAED,OAAO,IAAY,CAAA;AACpB,CAAC;AAtDD,4CAsDC","sourcesContent":["import { IPackageJson } from '@ts-type/package-dts/package-json';\nimport { PackageExportsEntry, PackageExportsFallback } from '@ts-type/package-dts/types/package.json';\nimport { resolve } from 'path';\nimport { pathExistsSync } from 'fs-extra';\nimport { findRootLazy } from '@yarn-tool/find-root';\n\nexport function _pkgExportsAddPJsonEntryCore<T extends IPackageJson[\"exports\"]>(pkgExports: T)\n{\n\tif (typeof pkgExports === 'object')\n\t{\n\t\tpkgExports['./package.json'] ??= './package.json';\n\t}\n\n\treturn pkgExports\n}\n\nexport function pkgExportsAddPJsonEntry<T extends IPackageJson>(pkg: T)\n{\n\t_pkgExportsAddPJsonEntryCore(pkg.exports);\n\n\treturn pkg\n}\n\nexport function _isPackageExportsEntry(entry: string | keyof keyof IPackageJson[\"exports\"],\n\tvalue: PackageExportsEntry | PackageExportsFallback,\n): value is PackageExportsEntry\n{\n\treturn entry.startsWith('./') && !!(value ?? false)\n}\n\nexport function pkgExportsVerify<T extends IPackageJson>(pkg: T, options?: {\n\tcwd?: string,\n})\n{\n\tif (typeof pkg.exports === 'object')\n\t{\n\t\tconst rootData = findRootLazy({\n\t\t\tcwd: options?.cwd,\n\t\t});\n\n\t\tif (!rootData.isWorkspace && rootData.pkg)\n\t\t{\n\t\t\tconst list: string[] = [];\n\n\t\t\tObject.entries(pkg.exports)\n\t\t\t\t.forEach(([entry, value]) =>\n\t\t\t\t{\n\t\t\t\t\tif (_isPackageExportsEntry(entry, value))\n\t\t\t\t\t{\n\t\t\t\t\t\t([typeof value === 'string' ? value : Object.values(value)] as string[])\n\t\t\t\t\t\t\t.flat()\n\t\t\t\t\t\t\t.forEach(file =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconst bool = pathExistsSync(resolve(rootData.pkg, file));\n\n\t\t\t\t\t\t\t\tif (!bool)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlist.push(`path of '${entry}' does not exist: '${file}'`);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t;\n\n\t\t\tif (list.length > 0)\n\t\t\t{\n\t\t\t\tlet err = new Error(`Invalid package exports: ${rootData.pkg}\\n${list.slice().map(v => ` - ${v}`).join('\\n')}`);\n\n\t\t\t\t// @ts-ignore\n\t\t\t\terr.list = list;\n\t\t\t\t// @ts-ignore\n\t\t\t\terr.rootData = rootData;\n\t\t\t\t// @ts-ignore\n\t\t\t\terr.pkgExports = pkg.exports;\n\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn null as null\n}\n"]}
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["exports.ts"],"names":[],"mappings":";;;AAEA,+BAA+B;AAC/B,uCAA0C;AAC1C,oDAAoD;AAEpD,SAAgB,4BAA4B,CAAoC,UAAa;;IAE5F,IAAI,OAAO,UAAU,KAAK,QAAQ,EAClC;QACC,MAAA,UAAU,CAAC,gBAAgB,qCAA3B,UAAU,CAAC,gBAAgB,IAAM,gBAAgB,EAAC;KAClD;IAED,OAAO,UAAU,CAAA;AAClB,CAAC;AARD,oEAQC;AAED,SAAgB,uBAAuB,CAAyB,GAAM;IAErE,4BAA4B,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAE1C,OAAO,GAAG,CAAA;AACX,CAAC;AALD,0DAKC;AAED,SAAgB,sBAAsB,CAAC,KAAmD,EACzF,KAAmD;IAGnD,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,KAAK,CAAC,CAAA;AACpD,CAAC;AALD,wDAKC;AAED,SAAgB,gBAAgB,CAAyB,GAAM,EAAE,OAEhE;IAEA,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,EACnC;QACC,MAAM,QAAQ,GAAG,IAAA,wBAAY,EAAC;YAC7B,GAAG,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG;SACjB,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,GAAG,EACzC;YACC,MAAM,IA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;KAED;IAED,OAAO,IAAY,CAAA;AACpB,CAAC;AA9DD,4CA8DC","sourcesContent":["import { IPackageJson } from '@ts-type/package-dts/package-json';\nimport { PackageExportsEntry, PackageExportsFallback } from '@ts-type/package-dts/types/package.json';\nimport { resolve } from 'path';\nimport { pathExistsSync } from 'fs-extra';\nimport { findRootLazy } from '@yarn-tool/find-root';\n\nexport function _pkgExportsAddPJsonEntryCore<T extends IPackageJson[\"exports\"]>(pkgExports: T)\n{\n\tif (typeof pkgExports === 'object')\n\t{\n\t\tpkgExports['./package.json'] ??= './package.json';\n\t}\n\n\treturn pkgExports\n}\n\nexport function pkgExportsAddPJsonEntry<T extends IPackageJson>(pkg: T)\n{\n\t_pkgExportsAddPJsonEntryCore(pkg.exports);\n\n\treturn pkg\n}\n\nexport function _isPackageExportsEntry(entry: string | keyof keyof IPackageJson[\"exports\"],\n\tvalue: PackageExportsEntry | PackageExportsFallback,\n): value is PackageExportsEntry\n{\n\treturn entry.startsWith('./') && !!(value ?? false)\n}\n\nexport function pkgExportsVerify<T extends IPackageJson>(pkg: T, options?: {\n\tcwd?: string,\n})\n{\n\tif (typeof pkg.exports === 'object')\n\t{\n\t\tconst rootData = findRootLazy({\n\t\t\tcwd: options?.cwd,\n\t\t});\n\n\t\tif (!rootData.isWorkspace && rootData.pkg)\n\t\t{\n\t\t\tconst list: string[] = [];\n\n\t\t\tObject.entries(pkg.exports)\n\t\t\t\t.forEach(([entry, value]) =>\n\t\t\t\t{\n\t\t\t\t\tif (_isPackageExportsEntry(entry, value))\n\t\t\t\t\t{\n\t\t\t\t\t\t([typeof value === 'string' ? value : Object.values(value)] as string[])\n\t\t\t\t\t\t\t.flat()\n\t\t\t\t\t\t\t.forEach(file =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * skip check './src/*'\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tif (file.includes?.('*'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst bool = pathExistsSync(resolve(rootData.pkg, file));\n\n\t\t\t\t\t\t\t\tif (!bool)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlist.push(`path of '${entry}' does not exist: '${file}'`);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t;\n\n\t\t\tif (list.length > 0)\n\t\t\t{\n\t\t\t\tlet err = new Error(`Invalid package exports: ${rootData.pkg}\\n${list.slice().map(v => ` - ${v}`).join('\\n')}`);\n\n\t\t\t\t// @ts-ignore\n\t\t\t\terr.list = list;\n\t\t\t\t// @ts-ignore\n\t\t\t\terr.rootData = rootData;\n\t\t\t\t// @ts-ignore\n\t\t\t\terr.pkgExports = pkg.exports;\n\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn null as null\n}\n"]}
@@ -11,4 +11,5 @@ export declare function defaultRootScripts(): {
11
11
  "ci:install": string;
12
12
  "test:jest:clearCache": string;
13
13
  "install:resetLockfile": string;
14
+ "install:frozenLockfile": string;
14
15
  };
@@ -2,4 +2,5 @@ export declare function defaultSharedRootScripts(): {
2
2
  "ci:install": string;
3
3
  "test:jest:clearCache": string;
4
4
  "install:resetLockfile": string;
5
+ "install:frozenLockfile": string;
5
6
  };
@@ -6,6 +6,7 @@ function defaultSharedRootScripts() {
6
6
  "ci:install": "yarn install --frozen-lockfile && yarn add -W typescript@next jest ts-jest ts-node ynpx lerna yarn-tool",
7
7
  "test:jest:clearCache": "jest --clearCache",
8
8
  "install:resetLockfile": "yarn-tool install --reset-lockfile",
9
+ "install:frozenLockfile": "yarn-tool install --frozen-lockfile",
9
10
  };
10
11
  }
11
12
  exports.defaultSharedRootScripts = defaultSharedRootScripts;
@@ -1 +1 @@
1
- {"version":3,"file":"shared-root-scripts.js","sourceRoot":"","sources":["shared-root-scripts.ts"],"names":[],"mappings":";;;AAAA,SAAgB,wBAAwB;IAEvC,OAAO;QACN,YAAY,EAAE,yGAAyG;QACvH,sBAAsB,EAAE,mBAAmB;QAC3C,uBAAuB,EAAE,oCAAoC;KAC7D,CAAA;AACF,CAAC;AAPD,4DAOC","sourcesContent":["export function defaultSharedRootScripts()\n{\n\treturn {\n\t\t\"ci:install\": \"yarn install --frozen-lockfile && yarn add -W typescript@next jest ts-jest ts-node ynpx lerna yarn-tool\",\n\t\t\"test:jest:clearCache\": \"jest --clearCache\",\n\t\t\"install:resetLockfile\": \"yarn-tool install --reset-lockfile\",\n\t}\n}\n"]}
1
+ {"version":3,"file":"shared-root-scripts.js","sourceRoot":"","sources":["shared-root-scripts.ts"],"names":[],"mappings":";;;AAAA,SAAgB,wBAAwB;IAEvC,OAAO;QACN,YAAY,EAAE,yGAAyG;QACvH,sBAAsB,EAAE,mBAAmB;QAC3C,uBAAuB,EAAE,oCAAoC;QAC7D,wBAAwB,EAAE,qCAAqC;KAC/D,CAAA;AACF,CAAC;AARD,4DAQC","sourcesContent":["export function defaultSharedRootScripts()\n{\n\treturn {\n\t\t\"ci:install\": \"yarn install --frozen-lockfile && yarn add -W typescript@next jest ts-jest ts-node ynpx lerna yarn-tool\",\n\t\t\"test:jest:clearCache\": \"jest --clearCache\",\n\t\t\"install:resetLockfile\": \"yarn-tool install --reset-lockfile\",\n\t\t\"install:frozenLockfile\": \"yarn-tool install --frozen-lockfile\",\n\t}\n}\n"]}
@@ -31,4 +31,5 @@ export declare function defaultWorkspaceRootScripts(): {
31
31
  "ci:install": string;
32
32
  "test:jest:clearCache": string;
33
33
  "install:resetLockfile": string;
34
+ "install:frozenLockfile": string;
34
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarn-tool/pkg-entry-util",
3
- "version": "2.0.7",
3
+ "version": "2.0.10",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "yarn",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@ts-type/package-dts": "^2.0.5",
55
- "@yarn-tool/find-root": "^2.0.3",
55
+ "@yarn-tool/find-root": "^2.0.4",
56
56
  "fs-extra": "^10.1.0",
57
57
  "tslib": "^2",
58
58
  "upath2": "^3.1.15"
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "e34c95f09bf1ad26e3a721028a28f6b8bfb44510"
64
+ "gitHead": "04b0e35bd37a6cbe152fd6564f0ec2439625270a"
65
65
  }