Generated module conversion step - stripNamespaces

This step converts each file into an exported module by hoisting the namespace bodies into the global scope and transferring internal markers down onto declarations as needed.

The namespaces are reconstructed as "barrel"-style modules, which are identical to the old namespace objects in structure. These reconstructed namespaces are then imported in the newly module-ified files, making existing expressions like "ts." valid.
This commit is contained in:
Jake Bailey
2022-11-07 13:32:03 -08:00
parent 9a0b85ce2a
commit b6c0538826
588 changed files with 4389 additions and 1482 deletions

View File

@@ -0,0 +1,4 @@
/* Generated file to emulate the ts namespace. */
export * from "../../compiler/_namespaces/ts";
export * from "../executeCommandLine";

View File

@@ -1,4 +1,5 @@
namespace ts {
import * as ts from "./_namespaces/ts";
interface Statistic {
name: string;
value: number;
@@ -1207,4 +1208,3 @@ function writeConfigFile(
return;
}
}

View File

@@ -1,7 +1,7 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"outFile": "../../built/local/executeCommandLine.js"
"outDir": "../../built/local"
},
"references": [
@@ -9,6 +9,7 @@
],
"files": [
"executeCommandLine.ts"
"executeCommandLine.ts",
"_namespaces/ts.ts"
]
}

View File

@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outFile": "../../built/local/executeCommandLine.release.js",
"outDir": "../../built/local/release",
"removeComments": true,
"preserveConstEnums": false
},