@yarn-tool/is-published 2.0.1 → 2.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 +18 -0
- package/index.js +7 -7
- package/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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.3](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/is-published@2.0.2...@yarn-tool/is-published@2.0.3) (2025-09-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @yarn-tool/is-published
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.0.2](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/is-published@2.0.1...@yarn-tool/is-published@2.0.2) (2024-05-03)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### 🛠 Build System
|
|
19
|
+
|
|
20
|
+
* update typescript ([ffa656a](https://github.com/bluelovers/ws-yarn-workspaces/commit/ffa656aefe53966db445d52234eb0efe4651e3dd))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [2.0.1](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/is-published@2.0.0...@yarn-tool/is-published@2.0.1) (2024-02-28)
|
|
7
25
|
|
|
8
26
|
**Note:** Version bump only for package @yarn-tool/is-published
|
package/index.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.EnumIsPublishedState = void 0;
|
|
4
|
+
exports._isPublishedCoreByNpaResult = _isPublishedCoreByNpaResult;
|
|
5
|
+
exports._isPublishedCore = _isPublishedCore;
|
|
6
|
+
exports._isPublishedCoreByPackageJSON = _isPublishedCoreByPackageJSON;
|
|
7
|
+
exports.isPublishedByNpaResult = isPublishedByNpaResult;
|
|
8
|
+
exports.isPublished = isPublished;
|
|
9
|
+
exports.isPublishedByPackageJSON = isPublishedByPackageJSON;
|
|
4
10
|
const tslib_1 = require("tslib");
|
|
5
11
|
const npa_to_deps_query_1 = require("@yarn-tool/npa-to-deps-query");
|
|
6
12
|
const npa_to_deps_1 = require("@yarn-tool/npa-to-deps");
|
|
@@ -48,7 +54,6 @@ function _isPublishedCoreByNpaResult(depsResult, options) {
|
|
|
48
54
|
});
|
|
49
55
|
});
|
|
50
56
|
}
|
|
51
|
-
exports._isPublishedCoreByNpaResult = _isPublishedCoreByNpaResult;
|
|
52
57
|
function _isPublishedCore(input, options) {
|
|
53
58
|
return bluebird_1.default.resolve()
|
|
54
59
|
.then(() => {
|
|
@@ -58,24 +63,19 @@ function _isPublishedCore(input, options) {
|
|
|
58
63
|
return _isPublishedCoreByNpaResult(result, options);
|
|
59
64
|
});
|
|
60
65
|
}
|
|
61
|
-
exports._isPublishedCore = _isPublishedCore;
|
|
62
66
|
function _isPublishedCoreByPackageJSON(pkg, options) {
|
|
63
67
|
return _isPublishedCore(`${pkg.name}@${pkg.version}`, options);
|
|
64
68
|
}
|
|
65
|
-
exports._isPublishedCoreByPackageJSON = _isPublishedCoreByPackageJSON;
|
|
66
69
|
function isPublishedByNpaResult(depsResult, options) {
|
|
67
70
|
return _isPublishedCoreByNpaResult(depsResult, options)
|
|
68
71
|
.then(data => data === null || data === void 0 ? void 0 : data.isPublished);
|
|
69
72
|
}
|
|
70
|
-
exports.isPublishedByNpaResult = isPublishedByNpaResult;
|
|
71
73
|
function isPublished(input, options) {
|
|
72
74
|
return _isPublishedCore(input, options)
|
|
73
75
|
.then(data => data === null || data === void 0 ? void 0 : data.isPublished);
|
|
74
76
|
}
|
|
75
|
-
exports.isPublished = isPublished;
|
|
76
77
|
function isPublishedByPackageJSON(pkg, options) {
|
|
77
78
|
return isPublished(`${pkg.name}@${pkg.version}`, options);
|
|
78
79
|
}
|
|
79
|
-
exports.isPublishedByPackageJSON = isPublishedByPackageJSON;
|
|
80
80
|
exports.default = isPublishedByPackageJSON;
|
|
81
81
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAqDA,kEAwCC;AAED,4CAWC;AAED,sEAMC;AAED,wDAIC;AAED,kCAIC;AAED,4DAMC;;AAtID,oEAAmF;AAEnF,wDAAqE;AACrE,gEAAgC;AAChC,+CAA0E;AAG1E,IAAkB,oBAKjB;AALD,WAAkB,oBAAoB;IAErC,uFAAoB,CAAA;IACpB,qFAAmB,CAAA;IACnB,qFAAmB,CAAA;AACpB,CAAC,EALiB,oBAAoB,oCAApB,oBAAoB,QAKrC;AAyCD,SAAgB,2BAA2B,CAAC,UAA+C,EAAE,OAAkB;IAE9G,OAAO,kBAAQ,CAAC,OAAO,CAAC,UAAU,CAAC;SACjC,IAAI,CAAC,UAAU,CAAC,EAAE;QAElB,OAAO,IAAA,6CAAyB,EAAC;YAChC,GAAG,UAAU;YACb,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,IAAI;SAChB,EAAE,OAAO,CAAC;aACT,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;YAErB,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,KAAK,WAAW,CAAC,KAAK,CAAC;YAE5D,OAAO;gBACN,UAAU;gBACV,WAAW;gBACX,MAAM,EAAE,IAAa;gBACrB,WAAW;gBACX,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,6CAA8C,CAAC,CAAC,CAAC,4CAA6C;aACnH,CAAA;QACF,CAAC,CAAC;aACD,KAAK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AAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,CAAC,CAAA;AAClC,CAAC;AAED,SAAgB,wBAAwB,CAAC,GAGxC,EAAE,OAAkB;IAEpB,OAAO,WAAW,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAA;AAC1D,CAAC;AAED,kBAAe,wBAAwB,CAAA","sourcesContent":["import { IOptions, queryDepsValueByNpaResult } from '@yarn-tool/npa-to-deps-query';\nimport { ITSResolvable } from 'ts-type';\nimport { IDepsResult, npaToDepsValue } from '@yarn-tool/npa-to-deps';\nimport Bluebird from 'bluebird';\nimport { PackageNotFoundError, VersionNotFoundError } from 'package-json';\nimport { IResult } from '@yarn-tool/npm-package-arg-util';\n\nexport const enum EnumIsPublishedState\n{\n\tVersionPublished = 0,\n\tVersionNotFound = 1,\n\tPackageNotFound = 2,\n}\n\nexport interface IPublishedResultBase\n{\n\tdepsResult: IDepsResult<IResult>;\n\texists: boolean;\n\tisPublished: null | boolean;\n\tstate: EnumIsPublishedState;\n}\n\nexport interface IPublishedResultVersionPublished extends IPublishedResultBase\n{\n\tqueryResult: {\n\t\tname: string;\n\t\tvalue: string;\n\t};\n\texists: true;\n\tisPublished: true;\n\tstate: EnumIsPublishedState.VersionPublished;\n}\n\nexport interface IPublishedResultVersionNotFound extends IPublishedResultBase\n{\n\tqueryResult?: {\n\t\tname: string;\n\t\tvalue: string;\n\t};\n\texists: true;\n\tisPublished: false;\n\tstate: EnumIsPublishedState.VersionNotFound;\n}\n\nexport interface IPublishedResultPackageNotFound extends IPublishedResultBase\n{\n\texists: false;\n\tisPublished: null;\n\tstate: EnumIsPublishedState.PackageNotFound;\n}\n\nexport type IPublishedResult = IPublishedResultVersionPublished | IPublishedResultVersionNotFound | IPublishedResultPackageNotFound;\n\nexport function _isPublishedCoreByNpaResult(depsResult: ITSResolvable<IDepsResult<IResult>>, options?: IOptions)\n{\n\treturn Bluebird.resolve(depsResult)\n\t\t.then(depsResult =>\n\t\t{\n\t\t\treturn queryDepsValueByNpaResult({\n\t\t\t\t...depsResult,\n\t\t\t\toperator: '',\n\t\t\t\tfetchQuery: true,\n\t\t\t}, options)\n\t\t\t\t.then((queryResult) =>\n\t\t\t\t{\n\t\t\t\t\tconst isPublished = depsResult.semver === queryResult.value;\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdepsResult,\n\t\t\t\t\t\tqueryResult,\n\t\t\t\t\t\texists: true as const,\n\t\t\t\t\t\tisPublished,\n\t\t\t\t\t\tstate: isPublished ? EnumIsPublishedState.VersionPublished as const : EnumIsPublishedState.VersionNotFound as const,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(VersionNotFoundError, err => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdepsResult,\n\t\t\t\t\t\texists: true as const,\n\t\t\t\t\t\tisPublished: false as const,\n\t\t\t\t\t\tstate: EnumIsPublishedState.VersionNotFound as const,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(PackageNotFoundError, err =>\n\t\t\t\t{\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdepsResult,\n\t\t\t\t\t\texists: false as const,\n\t\t\t\t\t\tisPublished: null as null,\n\t\t\t\t\t\tstate: EnumIsPublishedState.PackageNotFound as const,\n\t\t\t\t\t}\n\t\t\t\t}) as Bluebird<IPublishedResult>\n\t\t})\n}\n\nexport function _isPublishedCore(input: string, options?: IOptions)\n{\n\treturn Bluebird.resolve()\n\t\t.then(() =>\n\t\t{\n\t\t\treturn npaToDepsValue(input, options)\n\t\t})\n\t\t.then((result) =>\n\t\t{\n\t\t\treturn _isPublishedCoreByNpaResult(result, options)\n\t\t})\n}\n\nexport function _isPublishedCoreByPackageJSON(pkg: {\n\tname: string,\n\tversion: string,\n}, options?: IOptions)\n{\n\treturn _isPublishedCore(`${pkg.name}@${pkg.version}`, options)\n}\n\nexport function isPublishedByNpaResult(depsResult: ITSResolvable<IDepsResult>, options?: IOptions)\n{\n\treturn _isPublishedCoreByNpaResult(depsResult, options)\n\t\t.then(data => data?.isPublished)\n}\n\nexport function isPublished(input: string, options?: IOptions)\n{\n\treturn _isPublishedCore(input, options)\n\t\t.then(data => data?.isPublished)\n}\n\nexport function isPublishedByPackageJSON(pkg: {\n\tname: string,\n\tversion: string,\n}, options?: IOptions)\n{\n\treturn isPublished(`${pkg.name}@${pkg.version}`, options)\n}\n\nexport default isPublishedByPackageJSON\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/is-published",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "check package is published or not",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yarn",
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"tsc:showConfig": "ynpx get-current-tsconfig -p"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@yarn-tool/npa-to-deps-query": "^3.0.
|
|
75
|
+
"@yarn-tool/npa-to-deps-query": "^3.0.3",
|
|
76
76
|
"tslib": ">=2"
|
|
77
77
|
},
|
|
78
78
|
"packageManager": "yarn@1.22.19",
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "ca7f14bdac1827ed8e8fe5fd0932ee56a44669dc"
|
|
83
83
|
}
|