Skip to content

Commit 4f4c25d

Browse files
authored
fix(typescript): bump TypeScript version (#818)
* chore(typescript): bump TypeScript version * Revert "feat(typescript): error when no tsconfig and no rootDir (#794)" This reverts commit cbfd779.
1 parent f1ad31f commit 4f4c25d

File tree

7 files changed

+27
-91
lines changed

7 files changed

+27
-91
lines changed

β€Žpackages/typescript/package.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"@types/node": "^10.0.0",
6262
"buble": "^0.20.0",
6363
"rollup": "^2.14.0",
64-
"typescript": "^4.1.2"
64+
"typescript": "^4.2.2"
6565
},
6666
"types": "types/index.d.ts"
6767
}

β€Žpackages/typescript/src/preflight.tsβ€Ž

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ ${pluginName}: Rollup requires that TypeScript produces ES Modules. Unfortunatel
1717
"module" other than "esnext". Unless you know what you're doing, please change "module" to "esnext"
1818
in the target tsconfig.json file or plugin options.`.replace(/\n/g, '');
1919

20-
const rootDirErrorMessage = `${pluginName}: The "rootDir" or "rootDirs" option is required when the "tsconfig" option is not specified and "declaration" is "true".`;
21-
2220
const tsLibErrorMessage = `${pluginName}: Could not find module 'tslib', which is required by this plugin. Is it installed?`;
2321

2422
let undef;
@@ -30,11 +28,6 @@ export const preflight = ({ config, context, rollupOptions, tslib }: PreflightOp
3028
context.warn(moduleErrorMessage);
3129
}
3230

33-
const { options } = config;
34-
if (options.declaration && !options.configFilePath && !options.rootDir && !options.rootDirs) {
35-
context.error(rootDirErrorMessage);
36-
}
37-
3831
if (!rollupOptions.preserveModules && tslib === null) {
3932
context.error(tsLibErrorMessage);
4033
}

β€Žpackages/typescript/test/snapshots/tsconfig.ts.mdβ€Ž

Lines changed: 0 additions & 25 deletions
This file was deleted.
-409 Bytes
Binary file not shown.

β€Žpackages/typescript/test/test.jsβ€Ž

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,11 +1020,7 @@ test.serial('picks up on newly included typescript files in watch mode', async (
10201020
t.true(usage, 'should contain usage');
10211021
});
10221022

1023-
// TODO: upgrade TypeScript when there is a release containing the fix for this issue
1024-
// https://github.com/microsoft/TypeScript/pull/41811. Then enable this test
1025-
// More details at https://github.com/rollup/plugins/issues/287. This fails with the message:
1026-
// Unexpected token (Note that you need plugins to import files that are not JavaScript)
1027-
test.serial.skip('works when code is in src directory', async (t) => {
1023+
test.serial('works when code is in src directory', async (t) => {
10281024
const bundle = await rollup({
10291025
input: 'fixtures/src-dir/src/index.ts',
10301026
output: [

β€Žpackages/typescript/test/tsconfig.tsβ€Ž

Lines changed: 0 additions & 50 deletions
This file was deleted.

β€Žpnpm-lock.yamlβ€Ž

Lines changed: 25 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)