@visulima/tsconfig 1.0.15 → 1.1.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/CHANGELOG.md +18 -0
- package/README.md +385 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{findTsConfig-D2TOrVoT.cjs → findTsConfig-C77rAonk.cjs} +1 -1
- package/dist/packem_shared/{findTsConfig-BfSXytI1.mjs → findTsConfig-CvOobjQ5.mjs} +1 -1
- package/dist/packem_shared/implicitBaseUrlSymbol-BMiB-zfM.mjs +1 -0
- package/dist/packem_shared/implicitBaseUrlSymbol-Bfg9VyQS.cjs +1 -0
- package/package.json +18 -14
- package/dist/packem_shared/implicitBaseUrlSymbol-BRzG4WlS.mjs +0 -1
- package/dist/packem_shared/implicitBaseUrlSymbol-DRKC4-0H.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## @visulima/tsconfig [1.1.0](https://github.com/visulima/visulima/compare/@visulima/tsconfig@1.0.16...@visulima/tsconfig@1.1.0) (2024-10-25)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **tsconfig:** adding support ${configDir} ([#476](https://github.com/visulima/visulima/issues/476)) ([d54c47b](https://github.com/visulima/visulima/commit/d54c47b780b293e33d2d6d3bcce8dc32a3a101c3))
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **tsconfig:** handle relative tsconfig.json paths ([abf51b1](https://github.com/visulima/visulima/commit/abf51b1d2efa9b9ca5991a2272c824098cc968ba))
|
|
10
|
+
|
|
11
|
+
## @visulima/tsconfig [1.0.16](https://github.com/visulima/visulima/compare/@visulima/tsconfig@1.0.15...@visulima/tsconfig@1.0.16) (2024-10-05)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Dependencies
|
|
15
|
+
|
|
16
|
+
* **@visulima/fs:** upgraded to 2.2.2
|
|
17
|
+
* **@visulima/path:** upgraded to 1.1.1
|
|
18
|
+
|
|
1
19
|
## @visulima/tsconfig [1.0.15](https://github.com/visulima/visulima/compare/@visulima/tsconfig@1.0.14...@visulima/tsconfig@1.0.15) (2024-10-05)
|
|
2
20
|
|
|
3
21
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -31,6 +31,14 @@
|
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
- Tested against TypeScript for correctness
|
|
37
|
+
- Supports comments & dangling commas in tsconfig.json
|
|
38
|
+
- Resolves extends
|
|
39
|
+
- Fully typed tsconfig.json
|
|
40
|
+
- Validates and throws parsing errors
|
|
41
|
+
|
|
34
42
|
## Install
|
|
35
43
|
|
|
36
44
|
```sh
|
|
@@ -79,6 +87,383 @@ const tsconfig = await readTsConfig("/Users/../Projects/visulima/packages/tsconf
|
|
|
79
87
|
|
|
80
88
|
> tscCompatible: If true, the configuration will be parsed in a way that is compatible with the TypeScript compiler.
|
|
81
89
|
|
|
90
|
+
## Api Docs
|
|
91
|
+
|
|
92
|
+
<!-- TYPEDOC -->
|
|
93
|
+
|
|
94
|
+
# @visulima/tsconfig
|
|
95
|
+
|
|
96
|
+
## File
|
|
97
|
+
|
|
98
|
+
### TsConfigJson
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
type TsConfigJson: object;
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7).
|
|
105
|
+
|
|
106
|
+
#### Type declaration
|
|
107
|
+
|
|
108
|
+
##### compileOnSave?
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
optional compileOnSave: boolean;
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Enable Compile-on-Save for this project.
|
|
115
|
+
|
|
116
|
+
##### compilerOptions?
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
optional compilerOptions: CompilerOptions;
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Instructs the TypeScript compiler how to compile `.ts` files.
|
|
123
|
+
|
|
124
|
+
##### exclude?
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
optional exclude: string[];
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property.
|
|
131
|
+
|
|
132
|
+
Glob patterns require TypeScript version 2.0 or later.
|
|
133
|
+
|
|
134
|
+
##### extends?
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
optional extends: string | string[];
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Path to base configuration file to inherit from.
|
|
141
|
+
|
|
142
|
+
##### files?
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
optional files: string[];
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included.
|
|
149
|
+
|
|
150
|
+
##### include?
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
optional include: string[];
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Specifies a list of glob patterns that match files to be included in compilation.
|
|
157
|
+
|
|
158
|
+
If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`.
|
|
159
|
+
|
|
160
|
+
##### references?
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
optional references: References[];
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Referenced projects.
|
|
167
|
+
|
|
168
|
+
##### typeAcquisition?
|
|
169
|
+
|
|
170
|
+
```ts
|
|
171
|
+
optional typeAcquisition: TypeAcquisition;
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Auto type (.d.ts) acquisition options for this project.
|
|
175
|
+
|
|
176
|
+
##### watchOptions?
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
optional watchOptions: WatchOptions;
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Instructs the TypeScript compiler how to watch files.
|
|
183
|
+
|
|
184
|
+
#### Defined in
|
|
185
|
+
|
|
186
|
+
node\_modules/.pnpm/type-fest@4.26.1/node\_modules/type-fest/source/tsconfig-json.d.ts:1
|
|
187
|
+
|
|
188
|
+
## Other
|
|
189
|
+
|
|
190
|
+
### findTsConfig()
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
function findTsConfig(cwd?, options?): Promise<TsConfigResult>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
An asynchronous function that retrieves the TSConfig by searching for the "tsconfig.json" first,
|
|
197
|
+
second attempt is to look for the "jsconfig.json" file from a given current working directory.
|
|
198
|
+
|
|
199
|
+
#### Parameters
|
|
200
|
+
|
|
201
|
+
• **cwd?**: `string` \| `URL`
|
|
202
|
+
|
|
203
|
+
Optional. The current working directory from which to search for the "tsconfig.json" file.
|
|
204
|
+
The type of `cwd` is `string`.
|
|
205
|
+
|
|
206
|
+
• **options?**: `Options` = `{}`
|
|
207
|
+
|
|
208
|
+
#### Returns
|
|
209
|
+
|
|
210
|
+
`Promise`\<[`TsConfigResult`](README.md#tsconfigresult)\>
|
|
211
|
+
|
|
212
|
+
A `Promise` that resolves to the TSConfig result object.
|
|
213
|
+
The return type of the function is `Promise<TsConfigResult>`.
|
|
214
|
+
|
|
215
|
+
#### Throws
|
|
216
|
+
|
|
217
|
+
An `Error` when the "tsconfig.json" file is not found.
|
|
218
|
+
|
|
219
|
+
#### Defined in
|
|
220
|
+
|
|
221
|
+
[packages/tsconfig/src/find-tsconfig.ts:29](https://github.com/visulima/visulima/blob/d54c47b780b293e33d2d6d3bcce8dc32a3a101c3/packages/tsconfig/src/find-tsconfig.ts#L29)
|
|
222
|
+
|
|
223
|
+
***
|
|
224
|
+
|
|
225
|
+
### findTsConfigSync()
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
function findTsConfigSync(cwd?, options?): TsConfigResult
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
#### Parameters
|
|
232
|
+
|
|
233
|
+
• **cwd?**: `string` \| `URL`
|
|
234
|
+
|
|
235
|
+
• **options?**: `Options` = `{}`
|
|
236
|
+
|
|
237
|
+
#### Returns
|
|
238
|
+
|
|
239
|
+
[`TsConfigResult`](README.md#tsconfigresult)
|
|
240
|
+
|
|
241
|
+
#### Defined in
|
|
242
|
+
|
|
243
|
+
[packages/tsconfig/src/find-tsconfig.ts:66](https://github.com/visulima/visulima/blob/d54c47b780b293e33d2d6d3bcce8dc32a3a101c3/packages/tsconfig/src/find-tsconfig.ts#L66)
|
|
244
|
+
|
|
245
|
+
***
|
|
246
|
+
|
|
247
|
+
### readTsConfig()
|
|
248
|
+
|
|
249
|
+
```ts
|
|
250
|
+
function readTsConfig(tsconfigPath, options?): object
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
#### Parameters
|
|
254
|
+
|
|
255
|
+
• **tsconfigPath**: `string`
|
|
256
|
+
|
|
257
|
+
• **options?**: `Options`
|
|
258
|
+
|
|
259
|
+
#### Returns
|
|
260
|
+
|
|
261
|
+
`object`
|
|
262
|
+
|
|
263
|
+
##### compileOnSave?
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
optional compileOnSave: boolean;
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Enable Compile-on-Save for this project.
|
|
270
|
+
|
|
271
|
+
##### compilerOptions?
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
optional compilerOptions: CompilerOptions;
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Instructs the TypeScript compiler how to compile `.ts` files.
|
|
278
|
+
|
|
279
|
+
##### exclude?
|
|
280
|
+
|
|
281
|
+
```ts
|
|
282
|
+
optional exclude: string[];
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property.
|
|
286
|
+
|
|
287
|
+
Glob patterns require TypeScript version 2.0 or later.
|
|
288
|
+
|
|
289
|
+
##### files?
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
optional files: string[];
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included.
|
|
296
|
+
|
|
297
|
+
##### include?
|
|
298
|
+
|
|
299
|
+
```ts
|
|
300
|
+
optional include: string[];
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Specifies a list of glob patterns that match files to be included in compilation.
|
|
304
|
+
|
|
305
|
+
If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`.
|
|
306
|
+
|
|
307
|
+
##### references?
|
|
308
|
+
|
|
309
|
+
```ts
|
|
310
|
+
optional references: References[];
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Referenced projects.
|
|
314
|
+
|
|
315
|
+
##### typeAcquisition?
|
|
316
|
+
|
|
317
|
+
```ts
|
|
318
|
+
optional typeAcquisition: TypeAcquisition;
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
Auto type (.d.ts) acquisition options for this project.
|
|
322
|
+
|
|
323
|
+
##### watchOptions?
|
|
324
|
+
|
|
325
|
+
```ts
|
|
326
|
+
optional watchOptions: WatchOptions;
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Instructs the TypeScript compiler how to watch files.
|
|
330
|
+
|
|
331
|
+
#### Defined in
|
|
332
|
+
|
|
333
|
+
[packages/tsconfig/src/read-tsconfig.ts:308](https://github.com/visulima/visulima/blob/d54c47b780b293e33d2d6d3bcce8dc32a3a101c3/packages/tsconfig/src/read-tsconfig.ts#L308)
|
|
334
|
+
|
|
335
|
+
***
|
|
336
|
+
|
|
337
|
+
### writeTsConfig()
|
|
338
|
+
|
|
339
|
+
```ts
|
|
340
|
+
function writeTsConfig(tsConfig, options): Promise<void>
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
An asynchronous function that writes the provided TypeScript configuration object to a tsconfig.json file.
|
|
344
|
+
|
|
345
|
+
#### Parameters
|
|
346
|
+
|
|
347
|
+
• **tsConfig**: [`TsConfigJson`](README.md#tsconfigjson)
|
|
348
|
+
|
|
349
|
+
The TypeScript configuration object to write. The type of `tsConfig` is `TsConfigJson`.
|
|
350
|
+
|
|
351
|
+
• **options**: `WriteFileOptions` & `object` & `object` = `{}`
|
|
352
|
+
|
|
353
|
+
Optional. The write options and the current working directory. The type of `options` is an
|
|
354
|
+
intersection type of `WriteOptions` and a Record type with an optional `cwd` key of type `string`.
|
|
355
|
+
|
|
356
|
+
#### Returns
|
|
357
|
+
|
|
358
|
+
`Promise`\<`void`\>
|
|
359
|
+
|
|
360
|
+
A `Promise` that resolves when the tsconfig.json file has been written.
|
|
361
|
+
The return type of function is `Promise<void>`.
|
|
362
|
+
|
|
363
|
+
#### Defined in
|
|
364
|
+
|
|
365
|
+
[packages/tsconfig/src/write-tsconfig.ts:17](https://github.com/visulima/visulima/blob/d54c47b780b293e33d2d6d3bcce8dc32a3a101c3/packages/tsconfig/src/write-tsconfig.ts#L17)
|
|
366
|
+
|
|
367
|
+
***
|
|
368
|
+
|
|
369
|
+
### writeTsConfigSync()
|
|
370
|
+
|
|
371
|
+
```ts
|
|
372
|
+
function writeTsConfigSync(tsConfig, options): void
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
A function that writes the provided TypeScript configuration object to a tsconfig.json file.
|
|
376
|
+
|
|
377
|
+
#### Parameters
|
|
378
|
+
|
|
379
|
+
• **tsConfig**: [`TsConfigJson`](README.md#tsconfigjson)
|
|
380
|
+
|
|
381
|
+
The TypeScript configuration object to write. The type of `tsConfig` is `TsConfigJson`.
|
|
382
|
+
|
|
383
|
+
• **options**: `WriteFileOptions` & `object` & `object` = `{}`
|
|
384
|
+
|
|
385
|
+
Optional. The write options and the current working directory. The type of `options` is an
|
|
386
|
+
intersection type of `WriteOptions` and a Record type with an optional `cwd` key of type `string`.
|
|
387
|
+
|
|
388
|
+
#### Returns
|
|
389
|
+
|
|
390
|
+
`void`
|
|
391
|
+
|
|
392
|
+
A `Promise` that resolves when the tsconfig.json file has been written.
|
|
393
|
+
The return type of function is `Promise<void>`.
|
|
394
|
+
|
|
395
|
+
#### Defined in
|
|
396
|
+
|
|
397
|
+
[packages/tsconfig/src/write-tsconfig.ts:35](https://github.com/visulima/visulima/blob/d54c47b780b293e33d2d6d3bcce8dc32a3a101c3/packages/tsconfig/src/write-tsconfig.ts#L35)
|
|
398
|
+
|
|
399
|
+
***
|
|
400
|
+
|
|
401
|
+
### implicitBaseUrlSymbol
|
|
402
|
+
|
|
403
|
+
```ts
|
|
404
|
+
const implicitBaseUrlSymbol: typeof implicitBaseUrlSymbol;
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
#### Defined in
|
|
408
|
+
|
|
409
|
+
[packages/tsconfig/src/read-tsconfig.ts:305](https://github.com/visulima/visulima/blob/d54c47b780b293e33d2d6d3bcce8dc32a3a101c3/packages/tsconfig/src/read-tsconfig.ts#L305)
|
|
410
|
+
|
|
411
|
+
***
|
|
412
|
+
|
|
413
|
+
### TsConfigJsonResolved
|
|
414
|
+
|
|
415
|
+
```ts
|
|
416
|
+
type TsConfigJsonResolved: Except<TsConfigJson, "extends">;
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
#### Defined in
|
|
420
|
+
|
|
421
|
+
[packages/tsconfig/src/types.ts:3](https://github.com/visulima/visulima/blob/d54c47b780b293e33d2d6d3bcce8dc32a3a101c3/packages/tsconfig/src/types.ts#L3)
|
|
422
|
+
|
|
423
|
+
***
|
|
424
|
+
|
|
425
|
+
### TsConfigResult
|
|
426
|
+
|
|
427
|
+
```ts
|
|
428
|
+
type TsConfigResult: object;
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
#### Type declaration
|
|
432
|
+
|
|
433
|
+
##### config
|
|
434
|
+
|
|
435
|
+
```ts
|
|
436
|
+
config: TsConfigJsonResolved;
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
##### path
|
|
440
|
+
|
|
441
|
+
```ts
|
|
442
|
+
path: string;
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
#### Defined in
|
|
446
|
+
|
|
447
|
+
[packages/tsconfig/src/find-tsconfig.ts:14](https://github.com/visulima/visulima/blob/d54c47b780b293e33d2d6d3bcce8dc32a3a101c3/packages/tsconfig/src/find-tsconfig.ts#L14)
|
|
448
|
+
|
|
449
|
+
## File
|
|
450
|
+
|
|
451
|
+
- [TsConfigJson](README.md#tsconfigjson)
|
|
452
|
+
|
|
453
|
+
## Other
|
|
454
|
+
|
|
455
|
+
- [findTsConfig](README.md#findtsconfig)
|
|
456
|
+
- [findTsConfigSync](README.md#findtsconfigsync)
|
|
457
|
+
- [readTsConfig](README.md#readtsconfig)
|
|
458
|
+
- [writeTsConfig](README.md#writetsconfig)
|
|
459
|
+
- [writeTsConfigSync](README.md#writetsconfigsync)
|
|
460
|
+
- [TsConfigJson](namespaces/TsConfigJson/README.md)
|
|
461
|
+
- [implicitBaseUrlSymbol](README.md#implicitbaseurlsymbol)
|
|
462
|
+
- [TsConfigJsonResolved](README.md#tsconfigjsonresolved)
|
|
463
|
+
- [TsConfigResult](README.md#tsconfigresult)
|
|
464
|
+
|
|
465
|
+
<!-- /TYPEDOC -->
|
|
466
|
+
|
|
82
467
|
## Related
|
|
83
468
|
|
|
84
469
|
- [get-tsconfig](https://github.com/privatenumber/get-tsconfig) - Get the TypeScript configuration from a project.
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./packem_shared/findTsConfig-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./packem_shared/findTsConfig-C77rAonk.cjs"),n=require("./packem_shared/implicitBaseUrlSymbol-Bfg9VyQS.cjs"),e=require("./packem_shared/writeTsConfig-D_MA7_Uu.cjs");exports.findTsConfig=i.findTsConfig;exports.findTsConfigSync=i.findTsConfigSync;exports.implicitBaseUrlSymbol=n.implicitBaseUrlSymbol;exports.readTsConfig=n.readTsConfig;exports.writeTsConfig=e.writeTsConfig;exports.writeTsConfigSync=e.writeTsConfigSync;
|
package/dist/index.d.cts
CHANGED
|
@@ -1328,7 +1328,7 @@ declare const findTsConfig: (cwd?: URL | string, options?: Options$1) => Promise
|
|
|
1328
1328
|
declare const findTsConfigSync: (cwd?: URL | string, options?: Options$1) => TsConfigResult;
|
|
1329
1329
|
|
|
1330
1330
|
type Options = {
|
|
1331
|
-
tscCompatible?:
|
|
1331
|
+
tscCompatible?: "5.3" | "5.4" | "5.5" | "5.6" | true;
|
|
1332
1332
|
};
|
|
1333
1333
|
declare const implicitBaseUrlSymbol: unique symbol;
|
|
1334
1334
|
declare const readTsConfig: (tsconfigPath: string, options?: Options) => TsConfigJsonResolved;
|
package/dist/index.d.mts
CHANGED
|
@@ -1328,7 +1328,7 @@ declare const findTsConfig: (cwd?: URL | string, options?: Options$1) => Promise
|
|
|
1328
1328
|
declare const findTsConfigSync: (cwd?: URL | string, options?: Options$1) => TsConfigResult;
|
|
1329
1329
|
|
|
1330
1330
|
type Options = {
|
|
1331
|
-
tscCompatible?:
|
|
1331
|
+
tscCompatible?: "5.3" | "5.4" | "5.5" | "5.6" | true;
|
|
1332
1332
|
};
|
|
1333
1333
|
declare const implicitBaseUrlSymbol: unique symbol;
|
|
1334
1334
|
declare const readTsConfig: (tsconfigPath: string, options?: Options) => TsConfigJsonResolved;
|
package/dist/index.d.ts
CHANGED
|
@@ -1328,7 +1328,7 @@ declare const findTsConfig: (cwd?: URL | string, options?: Options$1) => Promise
|
|
|
1328
1328
|
declare const findTsConfigSync: (cwd?: URL | string, options?: Options$1) => TsConfigResult;
|
|
1329
1329
|
|
|
1330
1330
|
type Options = {
|
|
1331
|
-
tscCompatible?:
|
|
1331
|
+
tscCompatible?: "5.3" | "5.4" | "5.5" | "5.6" | true;
|
|
1332
1332
|
};
|
|
1333
1333
|
declare const implicitBaseUrlSymbol: unique symbol;
|
|
1334
1334
|
declare const readTsConfig: (tsconfigPath: string, options?: Options) => TsConfigJsonResolved;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{findTsConfig as f,findTsConfigSync as r}from"./packem_shared/findTsConfig-
|
|
1
|
+
import{findTsConfig as f,findTsConfigSync as r}from"./packem_shared/findTsConfig-CvOobjQ5.mjs";import{implicitBaseUrlSymbol as e,readTsConfig as s}from"./packem_shared/implicitBaseUrlSymbol-BMiB-zfM.mjs";import{writeTsConfig as g,writeTsConfigSync as m}from"./packem_shared/writeTsConfig-Dwba2y0l.mjs";export{f as findTsConfig,r as findTsConfigSync,e as implicitBaseUrlSymbol,s as readTsConfig,g as writeTsConfig,m as writeTsConfigSync};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var r=(c,e)=>l(c,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@visulima/fs"),s=require("@visulima/fs/error"),a=require("./implicitBaseUrlSymbol-
|
|
1
|
+
"use strict";var l=Object.defineProperty;var r=(c,e)=>l(c,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@visulima/fs"),s=require("@visulima/fs/error"),a=require("./implicitBaseUrlSymbol-Bfg9VyQS.cjs");var h=Object.defineProperty,d=r((c,e)=>h(c,"name",{value:e,configurable:!0}),"s");const g=new Map,u=d(async(c,e={})=>{const i=e.configFileName??"tsconfig.json";let n=await t.findUp(i,{...c&&{cwd:c},type:"file"});if(n||(n=await t.findUp("jsconfig.json",{...c&&{cwd:c},type:"file"})),!n)throw new s.NotFoundError(`No such file or directory, for ${i} or jsconfig.json found.`);const o=e.cache&&typeof e.cache!="boolean"?e.cache:g;if(e.cache&&o.has(n))return o.get(n);const f={config:a.readTsConfig(n),path:n};return e.cache&&o.set(n,f),f},"findTsConfig"),y=d((c,e={})=>{const i=e.configFileName??"tsconfig.json";let n=t.findUpSync(i,{...c&&{cwd:c},type:"file"});if(n||(n=t.findUpSync("jsconfig.json",{...c&&{cwd:c},type:"file"})),!n)throw new s.NotFoundError(`No such file or directory, for ${i} or jsconfig.json found.`);const o=e.cache&&typeof e.cache!="boolean"?e.cache:g;if(e.cache&&o.has(n))return o.get(n);const f={config:a.readTsConfig(n),path:n};return e.cache&&o.set(n,f),f},"findTsConfigSync");exports.findTsConfig=u;exports.findTsConfigSync=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var t=(o,e)=>p(o,"name",{value:e,configurable:!0});import{findUp as r,findUpSync as s}from"@visulima/fs";import{NotFoundError as a}from"@visulima/fs/error";import{readTsConfig as h}from"./implicitBaseUrlSymbol-
|
|
1
|
+
var p=Object.defineProperty;var t=(o,e)=>p(o,"name",{value:e,configurable:!0});import{findUp as r,findUpSync as s}from"@visulima/fs";import{NotFoundError as a}from"@visulima/fs/error";import{readTsConfig as h}from"./implicitBaseUrlSymbol-BMiB-zfM.mjs";var l=Object.defineProperty,g=t((o,e)=>l(o,"name",{value:e,configurable:!0}),"s");const d=new Map,m=g(async(o,e={})=>{const f=e.configFileName??"tsconfig.json";let c=await r(f,{...o&&{cwd:o},type:"file"});if(c||(c=await r("jsconfig.json",{...o&&{cwd:o},type:"file"})),!c)throw new a(`No such file or directory, for ${f} or jsconfig.json found.`);const n=e.cache&&typeof e.cache!="boolean"?e.cache:d;if(e.cache&&n.has(c))return n.get(c);const i={config:h(c),path:c};return e.cache&&n.set(c,i),i},"findTsConfig"),C=g((o,e={})=>{const f=e.configFileName??"tsconfig.json";let c=s(f,{...o&&{cwd:o},type:"file"});if(c||(c=s("jsconfig.json",{...o&&{cwd:o},type:"file"})),!c)throw new a(`No such file or directory, for ${f} or jsconfig.json found.`);const n=e.cache&&typeof e.cache!="boolean"?e.cache:d;if(e.cache&&n.has(c))return n.get(c);const i={config:h(c),path:c};return e.cache&&n.set(c,i),i},"findTsConfigSync");export{m as findTsConfig,C as findTsConfigSync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var R=Object.defineProperty;var I=(i,r)=>R(i,"name",{value:r,configurable:!0});import{readFileSync as k,isAccessibleSync as d,findUpSync as J}from"@visulima/fs";import{NotFoundError as N}from"@visulima/fs/error";import{join as f,resolve as C,isAbsolute as W,toNamespacedPath as z,dirname as E,normalize as O,relative as D}from"@visulima/path";import{isRelative as A}from"@visulima/path/utils";import{parse as $}from"jsonc-parser";import{statSync as x}from"node:fs";import M from"node:module";import{resolveExports as q}from"resolve-pkg-maps";var V=Object.defineProperty,F=I((i,r)=>V(i,"name",{value:r,configurable:!0}),"d");const _=F(i=>$(k(i,{buffer:!1})),"readJsonc"),G=F(()=>{const{findPnpApi:i}=M;return i?.(process.cwd())},"getPnpApi"),S=F((i,r,u,e)=>{const c="resolveFromPackageJsonPath:"+i+":"+r+":"+(u?"yes":"no");if(e?.has(c))return e.get(c);const t=_(i);if(!t)return;let n=r||"tsconfig.json";if(!u&&t.exports)try{const[o]=q(t.exports,r,["require","types"]);n=o}catch{return!1}else!r&&t.tsconfig&&(n=t.tsconfig);return n=f(i,"..",n),e?.set(c,n),n},"resolveFromPackageJsonPath"),j="package.json",P="tsconfig.json",H=F((i,r,u)=>{let e=i;if(i===".."&&(e=f(e,P)),i.startsWith(".")&&(e=C(r,e)),W(e)){if(d(e)){if(x(e).isFile())return e}else if(!e.endsWith(".json")){const a=`${e}.json`;if(d(a))return a}return}const[c,...t]=i.split("/"),n=c.startsWith("@")?c+"/"+t.shift():c,o=t.join("/"),s=G();if(s){const{resolveRequest:a}=s;try{if(n===i){const p=a(f(n,j),r);if(p){const g=S(p,o,!1,u);if(g&&d(g))return g}}else{let p;try{p=a(i,r,{extensions:[".json"]})}catch{p=a(f(i,P),r)}if(p)return p}}catch{}}const l=J(a=>{const p=f(C(a),"node_modules",n);if(d(p))return f("node_modules",n)},{cwd:r,type:"directory"});if(!l||!x(l).isDirectory())return;const h=f(l,j);if(d(h)){const a=S(h,o,!1,u);if(a===!1)return;if(a&&d(a)&&x(a).isFile())return a}const y=f(l,o),U=y.endsWith(".json");if(!U){const a=y+".json";if(d(a))return a}if(d(y)){if(x(y).isDirectory()){const a=f(y,j);if(d(a)){const g=S(a,"",!0,u);if(g&&d(g))return g}const p=f(y,P);if(d(p))return p}else if(U)return y}},"resolveExtendsPath");var K=Object.defineProperty,w=I((i,r)=>K(i,"name",{value:r,configurable:!0}),"u");const L=w(i=>$(k(i,{buffer:!1})),"readJsonc"),b=w(i=>{const r=z(i);return A(r)?r:`./${r}`},"normalizePath"),B=["files","include","exclude"],Q=w((i,r,u,e)=>{const c=H(i,r);if(!c)throw new N(`No such file or directory, for '${i}' found.`);if(u.has(c))throw new Error(`Circularity detected while resolving configuration: ${c}`);u.add(c);const t=E(c),n=T(c,e,u);delete n.references;const{compilerOptions:o}=n;if(o){const{baseUrl:s}=o;s&&!s.startsWith(m)&&(o.baseUrl=O(D(r,f(t,s)))||"./");let{outDir:l}=o;l&&(l.startsWith(m)||(l=D(r,f(t,l))),o.outDir=b(l.replace(m+"/",""))||"./")}for(const s of B){const l=n[s];l&&(n[s]=l.map(h=>h.startsWith(m)||W(h)?h:D(r,f(t,h))))}return n},"resolveExtends"),T=w((i,r,u=new Set)=>{let e;try{e=L(i)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${i}`)}if(typeof e!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${i}`);const c=E(i);if(e.compilerOptions){const{compilerOptions:t}=e;t.paths&&!t.baseUrl&&(t[Y]=c)}if(e.extends){const t=Array.isArray(e.extends)?e.extends:[e.extends];delete e.extends;for(const n of t.reverse()){const o=Q(n,c,new Set(u),r),s={...o,...e,compilerOptions:{...o.compilerOptions,...e.compilerOptions}};o.watchOptions&&(s.watchOptions={...o.watchOptions,...e.watchOptions}),e=s}}if(e.compilerOptions){const{compilerOptions:t}=e;for(const n of["baseUrl","rootDir"]){const o=t[n];if(o&&!o.startsWith(m)){const s=C(c,o);t[n]=b(D(c,s))}}for(const n of["outDir","declarationDir"]){let o=t[n];if(o){Array.isArray(e.exclude)||(e.exclude=[]);let s=o;W(s)||(s=f(c,s)),s=s.replace(m,""),e.exclude.includes(s)||e.exclude.push(s),o.startsWith(m)||(o=b(o)),t[n]=o}}r?.tscCompatible&&t.module==="node16"&&["5.4","5.5","5.6","true"].includes(String(r.tscCompatible))&&(t.allowSyntheticDefaultImports=t.allowSyntheticDefaultImports??!0,t.esModuleInterop=t.esModuleInterop??!0,t.moduleDetection=t.moduleDetection??"force",t.moduleResolution=t.moduleResolution??"node16",t.target=t.target??"es2022",t.useDefineForClassFields=t.useDefineForClassFields??!0),r?.tscCompatible&&t.strict&&(["5.6","true"].includes(String(r.tscCompatible))&&(t.strictBuiltinIteratorReturn=t.strictBuiltinIteratorReturn??!0),["5.4","5.5","5.6","true"].includes(String(r.tscCompatible))&&(t.noImplicitAny=t.noImplicitAny??!0,t.noImplicitThis=t.noImplicitThis??!0,t.strictNullChecks=t.strictNullChecks??!0,t.strictFunctionTypes=t.strictFunctionTypes??!0,t.strictBindCallApply=t.strictBindCallApply??!0,t.strictPropertyInitialization=t.strictPropertyInitialization??!0,t.alwaysStrict=t.alwaysStrict??!0,t.useUnknownInCatchVariables=t.useUnknownInCatchVariables??!0)),r?.tscCompatible&&t.isolatedModules&&(t.preserveConstEnums=t.preserveConstEnums??!0),r?.tscCompatible&&t.esModuleInterop&&(t.allowSyntheticDefaultImports=t.allowSyntheticDefaultImports??!0),r?.tscCompatible&&t.target==="esnext"&&(t.useDefineForClassFields=t.useDefineForClassFields??!0)}else e.compilerOptions={};if(e.include?(e.include=e.include.map(t=>O(t)),e.files&&delete e.files):e.files&&(e.files=e.files.map(t=>t.startsWith(m)?t:b(t))),e.watchOptions){const{watchOptions:t}=e;t.excludeDirectories&&(t.excludeDirectories=t.excludeDirectories.map(n=>C(c,n)))}return e},"internalParseTsConfig"),v=w((i,r)=>{if(i.startsWith(m))return O(f(r,i.slice(m.length)))},"interpolateConfigDirectory"),X=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],m="${configDir}",Y=Symbol("implicitBaseUrl"),lt=w((i,r)=>{const u=C(i),e=T(u,r),c=E(u),{compilerOptions:t}=e;if(t){for(const o of X){const s=t[o];if(s){const l=v(s,c);t[o]=l?b(D(c,l)):s}}for(const o of["rootDirs","typeRoots"]){const s=t[o];s&&(t[o]=s.map(l=>{const h=v(l,c);return h?b(D(c,h)):l}))}const{paths:n}=t;if(n)for(const o of Object.keys(n))n[o]=n[o].map(s=>v(s,c)??s);t.outDir&&(t.outDir=t.outDir.replace(m,""))}for(const n of B){const o=e[n];o&&(e[n]=o.map(s=>v(s,c)||(n==="files"&&A(s)?s:n==="include"&&A(s)?f(c,s):O(s))))}return e},"readTsConfig");export{m as configDirectoryPlaceholder,Y as implicitBaseUrlSymbol,lt as readTsConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var k=Object.defineProperty;var v=(s,i)=>k(s,"name",{value:i,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@visulima/fs"),q=require("@visulima/fs/error"),n=require("@visulima/path"),O=require("@visulima/path/utils"),P=require("jsonc-parser"),j=require("node:fs"),E=require("node:module"),T=require("resolve-pkg-maps"),B=v(s=>s&&typeof s=="object"&&"default"in s?s.default:s,"_interopDefaultCompat"),R=B(E);var $=Object.defineProperty,C=v((s,i)=>$(s,"name",{value:i,configurable:!0}),"d");const z=C(s=>P.parse(p.readFileSync(s,{buffer:!1})),"readJsonc"),M=C(()=>{const{findPnpApi:s}=R;return s?.(process.cwd())},"getPnpApi"),w=C((s,i,f,t)=>{const l="resolveFromPackageJsonPath:"+s+":"+i+":"+(f?"yes":"no");if(t?.has(l))return t.get(l);const e=z(s);if(!e)return;let c=i||"tsconfig.json";if(!f&&e.exports)try{const[o]=T.resolveExports(e.exports,i,["require","types"]);c=o}catch{return!1}else!i&&e.tsconfig&&(c=e.tsconfig);return c=n.join(s,"..",c),t?.set(l,c),c},"resolveFromPackageJsonPath"),A="package.json",x="tsconfig.json",_=C((s,i,f)=>{let t=s;if(s===".."&&(t=n.join(t,x)),s.startsWith(".")&&(t=n.resolve(i,t)),n.isAbsolute(t)){if(p.isAccessibleSync(t)){if(j.statSync(t).isFile())return t}else if(!t.endsWith(".json")){const u=`${t}.json`;if(p.isAccessibleSync(u))return u}return}const[l,...e]=s.split("/"),c=l.startsWith("@")?l+"/"+e.shift():l,o=e.join("/"),r=M();if(r){const{resolveRequest:u}=r;try{if(c===s){const d=u(n.join(c,A),i);if(d){const b=w(d,o,!1,f);if(b&&p.isAccessibleSync(b))return b}}else{let d;try{d=u(s,i,{extensions:[".json"]})}catch{d=u(n.join(s,x),i)}if(d)return d}}catch{}}const a=p.findUpSync(u=>{const d=n.join(n.resolve(u),"node_modules",c);if(p.isAccessibleSync(d))return n.join("node_modules",c)},{cwd:i,type:"directory"});if(!a||!j.statSync(a).isDirectory())return;const y=n.join(a,A);if(p.isAccessibleSync(y)){const u=w(y,o,!1,f);if(u===!1)return;if(u&&p.isAccessibleSync(u)&&j.statSync(u).isFile())return u}const h=n.join(a,o),F=h.endsWith(".json");if(!F){const u=h+".json";if(p.isAccessibleSync(u))return u}if(p.isAccessibleSync(h)){if(j.statSync(h).isDirectory()){const u=n.join(h,A);if(p.isAccessibleSync(u)){const b=w(u,"",!0,f);if(b&&p.isAccessibleSync(b))return b}const d=n.join(h,x);if(p.isAccessibleSync(d))return d}else if(F)return h}},"resolveExtendsPath");var J=Object.defineProperty,S=v((s,i)=>J(s,"name",{value:i,configurable:!0}),"u");const N=S(s=>P.parse(p.readFileSync(s,{buffer:!1})),"readJsonc"),g=S(s=>{const i=n.toNamespacedPath(s);return O.isRelative(i)?i:`./${i}`},"normalizePath"),I=["files","include","exclude"],V=S((s,i,f,t)=>{const l=_(s,i);if(!l)throw new q.NotFoundError(`No such file or directory, for '${s}' found.`);if(f.has(l))throw new Error(`Circularity detected while resolving configuration: ${l}`);f.add(l);const e=n.dirname(l),c=W(l,t,f);delete c.references;const{compilerOptions:o}=c;if(o){const{baseUrl:r}=o;r&&!r.startsWith(m)&&(o.baseUrl=n.normalize(n.relative(i,n.join(e,r)))||"./");let{outDir:a}=o;a&&(a.startsWith(m)||(a=n.relative(i,n.join(e,a))),o.outDir=g(a.replace(m+"/",""))||"./")}for(const r of I){const a=c[r];a&&(c[r]=a.map(y=>y.startsWith(m)||n.isAbsolute(y)?y:n.relative(i,n.join(e,y))))}return c},"resolveExtends"),W=S((s,i,f=new Set)=>{let t;try{t=N(s)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${s}`)}if(typeof t!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${s}`);const l=n.dirname(s);if(t.compilerOptions){const{compilerOptions:e}=t;e.paths&&!e.baseUrl&&(e[U]=l)}if(t.extends){const e=Array.isArray(t.extends)?t.extends:[t.extends];delete t.extends;for(const c of e.reverse()){const o=V(c,l,new Set(f),i),r={...o,...t,compilerOptions:{...o.compilerOptions,...t.compilerOptions}};o.watchOptions&&(r.watchOptions={...o.watchOptions,...t.watchOptions}),t=r}}if(t.compilerOptions){const{compilerOptions:e}=t;for(const c of["baseUrl","rootDir"]){const o=e[c];if(o&&!o.startsWith(m)){const r=n.resolve(l,o);e[c]=g(n.relative(l,r))}}for(const c of["outDir","declarationDir"]){let o=e[c];if(o){Array.isArray(t.exclude)||(t.exclude=[]);let r=o;n.isAbsolute(r)||(r=n.join(l,r)),r=r.replace(m,""),t.exclude.includes(r)||t.exclude.push(r),o.startsWith(m)||(o=g(o)),e[c]=o}}i?.tscCompatible&&e.module==="node16"&&["5.4","5.5","5.6","true"].includes(String(i.tscCompatible))&&(e.allowSyntheticDefaultImports=e.allowSyntheticDefaultImports??!0,e.esModuleInterop=e.esModuleInterop??!0,e.moduleDetection=e.moduleDetection??"force",e.moduleResolution=e.moduleResolution??"node16",e.target=e.target??"es2022",e.useDefineForClassFields=e.useDefineForClassFields??!0),i?.tscCompatible&&e.strict&&(["5.6","true"].includes(String(i.tscCompatible))&&(e.strictBuiltinIteratorReturn=e.strictBuiltinIteratorReturn??!0),["5.4","5.5","5.6","true"].includes(String(i.tscCompatible))&&(e.noImplicitAny=e.noImplicitAny??!0,e.noImplicitThis=e.noImplicitThis??!0,e.strictNullChecks=e.strictNullChecks??!0,e.strictFunctionTypes=e.strictFunctionTypes??!0,e.strictBindCallApply=e.strictBindCallApply??!0,e.strictPropertyInitialization=e.strictPropertyInitialization??!0,e.alwaysStrict=e.alwaysStrict??!0,e.useUnknownInCatchVariables=e.useUnknownInCatchVariables??!0)),i?.tscCompatible&&e.isolatedModules&&(e.preserveConstEnums=e.preserveConstEnums??!0),i?.tscCompatible&&e.esModuleInterop&&(e.allowSyntheticDefaultImports=e.allowSyntheticDefaultImports??!0),i?.tscCompatible&&e.target==="esnext"&&(e.useDefineForClassFields=e.useDefineForClassFields??!0)}else t.compilerOptions={};if(t.include?(t.include=t.include.map(e=>n.normalize(e)),t.files&&delete t.files):t.files&&(t.files=t.files.map(e=>e.startsWith(m)?e:g(e))),t.watchOptions){const{watchOptions:e}=t;e.excludeDirectories&&(e.excludeDirectories=e.excludeDirectories.map(c=>n.resolve(l,c)))}return t},"internalParseTsConfig"),D=S((s,i)=>{if(s.startsWith(m))return n.normalize(n.join(i,s.slice(m.length)))},"interpolateConfigDirectory"),G=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],m="${configDir}",U=Symbol("implicitBaseUrl"),H=S((s,i)=>{const f=n.resolve(s),t=W(f,i),l=n.dirname(f),{compilerOptions:e}=t;if(e){for(const o of G){const r=e[o];if(r){const a=D(r,l);e[o]=a?g(n.relative(l,a)):r}}for(const o of["rootDirs","typeRoots"]){const r=e[o];r&&(e[o]=r.map(a=>{const y=D(a,l);return y?g(n.relative(l,y)):a}))}const{paths:c}=e;if(c)for(const o of Object.keys(c))c[o]=c[o].map(r=>D(r,l)??r);e.outDir&&(e.outDir=e.outDir.replace(m,""))}for(const c of I){const o=t[c];o&&(t[c]=o.map(r=>D(r,l)||(c==="files"&&O.isRelative(r)?r:c==="include"&&O.isRelative(r)?n.join(l,r):n.normalize(r))))}return t},"readTsConfig");exports.configDirectoryPlaceholder=m;exports.implicitBaseUrlSymbol=U;exports.readTsConfig=H;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/tsconfig",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Find and/or parse the tsconfig.json file from a directory path.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"CHANGELOG.md"
|
|
68
68
|
],
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@visulima/fs": "2.2.
|
|
71
|
-
"@visulima/path": "1.1.
|
|
70
|
+
"@visulima/fs": "2.2.2",
|
|
71
|
+
"@visulima/path": "1.1.1",
|
|
72
72
|
"jsonc-parser": "^3.3.1",
|
|
73
73
|
"resolve-pkg-maps": "^1.0.0"
|
|
74
74
|
},
|
|
@@ -78,14 +78,15 @@
|
|
|
78
78
|
"@anolilab/semantic-release-pnpm": "1.1.3",
|
|
79
79
|
"@anolilab/semantic-release-preset": "^9.0.0",
|
|
80
80
|
"@arethetypeswrong/cli": "^0.16.4",
|
|
81
|
-
"@babel/core": "^7.25.
|
|
81
|
+
"@babel/core": "^7.25.9",
|
|
82
|
+
"@ckeditor/typedoc-plugins": "43.0.0",
|
|
82
83
|
"@rushstack/eslint-plugin-security": "^0.8.3",
|
|
83
|
-
"@secretlint/secretlint-rule-preset-recommend": "^
|
|
84
|
+
"@secretlint/secretlint-rule-preset-recommend": "^9.0.0",
|
|
84
85
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
85
86
|
"@types/node": "18.18.14",
|
|
86
|
-
"@visulima/packem": "1.0
|
|
87
|
-
"@vitest/coverage-v8": "^2.1.
|
|
88
|
-
"@vitest/ui": "^2.1.
|
|
87
|
+
"@visulima/packem": "1.1.0",
|
|
88
|
+
"@vitest/coverage-v8": "^2.1.3",
|
|
89
|
+
"@vitest/ui": "^2.1.3",
|
|
89
90
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
90
91
|
"cross-env": "^7.0.3",
|
|
91
92
|
"esbuild": "0.24.0",
|
|
@@ -96,15 +97,18 @@
|
|
|
96
97
|
"eslint-plugin-mdx": "^3.1.5",
|
|
97
98
|
"eslint-plugin-vitest": "^0.4.1",
|
|
98
99
|
"eslint-plugin-vitest-globals": "^1.5.0",
|
|
99
|
-
"execa": "^9.4.
|
|
100
|
+
"execa": "^9.4.1",
|
|
100
101
|
"prettier": "^3.3.3",
|
|
101
|
-
"rimraf": "
|
|
102
|
-
"secretlint": "
|
|
103
|
-
"semantic-release": "^24.1.
|
|
102
|
+
"rimraf": "6.0.1",
|
|
103
|
+
"secretlint": "9.0.0",
|
|
104
|
+
"semantic-release": "^24.1.3",
|
|
104
105
|
"tempy": "^3.1.0",
|
|
105
106
|
"type-fest": "^4.26.1",
|
|
106
|
-
"
|
|
107
|
-
"
|
|
107
|
+
"typedoc": "0.26.10",
|
|
108
|
+
"typedoc-plugin-markdown": "4.2.9",
|
|
109
|
+
"typedoc-plugin-rename-defaults": "0.7.1",
|
|
110
|
+
"typescript": "5.6.3",
|
|
111
|
+
"vitest": "^2.1.3"
|
|
108
112
|
},
|
|
109
113
|
"engines": {
|
|
110
114
|
"node": ">=18.* <=22.*"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var $=Object.defineProperty;var b=(o,r)=>$(o,"name",{value:r,configurable:!0});import{readFileSync as j,isAccessibleSync as u,findUpSync as k}from"@visulima/fs";import{NotFoundError as U}from"@visulima/fs/error";import{join as a,resolve as C,isAbsolute as T,toNamespacedPath as J,dirname as A,relative as w,normalize as N}from"@visulima/path";import{parse as P}from"jsonc-parser";import{statSync as x}from"node:fs";import z from"node:module";import{resolveExports as B}from"resolve-pkg-maps";var M=Object.defineProperty,v=b((o,r)=>M(o,"name",{value:r,configurable:!0}),"d");const W=v(o=>P(j(o)),"readJsonc"),R=v(()=>{const{findPnpApi:o}=z;return o?.(process.cwd())},"getPnpApi"),D=v((o,r,p,t)=>{const n="resolveFromPackageJsonPath:"+o+":"+r+":"+(p?"yes":"no");if(t?.has(n))return t.get(n);const e=W(o);if(!e)return;let s=r||"tsconfig.json";if(!p&&e.exports)try{const[c]=B(e.exports,r,["require","types"]);s=c}catch{return!1}else!r&&e.tsconfig&&(s=e.tsconfig);return s=a(o,"..",s),t?.set(n,s),s},"resolveFromPackageJsonPath"),F="package.json",O="tsconfig.json",q=v((o,r,p)=>{let t=o;if(o===".."&&(t=a(t,O)),o.startsWith(".")&&(t=C(r,t)),T(t)){if(u(t)){if(x(t).isFile())return t}else if(!t.endsWith(".json")){const i=`${t}.json`;if(u(i))return i}return}const[n,...e]=o.split("/"),s=n.startsWith("@")?n+"/"+e.shift():n,c=e.join("/"),l=R();if(l){const{resolveRequest:i}=l;try{if(s===o){const f=i(a(s,F),r);if(f){const y=D(f,c,!1,p);if(y&&u(y))return y}}else{let f;try{f=i(o,r,{extensions:[".json"]})}catch{f=i(a(o,O),r)}if(f)return f}}catch{}}const d=k(i=>{const f=a(C(i),"node_modules",s);if(u(f))return a("node_modules",s)},{cwd:r,type:"directory"});if(!d||!x(d).isDirectory())return;const h=a(d,F);if(u(h)){const i=D(h,c,!1,p);if(i===!1)return;if(i&&u(i)&&x(i).isFile())return i}const m=a(d,c),I=m.endsWith(".json");if(!I){const i=m+".json";if(u(i))return i}if(u(m)){if(x(m).isDirectory()){const i=a(m,F);if(u(i)){const y=D(i,"",!0,p);if(y&&u(y))return y}const f=a(m,O);if(u(f))return f}else if(I)return m}},"resolveExtendsPath");var V=Object.defineProperty,g=b((o,r)=>V(o,"name",{value:r,configurable:!0}),"c");const _=g(o=>P(j(o)),"readJsonc"),S=g(o=>J(/^\.{1,2}(?:\/.*)?$/.test(o)?o:`./${o}`),"normalizePath"),G=g((o,r,p,t)=>{const n=q(o,r);if(!n)throw new U(`No such file or directory, for '${o}' found.`);if(p.has(n))throw new Error(`Circularity detected while resolving configuration: ${n}`);p.add(n);const e=A(n),s=E(n,t,p);delete s.references;const{compilerOptions:c}=s;if(c){const l=["baseUrl","outDir"];for(const d of l){const h=c[d];h&&(c[d]=w(r,a(e,h)).replaceAll("\\","/")||"./")}}return s.files&&(s.files=s.files.map(l=>w(r,a(e,l)))),s.include&&(s.include=s.include.map(l=>w(r,a(e,l)))),s.exclude&&(s.exclude=s.exclude.map(l=>w(r,a(e,l)))),s},"resolveExtends"),E=g((o,r,p=new Set)=>{let t;try{t=_(o)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${o}`)}if(typeof t!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${o}`);const n=A(o);if(t.compilerOptions){const{compilerOptions:e}=t;e.paths&&!e.baseUrl&&(e[H]=n)}if(t.extends){const e=Array.isArray(t.extends)?t.extends:[t.extends];delete t.extends;for(const s of e.reverse()){const c=G(s,n,new Set(p),r),l={...c,...t,compilerOptions:{...c.compilerOptions,...t.compilerOptions}};c.watchOptions&&(l.watchOptions={...c.watchOptions,...t.watchOptions}),t=l}}if(t.compilerOptions){const{compilerOptions:e}=t,s=["baseUrl","rootDir"];for(const l of s){const d=e[l];if(d){const h=C(n,d),m=w(n,h);e[l]=S(m)}}const{outDir:c}=e;c&&(Array.isArray(t.exclude)||(t.exclude=[]),t.exclude.includes(c)||t.exclude.push(c),e.outDir=S(c)),r?.tscCompatible&&e.module==="node16"&&(e.allowSyntheticDefaultImports=e.allowSyntheticDefaultImports??!0,e.esModuleInterop=e.esModuleInterop??!0,e.moduleDetection=e.moduleDetection??"force",e.moduleResolution=e.moduleResolution??"node16",e.target=e.target??"es2022",e.useDefineForClassFields=e.useDefineForClassFields??!0),r?.tscCompatible&&e.strict&&(e.noImplicitAny=e.noImplicitAny??!0,e.noImplicitThis=e.noImplicitThis??!0,e.strictNullChecks=e.strictNullChecks??!0,e.strictFunctionTypes=e.strictFunctionTypes??!0,e.strictBindCallApply=e.strictBindCallApply??!0,e.strictPropertyInitialization=e.strictPropertyInitialization??!0,e.alwaysStrict=e.alwaysStrict??!0,e.useUnknownInCatchVariables=e.useUnknownInCatchVariables??!0),r?.tscCompatible&&e.isolatedModules&&(e.preserveConstEnums=e.preserveConstEnums??!0),r?.tscCompatible&&e.esModuleInterop&&(e.allowSyntheticDefaultImports=e.allowSyntheticDefaultImports??!0),r?.tscCompatible&&e.target==="esnext"&&(e.useDefineForClassFields=e.useDefineForClassFields??!0)}else t.compilerOptions={};if(t.files&&(t.files=t.files.map(e=>S(e))),t.include&&(t.include=t.include.map(e=>N(e))),t.watchOptions){const{watchOptions:e}=t;e.excludeDirectories&&(e.excludeDirectories=e.excludeDirectories.map(s=>C(n,s)))}return t},"internalParseTsConfig"),H=Symbol("implicitBaseUrl"),oe=g((o,r)=>E(o,r),"readTsConfig");export{H as implicitBaseUrlSymbol,oe as readTsConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var P=Object.defineProperty;var S=(s,i)=>P(s,"name",{value:i,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@visulima/fs"),I=require("@visulima/fs/error"),o=require("@visulima/path"),D=require("jsonc-parser"),j=require("node:fs"),E=require("node:module"),k=require("resolve-pkg-maps"),q=S(s=>s&&typeof s=="object"&&"default"in s?s.default:s,"_interopDefaultCompat"),T=q(E);var U=Object.defineProperty,v=S((s,i)=>U(s,"name",{value:i,configurable:!0}),"d");const $=v(s=>D.parse(u.readFileSync(s)),"readJsonc"),M=v(()=>{const{findPnpApi:s}=T;return s?.(process.cwd())},"getPnpApi"),w=v((s,i,f,t)=>{const r="resolveFromPackageJsonPath:"+s+":"+i+":"+(f?"yes":"no");if(t?.has(r))return t.get(r);const e=$(s);if(!e)return;let n=i||"tsconfig.json";if(!f&&e.exports)try{const[l]=k.resolveExports(e.exports,i,["require","types"]);n=l}catch{return!1}else!i&&e.tsconfig&&(n=e.tsconfig);return n=o.join(s,"..",n),t?.set(r,n),n},"resolveFromPackageJsonPath"),g="package.json",C="tsconfig.json",_=v((s,i,f)=>{let t=s;if(s===".."&&(t=o.join(t,C)),s.startsWith(".")&&(t=o.resolve(i,t)),o.isAbsolute(t)){if(u.isAccessibleSync(t)){if(j.statSync(t).isFile())return t}else if(!t.endsWith(".json")){const c=`${t}.json`;if(u.isAccessibleSync(c))return c}return}const[r,...e]=s.split("/"),n=r.startsWith("@")?r+"/"+e.shift():r,l=e.join("/"),a=M();if(a){const{resolveRequest:c}=a;try{if(n===s){const p=c(o.join(n,g),i);if(p){const h=w(p,l,!1,f);if(h&&u.isAccessibleSync(h))return h}}else{let p;try{p=c(s,i,{extensions:[".json"]})}catch{p=c(o.join(s,C),i)}if(p)return p}}catch{}}const d=u.findUpSync(c=>{const p=o.join(o.resolve(c),"node_modules",n);if(u.isAccessibleSync(p))return o.join("node_modules",n)},{cwd:i,type:"directory"});if(!d||!j.statSync(d).isDirectory())return;const m=o.join(d,g);if(u.isAccessibleSync(m)){const c=w(m,l,!1,f);if(c===!1)return;if(c&&u.isAccessibleSync(c)&&j.statSync(c).isFile())return c}const y=o.join(d,l),x=y.endsWith(".json");if(!x){const c=y+".json";if(u.isAccessibleSync(c))return c}if(u.isAccessibleSync(y)){if(j.statSync(y).isDirectory()){const c=o.join(y,g);if(u.isAccessibleSync(c)){const h=w(c,"",!0,f);if(h&&u.isAccessibleSync(h))return h}const p=o.join(y,C);if(u.isAccessibleSync(p))return p}else if(x)return y}},"resolveExtendsPath");var B=Object.defineProperty,b=S((s,i)=>B(s,"name",{value:i,configurable:!0}),"c");const J=b(s=>D.parse(u.readFileSync(s)),"readJsonc"),A=b(s=>o.toNamespacedPath(/^\.{1,2}(?:\/.*)?$/.test(s)?s:`./${s}`),"normalizePath"),N=b((s,i,f,t)=>{const r=_(s,i);if(!r)throw new I.NotFoundError(`No such file or directory, for '${s}' found.`);if(f.has(r))throw new Error(`Circularity detected while resolving configuration: ${r}`);f.add(r);const e=o.dirname(r),n=F(r,t,f);delete n.references;const{compilerOptions:l}=n;if(l){const a=["baseUrl","outDir"];for(const d of a){const m=l[d];m&&(l[d]=o.relative(i,o.join(e,m)).replaceAll("\\","/")||"./")}}return n.files&&(n.files=n.files.map(a=>o.relative(i,o.join(e,a)))),n.include&&(n.include=n.include.map(a=>o.relative(i,o.join(e,a)))),n.exclude&&(n.exclude=n.exclude.map(a=>o.relative(i,o.join(e,a)))),n},"resolveExtends"),F=b((s,i,f=new Set)=>{let t;try{t=J(s)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${s}`)}if(typeof t!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${s}`);const r=o.dirname(s);if(t.compilerOptions){const{compilerOptions:e}=t;e.paths&&!e.baseUrl&&(e[O]=r)}if(t.extends){const e=Array.isArray(t.extends)?t.extends:[t.extends];delete t.extends;for(const n of e.reverse()){const l=N(n,r,new Set(f),i),a={...l,...t,compilerOptions:{...l.compilerOptions,...t.compilerOptions}};l.watchOptions&&(a.watchOptions={...l.watchOptions,...t.watchOptions}),t=a}}if(t.compilerOptions){const{compilerOptions:e}=t,n=["baseUrl","rootDir"];for(const a of n){const d=e[a];if(d){const m=o.resolve(r,d),y=o.relative(r,m);e[a]=A(y)}}const{outDir:l}=e;l&&(Array.isArray(t.exclude)||(t.exclude=[]),t.exclude.includes(l)||t.exclude.push(l),e.outDir=A(l)),i?.tscCompatible&&e.module==="node16"&&(e.allowSyntheticDefaultImports=e.allowSyntheticDefaultImports??!0,e.esModuleInterop=e.esModuleInterop??!0,e.moduleDetection=e.moduleDetection??"force",e.moduleResolution=e.moduleResolution??"node16",e.target=e.target??"es2022",e.useDefineForClassFields=e.useDefineForClassFields??!0),i?.tscCompatible&&e.strict&&(e.noImplicitAny=e.noImplicitAny??!0,e.noImplicitThis=e.noImplicitThis??!0,e.strictNullChecks=e.strictNullChecks??!0,e.strictFunctionTypes=e.strictFunctionTypes??!0,e.strictBindCallApply=e.strictBindCallApply??!0,e.strictPropertyInitialization=e.strictPropertyInitialization??!0,e.alwaysStrict=e.alwaysStrict??!0,e.useUnknownInCatchVariables=e.useUnknownInCatchVariables??!0),i?.tscCompatible&&e.isolatedModules&&(e.preserveConstEnums=e.preserveConstEnums??!0),i?.tscCompatible&&e.esModuleInterop&&(e.allowSyntheticDefaultImports=e.allowSyntheticDefaultImports??!0),i?.tscCompatible&&e.target==="esnext"&&(e.useDefineForClassFields=e.useDefineForClassFields??!0)}else t.compilerOptions={};if(t.files&&(t.files=t.files.map(e=>A(e))),t.include&&(t.include=t.include.map(e=>o.normalize(e))),t.watchOptions){const{watchOptions:e}=t;e.excludeDirectories&&(e.excludeDirectories=e.excludeDirectories.map(n=>o.resolve(r,n)))}return t},"internalParseTsConfig"),O=Symbol("implicitBaseUrl"),z=b((s,i)=>F(s,i),"readTsConfig");exports.implicitBaseUrlSymbol=O;exports.readTsConfig=z;
|