@yarn-tool/pkg-version-query 2.0.2 → 2.0.5
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 +43 -0
- package/index.d.ts +2 -2
- package/index.js +5 -6
- package/index.js.map +1 -1
- package/lib/queryVersionByNpmPackageArg.d.ts +5 -0
- package/lib/queryVersionByNpmPackageArg.js +10 -7
- package/lib/queryVersionByNpmPackageArg.js.map +1 -1
- package/lib/types.d.ts +2 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,49 @@
|
|
|
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.5](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-version-query@2.0.4...@yarn-tool/pkg-version-query@2.0.5) (2022-08-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @yarn-tool/pkg-version-query
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.0.4](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-version-query@2.0.3...@yarn-tool/pkg-version-query@2.0.4) (2022-08-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @yarn-tool/pkg-version-query
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [2.0.3](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-version-query@2.0.2...@yarn-tool/pkg-version-query@2.0.3) (2022-08-13)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### 📦 Code Refactoring
|
|
26
|
+
|
|
27
|
+
* use `@yarn-tool/npm-package-arg-util` ([b29da89](https://github.com/bluelovers/ws-yarn-workspaces/commit/b29da890259a8bca861e78206dbd979868081c5f))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### 🚨 Tests
|
|
31
|
+
|
|
32
|
+
* update jest.config.js and deps ([d1d501b](https://github.com/bluelovers/ws-yarn-workspaces/commit/d1d501ba059130bd8f90e6eaa266084110698011))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### 🛠 Build System
|
|
36
|
+
|
|
37
|
+
* update typescript ([b69b593](https://github.com/bluelovers/ws-yarn-workspaces/commit/b69b593d511d9d4e246513dc1d69721150b9cfe8))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### 📌 Dependencies
|
|
41
|
+
|
|
42
|
+
* update deps ([58501f9](https://github.com/bluelovers/ws-yarn-workspaces/commit/58501f97494eb624779dffea7ac9d68e45e5e978))
|
|
43
|
+
* update deps ([a0b8755](https://github.com/bluelovers/ws-yarn-workspaces/commit/a0b875582efdc9829b0cdb6c9c819cace8b76e90))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
6
49
|
## [2.0.2](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/pkg-version-query@2.0.1...@yarn-tool/pkg-version-query@2.0.2) (2022-07-31)
|
|
7
50
|
|
|
8
51
|
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import queryVersionByNpmPackageArgWithCache from './lib/queryVersionByNpmPackageArg';
|
|
2
|
-
import queryVersionWithCache from './lib/queryVersion';
|
|
1
|
+
import { queryVersionByNpmPackageArgWithCache } from './lib/queryVersionByNpmPackageArg';
|
|
2
|
+
import { queryVersionWithCache } from './lib/queryVersion';
|
|
3
3
|
import { getCache } from './lib/cacheAgent';
|
|
4
4
|
export type { ICachedVersionResult, IOptionsQueryVersion } from './lib/types';
|
|
5
5
|
export { queryVersionByNpmPackageArgWithCache };
|
package/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCache = exports.queryVersionWithCache = exports.queryVersionByNpmPackageArgWithCache = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.queryVersionWithCache = queryVersion_1.default;
|
|
4
|
+
const queryVersionByNpmPackageArg_1 = require("./lib/queryVersionByNpmPackageArg");
|
|
5
|
+
Object.defineProperty(exports, "queryVersionByNpmPackageArgWithCache", { enumerable: true, get: function () { return queryVersionByNpmPackageArg_1.queryVersionByNpmPackageArgWithCache; } });
|
|
6
|
+
const queryVersion_1 = require("./lib/queryVersion");
|
|
7
|
+
Object.defineProperty(exports, "queryVersionWithCache", { enumerable: true, get: function () { return queryVersion_1.queryVersionWithCache; } });
|
|
9
8
|
const cacheAgent_1 = require("./lib/cacheAgent");
|
|
10
9
|
Object.defineProperty(exports, "getCache", { enumerable: true, get: function () { return cacheAgent_1.getCache; } });
|
|
11
|
-
exports.default = queryVersion_1.
|
|
10
|
+
exports.default = queryVersion_1.queryVersionWithCache;
|
|
12
11
|
//# 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":";;;AAAA,mFAAyF;AAMhF,qHANA,kEAAoC,OAMA;AAL7C,qDAA2D;AAMlD,sGANA,oCAAqB,OAMA;AAL9B,iDAA4C;AAOnC,yFAPA,qBAAQ,OAOA;AAEjB,kBAAe,oCAAqB,CAAA","sourcesContent":["import { queryVersionByNpmPackageArgWithCache } from './lib/queryVersionByNpmPackageArg';\nimport { queryVersionWithCache } from './lib/queryVersion';\nimport { getCache } from './lib/cacheAgent';\n\nexport type { ICachedVersionResult, IOptionsQueryVersion } from './lib/types';\n\nexport { queryVersionByNpmPackageArgWithCache }\nexport { queryVersionWithCache }\n\nexport { getCache }\n\nexport default queryVersionWithCache\n"]}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/// <reference types="bluebird" />
|
|
2
|
+
import { IResult } from '@yarn-tool/npm-package-arg-util';
|
|
2
3
|
import { IOptionsQueryVersion } from './types';
|
|
3
4
|
import { Options } from 'package-json';
|
|
4
5
|
export declare function parseVersionByNpmPackageArg(input: string): {
|
|
5
6
|
name: string;
|
|
6
7
|
version: string;
|
|
7
8
|
};
|
|
9
|
+
export declare function _parseVersionByNpmPackageArgCore(result: IResult): {
|
|
10
|
+
name: string;
|
|
11
|
+
version: string;
|
|
12
|
+
};
|
|
8
13
|
export declare function queryVersionByNpmPackageArgWithCache(input: string, options?: IOptionsQueryVersion<Options>): import("bluebird")<string>;
|
|
9
14
|
export default queryVersionByNpmPackageArgWithCache;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.queryVersionByNpmPackageArgWithCache = exports.parseVersionByNpmPackageArg = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const queryVersion_1 = tslib_1.__importDefault(require("./queryVersion"));
|
|
3
|
+
exports.queryVersionByNpmPackageArgWithCache = exports._parseVersionByNpmPackageArgCore = exports.parseVersionByNpmPackageArg = void 0;
|
|
4
|
+
const npm_package_arg_util_1 = require("@yarn-tool/npm-package-arg-util");
|
|
5
|
+
const queryVersion_1 = require("./queryVersion");
|
|
7
6
|
function parseVersionByNpmPackageArg(input) {
|
|
8
|
-
|
|
7
|
+
return _parseVersionByNpmPackageArgCore((0, npm_package_arg_util_1.npa)(input));
|
|
8
|
+
}
|
|
9
|
+
exports.parseVersionByNpmPackageArg = parseVersionByNpmPackageArg;
|
|
10
|
+
function _parseVersionByNpmPackageArgCore(result) {
|
|
11
|
+
const { name, fetchSpec: version } = result;
|
|
9
12
|
return {
|
|
10
13
|
name,
|
|
11
14
|
version,
|
|
12
15
|
};
|
|
13
16
|
}
|
|
14
|
-
exports.
|
|
17
|
+
exports._parseVersionByNpmPackageArgCore = _parseVersionByNpmPackageArgCore;
|
|
15
18
|
function queryVersionByNpmPackageArgWithCache(input, options) {
|
|
16
19
|
const { name, version } = parseVersionByNpmPackageArg(input);
|
|
17
|
-
return (0, queryVersion_1.
|
|
20
|
+
return (0, queryVersion_1.queryVersionWithCache)(name, version, options);
|
|
18
21
|
}
|
|
19
22
|
exports.queryVersionByNpmPackageArgWithCache = queryVersionByNpmPackageArgWithCache;
|
|
20
23
|
exports.default = queryVersionByNpmPackageArgWithCache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryVersionByNpmPackageArg.js","sourceRoot":"","sources":["queryVersionByNpmPackageArg.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queryVersionByNpmPackageArg.js","sourceRoot":"","sources":["queryVersionByNpmPackageArg.ts"],"names":[],"mappings":";;;AAAA,0EAA+D;AAC/D,iDAAuD;AAIvD,SAAgB,2BAA2B,CAAC,KAAa;IAExD,OAAO,gCAAgC,CAAC,IAAA,0BAAG,EAAC,KAAK,CAAC,CAAC,CAAA;AACpD,CAAC;AAHD,kEAGC;AAED,SAAgB,gCAAgC,CAAC,MAAe;IAE/D,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAE5C,OAAO;QACN,IAAI;QACJ,OAAO;KACP,CAAA;AACF,CAAC;AARD,4EAQC;AAED,SAAgB,oCAAoC,CAAC,KAAa,EAAE,OAAuC;IAE1G,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;IAE7D,OAAO,IAAA,oCAAqB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AACrD,CAAC;AALD,oFAKC;AAED,kBAAe,oCAAoC,CAAA","sourcesContent":["import { npa, IResult } from '@yarn-tool/npm-package-arg-util';\nimport { queryVersionWithCache } from './queryVersion';\nimport { IOptionsQueryVersion } from './types';\nimport { Options } from 'package-json';\n\nexport function parseVersionByNpmPackageArg(input: string)\n{\n\treturn _parseVersionByNpmPackageArgCore(npa(input))\n}\n\nexport function _parseVersionByNpmPackageArgCore(result: IResult)\n{\n\tconst { name, fetchSpec: version } = result;\n\n\treturn {\n\t\tname,\n\t\tversion,\n\t}\n}\n\nexport function queryVersionByNpmPackageArgWithCache(input: string, options?: IOptionsQueryVersion<Options>)\n{\n\tconst { name, version } = parseVersionByNpmPackageArg(input);\n\n\treturn queryVersionWithCache(name, version, options)\n}\n\nexport default queryVersionByNpmPackageArgWithCache\n"]}
|
package/lib/types.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export interface ICachedVersionResultCore {
|
|
|
8
8
|
result?: string;
|
|
9
9
|
error?: VersionNotFoundError | PackageNotFoundError;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type ICachedVersionResult = ITSRequireAtLeastOne<ICachedVersionResultCore, 'result' | 'error'>;
|
|
12
|
+
export type IOptionsQueryVersion<T extends Options | AbbreviatedMetadata> = T & {
|
|
13
13
|
notThrowError?: boolean;
|
|
14
14
|
cacheAgent?: Cache<string, ICachedVersionResult>;
|
|
15
15
|
cacheAgentOptions?: IOptionsLRUCacheFS<string, ICachedVersionResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/pkg-version-query",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yarn",
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
"sort-package-json": "yarn-tool sort"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@lazy-node/semver-ampersand": "^2.0.
|
|
41
|
-
"
|
|
40
|
+
"@lazy-node/semver-ampersand": "^2.0.3",
|
|
41
|
+
"@yarn-tool/npm-package-arg-util": "^1.0.30",
|
|
42
|
+
"cache-path": "^3.0.4",
|
|
42
43
|
"lru-cache-fs2": "^2.0.8",
|
|
43
|
-
"npm-package-arg": "^9.1.0",
|
|
44
44
|
"package-json": "<7 >=6.5",
|
|
45
45
|
"semver": "^7.3.7",
|
|
46
|
-
"ts-type": "^2.1.
|
|
46
|
+
"ts-type": "^2.1.10",
|
|
47
47
|
"tslib": "^2"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "f45f0e9d80c682395ccb7feda4375511f177579c"
|
|
53
53
|
}
|