@teambit/compiler 0.0.945 → 0.0.946
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/compiler.service.tsx +14 -1
- package/dist/compiler.service.d.ts +7 -1
- package/dist/compiler.service.js +7 -0
- package/dist/compiler.service.js.map +1 -1
- package/dist/{preview-1672284308356.js → preview-1672331186584.js} +2 -2
- package/package-tar/teambit-compiler-0.0.946.tgz +0 -0
- package/package.json +13 -13
- package/package-tar/teambit-compiler-0.0.945.tgz +0 -0
package/compiler.service.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, Newline } from 'ink';
|
|
3
|
-
import { EnvService, EnvDefinition } from '@teambit/envs';
|
|
3
|
+
import { EnvService, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';
|
|
4
4
|
import highlight from 'cli-highlight';
|
|
5
|
+
import { Compiler } from './types';
|
|
5
6
|
|
|
6
7
|
export type CompilerDescriptor = {
|
|
7
8
|
id: string;
|
|
@@ -9,6 +10,10 @@ export type CompilerDescriptor = {
|
|
|
9
10
|
config?: string;
|
|
10
11
|
};
|
|
11
12
|
|
|
13
|
+
type CompilerTransformationMap = ServiceTransformationMap & {
|
|
14
|
+
getCompiler: () => Compiler;
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
export class CompilerService implements EnvService<{}, CompilerDescriptor> {
|
|
13
18
|
name = 'Compile';
|
|
14
19
|
|
|
@@ -32,6 +37,14 @@ export class CompilerService implements EnvService<{}, CompilerDescriptor> {
|
|
|
32
37
|
);
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
transform(env: Env, context: EnvContext): CompilerTransformationMap | undefined {
|
|
41
|
+
// Old env
|
|
42
|
+
if (!env?.compiler) return undefined;
|
|
43
|
+
return {
|
|
44
|
+
getCompiler: () => env.compiler()(context),
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
35
48
|
getDescriptor(env: EnvDefinition) {
|
|
36
49
|
if (!env.env.getCompiler) return undefined;
|
|
37
50
|
const compiler = env.env.getCompiler();
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { EnvService, EnvDefinition } from '@teambit/envs';
|
|
2
|
+
import { EnvService, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';
|
|
3
|
+
import { Compiler } from './types';
|
|
3
4
|
export declare type CompilerDescriptor = {
|
|
4
5
|
id: string;
|
|
5
6
|
icon?: string;
|
|
6
7
|
config?: string;
|
|
7
8
|
};
|
|
9
|
+
declare type CompilerTransformationMap = ServiceTransformationMap & {
|
|
10
|
+
getCompiler: () => Compiler;
|
|
11
|
+
};
|
|
8
12
|
export declare class CompilerService implements EnvService<{}, CompilerDescriptor> {
|
|
9
13
|
name: string;
|
|
10
14
|
render(env: EnvDefinition): JSX.Element;
|
|
15
|
+
transform(env: Env, context: EnvContext): CompilerTransformationMap | undefined;
|
|
11
16
|
getDescriptor(env: EnvDefinition): {
|
|
12
17
|
id: any;
|
|
13
18
|
icon: any;
|
|
@@ -16,3 +21,4 @@ export declare class CompilerService implements EnvService<{}, CompilerDescripto
|
|
|
16
21
|
displayName: any;
|
|
17
22
|
} | undefined;
|
|
18
23
|
}
|
|
24
|
+
export {};
|
package/dist/compiler.service.js
CHANGED
|
@@ -50,6 +50,13 @@ class CompilerService {
|
|
|
50
50
|
ignoreIllegals: true
|
|
51
51
|
})), /*#__PURE__*/_react().default.createElement(_ink().Newline, null));
|
|
52
52
|
}
|
|
53
|
+
transform(env, context) {
|
|
54
|
+
// Old env
|
|
55
|
+
if (!(env !== null && env !== void 0 && env.compiler)) return undefined;
|
|
56
|
+
return {
|
|
57
|
+
getCompiler: () => env.compiler()(context)
|
|
58
|
+
};
|
|
59
|
+
}
|
|
53
60
|
getDescriptor(env) {
|
|
54
61
|
if (!env.env.getCompiler) return undefined;
|
|
55
62
|
const compiler = env.env.getCompiler();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CompilerService","render","env","descriptor","getDescriptor","id","displayName","version","config","highlight","language","ignoreIllegals","
|
|
1
|
+
{"version":3,"names":["CompilerService","render","env","descriptor","getDescriptor","id","displayName","version","config","highlight","language","ignoreIllegals","transform","context","compiler","undefined","getCompiler","icon","displayConfig"],"sources":["compiler.service.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, Newline } from 'ink';\nimport { EnvService, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport highlight from 'cli-highlight';\nimport { Compiler } from './types';\n\nexport type CompilerDescriptor = {\n id: string;\n icon?: string;\n config?: string;\n};\n\ntype CompilerTransformationMap = ServiceTransformationMap & {\n getCompiler: () => Compiler;\n}\n\nexport class CompilerService implements EnvService<{}, CompilerDescriptor> {\n name = 'Compile';\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n\n return (\n <Text key={descriptor?.id}>\n <Text color=\"cyan\">configured compiler: </Text>\n <Text>\n {descriptor?.id} ({descriptor?.displayName} @ {descriptor?.version})\n </Text>\n <Newline />\n <Text color=\"cyan\">compiler config:</Text>\n <Newline />\n <Text>\n {descriptor?.config && highlight(descriptor?.config, { language: 'javascript', ignoreIllegals: true })}\n </Text>\n <Newline />\n </Text>\n );\n }\n\n transform(env: Env, context: EnvContext): CompilerTransformationMap | undefined {\n // Old env\n if (!env?.compiler) return undefined;\n return {\n getCompiler: () => env.compiler()(context),\n }\n }\n\n getDescriptor(env: EnvDefinition) {\n if (!env.env.getCompiler) return undefined;\n const compiler = env.env.getCompiler();\n\n return {\n id: compiler.id,\n icon: compiler.icon,\n config: compiler.displayConfig ? compiler.displayConfig() : undefined,\n version: compiler.version ? compiler.version() : '?',\n displayName: compiler.displayName ? compiler.displayName : '?',\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAA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AAOD,SAAS;IAC1C,MAAMD,QAAQ,GAAGZ,GAAG,CAACA,GAAG,CAACc,WAAW,EAAE;IAEtC,OAAO;MACLX,EAAE,EAAES,QAAQ,CAACT,EAAE;MACfY,IAAI,EAAEH,QAAQ,CAACG,IAAI;MACnBT,MAAM,EAAEM,QAAQ,CAACI,aAAa,GAAGJ,QAAQ,CAACI,aAAa,EAAE,GAAGH,SAAS;MACrER,OAAO,EAAEO,QAAQ,CAACP,OAAO,GAAGO,QAAQ,CAACP,OAAO,EAAE,GAAG,GAAG;MACpDD,WAAW,EAAEQ,QAAQ,CAACR,WAAW,GAAGQ,QAAQ,CAACR,WAAW,GAAG;IAC7D,CAAC;EACH;AACF;AAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@0.0.946/dist/compiler.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@0.0.946/dist/compiler.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/compiler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.946",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/compilation/compiler",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.compilation",
|
|
8
8
|
"name": "compiler",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.946"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -19,22 +19,22 @@
|
|
|
19
19
|
"core-js": "^3.0.0",
|
|
20
20
|
"@babel/runtime": "7.20.0",
|
|
21
21
|
"@teambit/harmony": "0.4.6",
|
|
22
|
-
"@teambit/envs": "0.0.
|
|
22
|
+
"@teambit/envs": "0.0.946",
|
|
23
23
|
"@teambit/cli": "0.0.633",
|
|
24
|
-
"@teambit/component": "0.0.
|
|
24
|
+
"@teambit/component": "0.0.946",
|
|
25
25
|
"@teambit/logger": "0.0.726",
|
|
26
|
-
"@teambit/pubsub": "0.0.
|
|
27
|
-
"@teambit/aspect-loader": "0.0.
|
|
28
|
-
"@teambit/builder": "0.0.
|
|
26
|
+
"@teambit/pubsub": "0.0.946",
|
|
27
|
+
"@teambit/aspect-loader": "0.0.946",
|
|
28
|
+
"@teambit/builder": "0.0.946",
|
|
29
29
|
"@teambit/component-issues": "0.0.84",
|
|
30
|
-
"@teambit/dependency-resolver": "0.0.
|
|
31
|
-
"@teambit/generator": "0.0.
|
|
30
|
+
"@teambit/dependency-resolver": "0.0.946",
|
|
31
|
+
"@teambit/generator": "0.0.946",
|
|
32
32
|
"@teambit/legacy-bit-id": "0.0.421",
|
|
33
|
-
"@teambit/ui": "0.0.
|
|
34
|
-
"@teambit/workspace": "0.0.
|
|
35
|
-
"@teambit/isolator": "0.0.
|
|
33
|
+
"@teambit/ui": "0.0.946",
|
|
34
|
+
"@teambit/workspace": "0.0.946",
|
|
35
|
+
"@teambit/isolator": "0.0.946",
|
|
36
36
|
"@teambit/toolbox.fs.hard-link-directory": "0.0.11",
|
|
37
|
-
"@teambit/multi-compiler": "0.0.
|
|
37
|
+
"@teambit/multi-compiler": "0.0.946",
|
|
38
38
|
"@teambit/bit-error": "0.0.402"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
Binary file
|