@teambit/env 1.0.106 → 1.0.108

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,2 +1,2 @@
1
- import React from 'react';
2
- export declare const Logo: () => React.JSX.Element;
1
+ /// <reference types="react" />
2
+ export declare const Logo: () => JSX.Element;
@@ -9,7 +9,7 @@ export declare class EnvMain {
9
9
  * compose your own aspect environment.
10
10
  */
11
11
  compose(transformers?: EnvTransformer[], targetEnv?: Environment): Environment;
12
- static slots: never[];
12
+ static slots: any[];
13
13
  static dependencies: import("@teambit/harmony").Aspect[];
14
14
  static runtime: import("@teambit/harmony").RuntimeDefinition;
15
15
  static provider([aspectAspect, envs]: [AspectMain, EnvsMain]): Promise<EnvMain>;
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_env@1.0.106/dist/env.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_env@1.0.106/dist/env.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_env@1.0.108/dist/env.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_env@1.0.108/dist/env.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/env.aspect.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { Aspect } from '@teambit/harmony';
2
+
3
+ export const EnvAspect = Aspect.create({
4
+ id: 'teambit.envs/env',
5
+ });
package/env.env.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { AspectEnv } from '@teambit/aspect';
2
+ import { PackageJsonProps } from '@teambit/pkg';
3
+ import { COMPONENT_PREVIEW_STRATEGY_NAME, PreviewStrategyName } from '@teambit/preview';
4
+
5
+ export const EnvEnvType = 'env';
6
+
7
+ /**
8
+ * a component environment built for Envs.
9
+ */
10
+ export class EnvEnv {
11
+ constructor(private aspectEnv: AspectEnv) {}
12
+ // TODO: consider special icon for envs?
13
+ icon = 'https://static.bit.dev/extensions-icons/default.svg';
14
+
15
+ async __getDescriptor() {
16
+ return {
17
+ type: EnvEnvType,
18
+ };
19
+ }
20
+
21
+ getPackageJsonProps(): PackageJsonProps {
22
+ const packageJsonProps = this.aspectEnv.getPackageJsonProps();
23
+ delete packageJsonProps.exports;
24
+ return packageJsonProps;
25
+ }
26
+
27
+ getPreviewConfig() {
28
+ return {
29
+ strategyName: COMPONENT_PREVIEW_STRATEGY_NAME as PreviewStrategyName,
30
+ splitComponentBundle: false,
31
+ };
32
+ }
33
+ }
@@ -0,0 +1,28 @@
1
+ import AspectAspect, { AspectMain } from '@teambit/aspect';
2
+ import { MainRuntime } from '@teambit/cli';
3
+ import EnvsAspect, { Environment, EnvsMain, EnvTransformer } from '@teambit/envs';
4
+ import { EnvAspect } from './env.aspect';
5
+ import { EnvEnv } from './env.env';
6
+
7
+ export class EnvMain {
8
+ constructor(readonly envEnv: EnvEnv, private envs: EnvsMain) {}
9
+
10
+ /**
11
+ * compose your own aspect environment.
12
+ */
13
+ compose(transformers: EnvTransformer[] = [], targetEnv: Environment = {}) {
14
+ return this.envs.compose(this.envs.merge(targetEnv, this.envEnv), transformers);
15
+ }
16
+
17
+ static slots = [];
18
+ static dependencies = [AspectAspect, EnvsAspect];
19
+ static runtime = MainRuntime;
20
+ static async provider([aspectAspect, envs]: [AspectMain, EnvsMain]) {
21
+ const envEnv = aspectAspect.compose([], new EnvEnv(aspectAspect.aspectEnv));
22
+
23
+ envs.registerEnv(envEnv);
24
+ return new EnvMain(envEnv as EnvEnv, envs);
25
+ }
26
+ }
27
+
28
+ EnvAspect.addRuntime(EnvMain);
package/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { EnvAspect } from './env.aspect';
2
+
3
+ export type { EnvEnv } from './env.env';
4
+ export type { EnvMain } from './env.main.runtime';
5
+ export default EnvAspect;
6
+ export { EnvAspect };
package/package.json CHANGED
@@ -1,34 +1,31 @@
1
1
  {
2
2
  "name": "@teambit/env",
3
- "version": "1.0.106",
3
+ "version": "1.0.108",
4
4
  "homepage": "https://bit.cloud/teambit/envs/env",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.envs",
8
8
  "name": "env",
9
- "version": "1.0.106"
9
+ "version": "1.0.108"
10
10
  },
11
11
  "dependencies": {
12
- "core-js": "^3.0.0",
13
- "@babel/runtime": "7.20.0",
14
12
  "react": "^16.8.0 || ^17.0.0",
15
13
  "react-dom": "^16.8.0 || ^17.0.0",
16
14
  "@teambit/harmony": "0.4.6",
17
- "@teambit/aspect": "1.0.106",
18
- "@teambit/pkg": "1.0.106",
19
- "@teambit/preview": "1.0.106",
20
- "@teambit/cli": "0.0.839",
21
- "@teambit/envs": "1.0.106"
15
+ "@teambit/aspect": "1.0.108",
16
+ "@teambit/pkg": "1.0.108",
17
+ "@teambit/preview": "1.0.108",
18
+ "@teambit/cli": "0.0.840",
19
+ "@teambit/envs": "1.0.108"
22
20
  },
23
21
  "devDependencies": {
24
- "@types/react": "^17.0.8",
25
22
  "@types/mocha": "9.1.0",
26
- "@types/node": "12.20.4",
27
- "@types/react-dom": "^17.0.5",
28
- "@types/jest": "^26.0.0",
29
- "@types/testing-library__jest-dom": "5.9.5"
23
+ "@types/jest": "^29.2.2",
24
+ "@types/testing-library__jest-dom": "^5.9.5",
25
+ "@teambit/harmony.envs.core-aspect-env": "0.0.13"
30
26
  },
31
27
  "peerDependencies": {
28
+ "@types/react": "^18.2.12",
32
29
  "@teambit/legacy": "1.0.624"
33
30
  },
34
31
  "license": "Apache-2.0",
@@ -43,7 +40,7 @@
43
40
  },
