@js-utils-kit/types 1.2.0 → 1.4.0

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/dist/index.d.cts CHANGED
@@ -1,6 +1,56 @@
1
1
  import { ArchiverOptions, ArchiverOptions as ArchiverOptions$1 } from "archiver";
2
- import { HTTP_STATUS } from "@js-utils-kit/constants";
3
2
 
3
+ //#region src/commit/types.d.ts
4
+ /**
5
+ * Metadata describing a supported commit type.
6
+ *
7
+ * @see {@link COMMIT_TYPES}.
8
+ */
9
+ interface CommitTypeMeta {
10
+ /**
11
+ * Conventional commit type identifier
12
+ *
13
+ * @example
14
+ * - feat
15
+ * - fix
16
+ * - chore
17
+ * - BREAKING CHANGE.
18
+ */
19
+ type: string;
20
+ /**
21
+ * Human-readable description of what this commit type represents.
22
+ */
23
+ description: string;
24
+ /**
25
+ * Whether this commit type is allowed to introduce a breaking change.
26
+ *
27
+ * When true, breaking changes may be expressed using:
28
+ * - `!` after the type (e.g. `feat!:`)
29
+ * - `BREAKING CHANGE:` footer
30
+ */
31
+ allowsBreakingChange: boolean;
32
+ /**
33
+ * Whether commits of this type should be considered release-relevant (e.g. included in changelogs).
34
+ */
35
+ isReleaseRelevant?: boolean;
36
+ /**
37
+ * Default semantic version impact when no breaking change is present.
38
+ */
39
+ defaultReleaseType?: 'major' | 'minor' | 'patch' | 'none';
40
+ /**
41
+ * Display-friendly label for UIs or documentation.
42
+ */
43
+ title?: string;
44
+ /**
45
+ * Emoji or icon representing this commit type.
46
+ */
47
+ icon?: string;
48
+ /**
49
+ * Marks this commit type as deprecated.
50
+ */
51
+ deprecated?: boolean;
52
+ }
53
+ //#endregion
4
54
  //#region src/ArchiveFormat.d.ts
5
55
  /**
6
56
  * Supported archive formats.
@@ -91,8 +141,6 @@ type Hour = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15
91
141
  /**
92
142
  * Union type of all supported HTTP status codes.
93
143
  *
94
- * This type is derived directly from {@link HTTP_STATUS} and represents every possible numeric HTTP status value.
95
- *
96
144
  * Useful for enforcing strict type-safety when working with HTTP responses, middleware, validators, and utility functions.
97
145
  *
98
146
  * @example
@@ -104,7 +152,7 @@ type Hour = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15
104
152
  * }
105
153
  * ```
106
154
  */
107
- type HttpStatusCode = (typeof HTTP_STATUS)[keyof typeof HTTP_STATUS];
155
+ type HttpStatusCode = 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511;
108
156
  //#endregion
109
157
  //#region src/MinuteOrSecond.d.ts
110
158
  /**
@@ -115,6 +163,143 @@ type HttpStatusCode = (typeof HTTP_STATUS)[keyof typeof HTTP_STATUS];
115
163
  */
116
164
  type MinuteOrSecond = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59;
117
165
  //#endregion
