@teambit/compiler 1.0.667 → 1.0.668

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.
Files changed (38) hide show
  1. package/dist/compiler-env-type.d.ts +2 -2
  2. package/dist/compiler-env-type.js.map +1 -1
  3. package/dist/compiler.cmd.d.ts +2 -2
  4. package/dist/compiler.cmd.js.map +1 -1
  5. package/dist/compiler.main.runtime.d.ts +18 -17
  6. package/dist/compiler.main.runtime.js.map +1 -1
  7. package/dist/compiler.service.d.ts +2 -2
  8. package/dist/compiler.service.js.map +1 -1
  9. package/dist/compiler.task.d.ts +5 -5
  10. package/dist/compiler.task.js.map +1 -1
  11. package/dist/dist-artifact.d.ts +1 -1
  12. package/dist/dist-artifact.js.map +1 -1
  13. package/dist/exceptions/dist-artifact-not-found.d.ts +1 -1
  14. package/dist/exceptions/dist-artifact-not-found.js.map +1 -1
  15. package/dist/output-formatter.d.ts +1 -1
  16. package/dist/output-formatter.js.map +1 -1
  17. package/dist/{preview-1753809186996.js → preview-1753833698619.js} +2 -2
  18. package/dist/templates/compiler/files/aspect-file.d.ts +1 -1
  19. package/dist/templates/compiler/files/aspect-file.js.map +1 -1
  20. package/dist/templates/compiler/files/compiler-file.d.ts +1 -1
  21. package/dist/templates/compiler/files/compiler-file.js.map +1 -1
  22. package/dist/templates/compiler/files/index-file.d.ts +1 -1
  23. package/dist/templates/compiler/files/index-file.js.map +1 -1
  24. package/dist/templates/compiler/files/main-runtime-file.d.ts +1 -1
  25. package/dist/templates/compiler/files/main-runtime-file.js.map +1 -1
  26. package/dist/templates/compiler/index.d.ts +1 -1
  27. package/dist/templates/compiler/index.js.map +1 -1
  28. package/dist/types.d.ts +2 -2
  29. package/dist/types.js.map +1 -1
  30. package/dist/workspace-compiler.d.ts +10 -11
  31. package/dist/workspace-compiler.js.map +1 -1
  32. package/exceptions/dist-artifact-not-found.ts +1 -1
  33. package/package.json +22 -22
  34. package/templates/compiler/files/aspect-file.ts +1 -1
  35. package/templates/compiler/files/compiler-file.ts +1 -1
  36. package/templates/compiler/files/index-file.ts +1 -1
  37. package/templates/compiler/files/main-runtime-file.ts +1 -1
  38. package/templates/compiler/index.ts +1 -1
