@teambit/compiler 0.0.1110 → 0.0.1112
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.
- package/dist/compiler.aspect.js.map +1 -1
- package/dist/compiler.cmd.js +1 -1
- package/dist/compiler.cmd.js.map +1 -1
- package/dist/compiler.composition.js.map +1 -1
- package/dist/compiler.main.runtime.js.map +1 -1
- package/dist/compiler.service.js.map +1 -1
- package/dist/compiler.task.js.map +1 -1
- package/dist/dist-artifact.js.map +1 -1
- package/dist/events/compiler-error.js.map +1 -1
- package/dist/events/component-compilation-on-done.js.map +1 -1
- package/dist/events/index.js.map +1 -1
- package/dist/exceptions/dist-artifact-not-found.js.map +1 -1
- package/dist/exceptions/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/output-formatter.js.map +1 -1
- package/dist/{preview-1689736586631.js → preview-1689909446382.js} +2 -2
- package/dist/templates/compiler/files/aspect-file.js.map +1 -1
- package/dist/templates/compiler/files/compiler-file.js.map +1 -1
- package/dist/templates/compiler/files/index-file.js.map +1 -1
- package/dist/templates/compiler/files/main-runtime-file.js.map +1 -1
- package/dist/templates/compiler/index.js.map +1 -1
- package/dist/types.js +4 -4
- package/dist/types.js.map +1 -1
- package/dist/workspace-compiler.js.map +1 -1
- package/package-tar/teambit-compiler-0.0.1112.tgz +0 -0
- package/package.json +20 -20
- package/package-tar/teambit-compiler-0.0.1110.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["CompilerAspect","Aspect","create","id"],"sources":["compiler.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const CompilerAspect = Aspect.create({\n id: 'teambit.compilation/compiler',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,cAAc,GAAGC,iBAAM,CAACC,MAAM,CAAC;EAC1CC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
|
package/dist/compiler.cmd.js
CHANGED
|
@@ -57,7 +57,7 @@ function _events() {
|
|
|
57
57
|
return data;
|
|
58
58
|
}
|
|
59
59
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
60
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
60
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
61
61
|
class CompileCmd {
|
|
62
62
|
constructor(compile, logger, pubsub) {
|
|
63
63
|
this.compile = compile;
|
package/dist/compiler.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_prettyTime","_outputFormatter","_types","_compiler","_events","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","CompileCmd","constructor","compile","logger","pubsub","name","description","report","components","compilerOptions","startTimestamp","process","hrtime","setStatusLine","sub","CompilerAspect","id","onComponentCompilationDone","bind","outputString","compileComponents","initiator","CompilationInitiator","CmdReport","compileTimeLength","chalk","underline","formatCompileResults","componentsStatus","verbose","getStatusLine","clearStatusLine","code","getExitCode","json","deleteDistDir","compileResults","CmdJson","failedComponents","component","errors","getSummaryIcon","green","red","yellow","numberOfComponents","numberOfFailingComponents","numberOfSuccessfulComponents","icon","summaryLine","prettyTime","event","type","ComponentCompilationOnDoneEvent","TYPE","exports"],"sources":["compiler.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport type { PubsubMain, BitBaseEvent } from '@teambit/pubsub';\nimport chalk from 'chalk';\nimport prettyTime from 'pretty-time';\nimport { Component } from '@teambit/component';\nimport { formatCompileResults } from './output-formatter';\nimport { CompileError, WorkspaceCompiler, CompileOptions } from './workspace-compiler';\nimport { CompilationInitiator } from './types';\n\n// IDs & events\nimport { CompilerAspect } from './compiler.aspect';\nimport { ComponentCompilationOnDoneEvent } from './events';\n\nexport type ComponentsStatus = {\n buildResults: string[];\n component: Component;\n errors: CompileError[];\n};\n\nexport class CompileCmd implements Command {\n componentsStatus: ComponentsStatus[] = [];\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 = '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 ] as CommandOptions;\n\n constructor(private compile: WorkspaceCompiler, private logger: Logger, private pubsub: PubsubMain) {}\n\n async report([components = []]: [string[]], compilerOptions: CompileOptions) {\n const startTimestamp = process.hrtime();\n this.logger.setStatusLine('Compiling your components, hold tight.');\n this.pubsub.sub(CompilerAspect.id, this.onComponentCompilationDone.bind(this));\n\n let outputString = '';\n 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(this.componentsStatus, !!compilerOptions.verbose);\n outputString += '\\n';\n\n outputString += this.getStatusLine(this.componentsStatus, compileTimeLength);\n\n this.logger.clearStatusLine();\n\n return {\n data: outputString,\n code: this.getExitCode(this.componentsStatus),\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: ComponentsStatus[]): ComponentsStatus[] {\n return componentsStatus.filter((component) => component.errors.length);\n }\n\n private getSummaryIcon(componentsStatus: ComponentsStatus[]) {\n switch (this.failedComponents(componentsStatus).length) {\n case 0:\n return chalk.green('✔');\n case componentsStatus.length:\n return chalk.red('✗');\n default:\n return chalk.yellow('⍻');\n }\n }\n\n private getExitCode(componentsStatus: ComponentsStatus[]) {\n return this.failedComponents(componentsStatus).length ? 1 : 0;\n }\n\n private getStatusLine(componentsStatus: ComponentsStatus[], 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 private onComponentCompilationDone(event: BitBaseEvent<any>) {\n if (event.type === ComponentCompilationOnDoneEvent.TYPE) {\n this.componentsStatus.push(event.data);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,iBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,gBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2D,SAAAQ,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,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aAAaA,CAACF,gBAAoC,EAAEJ,iBAAiB,EAAE;IAC7E,MAAMqB,kBAAkB,GAAGjB,gBAAgB,CAACrC,MAAM;IAClD,MAAMuD,yBAAyB,GAAG,IAAI,CAACR,gBAAgB,CAACV,gBAAgB,CAAC,CAACrC,MAAM;IAChF,MAAMwD,4BAA4B,GAAGnB,gBAAgB,CAAC/C,MAAM,CAAE0D,SAAS,IAAK,CAACA,SAAS,CAACC,MAAM,CAACjD,MAAM,CAAC,CAACA,MAAM;IAE5G,MAAMyD,IAAI,GAAG,IAAI,CAACP,cAAc,CAACb,gBAAgB,CAAC;IAClD,MAAMqB,WAAW,GAAGH,yBAAyB,GACxC,GAAEE,IAAK,IAAGF,yBAA0B,IAAGD,kBAAmB,gCAA+B,GACzF,GAAEG,IAAK,IAAGD,4BAA6B,IAAGF,kBAAmB,oCAAmC;IAErG,OAAQ,GAAEI,WAAY,gBAAe,IAAAC,qBAAU,EAAC1B,iBAAiB,CAAE,GAAE;EACvE;EAEQP,0BAA0BA,CAACkC,KAAwB,EAAE;IAC3D,IAAIA,KAAK,CAACC,IAAI,KAAKC,yCAA+B,CAACC,IAAI,EAAE;MACvD,IAAI,CAAC1B,gBAAgB,CAAC3C,IAAI,CAACkE,KAAK,CAACrF,IAAI,CAAC;IACxC;EACF;AACF;AAACyF,OAAA,CAAAvD,UAAA,GAAAA,UAAA"}
|
|
1
|
+
{"version":3,"names":["CompileCmd","constructor","compile","logger","pubsub","name","description","report","components","compilerOptions","startTimestamp","process","hrtime","setStatusLine","sub","CompilerAspect","id","onComponentCompilationDone","bind","outputString","compileComponents","initiator","CompilationInitiator","CmdReport","compileTimeLength","chalk","underline","formatCompileResults","componentsStatus","verbose","getStatusLine","clearStatusLine","data","code","getExitCode","json","deleteDistDir","compileResults","CmdJson","failedComponents","filter","component","errors","length","getSummaryIcon","green","red","yellow","numberOfComponents","numberOfFailingComponents","numberOfSuccessfulComponents","icon","summaryLine","prettyTime","event","type","ComponentCompilationOnDoneEvent","TYPE","push"],"sources":["compiler.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport type { PubsubMain, BitBaseEvent } from '@teambit/pubsub';\nimport chalk from 'chalk';\nimport prettyTime from 'pretty-time';\nimport { Component } from '@teambit/component';\nimport { formatCompileResults } from './output-formatter';\nimport { CompileError, WorkspaceCompiler, CompileOptions } from './workspace-compiler';\nimport { CompilationInitiator } from './types';\n\n// IDs & events\nimport { CompilerAspect } from './compiler.aspect';\nimport { ComponentCompilationOnDoneEvent } from './events';\n\nexport type ComponentsStatus = {\n buildResults: string[];\n component: Component;\n errors: CompileError[];\n};\n\nexport class CompileCmd implements Command {\n componentsStatus: ComponentsStatus[] = [];\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 = '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 ] as CommandOptions;\n\n constructor(private compile: WorkspaceCompiler, private logger: Logger, private pubsub: PubsubMain) {}\n\n async report([components = []]: [string[]], compilerOptions: CompileOptions) {\n const startTimestamp = process.hrtime();\n this.logger.setStatusLine('Compiling your components, hold tight.');\n this.pubsub.sub(CompilerAspect.id, this.onComponentCompilationDone.bind(this));\n\n let outputString = '';\n 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(this.componentsStatus, !!compilerOptions.verbose);\n outputString += '\\n';\n\n outputString += this.getStatusLine(this.componentsStatus, compileTimeLength);\n\n this.logger.clearStatusLine();\n\n return {\n data: outputString,\n code: this.getExitCode(this.componentsStatus),\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: ComponentsStatus[]): ComponentsStatus[] {\n return componentsStatus.filter((component) => component.errors.length);\n }\n\n private getSummaryIcon(componentsStatus: ComponentsStatus[]) {\n switch (this.failedComponents(componentsStatus).length) {\n case 0:\n return chalk.green('✔');\n case componentsStatus.length:\n return chalk.red('✗');\n default:\n return chalk.yellow('⍻');\n }\n }\n\n private getExitCode(componentsStatus: ComponentsStatus[]) {\n return this.failedComponents(componentsStatus).length ? 1 : 0;\n }\n\n private getStatusLine(componentsStatus: ComponentsStatus[], 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 private onComponentCompilationDone(event: BitBaseEvent<any>) {\n if (event.type === ComponentCompilationOnDoneEvent.TYPE) {\n this.componentsStatus.push(event.data);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAG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,gBAAK,CAACqB,GAAG,CAAC,GAAG,CAAC;MACvB;QACE,OAAOrB,gBAAK,CAACsB,MAAM,CAAC,GAAG,CAAC;IAAC;EAE/B;EAEQb,WAAW,CAACN,gBAAoC,EAAE;IACxD,OAAO,IAAI,CAACW,gBAAgB,CAACX,gBAAgB,CAAC,CAACe,MAAM,GAAG,CAAC,GAAG,CAAC;EAC/D;EAEQb,aAAa,CAACF,gBAAoC,EAAEJ,iBAAiB,EAAE;IAC7E,MAAMwB,kBAAkB,GAAGpB,gBAAgB,CAACe,MAAM;IAClD,MAAMM,yBAAyB,GAAG,IAAI,CAACV,gBAAgB,CAACX,gBAAgB,CAAC,CAACe,MAAM;IAChF,MAAMO,4BAA4B,GAAGtB,gBAAgB,CAACY,MAAM,CAAEC,SAAS,IAAK,CAACA,SAAS,CAACC,MAAM,CAACC,MAAM,CAAC,CAACA,MAAM;IAE5G,MAAMQ,IAAI,GAAG,IAAI,CAACP,cAAc,CAAChB,gBAAgB,CAAC;IAClD,MAAMwB,WAAW,GAAGH,yBAAyB,GACxC,GAAEE,IAAK,IAAGF,yBAA0B,IAAGD,kBAAmB,gCAA+B,GACzF,GAAEG,IAAK,IAAGD,4BAA6B,IAAGF,kBAAmB,oCAAmC;IAErG,OAAQ,GAAEI,WAAY,gBAAe,IAAAC,qBAAU,EAAC7B,iBAAiB,CAAE,GAAE;EACvE;EAEQP,0BAA0B,CAACqC,KAAwB,EAAE;IAC3D,IAAIA,KAAK,CAACC,IAAI,KAAKC,yCAA+B,CAACC,IAAI,EAAE;MACvD,IAAI,CAAC7B,gBAAgB,CAAC8B,IAAI,CAACJ,KAAK,CAACtB,IAAI,CAAC;IACxC;EACF;AACF;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["compiler.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/compiler.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAG,CAAE;EAAC,GAAG,EAAC;AAAsD,EAAG,CAE3F;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["path","data","_interopRequireWildcard","require","_fsExtra","_interopRequireDefault","_aspectLoader","_builder","_cli","_componentIssues","_constants","_watcher","_envs","_dependencyResolver","_logger","_generator","_pubsub","_ui","_workspace","_compiler","_compiler2","_compiler3","_compiler4","_distArtifact","_exceptions","_types","_workspaceCompiler","_compiler5","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","CompilerMain","constructor","pubsub","workspaceCompiler","envs","builder","workspace","dependencyResolver","compilerService","getCompiler","context","compileOnWorkspace","componentsIds","options","initiator","CompilationInitiator","ComponentAdded","compileComponents","createTask","name","compiler","CompilerTask","CompilerAspect","id","getDistPathBySrcPath","component","srcPath","_environment$getCompi","environment","getEnv","env","compilerInstance","getRelativeDistFolder","_environment$getCompi2","getOrCalculateEnv","getDistDir","DEFAULT_DIST_DIRNAME","isDistDirExists","packageDir","getComponentPackagePath","distDir","pathToCheck","join","fs","existsSync","getDistsFiles","artifacts","getArtifactsVinylByAspect","length","DistArtifactNotFound","DistArtifact","addMissingDistsIssue","exist","state","issues","getOrCreate","IssuesClasses","MissingDists","undefined","provider","cli","loggerMain","aspectLoader","ui","generator","watcher","logger","createLogger","CompilerService","WorkspaceCompiler","registerService","compilerMain","register","CompileCmd","onComponentLoad","bind","registerComponentTemplate","compilerTemplate","exports","_defineProperty2","MainRuntime","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","PubsubAspect","AspectLoaderAspect","BuilderAspect","UIAspect","GeneratorAspect","DependencyResolverAspect","WatcherAspect","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 { Component, ComponentID } from '@teambit/component';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy/dist/constants';\nimport WatcherAspect, { WatcherMain } from '@teambit/watcher';\nimport { EnvsAspect, EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { BitId } from '@teambit/legacy-bit-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 } 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 {\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[] | BitId[] | ComponentID[] = [], // when empty, it compiles all\n options: CompileOptions = { initiator: CompilationInitiator.ComponentAdded }\n ) {\n return this.workspaceCompiler.compileComponents(componentsIds, options);\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 isDistDirExists(component: Component): boolean {\n const packageDir = 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(component: Component) {\n const exist = this.isDistDirExists(component);\n if (!exist) {\n component.state.issues.getOrCreate(IssuesClasses.MissingDists).data = true;\n }\n // we don't want to add any data to the compiler aspect, only to add issues on the component\n return undefined;\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 ];\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 ]: [\n CLIMain,\n Workspace,\n EnvsMain,\n LoggerMain,\n PubsubMain,\n AspectLoaderMain,\n BuilderMain,\n UiMain,\n GeneratorMain,\n DependencyResolverMain,\n WatcherMain\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 (workspace) {\n workspace.onComponentLoad(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;EA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AAC;IACDoD,GAAG,CAACY,QAAQ,CAAC,KAAIC,uBAAU,EAACtE,iBAAiB,EAAE+D,MAAM,EAAEhE,MAAM,CAAC,CAAC;IAC/D,IAAII,SAAS,EAAE;MACbA,SAAS,CAACoE,eAAe,CAACH,YAAY,CAACpB,oBAAoB,CAACwB,IAAI,CAACJ,YAAY,CAAC,CAAC;IACjF;IACA,IAAIP,SAAS,EAAEA,SAAS,CAACY,yBAAyB,CAAC,CAACC,6BAAgB,CAAC,CAAC;IAEtE,OAAON,YAAY;EACrB;AACF;AAACO,OAAA,CAAA9E,YAAA,GAAAA,YAAA;AAAA,IAAA+E,gBAAA,GAAA9F,OAAA,EAxJYe,YAAY,aAgFNgF,kBAAW;AAAA,IAAAD,gBAAA,GAAA9F,OAAA,EAhFjBe,YAAY,kBAkFD,CACpBiF,gBAAS,EACTC,4BAAe,EACfC,kBAAU,EACVC,sBAAY,EACZC,sBAAY,EACZC,uBAAkB,EAClBC,wBAAa,EACbC,aAAQ,EACRC,4BAAe,EACfC,8CAAwB,EACxBC,kBAAa,CACd;AA4DHrE,0BAAc,CAACsE,UAAU,CAAC5F,YAAY,CAAC;AAAC,IAAA6F,QAAA,GAEzB7F,YAAY;AAAA8E,OAAA,CAAA7F,OAAA,GAAA4G,QAAA"}
|
|
1
|
+
{"version":3,"names":["CompilerMain","constructor","pubsub","workspaceCompiler","envs","builder","workspace","dependencyResolver","compilerService","getCompiler","context","compileOnWorkspace","componentsIds","options","initiator","CompilationInitiator","ComponentAdded","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","path","join","fs","existsSync","getDistsFiles","artifacts","getArtifactsVinylByAspect","length","DistArtifactNotFound","DistArtifact","addMissingDistsIssue","exist","state","issues","getOrCreate","IssuesClasses","MissingDists","data","undefined","provider","cli","loggerMain","aspectLoader","ui","generator","watcher","logger","createLogger","CompilerService","WorkspaceCompiler","registerService","compilerMain","register","CompileCmd","onComponentLoad","bind","registerComponentTemplate","compilerTemplate","MainRuntime","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","PubsubAspect","AspectLoaderAspect","BuilderAspect","UIAspect","GeneratorAspect","DependencyResolverAspect","WatcherAspect","addRuntime"],"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 { Component, ComponentID } from '@teambit/component';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy/dist/constants';\nimport WatcherAspect, { WatcherMain } from '@teambit/watcher';\nimport { EnvsAspect, EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { BitId } from '@teambit/legacy-bit-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 } 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 {\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[] | BitId[] | ComponentID[] = [], // when empty, it compiles all\n options: CompileOptions = { initiator: CompilationInitiator.ComponentAdded }\n ) {\n return this.workspaceCompiler.compileComponents(componentsIds, options);\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 isDistDirExists(component: Component): boolean {\n const packageDir = 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(component: Component) {\n const exist = this.isDistDirExists(component);\n if (!exist) {\n component.state.issues.getOrCreate(IssuesClasses.MissingDists).data = true;\n }\n // we don't want to add any data to the compiler aspect, only to add issues on the component\n return undefined;\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 ];\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 ]: [\n CLIMain,\n Workspace,\n EnvsMain,\n LoggerMain,\n PubsubMain,\n AspectLoaderMain,\n BuilderMain,\n UiMain,\n GeneratorMain,\n DependencyResolverMain,\n WatcherMain\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 (workspace) {\n workspace.onComponentLoad(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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA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MAAM,EACN4D,YAAY,EACZC,EAAE,EACFG,MAAM,EACN3D,kBAAkB,EAClB0D,OAAO,CACR;IACD7D,IAAI,CAACkE,eAAe,CAAC9D,eAAe,CAAC;IACrC,MAAM+D,YAAY,GAAG,IAAIvE,YAAY,CACnCE,MAAM,EACNC,iBAAiB,EACjBC,IAAI,EACJC,OAAO,EACPC,SAAS,EACTC,kBAAkB,EAClBC,eAAe,CAChB;IACDoD,GAAG,CAACY,QAAQ,CAAC,KAAIC,uBAAU,EAACtE,iBAAiB,EAAE+D,MAAM,EAAEhE,MAAM,CAAC,CAAC;IAC/D,IAAII,SAAS,EAAE;MACbA,SAAS,CAACoE,eAAe,CAACH,YAAY,CAACrB,oBAAoB,CAACyB,IAAI,CAACJ,YAAY,CAAC,CAAC;IACjF;IACA,IAAIP,SAAS,EAAEA,SAAS,CAACY,yBAAyB,CAAC,CAACC,6BAAgB,CAAC,CAAC;IAEtE,OAAON,YAAY;EACrB;AACF;AAAC;AAAA,gCAxJYvE,YAAY,aAgFN8E,kBAAW;AAAA,gCAhFjB9E,YAAY,kBAkFD,CACpB+E,gBAAS,EACTC,4BAAe,EACfC,kBAAU,EACVC,sBAAY,EACZC,sBAAY,EACZC,uBAAkB,EAClBC,wBAAa,EACbC,aAAQ,EACRC,4BAAe,EACfC,8CAAwB,EACxBC,kBAAa,CACd;AA4DHnE,0BAAc,CAACoE,UAAU,CAAC1F,YAAY,CAAC;AAAC,eAEzBA,YAAY;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["CompilerService","getCompiler","context","compiler","env","render","descriptor","getDescriptor","id","displayName","version","config","highlight","language","ignoreIllegals","transform","undefined","icon","displayConfig"],"sources":["compiler.service.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, Newline } from 'ink';\nimport { EnvService, EnvDefinition, Env, EnvContext, ServiceTransformationMap, ExecutionContext } from '@teambit/envs';\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 {\n const compiler: Compiler = context.env.getCompiler();\n return compiler;\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n\n return (\n <Text key={descriptor?.id}>\n <Text color=\"cyan\">configured compiler: </Text>\n <Text>\n {descriptor?.id} ({descriptor?.displayName} @ {descriptor?.version})\n </Text>\n <Newline />\n <Text color=\"cyan\">compiler config:</Text>\n <Newline />\n <Text>\n {descriptor?.config && highlight(descriptor?.config, { language: 'javascript', ignoreIllegals: true })}\n </Text>\n <Newline />\n </Text>\n );\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":";;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAaO,MAAMA,eAAe,CAA+C;EAAA;IAAA,8CAClE,SAAS;EAAA;EAEhBC,WAAW,CAACC,OAAyB,EAAY;IAC/C,MAAMC,QAAkB,GAAGD,OAAO,CAACE,GAAG,CAACH,WAAW,EAAE;IACpD,OAAOE,QAAQ;EACjB;EAEAE,MAAM,CAACD,GAAkB,EAAE;IACzB,MAAME,UAAU,GAAG,I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AE;MACfS,IAAI,EAAEd,QAAQ,CAACc,IAAI;MACnBN,MAAM,EAAER,QAAQ,CAACe,aAAa,GAAGf,QAAQ,CAACe,aAAa,EAAE,GAAGF,SAAS;MACrEN,OAAO,EAAEP,QAAQ,CAACO,OAAO,GAAGP,QAAQ,CAACO,OAAO,EAAE,GAAG,GAAG;MACpDD,WAAW,EAAEN,QAAQ,CAACM,WAAW,GAAGN,QAAQ,CAACM,WAAW,GAAG;IAC7D,CAAC;EACH;AACF;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["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"],"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 private 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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAcA;AACA;AACA;AACO,MAAMA,YAAY,CAAsB;EAE7CC,WAAW,CACAC,QAAgB,EAChBC,IAAY,EACbC,gBAA0B,EAC1BC,kBAA0C,EAClD;IAAA,KAJSH,QAAgB,GAAhBA,QAAgB;IAAA,KAChBC,IAAY,GAAZA,IAAY;IAAA,KACbC,gBAA0B,GAA1BA,gBAA0B;IAAA,KAC1BC,kBAA0C,GAA1CA,kBAA0C;IAAA,qDAL7B,oBAAoB;IAOzC,IAAID,gBAAgB,CAACE,YAAY,EAAE;MACjC,IAAI,CAACC,WAAW,IAAK,iBAAgBH,gBAAgB,CAACE,YAAa,EAAC;IACtE;EACF;EAEA,MAAME,QAAQ,CAACC,OAAqB,EAAE;IACpC,MAAMC,OAAO,CAACC,GAAG,CACfF,OAAO,CAACG,cAAc,CAACC,eAAe,CAACC,GAAG,CAAEC,OAAO,IACjD,IAAI,CAACC,qBAAqB,CAACD,OAAO,EAAE,IAAI,CAACX,gBAAgB,CAAC,CAC3D,CACF;IACD,IAAI,CAAC,IAAI,CAACA,gBAAgB,CAACI,QAAQ,EAAE;IACrC,MAAM,IAAI,CAACJ,gBAAgB,CAACI,QAAQ,CAACC,OAAO,CAAC;EAC/C;EAEA,MAAMQ,OAAO,CAACR,OAAqB,EAA4B;IAC7D,MAAMS,YAAY,GAAG,MAAM,IAAI,CAACd,gBAAgB,CAACe,KAAK,CAACV,OAAO,CAAC;IAC/D,MAAM,IAAI,CAACW,i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,CAAC,MAAOyB,IAAI,IAAK;MAC7C,IAAIJ,QAAQ,CAACK,eAAe,CAACD,IAAI,CAACjB,IAAI,CAAC,EAAE;MACzC,MAAMmB,OAAO,GAAGF,IAAI,CAACG,QAAQ;MAC7B,MAAMC,kBAAE,CAACC,UAAU,CAACtB,eAAI,CAACU,IAAI,CAACjB,OAAO,CAACO,IAAI,EAAEa,QAAQ,CAACU,OAAO,EAAEN,IAAI,CAAChB,QAAQ,CAAC,EAAEkB,OAAO,CAAC;IACxF,CAAC,CAAC,CACH;EACH;EAEA,OAAOK,IAAI,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;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["DistArtifact","constructor","artifacts","getFile","path","find","file","pathNormalizeToLinux","relative"],"sources":["dist-artifact.ts"],"sourcesContent":["import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,YAAY,CAAC;EACxBC,WAAW,CAASC,SAA0B,EAAE;IAAA,KAA5BA,SAA0B,GAA1BA,SAA0B;EAAG;EAEjDC,OAAO,CAACC,IAAY,EAAE;IACpB,OAAO,IAAI,CAACF,SAAS,CAACG,IAAI,CAAEC,IAAI,IAAK;MACnC,OAAO,IAAAC,6BAAoB,EAACD,IAAI,CAACE,QAAQ,CAAC,KAAKJ,IAAI;IACrD,CAAC,CAAC;EACJ;AACF;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["CompilerErrorEventData","constructor","error","CompilerErrorEvent","BitBaseEvent","timestamp","Date","now","TYPE"],"sources":["compiler-error.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { BitBaseEvent } from '@teambit/pubsub';\n\nclass CompilerErrorEventData {\n constructor(readonly error: any) {}\n}\n\nexport class CompilerErrorEvent extends BitBaseEvent<CompilerErrorEventData> {\n static readonly TYPE = 'compiler-error';\n\n constructor(readonly error, readonly timestamp = Date.now()) {\n super(CompilerErrorEvent.TYPE, '0.0.1', timestamp, new CompilerErrorEventData(error));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AADA;;AAGA,MAAMA,sBAAsB,CAAC;EAC3BC,WAAW,CAAUC,KAAU,EAAE;IAAA,KAAZA,KAAU,GAAVA,KAAU;EAAG;AACpC;AAEO,MAAMC,kBAAkB,SAASC,sBAAY,CAAyB;EAG3EH,WAAW,CAAUC,KAAK,EAAWG,SAAS,GAAGC,IAAI,CAACC,GAAG,EAAE,EAAE;IAC3D,KAAK,CAACJ,kBAAkB,CAACK,IAAI,EAAE,OAAO,EAAEH,SAAS,EAAE,IAAIL,sBAAsB,CAACE,KAAK,CAAC,CAAC;IAAC,KADnEA,KAAK,GAALA,KAAK;IAAA,KAAWG,SAAS,GAATA,SAAS;EAE9C;AACF;AAAC;AAAA,gCANYF,kBAAkB,UACN,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["ComponentCompilationOnDoneEventData","constructor","errors","component","buildResults","ComponentCompilationOnDoneEvent","BitBaseEvent","timestamp","Date","now","TYPE"],"sources":["component-compilation-on-done.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { BitBaseEvent } from '@teambit/pubsub';\nimport { Component } from '@teambit/component';\nimport { CompileError } from '../workspace-compiler';\n\nclass ComponentCompilationOnDoneEventData {\n constructor(readonly errors: Array<CompileError>, readonly component: Component, readonly buildResults: string[]) {}\n}\n\nexport class ComponentCompilationOnDoneEvent extends BitBaseEvent<ComponentCompilationOnDoneEventData> {\n static readonly TYPE = 'component-compilation-on-done';\n\n constructor(\n readonly errors: Array<CompileError>,\n readonly component: Component,\n readonly buildResults: string[],\n readonly timestamp = Date.now()\n ) {\n super(\n ComponentCompilationOnDoneEvent.TYPE,\n '0.0.1',\n timestamp,\n new ComponentCompilationOnDoneEventData(errors, component, buildResults)\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AADA;;AAKA,MAAMA,mCAAmC,CAAC;EACxCC,WAAW,CAAUC,MAA2B,EAAWC,SAAoB,EAAWC,YAAsB,EAAE;IAAA,KAA7FF,MAA2B,GAA3BA,MAA2B;IAAA,KAAWC,SAAoB,GAApBA,SAAoB;IAAA,KAAWC,YAAsB,GAAtBA,YAAsB;EAAG;AACrH;AAEO,MAAMC,+BAA+B,SAASC,sBAAY,CAAsC;EAGrGL,WAAW,CACAC,MAA2B,EAC3BC,SAAoB,EACpBC,YAAsB,EACtBG,SAAS,GAAGC,IAAI,CAACC,GAAG,EAAE,EAC/B;IACA,KAAK,CACHJ,+BAA+B,CAACK,IAAI,EACpC,OAAO,EACPH,SAAS,EACT,IAAIP,mCAAmC,CAACE,MAAM,EAAEC,SAAS,EAAEC,YAAY,CAAC,CACzE;IAAC,KAVOF,MAA2B,GAA3BA,MAA2B;IAAA,KAC3BC,SAAoB,GAApBA,SAAoB;IAAA,KACpBC,YAAsB,GAAtBA,YAAsB;IAAA,KACtBG,SAAS,GAATA,SAAS;EAQpB;AACF;AAAC;AAAA,gCAhBYF,+BAA+B,UACnB,+BAA+B"}
|
package/dist/events/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './compiler-error';\nexport * from './component-compilation-on-done';\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["DistArtifactNotFound","BitError","constructor","componentId","toString"],"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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,oBAAoB,SAASC,oBAAQ,CAAC;EACjDC,WAAW,CAAUC,WAAwB,EAAE;IAC7C,KAAK,CAAE,+BAA8BA,WAAW,CAACC,QAAQ,EAAG,gBAAe,CAAC;IAAC,KAD1DD,WAAwB,GAAxBA,WAAwB;EAE7C;AACF;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { DistArtifactNotFound } from './dist-artifact-not-found';\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export type { CompilerMain } from './compiler.main.runtime';\nexport { CompilerTask, CompilerTaskOptions } from './compiler.task';\nexport type { CompilerEnv } from './compiler-env-type';\nexport { CompilerAspect } from './compiler.aspect';\nexport {\n Compiler,\n CompilerOptions,\n CompilationInitiator,\n TranspileFileOutput,\n TranspileFileParams,\n TranspileComponentParams,\n TranspileFileOutputOneFile,\n} from './types';\nexport * from './events';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AASA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["formatCompileResults","compileResults","verbose","map","componentResult","componentId","component","id","fullName","files","buildResults","status","errors","length","icon","chalk","red","green","reduce","outputString","result","fileList","file"],"sources":["output-formatter.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { ComponentsStatus } from './compiler.cmd';\n\nexport const formatCompileResults = (compileResults: ComponentsStatus[], verbose: boolean) =>\n compileResults\n .map((componentResult: ComponentsStatus) => ({\n componentId: componentResult.component.id.fullName,\n files: componentResult.buildResults,\n status: componentResult.errors.length ? 'FAILURE' : 'SUCCESS',\n icon: componentResult.errors.length ? chalk.red('✗') : chalk.green('✔'),\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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,oBAAoB,GAAG,CAACC,cAAkC,EAAEC,OAAgB,KACvFD,cAAc,CACXE,GAAG,CAAEC,eAAiC,KAAM;EAC3CC,WAAW,EAAED,eAAe,CAACE,SAAS,CAACC,EAAE,CAACC,QAAQ;EAClDC,KAAK,EAAEL,eAAe,CAACM,YAAY;EACnCC,MAAM,EAAEP,eAAe,CAACQ,MAAM,CAACC,MAAM,GAAG,SAAS,GAAG,SAAS;EAC7DC,IAAI,EAAEV,eAAe,CAACQ,MAAM,CAACC,MAAM,GAAGE,gBAAK,CAACC,GAAG,CAAC,GAAG,CAAC,GAAGD,gBAAK,CAACE,KAAK,CAAC,GAAG;AACxE,CAAC,CAAC,CAAC,CACFC,MAAM,CAAC,CAACC,YAAY,EAAEC,MAAM,KAAK;EAChCD,YAAY,IAAK,GAAEC,MAAM,CAACN,IAAK,IAAGM,MAAM,CAACT,MAAO,KAAIS,MAAM,CAACf,WAAY,EAAC;EACxE,IAAIH,OAAO,EAAE;IAAA;IACXiB,YAAY,IAAI,GAAG;IACnBA,YAAY,IAAIC,MAAM,aAANA,MAAM,wCAANA,MAAM,CAAEX,KAAK,kDAAb,cAAeS,MAAM,CAAC,CAACG,QAAQ,EAAEC,IAAI,KAAM,GAAED,QAAS,UAASC,IAAK,IAAG,EAAE,IAAI,CAAC;EAChG;EACAH,YAAY,IAAI,IAAI;EACpB,OAAOA,YAAY;AACrB,CAAC,EAAE,EAAE,CAAC;AAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@0.0.1112/dist/compiler.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@0.0.1112/dist/compiler.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -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,
|
|
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,UAAU,CAAC;EAAEC,cAAc;EAAEC;AAA8B,CAAC,EAAE;EAC5E,OAAQ;AACV;AACA,eAAeD,cAAe;AAC9B,SAASC,WAAY;AACrB;AACA,GAAG;AACH"}
|
|
@@ -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,
|
|
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,YAAY,CAAC;EAAEC;AAAiC,CAAC,EAAE;EACjE,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,cAAe;AAC9B;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,cAAe;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH"}
|
|
@@ -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,
|
|
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,SAAS,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAQ,YAAWD,cAAe,oBAAmBC,IAAK;AAC5D;AACA,gBAAgBD,cAAe,kBAAiBC,IAAK;AACrD,iBAAiBD,cAAe;AAChC,WAAWA,cAAe;AAC1B,CAAC;AACD"}
|
|
@@ -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,
|
|
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,eAAe,CAAC;EAAEC,IAAI;EAAEC;AAAiC,CAAC,EAAE;EAC1E,OAAQ;AACV;AACA,WAAWA,cAAe,cAAaD,IAAK;AAC5C,WAAWC,cAAe,oBAAmBD,IAAK;AAClD;AACA,eAAeC,cAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsBA,cAAe;AACrC,iBAAiBA,cAAe,IAAGA,cAAe;AAClD;AACA;AACA;AACA,iBAAiBA,cAAe;AAChC;AACA;AACA;AACA,EAAEA,cAAe,qBAAoBA,cAAe;AACpD,CAAC;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["compilerTemplate","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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,gBAAmC,GAAG;EACjDC,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,EAAG,GAAED,OAAO,CAACJ,IAAK,YAAW;MACzCM,OAAO,EAAE,IAAAG,wBAAU,EAACL,OAAO;IAC7B,CAAC,EACD;MACEC,YAAY,EAAG,GAAED,OAAO,CAACJ,IAAK,cAAa;MAC3CM,OAAO,EAAE,IAAAI,4BAAY,EAACN,OAAO;IAC/B,CAAC,EACD;MACEC,YAAY,EAAG,GAAED,OAAO,CAACJ,IAAK,kBAAiB;MAC/CM,OAAO,EAAE,IAAAK,kCAAe,EAACP,OAAO;IAClC,CAAC,CACF;EACH;AACF,CAAC;AAAC"}
|
package/dist/types.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CompilationInitiator = void 0;
|
|
7
|
-
let CompilationInitiator
|
|
7
|
+
let CompilationInitiator;
|
|
8
|
+
exports.CompilationInitiator = CompilationInitiator;
|
|
9
|
+
(function (CompilationInitiator) {
|
|
8
10
|
CompilationInitiator[CompilationInitiator["CmdReport"] = 0] = "CmdReport";
|
|
9
11
|
CompilationInitiator[CompilationInitiator["CmdJson"] = 1] = "CmdJson";
|
|
10
12
|
CompilationInitiator[CompilationInitiator["PreStart"] = 2] = "PreStart";
|
|
@@ -14,8 +16,6 @@ let CompilationInitiator = /*#__PURE__*/function (CompilationInitiator) {
|
|
|
14
16
|
CompilationInitiator[CompilationInitiator["AspectLoadFail"] = 6] = "AspectLoadFail";
|
|
15
17
|
CompilationInitiator[CompilationInitiator["ComponentAdded"] = 7] = "ComponentAdded";
|
|
16
18
|
CompilationInitiator[CompilationInitiator["Install"] = 8] = "Install";
|
|
17
|
-
|
|
18
|
-
}({});
|
|
19
|
-
exports.CompilationInitiator = CompilationInitiator;
|
|
19
|
+
})(CompilationInitiator || (exports.CompilationInitiator = CompilationInitiator = {}));
|
|
20
20
|
|
|
21
21
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CompilationInitiator"
|
|
1
|
+
{"version":3,"names":["CompilationInitiator"],"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 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 /**\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 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;AAAA;AAAA,WAApBA,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;AAAA,GAApBA,oBAAoB,oCAApBA,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_workspace","_path","_loader","_constants","_sources","_dataToPersist","_workspaceModules","_componentIdToPackageName","_removePath","_bitRoots","_lodash","_compiler","_events","_types","ComponentCompiler","constructor","pubsub","workspace","component","compilerInstance","compilerId","logger","dependencyResolver","dists","compileErrors","compile","noThrow","options","_options$deleteDistDi","dataToPersist","deleteDistDir","DataToPersist","distDir","distDirs","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","loader","succeed","pub","CompilerAspect","id","ComponentCompilationOnDoneEvent","length","forEach","errorItem","error","formatError","err","join","CompilerErrorEvent","console","message","_this$compilerInstanc","_this$compilerInstanc2","packageName","componentIdToPackageName","packageDir","distDirName","getDistDir","call","DEFAULT_DIST_DIRNAME","injectedDirs","getInjectedDirs","dist","relativeCompDir","componentDir","undefined","relative","rootDirs","readBitRootsDir","rootDir","filePath","isFileSupported","compileResults","_this$compilerInstanc3","_this$compilerInstanc4","contents","push","base","result","Dist","outputPath","Buffer","from","outputText","shouldCopyNonSupportedFiles","filesToCompile","_this$compilerInstanc5","_this$compilerInstanc6","outputDir","getComponentPackagePath","exports","WorkspaceCompiler","envs","aspectLoader","ui","watcher","registerOnComponentChange","onComponentChange","bind","registerOnComponentAdd","registerOnPreWatch","onPreWatch","registerPreStart","onPreStart","registerOnAspectLoadErrorSlot","onAspectLoadFail","preStartOpts","skipCompilation","compileComponents","changed","verbose","CompilationInitiator","PreStart","watchScopeInternalFiles","code","AspectLoadFail","removedFiles","Boolean","removeLinksFromNodeModules","ComponentChanged","linkToNodeModulesByComponents","results","_buildResults$","_buildResults$$buildR","components","watchOpts","preCompile","start","Date","now","_legacy","PreWatch","end","consoleSuccess","componentsIds","OutsideWorkspaceError","componentIds","getIdsToCompile","getMany","grouped","groupByIsEnv","envsResults","runCompileComponents","otherResults","other","componentsCompilers","_environment$getCompi","environment","getEnv","env","getCompiler","compilerName","name","warn","resultOnWorkspace","mapSeries","componentCompiler","envsIds","uniq","getEnvId","filter","envId","isCoreEnv","groupBy","includes","resolveMultipleComponentIds","filterIds","getNewAndModifiedIds","getAllComponentIds"],"sources":["workspace-compiler.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport mapSeries from 'p-map-series';\nimport { Component, ComponentID } from '@teambit/component';\nimport { EnvsMain } from '@teambit/envs';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { SerializableResults, Workspace, OutsideWorkspaceError } from '@teambit/workspace';\nimport { WatcherMain, WatchOptions } from '@teambit/watcher';\nimport path from 'path';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { Logger } from '@teambit/logger';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy/dist/constants';\nimport { AbstractVinyl, Dist } from '@teambit/legacy/dist/consumer/component/sources';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport {\n linkToNodeModulesByComponents,\n removeLinksFromNodeModules,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport { UiMain } from '@teambit/ui';\nimport { readBitRootsDir } from '@teambit/bit-roots';\nimport { groupBy, uniq } from 'lodash';\nimport type { PreStartOpts } from '@teambit/ui';\nimport { PathOsBasedAbsolute, PathOsBasedRelative } from '@teambit/legacy/dist/utils/path';\nimport { MultiCompiler } from '@teambit/multi-compiler';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompilerErrorEvent, ComponentCompilationOnDoneEvent } from './events';\nimport { Compiler, CompilationInitiator } from './types';\n\nexport type BuildResult = { component: string; buildResults: string[] | null | undefined };\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};\n\nexport type CompileError = { path: string; error: Error };\n\nexport class ComponentCompiler {\n constructor(\n private pubsub: PubsubMain,\n private workspace: Workspace,\n private component: Component,\n private compilerInstance: Compiler,\n private compilerId: string,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\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 // 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 await this.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) => this.compileOneFile(file, options.initiator))\n );\n }\n\n if (canTranspileComponent) {\n await this.compileAllFiles(this.component, options.initiator);\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) loader.succeed();\n this.pubsub.pub(\n CompilerAspect.id,\n new ComponentCompilationOnDoneEvent(this.compileErrors, this.component, buildResults)\n );\n return { component: this.component.id.toString(), buildResults };\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 relativeCompDir = this.workspace.componentDir(this.component.id, undefined, {\n relative: true,\n });\n const injectedDirs = await this.dependencyResolver.getInjectedDirs(\n this.workspace.path,\n relativeCompDir,\n packageName\n );\n if (injectedDirs.length > 0) return injectedDirs;\n\n const rootDirs = await readBitRootsDir(this.workspace.path);\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 private async compileOneFile(file: AbstractVinyl, initiator: CompilationInitiator): 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 await this.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(component: Component, initiator: CompilationInitiator): Promise<void> {\n const filesToCompile: AbstractVinyl[] = [];\n for (const base of await this.distDirs()) {\n 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,\n componentDir: this.componentDir,\n outputDir: this.workspace.getComponentPackagePath(component),\n initiator,\n });\n } catch (error: any) {\n this.compileErrors.push({ path: this.componentDir, error });\n }\n }\n }\n}\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.onComponentChange.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 }, id: ComponentID): Promise<boolean> {\n if (err.code && err.code === 'MODULE_NOT_FOUND' && this.workspace) {\n await this.compileComponents([id.toString()], { initiator: CompilationInitiator.AspectLoadFail }, true);\n return true;\n }\n return false;\n }\n\n async onComponentChange(\n component: Component,\n files: string[],\n removedFiles?: string[],\n initiator?: CompilationInitiator\n ): Promise<SerializableResults> {\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 { initiator: initiator || CompilationInitiator.ComponentChanged, deleteDistDir },\n true\n );\n await linkToNodeModulesByComponents([component], this.workspace);\n return {\n results: buildResults,\n toString() {\n return `${buildResults[0]?.buildResults?.join('\\n\\t')}`;\n },\n };\n }\n\n async onPreWatch(components: Component[], watchOpts: WatchOptions) {\n if (watchOpts.preCompile) {\n const start = Date.now();\n this.logger.console(`compiling ${components.length} components`);\n await this.compileComponents(\n components.map((c) => c.id._legacy),\n { initiator: CompilationInitiator.PreWatch }\n );\n const end = Date.now() - start;\n this.logger.consoleSuccess(`compiled ${components.length} components successfully (${end / 1000} sec)`);\n }\n }\n\n async compileComponents(\n componentsIds: string[] | BitId[] | ComponentID[], // when empty, it compiles new+modified (unless options.all is set),\n options: CompileOptions,\n noThrow?: boolean\n ): Promise<BuildResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const componentIds = await this.getIdsToCompile(componentsIds, options.changed);\n const components = await this.workspace.getMany(componentIds);\n\n const grouped = this.groupByIsEnv(components);\n const envsResults = grouped.envs ? await this.runCompileComponents(grouped.envs, options, noThrow) : [];\n const otherResults = grouped.other ? await this.runCompileComponents(grouped.other, options, noThrow) : [];\n return [...envsResults, ...otherResults];\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 environment = this.envs.getEnv(c).env;\n const compilerInstance = environment.getCompiler?.();\n\n if (compilerInstance) {\n const compilerName = compilerInstance.constructor.name || 'compiler';\n componentsCompilers.push(\n new ComponentCompiler(\n this.pubsub,\n this.workspace,\n c,\n compilerInstance,\n compilerName,\n this.logger,\n this.dependencyResolver\n )\n );\n } else {\n this.logger.warn(`unable to find a compiler instance for ${c.id.toString()}`);\n }\n });\n const resultOnWorkspace = await mapSeries(componentsCompilers, (componentCompiler) =>\n componentCompiler.compile(noThrow, options)\n );\n\n return resultOnWorkspace;\n }\n\n /**\n * This function get's a list of aspect ids and return them grouped by whether any of them is the env of other from the list\n * @param ids\n */\n groupByIsEnv(components: Component[]): { envs?: Component[]; other?: Component[] } {\n const envsIds = uniq(\n components\n .map((component) => this.envs.getEnvId(component))\n .filter((envId) => !this.aspectLoader.isCoreEnv(envId))\n );\n const grouped = groupBy(components, (component) => {\n if (envsIds.includes(component.id.toString())) return 'envs';\n return 'other';\n });\n return grouped as { envs: Component[]; other: Component[] };\n }\n\n private async getIdsToCompile(\n componentsIds: Array<string | ComponentID | BitId>,\n changed = false\n ): 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.getAllComponentIds();\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;AAIA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,eAAA;EAAA,MAAAR,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAM,c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,GAAG,KAAK,EACS;IACxB,IAAIyB,aAAa,CAAC7F,MAAM,EAAE;MACxB,MAAM+F,YAAY,GAAG,MAAM,IAAI,CAACpJ,SAAS,CAACiL,2BAA2B,CAAC/B,aAAa,CAAC;MACpF,OAAO,IAAI,CAAClJ,SAAS,CAACkL,SAAS,CAAC9B,YAAY,CAAC;IAC/C;IACA,IAAI3B,OAAO,EAAE;MACX,OAAO,IAAI,CAACzH,SAAS,CAACmL,oBAAoB,CAAC,CAAC;IAC9C;IACA,OAAO,IAAI,CAACnL,SAAS,CAACoL,kBAAkB,CAAC,CAAC;EAC5C;AACF;AAAC9E,OAAA,CAAAC,iBAAA,GAAAA,iBAAA"}
|
|
1
|
+
{"version":3,"names":["ComponentCompiler","constructor","pubsub","workspace","component","compilerInstance","compilerId","logger","dependencyResolver","dists","compileErrors","compile","noThrow","options","dataToPersist","deleteDistDir","DataToPersist","distDir","distDirs","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","loader","succeed","pub","CompilerAspect","id","ComponentCompilationOnDoneEvent","length","forEach","errorItem","error","formatError","err","join","CompilerErrorEvent","console","message","packageName","componentIdToPackageName","packageDir","distDirName","getDistDir","DEFAULT_DIST_DIRNAME","injectedDirs","getInjectedDirs","dist","relativeCompDir","componentDir","undefined","relative","rootDirs","readBitRootsDir","rootDir","filePath","isFileSupported","compileResults","contents","push","base","result","Dist","outputPath","Buffer","from","outputText","shouldCopyNonSupportedFiles","filesToCompile","outputDir","getComponentPackagePath","WorkspaceCompiler","envs","aspectLoader","ui","watcher","registerOnComponentChange","onComponentChange","bind","registerOnComponentAdd","registerOnPreWatch","onPreWatch","registerPreStart","onPreStart","registerOnAspectLoadErrorSlot","onAspectLoadFail","preStartOpts","skipCompilation","compileComponents","changed","verbose","CompilationInitiator","PreStart","watchScopeInternalFiles","code","AspectLoadFail","removedFiles","Boolean","removeLinksFromNodeModules","ComponentChanged","linkToNodeModulesByComponents","results","components","watchOpts","preCompile","start","Date","now","_legacy","PreWatch","end","consoleSuccess","componentsIds","OutsideWorkspaceError","componentIds","getIdsToCompile","getMany","grouped","groupByIsEnv","envsResults","runCompileComponents","otherResults","other","componentsCompilers","environment","getEnv","env","getCompiler","compilerName","name","warn","resultOnWorkspace","mapSeries","componentCompiler","envsIds","uniq","getEnvId","filter","envId","isCoreEnv","groupBy","includes","resolveMultipleComponentIds","filterIds","getNewAndModifiedIds","getAllComponentIds"],"sources":["workspace-compiler.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport mapSeries from 'p-map-series';\nimport { Component, ComponentID } from '@teambit/component';\nimport { EnvsMain } from '@teambit/envs';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { SerializableResults, Workspace, OutsideWorkspaceError } from '@teambit/workspace';\nimport { WatcherMain, WatchOptions } from '@teambit/watcher';\nimport path from 'path';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { Logger } from '@teambit/logger';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy/dist/constants';\nimport { AbstractVinyl, Dist } from '@teambit/legacy/dist/consumer/component/sources';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport {\n linkToNodeModulesByComponents,\n removeLinksFromNodeModules,\n} from '@teambit/workspace.modules.node-modules-linker';\nimport { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport componentIdToPackageName from '@teambit/legacy/dist/utils/bit/component-id-to-package-name';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport { UiMain } from '@teambit/ui';\nimport { readBitRootsDir } from '@teambit/bit-roots';\nimport { groupBy, uniq } from 'lodash';\nimport type { PreStartOpts } from '@teambit/ui';\nimport { PathOsBasedAbsolute, PathOsBasedRelative } from '@teambit/legacy/dist/utils/path';\nimport { MultiCompiler } from '@teambit/multi-compiler';\nimport { CompilerAspect } from './compiler.aspect';\nimport { CompilerErrorEvent, ComponentCompilationOnDoneEvent } from './events';\nimport { Compiler, CompilationInitiator } from './types';\n\nexport type BuildResult = { component: string; buildResults: string[] | null | undefined };\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};\n\nexport type CompileError = { path: string; error: Error };\n\nexport class ComponentCompiler {\n constructor(\n private pubsub: PubsubMain,\n private workspace: Workspace,\n private component: Component,\n private compilerInstance: Compiler,\n private compilerId: string,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\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 // 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 await this.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) => this.compileOneFile(file, options.initiator))\n );\n }\n\n if (canTranspileComponent) {\n await this.compileAllFiles(this.component, options.initiator);\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) loader.succeed();\n this.pubsub.pub(\n CompilerAspect.id,\n new ComponentCompilationOnDoneEvent(this.compileErrors, this.component, buildResults)\n );\n return { component: this.component.id.toString(), buildResults };\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 relativeCompDir = this.workspace.componentDir(this.component.id, undefined, {\n relative: true,\n });\n const injectedDirs = await this.dependencyResolver.getInjectedDirs(\n this.workspace.path,\n relativeCompDir,\n packageName\n );\n if (injectedDirs.length > 0) return injectedDirs;\n\n const rootDirs = await readBitRootsDir(this.workspace.path);\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 private async compileOneFile(file: AbstractVinyl, initiator: CompilationInitiator): 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 await this.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(component: Component, initiator: CompilationInitiator): Promise<void> {\n const filesToCompile: AbstractVinyl[] = [];\n for (const base of await this.distDirs()) {\n 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,\n componentDir: this.componentDir,\n outputDir: this.workspace.getComponentPackagePath(component),\n initiator,\n });\n } catch (error: any) {\n this.compileErrors.push({ path: this.componentDir, error });\n }\n }\n }\n}\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.onComponentChange.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 }, id: ComponentID): Promise<boolean> {\n if (err.code && err.code === 'MODULE_NOT_FOUND' && this.workspace) {\n await this.compileComponents([id.toString()], { initiator: CompilationInitiator.AspectLoadFail }, true);\n return true;\n }\n return false;\n }\n\n async onComponentChange(\n component: Component,\n files: string[],\n removedFiles?: string[],\n initiator?: CompilationInitiator\n ): Promise<SerializableResults> {\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 { initiator: initiator || CompilationInitiator.ComponentChanged, deleteDistDir },\n true\n );\n await linkToNodeModulesByComponents([component], this.workspace);\n return {\n results: buildResults,\n toString() {\n return `${buildResults[0]?.buildResults?.join('\\n\\t')}`;\n },\n };\n }\n\n async onPreWatch(components: Component[], watchOpts: WatchOptions) {\n if (watchOpts.preCompile) {\n const start = Date.now();\n this.logger.console(`compiling ${components.length} components`);\n await this.compileComponents(\n components.map((c) => c.id._legacy),\n { initiator: CompilationInitiator.PreWatch }\n );\n const end = Date.now() - start;\n this.logger.consoleSuccess(`compiled ${components.length} components successfully (${end / 1000} sec)`);\n }\n }\n\n async compileComponents(\n componentsIds: string[] | BitId[] | ComponentID[], // when empty, it compiles new+modified (unless options.all is set),\n options: CompileOptions,\n noThrow?: boolean\n ): Promise<BuildResult[]> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const componentIds = await this.getIdsToCompile(componentsIds, options.changed);\n const components = await this.workspace.getMany(componentIds);\n\n const grouped = this.groupByIsEnv(components);\n const envsResults = grouped.envs ? await this.runCompileComponents(grouped.envs, options, noThrow) : [];\n const otherResults = grouped.other ? await this.runCompileComponents(grouped.other, options, noThrow) : [];\n return [...envsResults, ...otherResults];\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 environment = this.envs.getEnv(c).env;\n const compilerInstance = environment.getCompiler?.();\n\n if (compilerInstance) {\n const compilerName = compilerInstance.constructor.name || 'compiler';\n componentsCompilers.push(\n new ComponentCompiler(\n this.pubsub,\n this.workspace,\n c,\n compilerInstance,\n compilerName,\n this.logger,\n this.dependencyResolver\n )\n );\n } else {\n this.logger.warn(`unable to find a compiler instance for ${c.id.toString()}`);\n }\n });\n const resultOnWorkspace = await mapSeries(componentsCompilers, (componentCompiler) =>\n componentCompiler.compile(noThrow, options)\n );\n\n return resultOnWorkspace;\n }\n\n /**\n * This function get's a list of aspect ids and return them grouped by whether any of them is the env of other from the list\n * @param ids\n */\n groupByIsEnv(components: Component[]): { envs?: Component[]; other?: Component[] } {\n const envsIds = uniq(\n components\n .map((component) => this.envs.getEnvId(component))\n .filter((envId) => !this.aspectLoader.isCoreEnv(envId))\n );\n const grouped = groupBy(components, (component) => {\n if (envsIds.includes(component.id.toString())) return 'envs';\n return 'other';\n });\n return grouped as { envs: Component[]; other: Component[] };\n }\n\n private async getIdsToCompile(\n componentsIds: Array<string | ComponentID | BitId>,\n changed = false\n ): 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.getAllComponentIds();\n }\n}\n"],"mappings":";;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AA9BA;;AAgDO,MAAMA,iBAAiB,CAAC;EAC7BC,WAAW,CACDC,MAAkB,EAClBC,SAAoB,EACpBC,SAAoB,EACpBC,gBAA0B,EAC1BC,UAAkB,EAClBC,MAAc,EACdC,kBAA0C,EAC1CC,KAAa,GAAG,EAAE,EAClBC,aAA6B,GAAG,EAAE,EAC1C;IAAA,KATQR,MAAkB,GAAlBA,MAAkB;IAAA,KAClBC,SAAoB,GAApBA,SAAoB;IAAA,KACpBC,SAAoB,GAApBA,SAAoB;IAAA,KACpBC,gBA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AO,GAAG,IAAAuB,iBAAO,EAACtC,UAAU,EAAG5H,SAAS,IAAK;MACjD,IAAI4J,OAAO,CAACO,QAAQ,CAACnK,SAAS,CAACiD,EAAE,CAACZ,QAAQ,EAAE,CAAC,EAAE,OAAO,MAAM;MAC5D,OAAO,OAAO;IAChB,CAAC,CAAC;IACF,OAAOsG,OAAO;EAChB;EAEA,MAAcF,eAAe,CAC3BH,aAAkD,EAClDvB,OAAO,GAAG,KAAK,EACS;IACxB,IAAIuB,aAAa,CAACnF,MAAM,EAAE;MACxB,MAAMqF,YAAY,GAAG,MAAM,IAAI,CAACzI,SAAS,CAACqK,2BAA2B,CAAC9B,aAAa,CAAC;MACpF,OAAO,IAAI,CAACvI,SAAS,CAACsK,SAAS,CAAC7B,YAAY,CAAC;IAC/C;IACA,IAAIzB,OAAO,EAAE;MACX,OAAO,IAAI,CAAChH,SAAS,CAACuK,oBAAoB,EAAE;IAC9C;IACA,OAAO,IAAI,CAACvK,SAAS,CAACwK,kBAAkB,EAAE;EAC5C;AACF;AAAC"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/compiler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1112",
|
|
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": "0.0.
|
|
9
|
+
"version": "0.0.1112"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -20,24 +20,24 @@
|
|
|
20
20
|
"@babel/runtime": "7.20.0",
|
|
21
21
|
"@teambit/harmony": "0.4.6",
|
|
22
22
|
"@teambit/legacy-bit-id": "0.0.423",
|
|
23
|
-
"@teambit/envs": "0.0.
|
|
24
|
-
"@teambit/cli": "0.0.
|
|
25
|
-
"@teambit/component": "0.0.
|
|
26
|
-
"@teambit/logger": "0.0.
|
|
27
|
-
"@teambit/pubsub": "0.0.
|
|
28
|
-
"@teambit/aspect-loader": "0.0.
|
|
29
|
-
"@teambit/builder": "0.0.
|
|
30
|
-
"@teambit/component-issues": "0.0.
|
|
31
|
-
"@teambit/dependency-resolver": "0.0.
|
|
32
|
-
"@teambit/generator": "0.0.
|
|
33
|
-
"@teambit/ui": "0.0.
|
|
34
|
-
"@teambit/watcher": "0.0.
|
|
35
|
-
"@teambit/workspace": "0.0.
|
|
36
|
-
"@teambit/isolator": "0.0.
|
|
23
|
+
"@teambit/envs": "0.0.1112",
|
|
24
|
+
"@teambit/cli": "0.0.744",
|
|
25
|
+
"@teambit/component": "0.0.1112",
|
|
26
|
+
"@teambit/logger": "0.0.837",
|
|
27
|
+
"@teambit/pubsub": "0.0.1112",
|
|
28
|
+
"@teambit/aspect-loader": "0.0.1112",
|
|
29
|
+
"@teambit/builder": "0.0.1112",
|
|
30
|
+
"@teambit/component-issues": "0.0.93",
|
|
31
|
+
"@teambit/dependency-resolver": "0.0.1112",
|
|
32
|
+
"@teambit/generator": "0.0.1112",
|
|
33
|
+
"@teambit/ui": "0.0.1112",
|
|
34
|
+
"@teambit/watcher": "0.0.124",
|
|
35
|
+
"@teambit/workspace": "0.0.1112",
|
|
36
|
+
"@teambit/isolator": "0.0.1112",
|
|
37
37
|
"@teambit/toolbox.fs.hard-link-directory": "0.0.14",
|
|
38
|
-
"@teambit/bit-roots": "0.0.
|
|
39
|
-
"@teambit/multi-compiler": "0.0.
|
|
40
|
-
"@teambit/workspace.modules.node-modules-linker": "0.0.
|
|
38
|
+
"@teambit/bit-roots": "0.0.80",
|
|
39
|
+
"@teambit/multi-compiler": "0.0.1112",
|
|
40
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.87",
|
|
41
41
|
"@teambit/bit-error": "0.0.402"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@teambit/compilation.content.compiler-overview": "1.95.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@teambit/legacy": "1.0.
|
|
55
|
+
"@teambit/legacy": "1.0.524",
|
|
56
56
|
"react": "^16.8.0 || ^17.0.0",
|
|
57
57
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
58
58
|
},
|
|
Binary file
|