@teambit/compiler 1.0.188 → 1.0.190
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_compilation_compiler-preview.js +1 -1
- package/artifacts/schema.json +7655 -0
- package/dist/compiler-env-type.js.map +1 -1
- package/dist/compiler.aspect.js.map +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-1710232535180.js +7 -0
- 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.map +1 -1
- package/dist/workspace-compiler.js.map +1 -1
- package/package.json +18 -18
- package/dist/preview-1710040632859.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["compiler-env-type.ts"],"sourcesContent":["import { EnvHandler } from '@teambit/envs';\nimport { Compiler } from './types';\n\nexport interface CompilerEnv {\n /**\n * return a compiler instance.\n */\n compiler(): EnvHandler<Compiler>;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["compiler-env-type.ts"],"sourcesContent":["import { EnvHandler } from '@teambit/envs';\nimport { Compiler } from './types';\n\nexport interface CompilerEnv {\n /**\n * return a compiler instance.\n */\n compiler(): EnvHandler<Compiler>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_harmony","data","require","CompilerAspect","exports","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,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC1CC,EAAE,EAAE;AACN,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["_harmony","data","require","CompilerAspect","exports","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,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC1CC,EAAE,EAAE;AACN,CAAC,CAAC","ignoreList":[]}
|
package/dist/compiler.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_logger","data","require","_chalk","_interopRequireDefault","_prettyTime","_outputFormatter","_types","_compiler","_events","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","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","Logger","successSymbol","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 Logger.successSymbol();\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":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,iBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,gBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,QAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,OAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2D,SAAAG,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAA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R,cAAc,CAACb,gBAAgB,CAAC;IAClD,MAAMsB,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,EAAC3B,iBAAiB,CAAE,GAAE;EACvE;EAEQP,0BAA0BA,CAACmC,KAAwB,EAAE;IAC3D,IAAIA,KAAK,CAACC,IAAI,KAAKC,yCAA+B,CAACC,IAAI,EAAE;MACvD,IAAI,CAAC3B,gBAAgB,CAACnD,IAAI,CAAC2E,KAAK,CAAClG,IAAI,CAAC;IACxC;EACF;AACF;AAACsG,OAAA,CAAAxD,UAAA,GAAAA,UAAA"}
|
|
1
|
+
{"version":3,"names":["_logger","data","require","_chalk","_interopRequireDefault","_prettyTime","_outputFormatter","_types","_compiler","_events","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","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","Logger","successSymbol","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 Logger.successSymbol();\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":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IA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GAAAA,UAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","obj","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"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,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAsD,CAAE,CACpF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA"}
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","obj","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"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,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAsD,CAAE,CACpF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["path","data","_interopRequireWildcard","require","_fsExtra","_interopRequireDefault","_aspectLoader","_builder","_cli","_componentIssues","_issues","_constants","_watcher","_envs","_dependencyResolver","_logger","_generator","_pubsub","_ui","_workspace","_compiler","_compiler2","_compiler3","_compiler4","_distArtifact","_exceptions","_types","_workspaceCompiler","_compiler5","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_defineProperty","key","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","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","join","fs","existsSync","getDistsFiles","artifacts","getArtifactsVinylByAspect","length","DistArtifactNotFound","DistArtifact","addMissingDistsIssue","components","issuesToIgnore","includes","IssuesClasses","MissingDists","Promise","all","map","exist","state","issues","getOrCreate","provider","cli","loggerMain","aspectLoader","ui","generator","watcher","logger","createLogger","CompilerService","WorkspaceCompiler","registerService","compilerMain","register","CompileCmd","registerAddComponentsIssues","bind","registerComponentTemplate","compilerTemplate","exports","MainRuntime","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","PubsubAspect","AspectLoaderAspect","BuilderAspect","UIAspect","GeneratorAspect","DependencyResolverAspect","WatcherAspect","IssuesAspect","addRuntime","_default"],"sources":["compiler.main.runtime.ts"],"sourcesContent":["import * as path from 'path';\nimport fs from 'fs-extra';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { BuilderAspect, BuilderMain } from '@teambit/builder';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport { Component } from '@teambit/component';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy/dist/constants';\nimport { WatcherAspect, WatcherMain } from '@teambit/watcher';\nimport { EnvsAspect, EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { ComponentID } from '@teambit/component-id';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { PubsubAspect, PubsubMain } from '@teambit/pubsub';\nimport { UIAspect, UiMain } from '@teambit/ui';\nimport { Workspace, WorkspaceAspect } 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[] | ComponentID[] | 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 async isDistDirExists(component: Component): Promise<boolean> {\n const packageDir = await this.workspace.getComponentPackagePath(component);\n const distDir = this.getRelativeDistFolder(component);\n const pathToCheck = path.join(packageDir, distDir);\n return fs.existsSync(pathToCheck);\n }\n\n async getDistsFiles(component: Component): Promise<DistArtifact> {\n const artifacts = await this.builder.getArtifactsVinylByAspect(component, CompilerAspect.id);\n if (!artifacts.length) throw new DistArtifactNotFound(component.id);\n\n return new DistArtifact(artifacts);\n }\n\n async addMissingDistsIssue(components: Component[], issuesToIgnore: string[]): Promise<void> {\n if (issuesToIgnore.includes(IssuesClasses.MissingDists.name)) return;\n await Promise.all(\n components.map(async (component) => {\n const exist = await this.isDistDirExists(component);\n if (!exist) {\n component.state.issues.getOrCreate(IssuesClasses.MissingDists).data = true;\n }\n })\n );\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n EnvsAspect,\n LoggerAspect,\n PubsubAspect,\n AspectLoaderAspect,\n BuilderAspect,\n UIAspect,\n GeneratorAspect,\n DependencyResolverAspect,\n WatcherAspect,\n IssuesAspect,\n ];\n\n static async provider([\n cli,\n workspace,\n envs,\n loggerMain,\n pubsub,\n aspectLoader,\n builder,\n ui,\n generator,\n dependencyResolver,\n watcher,\n issues,\n ]: [\n CLIMain,\n Workspace,\n EnvsMain,\n LoggerMain,\n PubsubMain,\n AspectLoaderMain,\n BuilderMain,\n UiMain,\n GeneratorMain,\n DependencyResolverMain,\n WatcherMain,\n IssuesMain\n ]) {\n const logger = loggerMain.createLogger(CompilerAspect.id);\n const compilerService = new CompilerService();\n\n const workspaceCompiler = new WorkspaceCompiler(\n workspace,\n envs,\n pubsub,\n aspectLoader,\n ui,\n logger,\n dependencyResolver,\n watcher\n );\n envs.registerService(compilerService);\n const compilerMain = new CompilerMain(\n pubsub,\n workspaceCompiler,\n envs,\n builder,\n workspace,\n dependencyResolver,\n compilerService\n );\n cli.register(new CompileCmd(workspaceCompiler, logger, pubsub));\n if (issues) {\n issues.registerAddComponentsIssues(compilerMain.addMissingDistsIssue.bind(compilerMain));\n }\n if (generator) generator.registerComponentTemplate([compilerT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AY,CACnCE,MAAM,EACNC,iBAAiB,EACjBC,IAAI,EACJC,OAAO,EACPC,SAAS,EACTC,kBAAkB,EAClBC,eACF,CAAC;IACDuD,GAAG,CAACY,QAAQ,CAAC,KAAIC,uBAAU,EAACzE,iBAAiB,EAAEkE,MAAM,EAAEnE,MAAM,CAAC,CAAC;IAC/D,IAAI0D,MAAM,EAAE;MACVA,MAAM,CAACiB,2BAA2B,CAACH,YAAY,CAACzB,oBAAoB,CAAC6B,IAAI,CAACJ,YAAY,CAAC,CAAC;IAC1F;IACA,IAAIP,SAAS,EAAEA,SAAS,CAACY,yBAAyB,CAAC,CAACC,6BAAgB,CAAC,CAAC;IAEtE,OAAON,YAAY;EACrB;AACF;AAACO,OAAA,CAAAjF,YAAA,GAAAA,YAAA;AAAAb,eAAA,CA9JYa,YAAY,aAmFNkF,kBAAW;AAAA/F,eAAA,CAnFjBa,YAAY,kBAqFD,CACpBmF,gBAAS,EACTC,4BAAe,EACfC,kBAAU,EACVC,sBAAY,EACZC,sBAAY,EACZC,kCAAkB,EAClBC,wBAAa,EACbC,cAAQ,EACRC,4BAAe,EACfC,8CAAwB,EACxBC,wBAAa,EACbC,sBAAY,CACb;AA8DHxE,0BAAc,CAACyE,UAAU,CAAC/F,YAAY,CAAC;AAAC,IAAAgG,QAAA,GAAAf,OAAA,CAAAlH,OAAA,GAEzBiC,YAAY"}
|
|
1
|
+
{"version":3,"names":["path","data","_interopRequireWildcard","require","_fsExtra","_interopRequireDefault","_aspectLoader","_builder","_cli","_componentIssues","_issues","_constants","_watcher","_envs","_dependencyResolver","_logger","_generator","_pubsub","_ui","_workspace","_compiler","_compiler2","_compiler3","_compiler4","_distArtifact","_exceptions","_types","_workspaceCompiler","_compiler5","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_defineProperty","key","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","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","join","fs","existsSync","getDistsFiles","artifacts","getArtifactsVinylByAspect","length","DistArtifactNotFound","DistArtifact","addMissingDistsIssue","components","issuesToIgnore","includes","IssuesClasses","MissingDists","Promise","all","map","exist","state","issues","getOrCreate","provider","cli","loggerMain","aspectLoader","ui","generator","watcher","logger","createLogger","CompilerService","WorkspaceCompiler","registerService","compilerMain","register","CompileCmd","registerAddComponentsIssues","bind","registerComponentTemplate","compilerTemplate","exports","MainRuntime","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","PubsubAspect","AspectLoaderAspect","BuilderAspect","UIAspect","GeneratorAspect","DependencyResolverAspect","WatcherAspect","IssuesAspect","addRuntime","_default"],"sources":["compiler.main.runtime.ts"],"sourcesContent":["import * as path from 'path';\nimport fs from 'fs-extra';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { BuilderAspect, BuilderMain } from '@teambit/builder';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport { Component } from '@teambit/component';\nimport { DEFAULT_DIST_DIRNAME } from '@teambit/legacy/dist/constants';\nimport { WatcherAspect, WatcherMain } from '@teambit/watcher';\nimport { EnvsAspect, EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { ComponentID } from '@teambit/component-id';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { PubsubAspect, PubsubMain } from '@teambit/pubsub';\nimport { UIAspect, UiMain } from '@teambit/ui';\nimport { Workspace, WorkspaceAspect } 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[] | ComponentID[] | 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 async isDistDirExists(component: Component): Promise<boolean> {\n const packageDir = await this.workspace.getComponentPackagePath(component);\n const distDir = this.getRelativeDistFolder(component);\n const pathToCheck = path.join(packageDir, distDir);\n return fs.existsSync(pathToCheck);\n }\n\n async getDistsFiles(component: Component): Promise<DistArtifact> {\n const artifacts = await this.builder.getArtifactsVinylByAspect(component, CompilerAspect.id);\n if (!artifacts.length) throw new DistArtifactNotFound(component.id);\n\n return new DistArtifact(artifacts);\n }\n\n async addMissingDistsIssue(components: Component[], issuesToIgnore: string[]): Promise<void> {\n if (issuesToIgnore.includes(IssuesClasses.MissingDists.name)) return;\n await Promise.all(\n components.map(async (component) => {\n const exist = await this.isDistDirExists(component);\n if (!exist) {\n component.state.issues.getOrCreate(IssuesClasses.MissingDists).data = true;\n }\n })\n );\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n EnvsAspect,\n LoggerAspect,\n PubsubAspect,\n AspectLoaderAspect,\n BuilderAspect,\n UIAspect,\n GeneratorAspect,\n DependencyResolverAspect,\n WatcherAspect,\n IssuesAspect,\n ];\n\n static async provider([\n cli,\n workspace,\n envs,\n loggerMain,\n pubsub,\n aspectLoader,\n builder,\n ui,\n generator,\n dependencyResolver,\n watcher,\n issues,\n ]: [\n CLIMain,\n Workspace,\n EnvsMain,\n LoggerMain,\n PubsubMain,\n AspectLoaderMain,\n BuilderMain,\n UiMain,\n GeneratorMain,\n DependencyResolverMain,\n WatcherMain,\n IssuesMain\n ]) {\n const logger = loggerMain.createLogger(CompilerAspect.id);\n const compilerService = new CompilerService();\n\n const workspaceCompiler = new WorkspaceCompiler(\n workspace,\n envs,\n pubsub,\n aspectLoader,\n ui,\n logger,\n dependencyResolver,\n watcher\n );\n envs.registerService(compilerService);\n const compilerMain = new CompilerMain(\n pubsub,\n workspaceCompiler,\n envs,\n builder,\n workspace,\n dependencyResolver,\n compilerService\n );\n cli.register(new CompileCmd(workspaceCompiler, logger, pubsub));\n if (issues) {\n issues.registerAddComponentsIssues(compilerMain.addMissingDistsIssue.bind(compilerMain));\n }\n if (generator) generator.registerComponentTemplate([compilerTemplate]);\n\n return compilerMain;\n }\n}\n\nCompilerAspect.addRuntime(CompilerMain);\n\nexport default CompilerMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,KAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,IAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,iBAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,gBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,QAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,OAAA,YAAAA,CAAA;IA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,4BAAe,EAAC,CAAC;IAE7C,MAAMpE,iBAAiB,GAAG,KAAIqE,sCAAiB,EAC7ClE,SAAS,EACTF,IAAI,EACJF,MAAM,EACN+D,YAAY,EACZC,EAAE,EACFG,MAAM,EACN9D,kBAAkB,EAClB6D,OACF,CAAC;IACDhE,IAAI,CAACqE,eAAe,CAACjE,eAAe,CAAC;IACrC,MAAMkE,YAAY,GAAG,IAAI1E,YAAY,CACnCE,MAAM,EACNC,iBAAiB,EACjBC,IAAI,EACJC,OAAO,EACPC,SAAS,EACTC,kBAAkB,EAClBC,eACF,CAAC;IACDuD,GAAG,CAACY,QAAQ,CAAC,KAAIC,uBAAU,EAACzE,iBAAiB,EAAEkE,MAAM,EAAEnE,MAAM,CAAC,CAAC;IAC/D,IAAI0D,MAAM,EAAE;MACVA,MAAM,CAACiB,2BAA2B,CAACH,YAAY,CAACzB,oBAAoB,CAAC6B,IAAI,CAACJ,YAAY,CAAC,CAAC;IAC1F;IACA,IAAIP,SAAS,EAAEA,SAAS,CAACY,yBAAyB,CAAC,CAACC,6BAAgB,CAAC,CAAC;IAEtE,OAAON,YAAY;EACrB;AACF;AAACO,OAAA,CAAAjF,YAAA,GAAAA,YAAA;AAAAb,eAAA,CA9JYa,YAAY,aAmFNkF,kBAAW;AAAA/F,eAAA,CAnFjBa,YAAY,kBAqFD,CACpBmF,gBAAS,EACTC,4BAAe,EACfC,kBAAU,EACVC,sBAAY,EACZC,sBAAY,EACZC,kCAAkB,EAClBC,wBAAa,EACbC,cAAQ,EACRC,4BAAe,EACfC,8CAAwB,EACxBC,wBAAa,EACbC,sBAAY,CACb;AA8DHxE,0BAAc,CAACyE,UAAU,CAAC/F,YAAY,CAAC;AAAC,IAAAgG,QAAA,GAAAf,OAAA,CAAAlH,OAAA,GAEzBiC,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cliHighlight","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","CompilerService","constructor","getCompiler","context","compiler","env","render","descriptor","getDescriptor","name","chalk","green","id","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","transform","undefined","icon","displayConfig","exports"],"sources":["compiler.service.ts"],"sourcesContent":["import { EnvService, EnvDefinition, Env, EnvContext, ServiceTransformationMap, ExecutionContext } from '@teambit/envs';\nimport chalk from 'chalk';\nimport highlight from 'cli-highlight';\nimport { Compiler } from './types';\n\nexport type CompilerDescriptor = {\n id: string;\n icon?: string;\n config?: string;\n};\n\ntype CompilerTransformationMap = ServiceTransformationMap & {\n getCompiler: () => Compiler;\n};\n\nexport class CompilerService implements EnvService<{}, CompilerDescriptor> {\n name = 'Compile';\n\n getCompiler(context: ExecutionContext): Compiler {\n const compiler: Compiler = context.env.getCompiler();\n return compiler;\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n const name = `${chalk.green('configured compiler:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('compiler config:');\n const configObj = descriptor?.config\n ? highlight(descriptor?.config, { language: 'json', ignoreIllegals: true })\n : '';\n return `${name}\\n${configLabel}\\n${configObj}`;\n }\n\n transform(env: Env, context: EnvContext): CompilerTransformationMap | undefined {\n // Old env\n if (!env?.compiler) return undefined;\n return {\n getCompiler: () => env.compiler()(context),\n };\n }\n\n getDescriptor(env: EnvDefinition) {\n if (!env.env.getCompiler) return undefined;\n const compiler = env.env.getCompiler();\n\n return {\n id: compiler.id,\n icon: compiler.icon,\n config: compiler.displayConfig ? compiler.displayConfig() : undefined,\n version: compiler.version ? compiler.version() : '?',\n displayName: compiler.displayName ? compiler.displayName : '?',\n };\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,C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;MACpDD,WAAW,EAAET,QAAQ,CAACS,WAAW,GAAGT,QAAQ,CAACS,WAAW,GAAG;IAC7D,CAAC;EACH;AACF;AAACY,OAAA,CAAAzB,eAAA,GAAAA,eAAA"}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cliHighlight","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","CompilerService","constructor","getCompiler","context","compiler","env","render","descriptor","getDescriptor","name","chalk","green","id","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","transform","undefined","icon","displayConfig","exports"],"sources":["compiler.service.ts"],"sourcesContent":["import { EnvService, EnvDefinition, Env, EnvContext, ServiceTransformationMap, ExecutionContext } from '@teambit/envs';\nimport chalk from 'chalk';\nimport highlight from 'cli-highlight';\nimport { Compiler } from './types';\n\nexport type CompilerDescriptor = {\n id: string;\n icon?: string;\n config?: string;\n};\n\ntype CompilerTransformationMap = ServiceTransformationMap & {\n getCompiler: () => Compiler;\n};\n\nexport class CompilerService implements EnvService<{}, CompilerDescriptor> {\n name = 'Compile';\n\n getCompiler(context: ExecutionContext): Compiler {\n const compiler: Compiler = context.env.getCompiler();\n return compiler;\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n const name = `${chalk.green('configured compiler:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('compiler config:');\n const configObj = descriptor?.config\n ? highlight(descriptor?.config, { language: 'json', ignoreIllegals: true })\n : '';\n return `${name}\\n${configLabel}\\n${configObj}`;\n }\n\n transform(env: Env, context: EnvContext): CompilerTransformationMap | undefined {\n // Old env\n if (!env?.compiler) return undefined;\n return {\n getCompiler: () => env.compiler()(context),\n };\n }\n\n getDescriptor(env: EnvDefinition) {\n if (!env.env.getCompiler) return undefined;\n const compiler = env.env.getCompiler();\n\n return {\n id: compiler.id,\n icon: compiler.icon,\n config: compiler.displayConfig ? compiler.displayConfig() : undefined,\n version: compiler.version ? compiler.version() : '?',\n displayName: compiler.displayName ? compiler.displayName : '?',\n };\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsC,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAK,CAAA,GAAAL,CAAA,CAAAM,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAJ,CAAA,GAAAI,CAAA,CAAAG,IAAA,CAAAR,CAAA,EAAAI,CAAA,uCAAAH,CAAA,SAAAA,CAAA,YAAAQ,SAAA,yEAAAL,CAAA,GAAAD,MAAA,GA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ACfW,IAAI,EAAEnB,QAAQ,CAACmB,IAAI;MACnBN,MAAM,EAAEb,QAAQ,CAACoB,aAAa,GAAGpB,QAAQ,CAACoB,aAAa,CAAC,CAAC,GAAGF,SAAS;MACrER,OAAO,EAAEV,QAAQ,CAACU,OAAO,GAAGV,QAAQ,CAACU,OAAO,CAAC,CAAC,GAAG,GAAG;MACpDD,WAAW,EAAET,QAAQ,CAACS,WAAW,GAAGT,QAAQ,CAACS,WAAW,GAAG;IAC7D,CAAC;EACH;AACF;AAACY,OAAA,CAAAzB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_toolboxFs","data","require","_fsExtra","_interopRequireDefault","_path","_compiler","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","CompilerTask","constructor","aspectId","name","compilerInstance","dependencyResolver","artifactName","description","preBuild","context","Promise","all","capsuleNetwork","seedersCapsules","map","capsule","copyNonSupportedFiles","execute","buildResults","build","_hardLinkBuildArtifactsOnCapsules","relCompDir","path","relative","capsulesRootDir","replace","injectedDirs","getInjectedDirs","getPackageName","component","hardLinkDirectory","injectedDir","join","postBuild","tasksResults","compiler","shouldCopyNonSupportedFiles","filesystem","files","file","isFileSupported","content","contents","fs","outputFile","distDir","from","options","CompilerAspect","id","depResolve","getAspect","exports"],"sources":["compiler.task.ts"],"sourcesContent":["import { BuildContext, BuiltTaskResult, BuildTask, TaskResultsList } from '@teambit/builder';\nimport { Capsule } from '@teambit/isolator';\nimport { hardLinkDirectory } from '@teambit/toolbox.fs.hard-link-directory';\nimport { EnvContext, EnvHandler } from '@teambit/envs';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { Compiler } from './types';\nimport { CompilerAspect } from './compiler.aspect';\n\nexport type CompilerTaskOptions = {\n /**\n * instance of compiler to use.\n */\n compiler: EnvHandler<Compiler>;\n\n /**\n * name of compiler task\n */\n name?: string;\n};\n\n/**\n * compiler build task. Allows to compile components during component build.\n */\nexport class CompilerTask implements BuildTask {\n readonly description = 'compile components';\n constructor(\n readonly aspectId: string,\n readonly name: string,\n 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,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmD,SAAAG,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA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CAACA,QAAQ,CAACC,2BAA2B,EAAE;MACzC;IACF;IACA,MAAMP,SAAS,GAAGd,OAAO,CAACc,SAAS;IACnC,MAAMnB,OAAO,CAACC,GAAG,CACfkB,SAAS,CAACQ,UAAU,CAACC,KAAK,CAACxB,GAAG,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,CACH,CAAC;EACH;EAEA,OAAOK,IAAIA,CAACC,OAA4B,EAAE;IACxC,OAAQtC,OAAmB,IAAK;MAC9B,MAAMP,QAAQ,GAAG8C,0BAAc,CAACC,EAAE;MAClC,MAAM9C,IAAI,GAAG4C,OAAO,CAAC5C,IAAI,IAAI,eAAe;MAC5C,MAAM+C,UAAU,GAAGzC,OAAO,CAAC0C,SAAS,CAAM,0CAA0C,CAAC;MACrF,OAAO,IAAInD,YAAY,CAACE,QAAQ,EAAEC,IAAI,EAAE4C,OAAO,CAACZ,QAAQ,CAAC1B,OAAO,CAAC,EAAEyC,UAAU,CAAC;IAChF,CAAC;EACH;AACF;AAACE,OAAA,CAAApD,YAAA,GAAAA,YAAA"}
|
|
1
|
+
{"version":3,"names":["_toolboxFs","data","require","_fsExtra","_interopRequireDefault","_path","_compiler","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","CompilerTask","constructor","aspectId","name","compilerInstance","dependencyResolver","artifactName","description","preBuild","context","Promise","all","capsuleNetwork","seedersCapsules","map","capsule","copyNonSupportedFiles","execute","buildResults","build","_hardLinkBuildArtifactsOnCapsules","relCompDir","path","relative","capsulesRootDir","replace","injectedDirs","getInjectedDirs","getPackageName","component","hardLinkDirectory","injectedDir","join","postBuild","tasksResults","compiler","shouldCopyNonSupportedFiles","filesystem","files","file","isFileSupported","content","contents","fs","outputFile","distDir","from","options","CompilerAspect","id","depResolve","getAspect","exports"],"sources":["compiler.task.ts"],"sourcesContent":["import { BuildContext, BuiltTaskResult, BuildTask, TaskResultsList } from '@teambit/builder';\nimport { Capsule } from '@teambit/isolator';\nimport { hardLinkDirectory } from '@teambit/toolbox.fs.hard-link-directory';\nimport { EnvContext, EnvHandler } from '@teambit/envs';\nimport { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { Compiler } from './types';\nimport { CompilerAspect } from './compiler.aspect';\n\nexport type CompilerTaskOptions = {\n /**\n * instance of compiler to use.\n */\n compiler: EnvHandler<Compiler>;\n\n /**\n * name of compiler task\n */\n name?: string;\n};\n\n/**\n * compiler build task. Allows to compile components during component build.\n */\nexport class CompilerTask implements BuildTask {\n readonly description = 'compile components';\n constructor(\n readonly aspectId: string,\n readonly name: string,\n 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,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EA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I,eAAe;MAC5C,MAAM+C,UAAU,GAAGzC,OAAO,CAAC0C,SAAS,CAAM,0CAA0C,CAAC;MACrF,OAAO,IAAInD,YAAY,CAACE,QAAQ,EAAEC,IAAI,EAAE4C,OAAO,CAACZ,QAAQ,CAAC1B,OAAO,CAAC,EAAEyC,UAAU,CAAC;IAChF,CAAC;EACH;AACF;AAACE,OAAA,CAAApD,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_utils","data","require","DistArtifact","constructor","artifacts","getFile","path","find","file","pathNormalizeToLinux","relative","exports"],"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,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,YAAY,CAAC;EACxBC,WAAWA,CAASC,SAA0B,EAAE;IAAA,KAA5BA,SAA0B,GAA1BA,SAA0B;EAAG;EAEjDC,OAAOA,CAACC,IAAY,EAAE;IACpB,OAAO,IAAI,CAACF,SAAS,CAACG,IAAI,CAAEC,IAAI,IAAK;MACnC,OAAO,IAAAC,6BAAoB,EAACD,IAAI,CAACE,QAAQ,CAAC,KAAKJ,IAAI;IACrD,CAAC,CAAC;EACJ;AACF;AAACK,OAAA,CAAAT,YAAA,GAAAA,YAAA"}
|
|
1
|
+
{"version":3,"names":["_utils","data","require","DistArtifact","constructor","artifacts","getFile","path","find","file","pathNormalizeToLinux","relative","exports"],"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,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,YAAY,CAAC;EACxBC,WAAWA,CAASC,SAA0B,EAAE;IAAA,KAA5BA,SAA0B,GAA1BA,SAA0B;EAAG;EAEjDC,OAAOA,CAACC,IAAY,EAAE;IACpB,OAAO,IAAI,CAACF,SAAS,CAACG,IAAI,CAAEC,IAAI,IAAK;MACnC,OAAO,IAAAC,6BAAoB,EAACD,IAAI,CAACE,QAAQ,CAAC,KAAKJ,IAAI;IACrD,CAAC,CAAC;EACJ;AACF;AAACK,OAAA,CAAAT,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","CompilerErrorEventData","constructor","error","CompilerErrorEvent","BitBaseEvent","timestamp","Date","now","TYPE","exports"],"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,SAAAA,QAA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AAWG,SAAS,GAATA,SAAS;EAE9C;AACF;AAACI,OAAA,CAAAN,kBAAA,GAAAA,kBAAA;AAAAxB,eAAA,CANYwB,kBAAkB,UACN,gBAAgB"}
|
|
1
|
+
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","CompilerErrorEventData","constructor","error","CompilerErrorEvent","BitBaseEvent","timestamp","Date","now","TYPE","exports"],"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,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAK,CAAA,GAAAL,CAAA,CAAAM,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAJ,CAAA,GAAAI,CAAA,CAAAG,IAAA,CAAAR,CAAA,EAAAI,CAAA,uCAAAH,CAAA,SAAAA,CAAA,YAAAQ,SAAA,yEAAAL,CAAA,GAAAD,MAAA,GAAAO,MAAA,EAAAV,CAAA,KAD/C;AAGA,MAAMW,sBAAsB,CAAC;EAC3BC,WAAWA,CAAUC,KAAU,EAAE;IAAA,KAAZA,KAAU,GAAVA,KAAU;EAAG;AACpC;AAEO,MAAMC,kBAAkB,SAASC,sBAAY,CAAyB;EAG3EH,WAAWA,CAAUC,KAAK,EAAWG,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,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;AAACI,OAAA,CAAAN,kBAAA,GAAAA,kBAAA;AAAAxB,eAAA,CANYwB,kBAAkB,UACN,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","ComponentCompilationOnDoneEventData","constructor","errors","component","buildResults","ComponentCompilationOnDoneEvent","BitBaseEvent","timestamp","Date","now","TYPE","exports"],"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,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAK,CAAA,GAAAL,CAAA,CAAAM,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAJ,CAAA,GAAAI,CAAA,CAAAG,IAAA,CAAAR,CAAA,EAAAI,CAAA,uCAAAH,CAAA,SAAAA,CAAA,YAAAQ,SAAA,yEAAAL,CAAA,GAAAD,MAAA,GAAAO,MAAA,EAAAV,CAAA,KAD/C;AAKA,MAAMW,mCAAmC,CAAC;EACxCC,WAAWA,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,WAAWA,CACAC,MAA2B,EAC3BC,SAAoB,EACpBC,YAAsB,EACtBG,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAC/B;IACA,KAAK,CACHJ,+BAA+B,CAACK,IAAI,EACpC,OAAO,EACPH,SAAS,EACT,IAAIP,mCAAmC,CAACE,MAAM,EAAEC,SAAS,EAAEC,YAAY,CACzE,CAAC;IAAC,KAVOF,MAA2B,GAA3BA,MAA2B;IAAA,KAC3BC,SAAoB,GAApBA,SAAoB;IAAA,KACpBC,YAAsB,GAAtBA,YAAsB;IAAA,KACtBG,SAAS,GAATA,SAAS;EAQpB;AACF;AAACI,OAAA,CAAAN,+BAAA,GAAAA,+BAAA;AAAA1B,eAAA,CAhBY0B,+BAA+B,UACnB,+BAA+B"}
|
|
1
|
+
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","ComponentCompilationOnDoneEventData","constructor","errors","component","buildResults","ComponentCompilationOnDoneEvent","BitBaseEvent","timestamp","Date","now","TYPE","exports"],"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,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAK,CAAA,GAAAL,CAAA,CAAAM,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAJ,CAAA,GAAAI,CAAA,CAAAG,IAAA,CAAAR,CAAA,EAAAI,CAAA,uCAAAH,CAAA,SAAAA,CAAA,YAAAQ,SAAA,yEAAAL,CAAA,GAAAD,MAAA,GAAAO,MAAA,EAAAV,CAAA,KAD/C;AAKA,MAAMW,mCAAmC,CAAC;EACxCC,WAAWA,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,WAAWA,CACAC,MAA2B,EAC3BC,SAAoB,EACpBC,YAAsB,EACtBG,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAC/B;IACA,KAAK,CACHJ,+BAA+B,CAACK,IAAI,EACpC,OAAO,EACPH,SAAS,EACT,IAAIP,mCAAmC,CAACE,MAAM,EAAEC,SAAS,EAAEC,YAAY,CACzE,CAAC;IAAC,KAVOF,MAA2B,GAA3BA,MAA2B;IAAA,KAC3BC,SAAoB,GAApBA,SAAoB;IAAA,KACpBC,YAAsB,GAAtBA,YAAsB;IAAA,KACtBG,SAAS,GAATA,SAAS;EAQpB;AACF;AAACI,OAAA,CAAAN,+BAAA,GAAAA,+BAAA;AAAA1B,eAAA,CAhBY0B,+BAA+B,UACnB,+BAA+B","ignoreList":[]}
|
package/dist/events/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compilerError","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_componentCompilationOnDone"],"sources":["index.ts"],"sourcesContent":["export * from './compiler-error';\nexport * from './component-compilation-on-done';\n"],"mappings":";;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,2BAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,2BAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,2BAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,2BAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["_compilerError","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_componentCompilationOnDone"],"sources":["index.ts"],"sourcesContent":["export * from './compiler-error';\nexport * from './component-compilation-on-done';\n"],"mappings":";;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,2BAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,2BAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,2BAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,2BAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bitError","data","require","DistArtifactNotFound","BitError","constructor","componentId","toString","exports"],"sources":["dist-artifact-not-found.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component';\nimport { BitError } from '@teambit/bit-error';\n\nexport class DistArtifactNotFound extends BitError {\n constructor(readonly componentId: ComponentID) {\n super(`dist artifact for component ${componentId.toString()} was not found`);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,oBAAoB,SAASC,oBAAQ,CAAC;EACjDC,WAAWA,CAAUC,WAAwB,EAAE;IAC7C,KAAK,CAAE,+BAA8BA,WAAW,CAACC,QAAQ,CAAC,CAAE,gBAAe,CAAC;IAAC,KAD1DD,WAAwB,GAAxBA,WAAwB;EAE7C;AACF;AAACE,OAAA,CAAAL,oBAAA,GAAAA,oBAAA"}
|
|
1
|
+
{"version":3,"names":["_bitError","data","require","DistArtifactNotFound","BitError","constructor","componentId","toString","exports"],"sources":["dist-artifact-not-found.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component';\nimport { BitError } from '@teambit/bit-error';\n\nexport class DistArtifactNotFound extends BitError {\n constructor(readonly componentId: ComponentID) {\n super(`dist artifact for component ${componentId.toString()} was not found`);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,oBAAoB,SAASC,oBAAQ,CAAC;EACjDC,WAAWA,CAAUC,WAAwB,EAAE;IAC7C,KAAK,CAAE,+BAA8BA,WAAW,CAACC,QAAQ,CAAC,CAAE,gBAAe,CAAC;IAAC,KAD1DD,WAAwB,GAAxBA,WAAwB;EAE7C;AACF;AAACE,OAAA,CAAAL,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_distArtifactNotFound","data","require"],"sources":["index.ts"],"sourcesContent":["export { DistArtifactNotFound } from './dist-artifact-not-found';\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,sBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,qBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["_distArtifactNotFound","data","require"],"sources":["index.ts"],"sourcesContent":["export { DistArtifactNotFound } from './dist-artifact-not-found';\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,sBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,qBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compiler","data","require","_compiler2","_types","_events","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export type { CompilerMain } from './compiler.main.runtime';\nexport type { CompilerTaskOptions } from './compiler.task';\nexport { CompilerTask } from './compiler.task';\nexport type { CompilerEnv } from './compiler-env-type';\nexport { CompilerAspect } from './compiler.aspect';\nexport { CompilationInitiator } from './types';\nexport type {\n Compiler,\n CompilerOptions,\n TranspileFileOutput,\n TranspileFileParams,\n TranspileComponentParams,\n TranspileFileOutputOneFile,\n} from './types';\nexport * from './events';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,IAAAI,OAAA,GAAAH,OAAA;AAAAI,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,OAAA,CAAAI,GAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["_compiler","data","require","_compiler2","_types","_events","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export type { CompilerMain } from './compiler.main.runtime';\nexport type { CompilerTaskOptions } from './compiler.task';\nexport { CompilerTask } from './compiler.task';\nexport type { CompilerEnv } from './compiler-env-type';\nexport { CompilerAspect } from './compiler.aspect';\nexport { CompilationInitiator } from './types';\nexport type {\n Compiler,\n CompilerOptions,\n TranspileFileOutput,\n TranspileFileParams,\n TranspileComponentParams,\n TranspileFileOutputOneFile,\n} from './types';\nexport * from './events';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,IAAAI,OAAA,GAAAH,OAAA;AAAAI,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,OAAA,CAAAI,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_logger","obj","__esModule","default","formatCompileResults","compileResults","verbose","map","componentResult","componentId","component","id","fullName","files","buildResults","status","errors","length","icon","chalk","red","Logger","successSymbol","reduce","outputString","result","fileList","file","exports"],"sources":["output-formatter.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Logger } from '@teambit/logger';\nimport { 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('✗') : Logger.successSymbol(),\n }))\n .reduce((outputString, result) => {\n outputString += `${result.icon} ${result.status}\\t${result.componentId}`;\n if (verbose) {\n outputString += ':';\n outputString += result?.files?.reduce((fileList, file) => `${fileList}\\t\\t - ${file}\\n`, '\\n');\n }\n outputString += '\\n';\n return outputString;\n }, '');\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyC,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGlC,MAAMG,oBAAoB,GAAGA,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,GAAGC,gBAAM,CAACC,aAAa,CAAC;AAC9E,CAAC,CAAC,CAAC,CACFC,MAAM,CAAC,CAACC,YAAY,EAAEC,MAAM,KAAK;EAChCD,YAAY,IAAK,GAAEC,MAAM,CAACP,IAAK,IAAGO,MAAM,CAACV,MAAO,KAAIU,MAAM,CAAChB,WAAY,EAAC;EACxE,IAAIH,OAAO,EAAE;IACXkB,YAAY,IAAI,GAAG;IACnBA,YAAY,IAAIC,MAAM,EAAEZ,KAAK,EAAEU,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;AAACI,OAAA,CAAAxB,oBAAA,GAAAA,oBAAA"}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_logger","obj","__esModule","default","formatCompileResults","compileResults","verbose","map","componentResult","componentId","component","id","fullName","files","buildResults","status","errors","length","icon","chalk","red","Logger","successSymbol","reduce","outputString","result","fileList","file","exports"],"sources":["output-formatter.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Logger } from '@teambit/logger';\nimport { 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('✗') : Logger.successSymbol(),\n }))\n .reduce((outputString, result) => {\n outputString += `${result.icon} ${result.status}\\t${result.componentId}`;\n if (verbose) {\n outputString += ':';\n outputString += result?.files?.reduce((fileList, file) => `${fileList}\\t\\t - ${file}\\n`, '\\n');\n }\n outputString += '\\n';\n return outputString;\n }, '');\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyC,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGlC,MAAMG,oBAAoB,GAAGA,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,GAAGC,gBAAM,CAACC,aAAa,CAAC;AAC9E,CAAC,CAAC,CAAC,CACFC,MAAM,CAAC,CAACC,YAAY,EAAEC,MAAM,KAAK;EAChCD,YAAY,IAAK,GAAEC,MAAM,CAACP,IAAK,IAAGO,MAAM,CAACV,MAAO,KAAIU,MAAM,CAAChB,WAAY,EAAC;EACxE,IAAIH,OAAO,EAAE;IACXkB,YAAY,IAAI,GAAG;IACnBA,YAAY,IAAIC,MAAM,EAAEZ,KAAK,EAAEU,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;AAACI,OAAA,CAAAxB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as compositions_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.compilation_compiler@1.0.190/dist/compiler.composition.js';
|
|
2
|
+
import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.compilation_compiler@1.0.190/dist/compiler.docs.mdx';
|
|
3
|
+
|
|
4
|
+
export const compositions = [compositions_0];
|
|
5
|
+
export const overview = [overview_0];
|
|
6
|
+
|
|
7
|
+
export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["aspectFile","namePascalCase","componentId"],"sources":["aspect-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function aspectFile({ namePascalCase, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${namePascalCase}Aspect = Aspect.create({\n id: '${componentId}',\n});\n `;\n}\n"],"mappings":";;;;;;AAEO,SAASA,UAAUA,CAAC;EAAEC,cAAc;EAAEC;AAA8B,CAAC,EAAE;EAC5E,OAAQ;AACV;AACA,eAAeD,cAAe;AAC9B,SAASC,WAAY;AACrB;AACA,GAAG;AACH"}
|
|
1
|
+
{"version":3,"names":["aspectFile","namePascalCase","componentId"],"sources":["aspect-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function aspectFile({ namePascalCase, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${namePascalCase}Aspect = Aspect.create({\n id: '${componentId}',\n});\n `;\n}\n"],"mappings":";;;;;;AAEO,SAASA,UAAUA,CAAC;EAAEC,cAAc;EAAEC;AAA8B,CAAC,EAAE;EAC5E,OAAQ;AACV;AACA,eAAeD,cAAe;AAC9B,SAASC,WAAY;AACrB;AACA,GAAG;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["compilerFile","namePascalCase"],"sources":["compiler-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compilerFile({ namePascalCase }: ComponentContext) {\n return `import {\n BuildContext,\n BuiltTaskResult,\n ComponentResult,\n} from '@teambit/builder';\nimport {\n Compiler,\n CompilerMain,\n TranspileFileParams,\n TranspileFileOutput,\n} from '@teambit/compiler';\n\nexport class ${namePascalCase} implements Compiler {\n\n constructor(readonly id: string, readonly distDir, private compiler: CompilerMain) {}\n\n /**\n * Detemines whether unsupported files (such as assets)\n * should be copied by Compiler aspect into the 'dist' directory\n */\n shouldCopyNonSupportedFiles = true;\n\n /* The name of the compiler being used. For example, TypeScript, Babel, etc. */\n displayName = '';\n\n /* The version of the compiler being used. For example '1.0.0' */\n version(): string {};\n\n /**\n * Use this for compilation in the workspace.\n * This will compile one file content at a time (alternatively, use 'transpileComponent') */\n transpileFile( fileContent: string, transpileFileParams: TranspileFileParams): TranspileFileOutput {}\n\n\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n let componentsResults: ComponentResult[] = [];\n return {\n /* Sets the files to persist as the Component's artifacts,\n and describes them. */\n artifacts: [\n {\n generatedBy: this.id,\n name: 'compilation output',\n globPatterns: [\\`\\${this.distDir}/**\\`],\n },\n ],\n componentsResults,\n };\n }\n\n /* This is optional but recommended.\n Not using it will require consumers of your compiler to use two APIs and have two depndencies\n to their Envs - your compiler\n */\n createTask() {\n return this.compiler.createTask('${namePascalCase}', this);\n }\n\n /**\n * Given a source file, return its parallel in the dists. e.g. index.ts => dist/index.js.\n * Needed by aspects such as Pkg to determine the main prop.\n */\n getDistPathBySrcPath(srcPath: string): string {}\n\n /**\n * Returns a boolean indicating whether a file is supported by the compiler or not.\n * For example, this API is used by Compiler aspect to copy unsupported files to the dist directory.\n */\n isFileSupported(filePath: string): boolean {}\n}\n `;\n}\n"],"mappings":";;;;;;AAEO,SAASA,YAAYA,CAAC;EAAEC;AAAiC,CAAC,EAAE;EACjE,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
|
+
{"version":3,"names":["compilerFile","namePascalCase"],"sources":["compiler-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compilerFile({ namePascalCase }: ComponentContext) {\n return `import {\n BuildContext,\n BuiltTaskResult,\n ComponentResult,\n} from '@teambit/builder';\nimport {\n Compiler,\n CompilerMain,\n TranspileFileParams,\n TranspileFileOutput,\n} from '@teambit/compiler';\n\nexport class ${namePascalCase} implements Compiler {\n\n constructor(readonly id: string, readonly distDir, private compiler: CompilerMain) {}\n\n /**\n * Detemines whether unsupported files (such as assets)\n * should be copied by Compiler aspect into the 'dist' directory\n */\n shouldCopyNonSupportedFiles = true;\n\n /* The name of the compiler being used. For example, TypeScript, Babel, etc. */\n displayName = '';\n\n /* The version of the compiler being used. For example '1.0.0' */\n version(): string {};\n\n /**\n * Use this for compilation in the workspace.\n * This will compile one file content at a time (alternatively, use 'transpileComponent') */\n transpileFile( fileContent: string, transpileFileParams: TranspileFileParams): TranspileFileOutput {}\n\n\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n let componentsResults: ComponentResult[] = [];\n return {\n /* Sets the files to persist as the Component's artifacts,\n and describes them. */\n artifacts: [\n {\n generatedBy: this.id,\n name: 'compilation output',\n globPatterns: [\\`\\${this.distDir}/**\\`],\n },\n ],\n componentsResults,\n };\n }\n\n /* This is optional but recommended.\n Not using it will require consumers of your compiler to use two APIs and have two depndencies\n to their Envs - your compiler\n */\n createTask() {\n return this.compiler.createTask('${namePascalCase}', this);\n }\n\n /**\n * Given a source file, return its parallel in the dists. e.g. index.ts => dist/index.js.\n * Needed by aspects such as Pkg to determine the main prop.\n */\n getDistPathBySrcPath(srcPath: string): string {}\n\n /**\n * Returns a boolean indicating whether a file is supported by the compiler or not.\n * For example, this API is used by Compiler aspect to copy unsupported files to the dist directory.\n */\n isFileSupported(filePath: string): boolean {}\n}\n `;\n}\n"],"mappings":";;;;;;AAEO,SAASA,YAAYA,CAAC;EAAEC;AAAiC,CAAC,EAAE;EACjE,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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `import { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport type { ${namePascalCase}Main } from './${name}.main.runtime';\nexport default ${namePascalCase}Aspect;\nexport { ${namePascalCase}Aspect };\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAQ,YAAWD,cAAe,oBAAmBC,IAAK;AAC5D;AACA,gBAAgBD,cAAe,kBAAiBC,IAAK;AACrD,iBAAiBD,cAAe;AAChC,WAAWA,cAAe;AAC1B,CAAC;AACD"}
|
|
1
|
+
{"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `import { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport type { ${namePascalCase}Main } from './${name}.main.runtime';\nexport default ${namePascalCase}Aspect;\nexport { ${namePascalCase}Aspect };\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAQ,YAAWD,cAAe,oBAAmBC,IAAK;AAC5D;AACA,gBAAgBD,cAAe,kBAAiBC,IAAK;AACrD,iBAAiBD,cAAe;AAChC,WAAWA,cAAe;AAC1B,CAAC;AACD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["mainRuntimeFile","name","namePascalCase"],"sources":["main-runtime-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainRuntimeFile({ name, namePascalCase }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { ${namePascalCase} } from './${name}.compiler';\nimport { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport class ${namePascalCase}Main {\n constructor(private compiler: CompilerMain) {}\n\n static slots = [];\n static dependencies = [CompilerAspect];\n static runtime = MainRuntime;\n\n distDir = 'dist';\n\n /* Set the main property of the component's package with\n the relative output path for the main file */\n getPackageJsonProps() {\n return {\n main: '\\${this.distDir}/{main}.js',\n };\n }\n\n createCompiler(): ${namePascalCase} {\n return new ${namePascalCase}(${namePascalCase}Aspect.id, this.distDir, this.compiler);\n }\n\n static async provider([compiler]: [CompilerMain]) {\n return new ${namePascalCase}Main(compiler);\n }\n}\n\n${namePascalCase}Aspect.addRuntime(${namePascalCase}Main);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAeA,CAAC;EAAEC,IAAI;EAAEC;AAAiC,CAAC,EAAE;EAC1E,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
|
+
{"version":3,"names":["mainRuntimeFile","name","namePascalCase"],"sources":["main-runtime-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainRuntimeFile({ name, namePascalCase }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { ${namePascalCase} } from './${name}.compiler';\nimport { ${namePascalCase}Aspect } from './${name}.aspect';\n\nexport class ${namePascalCase}Main {\n constructor(private compiler: CompilerMain) {}\n\n static slots = [];\n static dependencies = [CompilerAspect];\n static runtime = MainRuntime;\n\n distDir = 'dist';\n\n /* Set the main property of the component's package with\n the relative output path for the main file */\n getPackageJsonProps() {\n return {\n main: '\\${this.distDir}/{main}.js',\n };\n }\n\n createCompiler(): ${namePascalCase} {\n return new ${namePascalCase}(${namePascalCase}Aspect.id, this.distDir, this.compiler);\n }\n\n static async provider([compiler]: [CompilerMain]) {\n return new ${namePascalCase}Main(compiler);\n }\n}\n\n${namePascalCase}Aspect.addRuntime(${namePascalCase}Main);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAeA,CAAC;EAAEC,IAAI;EAAEC;AAAiC,CAAC,EAAE;EAC1E,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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_indexFile","data","require","_aspectFile","_mainRuntimeFile","_compilerFile","compilerTemplate","exports","name","description","hidden","generateFiles","context","relativePath","content","indexFile","isMain","aspectFile","compilerFile","mainRuntimeFile"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index-file';\nimport { aspectFile } from './files/aspect-file';\nimport { mainRuntimeFile } from './files/main-runtime-file';\nimport { compilerFile } from './files/compiler-file';\n\nexport const compilerTemplate: ComponentTemplate = {\n name: 'compiler',\n description: 'A compiler implementation',\n hidden: true,\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `${context.name}.compiler.ts`,\n content: compilerFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntimeFile(context),\n },\n ];\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMK,gBAAmC,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EACjDE,IAAI,EAAE,UAAU;EAChBC,WAAW,EAAE,2BAA2B;EACxCC,MAAM,EAAE,IAAI;EACZC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL;MACEC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAE,IAAAC,sBAAS,EAACH,OAAO,CAAC;MAC3BI,MAAM,EAAE;IACV,CAAC,EACD;MACEH,YAAY,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"}
|
|
1
|
+
{"version":3,"names":["_indexFile","data","require","_aspectFile","_mainRuntimeFile","_compilerFile","compilerTemplate","exports","name","description","hidden","generateFiles","context","relativePath","content","indexFile","isMain","aspectFile","compilerFile","mainRuntimeFile"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index-file';\nimport { aspectFile } from './files/aspect-file';\nimport { mainRuntimeFile } from './files/main-runtime-file';\nimport { compilerFile } from './files/compiler-file';\n\nexport const compilerTemplate: ComponentTemplate = {\n name: 'compiler',\n description: 'A compiler implementation',\n hidden: true,\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `${context.name}.compiler.ts`,\n content: compilerFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\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
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CompilationInitiator","exports"],"sources":["types.ts"],"sourcesContent":["import { BuildContext, BuildTask, BuiltTaskResult, TaskResultsList } from '@teambit/builder';\nimport type { Component } from '@teambit/component';\nimport { ServiceHandler } from '@teambit/envs';\n\nexport type TranspileFileParams = {\n componentDir: string; // absolute path of the component's root directory\n filePath: string; // relative path of the file inside the component directory\n};\n\nexport enum CompilationInitiator {\n CmdReport,\n CmdJson,\n PreStart,\n PreWatch,\n Start,\n ComponentChanged,\n AspectLoadFail,\n ComponentAdded,\n Install,\n}\n\nexport type TranspileComponentParams = {\n component: Component;\n componentDir: string; // absolute path of the component's root directory\n outputDir: string; // absolute path of the component's output directory\n initiator: CompilationInitiator; // origin of the compilation's request\n};\n\nexport type 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 * no need to handle non-supported-files (e.g. assets) in this method because the compiler-aspect already copies them\n * into the compiler.dist in the preBuild stage.\n */\n build(context: BuildContext): Promise<BuiltTaskResult>;\n\n /**\n * return the dist dir of the compiled files (relative path from the component root dir)\n */\n getDistDir?(): string;\n\n /**\n * given a source file, return its parallel in the dists. e.g. \"index.ts\" => \"dist/index.js\"\n * both, the return path and the given path are relative paths.\n */\n getDistPathBySrcPath(srcPath: string): string;\n\n /**\n * given a component, returns the path to the source folder to use for the preview, uses the one\n * in node_modules by default\n */\n getPreviewComponentRootPath?(component: Component): string;\n\n /**\n * only supported files matching get compiled. others, are copied to the dist dir.\n */\n isFileSupported(filePath: string): boolean;\n\n /**\n * sugar to create a Compiler task via the concrete compiler\n */\n createTask?(name?: string): BuildTask;\n\n /**\n * run before the build pipeline has started. this is useful when some preparation are needed to\n * be done on all envs before the build starts.\n */\n preBuild?(context: BuildContext): Promise<void>;\n\n /**\n * run after the build pipeline completed for all envs. useful for some cleanups\n */\n postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>;\n\n /**\n * returns the version of the current compiler instance (e.g. '4.0.1').\n */\n version(): string;\n\n /**\n * returns the display name of the current compiler instance (e.g. 'TypeScript')\n */\n displayName: string;\n}\n"],"mappings":";;;;;;IASYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA"}
|
|
1
|
+
{"version":3,"names":["CompilationInitiator","exports"],"sources":["types.ts"],"sourcesContent":["import { BuildContext, BuildTask, BuiltTaskResult, TaskResultsList } from '@teambit/builder';\nimport type { Component } from '@teambit/component';\nimport { ServiceHandler } from '@teambit/envs';\n\nexport type TranspileFileParams = {\n componentDir: string; // absolute path of the component's root directory\n filePath: string; // relative path of the file inside the component directory\n};\n\nexport enum CompilationInitiator {\n CmdReport,\n CmdJson,\n PreStart,\n PreWatch,\n Start,\n ComponentChanged,\n AspectLoadFail,\n ComponentAdded,\n Install,\n}\n\nexport type TranspileComponentParams = {\n component: Component;\n componentDir: string; // absolute path of the component's root directory\n outputDir: string; // absolute path of the component's output directory\n initiator: CompilationInitiator; // origin of the compilation's request\n};\n\nexport type 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 * no need to handle non-supported-files (e.g. assets) in this method because the compiler-aspect already copies them\n * into the compiler.dist in the preBuild stage.\n */\n build(context: BuildContext): Promise<BuiltTaskResult>;\n\n /**\n * return the dist dir of the compiled files (relative path from the component root dir)\n */\n getDistDir?(): string;\n\n /**\n * given a source file, return its parallel in the dists. e.g. \"index.ts\" => \"dist/index.js\"\n * both, the return path and the given path are relative paths.\n */\n getDistPathBySrcPath(srcPath: string): string;\n\n /**\n * given a component, returns the path to the source folder to use for the preview, uses the one\n * in node_modules by default\n */\n getPreviewComponentRootPath?(component: Component): string;\n\n /**\n * only supported files matching get compiled. others, are copied to the dist dir.\n */\n isFileSupported(filePath: string): boolean;\n\n /**\n * sugar to create a Compiler task via the concrete compiler\n */\n createTask?(name?: string): BuildTask;\n\n /**\n * run before the build pipeline has started. this is useful when some preparation are needed to\n * be done on all envs before the build starts.\n */\n preBuild?(context: BuildContext): Promise<void>;\n\n /**\n * run after the build pipeline completed for all envs. useful for some cleanups\n */\n postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>;\n\n /**\n * returns the version of the current compiler instance (e.g. '4.0.1').\n */\n version(): string;\n\n /**\n * returns the display name of the current compiler instance (e.g. 'TypeScript')\n */\n displayName: string;\n}\n"],"mappings":";;;;;;IASYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
|