@@ -1,5 +1,5 @@
1
- import { EnvHandler } from '@teambit/envs';
2
- import { Compiler } from './types';
1
+ import type { EnvHandler } from '@teambit/envs';
2
+ import type { Compiler } from './types';
3
3
  export interface CompilerEnv {
4
4
  /**
5
5
  * return a compiler instance.
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["compiler-env-type.ts"],"sourcesContent":["import { EnvHandler } from '@teambit/envs';\nimport { Compiler } from './types';\n\nexport interface CompilerEnv {\n /**\n * return a compiler instance.\n */\n compiler(): EnvHandler<Compiler>;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["compiler-env-type.ts"],"sourcesContent":["import type { EnvHandler } from '@teambit/envs';\nimport type { Compiler } from './types';\n\nexport interface CompilerEnv {\n /**\n * return a compiler instance.\n */\n compiler(): EnvHandler<Compiler>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- import { Command, CommandOptions } from '@teambit/cli';
1
+ import type { Command, CommandOptions } from '@teambit/cli';
2
2
  import { Logger } from '@teambit/logger';
3
3
  import type { PubsubMain } from '@teambit/pubsub';
4
- import { WorkspaceCompiler, CompileOptions, BuildResult } from './workspace-compiler';
4
+ import type { WorkspaceCompiler, CompileOptions, BuildResult } from './workspace-compiler';
5
5
  export declare class CompileCmd implements Command {
6
6
  private compile;
7
7
  private logger;
@@ -1 +1 @@
1
- {"version":3,"names":["_logger","data","require","_chalk","_interopRequireDefault","_prettyTime","_outputFormatter","_types","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompileCmd","constructor","compile","logger","pubsub","name","description","report","components","compilerOptions","startTimestamp","process","hrtime","setStatusLine","outputString","results","compileComponents","initiator","CompilationInitiator","CmdReport","compileTimeLength","chalk","underline","formatCompileResults","verbose","getStatusLine","clearStatusLine","code","getExitCode","json","deleteDistDir","compileResults","CmdJson","failedComponents","componentsStatus","component","errors","getSummaryIcon","Logger","successSymbol","red","yellow","numberOfComponents","numberOfFailingComponents","numberOfSuccessfulComponents","icon","summaryLine","prettyTime","exports"],"sources":["compiler.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport chalk from 'chalk';\nimport prettyTime from 'pretty-time';\nimport { formatCompileResults } from './output-formatter';\nimport { WorkspaceCompiler, CompileOptions, BuildResult } from './workspace-compiler';\nimport { CompilationInitiator } from './types';\n\nexport class CompileCmd implements Command {\n name = 'compile [component-names...]';\n description = 'compile components in the workspace';\n helpUrl = 'reference/compiling/compiler-overview';\n arguments = [\n {\n name: 'component-names...',\n description: 'a list of component names or component IDs (defaults to all components)',\n },\n ];\n alias = '';\n group = 'component-development';\n options = [\n ['c', 'changed', 'compile only new and modified components'],\n ['v', 'verbose', 'show more data, such as, dist paths'],\n ['j', 'json', 'return the compile results in json format'],\n ['d', 'delete-dist-dir', 'delete existing dist folder before writing new compiled files'],\n ['', 'generate-types', 'EXPERIMENTAL. generate d.ts files for typescript components (hurts performance)'],\n ] as CommandOptions;\n\n constructor(\n private compile: WorkspaceCompiler,\n private logger: Logger,\n private pubsub: PubsubMain\n ) {}\n\n async report([components = []]: [string[]], compilerOptions: CompileOptions) {\n const startTimestamp = process.hrtime();\n this.logger.setStatusLine('Compiling your components, hold tight.');\n\n let outputString = '';\n const results = await this.compile.compileComponents(components, {\n ...compilerOptions,\n initiator: CompilationInitiator.CmdReport,\n });\n const compileTimeLength = process.hrtime(startTimestamp);\n\n outputString += '\\n';\n outputString += ` ${chalk.underline('STATUS')}\\t${chalk.underline('COMPONENT ID')}\\n`;\n outputString += formatCompileResults(results, !!compilerOptions.verbose);\n outputString += '\\n';\n\n outputString += this.getStatusLine(results, compileTimeLength);\n\n this.logger.clearStatusLine();\n\n return {\n data: outputString,\n code: this.getExitCode(results),\n };\n }\n\n async json([components]: [string[]], compilerOptions: CompileOptions) {\n compilerOptions.deleteDistDir = true;\n // @ts-ignore\n const compileResults = await this.compile.compileComponents(components, {\n ...compilerOptions,\n initiator: CompilationInitiator.CmdJson,\n });\n return {\n data: compileResults,\n // @todo: fix the code once compile is ready.\n code: 0,\n };\n }\n\n private failedComponents(componentsStatus: BuildResult[]): BuildResult[] {\n return componentsStatus.filter((component) => component.errors.length);\n }\n\n private getSummaryIcon(componentsStatus: BuildResult[]) {\n switch (this.failedComponents(componentsStatus).length) {\n case 0:\n return Logger.successSymbol();\n case componentsStatus.length:\n return chalk.red('✗');\n default:\n return chalk.yellow('⍻');\n }\n }\n\n private getExitCode(componentsStatus: BuildResult[]) {\n return this.failedComponents(componentsStatus).length ? 1 : 0;\n }\n\n private getStatusLine(componentsStatus: BuildResult[], compileTimeLength) {\n const numberOfComponents = componentsStatus.length;\n const numberOfFailingComponents = this.failedComponents(componentsStatus).length;\n const numberOfSuccessfulComponents = componentsStatus.filter((component) => !component.errors.length).length;\n\n const icon = this.getSummaryIcon(componentsStatus);\n const summaryLine = numberOfFailingComponents\n ? `${icon} ${numberOfFailingComponents}/${numberOfComponents} components failed to compile.`\n : `${icon} ${numberOfSuccessfulComponents}/${numberOfComponents} components compiled successfully.`;\n\n return `${summaryLine}\\nFinished. (${prettyTime(compileTimeLength)})`;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,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,MAAM,GAAG,CAAC,GAAG,CAAC;EAC/D;EAEQ2C,aAAaA,CAACS,gBAA+B,EAAEd,iBAAiB,EAAE;IACxE,MAAMsB,kBAAkB,GAAGR,gBAAgB,CAACpD,MAAM;IAClD,MAAM6D,yBAAyB,GAAG,IAAI,CAACV,gBAAgB,CAACC,gBAAgB,CAAC,CAACpD,MAAM;IAChF,MAAM8D,4BAA4B,GAAGV,gBAAgB,CAAC3D,MAAM,CAAE4D,SAAS,IAAK,CAACA,SAAS,CAACC,MAAM,CAACtD,MAAM,CAAC,CAACA,MAAM;IAE5G,MAAM+D,IAAI,GAAG,IAAI,CAACR,cAAc,CAACH,gBAAgB,CAAC;IAClD,MAAMY,WAAW,GAAGH,yBAAyB,GACzC,GAAGE,IAAI,IAAIF,yBAAyB,IAAID,kBAAkB,gCAAgC,GAC1F,GAAGG,IAAI,IAAID,4BAA4B,IAAIF,kBAAkB,oCAAoC;IAErG,OAAO,GAAGI,WAAW,gBAAgB,IAAAC,qBAAU,EAAC3B,iBAAiB,CAAC,GAAG;EACvE;AACF;AAAC4B,OAAA,CAAAhD,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_logger","data","require","_chalk","_interopRequireDefault","_prettyTime","_outputFormatter","_types","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompileCmd","constructor","compile","logger","pubsub","name","description","report","components","compilerOptions","startTimestamp","process","hrtime","setStatusLine","outputString","results","compileComponents","initiator","CompilationInitiator","CmdReport","compileTimeLength","chalk","underline","formatCompileResults","verbose","getStatusLine","clearStatusLine","code","getExitCode","json","deleteDistDir","compileResults","CmdJson","failedComponents","componentsStatus","component","errors","getSummaryIcon","Logger","successSymbol","red","yellow","numberOfComponents","numberOfFailingComponents","numberOfSuccessfulComponents","icon","summaryLine","prettyTime","exports"],"sources":["compiler.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport chalk from 'chalk';\nimport prettyTime from 'pretty-time';\nimport { formatCompileResults } from './output-formatter';\nimport type { WorkspaceCompiler, CompileOptions, BuildResult } from './workspace-compiler';\nimport { CompilationInitiator } from './types';\n\nexport class CompileCmd implements Command {\n name = 'compile [component-names...]';\n description = 'compile components in the workspace';\n helpUrl = 'reference/compiling/compiler-overview';\n arguments = [\n {\n name: 'component-names...',\n description: 'a list of component names or component IDs (defaults to all components)',\n },\n ];\n alias = '';\n group = 'component-development';\n options = [\n ['c', 'changed', 'compile only new and modified components'],\n ['v', 'verbose', 'show more data, such as, dist paths'],\n ['j', 'json', 'return the compile results in json format'],\n ['d', 'delete-dist-dir', 'delete existing dist folder before writing new compiled files'],\n ['', 'generate-types', 'EXPERIMENTAL. generate d.ts files for typescript components (hurts performance)'],\n ] as CommandOptions;\n\n constructor(\n private compile: WorkspaceCompiler,\n private logger: Logger,\n private pubsub: PubsubMain\n ) {}\n\n async report([components = []]: [string[]], compilerOptions: CompileOptions) {\n const startTimestamp = process.hrtime();\n this.logger.setStatusLine('Compiling your components, hold tight.');\n\n let outputString = '';\n const results = await this.compile.compileComponents(components, {\n ...compilerOptions,\n initiator: CompilationInitiator.CmdReport,\n });\n const compileTimeLength = process.hrtime(startTimestamp);\n\n outputString += '\\n';\n outputString += ` ${chalk.underline('STATUS')}\\t${chalk.underline('COMPONENT ID')}\\n`;\n outputString += formatCompileResults(results, !!compilerOptions.verbose);\n outputString += '\\n';\n\n outputString += this.getStatusLine(results, compileTimeLength);\n\n this.logger.clearStatusLine();\n\n return {\n data: outputString,\n code: this.getExitCode(results),\n };\n }\n\n async json([components]: [string[]], compilerOptions: CompileOptions) {\n compilerOptions.deleteDistDir = true;\n // @ts-ignore\n const compileResults = await this.compile.compileComponents(components, {\n ...compilerOptions,\n initiator: CompilationInitiator.CmdJson,\n });\n return {\n data: compileResults,\n // @todo: fix the code once compile is ready.\n code: 0,\n };\n }\n\n private failedComponents(componentsStatus: BuildResult[]): BuildResult[] {\n return componentsStatus.filter((component) => component.errors.length);\n }\n\n private getSummaryIcon(componentsStatus: BuildResult[]) {\n switch (this.failedComponents(componentsStatus).length) {\n case 0:\n return Logger.successSymbol();\n case componentsStatus.length:\n return chalk.red('✗');\n default:\n return chalk.yellow('⍻');\n }\n }\n\n private getExitCode(componentsStatus: BuildResult[]) {\n return this.failedComponents(componentsStatus).length ? 1 : 0;\n }\n\n private getStatusLine(componentsStatus: BuildResult[], compileTimeLength) {\n const numberOfComponents = componentsStatus.length;\n const numberOfFailingComponents = this.failedComponents(componentsStatus).length;\n const numberOfSuccessfulComponents = componentsStatus.filter((component) => !component.errors.length).length;\n\n const icon = this.getSummaryIcon(componentsStatus);\n const summaryLine = numberOfFailingComponents\n ? `${icon} ${numberOfFailingComponents}/${numberOfComponents} components failed to compile.`\n : `${icon} ${numberOfSuccessfulComponents}/${numberOfComponents} components compiled successfully.`;\n\n return `${summaryLine}\\nFinished. (${prettyTime(compileTimeLength)})`;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,iBAAA;EAAA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AAC3D,MAAM,CAAE4D,SAAS,IAAK,CAACA,SAAS,CAACC,MAAM,CAACtD,MAAM,CAAC,CAACA,MAAM;IAE5G,MAAM+D,IAAI,GAAG,IAAI,CAACR,cAAc,CAACH,gBAAgB,CAAC;IAClD,MAAMY,WAAW,GAAGH,yBAAyB,GACzC,GAAGE,IAAI,IAAIF,yBAAyB,IAAID,kBAAkB,gCAAgC,GAC1F,GAAGG,IAAI,IAAID,4BAA4B,IAAIF,kBAAkB,oCAAoC;IAErG,OAAO,GAAGI,WAAW,gBAAgB,IAAAC,qBAAU,EAAC3B,iBAAiB,CAAC,GAAG;EACvE;AACF;AAAC4B,OAAA,CAAAhD,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -1,23 +1,24 @@
1
- import { AspectLoaderMain } from '@teambit/aspect-loader';
2
- import { BuilderMain } from '@teambit/builder';
3
- import { CLIMain } from '@teambit/cli';
4
- import { IssuesMain } from '@teambit/issues';
5
- import { Component } from '@teambit/component';
6
- import { WatcherMain } from '@teambit/watcher';
7
- import { EnvsMain, ExecutionContext } from '@teambit/envs';
8
- import { ComponentID } from '@teambit/component-id';
9
- import { DependencyResolverMain } from '@teambit/dependency-resolver';
10
- import { LoggerMain } from '@teambit/logger';
11
- import { GeneratorMain } from '@teambit/generator';
12
- import { PubsubMain } from '@teambit/pubsub';
13
- import { UiMain } from '@teambit/ui';
14
- import { Workspace, WorkspaceComponentLoadOptions } from '@teambit/workspace';
15
- import { BundlerMain } from '@teambit/bundler';
1
+ import type { AspectLoaderMain } from '@teambit/aspect-loader';
2
+ import type { BuilderMain } from '@teambit/builder';
3
+ import type { CLIMain } from '@teambit/cli';
4
+ import type { IssuesMain } from '@teambit/issues';
5
+ import type { Component } from '@teambit/component';
6
+ import type { WatcherMain } from '@teambit/watcher';
7
+ import type { EnvsMain, ExecutionContext } from '@teambit/envs';
8
+ import type { ComponentID } from '@teambit/component-id';
9
+ import type { DependencyResolverMain } from '@teambit/dependency-resolver';
10
+ import type { LoggerMain } from '@teambit/logger';
11
+ import type { GeneratorMain } from '@teambit/generator';
12
+ import type { PubsubMain } from '@teambit/pubsub';
13
+ import type { UiMain } from '@teambit/ui';
14
+ import type { Workspace, WorkspaceComponentLoadOptions } from '@teambit/workspace';
15
+ import type { BundlerMain } from '@teambit/bundler';
16
16
  import { CompilerService } from './compiler.service';
17
17
  import { CompilerTask } from './compiler.task';
18
18
  import { DistArtifact } from './dist-artifact';
19
- import { Compiler } from './types';
20
- import { CompileOptions, WorkspaceCompiler } from './workspace-compiler';
19
+ import type { Compiler } from './types';
20
+ import type { CompileOptions } from './workspace-compiler';
21
+ import { WorkspaceCompiler } from './workspace-compiler';
21
22
  export declare class CompilerMain {
22
23
  private pubsub;
23
24
  private workspaceCompiler;
@@ -1 +1 @@
1
- {"version":3,"names":["path","data","_interopRequireWildcard","require","_fsExtra","_interopRequireDefault","_aspectLoader","_builder","_cli","_componentIssues","_issues","_legacy","_watcher","_envs","_dependencyResolver","_logger","_generator","_pubsub","_ui","_workspace","_bundler","_compiler","_compiler2","_compiler3","_compiler4","_distArtifact","_exceptions","_types","_workspaceCompiler","_compiler5","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","CompilerMain","constructor","pubsub","workspaceCompiler","envs","builder","workspace","dependencyResolver","compilerService","getCompiler","context","compileOnWorkspace","componentsIds","options","initiator","CompilationInitiator","ComponentAdded","noThrow","componentLoadOptions","compileComponents","createTask","name","compiler","CompilerTask","CompilerAspect","id","getDistPathBySrcPath","component","srcPath","environment","getEnv","env","compilerInstance","getRelativeDistFolder","getOrCalculateEnv","getDistDir","DEFAULT_DIST_DIRNAME","isDistDirExists","packageDir","getComponentPackagePath","distDir","pathToCheck","join","fs","existsSync","getDistsFiles","artifacts","getArtifactsVinylByAspect","length","DistArtifactNotFound","DistArtifact","addMissingDistsIssue","components","issuesToIgnore","includes","IssuesClasses","MissingDists","Promise","all","map","exist","state","issues","getOrCreate","provider","cli","loggerMain","aspectLoader","ui","generator","watcher","bundler","logger","createLogger","CompilerService","WorkspaceCompiler","registerService","compilerMain","register","CompileCmd","registerAddComponentsIssues","bind","registerComponentTemplate","compilerTemplate","registerOnPreDevServerCreated","newCompsWithoutDevServer","debug","c","toString","PreDevServer","exports","MainRuntime","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","PubsubAspect","AspectLoaderAspect","BuilderAspect","UIAspect","GeneratorAspect","DependencyResolverAspect","WatcherAspect","IssuesAspect","BundlerAspect","addRuntime","_default"],"sources":["compiler.main.runtime.ts"],"sourcesContent":["import * as path from 'path';\nimport fs from 'fs-extra';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { BuilderAspect, BuilderMain } from '@teambit/builder';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport { Component } from '@teambit/component';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy.constants';\nimport { WatcherAspect, WatcherMain } from '@teambit/watcher';\nimport { EnvsAspect, EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { ComponentID } from '@teambit/component-id';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { PubsubAspect, PubsubMain } from '@teambit/pubsub';\nimport { UIAspect, UiMain } from '@teambit/ui';\nimport { Workspace, WorkspaceAspect, WorkspaceComponentLoadOptions } from '@teambit/workspace';\nimport { BundlerAspect, BundlerMain } from '@teambit/bundler';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompileCmd } from './compiler.cmd';\nimport { CompilerService } from './compiler.service';\nimport { CompilerTask } from './compiler.task';\nimport { DistArtifact } from './dist-artifact';\nimport { DistArtifactNotFound } from './exceptions';\nimport { CompilationInitiator, Compiler } from './types';\nimport { CompileOptions, WorkspaceCompiler } from './workspace-compiler';\nimport { compilerTemplate } from './templates/compiler';\n\nexport class CompilerMain {\n constructor(\n private pubsub: PubsubMain,\n private workspaceCompiler: WorkspaceCompiler,\n private envs: EnvsMain,\n private builder: BuilderMain,\n private workspace: Workspace,\n private dependencyResolver: DependencyResolverMain,\n private compilerService: CompilerService\n ) {}\n\n getCompiler(context: ExecutionContext): Compiler | undefined {\n return this.compilerService.getCompiler(context);\n }\n\n /**\n * Run compilation on `bit new` and when new components are imported\n */\n compileOnWorkspace(\n componentsIds: string[] | ComponentID[] | ComponentID[] = [], // when empty, it compiles all\n options: CompileOptions = { initiator: CompilationInitiator.ComponentAdded },\n noThrow?: boolean,\n componentLoadOptions: WorkspaceComponentLoadOptions = {}\n ) {\n return this.workspaceCompiler.compileComponents(componentsIds, options, noThrow, componentLoadOptions);\n }\n /**\n * API to create a new compiler task, it facilitates the usage of multiple compilers.\n * with this method you can create any number of compilers and add them to the buildPipeline.\n */\n createTask(name: string, compiler: Compiler): CompilerTask {\n return new CompilerTask(CompilerAspect.id, name, compiler, this.dependencyResolver);\n }\n\n /**\n * find the compiler configured on the workspace and ask for the dist path.\n */\n getDistPathBySrcPath(component: Component, srcPath: string): string | null {\n const environment = this.envs.getEnv(component).env;\n const compilerInstance = environment.getCompiler?.();\n if (!compilerInstance) return null;\n return compilerInstance.getDistPathBySrcPath(srcPath);\n }\n\n /**\n * find the compiler configured on the workspace and ask for the dist folder path.\n */\n getRelativeDistFolder(component: Component): string {\n const environment = this.envs.getOrCalculateEnv(component).env;\n const compilerInstance: Compiler | undefined = environment.getCompiler?.();\n if (!compilerInstance || !compilerInstance.getDistDir) return DEFAULT_DIST_DIRNAME;\n return compilerInstance.getDistDir();\n }\n\n /**\n * Check if the dist folder (in the component package under node_modules) exist\n * @param component\n * @returns\n */\n async isDistDirExists(component: Component): Promise<boolean> {\n const packageDir = await this.workspace.getComponentPackagePath(component);\n const distDir = this.getRelativeDistFolder(component);\n const pathToCheck = path.join(packageDir, distDir);\n return fs.existsSync(pathToCheck);\n }\n\n async getDistsFiles(component: Component): Promise<DistArtifact> {\n const artifacts = await this.builder.getArtifactsVinylByAspect(component, CompilerAspect.id);\n if (!artifacts.length) throw new DistArtifactNotFound(component.id);\n\n return new DistArtifact(artifacts);\n }\n\n async addMissingDistsIssue(components: Component[], issuesToIgnore: string[]): Promise<void> {\n if (issuesToIgnore.includes(IssuesClasses.MissingDists.name)) return;\n await Promise.all(\n components.map(async (component) => {\n const exist = await this.isDistDirExists(component);\n if (!exist) {\n component.state.issues.getOrCreate(IssuesClasses.MissingDists).data = true;\n }\n })\n );\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n EnvsAspect,\n LoggerAspect,\n PubsubAspect,\n AspectLoaderAspect,\n BuilderAspect,\n UIAspect,\n GeneratorAspect,\n DependencyResolverAspect,\n WatcherAspect,\n IssuesAspect,\n BundlerAspect,\n ];\n\n static async provider([\n cli,\n workspace,\n envs,\n loggerMain,\n pubsub,\n aspectLoader,\n builder,\n ui,\n generator,\n dependencyResolver,\n watcher,\n issues,\n bundler,\n ]: [\n CLIMain,\n Workspace,\n EnvsMain,\n LoggerMain,\n PubsubMain,\n AspectLoaderMain,\n BuilderMain,\n UiMain,\n GeneratorMain,\n DependencyResolverMain,\n WatcherMain,\n IssuesMain,\n BundlerMain,\n ]) {\n const logger = loggerMain.createLogger(CompilerAspect.id);\n const compilerService = new CompilerService();\n\n const workspaceCompiler = new WorkspaceCompiler(\n workspace,\n envs,\n pubsub,\n aspectLoader,\n ui,\n logger,\n dependencyResolver,\n watcher\n );\n envs.registerService(compilerService);\n const compilerMain = new CompilerMain(\n pubsub,\n workspaceCompiler,\n envs,\n builder,\n workspace,\n dependencyResolver,\n compilerService\n );\n cli.register(new CompileCmd(workspaceCompiler, logger, pubsub));\n if (issues) {\n issues.registerAddComponentsIssues(compilerMain.addMissingDistsIssue.bind(compilerMain));\n }\n if (generator) generator.registerComponentTemplate([compilerTemplate]);\n\n bundler.registerOnPreDevServerCreated(async (newCompsWithoutDevServer) => {\n logger.debug(\n `Compiling ${newCompsWithoutDevServer.length} components: ${newCompsWithoutDevServer.map((c) => c.id.toString()).join(', ')} before dev server creation`\n );\n await compilerMain.compileOnWorkspace(\n newCompsWithoutDevServer.map((c) => c.id),\n { initiator: CompilationInitiator.PreDevServer }\n );\n });\n\n return compilerMain;\n }\n}\n\nCompilerAspect.addRuntime(CompilerMain);\n\nexport default CompilerMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,KAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,IAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,iBAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,gBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,Q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,CACjD,CAAC;IACH,CAAC,CAAC;IAEF,OAAOZ,YAAY;EACrB;AACF;AAACa,OAAA,CAAA1F,YAAA,GAAAA,YAAA;AAAAZ,eAAA,CA7KYY,YAAY,aAqFN2F,kBAAW;AAAAvG,eAAA,CArFjBY,YAAY,kBAuFD,CACpB4F,gBAAS,EACTC,4BAAe,EACfC,kBAAU,EACVC,sBAAY,EACZC,sBAAY,EACZC,kCAAkB,EAClBC,wBAAa,EACbC,cAAQ,EACRC,4BAAe,EACfC,8CAAwB,EACxBC,wBAAa,EACbC,sBAAY,EACZC,wBAAa,CACd;AA0EHhF,0BAAc,CAACiF,UAAU,CAACzG,YAAY,CAAC;AAAC,IAAA0G,QAAA,GAAAhB,OAAA,CAAAvH,OAAA,GAEzB6B,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["path","data","_interopRequireWildcard","require","_fsExtra","_interopRequireDefault","_aspectLoader","_builder","_cli","_componentIssues","_issues","_legacy","_watcher","_envs","_dependencyResolver","_logger","_generator","_pubsub","_ui","_workspace","_bundler","_compiler","_compiler2","_compiler3","_compiler4","_distArtifact","_exceptions","_types","_workspaceCompiler","_compiler5","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","CompilerMain","constructor","pubsub","workspaceCompiler","envs","builder","workspace","dependencyResolver","compilerService","getCompiler","context","compileOnWorkspace","componentsIds","options","initiator","CompilationInitiator","ComponentAdded","noThrow","componentLoadOptions","compileComponents","createTask","name","compiler","CompilerTask","CompilerAspect","id","getDistPathBySrcPath","component","srcPath","environment","getEnv","env","compilerInstance","getRelativeDistFolder","getOrCalculateEnv","getDistDir","DEFAULT_DIST_DIRNAME","isDistDirExists","packageDir","getComponentPackagePath","distDir","pathToCheck","join","fs","existsSync","getDistsFiles","artifacts","getArtifactsVinylByAspect","length","DistArtifactNotFound","DistArtifact","addMissingDistsIssue","components","issuesToIgnore","includes","IssuesClasses","MissingDists","Promise","all","map","exist","state","issues","getOrCreate","provider","cli","loggerMain","aspectLoader","ui","generator","watcher","bundler","logger","createLogger","CompilerService","WorkspaceCompiler","registerService","compilerMain","register","CompileCmd","registerAddComponentsIssues","bind","registerComponentTemplate","compilerTemplate","registerOnPreDevServerCreated","newCompsWithoutDevServer","debug","c","toString","PreDevServer","exports","MainRuntime","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","PubsubAspect","AspectLoaderAspect","BuilderAspect","UIAspect","GeneratorAspect","DependencyResolverAspect","WatcherAspect","IssuesAspect","BundlerAspect","addRuntime","_default"],"sources":["compiler.main.runtime.ts"],"sourcesContent":["import * as path from 'path';\nimport fs from 'fs-extra';\nimport type { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { AspectLoaderAspect } from '@teambit/aspect-loader';\nimport type { BuilderMain } from '@teambit/builder';\nimport { BuilderAspect } from '@teambit/builder';\nimport type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport type { IssuesMain } from '@teambit/issues';\nimport { IssuesAspect } from '@teambit/issues';\nimport type { Component } from '@teambit/component';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy.constants';\nimport type { WatcherMain } from '@teambit/watcher';\nimport { WatcherAspect } from '@teambit/watcher';\nimport type { EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { ComponentID } from '@teambit/component-id';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport type { LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { GeneratorMain } from '@teambit/generator';\nimport { GeneratorAspect } from '@teambit/generator';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { PubsubAspect } from '@teambit/pubsub';\nimport type { UiMain } from '@teambit/ui';\nimport { UIAspect } from '@teambit/ui';\nimport type { Workspace, WorkspaceComponentLoadOptions } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { BundlerMain } from '@teambit/bundler';\nimport { BundlerAspect } from '@teambit/bundler';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompileCmd } from './compiler.cmd';\nimport { CompilerService } from './compiler.service';\nimport { CompilerTask } from './compiler.task';\nimport { DistArtifact } from './dist-artifact';\nimport { DistArtifactNotFound } from './exceptions';\nimport type { Compiler } from './types';\nimport { CompilationInitiator } from './types';\nimport type { CompileOptions } from './workspace-compiler';\nimport { WorkspaceCompiler } from './workspace-compiler';\nimport { compilerTemplate } from './templates/compiler';\n\nexport class CompilerMain {\n constructor(\n private pubsub: PubsubMain,\n private workspaceCompiler: WorkspaceCompiler,\n private envs: EnvsMain,\n private builder: BuilderMain,\n private workspace: Workspace,\n private dependencyResolver: DependencyResolverMain,\n private compilerService: CompilerService\n ) {}\n\n getCompiler(context: ExecutionContext): Compiler | undefined {\n return this.compilerService.getCompiler(context);\n }\n\n /**\n * Run compilation on `bit new` and when new components are imported\n */\n compileOnWorkspace(\n componentsIds: string[] | ComponentID[] | ComponentID[] = [], // when empty, it compiles all\n options: CompileOptions = { initiator: CompilationInitiator.ComponentAdded },\n noThrow?: boolean,\n componentLoadOptions: WorkspaceComponentLoadOptions = {}\n ) {\n return this.workspaceCompiler.compileComponents(componentsIds, options, noThrow, componentLoadOptions);\n }\n /**\n * API to create a new compiler task, it facilitates the usage of multiple compilers.\n * with this method you can create any number of compilers and add them to the buildPipeline.\n */\n createTask(name: string, compiler: Compiler): CompilerTask {\n return new CompilerTask(CompilerAspect.id, name, compiler, this.dependencyResolver);\n }\n\n /**\n * find the compiler configured on the workspace and ask for the dist path.\n */\n getDistPathBySrcPath(component: Component, srcPath: string): string | null {\n const environment = this.envs.getEnv(component).env;\n const compilerInstance = environment.getCompiler?.();\n if (!compilerInstance) return null;\n return compilerInstance.getDistPathBySrcPath(srcPath);\n }\n\n /**\n * find the compiler configured on the workspace and ask for the dist folder path.\n */\n getRelativeDistFolder(component: Component): string {\n const environment = this.envs.getOrCalculateEnv(component).env;\n const compilerInstance: Compiler | undefined = environment.getCompiler?.();\n if (!compilerInstance || !compilerInstance.getDistDir) return DEFAULT_DIST_DIRNAME;\n return compilerInstance.getDistDir();\n }\n\n /**\n * Check if the dist folder (in the component package under node_modules) exist\n * @param component\n * @returns\n */\n async isDistDirExists(component: Component): Promise<boolean> {\n const packageDir = await this.workspace.getComponentPackagePath(component);\n const distDir = this.getRelativeDistFolder(component);\n const pathToCheck = path.join(packageDir, distDir);\n return fs.existsSync(pathToCheck);\n }\n\n async getDistsFiles(component: Component): Promise<DistArtifact> {\n const artifacts = await this.builder.getArtifactsVinylByAspect(component, CompilerAspect.id);\n if (!artifacts.length) throw new DistArtifactNotFound(component.id);\n\n return new DistArtifact(artifacts);\n }\n\n async addMissingDistsIssue(components: Component[], issuesToIgnore: string[]): Promise<void> {\n if (issuesToIgnore.includes(IssuesClasses.MissingDists.name)) return;\n await Promise.all(\n components.map(async (component) => {\n const exist = await this.isDistDirExists(component);\n if (!exist) {\n component.state.issues.getOrCreate(IssuesClasses.MissingDists).data = true;\n }\n })\n );\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n EnvsAspect,\n LoggerAspect,\n PubsubAspect,\n AspectLoaderAspect,\n BuilderAspect,\n UIAspect,\n GeneratorAspect,\n DependencyResolverAspect,\n WatcherAspect,\n IssuesAspect,\n BundlerAspect,\n ];\n\n static async provider([\n cli,\n workspace,\n envs,\n loggerMain,\n pubsub,\n aspectLoader,\n builder,\n ui,\n generator,\n dependencyResolver,\n watcher,\n issues,\n bundler,\n ]: [\n CLIMain,\n Workspace,\n EnvsMain,\n LoggerMain,\n PubsubMain,\n AspectLoaderMain,\n BuilderMain,\n UiMain,\n GeneratorMain,\n DependencyResolverMain,\n WatcherMain,\n IssuesMain,\n BundlerMain,\n ]) {\n const logger = loggerMain.createLogger(CompilerAspect.id);\n const compilerService = new CompilerService();\n\n const workspaceCompiler = new WorkspaceCompiler(\n workspace,\n envs,\n pubsub,\n aspectLoader,\n ui,\n logger,\n dependencyResolver,\n watcher\n );\n envs.registerService(compilerService);\n const compilerMain = new CompilerMain(\n pubsub,\n workspaceCompiler,\n envs,\n builder,\n workspace,\n dependencyResolver,\n compilerService\n );\n cli.register(new CompileCmd(workspaceCompiler, logger, pubsub));\n if (issues) {\n issues.registerAddComponentsIssues(compilerMain.addMissingDistsIssue.bind(compilerMain));\n }\n if (generator) generator.registerComponentTemplate([compilerTemplate]);\n\n bundler.registerOnPreDevServerCreated(async (newCompsWithoutDevServer) => {\n logger.debug(\n `Compiling ${newCompsWithoutDevServer.length} components: ${newCompsWithoutDevServer.map((c) => c.id.toString()).join(', ')} before dev server creation`\n );\n await compilerMain.compileOnWorkspace(\n newCompsWithoutDevServer.map((c) => c.id),\n { initiator: CompilationInitiator.PreDevServer }\n );\n });\n\n return compilerMain;\n }\n}\n\nCompilerAspect.addRuntime(CompilerMain);\n\nexport default CompilerMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA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CAACrC,MAAM,gBAAgBqC,wBAAwB,CAAC1B,GAAG,CAAE4B,CAAC,IAAKA,CAAC,CAAC9D,EAAE,CAAC+D,QAAQ,CAAC,CAAC,CAAC,CAAC9C,IAAI,CAAC,IAAI,CAAC,6BAC7H,CAAC;MACD,MAAMmC,YAAY,CAAClE,kBAAkB,CACnC0E,wBAAwB,CAAC1B,GAAG,CAAE4B,CAAC,IAAKA,CAAC,CAAC9D,EAAE,CAAC,EACzC;QAAEX,SAAS,EAAEC,6BAAoB,CAAC0E;MAAa,CACjD,CAAC;IACH,CAAC,CAAC;IAEF,OAAOZ,YAAY;EACrB;AACF;AAACa,OAAA,CAAA1F,YAAA,GAAAA,YAAA;AAAAZ,eAAA,CA7KYY,YAAY,aAqFN2F,kBAAW;AAAAvG,eAAA,CArFjBY,YAAY,kBAuFD,CACpB4F,gBAAS,EACTC,4BAAe,EACfC,kBAAU,EACVC,sBAAY,EACZC,sBAAY,EACZC,kCAAkB,EAClBC,wBAAa,EACbC,cAAQ,EACRC,4BAAe,EACfC,8CAAwB,EACxBC,wBAAa,EACbC,sBAAY,EACZC,wBAAa,CACd;AA0EHhF,0BAAc,CAACiF,UAAU,CAACzG,YAAY,CAAC;AAAC,IAAA0G,QAAA,GAAAhB,OAAA,CAAAvH,OAAA,GAEzB6B,YAAY","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { EnvService, EnvDefinition, Env, EnvContext, ServiceTransformationMap, ExecutionContext } from '@teambit/envs';
2
- import { Compiler } from './types';
1
+ import type { EnvService, EnvDefinition, Env, EnvContext, ServiceTransformationMap, ExecutionContext } from '@teambit/envs';
2
+ import type { Compiler } from './types';
3
3
  export type CompilerDescriptor = {
4
4
  id: string;
5
5
  icon?: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cliHighlight","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompilerService","constructor","getCompiler","context","compiler","env","render","descriptor","getDescriptor","name","chalk","green","id","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","transform","undefined","icon","displayConfig","exports"],"sources":["compiler.service.ts"],"sourcesContent":["import { EnvService, EnvDefinition, Env, EnvContext, ServiceTransformationMap, ExecutionContext } from '@teambit/envs';\nimport chalk from 'chalk';\nimport highlight from 'cli-highlight';\nimport { Compiler } from './types';\n\nexport type CompilerDescriptor = {\n id: string;\n icon?: string;\n config?: string;\n};\n\ntype CompilerTransformationMap = ServiceTransformationMap & {\n getCompiler: () => Compiler;\n};\n\nexport class CompilerService implements EnvService<{}, CompilerDescriptor> {\n name = 'Compile';\n\n getCompiler(context: ExecutionContext): Compiler | undefined {\n const compiler = context.env.getCompiler?.();\n return compiler;\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n const name = `${chalk.green('configured compiler:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('compiler config:');\n const configObj = descriptor?.config\n ? highlight(descriptor?.config, { language: 'json', ignoreIllegals: true })\n : '';\n return `${name}\\n${configLabel}\\n${configObj}`;\n }\n\n transform(env: Env, context: EnvContext): CompilerTransformationMap | undefined {\n // Old env\n if (!env?.compiler) return undefined;\n return {\n getCompiler: () => env.compiler()(context),\n };\n }\n\n getDescriptor(env: EnvDefinition) {\n if (!env.env.getCompiler) return undefined;\n const compiler = env.env.getCompiler();\n\n return {\n id: compiler.id,\n icon: compiler.icon,\n config: compiler.displayConfig ? compiler.displayConfig() : undefined,\n version: compiler.version ? compiler.version() : '?',\n displayName: compiler.displayName ? compiler.displayName : '?',\n };\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,cAAA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;AACF;AAACY,OAAA,CAAAzB,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cliHighlight","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompilerService","constructor","getCompiler","context","compiler","env","render","descriptor","getDescriptor","name","chalk","green","id","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","transform","undefined","icon","displayConfig","exports"],"sources":["compiler.service.ts"],"sourcesContent":["import type {\n EnvService,\n EnvDefinition,\n Env,\n EnvContext,\n ServiceTransformationMap,\n ExecutionContext,\n} from '@teambit/envs';\nimport chalk from 'chalk';\nimport highlight from 'cli-highlight';\nimport type { Compiler } from './types';\n\nexport type CompilerDescriptor = {\n id: string;\n icon?: string;\n config?: string;\n};\n\ntype CompilerTransformationMap = ServiceTransformationMap & {\n getCompiler: () => Compiler;\n};\n\nexport class CompilerService implements EnvService<{}, CompilerDescriptor> {\n name = 'Compile';\n\n getCompiler(context: ExecutionContext): Compiler | undefined {\n const compiler = context.env.getCompiler?.();\n return compiler;\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n const name = `${chalk.green('configured compiler:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('compiler config:');\n const configObj = descriptor?.config\n ? highlight(descriptor?.config, { language: 'json', ignoreIllegals: true })\n : '';\n return `${name}\\n${configLabel}\\n${configObj}`;\n }\n\n transform(env: Env, context: EnvContext): CompilerTransformationMap | undefined {\n // Old env\n if (!env?.compiler) return undefined;\n return {\n getCompiler: () => env.compiler()(context),\n };\n }\n\n getDescriptor(env: EnvDefinition) {\n if (!env.env.getCompiler) return undefined;\n const compiler = env.env.getCompiler();\n\n return {\n id: compiler.id,\n icon: compiler.icon,\n config: compiler.displayConfig ? compiler.displayConfig() : undefined,\n version: compiler.version ? compiler.version()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B,QAAQ,CAACoB,aAAa,CAAC,CAAC,GAAGF,SAAS;MACrER,OAAO,EAAEV,QAAQ,CAACU,OAAO,GAAGV,QAAQ,CAACU,OAAO,CAAC,CAAC,GAAG,GAAG;MACpDD,WAAW,EAAET,QAAQ,CAACS,WAAW,GAAGT,QAAQ,CAACS,WAAW,GAAG;IAC7D,CAAC;EACH;AACF;AAACY,OAAA,CAAAzB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { BuildContext, BuiltTaskResult, BuildTask, TaskResultsList } from '@teambit/builder';
2
- import { Capsule } from '@teambit/isolator';
3
- import { EnvContext, EnvHandler } from '@teambit/envs';
4
- import { DependencyResolverMain } from '@teambit/dependency-resolver';
5
- import { Compiler } from './types';
1
+ import type { BuildContext, BuiltTaskResult, BuildTask, TaskResultsList } from '@teambit/builder';
2
+ import type { Capsule } from '@teambit/isolator';
3
+ import type { EnvContext, EnvHandler } from '@teambit/envs';
4
+ import type { DependencyResolverMain } from '@teambit/dependency-resolver';
5
+ import type { Compiler } from './types';
6
6
  export type CompilerTaskOptions = {
7
7
  /**
8
8
  * instance of compiler to use.
@@ -1 +1 @@
1
- {"version":3,"names":["_toolboxFs","data","require","_fsExtra","_interopRequireDefault","_path","_compiler","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompilerTask","constructor","aspectId","name","compilerInstance","dependencyResolver","artifactName","description","preBuild","context","Promise","all","capsuleNetwork","seedersCapsules","map","capsule","copyNonSupportedFiles","execute","buildResults","build","_hardLinkBuildArtifactsOnCapsules","relCompDir","path","relative","capsulesRootDir","replace","injectedDirs","getInjectedDirs","getPackageName","component","hardLinkDirectory","injectedDir","join","postBuild","tasksResults","compiler","shouldCopyNonSupportedFiles","filesystem","files","file","isFileSupported","content","contents","fs","outputFile","distDir","from","options","CompilerAspect","id","depResolve","getAspect","exports"],"sources":["compiler.task.ts"],"sourcesContent":["import { BuildContext, BuiltTaskResult, BuildTask, TaskResultsList } from '@teambit/builder';\nimport { Capsule } from '@teambit/isolator';\nimport { hardLinkDirectory } from '@teambit/toolbox.fs.hard-link-directory';\nimport { EnvContext, EnvHandler } from '@teambit/envs';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { Compiler } from './types';\nimport { CompilerAspect } from './compiler.aspect';\n\nexport type CompilerTaskOptions = {\n /**\n * instance of compiler to use.\n */\n compiler: EnvHandler<Compiler>;\n\n /**\n * name of compiler task\n */\n name?: string;\n};\n\n/**\n * compiler build task. Allows to compile components during component build.\n */\nexport class CompilerTask implements BuildTask {\n readonly description = 'compile components';\n constructor(\n readonly aspectId: string,\n readonly name: string,\n readonly compilerInstance: Compiler,\n private dependencyResolver: DependencyResolverMain\n ) {\n if (compilerInstance.artifactName) {\n this.description += ` for artifact ${compilerInstance.artifactName}`;\n }\n }\n\n async preBuild(context: BuildContext) {\n await Promise.all(\n context.capsuleNetwork.seedersCapsules.map((capsule) =>\n this.copyNonSupportedFiles(capsule, this.compilerInstance)\n )\n );\n if (!this.compilerInstance.preBuild) return;\n await this.compilerInstance.preBuild(context);\n }\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const buildResults = await this.compilerInstance.build(context);\n await this._hardLinkBuildArtifactsOnCapsules(context);\n return buildResults;\n }\n\n /**\n * This function hard links the compiled artifacts to the `node_modules` of other component capsules.\n * For instance, if we have a `button` component that is a dependency of the `card` component,\n * then the `dist` folder of the `button` component will be copied to `<card_capsule>/node_modules/button/dist`.\n */\n private async _hardLinkBuildArtifactsOnCapsules(context: BuildContext): Promise<void> {\n await Promise.all(\n context.capsuleNetwork.seedersCapsules.map(async (capsule) => {\n const relCompDir = path.relative(context.capsuleNetwork.capsulesRootDir, capsule.path).replace(/\\\\/g, '/');\n const injectedDirs = await this.dependencyResolver.getInjectedDirs(\n context.capsuleNetwork.capsulesRootDir,\n relCompDir,\n this.dependencyResolver.getPackageName(capsule.component)\n );\n return hardLinkDirectory(\n capsule.path,\n injectedDirs.map((injectedDir) => path.join(context.capsuleNetwork.capsulesRootDir, injectedDir))\n );\n })\n );\n }\n\n async postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void> {\n if (!this.compilerInstance.postBuild) return;\n await this.compilerInstance.postBuild(context, tasksResults);\n }\n\n async copyNonSupportedFiles(capsule: Capsule, compiler: Compiler) {\n if (!compiler.shouldCopyNonSupportedFiles) {\n return;\n }\n const component = capsule.component;\n await Promise.all(\n component.filesystem.files.map(async (file) => {\n if (compiler.isFileSupported(file.path)) return;\n const content = file.contents;\n await fs.outputFile(path.join(capsule.path, compiler.distDir, file.relative), content);\n })\n );\n }\n\n static from(options: CompilerTaskOptions) {\n return (context: EnvContext) => {\n const aspectId = CompilerAspect.id;\n const name = options.name || 'compiler-task';\n const depResolve = context.getAspect<any>('teambit.dependencies/dependency-resolver');\n return new CompilerTask(aspectId, name, options.compiler(context), depResolve);\n };\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmD,SAAAG,uBAAAG,CA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AA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_toolboxFs","data","require","_fsExtra","_interopRequireDefault","_path","_compiler","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompilerTask","constructor","aspectId","name","compilerInstance","dependencyResolver","artifactName","description","preBuild","context","Promise","all","capsuleNetwork","seedersCapsules","map","capsule","copyNonSupportedFiles","execute","buildResults","build","_hardLinkBuildArtifactsOnCapsules","relCompDir","path","relative","capsulesRootDir","replace","injectedDirs","getInjectedDirs","getPackageName","component","hardLinkDirectory","injectedDir","join","postBuild","tasksResults","compiler","shouldCopyNonSupportedFiles","filesystem","files","file","isFileSupported","content","contents","fs","outputFile","distDir","from","options","CompilerAspect","id","depResolve","getAspect","exports"],"sources":["compiler.task.ts"],"sourcesContent":["import type { BuildContext, BuiltTaskResult, BuildTask, TaskResultsList } from '@teambit/builder';\nimport type { Capsule } from '@teambit/isolator';\nimport { hardLinkDirectory } from '@teambit/toolbox.fs.hard-link-directory';\nimport type { EnvContext, EnvHandler } from '@teambit/envs';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport type { Compiler } from './types';\nimport { CompilerAspect } from './compiler.aspect';\n\nexport type CompilerTaskOptions = {\n /**\n * instance of compiler to use.\n */\n compiler: EnvHandler<Compiler>;\n\n /**\n * name of compiler task\n */\n name?: string;\n};\n\n/**\n * compiler build task. Allows to compile components during component build.\n */\nexport class CompilerTask implements BuildTask {\n readonly description = 'compile components';\n constructor(\n readonly aspectId: string,\n readonly name: string,\n readonly compilerInstance: Compiler,\n private dependencyResolver: DependencyResolverMain\n ) {\n if (compilerInstance.artifactName) {\n this.description += ` for artifact ${compilerInstance.artifactName}`;\n }\n }\n\n async preBuild(context: BuildContext) {\n await Promise.all(\n context.capsuleNetwork.seedersCapsules.map((capsule) =>\n this.copyNonSupportedFiles(capsule, this.compilerInstance)\n )\n );\n if (!this.compilerInstance.preBuild) return;\n await this.compilerInstance.preBuild(context);\n }\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const buildResults = await this.compilerInstance.build(context);\n await this._hardLinkBuildArtifactsOnCapsules(context);\n return buildResults;\n }\n\n /**\n * This function hard links the compiled artifacts to the `node_modules` of other component capsules.\n * For instance, if we have a `button` component that is a dependency of the `card` component,\n * then the `dist` folder of the `button` component will be copied to `<card_capsule>/node_modules/button/dist`.\n */\n private async _hardLinkBuildArtifactsOnCapsules(context: BuildContext): Promise<void> {\n await Promise.all(\n context.capsuleNetwork.seedersCapsules.map(async (capsule) => {\n const relCompDir = path.relative(context.capsuleNetwork.capsulesRootDir, capsule.path).replace(/\\\\/g, '/');\n const injectedDirs = await this.dependencyResolver.getInjectedDirs(\n context.capsuleNetwork.capsulesRootDir,\n relCompDir,\n this.dependencyResolver.getPackageName(capsule.component)\n );\n return hardLinkDirectory(\n capsule.path,\n injectedDirs.map((injectedDir) => path.join(context.capsuleNetwork.capsulesRootDir, injectedDir))\n );\n })\n );\n }\n\n async postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void> {\n if (!this.compilerInstance.postBuild) return;\n await this.compilerInstance.postBuild(context, tasksResults);\n }\n\n async copyNonSupportedFiles(capsule: Capsule, compiler: Compiler) {\n if (!compiler.shouldCopyNonSupportedFiles) {\n return;\n }\n const component = capsule.component;\n await Promise.all(\n component.filesystem.files.map(async (file) => {\n if (compiler.isFileSupported(file.path)) return;\n const content = file.contents;\n await fs.outputFile(path.join(capsule.path, compiler.distDir, file.relative), content);\n })\n );\n }\n\n static from(options: CompilerTaskOptions) {\n return (context: EnvContext) => {\n const aspectId = CompilerAspect.id;\n const name = options.name || 'compiler-task';\n const depResolve = context.getAspect<any>('teambit.dependencies/dependency-resolver');\n return new CompilerTask(aspectId, name, options.compiler(context), depResolve);\n };\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,WAAA;EAAA,MAAAC,IA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IAAI,EAAEa,QAAQ,CAACU,OAAO,EAAEN,IAAI,CAAChB,QAAQ,CAAC,EAAEkB,OAAO,CAAC;IACxF,CAAC,CACH,CAAC;EACH;EAEA,OAAOK,IAAIA,CAACC,OAA4B,EAAE;IACxC,OAAQtC,OAAmB,IAAK;MAC9B,MAAMP,QAAQ,GAAG8C,0BAAc,CAACC,EAAE;MAClC,MAAM9C,IAAI,GAAG4C,OAAO,CAAC5C,IAAI,IAAI,eAAe;MAC5C,MAAM+C,UAAU,GAAGzC,OAAO,CAAC0C,SAAS,CAAM,0CAA0C,CAAC;MACrF,OAAO,IAAInD,YAAY,CAACE,QAAQ,EAAEC,IAAI,EAAE4C,OAAO,CAACZ,QAAQ,CAAC1B,OAAO,CAAC,EAAEyC,UAAU,CAAC;IAChF,CAAC;EACH;AACF;AAACE,OAAA,CAAApD,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { AbstractVinyl } from '@teambit/component.sources';
1
+ import type { AbstractVinyl } from '@teambit/component.sources';
2
2
  export declare class DistArtifact {
3
3
  private artifacts;
4
4
  constructor(artifacts: AbstractVinyl[]);
@@ -1 +1 @@
1
- {"version":3,"names":["_toolboxPath","data","require","DistArtifact","constructor","artifacts","getFile","path","find","file","pathNormalizeToLinux","relative","exports"],"sources":["dist-artifact.ts"],"sourcesContent":["import { AbstractVinyl } from '@teambit/component.sources';\nimport { pathNormalizeToLinux } from '@teambit/toolbox.path.path';\n\nexport class DistArtifact {\n constructor(private artifacts: AbstractVinyl[]) {}\n\n getFile(path: string) {\n return this.artifacts.find((file) => {\n return pathNormalizeToLinux(file.relative) === path;\n });\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,YAAY,CAAC;EACxBC,WAAWA,CAASC,SAA0B,EAAE;IAAA,KAA5BA,SAA0B,GAA1BA,SAA0B;EAAG;EAEjDC,OAAOA,CAACC,IAAY,EAAE;IACpB,OAAO,IAAI,CAACF,SAAS,CAACG,IAAI,CAAEC,IAAI,IAAK;MACnC,OAAO,IAAAC,mCAAoB,EAACD,IAAI,CAACE,QAAQ,CAAC,KAAKJ,IAAI;IACrD,CAAC,CAAC;EACJ;AACF;AAACK,OAAA,CAAAT,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_toolboxPath","data","require","DistArtifact","constructor","artifacts","getFile","path","find","file","pathNormalizeToLinux","relative","exports"],"sources":["dist-artifact.ts"],"sourcesContent":["import type { AbstractVinyl } from '@teambit/component.sources';\nimport { pathNormalizeToLinux } from '@teambit/toolbox.path.path';\n\nexport class DistArtifact {\n constructor(private artifacts: AbstractVinyl[]) {}\n\n getFile(path: string) {\n return this.artifacts.find((file) => {\n return pathNormalizeToLinux(file.relative) === path;\n });\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,YAAY,CAAC;EACxBC,WAAWA,CAASC,SAA0B,EAAE;IAAA,KAA5BA,SAA0B,GAA1BA,SAA0B;EAAG;EAEjDC,OAAOA,CAACC,IAAY,EAAE;IACpB,OAAO,IAAI,CAACF,SAAS,CAACG,IAAI,CAAEC,IAAI,IAAK;MACnC,OAAO,IAAAC,mCAAoB,EAACD,IAAI,CAACE,QAAQ,CAAC,KAAKJ,IAAI;IACrD,CAAC,CAAC;EACJ;AACF;AAACK,OAAA,CAAAT,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { ComponentID } from '@teambit/component';
1
+ import type { ComponentID } from '@teambit/component';
2
2
  import { BitError } from '@teambit/bit-error';
3
3
  export declare class DistArtifactNotFound extends BitError {
4
4
  readonly componentId: ComponentID;
@@ -1 +1 @@
1
- {"version":3,"names":["_bitError","data","require","DistArtifactNotFound","BitError","constructor","componentId","toString","exports"],"sources":["dist-artifact-not-found.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component';\nimport { BitError } from '@teambit/bit-error';\n\nexport class DistArtifactNotFound extends BitError {\n constructor(readonly componentId: ComponentID) {\n super(`dist artifact for component ${componentId.toString()} was not found`);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,oBAAoB,SAASC,oBAAQ,CAAC;EACjDC,WAAWA,CAAUC,WAAwB,EAAE;IAC7C,KAAK,CAAC,+BAA+BA,WAAW,CAACC,QAAQ,CAAC,CAAC,gBAAgB,CAAC;IAAC,KAD1DD,WAAwB,GAAxBA,WAAwB;EAE7C;AACF;AAACE,OAAA,CAAAL,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_bitError","data","require","DistArtifactNotFound","BitError","constructor","componentId","toString","exports"],"sources":["dist-artifact-not-found.ts"],"sourcesContent":["import type { ComponentID } from '@teambit/component';\nimport { BitError } from '@teambit/bit-error';\n\nexport class DistArtifactNotFound extends BitError {\n constructor(readonly componentId: ComponentID) {\n super(`dist artifact for component ${componentId.toString()} was not found`);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,oBAAoB,SAASC,oBAAQ,CAAC;EACjDC,WAAWA,CAAUC,WAAwB,EAAE;IAC7C,KAAK,CAAC,+BAA+BA,WAAW,CAACC,QAAQ,CAAC,CAAC,gBAAgB,CAAC;IAAC,KAD1DD,WAAwB,GAAxBA,WAAwB;EAE7C;AACF;AAACE,OAAA,CAAAL,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { BuildResult } from './workspace-compiler';
1
+ import type { BuildResult } from './workspace-compiler';
2
2
  export declare const formatCompileResults: (compileResults: BuildResult[], verbose: boolean) => string;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_logger","e","__esModule","default","formatCompileResults","compileResults","verbose","map","componentResult","componentId","component","files","buildResults","status","errors","length","icon","chalk","red","Logger","successSymbol","reduce","outputString","result","fileList","file","exports"],"sources":["output-formatter.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Logger } from '@teambit/logger';\nimport { BuildResult } from './workspace-compiler';\n\nexport const formatCompileResults = (compileResults: BuildResult[], verbose: boolean) =>\n compileResults\n .map((componentResult: BuildResult) => ({\n componentId: componentResult.component,\n files: componentResult.buildResults,\n status: componentResult.errors.length ? 'FAILURE' : 'SUCCESS',\n icon: componentResult.errors.length ? chalk.red('✗') : Logger.successSymbol(),\n }))\n .reduce((outputString, result) => {\n outputString += `${result.icon} ${result.status}\\t${result.componentId}`;\n if (verbose) {\n outputString += ':';\n outputString += result?.files?.reduce((fileList, file) => `${fileList}\\t\\t - ${file}\\n`, '\\n');\n }\n outputString += '\\n';\n return outputString;\n }, '');\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyC,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGlC,MAAMG,oBAAoB,GAAGA,CAACC,cAA6B,EAAEC,OAAgB,KAClFD,cAAc,CACXE,GAAG,CAAEC,eAA4B,KAAM;EACtCC,WAAW,EAAED,eAAe,CAACE,SAAS;EACtCC,KAAK,EAAEH,eAAe,CAACI,YAAY;EACnCC,MAAM,EAAEL,eAAe,CAACM,MAAM,CAACC,MAAM,GAAG,SAAS,GAAG,SAAS;EAC7DC,IAAI,EAAER,eAAe,CAACM,MAAM,CAACC,MAAM,GAAGE,gBAAK,CAACC,GAAG,CAAC,GAAG,CAAC,GAAGC,gBAAM,CAACC,aAAa,CAAC;AAC9E,CAAC,CAAC,CAAC,CACFC,MAAM,CAAC,CAACC,YAAY,EAAEC,MAAM,KAAK;EAChCD,YAAY,IAAI,GAAGC,MAAM,CAACP,IAAI,IAAIO,MAAM,CAACV,MAAM,KAAKU,MAAM,CAACd,WAAW,EAAE;EACxE,IAAIH,OAAO,EAAE;IACXgB,YAAY,IAAI,GAAG;IACnBA,YAAY,IAAIC,MAAM,EAAEZ,KAAK,EAAEU,MAAM,CAAC,CAACG,QAAQ,EAAEC,IAAI,KAAK,GAAGD,QAAQ,UAAUC,IAAI,IAAI,EAAE,IAAI,CAAC;EAChG;EACAH,YAAY,IAAI,IAAI;EACpB,OAAOA,YAAY;AACrB,CAAC,EAAE,EAAE,CAAC;AAACI,OAAA,CAAAtB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_logger","e","__esModule","default","formatCompileResults","compileResults","verbose","map","componentResult","componentId","component","files","buildResults","status","errors","length","icon","chalk","red","Logger","successSymbol","reduce","outputString","result","fileList","file","exports"],"sources":["output-formatter.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Logger } from '@teambit/logger';\nimport type { BuildResult } from './workspace-compiler';\n\nexport const formatCompileResults = (compileResults: BuildResult[], verbose: boolean) =>\n compileResults\n .map((componentResult: BuildResult) => ({\n componentId: componentResult.component,\n files: componentResult.buildResults,\n status: componentResult.errors.length ? 'FAILURE' : 'SUCCESS',\n icon: componentResult.errors.length ? chalk.red('✗') : Logger.successSymbol(),\n }))\n .reduce((outputString, result) => {\n outputString += `${result.icon} ${result.status}\\t${result.componentId}`;\n if (verbose) {\n outputString += ':';\n outputString += result?.files?.reduce((fileList, file) => `${fileList}\\t\\t - ${file}\\n`, '\\n');\n }\n outputString += '\\n';\n return outputString;\n }, '');\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyC,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGlC,MAAMG,oBAAoB,GAAGA,CAACC,cAA6B,EAAEC,OAAgB,KAClFD,cAAc,CACXE,GAAG,CAAEC,eAA4B,KAAM;EACtCC,WAAW,EAAED,eAAe,CAACE,SAAS;EACtCC,KAAK,EAAEH,eAAe,CAACI,YAAY;EACnCC,MAAM,EAAEL,eAAe,CAACM,MAAM,CAACC,MAAM,GAAG,SAAS,GAAG,SAAS;EAC7DC,IAAI,EAAER,eAAe,CAACM,MAAM,CAACC,MAAM,GAAGE,gBAAK,CAACC,GAAG,CAAC,GAAG,CAAC,GAAGC,gBAAM,CAACC,aAAa,CAAC;AAC9E,CAAC,CAAC,CAAC,CACFC,MAAM,CAAC,CAACC,YAAY,EAAEC,MAAM,KAAK;EAChCD,YAAY,IAAI,GAAGC,MAAM,CAACP,IAAI,IAAIO,MAAM,CAACV,MAAM,KAAKU,MAAM,CAACd,WAAW,EAAE;EACxE,IAAIH,OAAO,EAAE;IACXgB,YAAY,IAAI,GAAG;IACnBA,YAAY,IAAIC,MAAM,EAAEZ,KAAK,EAAEU,MAAM,CAAC,CAACG,QAAQ,EAAEC,IAAI,KAAK,GAAGD,QAAQ,UAAUC,IAAI,IAAI,EAAE,IAAI,CAAC;EAChG;EACAH,YAAY,IAAI,IAAI;EACpB,OAAOA,YAAY;AACrB,CAAC,EAAE,EAAE,CAAC;AAACI,OAAA,CAAAtB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.667/dist/compiler.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.667/dist/compiler.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.668/dist/compiler.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.668/dist/compiler.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '@teambit/generator';
1
+ import type { ComponentContext } from '@teambit/generator';
2
2
  export declare function aspectFile({ namePascalCase, componentId }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["aspectFile","namePascalCase","componentId"],"sources":["aspect-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function aspectFile({ namePascalCase, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${namePascalCase}Aspect = Aspect.create({\n id: '${componentId}',\n});\n `;\n}\n"],"mappings":";;;;;;AAEO,SAASA,UAAUA,CAAC;EAAEC,cAAc;EAAEC;AAA8B,CAAC,EAAE;EAC5E,OAAO;AACT;AACA,eAAeD,cAAc;AAC7B,SAASC,WAAW;AACpB;AACA,GAAG;AACH","ignoreList":[]}
1
+ {"version":3,"names":["aspectFile","namePascalCase","componentId"],"sources":["aspect-file.ts"],"sourcesContent":["import type { ComponentContext } from '@teambit/generator';\n\nexport function aspectFile({ namePascalCase, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${namePascalCase}Aspect = Aspect.create({\n id: '${componentId}',\n});\n `;\n}\n"],"mappings":";;;;;;AAEO,SAASA,UAAUA,CAAC;EAAEC,cAAc;EAAEC;AAA8B,CAAC,EAAE;EAC5E,OAAO;AACT;AACA,eAAeD,cAAc;AAC7B,SAASC,WAAW;AACpB;AACA,GAAG;AACH","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '@teambit/generator';
1
+ import type { ComponentContext } from '@teambit/generator';
2
2
  export declare function compilerFile({ namePascalCase }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["compilerFile","namePascalCase"],"sources":["compiler-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compilerFile({ namePascalCase }: ComponentContext) {\n return `import {\n BuildContext,\n BuiltTaskResult,\n ComponentResult,\n} from '@teambit/builder';\nimport {\n Compiler,\n CompilerMain,\n TranspileFileParams,\n TranspileFileOutput,\n} from '@teambit/compiler';\n\nexport class ${namePascalCase} implements Compiler {\n\n constructor(readonly id: string, readonly distDir, private compiler: CompilerMain) {}\n\n /**\n * Detemines whether unsupported files (such as assets)\n * should be copied by Compiler aspect into the 'dist' directory\n */\n shouldCopyNonSupportedFiles = true;\n\n /* The name of the compiler being used. For example, TypeScript, Babel, etc. */\n displayName = '';\n\n /* The version of the compiler being used. For example '1.0.0' */\n version(): string {};\n\n /**\n * Use this for compilation in the workspace.\n * This will compile one file content at a time (alternatively, use 'transpileComponent') */\n transpileFile( fileContent: string, transpileFileParams: TranspileFileParams): TranspileFileOutput {}\n\n\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n let componentsResults: ComponentResult[] = [];\n return {\n /* Sets the files to persist as the Component's artifacts,\n and describes them. */\n artifacts: [\n {\n generatedBy: this.id,\n name: 'compilation output',\n globPatterns: [\\`\\${this.distDir}/**\\`],\n },\n ],\n componentsResults,\n };\n }\n\n /* This is optional but recommended.\n Not using it will require consumers of your compiler to use two APIs and have two depndencies\n to their Envs - your compiler\n */\n createTask() {\n return this.compiler.createTask('${namePascalCase}', this);\n }\n\n /**\n * Given a source file, return its parallel in the dists. e.g. index.ts => dist/index.js.\n * Needed by aspects such as Pkg to determine the main prop.\n */\n getDistPathBySrcPath(srcPath: string): string {}\n\n /**\n * Returns a boolean indicating whether a file is supported by the compiler or not.\n * For example, this API is used by Compiler aspect to copy unsupported files to the dist directory.\n */\n isFileSupported(filePath: string): boolean {}\n}\n `;\n}\n"],"mappings":";;;;;;AAEO,SAASA,YAAYA,CAAC;EAAEC;AAAiC,CAAC,EAAE;EACjE,OAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2CA,cAAc;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH","ignoreList":[]}
1
+ {"version":3,"names":["compilerFile","namePascalCase"],"sources":["compiler-file.ts"],"sourcesContent":["import type { ComponentContext } from '@teambit/generator';\n\nexport function compilerFile({ namePascalCase }: ComponentContext) {\n return `import {\n BuildContext,\n BuiltTaskResult,\n ComponentResult,\n} from '@teambit/builder';\nimport {\n Compiler,\n CompilerMain,\n TranspileFileParams,\n TranspileFileOutput,\n} from '@teambit/compiler';\n\nexport class ${namePascalCase} implements Compiler {\n\n constructor(readonly id: string, readonly distDir, private compiler: CompilerMain) {}\n\n /**\n * Detemines whether unsupported files (such as assets)\n * should be copied by Compiler aspect into the 'dist' directory\n */\n shouldCopyNonSupportedFiles = true;\n\n /* The name of the compiler being used. For example, TypeScript, Babel, etc. */\n displayName = '';\n\n /* The version of the compiler being used. For example '1.0.0' */\n version(): string {};\n\n /**\n * Use this for compilation in the workspace.\n * This will compile one file content at a time (alternatively, use 'transpileComponent') */\n transpileFile( fileContent: string, transpileFileParams: TranspileFileParams): TranspileFileOutput {}\n\n\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n let componentsResults: ComponentResult[] = [];\n return {\n /* Sets the files to persist as the Component's artifacts,\n and describes them. */\n artifacts: [\n {\n generatedBy: this.id,\n name: 'compilation output',\n globPatterns: [\\`\\${this.distDir}/**\\`],\n },\n ],\n componentsResults,\n };\n }\n\n /* This is optional but recommended.\n Not using it will require consumers of your compiler to use two APIs and have two depndencies\n to their Envs - your compiler\n */\n createTask() {\n return this.compiler.createTask('${namePascalCase}', this);\n }\n\n /**\n * Given a source file, return its parallel in the dists. e.g. index.ts => dist/index.js.\n * Needed by aspects such as Pkg to determine the main prop.\n */\n getDistPathBySrcPath(srcPath: string): string {}\n\n /**\n * Returns a boolean indicating whether a file is supported by the compiler or not.\n * For example, this API is used by Compiler aspect to copy unsupported files to the dist directory.\n */\n isFileSupported(filePath: string): boolean {}\n}\n `;\n}\n"],"mappings":";;;;;;AAEO,SAASA,YAAYA,CAAC;EAAEC;AAAiC,CAAC,EAAE;EACjE,OAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2CA,cAAc;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '@teambit/generator';
1
+ import type { ComponentContext } from '@teambit/generator';
2
2
  export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `import { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport type { ${namePascalCase}Main } from './${name}.main.runtime';\nexport default ${namePascalCase}Aspect;\nexport { ${namePascalCase}Aspect };\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAO,YAAYD,cAAc,oBAAoBC,IAAI;AAC3D;AACA,gBAAgBD,cAAc,kBAAkBC,IAAI;AACpD,iBAAiBD,cAAc;AAC/B,WAAWA,cAAc;AACzB,CAAC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index-file.ts"],"sourcesContent":["import type { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `import { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport type { ${namePascalCase}Main } from './${name}.main.runtime';\nexport default ${namePascalCase}Aspect;\nexport { ${namePascalCase}Aspect };\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAO,YAAYD,cAAc,oBAAoBC,IAAI;AAC3D;AACA,gBAAgBD,cAAc,kBAAkBC,IAAI;AACpD,iBAAiBD,cAAc;AAC/B,WAAWA,cAAc;AACzB,CAAC;AACD","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentContext } from '@teambit/generator';
1
+ import type { ComponentContext } from '@teambit/generator';
2
2
  export declare function mainRuntimeFile({ name, namePascalCase }: ComponentContext): string;
@@ -1 +1 @@
1
- {"version":3,"names":["mainRuntimeFile","name","namePascalCase"],"sources":["main-runtime-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainRuntimeFile({ name, namePascalCase }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { ${namePascalCase} } from './${name}.compiler';\nimport { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport class ${namePascalCase}Main {\n constructor(private compiler: CompilerMain) {}\n\n static slots = [];\n static dependencies = [CompilerAspect];\n static runtime = MainRuntime;\n\n distDir = 'dist';\n\n /* Set the main property of the component's package with\n the relative output path for the main file */\n getPackageJsonProps() {\n return {\n main: '\\${this.distDir}/{main}.js',\n };\n }\n\n createCompiler(): ${namePascalCase} {\n return new ${namePascalCase}(${namePascalCase}Aspect.id, this.distDir, this.compiler);\n }\n\n static async provider([compiler]: [CompilerMain]) {\n return new ${namePascalCase}Main(compiler);\n }\n}\n\n${namePascalCase}Aspect.addRuntime(${namePascalCase}Main);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAeA,CAAC;EAAEC,IAAI;EAAEC;AAAiC,CAAC,EAAE;EAC1E,OAAO;AACT;AACA,WAAWA,cAAc,cAAcD,IAAI;AAC3C,WAAWC,cAAc,oBAAoBD,IAAI;AACjD;AACA,eAAeC,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsBA,cAAc;AACpC,iBAAiBA,cAAc,IAAIA,cAAc;AACjD;AACA;AACA;AACA,iBAAiBA,cAAc;AAC/B;AACA;AACA;AACA,EAAEA,cAAc,qBAAqBA,cAAc;AACnD,CAAC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["mainRuntimeFile","name","namePascalCase"],"sources":["main-runtime-file.ts"],"sourcesContent":["import type { ComponentContext } from '@teambit/generator';\n\nexport function mainRuntimeFile({ name, namePascalCase }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { ${namePascalCase} } from './${name}.compiler';\nimport { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport class ${namePascalCase}Main {\n constructor(private compiler: CompilerMain) {}\n\n static slots = [];\n static dependencies = [CompilerAspect];\n static runtime = MainRuntime;\n\n distDir = 'dist';\n\n /* Set the main property of the component's package with\n the relative output path for the main file */\n getPackageJsonProps() {\n return {\n main: '\\${this.distDir}/{main}.js',\n };\n }\n\n createCompiler(): ${namePascalCase} {\n return new ${namePascalCase}(${namePascalCase}Aspect.id, this.distDir, this.compiler);\n }\n\n static async provider([compiler]: [CompilerMain]) {\n return new ${namePascalCase}Main(compiler);\n }\n}\n\n${namePascalCase}Aspect.addRuntime(${namePascalCase}Main);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAeA,CAAC;EAAEC,IAAI;EAAEC;AAAiC,CAAC,EAAE;EAC1E,OAAO;AACT;AACA,WAAWA,cAAc,cAAcD,IAAI;AAC3C,WAAWC,cAAc,oBAAoBD,IAAI;AACjD;AACA,eAAeC,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsBA,cAAc;AACpC,iBAAiBA,cAAc,IAAIA,cAAc;AACjD;AACA;AACA;AACA,iBAAiBA,cAAc;AAC/B;AACA;AACA;AACA,EAAEA,cAAc,qBAAqBA,cAAc;AACnD,CAAC;AACD","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ComponentTemplate } from '@teambit/generator';
1
+ import type { ComponentTemplate } from '@teambit/generator';
2
2
  export declare const compilerTemplate: ComponentTemplate;
@@ -1 +1 @@
1
- {"version":3,"names":["_indexFile","data","require","_aspectFile","_mainRuntimeFile","_compilerFile","compilerTemplate","exports","name","description","hidden","generateFiles","context","relativePath","content","indexFile","isMain","aspectFile","compilerFile","mainRuntimeFile"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index-file';\nimport { aspectFile } from './files/aspect-file';\nimport { mainRuntimeFile } from './files/main-runtime-file';\nimport { compilerFile } from './files/compiler-file';\n\nexport const compilerTemplate: ComponentTemplate = {\n name: 'compiler',\n description: 'A compiler implementation',\n hidden: true,\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `${context.name}.compiler.ts`,\n content: compilerFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntimeFile(context),\n },\n ];\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMK,gBAAmC,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EACjDE,IAAI,EAAE,UAAU;EAChBC,WAAW,EAAE,2BAA2B;EACxCC,MAAM,EAAE,IAAI;EACZC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL;MACEC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAE,IAAAC,sBAAS,EAACH,OAAO,CAAC;MAC3BI,MAAM,EAAE;IACV,CAAC,EACD;MACEH,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,YAAY;MACzCM,OAAO,EAAE,IAAAG,wBAAU,EAACL,OAAO;IAC7B,CAAC,EACD;MACEC,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,cAAc;MAC3CM,OAAO,EAAE,IAAAI,4BAAY,EAACN,OAAO;IAC/B,CAAC,EACD;MACEC,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,kBAAkB;MAC/CM,OAAO,EAAE,IAAAK,kCAAe,EAACP,OAAO;IAClC,CAAC,CACF;EACH;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_indexFile","data","require","_aspectFile","_mainRuntimeFile","_compilerFile","compilerTemplate","exports","name","description","hidden","generateFiles","context","relativePath","content","indexFile","isMain","aspectFile","compilerFile","mainRuntimeFile"],"sources":["index.ts"],"sourcesContent":["import type { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index-file';\nimport { aspectFile } from './files/aspect-file';\nimport { mainRuntimeFile } from './files/main-runtime-file';\nimport { compilerFile } from './files/compiler-file';\n\nexport const compilerTemplate: ComponentTemplate = {\n name: 'compiler',\n description: 'A compiler implementation',\n hidden: true,\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `${context.name}.compiler.ts`,\n content: compilerFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntimeFile(context),\n },\n ];\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAA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it/builder';
1
+ import type { BuildContext, BuildTask, BuiltTaskResult, TaskResultsList } from '@teambit/builder';
2
2
  import type { Component } from '@teambit/component';
3
- import { ServiceHandler } from '@teambit/envs';
3
+ import type { ServiceHandler } from '@teambit/envs';
4
4
  export type TranspileFileParams = {
5
5
  componentDir: string;
6
6
  filePath: string;
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["CompilationInitiator","exports"],"sources":["types.ts"],"sourcesContent":["import { BuildContext, BuildTask, BuiltTaskResult, TaskResultsList } from '@teambit/builder';\nimport type { Component } from '@teambit/component';\nimport { ServiceHandler } from '@teambit/envs';\n\nexport type TranspileFileParams = {\n componentDir: string; // absolute path of the component's root directory\n filePath: string; // relative path of the file inside the component directory\n};\n\nexport enum CompilationInitiator {\n CmdReport,\n CmdJson,\n PreStart,\n PreWatch,\n Start,\n ComponentChanged,\n AspectLoadFail,\n ComponentAdded,\n Install,\n PreDevServer,\n}\n\nexport type TranspileComponentParams = {\n component: Component;\n componentDir: string; // absolute path of the component's root directory\n outputDir: string; // absolute path of the component's output directory\n initiator: CompilationInitiator; // origin of the compilation's request\n};\n\nexport type TypeGeneratorCompParams = { component: Component; packageDir: string };\n\nexport type TranspileFileOutputOneFile = {\n outputText: string;\n outputPath: string;\n};\n\nexport type TranspileFileOutput = TranspileFileOutputOneFile[] | null;\n\nexport interface CompilerOptions {\n /**\n * name of the compiler.\n */\n name?: string;\n\n /**\n * relative path of the dist directory inside the capsule. e.g. \"dist\".\n */\n distDir: string;\n\n /**\n * determines which ones of the generated files will be saved in the bit objects when tagging.\n * e.g. distGlobPatterns = [`${this.distDir}/**`, `!${this.distDir}/tsconfig.tsbuildinfo`];\n * see https://github.com/mrmlnc/fast-glob for the supported glob patters syntax.\n */\n distGlobPatterns?: string[];\n\n /**\n * whether or not unsupported files (such as assets) should be copied into the dist directory\n */\n shouldCopyNonSupportedFiles?: boolean;\n\n /**\n * optional. default to \"dist\".\n * useful when the build pipeline has multiple compiler tasks of the same compiler.\n * e.g. using the same Babel compiler for two different tasks, one for creating \"es5\" files, and\n * the second for creating \"esm\". the artifact names would be \"es5\" and \"esm\" accordingly.\n */\n artifactName?: string;\n}\n\nexport interface Compiler extends CompilerOptions, ServiceHandler {\n /**\n * id of the compiler.\n */\n id: string;\n\n /**\n * Delete dist folder before writing the new compiled files\n */\n deleteDistDir?: boolean;\n\n /**\n * serialized config of the compiler.\n */\n displayConfig?(): string;\n\n /**\n * transpile a single file that gets saved into the workspace, used by `bit compile` and during\n * development\n */\n transpileFile?: (\n fileContent: string,\n params: TranspileFileParams\n ) => TranspileFileOutput | Promise<TranspileFileOutput>;\n\n /**\n * transpile all the files of a component, use this when you can't use `transpileFile`\n */\n transpileComponent?: (params: TranspileComponentParams) => Promise<void>;\n\n preGenerateTypesOnWorkspace?: (params: TypeGeneratorCompParams[], envId: string) => Promise<void>;\n\n generateTypesOnWorkspace?: (rootDir: string, params: TypeGeneratorCompParams[]) => Promise<void>;\n\n /**\n * compile components inside isolated capsules. this being used during tag for the release.\n * meaning, the final package of the component has the dists generated by this method.\n *\n * no need to handle non-supported-files (e.g. assets) in this method because the compiler-aspect already copies them\n * into the compiler.dist in the preBuild stage.\n */\n build(context: BuildContext): Promise<BuiltTaskResult>;\n\n /**\n * return the dist dir of the compiled files (relative path from the component root dir)\n */\n getDistDir?(): string;\n\n /**\n * given a source file, return its parallel in the dists. e.g. \"index.ts\" => \"dist/index.js\"\n * both, the return path and the given path are relative paths.\n */\n getDistPathBySrcPath(srcPath: string): string;\n\n /**\n * given a component, returns the path to the source folder to use for the preview, uses the one\n * in node_modules by default\n */\n getPreviewComponentRootPath?(component: Component): string;\n\n /**\n * only supported files matching get compiled. others, are copied to the dist dir.\n */\n isFileSupported(filePath: string): boolean;\n\n /**\n * sugar to create a Compiler task via the concrete compiler\n */\n createTask?(name?: string): BuildTask;\n\n /**\n * run before the build pipeline has started. this is useful when some preparation are needed to\n * be done on all envs before the build starts.\n */\n preBuild?(context: BuildContext): Promise<void>;\n\n /**\n * run after the build pipeline completed for all envs. useful for some cleanups\n */\n postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>;\n\n /**\n * returns the version of the current compiler instance (e.g. '4.0.1').\n */\n version(): string;\n\n /**\n * returns the display name of the current compiler instance (e.g. 'TypeScript')\n */\n displayName: string;\n}\n"],"mappings":";;;;;;IASYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["CompilationInitiator","exports"],"sources":["types.ts"],"sourcesContent":["import type { BuildContext, BuildTask, BuiltTaskResult, TaskResultsList } from '@teambit/builder';\nimport type { Component } from '@teambit/component';\nimport type { ServiceHandler } from '@teambit/envs';\n\nexport type TranspileFileParams = {\n componentDir: string; // absolute path of the component's root directory\n filePath: string; // relative path of the file inside the component directory\n};\n\nexport enum CompilationInitiator {\n CmdReport,\n CmdJson,\n PreStart,\n PreWatch,\n Start,\n ComponentChanged,\n AspectLoadFail,\n ComponentAdded,\n Install,\n PreDevServer,\n}\n\nexport type TranspileComponentParams = {\n component: Component;\n componentDir: string; // absolute path of the component's root directory\n outputDir: string; // absolute path of the component's output directory\n initiator: CompilationInitiator; // origin of the compilation's request\n};\n\nexport type TypeGeneratorCompParams = { component: Component; packageDir: string };\n\nexport type TranspileFileOutputOneFile = {\n outputText: string;\n outputPath: string;\n};\n\nexport type TranspileFileOutput = TranspileFileOutputOneFile[] | null;\n\nexport interface CompilerOptions {\n /**\n * name of the compiler.\n */\n name?: string;\n\n /**\n * relative path of the dist directory inside the capsule. e.g. \"dist\".\n */\n distDir: string;\n\n /**\n * determines which ones of the generated files will be saved in the bit objects when tagging.\n * e.g. distGlobPatterns = [`${this.distDir}/**`, `!${this.distDir}/tsconfig.tsbuildinfo`];\n * see https://github.com/mrmlnc/fast-glob for the supported glob patters syntax.\n */\n distGlobPatterns?: string[];\n\n /**\n * whether or not unsupported files (such as assets) should be copied into the dist directory\n */\n shouldCopyNonSupportedFiles?: boolean;\n\n /**\n * optional. default to \"dist\".\n * useful when the build pipeline has multiple compiler tasks of the same compiler.\n * e.g. using the same Babel compiler for two different tasks, one for creating \"es5\" files, and\n * the second for creating \"esm\". the artifact names would be \"es5\" and \"esm\" accordingly.\n */\n artifactName?: string;\n}\n\nexport interface Compiler extends CompilerOptions, ServiceHandler {\n /**\n * id of the compiler.\n */\n id: string;\n\n /**\n * Delete dist folder before writing the new compiled files\n */\n deleteDistDir?: boolean;\n\n /**\n * serialized config of the compiler.\n */\n displayConfig?(): string;\n\n /**\n * transpile a single file that gets saved into the workspace, used by `bit compile` and during\n * development\n */\n transpileFile?: (\n fileContent: string,\n params: TranspileFileParams\n ) => TranspileFileOutput | Promise<TranspileFileOutput>;\n\n /**\n * transpile all the files of a component, use this when you can't use `transpileFile`\n */\n transpileComponent?: (params: TranspileComponentParams) => Promise<void>;\n\n preGenerateTypesOnWorkspace?: (params: TypeGeneratorCompParams[], envId: string) => Promise<void>;\n\n generateTypesOnWorkspace?: (rootDir: string, params: TypeGeneratorCompParams[]) => Promise<void>;\n\n /**\n * compile components inside isolated capsules. this being used during tag for the release.\n * meaning, the final package of the component has the dists generated by this method.\n *\n * no need to handle non-supported-files (e.g. assets) in this method because the compiler-aspect already copies them\n * into the compiler.dist in the preBuild stage.\n */\n build(context: BuildContext): Promise<BuiltTaskResult>;\n\n /**\n * return the dist dir of the compiled files (relative path from the component root dir)\n */\n getDistDir?(): string;\n\n /**\n * given a source file, return its parallel in the dists. e.g. \"index.ts\" => \"dist/index.js\"\n * both, the return path and the given path are relative paths.\n */\n getDistPathBySrcPath(srcPath: string): string;\n\n /**\n * given a component, returns the path to the source folder to use for the preview, uses the one\n * in node_modules by default\n */\n getPreviewComponentRootPath?(component: Component): string;\n\n /**\n * only supported files matching get compiled. others, are copied to the dist dir.\n */\n isFileSupported(filePath: string): boolean;\n\n /**\n * sugar to create a Compiler task via the concrete compiler\n */\n createTask?(name?: string): BuildTask;\n\n /**\n * run before the build pipeline has started. this is useful when some preparation are needed to\n * be done on all envs before the build starts.\n */\n preBuild?(context: BuildContext): Promise<void>;\n\n /**\n * run after the build pipeline completed for all envs. useful for some cleanups\n */\n postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>;\n\n /**\n * returns the version of the current compiler instance (e.g. '4.0.1').\n */\n version(): string;\n\n /**\n * returns the display name of the current compiler instance (e.g. 'TypeScript')\n */\n displayName: string;\n}\n"],"mappings":";;;;;;IASYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
@@ -1,18 +1,17 @@
1
- import { Component } from '@teambit/component';
2
- import { EnvDefinition, EnvsMain } from '@teambit/envs';
1
+ import type { Component } from '@teambit/component';
2
+ import type { EnvDefinition, EnvsMain } from '@teambit/envs';
3
3
  import type { PubsubMain } from '@teambit/pubsub';
4
- import { SerializableResults, Workspace } from '@teambit/workspace';
5
- import type { WorkspaceComponentLoadOptions } from '@teambit/workspace';
6
- import { WatcherMain, WatchOptions } from '@teambit/watcher';
4
+ import type { WorkspaceComponentLoadOptions, SerializableResults, Workspace } from '@teambit/workspace';
5
+ import type { WatcherMain, WatchOptions } from '@teambit/watcher';
7
6
  import { ComponentID } from '@teambit/component-id';
8
7
  import { Logger } from '@teambit/logger';
9
8
  import { Dist } from '@teambit/component.sources';
10
- import { AspectLoaderMain } from '@teambit/aspect-loader';
11
- import { DependencyResolverMain } from '@teambit/dependency-resolver';
12
- import { UiMain } from '@teambit/ui';
13
- import type { PreStartOpts } from '@teambit/ui';
14
- import { CompIdGraph } from '@teambit/graph';
15
- import { Compiler, CompilationInitiator } from './types';
9
+ import type { AspectLoaderMain } from '@teambit/aspect-loader';
10
+ import type { DependencyResolverMain } from '@teambit/dependency-resolver';
11
+ import type { UiMain, PreStartOpts } from '@teambit/ui';
12
+ import type { CompIdGraph } from '@teambit/graph';
13
+ import type { Compiler } from './types';
14
+ import { CompilationInitiator } from './types';
16
15
  export type BuildResult = {
17
16
  component: string;
18
17
  buildResults: string[];
@@ -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","ComponentCompiler","constructor","pubsub","workspace","component","compilerInstance","compilerId","logger","env","dists","compileErrors","compile","noThrow","options","dataToPersist","deleteDistDir","distDirs","DataToPersist","distDir","removePath","RemovePath","addBasePath","path","persistAllToFS","compilers","canTranspileFile","find","c","transpileFile","canTranspileComponent","transpileComponent","Promise","all","filesystem","files","map","file","compileOneFile","initiator","compileAllFiles","Error","toString","throwOnCompileErrors","addManyFiles","buildResults","distFile","state","_consumer","compiler","consoleSuccess","id","errors","getPackageDir","packageName","componentIdToPackageName","join","length","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","fs","copyFile","filePath","isFileSupported","compileResults","contents","push","base","result","Dist","outputPath","Buffer","from","outputText","shouldCopyNonSupportedFiles","filesToCompile","outputDir","getComponentPackagePath","exports","WorkspaceCompiler","envs","aspectLoader","ui","dependencyResolver","watcher","registerOnComponentChange","onComponentChange","bind","registerOnComponentAdd","onComponentAdd","registerOnPreWatch","onPreWatch","registerPreStart","onPreStart","registerOnAspectLoadErrorSlot","onAspectLoadFail","preStartOpts","skipCompilation","compileComponents","changed","verbose","CompilationInitiator","PreStart","watchScopeInternalFiles","code","includes","inInstallContext","inInstallAfterPmContext","shouldCompile","graph","successors","getEnvDepsGraph","depsIds","s","AspectLoadFail","loadExtensions","executeLoadSlot","envComponentId","getGraphIds","nodeFilter","node","hasId","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","Object","keys","nonLoadedEnvs","filter","isEnvRegistered","loadAspects","idsToClearCache","uniq","reduce","acc","compIds","concat","clearComponentsCache","ComponentID","fromString","componentsCompilers","getOrCalculateEnv","environment","getCompiler","compilerName","name","warn","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","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 { Component } from '@teambit/component';\nimport { EnvDefinition, EnvsMain } from '@teambit/envs';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { SerializableResults, Workspace, OutsideWorkspaceError } from '@teambit/workspace';\nimport type { WorkspaceComponentLoadOptions } from '@teambit/workspace';\nimport { 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 { AbstractVinyl, Dist, DataToPersist, RemovePath } from '@teambit/component.sources';\nimport {\n linkToNodeModulesByComponents,\n removeLinksFromNodeModules,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { DependencyList, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { PathOsBasedAbsolute, PathOsBasedRelative } from '@teambit/toolbox.path.path';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport { UiMain } from '@teambit/ui';\nimport { readRootComponentsDir } from '@teambit/workspace.root-components';\nimport { compact, groupBy, uniq } from 'lodash';\nimport type { PreStartOpts } from '@teambit/ui';\nimport { MultiCompiler } from '@teambit/multi-compiler';\nimport { CompIdGraph } from '@teambit/graph';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompilerErrorEvent } from './events';\nimport { Compiler, CompilationInitiator, TypeGeneratorCompParams } from './types';\n\nexport type BuildResult = {\n component: string;\n buildResults: string[];\n errors: CompileError[];\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 dataToPersist = new DataToPersist();\n for (const distDir of distDirs) {\n dataToPersist.removePath(new RemovePath(distDir));\n }\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\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 dataToPersist = new DataToPersist();\n dataToPersist.addManyFiles(this.dists);\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\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 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<PathOsBasedRelative[]> {\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 = path.join(this.workspace.path, 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 = path.join(this.workspace.path, 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 private async compileOneFile(\n file: AbstractVinyl,\n initiator: CompilationInitiator,\n distDirs: PathOsBasedRelative[]\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: PathOsBasedRelative[]): 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 } 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 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' || err.code === 'ERR_MODULE_NOT_FOUND' || err.code === 'ERR_REQUIRE_ESM')) ||\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 { 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 }\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\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 }\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;\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 const subGraph = graph.successorsSubgraph(envsOfEnvsWithoutCoreCompIds, {\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));\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 if (!buildResults.length) return '';\n // this gets called when a file is changed, so the buildResults array always has only one item\n const buildResult = buildResults[0];\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;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MACxB,MAAM8G,YAAY,GAAG,MAAM,IAAI,CAACnK,SAAS,CAAC2Q,2BAA2B,CAACjG,aAAa,CAAC;MACpF,OAAO,IAAI,CAAC1K,SAAS,CAAC4Q,SAAS,CAACzG,YAAY,CAAC;IAC/C;IACA,IAAIjC,OAAO,EAAE;MACX,OAAO,IAAI,CAAClI,SAAS,CAAC6Q,oBAAoB,CAAC,CAAC;IAC9C;IACA,OAAO,IAAI,CAAC7Q,SAAS,CAAC8Q,OAAO,CAAC,CAAC;EACjC;AACF;AAACjK,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAED,SAASoD,oBAAoBA,CAACzH,YAA2B,EAAE0F,OAAiB,EAAE;EAC5E,IAAI,CAAC1F,YAAY,CAACY,MAAM,EAAE,OAAO,EAAE;EACnC;EACA,MAAM0N,WAAW,GAAGtO,YAAY,CAAC,CAAC,CAAC;EACnC,MAAMuO,KAAK,GAAG,IAAIC,gBAAK,CAACC,SAAS,CAAC,sBAAsB,CAAC,EAAE;EAC3D,MAAMC,kCAAkC,GAAGA,CAAA,KAAM;IAC/C,OAAOJ,WAAW,CAACtO,YAAY,CAACT,GAAG,CAAE6D,QAAQ,IAAK,SAASA,QAAQ,EAAE,CAAC,CAACzC,IAAI,CAAC,IAAI,CAAC;EACnF,CAAC;EAED,OAAO,GAAG4N,KAAK;AACjB,IAAII,gBAAM,CAACC,aAAa,CAAC,CAAC,YAAYN,WAAW,CAAC9Q,SAAS;AAC3D,IAAIkI,OAAO,GAAG,GAAGgJ,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","ComponentCompiler","constructor","pubsub","workspace","component","compilerInstance","compilerId","logger","env","dists","compileErrors","compile","noThrow","options","dataToPersist","deleteDistDir","distDirs","DataToPersist","distDir","removePath","RemovePath","addBasePath","path","persistAllToFS","compilers","canTranspileFile","find","c","transpileFile","canTranspileComponent","transpileComponent","Promise","all","filesystem","files","map","file","compileOneFile","initiator","compileAllFiles","Error","toString","throwOnCompileErrors","addManyFiles","buildResults","distFile","state","_consumer","compiler","consoleSuccess","id","errors","getPackageDir","packageName","componentIdToPackageName","join","length","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","fs","copyFile","filePath","isFileSupported","compileResults","contents","push","base","result","Dist","outputPath","Buffer","from","outputText","shouldCopyNonSupportedFiles","filesToCompile","outputDir","getComponentPackagePath","exports","WorkspaceCompiler","envs","aspectLoader","ui","dependencyResolver","watcher","registerOnComponentChange","onComponentChange","bind","registerOnComponentAdd","onComponentAdd","registerOnPreWatch","onPreWatch","registerPreStart","onPreStart","registerOnAspectLoadErrorSlot","onAspectLoadFail","preStartOpts","skipCompilation","compileComponents","changed","verbose","CompilationInitiator","PreStart","watchScopeInternalFiles","code","includes","inInstallContext","inInstallAfterPmContext","shouldCompile","graph","successors","getEnvDepsGraph","depsIds","s","AspectLoadFail","loadExtensions","executeLoadSlot","envComponentId","getGraphIds","nodeFilter","node","hasId","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","Object","keys","nonLoadedEnvs","filter","isEnvRegistered","loadAspects","idsToClearCache","uniq","reduce","acc","compIds","concat","clearComponentsCache","ComponentID","fromString","componentsCompilers","getOrCalculateEnv","environment","getCompiler","compilerName","name","warn","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","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, PathOsBasedRelative } 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\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 dataToPersist = new DataToPersist();\n for (const distDir of distDirs) {\n dataToPersist.removePath(new RemovePath(distDir));\n }\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\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 dataToPersist = new DataToPersist();\n dataToPersist.addManyFiles(this.dists);\n dataToPersist.addBasePath(this.workspace.path);\n await dataToPersist.persistAllToFS();\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 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<PathOsBasedRelative[]> {\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 = path.join(this.workspace.path, 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 = path.join(this.workspace.path, 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 private async compileOneFile(\n file: AbstractVinyl,\n initiator: CompilationInitiator,\n distDirs: PathOsBasedRelative[]\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: PathOsBasedRelative[]): 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 } 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 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' || err.code === 'ERR_MODULE_NOT_FOUND' || err.code === 'ERR_REQUIRE_ESM')) ||\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 { 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 }\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\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 }\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;\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 const subGraph = graph.successorsSubgraph(envsOfEnvsWithoutCoreCompIds, {\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));\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 if (!buildResults.length) return '';\n // this gets called when a file is changed, so the buildResults array always has only one item\n const buildResult = buildResults[0];\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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9Q,SAAS;AAC3D,IAAIkI,OAAO,GAAG,GAAGgJ,kCAAkC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE;AAChE","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { ComponentID } from '@teambit/component';
1
+ import type { ComponentID } from '@teambit/component';
2
2
  import { BitError } from '@teambit/bit-error';
3
3
 
4
4
  export class DistArtifactNotFound extends BitError {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/compiler",
3
- "version": "1.0.667",
3
+ "version": "1.0.668",
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.667"
9
+ "version": "1.0.668"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -21,29 +21,29 @@
21
21
  "@teambit/component-issues": "0.0.160",
22
22
  "@teambit/legacy.constants": "0.0.13",
23
23
  "@teambit/toolbox.fs.hard-link-directory": "0.0.23",
24
- "@teambit/component.sources": "0.0.109",
25
24
  "@teambit/toolbox.path.path": "0.0.8",
26
- "@teambit/pkg.modules.component-package-name": "0.0.64",
27
- "@teambit/workspace.modules.node-modules-linker": "0.0.285",
28
25
  "@teambit/workspace.root-components": "1.0.0",
29
26
  "@teambit/bit-error": "0.0.404",
30
- "@teambit/envs": "1.0.667",
31
- "@teambit/cli": "0.0.1244",
32
- "@teambit/logger": "0.0.1337",
33
- "@teambit/pubsub": "1.0.667",
34
- "@teambit/aspect-loader": "1.0.667",
35
- "@teambit/builder": "1.0.667",
36
- "@teambit/bundler": "1.0.667",
37
- "@teambit/component": "1.0.667",
38
- "@teambit/dependency-resolver": "1.0.667",
39
- "@teambit/generator": "1.0.668",
40
- "@teambit/issues": "1.0.667",
41
- "@teambit/ui": "1.0.667",
42
- "@teambit/watcher": "1.0.667",
43
- "@teambit/workspace": "1.0.667",
44
- "@teambit/isolator": "1.0.667",
45
- "@teambit/graph": "1.0.667",
46
- "@teambit/multi-compiler": "1.0.667"
27
+ "@teambit/envs": "1.0.668",
28
+ "@teambit/cli": "0.0.1245",
29
+ "@teambit/logger": "0.0.1338",
30
+ "@teambit/pubsub": "1.0.668",
31
+ "@teambit/aspect-loader": "1.0.668",
32
+ "@teambit/builder": "1.0.668",
33
+ "@teambit/bundler": "1.0.668",
34
+ "@teambit/component": "1.0.668",
35
+ "@teambit/dependency-resolver": "1.0.668",
36
+ "@teambit/generator": "1.0.669",
37
+ "@teambit/issues": "1.0.668",
38
+ "@teambit/ui": "1.0.668",
39
+ "@teambit/watcher": "1.0.668",
40
+ "@teambit/workspace": "1.0.668",
41
+ "@teambit/isolator": "1.0.668",
42
+ "@teambit/component.sources": "0.0.110",
43
+ "@teambit/graph": "1.0.668",
44
+ "@teambit/multi-compiler": "1.0.668",
45
+ "@teambit/pkg.modules.component-package-name": "0.0.65",
46
+ "@teambit/workspace.modules.node-modules-linker": "0.0.286"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/pretty-time": "^1.1.5",
@@ -1,4 +1,4 @@
1
- import { ComponentContext } from '@teambit/generator';
1
+ import type { ComponentContext } from '@teambit/generator';
2
2
 
3
3
  export function aspectFile({ namePascalCase, componentId }: ComponentContext) {
4
4
  return `import { Aspect } from '@teambit/harmony';
@@ -1,4 +1,4 @@
1
- import { ComponentContext } from '@teambit/generator';
1
+ import type { ComponentContext } from '@teambit/generator';
2
2
 
3
3
  export function compilerFile({ namePascalCase }: ComponentContext) {
4
4
  return `import {
@@ -1,4 +1,4 @@
1
- import { ComponentContext } from '@teambit/generator';
1
+ import type { ComponentContext } from '@teambit/generator';
2
2
 
3
3
  export function indexFile({ namePascalCase, name }: ComponentContext) {
4
4
  return `import { ${namePascalCase}Aspect } from './${name}.aspect';
@@ -1,4 +1,4 @@
1
- import { ComponentContext } from '@teambit/generator';
1
+ import type { ComponentContext } from '@teambit/generator';
2
2
 
3
3
  export function mainRuntimeFile({ name, namePascalCase }: ComponentContext) {
4
4
  return `import { MainRuntime } from '@teambit/cli';
@@ -1,4 +1,4 @@
1
- import { ComponentContext, ComponentTemplate } from '@teambit/generator';
1
+ import type { ComponentContext, ComponentTemplate } from '@teambit/generator';
2
2
  import { indexFile } from './files/index-file';
3
3
  import { aspectFile } from './files/aspect-file';
4
4
  import { mainRuntimeFile } from './files/main-runtime-file';