@yarn-tool/check-pkg-bin 3.0.1 → 3.0.3
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 +25 -0
- package/lib/core.d.ts +0 -1
- package/lib/core.js +3 -4
- package/lib/core.js.map +1 -1
- package/lib/pkg.js +1 -2
- package/lib/pkg.js.map +1 -1
- package/lib/ws.js +1 -2
- package/lib/ws.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
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
|
+
## [3.0.3](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/check-pkg-bin@3.0.2...@yarn-tool/check-pkg-bin@3.0.3) (2025-09-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 📌 Dependencies
|
|
11
|
+
|
|
12
|
+
* fix and update deps avoid use yargs@18 ([5ed9a5c](https://github.com/bluelovers/ws-yarn-workspaces/commit/5ed9a5cd953eeebd28d4ee970e99bed6fb966317))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [3.0.2](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/check-pkg-bin@3.0.1...@yarn-tool/check-pkg-bin@3.0.2) (2024-05-03)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### 🛠 Build System
|
|
21
|
+
|
|
22
|
+
* update typescript ([ffa656a](https://github.com/bluelovers/ws-yarn-workspaces/commit/ffa656aefe53966db445d52234eb0efe4651e3dd))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### 📌 Dependencies
|
|
26
|
+
|
|
27
|
+
* update deps ([f731d88](https://github.com/bluelovers/ws-yarn-workspaces/commit/f731d88db6e63d180e2db2e493beb42e84eb8e16))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
6
31
|
## [3.0.1](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/check-pkg-bin@3.0.0...@yarn-tool/check-pkg-bin@3.0.1) (2024-02-28)
|
|
7
32
|
|
|
8
33
|
|
package/lib/core.d.ts
CHANGED
package/lib/core.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
* Created by user on 2020/6/13.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.hasShebang = hasShebang;
|
|
7
|
+
exports.checkFile = checkFile;
|
|
8
|
+
exports.checkPkgJson = checkPkgJson;
|
|
7
9
|
const fs_extra_1 = require("fs-extra");
|
|
8
10
|
const shebang_1 = require("@yarn-tool/shebang");
|
|
9
11
|
const get_pkg_bin_1 = require("@yarn-tool/get-pkg-bin");
|
|
@@ -12,13 +14,11 @@ function hasShebang(buf) {
|
|
|
12
14
|
var _a, _b;
|
|
13
15
|
return ((_b = (_a = (0, shebang_1.matchShebang)(buf.toString())) === null || _a === void 0 ? void 0 : _a.script) === null || _b === void 0 ? void 0 : _b.length) > 0;
|
|
14
16
|
}
|
|
15
|
-
exports.hasShebang = hasShebang;
|
|
16
17
|
function checkFile(file) {
|
|
17
18
|
if ((0, fs_extra_1.existsSync)(file)) {
|
|
18
19
|
return hasShebang((0, fs_extra_1.readFileSync)(file));
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
|
-
exports.checkFile = checkFile;
|
|
22
22
|
function checkPkgJson(pkg, cwd) {
|
|
23
23
|
var _a;
|
|
24
24
|
return Object.entries((_a = (0, get_pkg_bin_1.getPackageBins)(pkg)) !== null && _a !== void 0 ? _a : [])
|
|
@@ -34,5 +34,4 @@ function checkPkgJson(pkg, cwd) {
|
|
|
34
34
|
return a;
|
|
35
35
|
}, []);
|
|
36
36
|
}
|
|
37
|
-
exports.checkPkgJson = checkPkgJson;
|
|
38
37
|
//# sourceMappingURL=core.js.map
|
package/lib/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["core.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["core.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAQH,gCAGC;AAED,8BAMC;AAED,oCAsBC;AAzCD,uCAAoD;AACpD,gDAAkD;AAElD,wDAAwD;AACxD,mCAA8B;AAE9B,SAAgB,UAAU,CAAC,GAAoB;;IAE9C,OAAO,CAAA,MAAA,MAAA,IAAA,sBAAY,EAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,0CAAE,MAAM,0CAAE,MAAM,IAAG,CAAC,CAAA;AACxD,CAAC;AAED,SAAgB,SAAS,CAAC,IAAY;IAErC,IAAI,IAAA,qBAAU,EAAC,IAAI,CAAC,EACpB,CAAC;QACA,OAAO,UAAU,CAAC,IAAA,uBAAY,EAAC,IAAI,CAAC,CAAC,CAAA;IACtC,CAAC;AACF,CAAC;AAED,SAAgB,YAAY,CAAC,GAAiB,EAAE,GAAW;;IAE1D,OAAO,MAAM,CAAC,OAAO,CAAC,MAAA,IAAA,4BAAc,EAAC,GAAG,CAAC,mCAAI,EAAE,CAAC;SAC9C,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;QAGlB,IAAI,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,IAAI,GAAG,IAAA,aAAI,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC/B,IAAI,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;QAE1B,CAAC,CAAC,IAAI,CAAC;YACN,IAAI;YACJ,QAAQ;YACR,UAAU,EAAE,IAAI;SAChB,CAAC,CAAA;QAEF,OAAO,CAAC,CAAA;IACT,CAAC,EAAE,EAIA,CAAC,CAAA;AACN,CAAC","sourcesContent":["/**\n * Created by user on 2020/6/13.\n */\n\nimport { existsSync, readFileSync } from 'fs-extra';\nimport { matchShebang } from '@yarn-tool/shebang';\nimport { IPackageJson } from '@ts-type/package-dts';\nimport { getPackageBins } from '@yarn-tool/get-pkg-bin';\nimport { join } from 'upath2';\n\nexport function hasShebang(buf: Buffer | string)\n{\n\treturn matchShebang(buf.toString())?.script?.length > 0\n}\n\nexport function checkFile(file: string)\n{\n\tif (existsSync(file))\n\t{\n\t\treturn hasShebang(readFileSync(file))\n\t}\n}\n\nexport function checkPkgJson(pkg: IPackageJson, cwd: string)\n{\n\treturn Object.entries(getPackageBins(pkg) ?? [])\n\t\t.reduce((a, row) =>\n\t\t{\n\n\t\t\tlet filename = row[1];\n\t\t\tlet file = join(cwd, filename);\n\t\t\tlet bool = checkFile(file)\n\n\t\t\ta.push({\n\t\t\t\tfile,\n\t\t\t\tfilename,\n\t\t\t\thasShebang: bool,\n\t\t\t})\n\n\t\t\treturn a\n\t\t}, [] as {\n\t\t\tfile: string,\n\t\t\tfilename: string,\n\t\t\thasShebang: boolean,\n\t\t}[])\n}\n\n"]}
|
package/lib/pkg.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Created by user on 2020/6/13.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.checkPkgDir =
|
|
6
|
+
exports.checkPkgDir = checkPkgDir;
|
|
7
7
|
const package_dts_1 = require("@ts-type/package-dts");
|
|
8
8
|
const upath2_1 = require("upath2");
|
|
9
9
|
const core_1 = require("./core");
|
|
@@ -18,5 +18,4 @@ function checkPkgDir(pkgDir = process.cwd()) {
|
|
|
18
18
|
valid: result.every(r => r.hasShebang),
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
exports.checkPkgDir = checkPkgDir;
|
|
22
21
|
//# sourceMappingURL=pkg.js.map
|
package/lib/pkg.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkg.js","sourceRoot":"","sources":["pkg.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"pkg.js","sourceRoot":"","sources":["pkg.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAMH,kCAaC;AAjBD,sDAAuD;AACvD,mCAA8B;AAC9B,iCAAsC;AAEtC,SAAgB,WAAW,CAAC,SAAiB,OAAO,CAAC,GAAG,EAAE;IAEzD,MAAM,GAAG,GAAG,IAAA,6BAAe,EAAC,IAAA,aAAI,EAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1D,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAExC,OAAO;QACN,IAAI,EAAE,GAAG,CAAC,IAAc;QACxB,GAAG;QACH,MAAM;QACN,MAAM;QACN,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;KACtC,CAAA;AACF,CAAC","sourcesContent":["/**\n * Created by user on 2020/6/13.\n */\n\nimport { readPackageJson } from '@ts-type/package-dts';\nimport { join } from 'upath2';\nimport { checkPkgJson } from './core';\n\nexport function checkPkgDir(pkgDir: string = process.cwd())\n{\n\tconst pkg = readPackageJson(join(pkgDir, 'package.json'));\n\n\tconst result = checkPkgJson(pkg, pkgDir)\n\n\treturn {\n\t\tname: pkg.name as string,\n\t\tpkg,\n\t\tpkgDir,\n\t\tresult,\n\t\tvalid: result.every(r => r.hasShebang),\n\t}\n}\n"]}
|
package/lib/ws.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkWorkspaces =
|
|
3
|
+
exports.checkWorkspaces = checkWorkspaces;
|
|
4
4
|
const listpkg_1 = require("ws-pkg-list/lib/listpkg");
|
|
5
5
|
const pkg_1 = require("./pkg");
|
|
6
6
|
function checkWorkspaces(cwd = process.cwd()) {
|
|
7
7
|
return (0, listpkg_1.workspacesPackagesList)(cwd)
|
|
8
8
|
.map(cwd => (0, pkg_1.checkPkgDir)(cwd));
|
|
9
9
|
}
|
|
10
|
-
exports.checkWorkspaces = checkWorkspaces;
|
|
11
10
|
//# sourceMappingURL=ws.js.map
|
package/lib/ws.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws.js","sourceRoot":"","sources":["ws.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ws.js","sourceRoot":"","sources":["ws.ts"],"names":[],"mappings":";;AAIA,0CAKC;AATD,qDAAiE;AACjE,+BAAoC;AAGpC,SAAgB,eAAe,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE;IAE1D,OAAO,IAAA,gCAAsB,EAAC,GAAG,CAAC;SAChC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAA,iBAAW,EAAC,GAAG,CAAC,CAAC,CAC7B;AACF,CAAC","sourcesContent":["import { workspacesPackagesList } from 'ws-pkg-list/lib/listpkg';\nimport { checkPkgDir } from './pkg';\nimport { IPackageJson } from '@ts-type/package-dts';\n\nexport function checkWorkspaces(cwd: string = process.cwd())\n{\n\treturn workspacesPackagesList(cwd)\n\t\t.map(cwd => checkPkgDir(cwd))\n\t;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/check-pkg-bin",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "check pkg bin has shebang",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/check-pkg-bin#readme",
|
|
@@ -45,23 +45,23 @@
|
|
|
45
45
|
"tsc:showConfig": "ynpx get-current-tsconfig -p"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@bluelovers/string-natural-compare": "^2.0.
|
|
48
|
+
"@bluelovers/string-natural-compare": "^2.0.13",
|
|
49
49
|
"@ts-type/package-dts": "^2.0.8",
|
|
50
|
-
"@yarn-tool/find-root": "^2.0.
|
|
51
|
-
"@yarn-tool/get-pkg-bin": "^2.0.
|
|
52
|
-
"@yarn-tool/shebang": "^1.0.
|
|
53
|
-
"@yarn-tool/table": "^2.0.
|
|
54
|
-
"cli-table3": "^0.6.
|
|
50
|
+
"@yarn-tool/find-root": "^2.0.15",
|
|
51
|
+
"@yarn-tool/get-pkg-bin": "^2.0.12",
|
|
52
|
+
"@yarn-tool/shebang": "^1.0.20",
|
|
53
|
+
"@yarn-tool/table": "^2.0.15",
|
|
54
|
+
"cli-table3": "^0.6.5",
|
|
55
55
|
"debug-color2": "^1.3.2",
|
|
56
56
|
"fs-extra": "^11.2.0",
|
|
57
57
|
"pkg-dir": "<6 >=5",
|
|
58
58
|
"tslib": ">=2",
|
|
59
59
|
"upath2": "^3.1.19",
|
|
60
|
-
"ws-pkg-list": "^3.0.
|
|
60
|
+
"ws-pkg-list": "^3.0.3",
|
|
61
61
|
"yargs": "^17.7.2"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "ca7f14bdac1827ed8e8fe5fd0932ee56a44669dc"
|
|
67
67
|
}
|