@teambit/babel 1.0.228 → 1.0.229
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_babel-preview.js +1 -1
- package/artifacts/schema.json +45 -11
- package/dist/babel.aspect.d.ts +2 -0
- package/dist/babel.composition.d.ts +1 -0
- package/dist/babel.main.runtime.d.ts +17 -0
- package/dist/compiler-options.d.ts +20 -0
- package/dist/index.d.ts +3 -0
- package/dist/{preview-1712805335812.js → preview-1712822929999.js} +2 -2
- package/package.json +6 -6
- package/tsconfig.json +1 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="0" failures="0" errors="0" skipped="0">
|
|
3
|
-
<testsuite name="teambit.compilation/babel@1.0.
|
|
3
|
+
<testsuite name="teambit.compilation/babel@1.0.229" tests="0" failures="0" errors="0" skipped="0"/>
|
|
4
4
|
</testsuites>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.compilation/babel-preview"]=t():e["teambit.compilation/babel-preview"]=t()}(self,(()=>(()=>{"use strict";var e={
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.compilation/babel-preview"]=t():e["teambit.compilation/babel-preview"]=t()}(self,(()=>(()=>{"use strict";var e={25777:(e,t,o)=>{var n={id:"teambit.compilation/aspect-docs/babel@0.0.168",homepage:"https://bit.cloud/teambit/compilation/aspect-docs/babel",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=b,a(o(41594));var r=o(5016),i=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},p.apply(this,arguments)}function l(e,t){if(null==e)return{};var o,n,r=s(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function s(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}a.__bit_component=n,p.__bit_component=n,l.__bit_component=n,s.__bit_component=n;var c={},m="wrapper";function b(e){var t=e.components,o=l(e,i);return(0,r.mdx)(m,p({},c,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("p",null,"This compiler utilizes the programmatic API of Babel to transpile files. See the compiler-options.ts for more data how to pass Babel options to the compiler."),(0,r.mdx)("p",null,"Note that to isolate the components from different Babel config files on the machine, the following two props are set to false (if they weren't passed in the options): ",(0,r.mdx)("inlineCode",{parentName:"p"},"configFile")," and ",(0,r.mdx)("inlineCode",{parentName:"p"},"babelrc"),"."),(0,r.mdx)("h2",null,"FAQ"),(0,r.mdx)("p",null,(0,r.mdx)("em",{parentName:"p"},"Q"),": I'm getting an error about missing plugins."),(0,r.mdx)("p",null,(0,r.mdx)("em",{parentName:"p"},"A"),": make sure that workspace.jsonc has the plugins and that you ran ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit install"),".\nExample of the workspace.jsonc settings:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},'"my-babel-env": {\n "teambit.bit/aspect": {},\n "teambit.bit/dependency-resolver": {\n "policy": {\n "dependencies": {\n "@babel/core": "7.11.6",\n "@babel/preset-react": "7.22.15",\n "@babel/preset-env": "7.22.15",\n "@babel/preset-typescript": "7.22.15",\n "@babel/plugin-transform-class-properties": "7.22.5"\n }\n }\n }\n },\n')),(0,r.mdx)("ol",{start:2},(0,r.mdx)("li",{parentName:"ol"},"You're not using the plugin.\nThe reason for the error is that Babel searches for config files in different directories. To disable this, add the following to the config you pass to the compiler:")),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},'{\n ...\n "babelrc": false,\n "configFile": false,\n}\n')),(0,r.mdx)("p",null,"this takes care of both .babelrc and babel.config.json."))}b.__bit_component=n,b.isMDXComponent=!0},96956:(e,t,o)=>{Object.defineProperty(t,"n",{enumerable:!0,get:function(){return n.default}});var n=r(o(25777));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.compilation/aspect-docs/babel@0.0.168",homepage:"https://bit.cloud/teambit/compilation/aspect-docs/babel",exported:!0}},52446:(e,t,o)=>{var n={id:"teambit.compilation/babel@1.0.229",homepage:"https://bit.cloud/teambit/compilation/babel",exported:!0};function r(){const e=i(o(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=n,i.__bit_component=n;const a=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/babel.svg"}));a.__bit_component=n,t.Logo=a},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{compositions:()=>b,compositions_metadata:()=>u,overview:()=>d});var e={};o.r(e),o.d(e,{default:()=>m});var t=o(52446),r=(o(41594),o(5016));const i=TeambitMdxUiMdxScopeContext;var a=o(96956),p=["components"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},l.apply(this,arguments)}var s={},c="wrapper";function m(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,p);return(0,r.mdx)(c,l({},s,o,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{Babel:a.n},mdxType:"MDXScopeProvider"},(0,r.mdx)(a.n,{mdxType:"Babel"})))}m.isMDXComponent=!0;const b=[t],d=[e],u={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -62,7 +62,11 @@
|
|
|
62
62
|
"line": 10,
|
|
63
63
|
"character": 31
|
|
64
64
|
},
|
|
65
|
-
"name": "Logger"
|
|
65
|
+
"name": "Logger",
|
|
66
|
+
"componentId": {
|
|
67
|
+
"scope": "teambit.harmony",
|
|
68
|
+
"name": "logger"
|
|
69
|
+
}
|
|
66
70
|
},
|
|
67
71
|
"isOptional": false,
|
|
68
72
|
"isSpread": false
|
|
@@ -82,7 +86,11 @@
|
|
|
82
86
|
"line": 10,
|
|
83
87
|
"character": 57
|
|
84
88
|
},
|
|
85
|
-
"name": "CompilerMain"
|
|
89
|
+
"name": "CompilerMain",
|
|
90
|
+
"componentId": {
|
|
91
|
+
"scope": "teambit.compilation",
|
|
92
|
+
"name": "compiler"
|
|
93
|
+
}
|
|
86
94
|
},
|
|
87
95
|
"isOptional": false,
|
|
88
96
|
"isSpread": false
|
|
@@ -124,7 +132,8 @@
|
|
|
124
132
|
"line": 12,
|
|
125
133
|
"character": 27
|
|
126
134
|
},
|
|
127
|
-
"name": "BabelCompilerOptions"
|
|
135
|
+
"name": "BabelCompilerOptions",
|
|
136
|
+
"internalFilePath": "compiler-options.ts"
|
|
128
137
|
},
|
|
129
138
|
"isOptional": false,
|
|
130
139
|
"isSpread": false
|
|
@@ -263,7 +272,11 @@
|
|
|
263
272
|
"line": 25,
|
|
264
273
|
"character": 49
|
|
265
274
|
},
|
|
266
|
-
"name": "LoggerMain"
|
|
275
|
+
"name": "LoggerMain",
|
|
276
|
+
"componentId": {
|
|
277
|
+
"scope": "teambit.harmony",
|
|
278
|
+
"name": "logger"
|
|
279
|
+
}
|
|
267
280
|
},
|
|
268
281
|
{
|
|
269
282
|
"__schema": "TypeRefSchema",
|
|
@@ -272,7 +285,11 @@
|
|
|
272
285
|
"line": 25,
|
|
273
286
|
"character": 61
|
|
274
287
|
},
|
|
275
|
-
"name": "CompilerMain"
|
|
288
|
+
"name": "CompilerMain",
|
|
289
|
+
"componentId": {
|
|
290
|
+
"scope": "teambit.compilation",
|
|
291
|
+
"name": "compiler"
|
|
292
|
+
}
|
|
276
293
|
}
|
|
277
294
|
]
|
|
278
295
|
},
|
|
@@ -371,7 +388,11 @@
|
|
|
371
388
|
"line": 10,
|
|
372
389
|
"character": 31
|
|
373
390
|
},
|
|
374
|
-
"name": "Logger"
|
|
391
|
+
"name": "Logger",
|
|
392
|
+
"componentId": {
|
|
393
|
+
"scope": "teambit.harmony",
|
|
394
|
+
"name": "logger"
|
|
395
|
+
}
|
|
375
396
|
},
|
|
376
397
|
"isOptional": false,
|
|
377
398
|
"isSpread": false
|
|
@@ -391,7 +412,11 @@
|
|
|
391
412
|
"line": 10,
|
|
392
413
|
"character": 57
|
|
393
414
|
},
|
|
394
|
-
"name": "CompilerMain"
|
|
415
|
+
"name": "CompilerMain",
|
|
416
|
+
"componentId": {
|
|
417
|
+
"scope": "teambit.compilation",
|
|
418
|
+
"name": "compiler"
|
|
419
|
+
}
|
|
395
420
|
},
|
|
396
421
|
"isOptional": false,
|
|
397
422
|
"isSpread": false
|
|
@@ -433,7 +458,8 @@
|
|
|
433
458
|
"line": 12,
|
|
434
459
|
"character": 27
|
|
435
460
|
},
|
|
436
|
-
"name": "BabelCompilerOptions"
|
|
461
|
+
"name": "BabelCompilerOptions",
|
|
462
|
+
"internalFilePath": "compiler-options.ts"
|
|
437
463
|
},
|
|
438
464
|
"isOptional": false,
|
|
439
465
|
"isSpread": false
|
|
@@ -572,7 +598,11 @@
|
|
|
572
598
|
"line": 25,
|
|
573
599
|
"character": 49
|
|
574
600
|
},
|
|
575
|
-
"name": "LoggerMain"
|
|
601
|
+
"name": "LoggerMain",
|
|
602
|
+
"componentId": {
|
|
603
|
+
"scope": "teambit.harmony",
|
|
604
|
+
"name": "logger"
|
|
605
|
+
}
|
|
576
606
|
},
|
|
577
607
|
{
|
|
578
608
|
"__schema": "TypeRefSchema",
|
|
@@ -581,7 +611,11 @@
|
|
|
581
611
|
"line": 25,
|
|
582
612
|
"character": 61
|
|
583
613
|
},
|
|
584
|
-
"name": "CompilerMain"
|
|
614
|
+
"name": "CompilerMain",
|
|
615
|
+
"componentId": {
|
|
616
|
+
"scope": "teambit.compilation",
|
|
617
|
+
"name": "compiler"
|
|
618
|
+
}
|
|
585
619
|
}
|
|
586
620
|
]
|
|
587
621
|
},
|
|
@@ -662,7 +696,7 @@
|
|
|
662
696
|
"componentId": {
|
|
663
697
|
"scope": "teambit.compilation",
|
|
664
698
|
"name": "babel",
|
|
665
|
-
"version": "1.0.
|
|
699
|
+
"version": "1.0.229"
|
|
666
700
|
},
|
|
667
701
|
"taggedModuleExports": []
|
|
668
702
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Logo: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CompilerMain } from '@teambit/compiler';
|
|
2
|
+
import { Logger, LoggerMain } from '@teambit/logger';
|
|
3
|
+
import { BabelCompiler } from '@teambit/compilation.babel-compiler';
|
|
4
|
+
import * as babel from '@babel/core';
|
|
5
|
+
import { BabelCompilerOptions } from './compiler-options';
|
|
6
|
+
export declare class BabelMain {
|
|
7
|
+
private logger;
|
|
8
|
+
private compiler;
|
|
9
|
+
constructor(logger: Logger, compiler: CompilerMain);
|
|
10
|
+
createCompiler(options: BabelCompilerOptions, babelModule?: typeof babel): BabelCompiler;
|
|
11
|
+
getPackageJsonProps(): {
|
|
12
|
+
main: string;
|
|
13
|
+
};
|
|
14
|
+
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
15
|
+
static dependencies: import("@teambit/harmony").Aspect[];
|
|
16
|
+
static provider([loggerExt, compiler]: [LoggerMain, CompilerMain]): Promise<BabelMain>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TransformOptions } from '@babel/core';
|
|
2
|
+
import { CompilerOptions } from '@teambit/compiler';
|
|
3
|
+
export type BabelCompilerOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* TransformOptions of Babel. @see https://babeljs.io/docs/en/options
|
|
6
|
+
*
|
|
7
|
+
* `babel.config.json` and `.babelrc.json` use the same options, so you can require the json file
|
|
8
|
+
* and pass it as the option parameter. e.g.
|
|
9
|
+
* ```
|
|
10
|
+
* createCompiler({ babelTransformOptions: require('./babel.config.json') });
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
babelTransformOptions?: TransformOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Determines which files should be compiled by the Babel compiler.
|
|
16
|
+
* It only works with the file types supported by Babel (.ts, .tsx, .js, .jsx, .d.ts).
|
|
17
|
+
* See https://github.com/mrmlnc/fast-glob for the supported glob patters syntax.
|
|
18
|
+
*/
|
|
19
|
+
supportedFilesGlobPatterns?: string[];
|
|
20
|
+
} & Partial<CompilerOptions>;
|
package/dist/index.d.ts
ADDED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_babel@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_babel@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_babel@1.0.229/dist/babel.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_babel@1.0.229/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,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/babel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.229",
|
|
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": "1.0.
|
|
9
|
+
"version": "1.0.229"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@babel/core": "7.19.6",
|
|
13
13
|
"@teambit/harmony": "0.4.6",
|
|
14
14
|
"@teambit/compilation.babel-compiler": "1.1.8",
|
|
15
|
-
"@teambit/cli": "0.0.
|
|
16
|
-
"@teambit/compiler": "1.0.
|
|
17
|
-
"@teambit/logger": "0.0.
|
|
15
|
+
"@teambit/cli": "0.0.862",
|
|
16
|
+
"@teambit/compiler": "1.0.229",
|
|
17
|
+
"@teambit/logger": "0.0.955"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/mocha": "9.1.0",
|
|
21
21
|
"chai": "4.3.0",
|
|
22
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
|
22
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.33",
|
|
23
23
|
"@teambit/compilation.aspect-docs.babel": "0.0.168"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
package/tsconfig.json
CHANGED
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
"emitDeclarationOnly": true,
|
|
21
21
|
"strict": true,
|
|
22
22
|
"strictPropertyInitialization": false,
|
|
23
|
-
"noImplicitAny": false
|
|
24
|
-
"composite": true
|
|
23
|
+
"noImplicitAny": false
|
|
25
24
|
},
|
|
26
25
|
"exclude": [
|
|
27
26
|
"artifacts",
|
|
@@ -36,16 +35,5 @@
|
|
|
36
35
|
"include": [
|
|
37
36
|
"**/*",
|
|
38
37
|
"**/*.json"
|
|
39
|
-
],
|
|
40
|
-
"references": [
|
|
41
|
-
{
|
|
42
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_cli@0.0.861"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@1.0.228"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_logger@0.0.954"
|
|
49
|
-
}
|
|
50
38
|
]
|
|
51
39
|
}
|