@teambit/react 0.0.828 → 0.0.831
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 +2 -2
- package/artifacts/env-template/public/{22.513e68a5af8f5a59a0a2.js → 22.0f657f2dfdd8e90d81ba.js} +1 -1
- package/artifacts/env-template/public/{512.ae71a211e88821392ca0.js → 241.b535afdd0eee34476c19.js} +93 -112
- package/artifacts/env-template/public/assets-manifest.json +14 -14
- package/artifacts/env-template/public/{compositions.8e40ef87cfb9de82a5ba.js → compositions.c567174ac511ea51e762.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.cf5cf99fa9b330515802.js → overview.bfdfa61910bcb32bdf52.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/{peers.9a0c744d02079a13c0b6.js → peers.8152920d7cfbf91012d9.js} +1 -1
- package/artifacts/env-template/public/{preview-root.e4ba60fb2dd39bc30c72.js → preview-root.58be48e467f1266c0479.js} +1 -1
- package/artifacts/env-template/public/static/css/{512.bd6f7c48.css → 241.bd6f7c48.css} +0 -0
- package/artifacts/preview/teambit_react_react-preview.js +1 -1
- package/{compositions-1661553386796.js → compositions-1661830538885.js} +0 -0
- package/dist/templates/react-workspace-app/index.js +33 -12
- package/dist/templates/react-workspace-app/index.js.map +1 -1
- package/dist/templates/workspace-common/constants.d.ts +1 -0
- package/dist/templates/workspace-common/constants.js +10 -0
- package/dist/templates/workspace-common/constants.js.map +1 -0
- package/dist/templates/workspace-common/files/workspace-config.d.ts +1 -1
- package/dist/templates/workspace-common/files/workspace-config.js +19 -3
- package/dist/templates/workspace-common/files/workspace-config.js.map +1 -1
- package/dist/templates/workspace-common/generate-files.d.ts +1 -1
- package/dist/templates/workspace-common/generate-files.js +2 -2
- package/dist/templates/workspace-common/generate-files.js.map +1 -1
- package/{overview-1661553386796.js → overview-1661830538885.js} +0 -0
- package/package-tar/teambit-react-0.0.831.tgz +0 -0
- package/package.json +39 -39
- package/{preview-1661553386796.js → preview-1661830538885.js} +2 -2
- package/templates/react-workspace-app/index.ts +12 -6
- package/templates/workspace-common/constants.ts +1 -0
- package/templates/workspace-common/files/workspace-config.ts +8 -3
- package/templates/workspace-common/generate-files.ts +5 -2
- package/package-tar/teambit-react-0.0.828.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["generateFiles","context","relativePath","content","workspaceConfig","gitIgnore","launchJson","readme","eslintConfig","tsConfig","prettierConfig","assetTypes","styleTypes"],"sources":["generate-files.ts"],"sourcesContent":["import { WorkspaceContext } from '@teambit/generator';\nimport { workspaceConfig } from './files/workspace-config';\nimport { readme } from './files/readme-file';\nimport { gitIgnore } from './files/git-ignore';\nimport { assetTypes } from './files/types/asset';\nimport { styleTypes } from './files/types/style';\nimport { eslintConfig } from './files/eslint-config';\nimport { tsConfig } from './files/ts-config';\nimport { prettierConfig } from './files/prettier-config';\nimport { launchJson } from './files/launch-json';\n\ntype GeneratedFile = {\n relativePath: string;\n content: string;\n};\n\nexport async function generateFiles(context: WorkspaceContext): Promise<GeneratedFile[]> {\n return [\n {\n relativePath: 'workspace.jsonc',\n content: await workspaceConfig(context),\n },\n {\n relativePath: `.gitignore`,\n content: gitIgnore(),\n },\n {\n relativePath: '.vscode/launch.json',\n content: launchJson(context),\n },\n {\n relativePath: `README.md`,\n content: readme(),\n },\n {\n relativePath: `.eslintrc.js`,\n content: eslintConfig,\n },\n {\n relativePath: `tsconfig.json`,\n content: tsConfig,\n },\n {\n relativePath: `.prettierrc.js`,\n content: prettierConfig,\n },\n {\n relativePath: `types/asset.d.ts`,\n content: assetTypes,\n },\n {\n relativePath: `types/style.d.ts`,\n content: styleTypes,\n },\n ];\n}\n"],"mappings":";;;;;;;;;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;;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;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAOO,eAAeA,aAAf,
|
|
1
|
+
{"version":3,"names":["generateFiles","context","extraConfig","relativePath","content","workspaceConfig","gitIgnore","launchJson","readme","eslintConfig","tsConfig","prettierConfig","assetTypes","styleTypes"],"sources":["generate-files.ts"],"sourcesContent":["import { WorkspaceContext } from '@teambit/generator';\nimport { workspaceConfig } from './files/workspace-config';\nimport { readme } from './files/readme-file';\nimport { gitIgnore } from './files/git-ignore';\nimport { assetTypes } from './files/types/asset';\nimport { styleTypes } from './files/types/style';\nimport { eslintConfig } from './files/eslint-config';\nimport { tsConfig } from './files/ts-config';\nimport { prettierConfig } from './files/prettier-config';\nimport { launchJson } from './files/launch-json';\n\ntype GeneratedFile = {\n relativePath: string;\n content: string;\n};\n\nexport async function generateFiles(\n context: WorkspaceContext,\n extraConfig?: Record<string, any>\n): Promise<GeneratedFile[]> {\n return [\n {\n relativePath: 'workspace.jsonc',\n content: await workspaceConfig(context, extraConfig),\n },\n {\n relativePath: `.gitignore`,\n content: gitIgnore(),\n },\n {\n relativePath: '.vscode/launch.json',\n content: launchJson(context),\n },\n {\n relativePath: `README.md`,\n content: readme(),\n },\n {\n relativePath: `.eslintrc.js`,\n content: eslintConfig,\n },\n {\n relativePath: `tsconfig.json`,\n content: tsConfig,\n },\n {\n relativePath: `.prettierrc.js`,\n content: prettierConfig,\n },\n {\n relativePath: `types/asset.d.ts`,\n content: assetTypes,\n },\n {\n relativePath: `types/style.d.ts`,\n content: styleTypes,\n },\n ];\n}\n"],"mappings":";;;;;;;;;A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|
|
2
2
|
"name": "@teambit/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.831",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/react/react",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.react",
|
|
8
8
|
"name": "react",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.831"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"fs-extra": "10.0.0",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"@babel/plugin-transform-modules-commonjs": "7.12.13",
|
|
38
38
|
"@babel/preset-env": "7.12.17",
|
|
39
39
|
"camelcase": "6.2.0",
|
|
40
|
+
"comment-json": "3.0.3",
|
|
40
41
|
"react-error-overlay": "6.0.9",
|
|
41
42
|
"strip-ansi": "6.0.0",
|
|
42
43
|
"prerender-spa-plugin-next": "4.2.0",
|
|
43
44
|
"express": "4.17.1",
|
|
44
45
|
"url-join": "4.0.1",
|
|
45
|
-
"comment-json": "3.0.3",
|
|
46
46
|
"react-refresh": "0.10.0",
|
|
47
47
|
"@babel/runtime": "^7.12.18",
|
|
48
48
|
"less-loader": "10.0.0",
|
|
@@ -82,49 +82,49 @@
|
|
|
82
82
|
"@teambit/react.instructions.react.adding-compositions": "0.0.6",
|
|
83
83
|
"@teambit/react.instructions.react.adding-tests": "0.0.6",
|
|
84
84
|
"@teambit/react.rendering.ssr": "0.0.3",
|
|
85
|
-
"@teambit/compositions.ui.hooks.use-composition": "0.0.163",
|
|
86
85
|
"@teambit/design.ui.tooltip": "0.0.352",
|
|
87
|
-
"@teambit/builder": "0.0.
|
|
88
|
-
"@teambit/bundler": "0.0.
|
|
89
|
-
"@teambit/compiler": "0.0.
|
|
86
|
+
"@teambit/builder": "0.0.831",
|
|
87
|
+
"@teambit/bundler": "0.0.831",
|
|
88
|
+
"@teambit/compiler": "0.0.831",
|
|
90
89
|
"@teambit/component.modules.component-url": "0.0.128",
|
|
91
|
-
"@teambit/component": "0.0.
|
|
92
|
-
"@teambit/dependency-resolver": "0.0.
|
|
93
|
-
"@teambit/envs": "0.0.
|
|
94
|
-
"@teambit/eslint": "0.0.
|
|
95
|
-
"@teambit/formatter": "0.0.
|
|
96
|
-
"@teambit/jest": "0.0.
|
|
97
|
-
"@teambit/linter": "0.0.
|
|
98
|
-
"@teambit/logger": "0.0.
|
|
99
|
-
"@teambit/pkg": "0.0.
|
|
100
|
-
"@teambit/prettier": "0.0.
|
|
101
|
-
"@teambit/
|
|
102
|
-
"@teambit/
|
|
103
|
-
"@teambit/
|
|
104
|
-
"@teambit/
|
|
105
|
-
"@teambit/
|
|
106
|
-
"@teambit/
|
|
107
|
-
"@teambit/
|
|
108
|
-
"@teambit/
|
|
109
|
-
"@teambit/
|
|
110
|
-
"@teambit/
|
|
111
|
-
"@teambit/
|
|
112
|
-
"@teambit/
|
|
113
|
-
"@teambit/preview": "0.0.828",
|
|
114
|
-
"@teambit/react.ui.highlighter-provider": "0.0.190",
|
|
115
|
-
"@teambit/compositions": "0.0.828",
|
|
116
|
-
"@teambit/ui": "0.0.828",
|
|
117
|
-
"@teambit/react.eslint-config-bit-react": "0.0.629",
|
|
118
|
-
"@teambit/mdx.modules.mdx-loader": "0.0.492",
|
|
119
|
-
"@teambit/react.babel.bit-react-transformer": "0.0.504",
|
|
90
|
+
"@teambit/component": "0.0.831",
|
|
91
|
+
"@teambit/dependency-resolver": "0.0.831",
|
|
92
|
+
"@teambit/envs": "0.0.831",
|
|
93
|
+
"@teambit/eslint": "0.0.831",
|
|
94
|
+
"@teambit/formatter": "0.0.382",
|
|
95
|
+
"@teambit/jest": "0.0.831",
|
|
96
|
+
"@teambit/linter": "0.0.831",
|
|
97
|
+
"@teambit/logger": "0.0.649",
|
|
98
|
+
"@teambit/pkg": "0.0.831",
|
|
99
|
+
"@teambit/prettier": "0.0.382",
|
|
100
|
+
"@teambit/schema": "0.0.831",
|
|
101
|
+
"@teambit/tester": "0.0.831",
|
|
102
|
+
"@teambit/typescript": "0.0.831",
|
|
103
|
+
"@teambit/webpack": "0.0.831",
|
|
104
|
+
"@teambit/workspace": "0.0.831",
|
|
105
|
+
"@teambit/application": "0.0.473",
|
|
106
|
+
"@teambit/cli": "0.0.556",
|
|
107
|
+
"@teambit/generator": "0.0.831",
|
|
108
|
+
"@teambit/graphql": "0.0.831",
|
|
109
|
+
"@teambit/preview": "0.0.831",
|
|
110
|
+
"@teambit/compositions": "0.0.831",
|
|
111
|
+
"@teambit/ui": "0.0.831",
|
|
120
112
|
"@teambit/webpack.modules.generate-style-loaders": "0.0.103",
|
|
121
113
|
"@teambit/webpack.modules.style-regexps": "0.0.132",
|
|
122
114
|
"@teambit/component-id": "0.0.405",
|
|
123
115
|
"@teambit/bit-error": "0.0.394",
|
|
124
116
|
"@teambit/toolbox.network.get-port": "0.0.113",
|
|
125
|
-
"@teambit/react.modules.prerenderer-puppeteer": "0.0.2",
|
|
126
117
|
"@teambit/ui-foundation.ui.pages.static-error": "0.0.75",
|
|
127
|
-
"@teambit/config": "0.0.
|
|
118
|
+
"@teambit/config": "0.0.569",
|
|
119
|
+
"@teambit/compositions.ui.hooks.use-composition": "0.0.163",
|
|
120
|
+
"@teambit/react.ui.compositions-app": "0.0.2",
|
|
121
|
+
"@teambit/react.ui.docs-app": "0.0.184",
|
|
122
|
+
"@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.21",
|
|
123
|
+
"@teambit/react.ui.highlighter-provider": "0.0.190",
|
|
124
|
+
"@teambit/react.eslint-config-bit-react": "0.0.630",
|
|
125
|
+
"@teambit/mdx.modules.mdx-loader": "0.0.492",
|
|
126
|
+
"@teambit/react.babel.bit-react-transformer": "0.0.504",
|
|
127
|
+
"@teambit/react.modules.prerenderer-puppeteer": "0.0.2"
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"@types/react": "^17.0.8",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"@teambit/react.content.react-overview": "1.95.0"
|
|
147
147
|
},
|
|
148
148
|
"peerDependencies": {
|
|
149
|
-
"@teambit/legacy": "1.0.
|
|
149
|
+
"@teambit/legacy": "1.0.339",
|
|
150
150
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
151
151
|
"react": "^16.8.0 || ^17.0.0"
|
|
152
152
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.831/dist/react.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.831/dist/react.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import { WorkspaceContext, WorkspaceTemplate } from '@teambit/generator';
|
|
2
|
+
import { parse } from 'comment-json';
|
|
2
3
|
import { generateFiles as generateCommonFiles } from '../workspace-common';
|
|
4
|
+
import { DEFAULT_SCOPE_NAME } from '../workspace-common/constants';
|
|
3
5
|
|
|
4
6
|
export const reactWorkspaceAppTemplate: WorkspaceTemplate = {
|
|
5
7
|
name: 'react-app',
|
|
6
8
|
description: 'EXPERIMENTAL. react workspace for an app',
|
|
7
9
|
hidden: true,
|
|
10
|
+
appName: 'my-app',
|
|
8
11
|
generateFiles: async (context: WorkspaceContext) => {
|
|
9
|
-
|
|
12
|
+
const scope = context.defaultScope || DEFAULT_SCOPE_NAME;
|
|
13
|
+
const extensions = {
|
|
14
|
+
[`${scope}/apps/my-app`]: parse(`{}`),
|
|
15
|
+
};
|
|
16
|
+
return generateCommonFiles(context, extensions);
|
|
10
17
|
},
|
|
11
18
|
fork: () => {
|
|
12
19
|
return [
|
|
13
|
-
{ id: 'teambit.react/templates/apps/my-app',
|
|
14
|
-
{ id: 'teambit.react/templates/envs/my-react',
|
|
15
|
-
{ id: 'teambit.react/templates/themes/theme',
|
|
16
|
-
{ id: 'teambit.react/templates/
|
|
17
|
-
{ id: 'teambit.react/templates/ui/heading', path: 'ui/heading' },
|
|
20
|
+
{ id: 'teambit.react/templates/apps/my-app', targetName: 'apps/my-app' },
|
|
21
|
+
// { id: 'teambit.react/templates/envs/my-react', targetName: 'envs/my-react' }, // TODO: uncomment when ready
|
|
22
|
+
{ id: 'teambit.react/templates/themes/theme', targetName: 'themes/theme' },
|
|
23
|
+
{ id: 'teambit.react/templates/pages/home', targetName: 'pages/home' },
|
|
18
24
|
];
|
|
19
25
|
},
|
|
20
26
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DEFAULT_SCOPE_NAME = 'my-org.my-scope';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { WorkspaceContext } from '@teambit/generator';
|
|
2
2
|
import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';
|
|
3
3
|
import { parse, assign } from 'comment-json';
|
|
4
|
+
import { DEFAULT_SCOPE_NAME } from '../constants';
|
|
4
5
|
|
|
5
|
-
export async function workspaceConfig({ name, defaultScope }: WorkspaceContext) {
|
|
6
|
-
const scope = defaultScope ||
|
|
6
|
+
export async function workspaceConfig({ name, defaultScope }: WorkspaceContext, extraConfig?: Record<string, any>) {
|
|
7
|
+
const scope = defaultScope || DEFAULT_SCOPE_NAME;
|
|
7
8
|
const configParsed = await getWorkspaceConfigTemplateParsed();
|
|
8
9
|
configParsed['teambit.workspace/workspace'].name = name;
|
|
9
10
|
configParsed['teambit.workspace/workspace'].defaultScope = scope;
|
|
@@ -30,7 +31,11 @@ export async function workspaceConfig({ name, defaultScope }: WorkspaceContext)
|
|
|
30
31
|
'teambit.workspace/variants': parse(`{}`),
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
let configMerged = assign(configParsed, variants);
|
|
35
|
+
|
|
36
|
+
if (extraConfig) {
|
|
37
|
+
configMerged = assign(configMerged, extraConfig);
|
|
38
|
+
}
|
|
34
39
|
|
|
35
40
|
return stringifyWorkspaceConfig(configMerged);
|
|
36
41
|
}
|
|
@@ -14,11 +14,14 @@ type GeneratedFile = {
|
|
|
14
14
|
content: string;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export async function generateFiles(
|
|
17
|
+
export async function generateFiles(
|
|
18
|
+
context: WorkspaceContext,
|
|
19
|
+
extraConfig?: Record<string, any>
|
|
20
|
+
): Promise<GeneratedFile[]> {
|
|
18
21
|
return [
|
|
19
22
|
{
|
|
20
23
|
relativePath: 'workspace.jsonc',
|
|
21
|
-
content: await workspaceConfig(context),
|
|
24
|
+
content: await workspaceConfig(context, extraConfig),
|
|
22
25
|
},
|
|
23
26
|
{
|
|
24
27
|
relativePath: `.gitignore`,
|
|
Binary file
|