@teambit/typescript 0.0.717 → 0.0.720
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -223,7 +223,7 @@ class TypescriptCompiler {
|
|
|
223
223
|
|
|
224
224
|
async runTscBuild(network) {
|
|
225
225
|
const rootDir = network.capsulesRootDir;
|
|
226
|
-
const capsules = network.
|
|
226
|
+
const capsules = await network.getCapsulesToCompile();
|
|
227
227
|
|
|
228
228
|
if (!capsules.length) {
|
|
229
229
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["typescript.compiler.ts"],"names":["TypescriptCompiler","constructor","id","logger","options","tsModule","distDir","distGlobPatterns","shouldCopyNonSupportedFiles","artifactName","tsconfig","compilerOptions","outDir","displayConfig","stringifyTsconfig","getDistDir","transpileFile","fileContent","isFileSupported","filePath","compilerOptionsFromTsconfig","convertCompilerOptionsFromJson","errors","length","formattedErrors","formatDiagnosticsWithColorAndContext","getFormatDiagnosticsHost","Error","sourceRoot","componentDir","rootDir","result","transpileModule","fileName","reportDiagnostics","diagnostics","formatHost","error","outputPath","replaceFileExtToJs","outputFiles","outputText","sourceMapText","push","preBuild","context","capsules","capsuleNetwork","seedersCapsules","capsuleDirs","map","capsule","path","writeTsConfig","writeTypes","writeNpmIgnore","build","componentsResults","runTscBuild","artifacts","getArtifactDefinition","postBuild","Promise","all","packageJson","PackageJsonFile","loadFromCapsuleSync","packageJsonObject","types","write","generatedBy","name","globPatterns","getDistPathBySrcPath","srcPath","fileWithJSExtIfNeeded","join","isJsAndCompile","compileJs","endsWith","isJsxAndCompile","compileJsx","network","capsulesRootDir","originalSeedersCapsules","getAllCapsuleDirs","getCanonicalFileName","p","getCurrentDirectory","getNewLine","sys","newLine","currentComponentResult","reportDiagnostic","diagnostic","errorStr","process","stdout","isTTY","formatDiagnostic","file","BitError","consoleFailure","component","reportSolutionBuilderStatus","diag","msg","messageText","debug","errorCounter","errorCount","info","host","createSolutionBuilderHost","undefined","writeProjectReferencesTsConfig","solutionBuilder","createSolutionBuilder","verbose","nextProject","longProcessLogger","createLongProcessLogger","getNextInvalidatedProject","capsulePath","project","replace","currentComponentId","getIdByPathInCapsule","logProgress","toString","getCapsule","startTime","Date","now","done","endTime","end","dirs","typePath","contents","fs","readFile","filename","basename","dir","pathExists","outputFile","NPM_IGNORE_FILE","npmIgnorePath","npmIgnoreEntriesStr","appendFile","projects","files","references","tsconfigStr","writeFile","JSON","stringify","fileExtension","extname","RegExp","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAGO,MAAMA,kBAAN,CAA6C;AAKlDC,EAAAA,WAAW,CACAC,EADA,EAEDC,MAFC,EAGDC,OAHC,EAIDC,QAJC,EAKT;AAAA;;AAAA,SAJSH,EAIT,GAJSA,EAIT;AAAA,SAHQC,MAGR,GAHQA,MAGR;AAAA,SAFQC,OAER,GAFQA,OAER;AAAA,SADQC,QACR,GADQA,QACR;AAAA;AAAA;AAAA;AAAA;AAAA,yDAYY,YAZZ;AAAA,2DAac,KAbd;AACA,SAAKC,OAAL,GAAeF,OAAO,CAACE,OAAR,IAAmB,MAAlC;AACA,SAAKC,gBAAL,GAAwBH,OAAO,CAACG,gBAAR,IAA4B,CAAE,GAAE,KAAKD,OAAQ,KAAjB,EAAwB,IAAG,KAAKA,OAAQ,uBAAxC,CAApD;AACA,SAAKE,2BAAL,GACE,OAAOJ,OAAO,CAACI,2BAAf,KAA+C,SAA/C,GAA2DJ,OAAO,CAACI,2BAAnE,GAAiG,IADnG;AAEA,SAAKC,YAAL,GAAoBL,OAAO,CAACK,YAAR,IAAwB,MAA5C;AACA,0BAAKL,OAAL,EAAaM,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vB,CAApB;AACA,UAAMkI,mBAAGe,SAAH,CAAavG,gBAAKwB,IAAL,CAAU9C,OAAV,EAAmB,eAAnB,CAAb,EAAkD4H,WAAlD,CAAN;AACD;;AAE0B,QAAbrG,aAAa,CAACoF,IAAD,EAAiB;AAC1C,UAAMiB,WAAW,GAAG,KAAK5I,iBAAL,CAAuB,KAAKV,OAAL,CAAaM,QAApC,CAApB;AACA,UAAMoD,OAAO,CAACC,GAAR,CAAY0E,IAAI,CAACvF,GAAL,CAAU8F,GAAD,IAASJ,mBAAGe,SAAH,CAAavG,gBAAKwB,IAAL,CAAUoE,GAAV,EAAe,eAAf,CAAb,EAA8CU,WAA9C,CAAlB,CAAZ,CAAN;AACD;;AAEO5I,EAAAA,iBAAiB,CAACJ,QAAD,EAAW;AAClC,WAAOkJ,IAAI,CAACC,SAAL,CAAenJ,QAAf,EAAyBwG,SAAzB,EAAoC,CAApC,CAAP;AACD;;AAEO3E,EAAAA,kBAAkB,CAACpB,QAAD,EAA2B;AACnD,QAAI,CAAC,KAAKD,eAAL,CAAqBC,QAArB,CAAL,EAAqC,OAAOA,QAAP;;AACrC,UAAM2I,aAAa,GAAG1G,gBAAK2G,OAAL,CAAa5I,QAAb,CAAtB;;AACA,WAAOA,QAAQ,CAAC0G,OAAT,CAAiB,IAAImC,MAAJ,CAAY,GAAEF,aAAc,GAA5B,CAAjB,EAAkD,KAAlD,CAAP,CAHmD,CAGc;AAClE;;AAEDG,EAAAA,OAAO,GAAG;AACR,WAAO,KAAK5J,QAAL,CAAc4J,OAArB;AACD;;AAhSiD","sourcesContent":["import { BuildContext, BuiltTaskResult, ComponentResult } from '@teambit/builder';\nimport { Compiler, TranspileFileParams, TranspileFileOutput } from '@teambit/compiler';\nimport { Network } from '@teambit/isolator';\nimport { Logger } from '@teambit/logger';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport ts from 'typescript';\nimport { BitError } from '@teambit/bit-error';\nimport PackageJsonFile from '@teambit/legacy/dist/consumer/component/package-json-file';\nimport { TypeScriptCompilerOptions } from './compiler-options';\n\nexport class TypescriptCompiler implements Compiler {\n distDir: string;\n distGlobPatterns: string[];\n shouldCopyNonSupportedFiles: boolean;\n artifactName: string;\n constructor(\n readonly id: string,\n private logger: Logger,\n private options: TypeScriptCompilerOptions,\n private tsModule: typeof ts\n ) {\n this.distDir = options.distDir || 'dist';\n this.distGlobPatterns = options.distGlobPatterns || [`${this.distDir}/**`, `!${this.distDir}/tsconfig.tsbuildinfo`];\n this.shouldCopyNonSupportedFiles =\n typeof options.shouldCopyNonSupportedFiles === 'boolean' ? options.shouldCopyNonSupportedFiles : true;\n this.artifactName = options.artifactName || 'dist';\n this.options.tsconfig ||= {};\n this.options.tsconfig.compilerOptions ||= {};\n // mutate the outDir, otherwise, on capsules, the dists might be written to a different directory and make confusion\n this.options.tsconfig.compilerOptions.outDir = this.distDir;\n }\n\n displayName = 'TypeScript';\n deleteDistDir = false;\n\n displayConfig() {\n return this.stringifyTsconfig(this.options.tsconfig);\n }\n\n getDistDir() {\n return this.distDir;\n }\n\n /**\n * compile one file on the workspace\n */\n transpileFile(fileContent: string, options: TranspileFileParams): TranspileFileOutput {\n if (!this.isFileSupported(options.filePath)) {\n return null; // file is not supported\n }\n const compilerOptionsFromTsconfig = this.tsModule.convertCompilerOptionsFromJson(\n this.options.tsconfig.compilerOptions,\n '.'\n );\n if (compilerOptionsFromTsconfig.errors.length) {\n // :TODO @david replace to a more concrete error type and put in 'exceptions' directory here.\n const formattedErrors = this.tsModule.formatDiagnosticsWithColorAndContext(\n compilerOptionsFromTsconfig.errors,\n this.getFormatDiagnosticsHost()\n );\n throw new Error(`failed parsing the tsconfig.json.\\n${formattedErrors}`);\n }\n\n const compilerOptions = compilerOptionsFromTsconfig.options;\n compilerOptions.sourceRoot = options.componentDir;\n compilerOptions.rootDir = '.';\n const result = this.tsModule.transpileModule(fileContent, {\n compilerOptions,\n fileName: options.filePath,\n reportDiagnostics: true,\n });\n\n if (result.diagnostics && result.diagnostics.length) {\n const formatHost = this.getFormatDiagnosticsHost();\n const error = this.tsModule.formatDiagnosticsWithColorAndContext(result.diagnostics, formatHost);\n\n // :TODO @david please replace to a more concrete error type and put in 'exceptions' directory here.\n throw new Error(error);\n }\n\n const outputPath = this.replaceFileExtToJs(options.filePath);\n const outputFiles = [{ outputText: result.outputText, outputPath }];\n if (result.sourceMapText) {\n outputFiles.push({\n outputText: result.sourceMapText,\n outputPath: `${outputPath}.map`,\n });\n }\n return outputFiles;\n }\n\n async preBuild(context: BuildContext) {\n const capsules = context.capsuleNetwork.seedersCapsules;\n const capsuleDirs = capsules.map((capsule) => capsule.path);\n await this.writeTsConfig(capsuleDirs);\n await this.writeTypes(capsuleDirs);\n await this.writeNpmIgnore(capsuleDirs);\n }\n\n /**\n * compile multiple components on the capsules\n */\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const componentsResults = await this.runTscBuild(context.capsuleNetwork);\n\n return {\n artifacts: this.getArtifactDefinition(),\n componentsResults,\n };\n }\n\n async postBuild(context: BuildContext) {\n await Promise.all(\n context.capsuleNetwork.seedersCapsules.map(async (capsule) => {\n const packageJson = PackageJsonFile.loadFromCapsuleSync(capsule.path);\n // the types['index.ts'] is needed only during the build to avoid errors when tsc finds the\n // same type once in the d.ts and once in the ts file.\n if (packageJson.packageJsonObject.types) {\n delete packageJson.packageJsonObject.types;\n await packageJson.write();\n }\n })\n );\n }\n\n getArtifactDefinition() {\n return [\n {\n generatedBy: this.id,\n name: this.artifactName,\n globPatterns: this.distGlobPatterns,\n },\n ];\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. index.ts => dist/index.js\n */\n getDistPathBySrcPath(srcPath: string) {\n const fileWithJSExtIfNeeded = this.replaceFileExtToJs(srcPath);\n return path.join(this.distDir, fileWithJSExtIfNeeded);\n }\n\n /**\n * whether typescript is able to compile the given path\n */\n isFileSupported(filePath: string): boolean {\n const isJsAndCompile = !!this.options.compileJs && filePath.endsWith('.js');\n const isJsxAndCompile = !!this.options.compileJsx && filePath.endsWith('.jsx');\n return (\n (filePath.endsWith('.ts') || filePath.endsWith('.tsx') || isJsAndCompile || isJsxAndCompile) &&\n !filePath.endsWith('.d.ts')\n );\n }\n\n /**\n * we have two options here:\n * 1. pass all capsules-dir at the second parameter of createSolutionBuilder and then no\n * need to write the main tsconfig.json with all the references.\n * 2. write main tsconfig.json and pass the capsules root-dir.\n * we went with option #2 because it'll be easier for users to go to the capsule-root and run\n * `tsc --build` to debug issues.\n */\n private async runTscBuild(network: Network): Promise<ComponentResult[]> {\n const rootDir = network.capsulesRootDir;\n const capsules = network.originalSeedersCapsules;\n if (!capsules.length) {\n return [];\n }\n const capsuleDirs = capsules.getAllCapsuleDirs();\n const formatHost = {\n getCanonicalFileName: (p) => p,\n getCurrentDirectory: () => '', // it helps to get the files with absolute paths\n getNewLine: () => this.tsModule.sys.newLine,\n };\n const componentsResults: ComponentResult[] = [];\n let currentComponentResult: Partial<ComponentResult> = { errors: [] };\n const reportDiagnostic = (diagnostic: ts.Diagnostic) => {\n const errorStr = process.stdout.isTTY\n ? this.tsModule.formatDiagnosticsWithColorAndContext([diagnostic], formatHost)\n : this.tsModule.formatDiagnostic(diagnostic, formatHost);\n if (!diagnostic.file) {\n // the error is general and not related to a specific file. e.g. tsconfig is missing.\n throw new BitError(errorStr);\n }\n this.logger.consoleFailure(errorStr);\n if (!currentComponentResult.component || !currentComponentResult.errors) {\n throw new Error(`currentComponentResult is not defined yet for ${diagnostic.file}`);\n }\n currentComponentResult.errors.push(errorStr);\n };\n // this only works when `verbose` is `true` in the `ts.createSolutionBuilder` function.\n const reportSolutionBuilderStatus = (diag: ts.Diagnostic) => {\n const msg = diag.messageText as string;\n this.logger.debug(msg);\n };\n const errorCounter = (errorCount: number) => {\n this.logger.info(`total error found: ${errorCount}`);\n };\n const host = this.tsModule.createSolutionBuilderHost(\n undefined,\n undefined,\n reportDiagnostic,\n reportSolutionBuilderStatus,\n errorCounter\n );\n await this.writeProjectReferencesTsConfig(rootDir, capsuleDirs);\n const solutionBuilder = this.tsModule.createSolutionBuilder(host, [rootDir], { verbose: true });\n let nextProject;\n const longProcessLogger = this.logger.createLongProcessLogger('compile typescript components', capsules.length);\n // eslint-disable-next-line no-cond-assign\n while ((nextProject = solutionBuilder.getNextInvalidatedProject())) {\n // regex to make sure it will work correctly for both linux and windows\n // it replaces both /tsconfig.json and \\tsocnfig.json\n const capsulePath = nextProject.project.replace(/[/\\\\]tsconfig.json/, '');\n const currentComponentId = capsules.getIdByPathInCapsule(capsulePath);\n if (!currentComponentId) throw new Error(`unable to find component for ${capsulePath}`);\n longProcessLogger.logProgress(currentComponentId.toString());\n const capsule = capsules.getCapsule(currentComponentId);\n if (!capsule) throw new Error(`unable to find capsule for ${currentComponentId.toString()}`);\n currentComponentResult.component = capsule.component;\n currentComponentResult.startTime = Date.now();\n nextProject.done();\n currentComponentResult.endTime = Date.now();\n componentsResults.push({ ...currentComponentResult } as ComponentResult);\n currentComponentResult = { errors: [] };\n }\n longProcessLogger.end();\n\n return componentsResults;\n }\n\n private getFormatDiagnosticsHost(): ts.FormatDiagnosticsHost {\n return {\n getCanonicalFileName: (p) => p,\n getCurrentDirectory: this.tsModule.sys.getCurrentDirectory,\n getNewLine: () => this.tsModule.sys.newLine,\n };\n }\n\n private async writeTypes(dirs: string[]) {\n await Promise.all(\n this.options.types.map(async (typePath) => {\n const contents = await fs.readFile(typePath, 'utf8');\n const filename = path.basename(typePath);\n\n await Promise.all(\n dirs.map(async (dir) => {\n const filePath = path.join(dir, 'types', filename);\n if (!(await fs.pathExists(filePath))) {\n await fs.outputFile(filePath, contents);\n }\n })\n );\n })\n );\n }\n\n /**\n * when using project-references, typescript adds a file \"tsconfig.tsbuildinfo\" which is not\n * needed for the package.\n */\n private async writeNpmIgnore(dirs: string[]) {\n const NPM_IGNORE_FILE = '.npmignore';\n await Promise.all(\n dirs.map(async (dir) => {\n const npmIgnorePath = path.join(dir, NPM_IGNORE_FILE);\n const npmIgnoreEntriesStr = `\\n${this.distDir}/tsconfig.tsbuildinfo\\n`;\n await fs.appendFile(npmIgnorePath, npmIgnoreEntriesStr);\n })\n );\n }\n\n private async writeProjectReferencesTsConfig(rootDir: string, projects: string[]) {\n const files = [];\n const references = projects.map((project) => ({ path: project }));\n const tsconfig = { files, references };\n const tsconfigStr = this.stringifyTsconfig(tsconfig);\n await fs.writeFile(path.join(rootDir, 'tsconfig.json'), tsconfigStr);\n }\n\n private async writeTsConfig(dirs: string[]) {\n const tsconfigStr = this.stringifyTsconfig(this.options.tsconfig);\n await Promise.all(dirs.map((dir) => fs.writeFile(path.join(dir, 'tsconfig.json'), tsconfigStr)));\n }\n\n private stringifyTsconfig(tsconfig) {\n return JSON.stringify(tsconfig, undefined, 2);\n }\n\n private replaceFileExtToJs(filePath: string): string {\n if (!this.isFileSupported(filePath)) return filePath;\n const fileExtension = path.extname(filePath);\n return filePath.replace(new RegExp(`${fileExtension}$`), '.js'); // makes sure it's the last occurrence\n }\n\n version() {\n return this.tsModule.version;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["typescript.compiler.ts"],"names":["TypescriptCompiler","constructor","id","logger","options","tsModule","distDir","distGlobPatterns","shouldCopyNonSupportedFiles","artifactName","tsconfig","compilerOptions","outDir","displayConfig","stringifyTsconfig","getDistDir","transpileFile","fileContent","isFileSupported","filePath","compilerOptionsFromTsconfig","convertCompilerOptionsFromJson","errors","length","formattedErrors","formatDiagnosticsWithColorAndContext","getFormatDiagnosticsHost","Error","sourceRoot","componentDir","rootDir","result","transpileModule","fileName","reportDiagnostics","diagnostics","formatHost","error","outputPath","replaceFileExtToJs","outputFiles","outputText","sourceMapText","push","preBuild","context","capsules","capsuleNetwork","seedersCapsules","capsuleDirs","map","capsule","path","writeTsConfig","writeTypes","writeNpmIgnore","build","componentsResults","runTscBuild","artifacts","getArtifactDefinition","postBuild","Promise","all","packageJson","PackageJsonFile","loadFromCapsuleSync","packageJsonObject","types","write","generatedBy","name","globPatterns","getDistPathBySrcPath","srcPath","fileWithJSExtIfNeeded","join","isJsAndCompile","compileJs","endsWith","isJsxAndCompile","compileJsx","network","capsulesRootDir","getCapsulesToCompile","getAllCapsuleDirs","getCanonicalFileName","p","getCurrentDirectory","getNewLine","sys","newLine","currentComponentResult","reportDiagnostic","diagnostic","errorStr","process","stdout","isTTY","formatDiagnostic","file","BitError","consoleFailure","component","reportSolutionBuilderStatus","diag","msg","messageText","debug","errorCounter","errorCount","info","host","createSolutionBuilderHost","undefined","writeProjectReferencesTsConfig","solutionBuilder","createSolutionBuilder","verbose","nextProject","longProcessLogger","createLongProcessLogger","getNextInvalidatedProject","capsulePath","project","replace","currentComponentId","getIdByPathInCapsule","logProgress","toString","getCapsule","startTime","Date","now","done","endTime","end","dirs","typePath","contents","fs","readFile","filename","basename","dir","pathExists","outputFile","NPM_IGNORE_FILE","npmIgnorePath","npmIgnoreEntriesStr","appendFile","projects","files","references","tsconfigStr","writeFile","JSON","stringify","fileExtension","extname","RegExp","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAGO,MAAMA,kBAAN,CAA6C;AAKlDC,EAAAA,WAAW,CACAC,EADA,EAEDC,MAFC,EAGDC,OAHC,EAIDC,QAJC,EAKT;AAAA;;AAAA,SAJSH,EAIT,GAJSA,EAIT;AAAA,SAHQC,MAGR,GAHQA,MAGR;AAAA,SAFQC,OAER,GAFQA,OAER;AAAA,SADQC,QACR,GADQA,QACR;AAAA;AAAA;AAAA;AAAA;AAAA,yDAYY,YAZZ;AAAA,2DAac,KAbd;AACA,SAAKC,OAAL,GAAeF,OAAO,CAACE,OAAR,IAAmB,MAAlC;AACA,SAAKC,gBAAL,GAAwBH,OAAO,CAACG,gBAAR,IAA4B,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J,OAArB;AACD;;AAhSiD","sourcesContent":["import { BuildContext, BuiltTaskResult, ComponentResult } from '@teambit/builder';\nimport { Compiler, TranspileFileParams, TranspileFileOutput } from '@teambit/compiler';\nimport { Network } from '@teambit/isolator';\nimport { Logger } from '@teambit/logger';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport ts from 'typescript';\nimport { BitError } from '@teambit/bit-error';\nimport PackageJsonFile from '@teambit/legacy/dist/consumer/component/package-json-file';\nimport { TypeScriptCompilerOptions } from './compiler-options';\n\nexport class TypescriptCompiler implements Compiler {\n distDir: string;\n distGlobPatterns: string[];\n shouldCopyNonSupportedFiles: boolean;\n artifactName: string;\n constructor(\n readonly id: string,\n private logger: Logger,\n private options: TypeScriptCompilerOptions,\n private tsModule: typeof ts\n ) {\n this.distDir = options.distDir || 'dist';\n this.distGlobPatterns = options.distGlobPatterns || [`${this.distDir}/**`, `!${this.distDir}/tsconfig.tsbuildinfo`];\n this.shouldCopyNonSupportedFiles =\n typeof options.shouldCopyNonSupportedFiles === 'boolean' ? options.shouldCopyNonSupportedFiles : true;\n this.artifactName = options.artifactName || 'dist';\n this.options.tsconfig ||= {};\n this.options.tsconfig.compilerOptions ||= {};\n // mutate the outDir, otherwise, on capsules, the dists might be written to a different directory and make confusion\n this.options.tsconfig.compilerOptions.outDir = this.distDir;\n }\n\n displayName = 'TypeScript';\n deleteDistDir = false;\n\n displayConfig() {\n return this.stringifyTsconfig(this.options.tsconfig);\n }\n\n getDistDir() {\n return this.distDir;\n }\n\n /**\n * compile one file on the workspace\n */\n transpileFile(fileContent: string, options: TranspileFileParams): TranspileFileOutput {\n if (!this.isFileSupported(options.filePath)) {\n return null; // file is not supported\n }\n const compilerOptionsFromTsconfig = this.tsModule.convertCompilerOptionsFromJson(\n this.options.tsconfig.compilerOptions,\n '.'\n );\n if (compilerOptionsFromTsconfig.errors.length) {\n // :TODO @david replace to a more concrete error type and put in 'exceptions' directory here.\n const formattedErrors = this.tsModule.formatDiagnosticsWithColorAndContext(\n compilerOptionsFromTsconfig.errors,\n this.getFormatDiagnosticsHost()\n );\n throw new Error(`failed parsing the tsconfig.json.\\n${formattedErrors}`);\n }\n\n const compilerOptions = compilerOptionsFromTsconfig.options;\n compilerOptions.sourceRoot = options.componentDir;\n compilerOptions.rootDir = '.';\n const result = this.tsModule.transpileModule(fileContent, {\n compilerOptions,\n fileName: options.filePath,\n reportDiagnostics: true,\n });\n\n if (result.diagnostics && result.diagnostics.length) {\n const formatHost = this.getFormatDiagnosticsHost();\n const error = this.tsModule.formatDiagnosticsWithColorAndContext(result.diagnostics, formatHost);\n\n // :TODO @david please replace to a more concrete error type and put in 'exceptions' directory here.\n throw new Error(error);\n }\n\n const outputPath = this.replaceFileExtToJs(options.filePath);\n const outputFiles = [{ outputText: result.outputText, outputPath }];\n if (result.sourceMapText) {\n outputFiles.push({\n outputText: result.sourceMapText,\n outputPath: `${outputPath}.map`,\n });\n }\n return outputFiles;\n }\n\n async preBuild(context: BuildContext) {\n const capsules = context.capsuleNetwork.seedersCapsules;\n const capsuleDirs = capsules.map((capsule) => capsule.path);\n await this.writeTsConfig(capsuleDirs);\n await this.writeTypes(capsuleDirs);\n await this.writeNpmIgnore(capsuleDirs);\n }\n\n /**\n * compile multiple components on the capsules\n */\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const componentsResults = await this.runTscBuild(context.capsuleNetwork);\n\n return {\n artifacts: this.getArtifactDefinition(),\n componentsResults,\n };\n }\n\n async postBuild(context: BuildContext) {\n await Promise.all(\n context.capsuleNetwork.seedersCapsules.map(async (capsule) => {\n const packageJson = PackageJsonFile.loadFromCapsuleSync(capsule.path);\n // the types['index.ts'] is needed only during the build to avoid errors when tsc finds the\n // same type once in the d.ts and once in the ts file.\n if (packageJson.packageJsonObject.types) {\n delete packageJson.packageJsonObject.types;\n await packageJson.write();\n }\n })\n );\n }\n\n getArtifactDefinition() {\n return [\n {\n generatedBy: this.id,\n name: this.artifactName,\n globPatterns: this.distGlobPatterns,\n },\n ];\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. index.ts => dist/index.js\n */\n getDistPathBySrcPath(srcPath: string) {\n const fileWithJSExtIfNeeded = this.replaceFileExtToJs(srcPath);\n return path.join(this.distDir, fileWithJSExtIfNeeded);\n }\n\n /**\n * whether typescript is able to compile the given path\n */\n isFileSupported(filePath: string): boolean {\n const isJsAndCompile = !!this.options.compileJs && filePath.endsWith('.js');\n const isJsxAndCompile = !!this.options.compileJsx && filePath.endsWith('.jsx');\n return (\n (filePath.endsWith('.ts') || filePath.endsWith('.tsx') || isJsAndCompile || isJsxAndCompile) &&\n !filePath.endsWith('.d.ts')\n );\n }\n\n /**\n * we have two options here:\n * 1. pass all capsules-dir at the second parameter of createSolutionBuilder and then no\n * need to write the main tsconfig.json with all the references.\n * 2. write main tsconfig.json and pass the capsules root-dir.\n * we went with option #2 because it'll be easier for users to go to the capsule-root and run\n * `tsc --build` to debug issues.\n */\n private async runTscBuild(network: Network): Promise<ComponentResult[]> {\n const rootDir = network.capsulesRootDir;\n const capsules = await network.getCapsulesToCompile();\n if (!capsules.length) {\n return [];\n }\n const capsuleDirs = capsules.getAllCapsuleDirs();\n const formatHost = {\n getCanonicalFileName: (p) => p,\n getCurrentDirectory: () => '', // it helps to get the files with absolute paths\n getNewLine: () => this.tsModule.sys.newLine,\n };\n const componentsResults: ComponentResult[] = [];\n let currentComponentResult: Partial<ComponentResult> = { errors: [] };\n const reportDiagnostic = (diagnostic: ts.Diagnostic) => {\n const errorStr = process.stdout.isTTY\n ? this.tsModule.formatDiagnosticsWithColorAndContext([diagnostic], formatHost)\n : this.tsModule.formatDiagnostic(diagnostic, formatHost);\n if (!diagnostic.file) {\n // the error is general and not related to a specific file. e.g. tsconfig is missing.\n throw new BitError(errorStr);\n }\n this.logger.consoleFailure(errorStr);\n if (!currentComponentResult.component || !currentComponentResult.errors) {\n throw new Error(`currentComponentResult is not defined yet for ${diagnostic.file}`);\n }\n currentComponentResult.errors.push(errorStr);\n };\n // this only works when `verbose` is `true` in the `ts.createSolutionBuilder` function.\n const reportSolutionBuilderStatus = (diag: ts.Diagnostic) => {\n const msg = diag.messageText as string;\n this.logger.debug(msg);\n };\n const errorCounter = (errorCount: number) => {\n this.logger.info(`total error found: ${errorCount}`);\n };\n const host = this.tsModule.createSolutionBuilderHost(\n undefined,\n undefined,\n reportDiagnostic,\n reportSolutionBuilderStatus,\n errorCounter\n );\n await this.writeProjectReferencesTsConfig(rootDir, capsuleDirs);\n const solutionBuilder = this.tsModule.createSolutionBuilder(host, [rootDir], { verbose: true });\n let nextProject;\n const longProcessLogger = this.logger.createLongProcessLogger('compile typescript components', capsules.length);\n // eslint-disable-next-line no-cond-assign\n while ((nextProject = solutionBuilder.getNextInvalidatedProject())) {\n // regex to make sure it will work correctly for both linux and windows\n // it replaces both /tsconfig.json and \\tsocnfig.json\n const capsulePath = nextProject.project.replace(/[/\\\\]tsconfig.json/, '');\n const currentComponentId = capsules.getIdByPathInCapsule(capsulePath);\n if (!currentComponentId) throw new Error(`unable to find component for ${capsulePath}`);\n longProcessLogger.logProgress(currentComponentId.toString());\n const capsule = capsules.getCapsule(currentComponentId);\n if (!capsule) throw new Error(`unable to find capsule for ${currentComponentId.toString()}`);\n currentComponentResult.component = capsule.component;\n currentComponentResult.startTime = Date.now();\n nextProject.done();\n currentComponentResult.endTime = Date.now();\n componentsResults.push({ ...currentComponentResult } as ComponentResult);\n currentComponentResult = { errors: [] };\n }\n longProcessLogger.end();\n\n return componentsResults;\n }\n\n private getFormatDiagnosticsHost(): ts.FormatDiagnosticsHost {\n return {\n getCanonicalFileName: (p) => p,\n getCurrentDirectory: this.tsModule.sys.getCurrentDirectory,\n getNewLine: () => this.tsModule.sys.newLine,\n };\n }\n\n private async writeTypes(dirs: string[]) {\n await Promise.all(\n this.options.types.map(async (typePath) => {\n const contents = await fs.readFile(typePath, 'utf8');\n const filename = path.basename(typePath);\n\n await Promise.all(\n dirs.map(async (dir) => {\n const filePath = path.join(dir, 'types', filename);\n if (!(await fs.pathExists(filePath))) {\n await fs.outputFile(filePath, contents);\n }\n })\n );\n })\n );\n }\n\n /**\n * when using project-references, typescript adds a file \"tsconfig.tsbuildinfo\" which is not\n * needed for the package.\n */\n private async writeNpmIgnore(dirs: string[]) {\n const NPM_IGNORE_FILE = '.npmignore';\n await Promise.all(\n dirs.map(async (dir) => {\n const npmIgnorePath = path.join(dir, NPM_IGNORE_FILE);\n const npmIgnoreEntriesStr = `\\n${this.distDir}/tsconfig.tsbuildinfo\\n`;\n await fs.appendFile(npmIgnorePath, npmIgnoreEntriesStr);\n })\n );\n }\n\n private async writeProjectReferencesTsConfig(rootDir: string, projects: string[]) {\n const files = [];\n const references = projects.map((project) => ({ path: project }));\n const tsconfig = { files, references };\n const tsconfigStr = this.stringifyTsconfig(tsconfig);\n await fs.writeFile(path.join(rootDir, 'tsconfig.json'), tsconfigStr);\n }\n\n private async writeTsConfig(dirs: string[]) {\n const tsconfigStr = this.stringifyTsconfig(this.options.tsconfig);\n await Promise.all(dirs.map((dir) => fs.writeFile(path.join(dir, 'tsconfig.json'), tsconfigStr)));\n }\n\n private stringifyTsconfig(tsconfig) {\n return JSON.stringify(tsconfig, undefined, 2);\n }\n\n private replaceFileExtToJs(filePath: string): string {\n if (!this.isFileSupported(filePath)) return filePath;\n const fileExtension = path.extname(filePath);\n return filePath.replace(new RegExp(`${fileExtension}$`), '.js'); // makes sure it's the last occurrence\n }\n\n version() {\n return this.tsModule.version;\n }\n}\n"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/typescript",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.720",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/typescript/typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.typescript",
|
|
8
8
|
"name": "typescript",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.720"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -14,24 +14,24 @@
|
|
|
14
14
|
"typescript": "4.4.2",
|
|
15
15
|
"fs-extra": "10.0.0",
|
|
16
16
|
"p-map-series": "2.1.0",
|
|
17
|
-
"chalk": "
|
|
17
|
+
"chalk": "4.1.2",
|
|
18
18
|
"@babel/runtime": "7.12.18",
|
|
19
19
|
"core-js": "^3.0.0",
|
|
20
20
|
"@teambit/harmony": "0.3.3",
|
|
21
|
-
"@teambit/compiler": "0.0.
|
|
21
|
+
"@teambit/compiler": "0.0.720",
|
|
22
22
|
"@teambit/typescript.modules.ts-config-mutator": "0.0.68",
|
|
23
|
-
"@teambit/component": "0.0.
|
|
23
|
+
"@teambit/component": "0.0.720",
|
|
24
24
|
"@teambit/semantics.entities.semantic-schema": "0.0.7",
|
|
25
25
|
"@teambit/ts-server": "0.0.32",
|
|
26
|
-
"@teambit/aspect-loader": "0.0.
|
|
26
|
+
"@teambit/aspect-loader": "0.0.720",
|
|
27
27
|
"@teambit/bit-error": "0.0.394",
|
|
28
|
-
"@teambit/builder": "0.0.
|
|
29
|
-
"@teambit/isolator": "0.0.
|
|
30
|
-
"@teambit/logger": "0.0.
|
|
31
|
-
"@teambit/schema": "0.0.
|
|
32
|
-
"@teambit/cli": "0.0.
|
|
33
|
-
"@teambit/pkg": "0.0.
|
|
34
|
-
"@teambit/workspace": "0.0.
|
|
28
|
+
"@teambit/builder": "0.0.720",
|
|
29
|
+
"@teambit/isolator": "0.0.720",
|
|
30
|
+
"@teambit/logger": "0.0.571",
|
|
31
|
+
"@teambit/schema": "0.0.720",
|
|
32
|
+
"@teambit/cli": "0.0.479",
|
|
33
|
+
"@teambit/pkg": "0.0.720",
|
|
34
|
+
"@teambit/workspace": "0.0.720"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/lodash": "4.14.165",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"@types/jest": "^26.0.0",
|
|
45
45
|
"@types/react-dom": "^17.0.5",
|
|
46
46
|
"@types/node": "12.20.4",
|
|
47
|
-
"@teambit/typescript.aspect-docs.typescript": "0.0.
|
|
47
|
+
"@teambit/typescript.aspect-docs.typescript": "0.0.137"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@teambit/legacy": "1.0.
|
|
50
|
+
"@teambit/legacy": "1.0.259",
|
|
51
51
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
52
52
|
"react": "^16.8.0 || ^17.0.0"
|
|
53
53
|
},
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"react": "-"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@teambit/legacy": "1.0.
|
|
78
|
+
"@teambit/legacy": "1.0.259",
|
|
79
79
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
80
80
|
"react": "^16.8.0 || ^17.0.0"
|
|
81
81
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@0.0.720/dist/typescript.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.typescript_typescript@0.0.720/dist/typescript.docs.mdx')]
|
|
Binary file
|