diff --git a/src/compiler/build/watch-build.ts b/src/compiler/build/watch-build.ts index 5a96de55109..0452b3b7e7b 100644 --- a/src/compiler/build/watch-build.ts +++ b/src/compiler/build/watch-build.ts @@ -147,7 +147,7 @@ export const createWatchBuild = async ( } }; - config.sys.addDestory(close); + config.sys.addDestroy(close); return { start, diff --git a/src/compiler/sys/stencil-sys.ts b/src/compiler/sys/stencil-sys.ts index 81a69170ef9..b5a143cabbe 100644 --- a/src/compiler/sys/stencil-sys.ts +++ b/src/compiler/sys/stencil-sys.ts @@ -44,8 +44,8 @@ export const createSystem = (c?: { logger?: Logger }): CompilerSystem => { const items = new Map(); const destroys = new Set<() => Promise | void>(); - const addDestory = (cb: () => void) => destroys.add(cb); - const removeDestory = (cb: () => void) => destroys.delete(cb); + const addDestroy = (cb: () => void) => destroys.add(cb); + const removeDestroy = (cb: () => void) => destroys.delete(cb); const events = buildEvents(); const hardwareConcurrency = (IS_BROWSER_ENV && navigator.hardwareConcurrency) || 1; @@ -407,7 +407,7 @@ export const createSystem = (c?: { logger?: Logger }): CompilerSystem => { } }; - addDestory(close); + addDestroy(close); if (item) { item.isDirectory = true; @@ -427,7 +427,7 @@ export const createSystem = (c?: { logger?: Logger }): CompilerSystem => { return { close() { - removeDestory(close); + removeDestroy(close); close(); }, }; @@ -447,7 +447,7 @@ export const createSystem = (c?: { logger?: Logger }): CompilerSystem => { } }; - addDestory(close); + addDestroy(close); if (item) { item.isDirectory = false; @@ -467,7 +467,7 @@ export const createSystem = (c?: { logger?: Logger }): CompilerSystem => { return { close() { - removeDestory(close); + removeDestroy(close); close(); }, }; @@ -586,7 +586,7 @@ export const createSystem = (c?: { logger?: Logger }): CompilerSystem => { events, access, accessSync, - addDestory, + addDestroy, copyFile, createDir, createDirSync, @@ -611,7 +611,7 @@ export const createSystem = (c?: { logger?: Logger }): CompilerSystem => { readFileSync, realpath, realpathSync, - removeDestory, + removeDestroy, rename, fetch, resolvePath, diff --git a/src/compiler/sys/worker/sys-worker.ts b/src/compiler/sys/worker/sys-worker.ts index 1413cba4da4..c5d341195b6 100644 --- a/src/compiler/sys/worker/sys-worker.ts +++ b/src/compiler/sys/worker/sys-worker.ts @@ -12,7 +12,7 @@ export const createSysWorker = (config: ValidatedConfig) => { ) { const workerCtrl = config.sys.createWorkerController(config.maxConcurrentWorkers); - config.sys.addDestory(() => workerCtrl.destroy()); + config.sys.addDestroy(() => workerCtrl.destroy()); config.logger.debug(`create workers, maxWorkers: ${workerCtrl.maxWorkers}`); return createWorkerMainContext(workerCtrl); diff --git a/src/compiler/transpile/create-build-program.ts b/src/compiler/transpile/create-build-program.ts index 71632963086..a4ee6377f42 100644 --- a/src/compiler/transpile/create-build-program.ts +++ b/src/compiler/transpile/create-build-program.ts @@ -71,7 +71,7 @@ export const createTsBuildProgram = async ( }, }; - config.sys.addDestory(() => tsWatchSys.clearTimeout(currentBuildTimeoutId)); + config.sys.addDestroy(() => tsWatchSys.clearTimeout(currentBuildTimeoutId)); /** * Create a {@link ts.WatchCompilerHost}. A CompilerHost allows a {@link ts.Program} to interact with the diff --git a/src/compiler/transpile/create-watch-program.ts b/src/compiler/transpile/create-watch-program.ts index a7d54e77f3e..8cc544c4c3a 100644 --- a/src/compiler/transpile/create-watch-program.ts +++ b/src/compiler/transpile/create-watch-program.ts @@ -34,7 +34,7 @@ export const createTsWatchProgram = async ( }, }; - config.sys.addDestory(() => tsWatchSys.clearTimeout(timeoutId)); + config.sys.addDestroy(() => tsWatchSys.clearTimeout(timeoutId)); const tsWatchHost = ts.createWatchCompilerHost( config.tsconfig, diff --git a/src/declarations/stencil-public-compiler.ts b/src/declarations/stencil-public-compiler.ts index a846c88be63..d330b005e15 100644 --- a/src/declarations/stencil-public-compiler.ts +++ b/src/declarations/stencil-public-compiler.ts @@ -921,7 +921,7 @@ export interface CompilerSystem { /** * Add a callback which will be ran when destroy() is called. */ - addDestory(cb: () => void): void; + addDestroy(cb: () => void): void; /** * Always returns a boolean, does not throw. */ @@ -1063,7 +1063,7 @@ export interface CompilerSystem { /** * Remove a callback which will be ran when destroy() is called. */ - removeDestory(cb: () => void): void; + removeDestroy(cb: () => void): void; /** * Rename old path to new path. Does not throw. */ diff --git a/src/sys/node/node-sys.ts b/src/sys/node/node-sys.ts index e92be17ba78..593e475b7f0 100644 --- a/src/sys/node/node-sys.ts +++ b/src/sys/node/node-sys.ts @@ -76,10 +76,10 @@ export function createNodeSys(c: { process?: any } = {}): CompilerSystem { } catch (e) {} return hasAccess; }, - addDestory(cb) { + addDestroy(cb) { destroys.add(cb); }, - removeDestory(cb) { + removeDestroy(cb) { destroys.delete(cb); }, applyPrerenderGlobalPatch(opts) { @@ -453,11 +453,11 @@ export function createNodeSys(c: { process?: any } = {}): CompilerSystem { tsFileWatcher.close(); }; - sys.addDestory(close); + sys.addDestroy(close); return { close() { - sys.removeDestory(close); + sys.removeDestroy(close); tsFileWatcher.close(); }, }; @@ -481,11 +481,11 @@ export function createNodeSys(c: { process?: any } = {}): CompilerSystem { const close = () => { tsFileWatcher.close(); }; - sys.addDestory(close); + sys.addDestroy(close); return { close() { - sys.removeDestory(close); + sys.removeDestroy(close); tsFileWatcher.close(); }, };