166
+ //#region src/utils/DeepPartial.d.ts
167
+ type DeepPartial<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends readonly (infer U)[] ? readonly DeepPartial<U>[] : T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T;
168
+ //#endregion
169
+ //#region src/PackageJson.d.ts
170
+ type Person = string | {
171
+ name: string;
172
+ email: string;
173
+ url: string;
174
+ };
175
+ type Repository = string | {
176
+ type: string;
177
+ url: string;
178
+ directory: string;
179
+ };
180
+ type Bugs = string | {
181
+ url: string;
182
+ email: string;
183
+ };
184
+ type FundingItem = string | {
185
+ url: string;
186
+ type: string;
187
+ };
188
+ type Funding = FundingItem | FundingItem[];
189
+ type LicenseItem = {
190
+ type: string;
191
+ url: string;
192
+ };
193
+ type DevEngineItem = {
194
+ name: string;
195
+ version: string;
196
+ onFail: 'ignore' | 'warn' | 'error' | 'download';
197
+ };
198
+ type DevEngineField = DevEngineItem | DevEngineItem[];
199
+ type DevEngines = {
200
+ os: DevEngineField;
201
+ cpu: DevEngineField;
202
+ libc: DevEngineField;
203
+ runtime: DevEngineField;
204
+ packageManager: DevEngineField;
205
+ };
206
+ type PackageJson = DeepPartial<{
207
+ name: string;
208
+ displayName: string;
209
+ version: string;
210
+ description: string;
211
+ keywords: string[];
212
+ private: boolean | 'true' | 'false';
213
+ homepage: string;
214
+ repository: Repository;
215
+ bugs: Bugs;
216
+ license: string;
217
+ licenses: LicenseItem[];
218
+ author: Person;
219
+ contributors: Person[];
220
+ maintainers: Person[];
221
+ funding: Funding;
222
+ files: string[];
223
+ main: string;
224
+ module: string;
225
+ types: string;
226
+ typings: string;
227
+ exports: unknown;
228
+ imports: Record<string, unknown>;
229
+ bin: string | Record<string, string>;
230
+ man: string | string[];
231
+ type: 'commonjs' | 'module';
232
+ directories: {
233
+ bin: string;
234
+ doc: string;
235
+ example: string;
236
+ lib: string;
237
+ man: string;
238
+ test: string;
239
+ };
240
+ scripts: Record<string, string>;
241
+ config: Record<string, unknown>;
242
+ dependencies: Record<string, string>;
243
+ devDependencies: Record<string, string>;
244
+ optionalDependencies: Record<string, string>;
245
+ peerDependencies: Record<string, string>;
246
+ peerDependenciesMeta: Record<string, {
247
+ optional: boolean;
248
+ }>;
249
+ bundleDependencies: boolean | string[];
250
+ bundledDependencies: boolean | string[];
251
+ engines: Record<string, string>;
252
+ engineStrict: boolean;
253
+ os: string[];
254
+ cpu: string[];
255
+ devEngines: DevEngines;
256
+ preferGlobal: boolean;
257
+ publishConfig: {
258
+ access: 'public' | 'restricted';
259
+ tag: string;
260
+ registry: string;
261
+ provenance: boolean;
262
+ };
263
+ dist: {
264
+ shasum: string;
265
+ tarball: string;
266
+ };
267
+ readme: string;
268
+ esnext: string | {
269
+ main: string;
270
+ browser: string;
271
+ };
272
+ workspaces: string[] | {
273
+ packages: string[];
274
+ nohoist: string[];
275
+ };
276
+ resolutions: Record<string, unknown>;
277
+ overrides: Record<string, unknown>;
278
+ packageManager: string;
279
+ typesVersions: Record<string, Record<string, string[]>>;
280
+ volta: {
281
+ extends: string;
282
+ node: string;
283
+ npm: string;
284
+ pnpm: string;
285
+ yarn: string;
286
+ };
287
+ pnpm: Record<string, unknown>;
288
+ eslintConfig: Record<string, unknown>;
289
+ prettier: Record<string, unknown>;
290
+ stylelint: Record<string, unknown>;
291
+ ava: Record<string, unknown>;
292
+ release: Record<string, unknown>;
293
+ jscpd: Record<string, unknown>;
294
+ stackblitz: {
295
+ installDependencies: boolean;
296
+ startCommand: string | boolean;
297
+ compileTrigger: 'auto' | 'keystroke' | 'save';
298
+ env: Record<string, string>;
299
+ };
300
+ [key: string]: unknown;
301
+ }>;
302
+ //#endregion
118
303
  //#region src/Trim.d.ts
