@teambit/compiler 1.0.1201 → 1.0.1203
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.1203/dist/compiler.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.1203/dist/compiler.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -164,7 +164,10 @@ class ComponentCompiler {
|
|
|
164
164
|
}
|
|
165
165
|
await Promise.all(absoluteDistDirs.map(distDir => _fsExtra().default.remove(distDir)));
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
|
|
168
|
+
// a multi-compiler exposes its inner compilers.
|
|
169
|
+
const innerCompilers = this.compilerInstance.compilers;
|
|
170
|
+
const compilers = innerCompilers || [this.compilerInstance];
|
|
168
171
|
const canTranspileFile = compilers.find(c => c.transpileFile);
|
|
169
172
|
const canTranspileComponent = compilers.find(c => c.transpileComponent);
|
|
170
173
|
if (canTranspileFile) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_globby","_fsExtra","_workspace","_path","_chalk","_componentId","_logger","_legacy","_component","_workspaceModules","_dependencyResolver","_pkgModules","_workspace2","_lodash","_compiler","_events","_types","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ComponentCompiler","constructor","pubsub","workspace","component","compilerInstance","compilerId","logger","env","dists","compileErrors","compile","noThrow","options","dataToPersist","deleteDistDir","distDirs","relativeDistDirs","filter","distDir","path","isAbsolute","absoluteDistDirs","length","DataToPersist","removePath","RemovePath","addBasePath","persistAllToFS","Promise","all","map","fs","remove","compilers","canTranspileFile","find","c","transpileFile","canTranspileComponent","transpileComponent","filesystem","files","file","compileOneFile","initiator","compileAllFiles","Error","toString","throwOnCompileErrors","relativeDists","distFile","absoluteDists","addManyFiles","write","buildResults","state","_consumer","compiler","consoleSuccess","id","errors","getPackageDir","packageName","componentIdToPackageName","join","toAbsolutePath","pathToResolve","forEach","errorItem","error","formatError","err","pub","CompilerAspect","CompilerErrorEvent","console","message","packageDir","distDirName","getDistDir","DEFAULT_DIST_DIRNAME","injectedDirs","getInjectedDirs","dist","rootDirs","readRootComponentsDir","rootComponentsPath","rootDir","relative","componentDir","copyTypesToOtherDists","packageDistDir","otherDirs","slice","packageDistDirAbs","matches","globby","cwd","onlyFiles","ignore","distDirAbs","match","source","dest","copyFile","copyCompiledFilesToOtherDists","outputDir","getComponentPackagePath","sourceDistDirAbs","pathExists","dir","resolve","ensureDir","dirname","filePath","isFileSupported","compileResults","contents","push","base","result","Dist","outputPath","Buffer","from","outputText","shouldCopyNonSupportedFiles","filesToCompile","exports","WorkspaceCompiler","envs","aspectLoader","ui","dependencyResolver","watcher","Set","registerOnComponentChange","onComponentChange","bind","registerOnComponentAdd","onComponentAdd","registerOnPreWatch","onPreWatch","registerPreStart","onPreStart","registerOnAspectLoadErrorSlot","onAspectLoadFail","preStartOpts","skipCompilation","compileComponents","changed","verbose","CompilationInitiator","PreStart","watchScopeInternalFiles","code","includes","inInstallContext","inInstallAfterPmContext","shouldCompile","idStr","hasId","ignoreVersion","debug","componentsBeingProcessedInOnAspectLoadFail","has","add","graph","successors","getEnvDepsGraph","depsIds","s","AspectLoadFail","loadExtensions","executeLoadSlot","delete","envComponentId","getGraphIds","nodeFilter","node","attr","watchOpts","undefined","removedFiles","Boolean","removeLinksFromNodeModules","ComponentChanged","generateTypes","results","formatCompileResults","componentIds","preCompile","start","Date","now","PreWatch","end","componentsIds","componentLoadOptions","OutsideWorkspaceError","getIdsToCompile","loadSeedersAsAspects","components","getMany","loadExternalEnvs","grouped","buildGroupsToCompile","mapSeries","group","runCompileComponents","linkComponents","linkToNodeModulesByComponents","flat","componentsIdsStr","envIdsCompIdsMap","compsWithWrongEnvId","envId","calculateEnvId","envIdByGet","getEnvId","externalEnvsIds","keys","nonLoadedEnvs","isEnvRegistered","loadAspects","idsToClearCache","uniq","reduce","acc","compIds","concat","clearComponentsCache","ComponentID","fromString","componentsCompilers","skipped","getOrCalculateEnv","environment","getCompiler","compilerName","name","warn","reason","typeGeneratorParamsPerEnv","getTypesCompilerPerEnv","preGenerateTypesOnWorkspace","resultOnWorkspace","componentCompiler","generateTypesOnWorkspace","envsMap","componentCompilers","compParams","typeCompiler","buildPipe","getBuildPipe","compilerTasks","task","aspectId","tsTask","displayName","compact","typesGeneratorParamsPerEnv","envCompIds","envsIds","groupedByIsEnv","groupBy","isEnv","envsOfEnvsCompIds","groupedByEnvsOfEnvs","envsOfEnvsWithoutCoreCompIds","isCoreEnv","depsOfEnvsOfEnvsCompIds","envsOfEnvsOnGraph","hasNode","subGraph","successorsSubgraph","nodes","n","depsOfEnvsOfEnvsCompLists","envsOfEnvs","envComp","getDependencies","DependencyList","merge","getComponentDependencies","dep","groupedByIsDepsOfEnvsOfEnvs","other","depsOfEnvsOfCompIds","otherEnvsIds","otherEnvs","otherEnvsWithoutCoreIds","depsOfEnvsCompLists","groupedByIsDepsOfEnvs","depsOfEnvsOfEnvs","depsOfEnvs","resolveMultipleComponentIds","filterIds","getNewAndModifiedIds","listIds","buildResult","title","chalk","underline","verboseComponentFilesArrayToString","Logger","successSymbol"],"sources":["workspace-compiler.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport mapSeries from 'p-map-series';\nimport globby from 'globby';\nimport fs from 'fs-extra';\nimport type { Component } from '@teambit/component';\nimport type { EnvDefinition, EnvsMain } from '@teambit/envs';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { OutsideWorkspaceError } from '@teambit/workspace';\nimport type { WorkspaceComponentLoadOptions, SerializableResults, Workspace } from '@teambit/workspace';\nimport type { WatcherMain, WatchOptions } from '@teambit/watcher';\nimport path from 'path';\nimport chalk from 'chalk';\nimport { ComponentID } from '@teambit/component-id';\nimport { Logger } from '@teambit/logger';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy.constants';\nimport type { AbstractVinyl } from '@teambit/component.sources';\nimport { Dist, DataToPersist, RemovePath } from '@teambit/component.sources';\nimport {\n linkToNodeModulesByComponents,\n removeLinksFromNodeModules,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport type { AspectLoaderMain } from '@teambit/aspect-loader';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyList } from '@teambit/dependency-resolver';\nimport type { PathOsBasedAbsolute } from '@teambit/toolbox.path.path';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport type { UiMain, PreStartOpts } from '@teambit/ui';\nimport { readRootComponentsDir } from '@teambit/workspace.root-components';\nimport { compact, groupBy, uniq } from 'lodash';\nimport type { MultiCompiler } from '@teambit/multi-compiler';\nimport type { CompIdGraph } from '@teambit/graph';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompilerErrorEvent } from './events';\nimport type { Compiler, TypeGeneratorCompParams } from './types';\nimport { CompilationInitiator } from './types';\n\nexport type BuildResult = {\n component: string;\n buildResults: string[];\n errors: CompileError[];\n /**\n * set when nothing was compiled for the component because its env provides no compiler. such a\n * component is neither a success nor a failure, so it is counted and reported on its own.\n */\n skipped?: { reason: string };\n};\n\nexport type CompileOptions = {\n changed?: boolean; // compile only new and modified components\n verbose?: boolean; // show more data, such as, dist paths\n /**\n * whether the dist root dir should be deleted before writing new dists.\n * defaults to true for `bit compile` and false everywhere else, such as `bit watch` and `bit\n * start` to avoid webpack \"EINTR\" error.\n */\n deleteDistDir?: boolean;\n initiator: CompilationInitiator; // describes where the compilation is coming from\n // should we create links in node_modules for the compiled components (default = true)\n // this will link the source files, and create the package.json\n linkComponents?: boolean;\n /**\n * whether to generate types after the compilation, default = false.\n * keep in mind that it's a heavy operation, and hurts the performance.\n */\n generateTypes?: boolean;\n};\n\nexport type CompileError = { path: string; error: Error };\n\nexport class ComponentCompiler {\n constructor(\n private pubsub: PubsubMain,\n private workspace: Workspace,\n readonly component: Component,\n readonly compilerInstance: Compiler,\n private compilerId: string,\n private logger: Logger,\n readonly env: EnvDefinition,\n private dists: Dist[] = [],\n private compileErrors: CompileError[] = []\n ) {}\n\n async compile(noThrow = true, options: CompileOptions): Promise<BuildResult> {\n let dataToPersist;\n const deleteDistDir = options.deleteDistDir ?? this.compilerInstance.deleteDistDir;\n const distDirs = await this.distDirs();\n // delete dist folder before transpilation (because some compilers (like ngPackagr) can generate files there during the compilation process)\n if (deleteDistDir) {\n const relativeDistDirs = distDirs.filter((distDir) => !path.isAbsolute(distDir));\n const absoluteDistDirs = distDirs.filter((distDir) => path.isAbsolute(distDir));\n if (relativeDistDirs.length) {\n dataToPersist = new DataToPersist();\n for (const distDir of relativeDistDirs) {\n dataToPersist.removePath(new RemovePath(distDir));\n }\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n }\n await Promise.all(absoluteDistDirs.map((distDir) => fs.remove(distDir)));\n }\n\n const compilers: Compiler[] = (this.compilerInstance as MultiCompiler).compilers\n ? (this.compilerInstance as MultiCompiler).compilers\n : [this.compilerInstance];\n const canTranspileFile = compilers.find((c) => c.transpileFile);\n const canTranspileComponent = compilers.find((c) => c.transpileComponent);\n\n if (canTranspileFile) {\n await Promise.all(\n this.component.filesystem.files.map((file: AbstractVinyl) =>\n this.compileOneFile(file, options.initiator, distDirs)\n )\n );\n }\n\n if (canTranspileComponent) {\n await this.compileAllFiles(options.initiator, distDirs);\n }\n\n if (!canTranspileFile && !canTranspileComponent) {\n throw new Error(\n `compiler ${this.compilerId.toString()} doesn't implement either \"transpileFile\" or \"transpileComponent\" methods`\n );\n }\n this.throwOnCompileErrors(noThrow);\n\n // writing the dists with `component.setDists(dists); component.dists.writeDists` is tricky\n // as it uses other base-paths and doesn't respect the new node-modules base path.\n const relativeDists = this.dists.filter((distFile) => !path.isAbsolute(distFile.path));\n const absoluteDists = this.dists.filter((distFile) => path.isAbsolute(distFile.path));\n if (relativeDists.length) {\n dataToPersist = new DataToPersist();\n dataToPersist.addManyFiles(relativeDists);\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n }\n await Promise.all(absoluteDists.map((distFile) => distFile.write()));\n const buildResults = this.dists.map((distFile) => distFile.path);\n if (this.component.state._consumer.compiler) this.logger.consoleSuccess();\n\n return { component: this.component.id.toString(), buildResults, errors: this.compileErrors };\n }\n\n getPackageDir() {\n const packageName = componentIdToPackageName(this.component.state._consumer);\n return path.join('node_modules', packageName);\n }\n\n private toAbsolutePath(pathToResolve: string): string {\n return path.isAbsolute(pathToResolve) ? pathToResolve : path.join(this.workspace.path, pathToResolve);\n }\n\n private throwOnCompileErrors(noThrow = true) {\n if (this.compileErrors.length) {\n this.compileErrors.forEach((errorItem) => {\n this.logger.error(`compilation error at ${errorItem.path}`, errorItem.error);\n });\n const formatError = (errorItem) => `${errorItem.path}\\n${errorItem.error}`;\n const err = new Error(`compilation failed. see the following errors from the compiler\n${this.compileErrors.map(formatError).join('\\n')}`);\n\n this.pubsub.pub(CompilerAspect.id, new CompilerErrorEvent(err));\n\n if (!noThrow) {\n throw err;\n }\n\n this.logger.console(err.message);\n }\n }\n\n private async distDirs(): Promise<string[]> {\n const packageName = componentIdToPackageName(this.component.state._consumer);\n const packageDir = path.join('node_modules', packageName);\n const distDirName = this.compilerInstance.getDistDir?.() || DEFAULT_DIST_DIRNAME;\n const injectedDirs = await this.getInjectedDirs(packageName);\n return [packageDir, ...injectedDirs].map((dist) => path.join(dist, distDirName));\n }\n\n private async getInjectedDirs(packageName: string): Promise<string[]> {\n const injectedDirs = await this.workspace.getInjectedDirs(this.component);\n if (injectedDirs.length > 0) return injectedDirs;\n\n const rootDirs = await readRootComponentsDir(this.workspace.rootComponentsPath);\n return rootDirs.map((rootDir) => path.relative(this.workspace.path, path.join(rootDir, packageName)));\n }\n\n private get componentDir(): PathOsBasedAbsolute {\n return this.workspace.componentDir(this.component.id);\n }\n\n async copyTypesToOtherDists() {\n const distDirs = await this.distDirs();\n if (distDirs.length <= 1) return;\n const packageDistDir = distDirs[0];\n const otherDirs = distDirs.slice(1);\n const packageDistDirAbs = this.toAbsolutePath(packageDistDir);\n const matches = await globby(`**/*.d.ts`, {\n cwd: packageDistDirAbs,\n onlyFiles: true,\n ignore: [`${packageDistDir}/node_modules/`],\n });\n if (!matches.length) return;\n await Promise.all(\n otherDirs.map(async (distDir) => {\n const distDirAbs = this.toAbsolutePath(distDir);\n await Promise.all(\n matches.map(async (match) => {\n const source = path.join(packageDistDirAbs, match);\n const dest = path.join(distDirAbs, match);\n await fs.copyFile(source, dest);\n })\n );\n })\n );\n }\n\n /**\n * Copy all compiled files from the outputDir (where the compiler wrote) to all other dist directories.\n * This is needed for compilers that use transpileComponent and write directly to the filesystem,\n * as they only receive one outputDir but files need to be available in all dist locations.\n */\n async copyCompiledFilesToOtherDists() {\n const distDirs = await this.distDirs();\n if (distDirs.length <= 1) return;\n\n // The compiler writes to the outputDir from getComponentPackagePath + distDirName\n const outputDir = await this.workspace.getComponentPackagePath(this.component);\n const distDirName = this.compilerInstance.getDistDir?.() || DEFAULT_DIST_DIRNAME;\n const sourceDistDirAbs = path.join(outputDir, distDirName);\n\n // Check if the dist directory exists (compiler may not have written anything)\n if (!(await fs.pathExists(sourceDistDirAbs))) return;\n\n const otherDirs = distDirs.filter(\n (dir) => path.resolve(this.toAbsolutePath(dir)) !== path.resolve(sourceDistDirAbs)\n );\n\n if (!otherDirs.length) return;\n\n const matches = await globby(`**/*`, {\n cwd: sourceDistDirAbs,\n onlyFiles: true,\n ignore: ['node_modules/**'],\n });\n if (!matches.length) return;\n\n await Promise.all(\n otherDirs.map(async (distDir) => {\n const distDirAbs = this.toAbsolutePath(distDir);\n await Promise.all(\n matches.map(async (match) => {\n const source = path.join(sourceDistDirAbs, match);\n const dest = path.join(distDirAbs, match);\n try {\n await fs.ensureDir(path.dirname(dest));\n await fs.copyFile(source, dest);\n } catch (err: any) {\n throw new Error(`failed to copy compiled file from \"${source}\" to \"${dest}\": ${err.message}`);\n }\n })\n );\n })\n );\n }\n\n private async compileOneFile(\n file: AbstractVinyl,\n initiator: CompilationInitiator,\n distDirs: string[]\n ): Promise<void> {\n const options = { componentDir: this.componentDir, filePath: file.relative, initiator };\n const isFileSupported = this.compilerInstance.isFileSupported(file.path);\n let compileResults;\n if (isFileSupported) {\n try {\n compileResults = await this.compilerInstance.transpileFile?.(file.contents.toString(), options);\n } catch (error: any) {\n this.compileErrors.push({ path: file.path, error });\n return;\n }\n }\n for (const base of distDirs) {\n if (isFileSupported && compileResults) {\n this.dists.push(\n ...compileResults.map(\n (result) =>\n new Dist({\n base,\n path: path.join(base, result.outputPath),\n contents: Buffer.from(result.outputText),\n })\n )\n );\n } else if (this.compilerInstance.shouldCopyNonSupportedFiles) {\n // compiler doesn't support this file type. copy the file as is to the dist dir.\n this.dists.push(new Dist({ base, path: path.join(base, file.relative), contents: file.contents }));\n }\n }\n }\n\n private async compileAllFiles(initiator: CompilationInitiator, distDirs: string[]): Promise<void> {\n const filesToCompile: AbstractVinyl[] = [];\n for (const base of distDirs) {\n this.component.filesystem.files.forEach((file: AbstractVinyl) => {\n const isFileSupported = this.compilerInstance.isFileSupported(file.path);\n if (isFileSupported) {\n filesToCompile.push(file);\n } else if (this.compilerInstance.shouldCopyNonSupportedFiles) {\n // compiler doesn't support this file type. copy the file as is to the dist dir.\n this.dists.push(\n new Dist({\n base,\n path: path.join(base, file.relative),\n contents: file.contents,\n })\n );\n }\n });\n }\n\n if (filesToCompile.length) {\n try {\n await this.compilerInstance.transpileComponent?.({\n component: this.component,\n componentDir: this.componentDir,\n outputDir: await this.workspace.getComponentPackagePath(this.component),\n initiator,\n });\n // Copy compiled files to all other dist directories (injected dirs)\n await this.copyCompiledFilesToOtherDists();\n } catch (error: any) {\n this.compileErrors.push({ path: this.componentDir, error });\n }\n }\n }\n}\n\ntype TypeGeneratorParamsPerEnv = { envId: string; compParams: TypeGeneratorCompParams[]; typeCompiler: Compiler };\n\nexport class WorkspaceCompiler {\n private componentsBeingProcessedInOnAspectLoadFail = new Set<string>();\n\n constructor(\n private workspace: Workspace,\n private envs: EnvsMain,\n private pubsub: PubsubMain,\n private aspectLoader: AspectLoaderMain,\n private ui: UiMain,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\n private watcher: WatcherMain\n ) {\n if (this.workspace) {\n this.workspace.registerOnComponentChange(this.onComponentChange.bind(this));\n this.workspace.registerOnComponentAdd(this.onComponentAdd.bind(this));\n this.watcher.registerOnPreWatch(this.onPreWatch.bind(this));\n }\n this.ui.registerPreStart(this.onPreStart.bind(this));\n if (this.aspectLoader) {\n this.aspectLoader.registerOnAspectLoadErrorSlot(this.onAspectLoadFail.bind(this));\n }\n }\n\n async onPreStart(preStartOpts: PreStartOpts): Promise<void> {\n if (this.workspace) {\n if (preStartOpts.skipCompilation) {\n return;\n }\n await this.compileComponents([], {\n changed: true,\n verbose: false,\n deleteDistDir: false,\n initiator: CompilationInitiator.PreStart,\n });\n } else {\n await this.watcher.watchScopeInternalFiles();\n }\n }\n\n async onAspectLoadFail(err: Error & { code?: string }, component: Component): Promise<boolean> {\n if (\n ((err.code &&\n (err.code === 'MODULE_NOT_FOUND' ||\n err.code === 'ERR_MODULE_NOT_FOUND' ||\n err.code === 'ERR_REQUIRE_ESM' ||\n // node refuses to load .ts files from node_modules. happens when the loaded instance\n // has only the component sources (e.g. re-created by the package manager mid-install)\n // and compiling the component fixes it, same as a missing-module failure\n err.code === 'ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING')) ||\n err.message.includes('import.meta') ||\n err.message.includes('exports is not defined')) &&\n this.workspace\n ) {\n const inInstallContext = this.workspace.inInstallContext;\n const inInstallAfterPmContext = this.workspace.inInstallAfterPmContext;\n // If we are now running install we only want to compile after the package manager is done\n const shouldCompile = (inInstallContext && inInstallAfterPmContext) || !inInstallContext;\n if (shouldCompile) {\n const id = component.id;\n const idStr = id.toString();\n\n // compiling can only fix a workspace component whose dists are missing or stale. when the\n // failed aspect is not in the workspace (e.g. an env that used to be a core aspect,\n // resolved to its pinned version but not installed yet), the cascade below imports the\n // env's full dependency closure from the remote and recompiles a large part of the\n // workspace into every injected node_modules copy - minutes of work that cannot\n // materialize the missing package. skip it and let the regular missing-aspect handling\n // report it (a NonLoadedEnv issue with a \"bit install\" remediation).\n if (!this.workspace.hasId(id, { ignoreVersion: true })) {\n this.logger.debug(\n `onAspectLoadFail: skipping compilation of ${idStr} - not a workspace component, compiling cannot fix its missing module`\n );\n return false;\n }\n\n // Prevent infinite loop when there's a circular dependency between an env and a component.\n // If we're already processing this component, don't re-enter.\n if (this.componentsBeingProcessedInOnAspectLoadFail.has(idStr)) {\n this.logger.debug(\n `onAspectLoadFail: skipping ${idStr} as it's already being processed (preventing infinite loop)`\n );\n return false;\n }\n\n this.componentsBeingProcessedInOnAspectLoadFail.add(idStr);\n try {\n const { graph, successors } = await this.getEnvDepsGraph(id);\n // const deps = this.dependencyResolver.getDependencies(component);\n // const depsIds = deps.getComponentDependencies().map((dep) => {\n // return dep.id.toString();\n // });\n const depsIds = successors.map((s) => s.id);\n await this.compileComponents(\n [id.toString(), ...depsIds],\n { initiator: CompilationInitiator.AspectLoadFail },\n true,\n { loadExtensions: true, executeLoadSlot: true },\n graph\n );\n return true;\n } finally {\n this.componentsBeingProcessedInOnAspectLoadFail.delete(idStr);\n }\n }\n }\n return false;\n }\n\n async getEnvDepsGraph(envComponentId: ComponentID): Promise<{ graph: CompIdGraph; successors: { id: string }[] }> {\n const graph = await this.workspace.getGraphIds([envComponentId]);\n const successors = graph.successors(envComponentId.toString(), {\n nodeFilter: (node) => this.workspace.hasId(node.attr),\n });\n return { graph, successors };\n }\n\n async onComponentAdd(component: Component, files: string[], watchOpts: WatchOptions) {\n return this.onComponentChange(component, files, undefined, watchOpts);\n }\n\n async onComponentChange(\n component: Component,\n files: string[],\n removedFiles: string[] = [],\n watchOpts: WatchOptions\n ): Promise<SerializableResults | void> {\n if (!watchOpts.compile) return undefined;\n // when files are removed, we need to remove the dist directories and the old symlinks, otherwise, it has\n // symlinks to non-exist files and the dist has stale files\n const deleteDistDir = Boolean(removedFiles?.length);\n if (removedFiles?.length) {\n await removeLinksFromNodeModules(component, this.workspace, removedFiles);\n }\n const buildResults = await this.compileComponents(\n [component.id.toString()],\n {\n initiator: watchOpts.initiator || CompilationInitiator.ComponentChanged,\n deleteDistDir,\n generateTypes: watchOpts.generateTypes,\n },\n true\n );\n return {\n results: buildResults,\n toString() {\n return formatCompileResults(buildResults, watchOpts.verbose);\n },\n };\n }\n\n async onPreWatch(componentIds: ComponentID[], watchOpts: WatchOptions) {\n if (watchOpts.preCompile) {\n const start = Date.now();\n this.logger.console(`compiling ${componentIds.length} components`);\n await this.compileComponents(\n componentIds.map((id) => id),\n { initiator: CompilationInitiator.PreWatch, generateTypes: watchOpts.generateTypes }\n );\n const end = Date.now() - start;\n this.logger.consoleSuccess(`compiled ${componentIds.length} components successfully (${end / 1000} sec)`);\n }\n }\n\n async compileComponents(\n componentsIds: string[] | ComponentID[] | ComponentID[], // when empty, it compiles new+modified (unless options.all is set),\n options: CompileOptions,\n noThrow?: boolean,\n componentLoadOptions: WorkspaceComponentLoadOptions = {},\n graph?: CompIdGraph\n ): Promise<BuildResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const componentIds = await this.getIdsToCompile(componentsIds, options.changed);\n // In case the aspect failed to load, we want to compile it without try to re-load it again\n if (options.initiator === CompilationInitiator.AspectLoadFail) {\n componentLoadOptions.loadSeedersAsAspects = false;\n }\n let components = await this.workspace.getMany(componentIds, componentLoadOptions);\n await this.loadExternalEnvs(components);\n // reload components as we might cleared the cache as part of the loadExternalEnvs\n components = await this.workspace.getMany(componentIds, componentLoadOptions);\n const grouped = await this.buildGroupsToCompile(components, graph);\n\n const results = await mapSeries(grouped, async (group) => {\n return this.runCompileComponents(group.components, options, noThrow);\n });\n const linkComponents = options.linkComponents ?? true;\n if (linkComponents) {\n await linkToNodeModulesByComponents(components, this.workspace);\n }\n return results.flat();\n }\n\n /**\n * This will ensue that the envs of the components are loaded before the compilation starts.\n * @param components\n */\n private async loadExternalEnvs(components: Component[]) {\n const componentsIdsStr = components.map((c) => c.id.toString());\n const envIdsCompIdsMap = {};\n const compsWithWrongEnvId: string[] = [];\n await Promise.all(\n components.map(async (component) => {\n // It's important to use calculate here to get the real id even if it's not loaded\n const envId = (await this.envs.calculateEnvId(component)).toString();\n // This might be different from the env id above, because the component might be loaded before the env\n // in that case we will need to clear the cache of that component\n const envIdByGet = this.envs.getEnvId(component);\n if (envId !== envIdByGet) {\n compsWithWrongEnvId.push(component.id.toString());\n }\n // If it's part of the components it will be handled later as it's not external\n // and might need to be compiled as well\n if (componentsIdsStr.includes(envId)) return undefined;\n if (!envIdsCompIdsMap[envId]) envIdsCompIdsMap[envId] = [component.id.toString()];\n envIdsCompIdsMap[envId].push(component.id.toString());\n })\n );\n const externalEnvsIds = Object.keys(envIdsCompIdsMap);\n\n if (!externalEnvsIds.length) return;\n const nonLoadedEnvs = externalEnvsIds.filter((envId) => !this.envs.isEnvRegistered(envId));\n await this.workspace.loadAspects(nonLoadedEnvs);\n const idsToClearCache: string[] = uniq(\n nonLoadedEnvs\n .reduce((acc, envId) => {\n const compIds = envIdsCompIdsMap[envId];\n return [...acc, ...compIds];\n }, [] as string[])\n .concat(compsWithWrongEnvId)\n );\n this.workspace.clearComponentsCache(idsToClearCache.map((id) => ComponentID.fromString(id)));\n }\n\n private async runCompileComponents(\n components: Component[],\n options: CompileOptions,\n noThrow?: boolean\n ): Promise<BuildResult[]> {\n const componentsCompilers: ComponentCompiler[] = [];\n const skipped: BuildResult[] = [];\n\n components.forEach((c) => {\n const env = this.envs.getOrCalculateEnv(c);\n const environment = env.env;\n const compilerInstance = environment.getCompiler?.();\n\n if (compilerInstance) {\n const compilerName = compilerInstance.constructor.name || 'compiler';\n componentsCompilers.push(\n new ComponentCompiler(this.pubsub, this.workspace, c, compilerInstance, compilerName, this.logger, env)\n );\n } else {\n this.logger.warn(`unable to find a compiler instance for ${c.id.toString()}`);\n skipped.push({\n component: c.id.toString(),\n buildResults: [],\n errors: [],\n skipped: { reason: `the env \"${env.id}\" provides no compiler` },\n });\n }\n });\n\n const typeGeneratorParamsPerEnv = options.generateTypes\n ? await this.getTypesCompilerPerEnv(componentsCompilers)\n : undefined;\n\n if (typeGeneratorParamsPerEnv) {\n await this.preGenerateTypesOnWorkspace(typeGeneratorParamsPerEnv);\n }\n\n const resultOnWorkspace = await mapSeries(componentsCompilers, (componentCompiler) =>\n componentCompiler.compile(noThrow, options)\n );\n\n if (typeGeneratorParamsPerEnv) {\n await this.generateTypesOnWorkspace(typeGeneratorParamsPerEnv, componentsCompilers);\n }\n\n return [...resultOnWorkspace, ...skipped];\n }\n\n private async getTypesCompilerPerEnv(componentsCompilers: ComponentCompiler[]): Promise<TypeGeneratorParamsPerEnv[]> {\n const envsMap: { [envId: string]: ComponentCompiler[] } = {};\n componentsCompilers.forEach((componentCompiler) => {\n const envId = componentCompiler.env.id;\n if (!envsMap[envId]) envsMap[envId] = [];\n envsMap[envId].push(componentCompiler);\n });\n\n const results = await mapSeries(Object.keys(envsMap), async (envId) => {\n const componentCompilers = envsMap[envId];\n const compParams = await Promise.all(\n componentCompilers.map(async (componentCompiler) => {\n return {\n component: componentCompiler.component,\n packageDir: path.join(this.workspace.path, componentCompiler.getPackageDir()),\n };\n })\n );\n\n let typeCompiler = componentCompilers[0].compilerInstance;\n if (!typeCompiler.preGenerateTypesOnWorkspace) {\n const buildPipe = componentCompilers[0].env.env.getBuildPipe();\n const compilerTasks = buildPipe.filter((task) => task.aspectId === CompilerAspect.id);\n const tsTask = compilerTasks.find(\n (task) => task.compilerInstance && task.compilerInstance.displayName === 'TypeScript'\n );\n if (!tsTask) return;\n typeCompiler = tsTask.compilerInstance;\n if (!typeCompiler.preGenerateTypesOnWorkspace) return;\n }\n return { envId, compParams, typeCompiler };\n });\n return compact(results);\n }\n\n private async preGenerateTypesOnWorkspace(typesGeneratorParamsPerEnv: TypeGeneratorParamsPerEnv[]) {\n await mapSeries(typesGeneratorParamsPerEnv, async ({ envId, compParams, typeCompiler }) => {\n await typeCompiler.preGenerateTypesOnWorkspace!(compParams, envId);\n });\n }\n\n private async generateTypesOnWorkspace(\n typesGeneratorParamsPerEnv: TypeGeneratorParamsPerEnv[],\n componentsCompilers: ComponentCompiler[]\n ) {\n await mapSeries(typesGeneratorParamsPerEnv, async ({ compParams, typeCompiler }) => {\n await typeCompiler.generateTypesOnWorkspace!(path.join(this.workspace.path, 'node_modules'), compParams);\n });\n await Promise.all(componentsCompilers.map((componentCompiler) => componentCompiler.copyTypesToOtherDists()));\n }\n\n /**\n * This function groups the components to compile into groups by their environment and dependencies.\n * The order of the groups is important, the first group should be compiled first.\n * The order inside the group is not important.\n * The groups are:\n * 1. dependencies of envs of envs.\n * 2. envs of envs.\n * 3. dependencies of envs.\n * 4. envs.\n * 5. the rest.\n * @param ids\n */\n async buildGroupsToCompile(\n components: Component[],\n graph?: CompIdGraph\n ): Promise<\n Array<{\n components: Component[];\n envsOfEnvs?: boolean;\n envs?: boolean;\n depsOfEnvsOfEnvs?: boolean;\n depsOfEnvs?: boolean;\n other?: boolean;\n }>\n > {\n const envCompIds = await Promise.all(\n components\n // .map((component) => this.envs.getEnvId(component))\n .map(async (component) => {\n const envId = await this.envs.calculateEnvId(component);\n return envId.toString();\n })\n );\n const envsIds = uniq(envCompIds);\n const groupedByIsEnv = groupBy(components, (component) => {\n if (envsIds.includes(component.id.toString())) return 'envs';\n if (this.envs.isEnv(component)) return 'envs';\n return 'other';\n });\n const envsOfEnvsCompIds = await Promise.all(\n (groupedByIsEnv.envs || [])\n // .map((component) => this.envs.getEnvId(component))\n .map(async (component) => (await this.envs.calculateEnvId(component)).toString())\n );\n const groupedByEnvsOfEnvs = groupBy(groupedByIsEnv.envs, (component) => {\n if (envsOfEnvsCompIds.includes(component.id.toString())) return 'envsOfEnvs';\n return 'otherEnvs';\n });\n const envsOfEnvsWithoutCoreCompIds = envsOfEnvsCompIds.filter((id) => !this.envs.isCoreEnv(id));\n let depsOfEnvsOfEnvsCompIds: string[] = [];\n if (graph) {\n // envs installed as packages (e.g. legacy core envs) are not part of the workspace graph\n const envsOfEnvsOnGraph = envsOfEnvsWithoutCoreCompIds.filter((id) => graph.hasNode(id));\n const subGraph = graph.successorsSubgraph(envsOfEnvsOnGraph, {\n nodeFilter: (node) => this.workspace.hasId(node.attr),\n });\n depsOfEnvsOfEnvsCompIds = subGraph.nodes.map((n) => n.id);\n } else {\n const depsOfEnvsOfEnvsCompLists = (groupedByEnvsOfEnvs.envsOfEnvs || []).map((envComp) =>\n this.dependencyResolver.getDependencies(envComp)\n );\n depsOfEnvsOfEnvsCompIds = DependencyList.merge(depsOfEnvsOfEnvsCompLists)\n .getComponentDependencies()\n .map((dep) => dep.id.toString());\n }\n const groupedByIsDepsOfEnvsOfEnvs = groupBy(groupedByIsEnv.other, (component) => {\n if (depsOfEnvsOfEnvsCompIds.includes(component.id.toString())) return 'depsOfEnvsOfEnvs';\n return 'other';\n });\n let depsOfEnvsOfCompIds: string[] = [];\n if (graph) {\n const otherEnvsIds = (groupedByEnvsOfEnvs.otherEnvs || []).map((c) => c.id.toString());\n if (otherEnvsIds.length) {\n const otherEnvsWithoutCoreIds = otherEnvsIds.filter((id) => !this.envs.isCoreEnv(id) && graph.hasNode(id));\n const subGraph = graph.successorsSubgraph(otherEnvsWithoutCoreIds, {\n nodeFilter: (node) => this.workspace.hasId(node.attr),\n });\n depsOfEnvsOfCompIds = subGraph.nodes.map((n) => n.id);\n }\n } else {\n const depsOfEnvsCompLists = (groupedByEnvsOfEnvs.otherEnvs || []).map((envComp) =>\n this.dependencyResolver.getDependencies(envComp)\n );\n depsOfEnvsOfCompIds = DependencyList.merge(depsOfEnvsCompLists)\n .getComponentDependencies()\n .map((dep) => dep.id.toString());\n }\n const groupedByIsDepsOfEnvs = groupBy(groupedByIsDepsOfEnvsOfEnvs.other, (component) => {\n if (depsOfEnvsOfCompIds.includes(component.id.toString())) return 'depsOfEnvs';\n return 'other';\n });\n return [\n {\n components: groupedByIsDepsOfEnvsOfEnvs.depsOfEnvsOfEnvs || [],\n depsOfEnvsOfEnvs: true,\n },\n {\n components: groupedByEnvsOfEnvs.envsOfEnvs || [],\n envsOfEnvs: true,\n },\n {\n components: groupedByIsDepsOfEnvs.depsOfEnvs || [],\n depsOfEnvs: true,\n },\n {\n components: groupedByEnvsOfEnvs.otherEnvs || [],\n envs: true,\n },\n {\n components: groupedByIsDepsOfEnvs.other || [],\n other: true,\n },\n ];\n }\n\n private async getIdsToCompile(componentsIds: Array<string | ComponentID>, changed = false): Promise<ComponentID[]> {\n if (componentsIds.length) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(componentsIds);\n return this.workspace.filterIds(componentIds);\n }\n if (changed) {\n return this.workspace.getNewAndModifiedIds();\n }\n return this.workspace.listIds();\n }\n}\n\nfunction formatCompileResults(buildResults: BuildResult[], verbose?: boolean) {\n // this gets called when a file is changed, so the buildResults array always has only one item\n const buildResult = buildResults.find((result) => !result.skipped);\n if (!buildResult) return '';\n const title = ` ${chalk.underline('STATUS\\tCOMPONENT ID')}`;\n const verboseComponentFilesArrayToString = () => {\n return buildResult.buildResults.map((filePath) => ` \\t - ${filePath}`).join('\\n');\n };\n\n return `${title}\n ${Logger.successSymbol()}SUCCESS\\t${buildResult.component}\\n\n ${verbose ? `${verboseComponentFilesArrayToString()}\\n` : ''}`;\n}\n"],"mappings":";;;;;;AACA,SAAA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AAClD,IAAI,CAAC,IAAI,CAAC;EACnF,CAAC;EAED,OAAO,GAAG6O,KAAK;AACjB,IAAII,gBAAM,CAACC,aAAa,CAAC,CAAC,YAAYN,WAAW,CAACzS,SAAS;AAC3D,IAAIoJ,OAAO,GAAG,GAAGyJ,kCAAkC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE;AAChE","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_globby","_fsExtra","_workspace","_path","_chalk","_componentId","_logger","_legacy","_component","_workspaceModules","_dependencyResolver","_pkgModules","_workspace2","_lodash","_compiler","_events","_types","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ComponentCompiler","constructor","pubsub","workspace","component","compilerInstance","compilerId","logger","env","dists","compileErrors","compile","noThrow","options","dataToPersist","deleteDistDir","distDirs","relativeDistDirs","filter","distDir","path","isAbsolute","absoluteDistDirs","length","DataToPersist","removePath","RemovePath","addBasePath","persistAllToFS","Promise","all","map","fs","remove","innerCompilers","compilers","canTranspileFile","find","c","transpileFile","canTranspileComponent","transpileComponent","filesystem","files","file","compileOneFile","initiator","compileAllFiles","Error","toString","throwOnCompileErrors","relativeDists","distFile","absoluteDists","addManyFiles","write","buildResults","state","_consumer","compiler","consoleSuccess","id","errors","getPackageDir","packageName","componentIdToPackageName","join","toAbsolutePath","pathToResolve","forEach","errorItem","error","formatError","err","pub","CompilerAspect","CompilerErrorEvent","console","message","packageDir","distDirName","getDistDir","DEFAULT_DIST_DIRNAME","injectedDirs","getInjectedDirs","dist","rootDirs","readRootComponentsDir","rootComponentsPath","rootDir","relative","componentDir","copyTypesToOtherDists","packageDistDir","otherDirs","slice","packageDistDirAbs","matches","globby","cwd","onlyFiles","ignore","distDirAbs","match","source","dest","copyFile","copyCompiledFilesToOtherDists","outputDir","getComponentPackagePath","sourceDistDirAbs","pathExists","dir","resolve","ensureDir","dirname","filePath","isFileSupported","compileResults","contents","push","base","result","Dist","outputPath","Buffer","from","outputText","shouldCopyNonSupportedFiles","filesToCompile","exports","WorkspaceCompiler","envs","aspectLoader","ui","dependencyResolver","watcher","Set","registerOnComponentChange","onComponentChange","bind","registerOnComponentAdd","onComponentAdd","registerOnPreWatch","onPreWatch","registerPreStart","onPreStart","registerOnAspectLoadErrorSlot","onAspectLoadFail","preStartOpts","skipCompilation","compileComponents","changed","verbose","CompilationInitiator","PreStart","watchScopeInternalFiles","code","includes","inInstallContext","inInstallAfterPmContext","shouldCompile","idStr","hasId","ignoreVersion","debug","componentsBeingProcessedInOnAspectLoadFail","has","add","graph","successors","getEnvDepsGraph","depsIds","s","AspectLoadFail","loadExtensions","executeLoadSlot","delete","envComponentId","getGraphIds","nodeFilter","node","attr","watchOpts","undefined","removedFiles","Boolean","removeLinksFromNodeModules","ComponentChanged","generateTypes","results","formatCompileResults","componentIds","preCompile","start","Date","now","PreWatch","end","componentsIds","componentLoadOptions","OutsideWorkspaceError","getIdsToCompile","loadSeedersAsAspects","components","getMany","loadExternalEnvs","grouped","buildGroupsToCompile","mapSeries","group","runCompileComponents","linkComponents","linkToNodeModulesByComponents","flat","componentsIdsStr","envIdsCompIdsMap","compsWithWrongEnvId","envId","calculateEnvId","envIdByGet","getEnvId","externalEnvsIds","keys","nonLoadedEnvs","isEnvRegistered","loadAspects","idsToClearCache","uniq","reduce","acc","compIds","concat","clearComponentsCache","ComponentID","fromString","componentsCompilers","skipped","getOrCalculateEnv","environment","getCompiler","compilerName","name","warn","reason","typeGeneratorParamsPerEnv","getTypesCompilerPerEnv","preGenerateTypesOnWorkspace","resultOnWorkspace","componentCompiler","generateTypesOnWorkspace","envsMap","componentCompilers","compParams","typeCompiler","buildPipe","getBuildPipe","compilerTasks","task","aspectId","tsTask","displayName","compact","typesGeneratorParamsPerEnv","envCompIds","envsIds","groupedByIsEnv","groupBy","isEnv","envsOfEnvsCompIds","groupedByEnvsOfEnvs","envsOfEnvsWithoutCoreCompIds","isCoreEnv","depsOfEnvsOfEnvsCompIds","envsOfEnvsOnGraph","hasNode","subGraph","successorsSubgraph","nodes","n","depsOfEnvsOfEnvsCompLists","envsOfEnvs","envComp","getDependencies","DependencyList","merge","getComponentDependencies","dep","groupedByIsDepsOfEnvsOfEnvs","other","depsOfEnvsOfCompIds","otherEnvsIds","otherEnvs","otherEnvsWithoutCoreIds","depsOfEnvsCompLists","groupedByIsDepsOfEnvs","depsOfEnvsOfEnvs","depsOfEnvs","resolveMultipleComponentIds","filterIds","getNewAndModifiedIds","listIds","buildResult","title","chalk","underline","verboseComponentFilesArrayToString","Logger","successSymbol"],"sources":["workspace-compiler.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport mapSeries from 'p-map-series';\nimport globby from 'globby';\nimport fs from 'fs-extra';\nimport type { Component } from '@teambit/component';\nimport type { EnvDefinition, EnvsMain } from '@teambit/envs';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { OutsideWorkspaceError } from '@teambit/workspace';\nimport type { WorkspaceComponentLoadOptions, SerializableResults, Workspace } from '@teambit/workspace';\nimport type { WatcherMain, WatchOptions } from '@teambit/watcher';\nimport path from 'path';\nimport chalk from 'chalk';\nimport { ComponentID } from '@teambit/component-id';\nimport { Logger } from '@teambit/logger';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy.constants';\nimport type { AbstractVinyl } from '@teambit/component.sources';\nimport { Dist, DataToPersist, RemovePath } from '@teambit/component.sources';\nimport {\n linkToNodeModulesByComponents,\n removeLinksFromNodeModules,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport type { AspectLoaderMain } from '@teambit/aspect-loader';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyList } from '@teambit/dependency-resolver';\nimport type { PathOsBasedAbsolute } from '@teambit/toolbox.path.path';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport type { UiMain, PreStartOpts } from '@teambit/ui';\nimport { readRootComponentsDir } from '@teambit/workspace.root-components';\nimport { compact, groupBy, uniq } from 'lodash';\nimport type { CompIdGraph } from '@teambit/graph';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompilerErrorEvent } from './events';\nimport type { Compiler, TypeGeneratorCompParams } from './types';\nimport { CompilationInitiator } from './types';\n\nexport type BuildResult = {\n component: string;\n buildResults: string[];\n errors: CompileError[];\n /**\n * set when nothing was compiled for the component because its env provides no compiler. such a\n * component is neither a success nor a failure, so it is counted and reported on its own.\n */\n skipped?: { reason: string };\n};\n\nexport type CompileOptions = {\n changed?: boolean; // compile only new and modified components\n verbose?: boolean; // show more data, such as, dist paths\n /**\n * whether the dist root dir should be deleted before writing new dists.\n * defaults to true for `bit compile` and false everywhere else, such as `bit watch` and `bit\n * start` to avoid webpack \"EINTR\" error.\n */\n deleteDistDir?: boolean;\n initiator: CompilationInitiator; // describes where the compilation is coming from\n // should we create links in node_modules for the compiled components (default = true)\n // this will link the source files, and create the package.json\n linkComponents?: boolean;\n /**\n * whether to generate types after the compilation, default = false.\n * keep in mind that it's a heavy operation, and hurts the performance.\n */\n generateTypes?: boolean;\n};\n\nexport type CompileError = { path: string; error: Error };\n\nexport class ComponentCompiler {\n constructor(\n private pubsub: PubsubMain,\n private workspace: Workspace,\n readonly component: Component,\n readonly compilerInstance: Compiler,\n private compilerId: string,\n private logger: Logger,\n readonly env: EnvDefinition,\n private dists: Dist[] = [],\n private compileErrors: CompileError[] = []\n ) {}\n\n async compile(noThrow = true, options: CompileOptions): Promise<BuildResult> {\n let dataToPersist;\n const deleteDistDir = options.deleteDistDir ?? this.compilerInstance.deleteDistDir;\n const distDirs = await this.distDirs();\n // delete dist folder before transpilation (because some compilers (like ngPackagr) can generate files there during the compilation process)\n if (deleteDistDir) {\n const relativeDistDirs = distDirs.filter((distDir) => !path.isAbsolute(distDir));\n const absoluteDistDirs = distDirs.filter((distDir) => path.isAbsolute(distDir));\n if (relativeDistDirs.length) {\n dataToPersist = new DataToPersist();\n for (const distDir of relativeDistDirs) {\n dataToPersist.removePath(new RemovePath(distDir));\n }\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n }\n await Promise.all(absoluteDistDirs.map((distDir) => fs.remove(distDir)));\n }\n\n // a multi-compiler exposes its inner compilers.\n const innerCompilers: Compiler[] | undefined = (this.compilerInstance as { compilers?: Compiler[] }).compilers;\n const compilers: Compiler[] = innerCompilers || [this.compilerInstance];\n const canTranspileFile = compilers.find((c) => c.transpileFile);\n const canTranspileComponent = compilers.find((c) => c.transpileComponent);\n\n if (canTranspileFile) {\n await Promise.all(\n this.component.filesystem.files.map((file: AbstractVinyl) =>\n this.compileOneFile(file, options.initiator, distDirs)\n )\n );\n }\n\n if (canTranspileComponent) {\n await this.compileAllFiles(options.initiator, distDirs);\n }\n\n if (!canTranspileFile && !canTranspileComponent) {\n throw new Error(\n `compiler ${this.compilerId.toString()} doesn't implement either \"transpileFile\" or \"transpileComponent\" methods`\n );\n }\n this.throwOnCompileErrors(noThrow);\n\n // writing the dists with `component.setDists(dists); component.dists.writeDists` is tricky\n // as it uses other base-paths and doesn't respect the new node-modules base path.\n const relativeDists = this.dists.filter((distFile) => !path.isAbsolute(distFile.path));\n const absoluteDists = this.dists.filter((distFile) => path.isAbsolute(distFile.path));\n if (relativeDists.length) {\n dataToPersist = new DataToPersist();\n dataToPersist.addManyFiles(relativeDists);\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\n }\n await Promise.all(absoluteDists.map((distFile) => distFile.write()));\n const buildResults = this.dists.map((distFile) => distFile.path);\n if (this.component.state._consumer.compiler) this.logger.consoleSuccess();\n\n return { component: this.component.id.toString(), buildResults, errors: this.compileErrors };\n }\n\n getPackageDir() {\n const packageName = componentIdToPackageName(this.component.state._consumer);\n return path.join('node_modules', packageName);\n }\n\n private toAbsolutePath(pathToResolve: string): string {\n return path.isAbsolute(pathToResolve) ? pathToResolve : path.join(this.workspace.path, pathToResolve);\n }\n\n private throwOnCompileErrors(noThrow = true) {\n if (this.compileErrors.length) {\n this.compileErrors.forEach((errorItem) => {\n this.logger.error(`compilation error at ${errorItem.path}`, errorItem.error);\n });\n const formatError = (errorItem) => `${errorItem.path}\\n${errorItem.error}`;\n const err = new Error(`compilation failed. see the following errors from the compiler\n${this.compileErrors.map(formatError).join('\\n')}`);\n\n this.pubsub.pub(CompilerAspect.id, new CompilerErrorEvent(err));\n\n if (!noThrow) {\n throw err;\n }\n\n this.logger.console(err.message);\n }\n }\n\n private async distDirs(): Promise<string[]> {\n const packageName = componentIdToPackageName(this.component.state._consumer);\n const packageDir = path.join('node_modules', packageName);\n const distDirName = this.compilerInstance.getDistDir?.() || DEFAULT_DIST_DIRNAME;\n const injectedDirs = await this.getInjectedDirs(packageName);\n return [packageDir, ...injectedDirs].map((dist) => path.join(dist, distDirName));\n }\n\n private async getInjectedDirs(packageName: string): Promise<string[]> {\n const injectedDirs = await this.workspace.getInjectedDirs(this.component);\n if (injectedDirs.length > 0) return injectedDirs;\n\n const rootDirs = await readRootComponentsDir(this.workspace.rootComponentsPath);\n return rootDirs.map((rootDir) => path.relative(this.workspace.path, path.join(rootDir, packageName)));\n }\n\n private get componentDir(): PathOsBasedAbsolute {\n return this.workspace.componentDir(this.component.id);\n }\n\n async copyTypesToOtherDists() {\n const distDirs = await this.distDirs();\n if (distDirs.length <= 1) return;\n const packageDistDir = distDirs[0];\n const otherDirs = distDirs.slice(1);\n const packageDistDirAbs = this.toAbsolutePath(packageDistDir);\n const matches = await globby(`**/*.d.ts`, {\n cwd: packageDistDirAbs,\n onlyFiles: true,\n ignore: [`${packageDistDir}/node_modules/`],\n });\n if (!matches.length) return;\n await Promise.all(\n otherDirs.map(async (distDir) => {\n const distDirAbs = this.toAbsolutePath(distDir);\n await Promise.all(\n matches.map(async (match) => {\n const source = path.join(packageDistDirAbs, match);\n const dest = path.join(distDirAbs, match);\n await fs.copyFile(source, dest);\n })\n );\n })\n );\n }\n\n /**\n * Copy all compiled files from the outputDir (where the compiler wrote) to all other dist directories.\n * This is needed for compilers that use transpileComponent and write directly to the filesystem,\n * as they only receive one outputDir but files need to be available in all dist locations.\n */\n async copyCompiledFilesToOtherDists() {\n const distDirs = await this.distDirs();\n if (distDirs.length <= 1) return;\n\n // The compiler writes to the outputDir from getComponentPackagePath + distDirName\n const outputDir = await this.workspace.getComponentPackagePath(this.component);\n const distDirName = this.compilerInstance.getDistDir?.() || DEFAULT_DIST_DIRNAME;\n const sourceDistDirAbs = path.join(outputDir, distDirName);\n\n // Check if the dist directory exists (compiler may not have written anything)\n if (!(await fs.pathExists(sourceDistDirAbs))) return;\n\n const otherDirs = distDirs.filter(\n (dir) => path.resolve(this.toAbsolutePath(dir)) !== path.resolve(sourceDistDirAbs)\n );\n\n if (!otherDirs.length) return;\n\n const matches = await globby(`**/*`, {\n cwd: sourceDistDirAbs,\n onlyFiles: true,\n ignore: ['node_modules/**'],\n });\n if (!matches.length) return;\n\n await Promise.all(\n otherDirs.map(async (distDir) => {\n const distDirAbs = this.toAbsolutePath(distDir);\n await Promise.all(\n matches.map(async (match) => {\n const source = path.join(sourceDistDirAbs, match);\n const dest = path.join(distDirAbs, match);\n try {\n await fs.ensureDir(path.dirname(dest));\n await fs.copyFile(source, dest);\n } catch (err: any) {\n throw new Error(`failed to copy compiled file from \"${source}\" to \"${dest}\": ${err.message}`);\n }\n })\n );\n })\n );\n }\n\n private async compileOneFile(\n file: AbstractVinyl,\n initiator: CompilationInitiator,\n distDirs: string[]\n ): Promise<void> {\n const options = { componentDir: this.componentDir, filePath: file.relative, initiator };\n const isFileSupported = this.compilerInstance.isFileSupported(file.path);\n let compileResults;\n if (isFileSupported) {\n try {\n compileResults = await this.compilerInstance.transpileFile?.(file.contents.toString(), options);\n } catch (error: any) {\n this.compileErrors.push({ path: file.path, error });\n return;\n }\n }\n for (const base of distDirs) {\n if (isFileSupported && compileResults) {\n this.dists.push(\n ...compileResults.map(\n (result) =>\n new Dist({\n base,\n path: path.join(base, result.outputPath),\n contents: Buffer.from(result.outputText),\n })\n )\n );\n } else if (this.compilerInstance.shouldCopyNonSupportedFiles) {\n // compiler doesn't support this file type. copy the file as is to the dist dir.\n this.dists.push(new Dist({ base, path: path.join(base, file.relative), contents: file.contents }));\n }\n }\n }\n\n private async compileAllFiles(initiator: CompilationInitiator, distDirs: string[]): Promise<void> {\n const filesToCompile: AbstractVinyl[] = [];\n for (const base of distDirs) {\n this.component.filesystem.files.forEach((file: AbstractVinyl) => {\n const isFileSupported = this.compilerInstance.isFileSupported(file.path);\n if (isFileSupported) {\n filesToCompile.push(file);\n } else if (this.compilerInstance.shouldCopyNonSupportedFiles) {\n // compiler doesn't support this file type. copy the file as is to the dist dir.\n this.dists.push(\n new Dist({\n base,\n path: path.join(base, file.relative),\n contents: file.contents,\n })\n );\n }\n });\n }\n\n if (filesToCompile.length) {\n try {\n await this.compilerInstance.transpileComponent?.({\n component: this.component,\n componentDir: this.componentDir,\n outputDir: await this.workspace.getComponentPackagePath(this.component),\n initiator,\n });\n // Copy compiled files to all other dist directories (injected dirs)\n await this.copyCompiledFilesToOtherDists();\n } catch (error: any) {\n this.compileErrors.push({ path: this.componentDir, error });\n }\n }\n }\n}\n\ntype TypeGeneratorParamsPerEnv = { envId: string; compParams: TypeGeneratorCompParams[]; typeCompiler: Compiler };\n\nexport class WorkspaceCompiler {\n private componentsBeingProcessedInOnAspectLoadFail = new Set<string>();\n\n constructor(\n private workspace: Workspace,\n private envs: EnvsMain,\n private pubsub: PubsubMain,\n private aspectLoader: AspectLoaderMain,\n private ui: UiMain,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\n private watcher: WatcherMain\n ) {\n if (this.workspace) {\n this.workspace.registerOnComponentChange(this.onComponentChange.bind(this));\n this.workspace.registerOnComponentAdd(this.onComponentAdd.bind(this));\n this.watcher.registerOnPreWatch(this.onPreWatch.bind(this));\n }\n this.ui.registerPreStart(this.onPreStart.bind(this));\n if (this.aspectLoader) {\n this.aspectLoader.registerOnAspectLoadErrorSlot(this.onAspectLoadFail.bind(this));\n }\n }\n\n async onPreStart(preStartOpts: PreStartOpts): Promise<void> {\n if (this.workspace) {\n if (preStartOpts.skipCompilation) {\n return;\n }\n await this.compileComponents([], {\n changed: true,\n verbose: false,\n deleteDistDir: false,\n initiator: CompilationInitiator.PreStart,\n });\n } else {\n await this.watcher.watchScopeInternalFiles();\n }\n }\n\n async onAspectLoadFail(err: Error & { code?: string }, component: Component): Promise<boolean> {\n if (\n ((err.code &&\n (err.code === 'MODULE_NOT_FOUND' ||\n err.code === 'ERR_MODULE_NOT_FOUND' ||\n err.code === 'ERR_REQUIRE_ESM' ||\n // node refuses to load .ts files from node_modules. happens when the loaded instance\n // has only the component sources (e.g. re-created by the package manager mid-install)\n // and compiling the component fixes it, same as a missing-module failure\n err.code === 'ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING')) ||\n err.message.includes('import.meta') ||\n err.message.includes('exports is not defined')) &&\n this.workspace\n ) {\n const inInstallContext = this.workspace.inInstallContext;\n const inInstallAfterPmContext = this.workspace.inInstallAfterPmContext;\n // If we are now running install we only want to compile after the package manager is done\n const shouldCompile = (inInstallContext && inInstallAfterPmContext) || !inInstallContext;\n if (shouldCompile) {\n const id = component.id;\n const idStr = id.toString();\n\n // compiling can only fix a workspace component whose dists are missing or stale. when the\n // failed aspect is not in the workspace (e.g. an env that used to be a core aspect,\n // resolved to its pinned version but not installed yet), the cascade below imports the\n // env's full dependency closure from the remote and recompiles a large part of the\n // workspace into every injected node_modules copy - minutes of work that cannot\n // materialize the missing package. skip it and let the regular missing-aspect handling\n // report it (a NonLoadedEnv issue with a \"bit install\" remediation).\n if (!this.workspace.hasId(id, { ignoreVersion: true })) {\n this.logger.debug(\n `onAspectLoadFail: skipping compilation of ${idStr} - not a workspace component, compiling cannot fix its missing module`\n );\n return false;\n }\n\n // Prevent infinite loop when there's a circular dependency between an env and a component.\n // If we're already processing this component, don't re-enter.\n if (this.componentsBeingProcessedInOnAspectLoadFail.has(idStr)) {\n this.logger.debug(\n `onAspectLoadFail: skipping ${idStr} as it's already being processed (preventing infinite loop)`\n );\n return false;\n }\n\n this.componentsBeingProcessedInOnAspectLoadFail.add(idStr);\n try {\n const { graph, successors } = await this.getEnvDepsGraph(id);\n // const deps = this.dependencyResolver.getDependencies(component);\n // const depsIds = deps.getComponentDependencies().map((dep) => {\n // return dep.id.toString();\n // });\n const depsIds = successors.map((s) => s.id);\n await this.compileComponents(\n [id.toString(), ...depsIds],\n { initiator: CompilationInitiator.AspectLoadFail },\n true,\n { loadExtensions: true, executeLoadSlot: true },\n graph\n );\n return true;\n } finally {\n this.componentsBeingProcessedInOnAspectLoadFail.delete(idStr);\n }\n }\n }\n return false;\n }\n\n async getEnvDepsGraph(envComponentId: ComponentID): Promise<{ graph: CompIdGraph; successors: { id: string }[] }> {\n const graph = await this.workspace.getGraphIds([envComponentId]);\n const successors = graph.successors(envComponentId.toString(), {\n nodeFilter: (node) => this.workspace.hasId(node.attr),\n });\n return { graph, successors };\n }\n\n async onComponentAdd(component: Component, files: string[], watchOpts: WatchOptions) {\n return this.onComponentChange(component, files, undefined, watchOpts);\n }\n\n async onComponentChange(\n component: Component,\n files: string[],\n removedFiles: string[] = [],\n watchOpts: WatchOptions\n ): Promise<SerializableResults | void> {\n if (!watchOpts.compile) return undefined;\n // when files are removed, we need to remove the dist directories and the old symlinks, otherwise, it has\n // symlinks to non-exist files and the dist has stale files\n const deleteDistDir = Boolean(removedFiles?.length);\n if (removedFiles?.length) {\n await removeLinksFromNodeModules(component, this.workspace, removedFiles);\n }\n const buildResults = await this.compileComponents(\n [component.id.toString()],\n {\n initiator: watchOpts.initiator || CompilationInitiator.ComponentChanged,\n deleteDistDir,\n generateTypes: watchOpts.generateTypes,\n },\n true\n );\n return {\n results: buildResults,\n toString() {\n return formatCompileResults(buildResults, watchOpts.verbose);\n },\n };\n }\n\n async onPreWatch(componentIds: ComponentID[], watchOpts: WatchOptions) {\n if (watchOpts.preCompile) {\n const start = Date.now();\n this.logger.console(`compiling ${componentIds.length} components`);\n await this.compileComponents(\n componentIds.map((id) => id),\n { initiator: CompilationInitiator.PreWatch, generateTypes: watchOpts.generateTypes }\n );\n const end = Date.now() - start;\n this.logger.consoleSuccess(`compiled ${componentIds.length} components successfully (${end / 1000} sec)`);\n }\n }\n\n async compileComponents(\n componentsIds: string[] | ComponentID[] | ComponentID[], // when empty, it compiles new+modified (unless options.all is set),\n options: CompileOptions,\n noThrow?: boolean,\n componentLoadOptions: WorkspaceComponentLoadOptions = {},\n graph?: CompIdGraph\n ): Promise<BuildResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const componentIds = await this.getIdsToCompile(componentsIds, options.changed);\n // In case the aspect failed to load, we want to compile it without try to re-load it again\n if (options.initiator === CompilationInitiator.AspectLoadFail) {\n componentLoadOptions.loadSeedersAsAspects = false;\n }\n let components = await this.workspace.getMany(componentIds, componentLoadOptions);\n await this.loadExternalEnvs(components);\n // reload components as we might cleared the cache as part of the loadExternalEnvs\n components = await this.workspace.getMany(componentIds, componentLoadOptions);\n const grouped = await this.buildGroupsToCompile(components, graph);\n\n const results = await mapSeries(grouped, async (group) => {\n return this.runCompileComponents(group.components, options, noThrow);\n });\n const linkComponents = options.linkComponents ?? true;\n if (linkComponents) {\n await linkToNodeModulesByComponents(components, this.workspace);\n }\n return results.flat();\n }\n\n /**\n * This will ensue that the envs of the components are loaded before the compilation starts.\n * @param components\n */\n private async loadExternalEnvs(components: Component[]) {\n const componentsIdsStr = components.map((c) => c.id.toString());\n const envIdsCompIdsMap = {};\n const compsWithWrongEnvId: string[] = [];\n await Promise.all(\n components.map(async (component) => {\n // It's important to use calculate here to get the real id even if it's not loaded\n const envId = (await this.envs.calculateEnvId(component)).toString();\n // This might be different from the env id above, because the component might be loaded before the env\n // in that case we will need to clear the cache of that component\n const envIdByGet = this.envs.getEnvId(component);\n if (envId !== envIdByGet) {\n compsWithWrongEnvId.push(component.id.toString());\n }\n // If it's part of the components it will be handled later as it's not external\n // and might need to be compiled as well\n if (componentsIdsStr.includes(envId)) return undefined;\n if (!envIdsCompIdsMap[envId]) envIdsCompIdsMap[envId] = [component.id.toString()];\n envIdsCompIdsMap[envId].push(component.id.toString());\n })\n );\n const externalEnvsIds = Object.keys(envIdsCompIdsMap);\n\n if (!externalEnvsIds.length) return;\n const nonLoadedEnvs = externalEnvsIds.filter((envId) => !this.envs.isEnvRegistered(envId));\n await this.workspace.loadAspects(nonLoadedEnvs);\n const idsToClearCache: string[] = uniq(\n nonLoadedEnvs\n .reduce((acc, envId) => {\n const compIds = envIdsCompIdsMap[envId];\n return [...acc, ...compIds];\n }, [] as string[])\n .concat(compsWithWrongEnvId)\n );\n this.workspace.clearComponentsCache(idsToClearCache.map((id) => ComponentID.fromString(id)));\n }\n\n private async runCompileComponents(\n components: Component[],\n options: CompileOptions,\n noThrow?: boolean\n ): Promise<BuildResult[]> {\n const componentsCompilers: ComponentCompiler[] = [];\n const skipped: BuildResult[] = [];\n\n components.forEach((c) => {\n const env = this.envs.getOrCalculateEnv(c);\n const environment = env.env;\n const compilerInstance = environment.getCompiler?.();\n\n if (compilerInstance) {\n const compilerName = compilerInstance.constructor.name || 'compiler';\n componentsCompilers.push(\n new ComponentCompiler(this.pubsub, this.workspace, c, compilerInstance, compilerName, this.logger, env)\n );\n } else {\n this.logger.warn(`unable to find a compiler instance for ${c.id.toString()}`);\n skipped.push({\n component: c.id.toString(),\n buildResults: [],\n errors: [],\n skipped: { reason: `the env \"${env.id}\" provides no compiler` },\n });\n }\n });\n\n const typeGeneratorParamsPerEnv = options.generateTypes\n ? await this.getTypesCompilerPerEnv(componentsCompilers)\n : undefined;\n\n if (typeGeneratorParamsPerEnv) {\n await this.preGenerateTypesOnWorkspace(typeGeneratorParamsPerEnv);\n }\n\n const resultOnWorkspace = await mapSeries(componentsCompilers, (componentCompiler) =>\n componentCompiler.compile(noThrow, options)\n );\n\n if (typeGeneratorParamsPerEnv) {\n await this.generateTypesOnWorkspace(typeGeneratorParamsPerEnv, componentsCompilers);\n }\n\n return [...resultOnWorkspace, ...skipped];\n }\n\n private async getTypesCompilerPerEnv(componentsCompilers: ComponentCompiler[]): Promise<TypeGeneratorParamsPerEnv[]> {\n const envsMap: { [envId: string]: ComponentCompiler[] } = {};\n componentsCompilers.forEach((componentCompiler) => {\n const envId = componentCompiler.env.id;\n if (!envsMap[envId]) envsMap[envId] = [];\n envsMap[envId].push(componentCompiler);\n });\n\n const results = await mapSeries(Object.keys(envsMap), async (envId) => {\n const componentCompilers = envsMap[envId];\n const compParams = await Promise.all(\n componentCompilers.map(async (componentCompiler) => {\n return {\n component: componentCompiler.component,\n packageDir: path.join(this.workspace.path, componentCompiler.getPackageDir()),\n };\n })\n );\n\n let typeCompiler = componentCompilers[0].compilerInstance;\n if (!typeCompiler.preGenerateTypesOnWorkspace) {\n const buildPipe = componentCompilers[0].env.env.getBuildPipe();\n const compilerTasks = buildPipe.filter((task) => task.aspectId === CompilerAspect.id);\n const tsTask = compilerTasks.find(\n (task) => task.compilerInstance && task.compilerInstance.displayName === 'TypeScript'\n );\n if (!tsTask) return;\n typeCompiler = tsTask.compilerInstance;\n if (!typeCompiler.preGenerateTypesOnWorkspace) return;\n }\n return { envId, compParams, typeCompiler };\n });\n return compact(results);\n }\n\n private async preGenerateTypesOnWorkspace(typesGeneratorParamsPerEnv: TypeGeneratorParamsPerEnv[]) {\n await mapSeries(typesGeneratorParamsPerEnv, async ({ envId, compParams, typeCompiler }) => {\n await typeCompiler.preGenerateTypesOnWorkspace!(compParams, envId);\n });\n }\n\n private async generateTypesOnWorkspace(\n typesGeneratorParamsPerEnv: TypeGeneratorParamsPerEnv[],\n componentsCompilers: ComponentCompiler[]\n ) {\n await mapSeries(typesGeneratorParamsPerEnv, async ({ compParams, typeCompiler }) => {\n await typeCompiler.generateTypesOnWorkspace!(path.join(this.workspace.path, 'node_modules'), compParams);\n });\n await Promise.all(componentsCompilers.map((componentCompiler) => componentCompiler.copyTypesToOtherDists()));\n }\n\n /**\n * This function groups the components to compile into groups by their environment and dependencies.\n * The order of the groups is important, the first group should be compiled first.\n * The order inside the group is not important.\n * The groups are:\n * 1. dependencies of envs of envs.\n * 2. envs of envs.\n * 3. dependencies of envs.\n * 4. envs.\n * 5. the rest.\n * @param ids\n */\n async buildGroupsToCompile(\n components: Component[],\n graph?: CompIdGraph\n ): Promise<\n Array<{\n components: Component[];\n envsOfEnvs?: boolean;\n envs?: boolean;\n depsOfEnvsOfEnvs?: boolean;\n depsOfEnvs?: boolean;\n other?: boolean;\n }>\n > {\n const envCompIds = await Promise.all(\n components\n // .map((component) => this.envs.getEnvId(component))\n .map(async (component) => {\n const envId = await this.envs.calculateEnvId(component);\n return envId.toString();\n })\n );\n const envsIds = uniq(envCompIds);\n const groupedByIsEnv = groupBy(components, (component) => {\n if (envsIds.includes(component.id.toString())) return 'envs';\n if (this.envs.isEnv(component)) return 'envs';\n return 'other';\n });\n const envsOfEnvsCompIds = await Promise.all(\n (groupedByIsEnv.envs || [])\n // .map((component) => this.envs.getEnvId(component))\n .map(async (component) => (await this.envs.calculateEnvId(component)).toString())\n );\n const groupedByEnvsOfEnvs = groupBy(groupedByIsEnv.envs, (component) => {\n if (envsOfEnvsCompIds.includes(component.id.toString())) return 'envsOfEnvs';\n return 'otherEnvs';\n });\n const envsOfEnvsWithoutCoreCompIds = envsOfEnvsCompIds.filter((id) => !this.envs.isCoreEnv(id));\n let depsOfEnvsOfEnvsCompIds: string[] = [];\n if (graph) {\n // envs installed as packages (e.g. legacy core envs) are not part of the workspace graph\n const envsOfEnvsOnGraph = envsOfEnvsWithoutCoreCompIds.filter((id) => graph.hasNode(id));\n const subGraph = graph.successorsSubgraph(envsOfEnvsOnGraph, {\n nodeFilter: (node) => this.workspace.hasId(node.attr),\n });\n depsOfEnvsOfEnvsCompIds = subGraph.nodes.map((n) => n.id);\n } else {\n const depsOfEnvsOfEnvsCompLists = (groupedByEnvsOfEnvs.envsOfEnvs || []).map((envComp) =>\n this.dependencyResolver.getDependencies(envComp)\n );\n depsOfEnvsOfEnvsCompIds = DependencyList.merge(depsOfEnvsOfEnvsCompLists)\n .getComponentDependencies()\n .map((dep) => dep.id.toString());\n }\n const groupedByIsDepsOfEnvsOfEnvs = groupBy(groupedByIsEnv.other, (component) => {\n if (depsOfEnvsOfEnvsCompIds.includes(component.id.toString())) return 'depsOfEnvsOfEnvs';\n return 'other';\n });\n let depsOfEnvsOfCompIds: string[] = [];\n if (graph) {\n const otherEnvsIds = (groupedByEnvsOfEnvs.otherEnvs || []).map((c) => c.id.toString());\n if (otherEnvsIds.length) {\n const otherEnvsWithoutCoreIds = otherEnvsIds.filter((id) => !this.envs.isCoreEnv(id) && graph.hasNode(id));\n const subGraph = graph.successorsSubgraph(otherEnvsWithoutCoreIds, {\n nodeFilter: (node) => this.workspace.hasId(node.attr),\n });\n depsOfEnvsOfCompIds = subGraph.nodes.map((n) => n.id);\n }\n } else {\n const depsOfEnvsCompLists = (groupedByEnvsOfEnvs.otherEnvs || []).map((envComp) =>\n this.dependencyResolver.getDependencies(envComp)\n );\n depsOfEnvsOfCompIds = DependencyList.merge(depsOfEnvsCompLists)\n .getComponentDependencies()\n .map((dep) => dep.id.toString());\n }\n const groupedByIsDepsOfEnvs = groupBy(groupedByIsDepsOfEnvsOfEnvs.other, (component) => {\n if (depsOfEnvsOfCompIds.includes(component.id.toString())) return 'depsOfEnvs';\n return 'other';\n });\n return [\n {\n components: groupedByIsDepsOfEnvsOfEnvs.depsOfEnvsOfEnvs || [],\n depsOfEnvsOfEnvs: true,\n },\n {\n components: groupedByEnvsOfEnvs.envsOfEnvs || [],\n envsOfEnvs: true,\n },\n {\n components: groupedByIsDepsOfEnvs.depsOfEnvs || [],\n depsOfEnvs: true,\n },\n {\n components: groupedByEnvsOfEnvs.otherEnvs || [],\n envs: true,\n },\n {\n components: groupedByIsDepsOfEnvs.other || [],\n other: true,\n },\n ];\n }\n\n private async getIdsToCompile(componentsIds: Array<string | ComponentID>, changed = false): Promise<ComponentID[]> {\n if (componentsIds.length) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(componentsIds);\n return this.workspace.filterIds(componentIds);\n }\n if (changed) {\n return this.workspace.getNewAndModifiedIds();\n }\n return this.workspace.listIds();\n }\n}\n\nfunction formatCompileResults(buildResults: BuildResult[], verbose?: boolean) {\n // this gets called when a file is changed, so the buildResults array always has only one item\n const buildResult = buildResults.find((result) => !result.skipped);\n if (!buildResult) return '';\n const title = ` ${chalk.underline('STATUS\\tCOMPONENT ID')}`;\n const verboseComponentFilesArrayToString = () => {\n return buildResult.buildResults.map((filePath) => ` \\t - ${filePath}`).join('\\n');\n };\n\n return `${title}\n ${Logger.successSymbol()}SUCCESS\\t${buildResult.component}\\n\n ${verbose ? `${verboseComponentFilesArrayToString()}\\n` : ''}`;\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,OAAA;EAAA,MAAAP,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AC,CAAC;EACjC;AACF;AAAC3K,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAED,SAAS4D,oBAAoBA,CAACvI,YAA2B,EAAEiG,OAAiB,EAAE;EAC5E;EACA,MAAMqJ,WAAW,GAAGtP,YAAY,CAACnB,IAAI,CAAEqF,MAAM,IAAK,CAACA,MAAM,CAACmH,OAAO,CAAC;EAClE,IAAI,CAACiE,WAAW,EAAE,OAAO,EAAE;EAC3B,MAAMC,KAAK,GAAG,IAAIC,gBAAK,CAACC,SAAS,CAAC,sBAAsB,CAAC,EAAE;EAC3D,MAAMC,kCAAkC,GAAGA,CAAA,KAAM;IAC/C,OAAOJ,WAAW,CAACtP,YAAY,CAACzB,GAAG,CAAEqF,QAAQ,IAAK,SAASA,QAAQ,EAAE,CAAC,CAAClD,IAAI,CAAC,IAAI,CAAC;EACnF,CAAC;EAED,OAAO,GAAG6O,KAAK;AACjB,IAAII,gBAAM,CAACC,aAAa,CAAC,CAAC,YAAYN,WAAW,CAAC1S,SAAS;AAC3D,IAAIqJ,OAAO,GAAG,GAAGyJ,kCAAkC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE;AAChE","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/compiler",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1203",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/compilation/compiler",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.compilation",
|
|
8
8
|
"name": "compiler",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.1203"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"pretty-time": "1.1.0",
|
|
@@ -17,34 +17,33 @@
|
|
|
17
17
|
"lodash": "4.17.21",
|
|
18
18
|
"p-map-series": "2.1.0",
|
|
19
19
|
"@teambit/harmony": "0.4.12",
|
|
20
|
-
"@teambit/component-id": "1.2.4",
|
|
21
|
-
"@teambit/component-issues": "0.0.188",
|
|
22
|
-
"@teambit/workspace.root-components": "1.0.1",
|
|
23
|
-
"@teambit/bit-error": "0.0.404",
|
|
24
|
-
"@teambit/envs": "1.0.1201",
|
|
25
20
|
"@teambit/cli": "0.0.1407",
|
|
26
21
|
"@teambit/logger": "0.0.1495",
|
|
27
|
-
"@teambit/
|
|
28
|
-
"@teambit/
|
|
29
|
-
"@teambit/builder": "1.0.1201",
|
|
30
|
-
"@teambit/bundler": "1.0.1201",
|
|
31
|
-
"@teambit/component": "1.0.1201",
|
|
32
|
-
"@teambit/dependency-resolver": "1.0.1201",
|
|
33
|
-
"@teambit/generator": "1.0.1202",
|
|
22
|
+
"@teambit/component-id": "1.2.4",
|
|
23
|
+
"@teambit/component-issues": "0.0.188",
|
|
34
24
|
"@teambit/harmony.modules.runtimes": "0.0.2",
|
|
35
|
-
"@teambit/issues": "1.0.1201",
|
|
36
25
|
"@teambit/legacy.constants": "0.0.47",
|
|
37
|
-
"@teambit/ui": "1.0.1201",
|
|
38
|
-
"@teambit/watcher": "1.0.1201",
|
|
39
|
-
"@teambit/workspace": "1.0.1201",
|
|
40
|
-
"@teambit/isolator": "1.0.1201",
|
|
41
26
|
"@teambit/toolbox.fs.hard-link-directory": "0.0.44",
|
|
42
27
|
"@teambit/component.sources": "0.0.228",
|
|
43
28
|
"@teambit/toolbox.path.path": "0.0.24",
|
|
44
|
-
"@teambit/graph": "1.0.1201",
|
|
45
|
-
"@teambit/multi-compiler": "1.0.1201",
|
|
46
29
|
"@teambit/pkg.modules.component-package-name": "0.0.183",
|
|
47
|
-
"@teambit/workspace.modules.node-modules-linker": "0.0.409"
|
|
30
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.409",
|
|
31
|
+
"@teambit/workspace.root-components": "1.0.1",
|
|
32
|
+
"@teambit/bit-error": "0.0.404",
|
|
33
|
+
"@teambit/envs": "1.0.1203",
|
|
34
|
+
"@teambit/pubsub": "1.0.1203",
|
|
35
|
+
"@teambit/aspect-loader": "1.0.1203",
|
|
36
|
+
"@teambit/builder": "1.0.1203",
|
|
37
|
+
"@teambit/bundler": "1.0.1203",
|
|
38
|
+
"@teambit/component": "1.0.1203",
|
|
39
|
+
"@teambit/dependency-resolver": "1.0.1203",
|
|
40
|
+
"@teambit/generator": "1.0.1204",
|
|
41
|
+
"@teambit/issues": "1.0.1203",
|
|
42
|
+
"@teambit/ui": "1.0.1203",
|
|
43
|
+
"@teambit/watcher": "1.0.1203",
|
|
44
|
+
"@teambit/workspace": "1.0.1203",
|
|
45
|
+
"@teambit/isolator": "1.0.1203",
|
|
46
|
+
"@teambit/graph": "1.0.1203"
|
|
48
47
|
},
|
|
49
48
|
"devDependencies": {
|
|
50
49
|
"@types/pretty-time": "^1.1.5",
|