mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
Remove tsconfig-resolver from repo (#11642)
This commit is contained in:
parent
ea82b03cd6
commit
ca45fd93c1
3 changed files with 14 additions and 56 deletions
|
@ -5940,9 +5940,9 @@ importers:
|
||||||
execa:
|
execa:
|
||||||
specifier: ^8.0.1
|
specifier: ^8.0.1
|
||||||
version: 8.0.1
|
version: 8.0.1
|
||||||
tsconfig-resolver:
|
tsconfck:
|
||||||
specifier: ^3.0.1
|
specifier: ^3.1.1
|
||||||
version: 3.0.1
|
version: 3.1.1(typescript@5.5.4)
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
|
@ -7370,9 +7370,6 @@ packages:
|
||||||
'@types/js-yaml@4.0.9':
|
'@types/js-yaml@4.0.9':
|
||||||
resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==}
|
resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==}
|
||||||
|
|
||||||
'@types/json5@0.0.30':
|
|
||||||
resolution: {integrity: sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA==}
|
|
||||||
|
|
||||||
'@types/katex@0.16.7':
|
'@types/katex@0.16.7':
|
||||||
resolution: {integrity: sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==}
|
resolution: {integrity: sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==}
|
||||||
|
|
||||||
|
@ -7442,9 +7439,6 @@ packages:
|
||||||
'@types/relateurl@0.2.33':
|
'@types/relateurl@0.2.33':
|
||||||
resolution: {integrity: sha512-bTQCKsVbIdzLqZhLkF5fcJQreE4y1ro4DIyVrlDNSCJRRwHhB8Z+4zXXa8jN6eDvc2HbRsEYgbvrnGvi54EpSw==}
|
resolution: {integrity: sha512-bTQCKsVbIdzLqZhLkF5fcJQreE4y1ro4DIyVrlDNSCJRRwHhB8Z+4zXXa8jN6eDvc2HbRsEYgbvrnGvi54EpSw==}
|
||||||
|
|
||||||
'@types/resolve@1.20.6':
|
|
||||||
resolution: {integrity: sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==}
|
|
||||||
|
|
||||||
'@types/sax@1.2.7':
|
'@types/sax@1.2.7':
|
||||||
resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==}
|
resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==}
|
||||||
|
|
||||||
|
@ -10844,10 +10838,6 @@ packages:
|
||||||
resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
|
resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
|
||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
|
|
||||||
strip-bom@4.0.0:
|
|
||||||
resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==}
|
|
||||||
engines: {node: '>=8'}
|
|
||||||
|
|
||||||
strip-final-newline@3.0.0:
|
strip-final-newline@3.0.0:
|
||||||
resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==}
|
resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
|
@ -11052,9 +11042,6 @@ packages:
|
||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
tsconfig-resolver@3.0.1:
|
|
||||||
resolution: {integrity: sha512-ZHqlstlQF449v8glscGRXzL6l2dZvASPCdXJRWG4gHEZlUVx2Jtmr+a2zeVG4LCsKhDXKRj5R3h0C/98UcVAQg==}
|
|
||||||
|
|
||||||
tslib@2.1.0:
|
tslib@2.1.0:
|
||||||
resolution: {integrity: sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==}
|
resolution: {integrity: sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==}
|
||||||
|
|
||||||
|
@ -11099,10 +11086,6 @@ packages:
|
||||||
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
|
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
|
||||||
engines: {node: '>= 0.8.0'}
|
engines: {node: '>= 0.8.0'}
|
||||||
|
|
||||||
type-fest@0.13.1:
|
|
||||||
resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==}
|
|
||||||
engines: {node: '>=10'}
|
|
||||||
|
|
||||||
type-fest@1.4.0:
|
type-fest@1.4.0:
|
||||||
resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==}
|
resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
@ -13230,8 +13213,6 @@ snapshots:
|
||||||
|
|
||||||
'@types/js-yaml@4.0.9': {}
|
'@types/js-yaml@4.0.9': {}
|
||||||
|
|
||||||
'@types/json5@0.0.30': {}
|
|
||||||
|
|
||||||
'@types/katex@0.16.7': {}
|
'@types/katex@0.16.7': {}
|
||||||
|
|
||||||
'@types/linkify-it@5.0.0': {}
|
'@types/linkify-it@5.0.0': {}
|
||||||
|
@ -13299,8 +13280,6 @@ snapshots:
|
||||||
|
|
||||||
'@types/relateurl@0.2.33': {}
|
'@types/relateurl@0.2.33': {}
|
||||||
|
|
||||||
'@types/resolve@1.20.6': {}
|
|
||||||
|
|
||||||
'@types/sax@1.2.7':
|
'@types/sax@1.2.7':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 18.19.31
|
'@types/node': 18.19.31
|
||||||
|
@ -17367,8 +17346,6 @@ snapshots:
|
||||||
|
|
||||||
strip-bom@3.0.0: {}
|
strip-bom@3.0.0: {}
|
||||||
|
|
||||||
strip-bom@4.0.0: {}
|
|
||||||
|
|
||||||
strip-final-newline@3.0.0: {}
|
strip-final-newline@3.0.0: {}
|
||||||
|
|
||||||
strip-json-comments@3.1.1: {}
|
strip-json-comments@3.1.1: {}
|
||||||
|
@ -17592,15 +17569,6 @@ snapshots:
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
typescript: 5.5.4
|
typescript: 5.5.4
|
||||||
|
|
||||||
tsconfig-resolver@3.0.1:
|
|
||||||
dependencies:
|
|
||||||
'@types/json5': 0.0.30
|
|
||||||
'@types/resolve': 1.20.6
|
|
||||||
json5: 2.2.3
|
|
||||||
resolve: 1.22.8
|
|
||||||
strip-bom: 4.0.0
|
|
||||||
type-fest: 0.13.1
|
|
||||||
|
|
||||||
tslib@2.1.0: {}
|
tslib@2.1.0: {}
|
||||||
|
|
||||||
tslib@2.6.2: {}
|
tslib@2.6.2: {}
|
||||||
|
@ -17636,8 +17604,6 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
prelude-ls: 1.2.1
|
prelude-ls: 1.2.1
|
||||||
|
|
||||||
type-fest@0.13.1: {}
|
|
||||||
|
|
||||||
type-fest@1.4.0: {}
|
type-fest@1.4.0: {}
|
||||||
|
|
||||||
type-fest@2.19.0: {}
|
type-fest@2.19.0: {}
|
||||||
|
|
|
@ -22,6 +22,6 @@
|
||||||
"del": "^7.1.0",
|
"del": "^7.1.0",
|
||||||
"esbuild-plugin-copy": "^2.1.1",
|
"esbuild-plugin-copy": "^2.1.1",
|
||||||
"execa": "^8.0.1",
|
"execa": "^8.0.1",
|
||||||
"tsconfig-resolver": "^3.0.1"
|
"tsconfck": "^3.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { spawn } from 'node:child_process';
|
||||||
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import pLimit from 'p-limit';
|
import pLimit from 'p-limit';
|
||||||
import { tsconfigResolverSync } from 'tsconfig-resolver';
|
import { toJson } from 'tsconfck';
|
||||||
|
|
||||||
const skippedExamples = ['toolbar-app', 'component', 'server-islands'];
|
const skippedExamples = ['toolbar-app', 'component', 'server-islands'];
|
||||||
|
|
||||||
|
@ -70,25 +70,17 @@ function checkExamples() {
|
||||||
*/
|
*/
|
||||||
function prepareExample(examplePath) {
|
function prepareExample(examplePath) {
|
||||||
const tsconfigPath = path.join('./examples/', examplePath, 'tsconfig.json');
|
const tsconfigPath = path.join('./examples/', examplePath, 'tsconfig.json');
|
||||||
const tsconfig = tsconfigResolverSync({ filePath: tsconfigPath, cache: false });
|
if (!existsSync(tsconfigPath)) return
|
||||||
let originalConfig = undefined;
|
|
||||||
|
|
||||||
if (tsconfig.exists) {
|
const originalConfig = readFileSync(tsconfigPath, 'utf-8');
|
||||||
tsconfig.config.extends = 'astro/tsconfigs/strictest';
|
const tsconfig = JSON.parse(toJson(originalConfig));
|
||||||
originalConfig = readFileSync(tsconfigPath).toString();
|
|
||||||
|
|
||||||
if (!tsconfig.config.compilerOptions) {
|
// Swap to strictest config to make sure it also passes
|
||||||
tsconfig.config.compilerOptions = {};
|
tsconfig.extends = 'astro/tsconfigs/strictest';
|
||||||
}
|
tsconfig.compilerOptions ??= {}
|
||||||
|
tsconfig.compilerOptions.types = tsconfig.compilerOptions.types ?? []; // Speeds up tests
|
||||||
|
|
||||||
tsconfig.config.compilerOptions = Object.assign(tsconfig.config.compilerOptions, {
|
writeFileSync(tsconfigPath, JSON.stringify(tsconfig));
|
||||||
types: tsconfig.config.compilerOptions.types ?? [], // Speeds up tests
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tsconfig.config) {
|
|
||||||
writeFileSync(tsconfigPath, JSON.stringify(tsconfig.config));
|
|
||||||
}
|
|
||||||
|
|
||||||
return originalConfig;
|
return originalConfig;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue