Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "tsconfck", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "A utility to work with tsconfig.json without typescript", | ||
@@ -52,7 +52,7 @@ "license": "MIT", | ||
"@tsconfig/node18": "^18.2.2", | ||
"@vitest/coverage-v8": "^1.1.1", | ||
"esbuild": "^0.19.11", | ||
"@vitest/coverage-v8": "^1.2.2", | ||
"esbuild": "^0.20.0", | ||
"tiny-glob": "^0.2.9", | ||
"typescript": "^5.3.3", | ||
"vitest": "^1.1.1" | ||
"vitest": "^1.2.2" | ||
}, | ||
@@ -59,0 +59,0 @@ "engines": { |
@@ -23,5 +23,5 @@ # tsconfck | ||
- [x] completely async and optimized (it's [fast](https://github.com/dominikg/tsconfck/blob/main/docs/benchmark.md)) | ||
- [x] tiny [4.7KB gzip](https://pkg-size.dev/tsconfck@%5E3.0.0-next.0) | ||
- [x] tiny [4.8KB gzip](https://pkg-size.dev/tsconfck) | ||
- [x] unbundled esm js, no sourcemaps needed | ||
- [x] [types](https://github.com/dominikg/tsconfck/blob/main//packages/tsconfck/types/index.d.ts) generated with [dts-buddy](https://github.com/Rich-Harris/dts-buddy) | ||
- [x] [types](https://github.com/dominikg/tsconfck/blob/main/packages/tsconfck/types/index.d.ts) generated with [dts-buddy](https://github.com/Rich-Harris/dts-buddy) | ||
@@ -28,0 +28,0 @@ # Users |
@@ -32,15 +32,3 @@ import path from 'node:path'; | ||
if (cache?.hasParseResult(filename)) { | ||
const result = await cache.getParseResult(filename); | ||
if ( | ||
(result.tsconfig.extends && !result.extended) || | ||
(result.tsconfig.references && !result.referenced) | ||
) { | ||
const promise = Promise.all([ | ||
parseExtends(result, cache), | ||
parseReferences(result, options) | ||
]).then(() => result); | ||
cache.setParseResult(filename, promise); | ||
await promise; | ||
} | ||
return result; | ||
return getParsedDeep(filename, cache, options); | ||
} | ||
@@ -63,3 +51,3 @@ const { | ||
if (filename !== tsconfigFile && cache?.hasParseResult(tsconfigFile)) { | ||
result = await cache.getParseResult(tsconfigFile); | ||
result = await getParsedDeep(tsconfigFile, cache, options); | ||
} else { | ||
@@ -77,3 +65,26 @@ result = await parseFile(tsconfigFile, cache, filename === tsconfigFile); | ||
/** | ||
* ensure extends and references are parsed | ||
* | ||
* @param {string} filename - cached file | ||
* @param {import('./cache.js').TSConfckCache} cache - cache | ||
* @param {import('./public.d.ts').TSConfckParseOptions} options - options | ||
*/ | ||
async function getParsedDeep(filename, cache, options) { | ||
const result = await cache.getParseResult(filename); | ||
if ( | ||
(result.tsconfig.extends && !result.extended) || | ||
(result.tsconfig.references && !result.referenced) | ||
) { | ||
const promise = Promise.all([ | ||
parseExtends(result, cache), | ||
parseReferences(result, options) | ||
]).then(() => result); | ||
cache.setParseResult(filename, promise); | ||
return promise; | ||
} | ||
return result; | ||
} | ||
/** | ||
* | ||
* @param {string} tsconfigFile - path to tsconfig file | ||
@@ -80,0 +91,0 @@ * @param {import('./cache.js').TSConfckCache} [cache] - cache |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66771
1839