119
304
  /**
120
305
  * Trims whitespace from a string with methods for leading and trailing and normalizing whitespace.
@@ -150,4 +335,4 @@ interface Trim {
150
335
  normalizeWhitespace(str: string): string;
151
336
  }
152
337
  //#endregion
153
- export { ArchiveFormat, ArchiverOptions, CreateArchiveOptions, Environment, Falsy, Hour, HttpStatusCode, MinuteOrSecond, Trim };
338
+ export { ArchiveFormat, ArchiverOptions, CommitTypeMeta, CreateArchiveOptions, Environment, Falsy, Hour, HttpStatusCode, MinuteOrSecond, PackageJson, Trim };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,56 @@
1
1
  import { ArchiverOptions, ArchiverOptions as ArchiverOptions$1 } from "archiver";
2
- import { HTTP_STATUS } from "@js-utils-kit/constants";
3
2
 
3
+ //#region src/commit/types.d.ts
4
+ /**
5
+ * Metadata describing a supported commit type.
6
+ *
7
+ * @see {@link COMMIT_TYPES}.
8
+ */
9
+ interface CommitTypeMeta {
10
+ /**
11
+ * Conventional commit type identifier
12
+ *
13
+ * @example
14
+ * - feat
15
+ * - fix
16
+ * - chore
17
+ * - BREAKING CHANGE.
18
+ */
19
+ type: string;
20
+ /**
21
+ * Human-readable description of what this commit type represents.
22
+ */
23
+ description: string;
24
+ /**
25
+ * Whether this commit type is allowed to introduce a breaking change.
26
+ *
27
+ * When true, breaking changes may be expressed using:
28
+ * - `!` after the type (e.g. `feat!:`)
29
+ * - `BREAKING CHANGE:` footer
30
+ */
31
+ allowsBreakingChange: boolean;
32
+ /**
33
+ * Whether commits of this type should be considered release-relevant (e.g. included in changelogs).
34
+ */
35
+ isReleaseRelevant?: boolean;
36
+ /**
37
+ * Default semantic version impact when no breaking change is present.
38
+ */
39
+ defaultReleaseType?: 'major' | 'minor' | 'patch' | 'none';
40
+ /**
41
+ * Display-friendly label for UIs or documentation.
42
+ */
43
+ title?: string;
44
+ /**
45
+ * Emoji or icon representing this commit type.
46
+ */
47
+ icon?: string;
48
+ /**
49
+ * Marks this commit type as deprecated.
50
+ */
51
+ deprecated?: boolean;
52
+ }
53
+ //#endregion
4
54
  //#region src/ArchiveFormat.d.ts
5
55
  /**
6
56
  * Supported archive formats.
@@ -91,8 +141,6 @@ type Hour = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15
91
141
  /**
92
142
  * Union type of all supported HTTP status codes.
93
143
  *
94
- * This type is derived directly from {@link HTTP_STATUS} and represents every possible numeric HTTP status value.
95
- *
96
144
  * Useful for enforcing strict type-safety when working with HTTP responses, middleware, validators, and utility functions.
97
145
  *
98
146
  * @example
@@ -104,7 +152,7 @@ type Hour = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15
104
152
  * }
105
153
  * ```
106
154
  */
107
- type HttpStatusCode = (typeof HTTP_STATUS)[keyof typeof HTTP_STATUS];
155
+ type HttpStatusCode = 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511;
108
156
  //#endregion
109
157
  //#region src/MinuteOrSecond.d.ts
110
158
  /**
@@ -115,6 +163,143 @@ type HttpStatusCode = (typeof HTTP_STATUS)[keyof typeof HTTP_STATUS];
115
163
  */
116
164
  type MinuteOrSecond = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59;
117
165
  //#endregion
