@teambit/babel 0.0.1113 → 0.0.1115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"names":["BabelAspect","Aspect","create","id"],"sources":["babel.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const BabelAspect = Aspect.create({\n id: 'teambit.compilation/babel',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,WAAW,GAAGC,iBAAM,CAACC,MAAM,CAAC;EACvCC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
1
+ {"version":3,"names":["_harmony","data","require","BabelAspect","Aspect","create","id","exports"],"sources":["babel.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const BabelAspect = Aspect.create({\n id: 'teambit.compilation/babel',\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,WAAW,GAAGC,iBAAM,CAACC,MAAM,CAAC;EACvCC,EAAE,EAAE;AACN,CAAC,CAAC;AAACC,OAAA,CAAAJ,WAAA,GAAAA,WAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["BabelCompiler","constructor","id","logger","compiler","options","babelModule","babel","distDir","distGlobPatterns","shouldCopyNonSupportedFiles","artifactName","supportedFilesGlobPatterns","flatten","version","getDistDir","transpileFile","fileContent","supportedExtensions","fileExtension","path","extname","filePath","includes","endsWith","transformOptions","babelTransformOptions","context","rootDir","componentDir","outputFiles","transpileFileContent","build","capsules","capsuleNetwork","seedersCapsules","componentsResults","longProcessLogger","createLongProcessLogger","length","mapSeries","capsule","currentComponentResult","errors","component","logProgress","toString","buildOneCapsule","push","artifacts","getArtifactDefinition","createTask","name","componentResult","startTime","Date","now","sourceFiles","filesystem","files","map","file","relative","fs","ensureDir","join","Promise","all","isFileSupported","absoluteFilePath","sourceFileName","basename","filename","result","transpileFilePathAsync","debug","distPath","replaceFileExtToJs","distPathMap","outputFile","outputText","err","endTime","generatedBy","globPatterns","getDistPathBySrcPath","srcPath","fileWithJSExtIfNeeded","multimatch","displayConfig","JSON","stringify"],"sources":["babel.compiler.ts"],"sourcesContent":["import * as babel from '@babel/core';\nimport multimatch from 'multimatch';\nimport { flatten } from 'lodash';\nimport mapSeries from 'p-map-series';\nimport fs from 'fs-extra';\nimport { BuildContext, BuiltTaskResult, ComponentResult } from '@teambit/builder';\nimport { Compiler, CompilerMain, TranspileFileParams, TranspileFileOutput } from '@teambit/compiler';\nimport { Capsule } from '@teambit/isolator';\nimport { Logger } from '@teambit/logger';\nimport path from 'path';\nimport {\n isFileSupported,\n transpileFileContent,\n transpileFilePathAsync,\n replaceFileExtToJs,\n TranspileContext,\n} from '@teambit/compilation.modules.babel-compiler';\nimport { BabelCompilerOptions } from './compiler-options';\n\nexport class BabelCompiler implements Compiler {\n distDir: string;\n distGlobPatterns: string[];\n shouldCopyNonSupportedFiles: boolean;\n artifactName: string;\n supportedFilesGlobPatterns: string[] | null;\n constructor(\n readonly id: string,\n private logger: Logger,\n private compiler: CompilerMain,\n private options: BabelCompilerOptions,\n private babelModule = babel\n ) {\n this.distDir = options.distDir || 'dist';\n this.distGlobPatterns = options.distGlobPatterns || [`${this.distDir}/**`, `!${this.distDir}/tsconfig.tsbuildinfo`];\n this.shouldCopyNonSupportedFiles =\n typeof options.shouldCopyNonSupportedFiles === 'boolean' ? options.shouldCopyNonSupportedFiles : true;\n this.artifactName = options.artifactName || 'dist';\n this.supportedFilesGlobPatterns = options.supportedFilesGlobPatterns\n ? flatten(options.supportedFilesGlobPatterns)\n : null;\n }\n\n displayName = 'Babel';\n deleteDistDir = false;\n\n version() {\n return this.babelModule.version;\n }\n\n getDistDir() {\n return this.distDir;\n }\n\n /**\n * compile one file on the workspace\n */\n transpileFile(fileContent: string, options: TranspileFileParams): TranspileFileOutput {\n const supportedExtensions = ['.ts', '.tsx', '.js', '.jsx'];\n const fileExtension = path.extname(options.filePath);\n if (!supportedExtensions.includes(fileExtension) || options.filePath.endsWith('.d.ts')) {\n return null; // file is not supported\n }\n const transformOptions = this.options.babelTransformOptions || {};\n const context: TranspileContext = {\n filePath: options.filePath,\n rootDir: options.componentDir,\n };\n const outputFiles = transpileFileContent(fileContent, context, transformOptions, this.babelModule);\n return outputFiles;\n }\n\n /**\n * compile multiple components on the capsules\n */\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const capsules = context.capsuleNetwork.seedersCapsules;\n const componentsResults: ComponentResult[] = [];\n const longProcessLogger = this.logger.createLongProcessLogger('compile babel components', capsules.length);\n await mapSeries(capsules, async (capsule) => {\n const currentComponentResult: ComponentResult = {\n errors: [],\n component: capsule.component,\n };\n longProcessLogger.logProgress(capsule.component.id.toString());\n await this.buildOneCapsule(capsule, currentComponentResult);\n componentsResults.push({ ...currentComponentResult });\n });\n\n return {\n artifacts: this.getArtifactDefinition(),\n componentsResults,\n };\n }\n\n createTask(name = 'BabelCompiler') {\n return this.compiler.createTask(name, this);\n }\n\n private async buildOneCapsule(capsule: Capsule, componentResult: ComponentResult) {\n componentResult.startTime = Date.now();\n const sourceFiles = capsule.component.filesystem.files.map((file) => file.relative);\n await fs.ensureDir(path.join(capsule.path, this.distDir));\n await Promise.all(\n sourceFiles.map(async (filePath) => {\n if (this.isFileSupported(filePath)) {\n const absoluteFilePath = path.join(capsule.path, filePath);\n this.options.babelTransformOptions ||= {};\n this.options.babelTransformOptions.sourceFileName = path.basename(filePath);\n this.options.babelTransformOptions.filename = path.basename(filePath);\n try {\n const result = await transpileFilePathAsync(\n absoluteFilePath,\n this.options.babelTransformOptions || {},\n this.babelModule\n );\n if (!result || !result.length) {\n this.logger.debug(\n `getting an empty response from Babel for the file ${filePath}. it might be configured to be ignored`\n );\n return;\n }\n // Make sure to get only the relative path of the dist because we want to add the dist dir.\n // If we use the result outputPath we will get an absolute path here\n const distPath = this.replaceFileExtToJs(filePath);\n const distPathMap = `${distPath}.map`;\n await fs.outputFile(path.join(capsule.path, this.distDir, distPath), result[0].outputText);\n if (result.length > 1) {\n await fs.outputFile(path.join(capsule.path, this.distDir, distPathMap), result[1].outputText);\n }\n } catch (err: any) {\n componentResult.errors?.push(err);\n }\n }\n })\n );\n componentResult.endTime = Date.now();\n }\n\n getArtifactDefinition() {\n return [\n {\n generatedBy: this.id,\n name: this.artifactName,\n globPatterns: this.distGlobPatterns,\n },\n ];\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. index.ts => dist/index.js\n */\n getDistPathBySrcPath(srcPath: string) {\n const fileWithJSExtIfNeeded = this.replaceFileExtToJs(srcPath);\n return path.join(this.distDir, fileWithJSExtIfNeeded);\n }\n\n /**\n * whether babel is able to compile the given path\n */\n isFileSupported(filePath: string): boolean {\n if (this.supportedFilesGlobPatterns) {\n return isFileSupported(filePath) && !!multimatch(filePath, this.supportedFilesGlobPatterns).length;\n }\n return isFileSupported(filePath);\n }\n\n displayConfig() {\n return JSON.stringify(this.options.babelTransformOptions || {}, null, 2);\n }\n\n private replaceFileExtToJs(filePath: string): string {\n if (!this.isFileSupported(filePath)) return filePath;\n return replaceFileExtToJs(filePath);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMqD;AAAA;AAAA;AAAA;AAG9C,MAAMA,aAAa,CAAqB;EAM7CC,WAAW,CACAC,EAAU,EACXC,MAAc,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;IACzC,IAAI,IAAI,CAACV,0BAA0B,EAAE;MACnC,OAAO,IAAAwD,qCAAe,EAAC9C,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAAkE,qBAAU,EAAClE,QAAQ,EAAE,IAAI,CAACV,0BAA0B,CAAC,CAAC2B,MAAM;IACpG;IACA,OAAO,IAAA6B,qCAAe,EAAC9C,QAAQ,CAAC;EAClC;EAEAmE,aAAa,GAAG;IACd,OAAOC,IAAI,CAACC,SAAS,CAAC,IAAI,CAACtF,OAAO,CAACqB,qBAAqB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;EAC1E;EAEQmD,kBAAkB,CAACvD,QAAgB,EAAU;IACnD,IAAI,CAAC,IAAI,CAAC8C,eAAe,CAAC9C,QAAQ,CAAC,EAAE,OAAOA,QAAQ;IACpD,OAAO,IAAAuD,wCAAkB,EAACvD,QAAQ,CAAC;EACrC;AACF;AAAC"}
1
+ {"version":3,"names":["babel","data","_interopRequireWildcard","require","_multimatch","_interopRequireDefault","_lodash","_pMapSeries","_fsExtra","_path","_compilationModules","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","BabelCompiler","constructor","id","logger","compiler","options","babelModule","distDir","distGlobPatterns","shouldCopyNonSupportedFiles","artifactName","supportedFilesGlobPatterns","flatten","version","getDistDir","transpileFile","fileContent","supportedExtensions","fileExtension","path","extname","filePath","includes","endsWith","transformOptions","babelTransformOptions","context","rootDir","componentDir","outputFiles","transpileFileContent","build","capsules","capsuleNetwork","seedersCapsules","componentsResults","longProcessLogger","createLongProcessLogger","mapSeries","capsule","currentComponentResult","errors","component","logProgress","toString","buildOneCapsule","artifacts","getArtifactDefinition","createTask","name","componentResult","startTime","Date","now","sourceFiles","filesystem","files","map","file","relative","fs","ensureDir","join","Promise","all","isFileSupported","_this$options","absoluteFilePath","sourceFileName","basename","filename","result","transpileFilePathAsync","debug","distPath","replaceFileExtToJs","distPathMap","outputFile","outputText","err","_componentResult$erro","endTime","generatedBy","globPatterns","getDistPathBySrcPath","srcPath","fileWithJSExtIfNeeded","multimatch","displayConfig","JSON","stringify","exports"],"sources":["babel.compiler.ts"],"sourcesContent":["import * as babel from '@babel/core';\nimport multimatch from 'multimatch';\nimport { flatten } from 'lodash';\nimport mapSeries from 'p-map-series';\nimport fs from 'fs-extra';\nimport { BuildContext, BuiltTaskResult, ComponentResult } from '@teambit/builder';\nimport { Compiler, CompilerMain, TranspileFileParams, TranspileFileOutput } from '@teambit/compiler';\nimport { Capsule } from '@teambit/isolator';\nimport { Logger } from '@teambit/logger';\nimport path from 'path';\nimport {\n isFileSupported,\n transpileFileContent,\n transpileFilePathAsync,\n replaceFileExtToJs,\n TranspileContext,\n} from '@teambit/compilation.modules.babel-compiler';\nimport { BabelCompilerOptions } from './compiler-options';\n\nexport class BabelCompiler implements Compiler {\n distDir: string;\n distGlobPatterns: string[];\n shouldCopyNonSupportedFiles: boolean;\n artifactName: string;\n supportedFilesGlobPatterns: string[] | null;\n constructor(\n readonly id: string,\n private logger: Logger,\n private compiler: CompilerMain,\n private options: BabelCompilerOptions,\n private babelModule = babel\n ) {\n this.distDir = options.distDir || 'dist';\n this.distGlobPatterns = options.distGlobPatterns || [`${this.distDir}/**`, `!${this.distDir}/tsconfig.tsbuildinfo`];\n this.shouldCopyNonSupportedFiles =\n typeof options.shouldCopyNonSupportedFiles === 'boolean' ? options.shouldCopyNonSupportedFiles : true;\n this.artifactName = options.artifactName || 'dist';\n this.supportedFilesGlobPatterns = options.supportedFilesGlobPatterns\n ? flatten(options.supportedFilesGlobPatterns)\n : null;\n }\n\n displayName = 'Babel';\n deleteDistDir = false;\n\n version() {\n return this.babelModule.version;\n }\n\n getDistDir() {\n return this.distDir;\n }\n\n /**\n * compile one file on the workspace\n */\n transpileFile(fileContent: string, options: TranspileFileParams): TranspileFileOutput {\n const supportedExtensions = ['.ts', '.tsx', '.js', '.jsx'];\n const fileExtension = path.extname(options.filePath);\n if (!supportedExtensions.includes(fileExtension) || options.filePath.endsWith('.d.ts')) {\n return null; // file is not supported\n }\n const transformOptions = this.options.babelTransformOptions || {};\n const context: TranspileContext = {\n filePath: options.filePath,\n rootDir: options.componentDir,\n };\n const outputFiles = transpileFileContent(fileContent, context, transformOptions, this.babelModule);\n return outputFiles;\n }\n\n /**\n * compile multiple components on the capsules\n */\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const capsules = context.capsuleNetwork.seedersCapsules;\n const componentsResults: ComponentResult[] = [];\n const longProcessLogger = this.logger.createLongProcessLogger('compile babel components', capsules.length);\n await mapSeries(capsules, async (capsule) => {\n const currentComponentResult: ComponentResult = {\n errors: [],\n component: capsule.component,\n };\n longProcessLogger.logProgress(capsule.component.id.toString());\n await this.buildOneCapsule(capsule, currentComponentResult);\n componentsResults.push({ ...currentComponentResult });\n });\n\n return {\n artifacts: this.getArtifactDefinition(),\n componentsResults,\n };\n }\n\n createTask(name = 'BabelCompiler') {\n return this.compiler.createTask(name, this);\n }\n\n private async buildOneCapsule(capsule: Capsule, componentResult: ComponentResult) {\n componentResult.startTime = Date.now();\n const sourceFiles = capsule.component.filesystem.files.map((file) => file.relative);\n await fs.ensureDir(path.join(capsule.path, this.distDir));\n await Promise.all(\n sourceFiles.map(async (filePath) => {\n if (this.isFileSupported(filePath)) {\n const absoluteFilePath = path.join(capsule.path, filePath);\n this.options.babelTransformOptions ||= {};\n this.options.babelTransformOptions.sourceFileName = path.basename(filePath);\n this.options.babelTransformOptions.filename = path.basename(filePath);\n try {\n const result = await transpileFilePathAsync(\n absoluteFilePath,\n this.options.babelTransformOptions || {},\n this.babelModule\n );\n if (!result || !result.length) {\n this.logger.debug(\n `getting an empty response from Babel for the file ${filePath}. it might be configured to be ignored`\n );\n return;\n }\n // Make sure to get only the relative path of the dist because we want to add the dist dir.\n // If we use the result outputPath we will get an absolute path here\n const distPath = this.replaceFileExtToJs(filePath);\n const distPathMap = `${distPath}.map`;\n await fs.outputFile(path.join(capsule.path, this.distDir, distPath), result[0].outputText);\n if (result.length > 1) {\n await fs.outputFile(path.join(capsule.path, this.distDir, distPathMap), result[1].outputText);\n }\n } catch (err: any) {\n componentResult.errors?.push(err);\n }\n }\n })\n );\n componentResult.endTime = Date.now();\n }\n\n getArtifactDefinition() {\n return [\n {\n generatedBy: this.id,\n name: this.artifactName,\n globPatterns: this.distGlobPatterns,\n },\n ];\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. index.ts => dist/index.js\n */\n getDistPathBySrcPath(srcPath: string) {\n const fileWithJSExtIfNeeded = this.replaceFileExtToJs(srcPath);\n return path.join(this.distDir, fileWithJSExtIfNeeded);\n }\n\n /**\n * whether babel is able to compile the given path\n */\n isFileSupported(filePath: string): boolean {\n if (this.supportedFilesGlobPatterns) {\n return isFileSupported(filePath) && !!multimatch(filePath, this.supportedFilesGlobPatterns).length;\n }\n return isFileSupported(filePath);\n }\n\n displayConfig() {\n return JSON.stringify(this.options.babelTransformOptions || {}, null, 2);\n }\n\n private replaceFileExtToJs(filePath: string): string {\n if (!this.isFileSupported(filePath)) return filePath;\n return replaceFileExtToJs(filePath);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;E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AAC,IAAI,CAAC4C,eAAe,CAAC5C,QAAQ,CAAC,EAAE,OAAOA,QAAQ;IACpD,OAAO,IAAAsD,wCAAkB,EAACtD,QAAQ,CAAC;EACrC;AACF;AAACsE,OAAA,CAAA3F,aAAA,GAAAA,aAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["babel.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/babel.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAG,CAAE;EAAC,GAAG,EAAC;AAAmD,EAAG,CAExF;AAAC"}
1
+ {"version":3,"names":["_react","data","_interopRequireDefault","require","Logo","default","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["babel.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/babel.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;AAEO,MAAMG,IAAI,GAAGA,CAAA,kBAClBJ,MAAA,GAAAK,OAAA,CAAAC,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEV,MAAA,GAAAK,OAAA,CAAAC,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAmD,CAAE,CACjF,CACN;AAACC,OAAA,CAAAT,IAAA,GAAAA,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["BabelMain","constructor","logger","compiler","createCompiler","options","babelModule","babel","BabelCompiler","BabelAspect","id","getPackageJsonProps","main","provider","loggerExt","createLogger","MainRuntime","LoggerAspect","CompilerAspect","addRuntime"],"sources":["babel.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport * as babel from '@babel/core';\nimport { BabelCompilerOptions } from './compiler-options';\nimport { BabelAspect } from './babel.aspect';\nimport { BabelCompiler } from './babel.compiler';\n\nexport class BabelMain {\n constructor(private logger: Logger, private compiler: CompilerMain) {}\n\n createCompiler(options: BabelCompilerOptions, babelModule = babel): BabelCompiler {\n return new BabelCompiler(BabelAspect.id, this.logger, this.compiler, options, babelModule);\n }\n\n getPackageJsonProps() {\n return {\n main: 'dist/{main}.js',\n };\n }\n\n static runtime = MainRuntime;\n static dependencies = [LoggerAspect, CompilerAspect];\n\n static async provider([loggerExt, compiler]: [LoggerMain, CompilerMain]) {\n const logger = loggerExt.createLogger(BabelAspect.id);\n return new BabelMain(logger, compiler);\n }\n}\n\nBabelAspect.addRuntime(BabelMain);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAiD;AAAA;AAE1C,MAAMA,SAAS,CAAC;EACrBC,WAAW,CAASC,MAAc,EAAUC,QAAsB,EAAE;IAAA,KAAhDD,MAAc,GAAdA,MAAc;IAAA,KAAUC,QAAsB,GAAtBA,QAAsB;EAAG;EAErEC,cAAc,CAACC,OAA6B,EAAEC,WAAW,GAAGC,KAAK,IAAiB;IAChF,OAAO,KAAIC,uBAAa,EAACC,oBAAW,CAACC,EAAE,EAAE,IAAI,CAACR,MAAM,EAAE,IAAI,CAACC,QAAQ,EAAEE,OAAO,EAAEC,WAAW,CAAC;EAC5F;EAEAK,mBAAmB,GAAG;IACpB,OAAO;MACLC,IAAI,EAAE;IACR,CAAC;EACH;EAKA,aAAaC,QAAQ,CAAC,CAACC,SAAS,EAAEX,QAAQ,CAA6B,EAAE;IACvE,MAAMD,MAAM,GAAGY,SAAS,CAACC,YAAY,CAACN,oBAAW,CAACC,EAAE,CAAC;IACrD,OAAO,IAAIV,SAAS,CAACE,MAAM,EAAEC,QAAQ,CAAC;EACxC;AACF;AAAC;AAAA,gCApBYH,SAAS,aAaHgB,kBAAW;AAAA,gCAbjBhB,SAAS,kBAcE,CAACiB,sBAAY,EAAEC,0BAAc,CAAC;AAQtDT,oBAAW,CAACU,UAAU,CAACnB,SAAS,CAAC"}
1
+ {"version":3,"names":["_cli","data","require","_compiler","_logger","babel","_interopRequireWildcard","_babel","_babel2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","BabelMain","constructor","logger","compiler","createCompiler","options","babelModule","BabelCompiler","BabelAspect","id","getPackageJsonProps","main","provider","loggerExt","createLogger","exports","_defineProperty2","MainRuntime","LoggerAspect","CompilerAspect","addRuntime"],"sources":["babel.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport * as babel from '@babel/core';\nimport { BabelCompilerOptions } from './compiler-options';\nimport { BabelAspect } from './babel.aspect';\nimport { BabelCompiler } from './babel.compiler';\n\nexport class BabelMain {\n constructor(private logger: Logger, private compiler: CompilerMain) {}\n\n createCompiler(options: BabelCompilerOptions, babelModule = babel): BabelCompiler {\n return new BabelCompiler(BabelAspect.id, this.logger, this.compiler, options, babelModule);\n }\n\n getPackageJsonProps() {\n return {\n main: 'dist/{main}.js',\n };\n }\n\n static runtime = MainRuntime;\n static dependencies = [LoggerAspect, CompilerAspect];\n\n static async provider([loggerExt, compiler]: [LoggerMain, CompilerMain]) {\n const logger = loggerExt.createLogger(BabelAspect.id);\n return new BabelMain(logger, compiler);\n }\n}\n\nBabelAspect.addRuntime(BabelMain);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAK,uBAAA,CAAAJ,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,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;AACA,SAAAO,QAAA;E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ACrBC,WAAWA,CAASC,MAAc,EAAUC,QAAsB,EAAE;IAAA,KAAhDD,MAAc,GAAdA,MAAc;IAAA,KAAUC,QAAsB,GAAtBA,QAAsB;EAAG;EAErEC,cAAcA,CAACC,OAA6B,EAAEC,WAAW,GAAGhC,KAAK,CAAD,CAAC,EAAiB;IAChF,OAAO,KAAIiC,uBAAa,EAACC,oBAAW,CAACC,EAAE,EAAE,IAAI,CAACP,MAAM,EAAE,IAAI,CAACC,QAAQ,EAAEE,OAAO,EAAEC,WAAW,CAAC;EAC5F;EAEAI,mBAAmBA,CAAA,EAAG;IACpB,OAAO;MACLC,IAAI,EAAE;IACR,CAAC;EACH;EAKA,aAAaC,QAAQA,CAAC,CAACC,SAAS,EAAEV,QAAQ,CAA6B,EAAE;IACvE,MAAMD,MAAM,GAAGW,SAAS,CAACC,YAAY,CAACN,oBAAW,CAACC,EAAE,CAAC;IACrD,OAAO,IAAIT,SAAS,CAACE,MAAM,EAAEC,QAAQ,CAAC;EACxC;AACF;AAACY,OAAA,CAAAf,SAAA,GAAAA,SAAA;AAAA,IAAAgB,gBAAA,GAAA/B,OAAA,EApBYe,SAAS,aAaHiB,kBAAW;AAAA,IAAAD,gBAAA,GAAA/B,OAAA,EAbjBe,SAAS,kBAcE,CAACkB,sBAAY,EAAEC,0BAAc,CAAC;AAQtDX,oBAAW,CAACY,UAAU,CAACpB,SAAS,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { BabelCompiler } from './babel.compiler';\nexport type { BabelMain } from './babel.main.runtime';\nexport { BabelAspect } from './babel.aspect';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
1
+ {"version":3,"names":["_babel","data","require","_babel2"],"sources":["index.ts"],"sourcesContent":["export { BabelCompiler } from './babel.compiler';\nexport type { BabelMain } from './babel.main.runtime';\nexport { BabelAspect } from './babel.aspect';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_babel@0.0.1113/dist/babel.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_babel@0.0.1113/dist/babel.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_babel@0.0.1115/dist/babel.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_babel@0.0.1115/dist/babel.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/babel",
3
- "version": "0.0.1113",
3
+ "version": "0.0.1115",
4
4
  "homepage": "https://bit.cloud/teambit/compilation/babel",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.compilation",
8
8
  "name": "babel",
9
- "version": "0.0.1113"
9
+ "version": "0.0.1115"
10
10
  },
11
11
  "dependencies": {
12
12
  "@babel/core": "7.19.6",
@@ -17,12 +17,12 @@
17
17
  "core-js": "^3.0.0",
18
18
  "@babel/runtime": "7.20.0",
19
19
  "@teambit/harmony": "0.4.6",
20
- "@teambit/builder": "0.0.1113",
20
+ "@teambit/builder": "0.0.1115",
21
21
  "@teambit/compilation.modules.babel-compiler": "0.0.133",
22
- "@teambit/compiler": "0.0.1113",
23
- "@teambit/isolator": "0.0.1113",
24
- "@teambit/logger": "0.0.838",
25
- "@teambit/cli": "0.0.745"
22
+ "@teambit/compiler": "0.0.1115",
23
+ "@teambit/isolator": "0.0.1115",
24
+ "@teambit/logger": "0.0.840",
25
+ "@teambit/cli": "0.0.747"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/fs-extra": "9.0.7",
@@ -36,7 +36,7 @@
36
36
  "@teambit/compilation.aspect-docs.babel": "0.0.154"
37
37
  },
38
38
  "peerDependencies": {
39
- "@teambit/legacy": "1.0.525",
39
+ "@teambit/legacy": "1.0.526",
40
40
  "react": "^16.8.0 || ^17.0.0",
41
41
  "react-dom": "^16.8.0 || ^17.0.0"
42
42
  },