@ts-type/package-dts 2.0.7 → 3.0.1
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 +37 -0
- package/README.md +39 -14
- package/eslintrc-json.js +1 -1
- package/eslintrc-json.js.map +1 -1
- package/index.d.ts +17 -1
- package/index.js +18 -3
- package/index.js.map +1 -1
- package/lerna-json.js +2 -15
- package/lerna-json.js.map +1 -1
- package/lib/package-json/exports.d.ts +9 -7
- package/lib/package-json/exports.js.map +1 -1
- package/lib/package-json/publishConfig.js +1 -1
- package/lib/package-json/publishConfig.js.map +1 -1
- package/lib/package-json/types.d.ts +28 -0
- package/lib/package-json/types.js +14 -2
- package/lib/package-json/types.js.map +1 -1
- package/package-json.d.ts +1 -1
- package/package-json.js +2 -15
- package/package-json.js.map +1 -1
- package/package.json +10 -4
- package/schema/eslintrc.json +29 -17
- package/schema/lerna.json +1 -1
- package/schema/package.json +530 -28
- package/schema/travis.json +17 -10
- package/script/index.js +2 -4
- package/script/index.js.map +1 -1
- package/script/util.js +7 -10
- package/script/util.js.map +1 -1
- package/types/eslintrc.json.d.ts +7496 -9
- package/types/lerna.json.d.ts +1 -1
- package/types/package.json.d.ts +27813 -7682
- package/types/travis.json.d.ts +15 -10
- package/types/tsconfig.json.d.ts +1298 -326
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@
|
|
|
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.1](https://github.com/bluelovers/ws-ts-type/compare/@ts-type/package-dts@2.0.8...@ts-type/package-dts@3.0.1) (2026-03-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* **package-dts:** 版本升級至 3.0.0 並調整 devDependencies 順序
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### 📚 Documentation
|
|
16
|
+
|
|
17
|
+
* enhance documentation and JSDoc comments across multiple packages ([88ee99b](https://github.com/bluelovers/ws-ts-type/commit/88ee99b3a489645ca53093357cc3523dbe7996e0))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### 🛠 Build System
|
|
21
|
+
|
|
22
|
+
* 更新多個套件的 test 指令為 jest ([61ea53b](https://github.com/bluelovers/ws-ts-type/commit/61ea53bf15fc3ed0e216793200604ae5a52079c9))
|
|
23
|
+
* **package-dts:** 版本升級至 3.0.0 並調整 devDependencies 順序 ([31a51b3](https://github.com/bluelovers/ws-ts-type/commit/31a51b30face1374d039fcb638e79029af0b1ae7))
|
|
24
|
+
* **schema:** update schema ([cce7147](https://github.com/bluelovers/ws-ts-type/commit/cce7147b2d79af2b76063d49e748d74ee8330b93))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### ♻️ Chores
|
|
28
|
+
|
|
29
|
+
* migrate from yarn to pnpm and enhance test infrastructure ([8a5daa2](https://github.com/bluelovers/ws-ts-type/commit/8a5daa2f2022eaf025c3349d4fe5dc8971f8c077))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [2.0.8](https://github.com/bluelovers/ws-ts-type/compare/@ts-type/package-dts@2.0.7...@ts-type/package-dts@2.0.8) (2022-10-10)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### 🔖 Miscellaneous
|
|
38
|
+
|
|
39
|
+
* . ([8ea01fd](https://github.com/bluelovers/ws-ts-type/commit/8ea01fd2c12b7cb0d853532b4e50af937128613c))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
6
43
|
## [2.0.7](https://github.com/bluelovers/ws-ts-type/compare/@ts-type/package-dts@2.0.6...@ts-type/package-dts@2.0.7) (2022-10-10)
|
|
7
44
|
|
|
8
45
|
|
package/README.md
CHANGED
|
@@ -1,26 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# package-dts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
NPM 配置文件(package.json、.eslintrc.json、tsconfig.json、.travis.yml)的 TypeScript 類型定義
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
TypeScript type definitions for NPM configuration files (package.json, .eslintrc.json, tsconfig.json, .travis.yml)
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 功能特點 / Features
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- 完整的 package.json 類型定義
|
|
10
|
+
- Complete package.json type definitions
|
|
11
|
+
- .eslintrc.json 類型定義
|
|
12
|
+
- .eslintrc.json type definitions
|
|
13
|
+
- tsconfig.json 類型定義
|
|
14
|
+
- tsconfig.json type definitions
|
|
15
|
+
- .travis.yml 類型定義
|
|
16
|
+
- .travis.yml type definitions
|
|
17
|
+
- 支援讀取並解析配置檔案
|
|
18
|
+
- Support reading and parsing configuration files
|
|
19
|
+
|
|
20
|
+
## 安裝 / Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
10
23
|
npm install @ts-type/package-dts
|
|
24
|
+
# or
|
|
25
|
+
yarn add @ts-type/package-dts
|
|
11
26
|
```
|
|
12
27
|
|
|
13
|
-
##
|
|
28
|
+
## 使用範例 / Usage Example
|
|
14
29
|
|
|
15
|
-
```
|
|
16
|
-
import IPackageJson from '
|
|
17
|
-
import
|
|
30
|
+
```typescript
|
|
31
|
+
import IPackageJson from '@ts-type/package-dts/package-json';
|
|
32
|
+
import { readPackageJson } from '@ts-type/package-dts';
|
|
18
33
|
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
let b: IPackageJson = pkg as any;
|
|
34
|
+
// 讀取 package.json
|
|
35
|
+
const pkg = readPackageJson('./package.json');
|
|
22
36
|
|
|
23
|
-
|
|
37
|
+
// 使用類型
|
|
38
|
+
const name: string = pkg.name;
|
|
39
|
+
const version: string = pkg.version;
|
|
40
|
+
const keywords: string[] = pkg.keywords ?? [];
|
|
24
41
|
|
|
25
|
-
|
|
42
|
+
// 驗證類型
|
|
43
|
+
const devDeps = pkg.devDependencies;
|
|
44
|
+
if (devDeps) {
|
|
45
|
+
Object.keys(devDeps).forEach(dep => {
|
|
46
|
+
console.log(`${dep}@${devDeps[dep]}`);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
26
49
|
```
|
|
50
|
+
|
|
51
|
+

|
package/eslintrc-json.js
CHANGED
package/eslintrc-json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslintrc-json.js","sourceRoot":"","sources":["eslintrc-json.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAMH,IAAkB,QAKjB;AALD,WAAkB,QAAQ;IAEzB,uBAAW,CAAA;IACX,yBAAa,CAAA;IACb,2BAAe,CAAA;AAChB,CAAC,EALiB,QAAQ,
|
|
1
|
+
{"version":3,"file":"eslintrc-json.js","sourceRoot":"","sources":["eslintrc-json.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAMH,IAAkB,QAKjB;AALD,WAAkB,QAAQ;IAEzB,uBAAW,CAAA;IACX,yBAAa,CAAA;IACb,2BAAe,CAAA;AAChB,CAAC,EALiB,QAAQ,wBAAR,QAAQ,QAKzB","sourcesContent":["/**\n * Created by user on 2019/5/19.\n */\n\nimport { JSONSchemaForESLintConfigurationFiles, Rule } from './types/eslintrc.json';\n\nexport type ILibEslint = typeof import('./types/eslintrc.json');\n\nexport const enum EnumRule\n{\n\toff = 'off',\n\twarn = 'warn',\n\terror = 'error',\n}\n\nexport type IRule = Rule | EnumRule;\n\nexport type IEslintrcJson = JSONSchemaForESLintConfigurationFiles & {\n\n\tparser?: string | '@typescript-eslint/parser',\n\n\textends?: (string | 'plugin:@typescript-eslint/recommended' | 'bluelovers')[]\n\n\tparserOptions?: JSONSchemaForESLintConfigurationFiles[\"parserOptions\"] & {\n\n\t\t/**\n\t\t * path for tsconfig.json\n\t\t */\n\t\tproject?: string,\n\n\t},\n\n};\n\nexport default IEslintrcJson\n"]}
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 配置文件類型定義匯入模組
|
|
3
|
+
* Configuration file type definitions import module
|
|
4
|
+
*
|
|
5
|
+
* 匯入各類配置文件的類型定義:
|
|
6
|
+
* - package.json
|
|
7
|
+
* - .eslintrc.json
|
|
8
|
+
* - tsconfig.json
|
|
9
|
+
* - .travis.yml
|
|
10
|
+
*
|
|
11
|
+
* @package
|
|
3
12
|
*/
|
|
4
13
|
import IPackageJson from './package-json';
|
|
5
14
|
export { IEslintrcJson } from './eslintrc-json';
|
|
6
15
|
export { IPackageJson, ILibPackageJson } from './package-json';
|
|
7
16
|
export { ITsconfig } from './tsconfig-json';
|
|
8
17
|
export { ITravisCI } from './travis-json';
|
|
18
|
+
/**
|
|
19
|
+
* 讀取並解析 package.json 檔案
|
|
20
|
+
* Read and parse package.json file
|
|
21
|
+
*
|
|
22
|
+
* @param file - package.json 檔案路徑 / package.json file path
|
|
23
|
+
* @returns 解析後的 package.json 物件 / Parsed package.json object
|
|
24
|
+
*/
|
|
9
25
|
export declare function readPackageJson(file: string): IPackageJson;
|
|
10
26
|
export default IPackageJson;
|
package/index.js
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* 配置文件類型定義匯入模組
|
|
4
|
+
* Configuration file type definitions import module
|
|
5
|
+
*
|
|
6
|
+
* 匯入各類配置文件的類型定義:
|
|
7
|
+
* - package.json
|
|
8
|
+
* - .eslintrc.json
|
|
9
|
+
* - tsconfig.json
|
|
10
|
+
* - .travis.yml
|
|
11
|
+
*
|
|
12
|
+
* @package
|
|
4
13
|
*/
|
|
5
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.readPackageJson =
|
|
15
|
+
exports.readPackageJson = readPackageJson;
|
|
7
16
|
const fs_1 = require("fs");
|
|
17
|
+
/**
|
|
18
|
+
* 讀取並解析 package.json 檔案
|
|
19
|
+
* Read and parse package.json file
|
|
20
|
+
*
|
|
21
|
+
* @param file - package.json 檔案路徑 / package.json file path
|
|
22
|
+
* @returns 解析後的 package.json 物件 / Parsed package.json object
|
|
23
|
+
*/
|
|
8
24
|
function readPackageJson(file) {
|
|
9
25
|
return JSON.parse((0, fs_1.readFileSync)(file).toString());
|
|
10
26
|
}
|
|
11
|
-
exports.readPackageJson = readPackageJson;
|
|
12
27
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAgBH,0CAGC;AAjBD,2BAAkC;AAOlC;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,IAAY;IAE3C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAClD,CAAC","sourcesContent":["/**\n * 配置文件類型定義匯入模組\n * Configuration file type definitions import module\n *\n * 匯入各類配置文件的類型定義:\n * - package.json\n * - .eslintrc.json\n * - tsconfig.json\n * - .travis.yml\n *\n * @package\n */\n\nimport { readFileSync } from 'fs';\nimport IPackageJson from './package-json';\nexport { IEslintrcJson } from './eslintrc-json';\nexport { IPackageJson, ILibPackageJson } from './package-json';\nexport { ITsconfig } from './tsconfig-json';\nexport { ITravisCI } from './travis-json';\n\n/**\n * 讀取並解析 package.json 檔案\n * Read and parse package.json file\n *\n * @param file - package.json 檔案路徑 / package.json file path\n * @returns 解析後的 package.json 物件 / Parsed package.json object\n */\nexport function readPackageJson(file: string): IPackageJson\n{\n\treturn JSON.parse(readFileSync(file).toString());\n}\n\nexport default IPackageJson;\n"]}
|
package/lerna-json.js
CHANGED
|
@@ -2,20 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Created by user on 2020/6/19.
|
|
4
4
|
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
tslib_1.__exportStar(require("./lib/lerna-json/types"), exports);
|
|
21
8
|
//# sourceMappingURL=lerna-json.js.map
|
package/lerna-json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lerna-json.js","sourceRoot":"","sources":["lerna-json.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"lerna-json.js","sourceRoot":"","sources":["lerna-json.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAOH,iEAAuC","sourcesContent":["/**\n * Created by user on 2020/6/19.\n */\n\nimport { AJSONSchemaForLernaJsonFiles } from './types/lerna.json';\nimport { ITSPartialPick, ITSMergeBoth, ITSOverwrite } from 'ts-type/lib/type/record';\n\nimport { IPackageJsonTag, IReleaseType } from './lib/package-json/types';\n\nexport * from './lib/lerna-json/types';\nimport { INpmClient } from './lib/lerna-json/types';\nimport { IBranch } from './lib/types';\nimport { ITSOmitRecordType } from 'ts-type/lib/helper/record/pick-type';\n\nexport type { IReleaseType }\n\ntype _Command = AJSONSchemaForLernaJsonFiles[\"command\"];\n\ntype _MergeCommand<T extends Record<string, Record<string, any>>> = {\n\t[P in keyof (T & _Command)]?:\n\t\t(P extends keyof _Command ?\n\t\t\tP extends keyof T ?\n\t\t\t\tITSMergeBoth<_Command[P], T[P]>\n\t\t\t\t: _Command[P]\n\t\t\t: T[P])\n}\n\nexport interface ILernaJsonCommand extends _MergeCommand<{\n\tpublish?: {\n\t\tconcurrency?: number;\n\t\t\"bump\"?: IReleaseType,\n\t\t\"conventionalCommits\"?: boolean,\n\t\t\"conventionalGraduate\"?: boolean,\n\t\tdistTag?: IPackageJsonTag,\n\t\tnpmClient?: INpmClient,\n\t\tallowBranch?: IBranch[],\n\t\tnoPrivate?: boolean,\n\t},\n\n\t\"version\"?: {\n\t\tconcurrency?: number;\n\t\t\"bump\"?: IReleaseType,\n\t\tallowBranch?: IBranch[],\n\t\t\"conventionalCommits\"?: boolean,\n\t\t\"changelogPreset\"?: string | \"@bluelovers/conventional-changelog-bluelovers\",\n\t\texact?: boolean;\n\t\tcreateRelease?: \"gitlab\" | \"github\",\n\t\tnoPrivate?: boolean,\n\t},\n\n\trun?: {\n\t\tconcurrency?: number;\n\t\t\"stream\"?: boolean,\n\t\tnpmClient?: INpmClient,\n\t\t[k: string]: unknown;\n\t},\n\n\texec?: {\n\t\tconcurrency?: number;\n\t\t\"stream\"?: boolean\n\t\t[k: string]: unknown;\n\t},\n}>\n{\n\t[k: string]: Record<string, unknown>;\n}\n\nexport interface ILernaJson extends ITSOverwrite<AJSONSchemaForLernaJsonFiles,\n\t{\n\n\t\t/**\n\t\t * The current version of the repository (or independent).\n\t\t */\n\t\tversion?: string | \"independent\";\n\n\t\t/**\n\t\t * Specify which client to run commands with (change to \"yarn\" to run commands with yarn. Defaults to \"npm\".\n\t\t */\n\t\tnpmClient?: INpmClient;\n\n\t\tworkspaces?: (string | \"packages/*\")[];\n\t\tpackages?: (string | \"packages/*\")[];\n\n\t\tcommand?: ILernaJsonCommand,\n\t}>\n{\n\n}\n\nexport default ILernaJson\n"]}
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PackageExportsEntryObject, PackageExportsFallback, PackageExportsEntryPath } from '../../types/package.json';
|
|
2
2
|
import { ITSPartialRecord } from 'ts-type/lib/type/record/partial';
|
|
3
3
|
type _IConditions = 'node-addons' | 'node' | 'default' | 'types' | 'import' | 'require';
|
|
4
|
-
interface _IPackageExportsEntryObjectExtend extends ITSPartialRecord<_IConditions,
|
|
4
|
+
interface _IPackageExportsEntryObjectExtend extends ITSPartialRecord<_IConditions, IPackageExportsValue> {
|
|
5
5
|
}
|
|
6
6
|
declare module '../../types/package.json' {
|
|
7
7
|
interface PackageExportsEntryObject extends _IPackageExportsEntryObjectExtend {
|
|
8
|
-
[k: string]:
|
|
8
|
+
[k: string]: IPackageExportsValue;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export interface IPackageExportsEntryObject extends PackageExportsEntryObject, _IPackageExportsEntryObjectExtend {
|
|
12
12
|
}
|
|
13
|
+
export type IPackageExportsValueFallback = PackageExportsEntryPath | PackageExportsFallback;
|
|
14
|
+
export type IPackageExportsValue = IPackageExportsValueFallback | IPackageExportsEntryObject;
|
|
13
15
|
/**
|
|
14
16
|
* The module path prefix that is resolved when the module specifier starts with "name/", set to "./*" to allow external modules to import any subpath.
|
|
15
17
|
*
|
|
16
18
|
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
17
19
|
* via the `patternProperty` "^\./.+".
|
|
18
20
|
*/
|
|
19
|
-
export interface IPackageJsonExportsEntryObjectRoot extends ITSPartialRecord<'default' | './package.json' | `./${string}` | _IConditions,
|
|
21
|
+
export interface IPackageJsonExportsEntryObjectRoot extends ITSPartialRecord<'default' | './package.json' | `./${string}` | _IConditions, IPackageExportsValue> {
|
|
20
22
|
/**
|
|
21
23
|
* The module path that is resolved when the module specifier matches "name", shadows the "main" field.
|
|
22
24
|
*/
|
|
23
|
-
"."?:
|
|
25
|
+
"."?: IPackageExportsValue;
|
|
24
26
|
/**
|
|
25
27
|
* The module path prefix that is resolved when the module specifier starts with "name/", set to "./*" to allow external modules to import any subpath.
|
|
26
28
|
*
|
|
27
29
|
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
28
30
|
* via the `patternProperty` "^\./.+".
|
|
29
31
|
*/
|
|
30
|
-
[k: string]:
|
|
32
|
+
[k: string]: IPackageExportsValue;
|
|
31
33
|
}
|
|
32
34
|
export interface IPackageJsonExports {
|
|
33
|
-
exports?:
|
|
35
|
+
exports?: IPackageExportsValueFallback | IPackageJsonExportsEntryObjectRoot;
|
|
34
36
|
}
|
|
35
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["exports.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["exports.ts"],"names":[],"mappings":"","sourcesContent":["import {\n\tPackageExportsEntryObject, PackageExportsFallback,\n\tPackageExportsEntryPath,\n} from '../../types/package.json';\nimport { ITSPartialRecord } from 'ts-type/lib/type/record/partial';\n\ntype _IConditions = 'node-addons' | 'node' | 'default' | 'types' | 'import' | 'require';\n\ninterface _IPackageExportsEntryObjectExtend extends ITSPartialRecord<_IConditions, IPackageExportsValue>\n{\n\n}\n\ndeclare module '../../types/package.json'\n{\n\tinterface PackageExportsEntryObject extends _IPackageExportsEntryObjectExtend\n\t{\n\t\t[k: string]: IPackageExportsValue;\n\t}\n}\n\nexport interface IPackageExportsEntryObject extends PackageExportsEntryObject, _IPackageExportsEntryObjectExtend\n{\n\n}\n\nexport type IPackageExportsValueFallback = PackageExportsEntryPath | PackageExportsFallback;\n\nexport type IPackageExportsValue = IPackageExportsValueFallback | IPackageExportsEntryObject;\n\n/**\n * The module path prefix that is resolved when the module specifier starts with \"name/\", set to \"./*\" to allow external modules to import any subpath.\n *\n * This interface was referenced by `undefined`'s JSON-Schema definition\n * via the `patternProperty` \"^\\./.+\".\n */\nexport interface IPackageJsonExportsEntryObjectRoot extends ITSPartialRecord<'default' | './package.json' | `./${string}` | _IConditions, IPackageExportsValue>\n{\n\t/**\n\t * The module path that is resolved when the module specifier matches \"name\", shadows the \"main\" field.\n\t */\n\t\".\"?: IPackageExportsValue;\n\n\t/**\n\t * The module path prefix that is resolved when the module specifier starts with \"name/\", set to \"./*\" to allow external modules to import any subpath.\n\t *\n\t * This interface was referenced by `undefined`'s JSON-Schema definition\n\t * via the `patternProperty` \"^\\./.+\".\n\t */\n\t[k: string]: IPackageExportsValue;\n}\n\nexport interface IPackageJsonExports\n{\n\texports?: IPackageExportsValueFallback | IPackageJsonExportsEntryObjectRoot\n}\n"]}
|
|
@@ -7,5 +7,5 @@ var EnumPublishConfigRegistry;
|
|
|
7
7
|
EnumPublishConfigRegistry["npm"] = "https://registry.npmjs.org/";
|
|
8
8
|
EnumPublishConfigRegistry["yarn"] = "https://registry.yarnpkg.com";
|
|
9
9
|
EnumPublishConfigRegistry["taobao"] = "http://registry.npm.taobao.org/";
|
|
10
|
-
})(EnumPublishConfigRegistry
|
|
10
|
+
})(EnumPublishConfigRegistry || (exports.EnumPublishConfigRegistry = EnumPublishConfigRegistry = {}));
|
|
11
11
|
//# sourceMappingURL=publishConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishConfig.js","sourceRoot":"","sources":["publishConfig.ts"],"names":[],"mappings":";;;AAEA,IAAkB,yBAMjB;AAND,WAAkB,yBAAyB;IAE1C,kEAAqC,CAAA;IACrC,gEAAmC,CAAA;IACnC,kEAAqC,CAAA;IACrC,uEAA0C,CAAA;AAC3C,CAAC,EANiB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"publishConfig.js","sourceRoot":"","sources":["publishConfig.ts"],"names":[],"mappings":";;;AAEA,IAAkB,yBAMjB;AAND,WAAkB,yBAAyB;IAE1C,kEAAqC,CAAA;IACrC,gEAAmC,CAAA;IACnC,kEAAqC,CAAA;IACrC,uEAA0C,CAAA;AAC3C,CAAC,EANiB,yBAAyB,yCAAzB,yBAAyB,QAM1C","sourcesContent":["\n\nexport const enum EnumPublishConfigRegistry\n{\n\tgithub = 'https://npm.pkg.github.com',\n\tnpm = 'https://registry.npmjs.org/',\n\tyarn = 'https://registry.yarnpkg.com',\n\ttaobao = 'http://registry.npm.taobao.org/',\n}\n\n"]}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* 套件類型定義
|
|
3
|
+
* Package type definitions
|
|
4
|
+
*
|
|
2
5
|
* Created by user on 2020/6/12.
|
|
3
6
|
*/
|
|
4
7
|
import type { ReleaseType as IReleaseType } from 'semver';
|
|
@@ -6,10 +9,27 @@ import { EnumPublishConfigRegistry } from './publishConfig';
|
|
|
6
9
|
import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';
|
|
7
10
|
import { ITSValueOf, ITSValueOfArray } from 'ts-type/lib/helper/key-value';
|
|
8
11
|
import { ITSTypeAndStringLiteral } from 'ts-type/lib/helper/string';
|
|
12
|
+
/**
|
|
13
|
+
* 依賴項類型定義
|
|
14
|
+
* Dependency type definition
|
|
15
|
+
*
|
|
16
|
+
* @typeParam T - 依賴項名稱陣列或字串 / Dependency name array or string
|
|
17
|
+
*/
|
|
9
18
|
export type IDependency<T extends ITSArrayListMaybeReadonly<string> | string = string[]> = Record<T extends string ? T : T extends ITSArrayListMaybeReadonly<string> ? ITSValueOfArray<T> : never, IVersionValue>;
|
|
10
19
|
export type { IDependency as IPackageMap };
|
|
11
20
|
export type { IDependency as IDependencies };
|
|
21
|
+
/**
|
|
22
|
+
* 版本號值類型
|
|
23
|
+
* Version value type
|
|
24
|
+
*
|
|
25
|
+
* 支援 semver 版本字串或預定義的特殊值
|
|
26
|
+
* Supports semver version string or predefined special values
|
|
27
|
+
*/
|
|
12
28
|
export type IVersionValue = ITSTypeAndStringLiteral<EnumVersionValue.latest> | ITSTypeAndStringLiteral<EnumVersionValue2> | string;
|
|
29
|
+
/**
|
|
30
|
+
* Semver 版本發布類型列舉
|
|
31
|
+
* Semver version release type enumeration
|
|
32
|
+
*/
|
|
13
33
|
export declare enum EnumVersionValue {
|
|
14
34
|
'major' = "major",
|
|
15
35
|
'minor' = "minor",
|
|
@@ -17,6 +37,10 @@ export declare enum EnumVersionValue {
|
|
|
17
37
|
'greatest' = "greatest",
|
|
18
38
|
'newest' = "newest"
|
|
19
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* 預發布版本類型常數列舉
|
|
42
|
+
* Prerelease version type constant enumeration
|
|
43
|
+
*/
|
|
20
44
|
export declare const enum EnumVersionValue2 {
|
|
21
45
|
any = "*",
|
|
22
46
|
latest = "latest",
|
|
@@ -27,6 +51,10 @@ export declare const enum EnumVersionValue2 {
|
|
|
27
51
|
dev = "dev"
|
|
28
52
|
}
|
|
29
53
|
export type IPackageJsonDependenciesField = 'dependencies' | 'devDependencies' | 'peerDependencies' | 'optionalDependencies';
|
|
54
|
+
/**
|
|
55
|
+
* package.json 依賴欄位名稱陣列常量
|
|
56
|
+
* package.json dependency field name array constant
|
|
57
|
+
*/
|
|
30
58
|
declare const packageJsonDependenciesFields: readonly ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
31
59
|
export { packageJsonDependenciesFields };
|
|
32
60
|
/**
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.packageJsonDependenciesFields = exports.EnumVersionValue2 = exports.EnumVersionValue = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Semver 版本發布類型列舉
|
|
6
|
+
* Semver version release type enumeration
|
|
7
|
+
*/
|
|
4
8
|
var EnumVersionValue;
|
|
5
9
|
(function (EnumVersionValue) {
|
|
6
10
|
EnumVersionValue["major"] = "major";
|
|
@@ -8,7 +12,11 @@ var EnumVersionValue;
|
|
|
8
12
|
EnumVersionValue["latest"] = "latest";
|
|
9
13
|
EnumVersionValue["greatest"] = "greatest";
|
|
10
14
|
EnumVersionValue["newest"] = "newest";
|
|
11
|
-
})(EnumVersionValue
|
|
15
|
+
})(EnumVersionValue || (exports.EnumVersionValue = EnumVersionValue = {}));
|
|
16
|
+
/**
|
|
17
|
+
* 預發布版本類型常數列舉
|
|
18
|
+
* Prerelease version type constant enumeration
|
|
19
|
+
*/
|
|
12
20
|
var EnumVersionValue2;
|
|
13
21
|
(function (EnumVersionValue2) {
|
|
14
22
|
EnumVersionValue2["any"] = "*";
|
|
@@ -18,7 +26,11 @@ var EnumVersionValue2;
|
|
|
18
26
|
EnumVersionValue2["canary"] = "canary";
|
|
19
27
|
EnumVersionValue2["stable"] = "stable";
|
|
20
28
|
EnumVersionValue2["dev"] = "dev";
|
|
21
|
-
})(EnumVersionValue2
|
|
29
|
+
})(EnumVersionValue2 || (exports.EnumVersionValue2 = EnumVersionValue2 = {}));
|
|
30
|
+
/**
|
|
31
|
+
* package.json 依賴欄位名稱陣列常量
|
|
32
|
+
* package.json dependency field name array constant
|
|
33
|
+
*/
|
|
22
34
|
const packageJsonDependenciesFields = [
|
|
23
35
|
'dependencies',
|
|
24
36
|
'devDependencies',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";;;AAgCA;;;GAGG;AACH,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAE3B,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;IACnB,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;AACpB,CAAC,EAPW,gBAAgB,gCAAhB,gBAAgB,QAO3B;AAED;;;GAGG;AACH,IAAkB,iBAUjB;AAVD,WAAkB,iBAAiB;IAElC,8BAAS,CAAA;IAET,sCAAiB,CAAA;IACjB,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,sCAAiB,CAAA;IACjB,gCAAW,CAAA;AACZ,CAAC,EAViB,iBAAiB,iCAAjB,iBAAiB,QAUlC;AASD;;;GAGG;AACH,MAAM,6BAA6B,GAAG;IACrC,cAAuB;IACvB,iBAA0B;IAC1B,kBAA2B;IAC3B,sBAA+B;CACtB,CAAA;AAED,sEAA6B","sourcesContent":["/**\n * 套件類型定義\n * Package type definitions\n *\n * Created by user on 2020/6/12.\n */\nimport type { ReleaseType as IReleaseType } from 'semver';\nimport { EnumPublishConfigRegistry } from './publishConfig';\nimport { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport { ITSValueOf, ITSValueOfArray } from 'ts-type/lib/helper/key-value';\nimport { ITSTypeAndStringLiteral } from 'ts-type/lib/helper/string';\n\n/**\n * 依賴項類型定義\n * Dependency type definition\n *\n * @typeParam T - 依賴項名稱陣列或字串 / Dependency name array or string\n */\nexport type IDependency<T extends ITSArrayListMaybeReadonly<string> | string = string[]> = Record<T extends string ? T : T extends ITSArrayListMaybeReadonly<string> ? ITSValueOfArray<T> : never, IVersionValue>;\n\nexport type { IDependency as IPackageMap }\nexport type { IDependency as IDependencies }\n\n/**\n * 版本號值類型\n * Version value type\n *\n * 支援 semver 版本字串或預定義的特殊值\n * Supports semver version string or predefined special values\n */\nexport type IVersionValue = ITSTypeAndStringLiteral<EnumVersionValue.latest> | ITSTypeAndStringLiteral<EnumVersionValue2> | string;\n\n/**\n * Semver 版本發布類型列舉\n * Semver version release type enumeration\n */\nexport enum EnumVersionValue\n{\n\t'major' = 'major',\n\t'minor' = 'minor',\n\t'latest' = 'latest',\n\t'greatest' = 'greatest',\n\t'newest' = 'newest'\n}\n\n/**\n * 預發布版本類型常數列舉\n * Prerelease version type constant enumeration\n */\nexport const enum EnumVersionValue2\n{\n\tany = '*',\n\n\tlatest = 'latest',\n\tnext = 'next',\n\tbeta = 'beta',\n\tcanary = 'canary',\n\tstable = 'stable',\n\tdev = 'dev',\n}\n\nexport type IPackageJsonDependenciesField =\n\t'dependencies'\n\t| 'devDependencies'\n\t| 'peerDependencies'\n\t| 'optionalDependencies'\n;\n\n/**\n * package.json 依賴欄位名稱陣列常量\n * package.json dependency field name array constant\n */\nconst packageJsonDependenciesFields = [\n\t'dependencies' as const,\n\t'devDependencies' as const,\n\t'peerDependencies' as const,\n\t'optionalDependencies' as const,\n] as const\n\nexport { packageJsonDependenciesFields }\n\n/**\n * This is a set of config values that will be used at publish-time.\n * It’s especially handy if you want to set the tag, registry or access,\n * so that you can ensure that a given package is not tagged with “latest”,\n * published to the global public registry or that a scoped module is private by default.\n *\n * Any config values can be overridden,\n * but only “tag”, “registry” and “access” probably matter for the purposes of publishing.\n */\nexport interface IPackageJsonPublishConfig\n{\n\tregistry?: string | EnumPublishConfigRegistry;\n\taccess?: string | \"public\" | \"restricted\";\n\ttag?: IPackageJsonTag;\n\n\t[k: string]: any;\n}\n\nexport type IPackageJsonTag = string | ITSTypeAndStringLiteral<Exclude<ITSValueOf<typeof EnumVersionValue2>, EnumVersionValue2.any>>;\n\nexport type { IReleaseType }\n"]}
|
package/package-json.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Created by user on 2019/5/18.
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { JSONSchemaForNPMPackageJsonFiles as CoreProperties } from './types/package.json';
|
|
5
5
|
import type { IDependency, IPackageJsonDependenciesField } from './lib/package-json/types';
|
|
6
6
|
import type { ITSOverwrite } from 'ts-type/lib/type/record';
|
|
7
7
|
import { IPackageJsonExtendYarn } from './lib/package-json/yarn';
|
package/package-json.js
CHANGED
|
@@ -2,23 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Created by user on 2019/5/18.
|
|
4
4
|
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
6
|
exports.EnumVersionValue2 = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
21
8
|
var types_1 = require("./lib/package-json/types");
|
|
22
9
|
Object.defineProperty(exports, "EnumVersionValue2", { enumerable: true, get: function () { return types_1.EnumVersionValue2; } });
|
|
23
|
-
__exportStar(require("./lib/package-json/types"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/package-json/types"), exports);
|
|
24
11
|
//# sourceMappingURL=package-json.js.map
|
package/package-json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json.js","sourceRoot":"","sources":["package-json.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"package-json.js","sourceRoot":"","sources":["package-json.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAWH,kDAA6D;AAApD,0GAAA,iBAAiB,OAAA;AAC1B,mEAAyC","sourcesContent":["/**\n * Created by user on 2019/5/18.\n */\n\nimport type { JSONSchemaForNPMPackageJsonFiles as CoreProperties } from './types/package.json';\nimport type { IDependency, IPackageJsonDependenciesField } from './lib/package-json/types';\nimport type { ITSOverwrite } from 'ts-type/lib/type/record';\nimport { IPackageJsonExtendYarn } from './lib/package-json/yarn';\nimport { ITSPartialRecord } from 'ts-type/lib/type/record/partial';\nimport { ITSOmitIndexSignatures } from 'ts-type/lib/helper/record/omit-index';\nimport { _IPackageJsonCore } from './lib/package-json/extend';\nimport { IPackageJsonExports, IPackageJsonExportsEntryObjectRoot } from './lib/package-json/exports';\n\nexport { EnumVersionValue2 } from './lib/package-json/types';\nexport * from './lib/package-json/types';\n\nexport type ILibPackageJson = typeof import('./types/package.json');\n\n/**\n * @example IPackageJson<unknown>\n */\nexport interface IPackageJson<T = unknown> extends ITSOverwrite<ITSOmitIndexSignatures<CoreProperties>, _IPackageJsonCore & ITSPartialRecord<IPackageJsonDependenciesField, IDependency> & IPackageJsonExtendYarn & IPackageJsonExports>\n{\n/*\n\t//[k in Exclude<string, keyof CoreProperties>]: T;\n\t[k: string]: unknown;\n */\n\t// @ts-ignore\n\t[k: string]: T;\n}\n\nexport default IPackageJson\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ts-type/package-dts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Typescript type definition for NPM package json",
|
|
6
6
|
"keywords": [
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"pretest": "yarn run build",
|
|
54
54
|
"test": "yarn run ts:check",
|
|
55
55
|
"test:jest": "jest --passWithNoTests",
|
|
56
|
+
"test:jest:coverage": "node --run test:jest -- --coverage",
|
|
56
57
|
"test:jest:snapshot": "yarn run test:jest -- -u",
|
|
57
58
|
"test:snapshot": "yarn run test -- -u",
|
|
58
59
|
"test:tsd": "ynpx tsd",
|
|
@@ -63,16 +64,21 @@
|
|
|
63
64
|
"ncu": "yarn-tool ncu -u",
|
|
64
65
|
"sort-package-json": "yarn-tool sort",
|
|
65
66
|
"ts:check": "tsc --noEmit -p tsconfig.check.json",
|
|
67
|
+
"tsc:showConfig": "ynpx get-current-tsconfig -p",
|
|
66
68
|
"update:schema": "ts-node ./script/index"
|
|
67
69
|
},
|
|
68
70
|
"dependencies": {
|
|
69
|
-
"@types/semver": "^7.
|
|
70
|
-
"ts-type": "^3.0.
|
|
71
|
+
"@types/semver": "^7.7.1",
|
|
72
|
+
"ts-type": "^3.0.2"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@types/json-schema": "^7.0.15",
|
|
76
|
+
"json-schema": "^0.4.0"
|
|
71
77
|
},
|
|
72
78
|
"publishConfig": {
|
|
73
79
|
"access": "public"
|
|
74
80
|
},
|
|
75
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "57f82cba146cfef0d0f3f138e5ec736cd17f040d",
|
|
76
82
|
"sharedDependencies": {
|
|
77
83
|
"eslint-config-bluelovers": "latest"
|
|
78
84
|
}
|