From edf238fb538041f0f7881f818e47b8f01741907b Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:26:32 -0800 Subject: [PATCH] [experiment] make tsc use the public API --- Herebyfile.mjs | 25 +++++++++++++------------ src/tsc/_namespaces/ts.ts | 4 +--- src/tsc/tsconfig.json | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Herebyfile.mjs b/Herebyfile.mjs index 8447834a6338a..8e3abda1a9741 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -383,18 +383,6 @@ function entrypointBuildTask(options) { return { build, bundle, shim, main, watch }; } -const { main: tsc, watch: watchTsc } = entrypointBuildTask({ - name: "tsc", - description: "Builds the command-line compiler", - buildDeps: [generateDiagnostics], - project: "src/tsc", - srcEntrypoint: "./src/tsc/tsc.ts", - builtEntrypoint: "./built/local/tsc/tsc.js", - output: "./built/local/tsc.js", - mainDeps: [generateLibs], -}); -export { tsc, watchTsc }; - const { main: services, build: buildServices, watch: watchServices } = entrypointBuildTask({ name: "services", description: "Builds the typescript.js library", @@ -408,6 +396,19 @@ const { main: services, build: buildServices, watch: watchServices } = entrypoin }); export { services, watchServices }; +const { main: tsc, watch: watchTsc } = entrypointBuildTask({ + name: "tsc", + description: "Builds the command-line compiler", + buildDeps: [generateDiagnostics], + project: "src/tsc", + srcEntrypoint: "./src/tsc/tsc.ts", + builtEntrypoint: "./built/local/tsc/tsc.js", + output: "./built/local/tsc.js", + mainDeps: [generateLibs, services], + bundlerOptions: { usePublicAPI: true }, +}); +export { tsc, watchTsc }; + export const dtsServices = task({ name: "dts-services", description: "Bundles typescript.d.ts", diff --git a/src/tsc/_namespaces/ts.ts b/src/tsc/_namespaces/ts.ts index b9fd7c710ab69..205e6849694b0 100644 --- a/src/tsc/_namespaces/ts.ts +++ b/src/tsc/_namespaces/ts.ts @@ -1,3 +1 @@ -/* Generated file to emulate the ts namespace. */ - -export * from "../../compiler/_namespaces/ts"; +export * from "../../typescript/typescript"; diff --git a/src/tsc/tsconfig.json b/src/tsc/tsconfig.json index e0e98fac65db6..7d54c64c1dc78 100644 --- a/src/tsc/tsconfig.json +++ b/src/tsc/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { }, "references": [ - { "path": "../compiler" } + { "path": "../typescript" } ], "include": ["**/*"] }