From f7b709165884c183e2a2bb2eac5f22b966b00173 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Mon, 29 Nov 2021 19:22:01 +0000 Subject: [PATCH 1/4] fix typo EmitDtsConig -> EmitDtsConfig --- packages/svelte2tsx/index.d.ts | 4 ++-- packages/svelte2tsx/src/emitDts.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/svelte2tsx/index.d.ts b/packages/svelte2tsx/index.d.ts index b012d1ab4..5bcb797a2 100644 --- a/packages/svelte2tsx/index.d.ts +++ b/packages/svelte2tsx/index.d.ts @@ -55,7 +55,7 @@ export function svelte2tsx( } ): SvelteCompiledToTsx -export interface EmitDtsConig { +export interface EmitDtsConfig { /** * Where to output the declaration files */ @@ -80,4 +80,4 @@ export interface EmitDtsConig { * Note: Handwritten `d.ts` files are not copied over; TypeScript does not * touch these files. */ -export function emitDts(config: EmitDtsConig): Promise; +export function emitDts(config: EmitDtsConfig): Promise; diff --git a/packages/svelte2tsx/src/emitDts.ts b/packages/svelte2tsx/src/emitDts.ts index 81817918b..bf092b1eb 100644 --- a/packages/svelte2tsx/src/emitDts.ts +++ b/packages/svelte2tsx/src/emitDts.ts @@ -2,13 +2,13 @@ import * as path from 'path'; import ts from 'typescript'; import { svelte2tsx } from './svelte2tsx'; -export interface EmitDtsConig { +export interface EmitDtsConfig { declarationDir: string; svelteShimsPath: string; libRoot?: string; } -export async function emitDts(config: EmitDtsConig) { +export async function emitDts(config: EmitDtsConfig) { const svelteMap = await createSvelteMap(config); const { options, filenames } = loadTsconfig(config, svelteMap); const host = await createTsCompilerHost(options, svelteMap); @@ -16,7 +16,7 @@ export async function emitDts(config: EmitDtsConig) { program.emit(); } -function loadTsconfig(config: EmitDtsConig, svelteMap: SvelteMap) { +function loadTsconfig(config: EmitDtsConfig, svelteMap: SvelteMap) { const libRoot = config.libRoot || process.cwd(); const jsconfigFile = ts.findConfigFile(libRoot, ts.sys.fileExists, 'jsconfig.json'); From de5a7793b364487c8444402befd76087f71bc67d Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Tue, 30 Nov 2021 09:59:42 +0000 Subject: [PATCH 2/4] make rename non-breaking --- packages/svelte2tsx/src/emitDts.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/svelte2tsx/src/emitDts.ts b/packages/svelte2tsx/src/emitDts.ts index bf092b1eb..9228abb29 100644 --- a/packages/svelte2tsx/src/emitDts.ts +++ b/packages/svelte2tsx/src/emitDts.ts @@ -8,6 +8,10 @@ export interface EmitDtsConfig { libRoot?: string; } +// to make typo fix non-breaking, continue to export the old name but mark it as deprecated +/**@deprecated*/ +export interface EmitDtsConig extends EmitDtsConfig {} + export async function emitDts(config: EmitDtsConfig) { const svelteMap = await createSvelteMap(config); const { options, filenames } = loadTsconfig(config, svelteMap); From c8683a13eca9da1fb8aead4bd1d4a8d3aed17594 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Tue, 30 Nov 2021 10:21:38 +0000 Subject: [PATCH 3/4] disable @typescript-eslint/no-empty-interface for legacy line --- packages/svelte2tsx/src/emitDts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/svelte2tsx/src/emitDts.ts b/packages/svelte2tsx/src/emitDts.ts index 9228abb29..2df932d01 100644 --- a/packages/svelte2tsx/src/emitDts.ts +++ b/packages/svelte2tsx/src/emitDts.ts @@ -10,7 +10,7 @@ export interface EmitDtsConfig { // to make typo fix non-breaking, continue to export the old name but mark it as deprecated /**@deprecated*/ -export interface EmitDtsConig extends EmitDtsConfig {} +export interface EmitDtsConig extends EmitDtsConfig {} /* eslint-disable-line @typescript-eslint/no-empty-interface */ export async function emitDts(config: EmitDtsConfig) { const svelteMap = await createSvelteMap(config); From 1b4287a9205e6e4f113bb7f38cdc3f77b5127ff9 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Tue, 30 Nov 2021 12:54:28 +0000 Subject: [PATCH 4/4] move legacy EmitDtsConig to svelte2tsx/index.d.ts --- packages/svelte2tsx/index.d.ts | 4 ++++ packages/svelte2tsx/src/emitDts.ts | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/svelte2tsx/index.d.ts b/packages/svelte2tsx/index.d.ts index 5bcb797a2..1ec728fb5 100644 --- a/packages/svelte2tsx/index.d.ts +++ b/packages/svelte2tsx/index.d.ts @@ -74,6 +74,10 @@ export interface EmitDtsConfig { libRoot?: string; } +// to make typo fix non-breaking, continue to export the old name but mark it as deprecated +/**@deprecated*/ +export interface EmitDtsConig extends EmitDtsConfig {} /* eslint-disable-line @typescript-eslint/no-empty-interface */ + /** * Searches for a jsconfig or tsconfig starting at `root` and emits d.ts files * into `declarationDir` using the ambient file from `svelteShimsPath`. diff --git a/packages/svelte2tsx/src/emitDts.ts b/packages/svelte2tsx/src/emitDts.ts index 2df932d01..bf092b1eb 100644 --- a/packages/svelte2tsx/src/emitDts.ts +++ b/packages/svelte2tsx/src/emitDts.ts @@ -8,10 +8,6 @@ export interface EmitDtsConfig { libRoot?: string; } -// to make typo fix non-breaking, continue to export the old name but mark it as deprecated -/**@deprecated*/ -export interface EmitDtsConig extends EmitDtsConfig {} /* eslint-disable-line @typescript-eslint/no-empty-interface */ - export async function emitDts(config: EmitDtsConfig) { const svelteMap = await createSvelteMap(config); const { options, filenames } = loadTsconfig(config, svelteMap);