44
41
  "private": false,
45
42
  "engines": {
46
- "node": ">=12.22.0"
43
+ "node": ">=16.0.0"
47
44
  },
48
45
  "repository": {
49
46
  "type": "git",
@@ -52,12 +49,9 @@
52
49
  "keywords": [
53
50
  "bit",
54
51
  "bit-aspect",
52
+ "bit-core-aspect",
55
53
  "components",
56
54
  "collaboration",
57
- "web",
58
- "react",
59
- "react-components",
60
- "angular",
61
- "angular-components"
55
+ "web"
62
56
  ]
63
57
  }
package/tsconfig.json CHANGED
@@ -1,38 +1,33 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "lib": [
4
- "es2019",
5
- "DOM",
6
- "ES6",
7
- "DOM.Iterable",
8
- "ScriptHost"
4
+ "esnext",
5
+ "dom",
6
+ "dom.Iterable"
9
7
  ],
10
- "target": "es2015",
11
- "module": "CommonJS",
12
- "jsx": "react",
13
- "allowJs": true,
14
- "composite": true,
8
+ "target": "es2020",
9
+ "module": "es2020",
10
+ "jsx": "react-jsx",
15
11
  "declaration": true,
16
12
  "sourceMap": true,
17
- "skipLibCheck": true,
18
13
  "experimentalDecorators": true,
19
- "outDir": "dist",
14
+ "skipLibCheck": true,
20
15
  "moduleResolution": "node",
21
16
  "esModuleInterop": true,
22
- "rootDir": ".",
23
17
  "resolveJsonModule": true,
24
- "emitDeclarationOnly": true,
25
- "emitDecoratorMetadata": true,
26
- "allowSyntheticDefaultImports": true,
27
- "strictPropertyInitialization": false,
28
- "strict": true,
29
- "noImplicitAny": false,
30
- "preserveConstEnums": true
18
+ "allowJs": true,
19
+ "outDir": "dist",
20
+ "emitDeclarationOnly": true
31
21
  },
32
22
  "exclude": [
23
+ "artifacts",
24
+ "public",
33
25
  "dist",
26
+ "node_modules",
27
+ "package.json",
34
28
  "esm.mjs",
35
- "package.json"
29
+ "**/*.cjs",
30
+ "./dist"
36
31
  ],
37
32
  "include": [
38
33
  "**/*",
package/types/asset.d.ts CHANGED
@@ -5,12 +5,12 @@ declare module '*.png' {
5
5
  declare module '*.svg' {
6
6
  import type { FunctionComponent, SVGProps } from 'react';
7
7
 
8
- export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
8
+ export const ReactComponent: FunctionComponent<
9
+ SVGProps<SVGSVGElement> & { title?: string }
10
+ >;
9
11
  const src: string;
10
12
  export default src;
11
13
  }
12
-
13
- // @TODO Gilad
14
14
  declare module '*.jpg' {
15
15
  const value: any;
16
16
  export = value;
@@ -27,3 +27,15 @@ declare module '*.bmp' {
27
27
  const value: any;
28
28
  export = value;
29
29
  }
30
+ declare module '*.otf' {
31
+ const value: any;
32
+ export = value;
33
+ }
34
+ declare module '*.woff' {
35
+ const value: any;
36
+ export = value;
37
+ }
38
+ declare module '*.woff2' {
39
+ const value: any;
40
+ export = value;
41
+ }