@teambit/compiler 1.0.587 → 1.0.590

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.
@@ -12,6 +12,7 @@ import { GeneratorMain } from '@teambit/generator';
12
12
  import { PubsubMain } from '@teambit/pubsub';
13
13
  import { UiMain } from '@teambit/ui';
14
14
  import { Workspace, WorkspaceComponentLoadOptions } from '@teambit/workspace';
15
+ import { BundlerMain } from '@teambit/bundler';
15
16
  import { CompilerService } from './compiler.service';
16
17
  import { CompilerTask } from './compiler.task';
17
18
  import { DistArtifact } from './dist-artifact';
@@ -55,7 +56,7 @@ export declare class CompilerMain {
55
56
  addMissingDistsIssue(components: Component[], issuesToIgnore: string[]): Promise<void>;
56
57
  static runtime: import("@teambit/harmony").RuntimeDefinition;
57
58
  static dependencies: import("@teambit/harmony").Aspect[];
58
- static provider([cli, workspace, envs, loggerMain, pubsub, aspectLoader, builder, ui, generator, dependencyResolver, watcher, issues,]: [
59
+ static provider([cli, workspace, envs, loggerMain, pubsub, aspectLoader, builder, ui, generator, dependencyResolver, watcher, issues, bundler]: [
59
60
  CLIMain,
60
61
  Workspace,
61
62
  EnvsMain,
@@ -67,7 +68,8 @@ export declare class CompilerMain {
67
68
  GeneratorMain,
68
69
  DependencyResolverMain,
69
70
  WatcherMain,
70
- IssuesMain
71
+ IssuesMain,
72
+ BundlerMain
71
73
  ]): Promise<CompilerMain>;
72
74
  }
73
75
  export default CompilerMain;
@@ -116,6 +116,13 @@ function _workspace() {
116
116
  };
117
117
  return data;
118
118
  }
119
+ function _bundler() {
120
+ const data = require("@teambit/bundler");
121
+ _bundler = function () {
122
+ return data;
123
+ };
124
+ return data;
125
+ }
119
126
  function _compiler() {
120
127
  const data = require("./compiler.aspect");
121
128
  _compiler = function () {
@@ -262,7 +269,7 @@ class CompilerMain {
262
269
  }
263
270
  }));
264
271
  }
265
- static async provider([cli, workspace, envs, loggerMain, pubsub, aspectLoader, builder, ui, generator, dependencyResolver, watcher, issues]) {
272
+ static async provider([cli, workspace, envs, loggerMain, pubsub, aspectLoader, builder, ui, generator, dependencyResolver, watcher, issues, bundler]) {
266
273
  const logger = loggerMain.createLogger(_compiler().CompilerAspect.id);
267
274
  const compilerService = new (_compiler3().CompilerService)();
268
275
  const workspaceCompiler = new (_workspaceCompiler().WorkspaceCompiler)(workspace, envs, pubsub, aspectLoader, ui, logger, dependencyResolver, watcher);
@@ -273,12 +280,18 @@ class CompilerMain {
273
280
  issues.registerAddComponentsIssues(compilerMain.addMissingDistsIssue.bind(compilerMain));
274
281
  }
275
282
  if (generator) generator.registerComponentTemplate([_compiler5().compilerTemplate]);
283
+ bundler.registerOnPreDevServerCreated(async newCompsWithoutDevServer => {
284
+ logger.debug(`Compiling ${newCompsWithoutDevServer.length} components: ${newCompsWithoutDevServer.map(c => c.id.toString()).join(', ')} before dev server creation`);
285
+ await compilerMain.compileOnWorkspace(newCompsWithoutDevServer.map(c => c.id), {
286
+ initiator: _types().CompilationInitiator.PreDevServer
287
+ });
288
+ });
276
289
  return compilerMain;
277
290
  }
278
291
  }
279
292
  exports.CompilerMain = CompilerMain;