166
+ //#region src/utils/DeepPartial.d.ts
167
+ type DeepPartial<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends readonly (infer U)[] ? readonly DeepPartial<U>[] : T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T;
168
+ //#endregion
169
+ //#region src/PackageJson.d.ts
170
+ type Person = string | {
171
+ name: string;
172
+ email: string;
173
+ url: string;
174
+ };
175
+ type Repository = string | {
176
+ type: string;
177
+ url: string;
178
+ directory: string;
179
+ };
180
+ type Bugs = string | {
181
+ url: string;
182
+ email: string;
183
+ };
184
+ type FundingItem = string | {
185
+ url: string;
186
+ type: string;
187
+ };
188
+ type Funding = FundingItem | FundingItem[];
189
+ type LicenseItem = {
190
+ type: string;
191
+ url: string;
192
+ };
193
+ type DevEngineItem = {
194
+ name: string;
195
+ version: string;
196
+ onFail: 'ignore' | 'warn' | 'error' | 'download';
197
+ };
198
+ type DevEngineField = DevEngineItem | DevEngineItem[];
199
+ type DevEngines = {
200
+ os: DevEngineField;
201
+ cpu: DevEngineField;
202
+ libc: DevEngineField;
203
+ runtime: DevEngineField;
204
+ packageManager: DevEngineField;
205
+ };
206
+ type PackageJson = DeepPartial<{
207
+ name: string;
208
+ displayName: string;
209
+ version: string;
210
+ description: string;
211
+ keywords: string[];
212
+ private: boolean | 'true' | 'false';
213
+ homepage: string;
214
+ repository: Repository;
215
+ bugs: Bugs;
216
+ license: string;
217
+ licenses: LicenseItem[];
218
+ author: Person;
219
+ contributors: Person[];
220
+ maintainers: Person[];
221
+ funding: Funding;
222
+ files: string[];
223
+ main: string;
224
+ module: string;
225
+ types: string;
226
+ typings: string;
227
+ exports: unknown;
228
+ imports: Record<string, unknown>;
229
+ bin: string | Record<string, string>;
230
+ man: string | string[];
231
+ type: 'commonjs' | 'module';
232
+ directories: {
233
+ bin: string;
234
+ doc: string;
235
+ example: string;
236
+ lib: string;
237
+ man: string;
238
+ test: string;
239
+ };
240
+ scripts: Record<string, string>;
241
+ config: Record<string, unknown>;
242
+ dependencies: Record<string, string>;
243
+ devDependencies: Record<string, string>;
244
+ optionalDependencies: Record<string, string>;
245
+ peerDependencies: Record<string, string>;
246
+ peerDependenciesMeta: Record<string, {
247
+ optional: boolean;
248
+ }>;
249
+ bundleDependencies: boolean | string[];
250
+ bundledDependencies: boolean | string[];
251
+ engines: Record<string, string>;
252
+ engineStrict: boolean;
253
+ os: string[];
254
+ cpu: string[];
255
+ devEngines: DevEngines;
256
+ preferGlobal: boolean;
257
+ publishConfig: {
258
+ access: 'public' | 'restricted';
259
+ tag: string;
260
+ registry: string;
261
+ provenance: boolean;
262
+ };
263
+ dist: {
264
+ shasum: string;
265
+ tarball: string;
266
+ };
267
+ readme: string;
268
+ esnext: string | {
269
+ main: string;
270
+ browser: string;
271
+ };
272
+ workspaces: string[] | {
273
+ packages: string[];
274
+ nohoist: string[];
275
+ };
276
+ resolutions: Record<string, unknown>;
277
+ overrides: Record<string, unknown>;
278
+ packageManager: string;
279
+ typesVersions: Record<string, Record<string, string[]>>;
280
+ volta: {
281
+ extends: string;
282
+ node: string;
283
+ npm: string;
284
+ pnpm: string;
285
+ yarn: string;
286
+ };
287
+ pnpm: Record<string, unknown>;
288
+ eslintConfig: Record<string, unknown>;
289
+ prettier: Record<string, unknown>;
290
+ stylelint: Record<string, unknown>;
291
+ ava: Record<string, unknown>;
292
+ release: Record<string, unknown>;
293
+ jscpd: Record<string, unknown>;
294
+ stackblitz: {
295
+ installDependencies: boolean;
296
+ startCommand: string | boolean;
297
+ compileTrigger: 'auto' | 'keystroke' | 'save';
298
+ env: Record<string, string>;
299
+ };
300
+ [key: string]: unknown;
301
+ }>;
302
+ //#endregion
118
303
  //#region src/Trim.d.ts
119
304
  /**
120
305
  * Trims whitespace from a string with methods for leading and trailing and normalizing whitespace.
@@ -150,4 +335,4 @@ interface Trim {
150
335
  normalizeWhitespace(str: string): string;
151
336
  }
152
337
  //#endregion
153
- export { ArchiveFormat, ArchiverOptions, CreateArchiveOptions, Environment, Falsy, Hour, HttpStatusCode, MinuteOrSecond, Trim };
338
+ export { ArchiveFormat, ArchiverOptions, CommitTypeMeta, CreateArchiveOptions, Environment, Falsy, Hour, HttpStatusCode, MinuteOrSecond, PackageJson, Trim };