280
293
  _defineProperty(CompilerMain, "runtime", _cli().MainRuntime);
281
- _defineProperty(CompilerMain, "dependencies", [_cli().CLIAspect, _workspace().WorkspaceAspect, _envs().EnvsAspect, _logger().LoggerAspect, _pubsub().PubsubAspect, _aspectLoader().AspectLoaderAspect, _builder().BuilderAspect, _ui().UIAspect, _generator().GeneratorAspect, _dependencyResolver().DependencyResolverAspect, _watcher().WatcherAspect, _issues().IssuesAspect]);
294
+ _defineProperty(CompilerMain, "dependencies", [_cli().CLIAspect, _workspace().WorkspaceAspect, _envs().EnvsAspect, _logger().LoggerAspect, _pubsub().PubsubAspect, _aspectLoader().AspectLoaderAspect, _builder().BuilderAspect, _ui().UIAspect, _generator().GeneratorAspect, _dependencyResolver().DependencyResolverAspect, _watcher().WatcherAspect, _issues().IssuesAspect, _bundler().BundlerAspect]);
282
295
  _compiler().CompilerAspect.addRuntime(CompilerMain);
283
296
  var _default = exports.default = CompilerMain;
284
297
 
@@ -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","_compiler","_compiler2","_compiler3","_compiler4","_distArtifact","_exceptions","_types","_workspaceCompiler","_compiler5","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_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","logger","createLogger","CompilerService","WorkspaceCompiler","registerService","compilerMain","register","CompileCmd","registerAddComponentsIssues","bind","registerComponentTemplate","compilerTemplate","exports","MainRuntime","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","PubsubAspect","AspectLoaderAspect","BuilderAspect","UIAspect","GeneratorAspect","DependencyResolverAspect","WatcherAspect","IssuesAspect","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 { 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 ];\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 ]: [\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 ]) {\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 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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IAEtE,OAAON,YAAY;EACrB;AACF;AAACO,OAAA,CAAAnF,YAAA,GAAAA,YAAA;AAAAZ,eAAA,CAhKYY,YAAY,aAqFNoF,kBAAW;AAAAhG,eAAA,CArFjBY,YAAY,kBAuFD,CACpBqF,gBAAS,EACTC,4BAAe,EACfC,kBAAU,EACVC,sBAAY,EACZC,sBAAY,EACZC,kCAAkB,EAClBC,wBAAa,EACbC,cAAQ,EACRC,4BAAe,EACfC,8CAAwB,EACxBC,wBAAa,EACbC,sBAAY,CACb;AA8DHxE,0BAAc,CAACyE,UAAU,CAACjG,YAAY,CAAC;AAAC,IAAAkG,QAAA,GAAAf,OAAA,CAAAjH,OAAA,GAEzB8B,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","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_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(`Compiling ${newCompsWithoutDevServer.length} components: ${newCompsWithoutDevServer.map(c => c.id.toString()).join(', ')} before dev server creation`);\n await compilerMain.compileOnWorkspace(\n newCompsWithoutDevServer\n .map(c => c.id), { 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,QAAA;EAAA,MAAAT,IAAA,GAA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AAC,IAAIA,CAAC,CAAC9D,EAAE,CAAC,EAAE;QAAEX,SAAS,EAAEC,6BAAoB,CAAC0E;MAAa,CACpE,CAAC;IACH,CAAC,CAAC;IAEF,OAAOZ,YAAY;EACrB;AACF;AAACa,OAAA,CAAA1F,YAAA,GAAAA,YAAA;AAAAZ,eAAA,CA3KYY,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;AAwEHhF,0BAAc,CAACiF,UAAU,CAACzG,YAAY,CAAC;AAAC,IAAA0G,QAAA,GAAAhB,OAAA,CAAAxH,OAAA,GAEzB8B,YAAY","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.587/dist/compiler.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.587/dist/compiler.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.590/dist/compiler.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compilation_compiler@1.0.590/dist/compiler.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/dist/types.d.ts CHANGED
@@ -14,7 +14,8 @@ export declare enum CompilationInitiator {
14
14
  ComponentChanged = 5,
15
15
  AspectLoadFail = 6,
16
16
  ComponentAdded = 7,
17
- Install = 8
17
+ Install = 8,
18
+ PreDevServer = 9
18
19
  }
19
20
  export type TranspileComponentParams = {
20
21
  component: Component;
package/dist/types.js CHANGED
@@ -14,6 +14,7 @@ let CompilationInitiator = exports.CompilationInitiator = /*#__PURE__*/function
14
14
  CompilationInitiator[CompilationInitiator["AspectLoadFail"] = 6] = "AspectLoadFail";
15
15
  CompilationInitiator[CompilationInitiator["ComponentAdded"] = 7] = "ComponentAdded";
16
16
  CompilationInitiator[CompilationInitiator["Install"] = 8] = "Install";
17
+ CompilationInitiator[CompilationInitiator["PreDevServer"] = 9] = "PreDevServer";
17
18
  return CompilationInitiator;
18
19
  }({});
19
20
 
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}\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;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
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":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/compiler",
3
- "version": "1.0.587",
3
+ "version": "1.0.590",
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.587"
9
+ "version": "1.0.590"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -20,27 +20,28 @@
20
20
  "@teambit/component-id": "1.2.3",
21
21
  "@teambit/workspace.root-components": "1.0.0",
22
22
  "@teambit/bit-error": "0.0.404",
23
- "@teambit/envs": "1.0.587",
24
- "@teambit/cli": "0.0.1164",
25
- "@teambit/logger": "0.0.1257",
26
- "@teambit/pubsub": "1.0.587",
27
- "@teambit/aspect-loader": "1.0.587",
28
- "@teambit/builder": "1.0.587",
23
+ "@teambit/envs": "1.0.590",
24
+ "@teambit/cli": "0.0.1167",
25
+ "@teambit/logger": "0.0.1260",
26
+ "@teambit/pubsub": "1.0.590",
27
+ "@teambit/aspect-loader": "1.0.590",
28
+ "@teambit/builder": "1.0.590",
29
+ "@teambit/bundler": "1.0.590",
29
30
  "@teambit/component-issues": "0.0.157",
30
- "@teambit/component": "1.0.587",
31
- "@teambit/dependency-resolver": "1.0.587",
32
- "@teambit/generator": "1.0.588",
33
- "@teambit/issues": "1.0.587",
31
+ "@teambit/component": "1.0.590",
32
+ "@teambit/dependency-resolver": "1.0.590",
33
+ "@teambit/generator": "1.0.591",
34
+ "@teambit/issues": "1.0.590",
34
35
  "@teambit/legacy.constants": "0.0.11",
35
- "@teambit/ui": "1.0.587",
36
- "@teambit/watcher": "1.0.587",
37
- "@teambit/workspace": "1.0.587",
38
- "@teambit/isolator": "1.0.587",
36
+ "@teambit/ui": "1.0.590",
37
+ "@teambit/watcher": "1.0.590",
38
+ "@teambit/workspace": "1.0.590",
39
+ "@teambit/isolator": "1.0.590",
39
40
  "@teambit/toolbox.fs.hard-link-directory": "0.0.23",
40
41
  "@teambit/component.sources": "0.0.99",
41
42
  "@teambit/toolbox.path.path": "0.0.8",
42
- "@teambit/graph": "1.0.587",
43
- "@teambit/multi-compiler": "1.0.587",
43
+ "@teambit/graph": "1.0.590",
44
+ "@teambit/multi-compiler": "1.0.590",
44
45
  "@teambit/pkg.modules.component-package-name": "0.0.54",
45
46
  "@teambit/workspace.modules.node-modules-linker": "0.0.275"
46
47
  },