@teambit/react 0.0.1143 → 0.0.1145

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.
Files changed (119) hide show
  1. package/artifacts/env-template/public/{468.568f9c38778c002236e3.js → 182.410a89f71ee95a3ff99b.js} +2 -2
  2. package/artifacts/env-template/public/{924.12753b2d3256909c0b90.js → 924.02ee0292af3d0a49b9b3.js} +6 -6
  3. package/artifacts/env-template/public/assets-manifest.json +14 -14
  4. package/artifacts/env-template/public/{compositions.5d70abab406497a71dea.js → compositions.20fe0f3ddee7cca3c6d3.js} +1 -1
  5. package/artifacts/env-template/public/compositions.html +1 -1
  6. package/artifacts/env-template/public/{overview.7b086f1c73f4aca498cd.js → overview.06b1918799167bcfab11.js} +1 -1
  7. package/artifacts/env-template/public/overview.html +1 -1
  8. package/artifacts/env-template/public/{peers.a94f3126b5939f61d472.js → peers.5769331da1f38fc00702.js} +1 -1
  9. package/artifacts/env-template/public/{preview-root.fa8ad55acdd88d61b0ec.js → preview-root.53a6e63c0ef099b3ef97.js} +1 -1
  10. package/artifacts/env-template/public/static/css/924.cae10f55.css +1 -0
  11. package/dist/{preview-1693192680001.js → preview-1693474270980.js} +2 -2
  12. package/dist/react.main.runtime.js +0 -1
  13. package/dist/react.main.runtime.js.map +1 -1
  14. package/dist/react.templates.d.ts +1 -2
  15. package/dist/react.templates.js +1 -66
  16. package/dist/react.templates.js.map +1 -1
  17. package/dist/templates/react-component/index.js +1 -0
  18. package/dist/templates/react-component/index.js.map +1 -1
  19. package/dist/templates/react-component-js/index.js +1 -0
  20. package/dist/templates/react-component-js/index.js.map +1 -1
  21. package/dist/templates/react-context/index.js +1 -0
  22. package/dist/templates/react-context/index.js.map +1 -1
  23. package/dist/templates/react-env/index.js +1 -0
  24. package/dist/templates/react-env/index.js.map +1 -1
  25. package/dist/templates/react-hook/index.js +1 -0
  26. package/dist/templates/react-hook/index.js.map +1 -1
  27. package/package.json +31 -33
  28. package/templates/react-component/index.ts +1 -0
  29. package/templates/react-component-js/index.ts +1 -1
  30. package/templates/react-context/index.ts +1 -1
  31. package/templates/react-env/index.ts +1 -0
  32. package/templates/react-hook/index.ts +1 -1
  33. package/artifacts/env-template/public/static/css/924.b97916e5.css +0 -1
  34. package/dist/templates/react-workspace/index.d.ts +0 -2
  35. package/dist/templates/react-workspace/index.js +0 -41
  36. package/dist/templates/react-workspace/index.js.map +0 -1
  37. package/dist/templates/react-workspace-analytics/index.d.ts +0 -2
  38. package/dist/templates/react-workspace-analytics/index.js +0 -47
  39. package/dist/templates/react-workspace-analytics/index.js.map +0 -1
  40. package/dist/templates/react-workspace-app/index.d.ts +0 -2
  41. package/dist/templates/react-workspace-app/index.js +0 -58
  42. package/dist/templates/react-workspace-app/index.js.map +0 -1
  43. package/dist/templates/react-workspace-blog/index.d.ts +0 -2
  44. package/dist/templates/react-workspace-blog/index.js +0 -39
  45. package/dist/templates/react-workspace-blog/index.js.map +0 -1
  46. package/dist/templates/react-workspace-data-fetching/index.d.ts +0 -2
  47. package/dist/templates/react-workspace-data-fetching/index.js +0 -47
  48. package/dist/templates/react-workspace-data-fetching/index.js.map +0 -1
  49. package/dist/templates/react-workspace-deprecated/index.d.ts +0 -2
  50. package/dist/templates/react-workspace-deprecated/index.js +0 -48
  51. package/dist/templates/react-workspace-deprecated/index.js.map +0 -1
  52. package/dist/templates/react-workspace-design-system/index.d.ts +0 -2
  53. package/dist/templates/react-workspace-design-system/index.js +0 -55
  54. package/dist/templates/react-workspace-design-system/index.js.map +0 -1
  55. package/dist/templates/react-workspace-lib/index.d.ts +0 -2
  56. package/dist/templates/react-workspace-lib/index.js +0 -52
  57. package/dist/templates/react-workspace-lib/index.js.map +0 -1
  58. package/dist/templates/react-workspace-wiki/index.d.ts +0 -2
  59. package/dist/templates/react-workspace-wiki/index.js +0 -47
  60. package/dist/templates/react-workspace-wiki/index.js.map +0 -1
  61. package/dist/templates/workspace-common/constants.d.ts +0 -1
  62. package/dist/templates/workspace-common/constants.js +0 -10
  63. package/dist/templates/workspace-common/constants.js.map +0 -1
  64. package/dist/templates/workspace-common/files/eslint-config.d.ts +0 -1
  65. package/dist/templates/workspace-common/files/eslint-config.js +0 -15
  66. package/dist/templates/workspace-common/files/eslint-config.js.map +0 -1
  67. package/dist/templates/workspace-common/files/git-ignore.d.ts +0 -1
  68. package/dist/templates/workspace-common/files/git-ignore.js +0 -121
  69. package/dist/templates/workspace-common/files/git-ignore.js.map +0 -1
  70. package/dist/templates/workspace-common/files/launch-json.d.ts +0 -2
  71. package/dist/templates/workspace-common/files/launch-json.js +0 -39
  72. package/dist/templates/workspace-common/files/launch-json.js.map +0 -1
  73. package/dist/templates/workspace-common/files/prettier-config.d.ts +0 -1
  74. package/dist/templates/workspace-common/files/prettier-config.js +0 -14
  75. package/dist/templates/workspace-common/files/prettier-config.js.map +0 -1
  76. package/dist/templates/workspace-common/files/readme-file.d.ts +0 -1
  77. package/dist/templates/workspace-common/files/readme-file.js +0 -44
  78. package/dist/templates/workspace-common/files/readme-file.js.map +0 -1
  79. package/dist/templates/workspace-common/files/ts-config.d.ts +0 -1
  80. package/dist/templates/workspace-common/files/ts-config.js +0 -19
  81. package/dist/templates/workspace-common/files/ts-config.js.map +0 -1
  82. package/dist/templates/workspace-common/files/types/asset.d.ts +0 -1
  83. package/dist/templates/workspace-common/files/types/asset.js +0 -37
  84. package/dist/templates/workspace-common/files/types/asset.js.map +0 -1
  85. package/dist/templates/workspace-common/files/types/style.d.ts +0 -1
  86. package/dist/templates/workspace-common/files/types/style.js +0 -52
  87. package/dist/templates/workspace-common/files/types/style.js.map +0 -1
  88. package/dist/templates/workspace-common/files/workspace-config.d.ts +0 -2
  89. package/dist/templates/workspace-common/files/workspace-config.js +0 -65
  90. package/dist/templates/workspace-common/files/workspace-config.js.map +0 -1
  91. package/dist/templates/workspace-common/generate-files.d.ts +0 -7
  92. package/dist/templates/workspace-common/generate-files.js +0 -102
  93. package/dist/templates/workspace-common/generate-files.js.map +0 -1
  94. package/dist/templates/workspace-common/index.d.ts +0 -1
  95. package/dist/templates/workspace-common/index.js +0 -20
  96. package/dist/templates/workspace-common/index.js.map +0 -1
  97. package/templates/react-workspace/index.ts +0 -27
  98. package/templates/react-workspace-analytics/index.ts +0 -31
  99. package/templates/react-workspace-app/index.ts +0 -26
  100. package/templates/react-workspace-blog/index.ts +0 -25
  101. package/templates/react-workspace-data-fetching/index.ts +0 -35
  102. package/templates/react-workspace-deprecated/index.ts +0 -28
  103. package/templates/react-workspace-design-system/index.ts +0 -37
  104. package/templates/react-workspace-lib/index.ts +0 -21
  105. package/templates/react-workspace-wiki/index.ts +0 -27
  106. package/templates/workspace-common/constants.ts +0 -1
  107. package/templates/workspace-common/files/eslint-config.ts +0 -6
  108. package/templates/workspace-common/files/git-ignore.ts +0 -113
  109. package/templates/workspace-common/files/launch-json.ts +0 -30
  110. package/templates/workspace-common/files/prettier-config.ts +0 -5
  111. package/templates/workspace-common/files/readme-file.ts +0 -36
  112. package/templates/workspace-common/files/ts-config.ts +0 -10
  113. package/templates/workspace-common/files/types/asset.ts +0 -28
  114. package/templates/workspace-common/files/types/style.ts +0 -43
  115. package/templates/workspace-common/files/workspace-config.ts +0 -41
  116. package/templates/workspace-common/generate-files.ts +0 -59
  117. package/templates/workspace-common/index.ts +0 -1
  118. /package/{compositions-1693192680001.js → compositions-1693474270980.js} +0 -0
  119. /package/{overview-1693192680001.js → overview-1693474270980.js} +0 -0
@@ -1,36 +0,0 @@
1
- export function readme() {
2
- return `# Welcome to your Bit Workspace
3
-
4
- To get started straight away run \`bit start\` and open [localhost:3000](http://localhost:3000). It may take a while to build the first time you run this command as it is building the whole User Interface for your development environment.
5
-
6
- \`\`\`bash
7
- bit start
8
- \`\`\`
9
-
10
- ## What's included
11
-
12
- - **workspace.jsonc**
13
-
14
- This is the main configuration file of your bit workspace. Here you can modify the workspace name and icon as well as default directory and scope. It is where dependencies are found when you install anything. It is also where you register aspects, bit extensions as well as apply the environments for your components. This workspace has been setup so that all components use the React env. However you can create other components and apply other envs to them such as node, html, angular and aspect envs.
15
-
16
- - **.bitmap**
17
-
18
- This is an auto-generated file and includes the mapping of your components. There is one component included here. In order to remove this component you can run the following command.
19
-
20
-
21
- - **Demo Components**
22
-
23
- A folder (unless the --empty flag was used) containing demo components are included in this workspace. These components are used to demonstrate the different features of Bit. If you would like to remove these components you can run the following command.
24
-
25
- \`\`\`jsx
26
- bit remove "ui/*" --delete files
27
- \`\`\`
28
-
29
- This removes the components from the bitmap as well as removes the files.
30
-
31
-
32
- - **.gitignore**
33
-
34
- Ignoring any files from version control
35
- `;
36
- }
@@ -1,10 +0,0 @@
1
- export const tsConfig = `{
2
- "extends": "./node_modules/@teambit/react/typescript/tsconfig.json",
3
- // "include": [],
4
- "compilerOptions": {
5
- "noEmit": true
6
- },
7
- "exclude": [
8
- "dist"
9
- ]
10
- }`;
@@ -1,28 +0,0 @@
1
- export const assetTypes = `declare module '*.png' {
2
- const value: any;
3
- export = value;
4
- }
5
- declare module '*.svg' {
6
- import type { FunctionComponent, SVGProps } from 'react';
7
-
8
- export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
9
- const src: string;
10
- export default src;
11
- }
12
- declare module '*.jpg' {
13
- const value: any;
14
- export = value;
15
- }
16
- declare module '*.jpeg' {
17
- const value: any;
18
- export = value;
19
- }
20
- declare module '*.gif' {
21
- const value: any;
22
- export = value;
23
- }
24
- declare module '*.bmp' {
25
- const value: any;
26
- export = value;
27
- }
28
- `;
@@ -1,43 +0,0 @@
1
- export const styleTypes = `declare module '*.module.css' {
2
- const classes: { readonly [key: string]: string };
3
- export default classes;
4
- }
5
- declare module '*.module.scss' {
6
- const classes: { readonly [key: string]: string };
7
- export default classes;
8
- }
9
- declare module '*.module.sass' {
10
- const classes: { readonly [key: string]: string };
11
- export default classes;
12
- }
13
-
14
- declare module '*.module.less' {
15
- const classes: { readonly [key: string]: string };
16
- export default classes;
17
- }
18
-
19
- declare module '*.less' {
20
- const classes: { readonly [key: string]: string };
21
- export default classes;
22
- }
23
-
24
- declare module '*.css' {
25
- const classes: { readonly [key: string]: string };
26
- export default classes;
27
- }
28
-
29
- declare module '*.sass' {
30
- const classes: { readonly [key: string]: string };
31
- export default classes;
32
- }
33
-
34
- declare module '*.scss' {
35
- const classes: { readonly [key: string]: string };
36
- export default classes;
37
- }
38
-
39
- declare module '*.mdx' {
40
- const component: any;
41
- export default component;
42
- }
43
- `;
@@ -1,41 +0,0 @@
1
- import { WorkspaceContext } from '@teambit/generator';
2
- import { getWorkspaceConfigTemplateParsed, stringifyWorkspaceConfig } from '@teambit/config';
3
- import { parse, assign } from 'comment-json';
4
- import { DEFAULT_SCOPE_NAME } from '../constants';
5
-
6
- export async function workspaceConfig({ name, defaultScope }: WorkspaceContext, extraConfig?: Record<string, any>) {
7
- const scope = defaultScope || DEFAULT_SCOPE_NAME;
8
- const configParsed = await getWorkspaceConfigTemplateParsed();
9
- configParsed['teambit.workspace/workspace'].name = name;
10
- configParsed['teambit.workspace/workspace'].defaultScope = scope;
11
- configParsed['teambit.dependencies/dependency-resolver'].packageManager = 'teambit.dependencies/pnpm';
12
- configParsed['teambit.dependencies/dependency-resolver'].policy = {
13
- dependencies: {
14
- '@teambit/eslint-config-bit-react': '~0.0.367',
15
- '@typescript-eslint/eslint-plugin': '5.35.1',
16
- 'eslint-import-resolver-node': '0.3.6',
17
- 'eslint-plugin-import': '2.22.1',
18
- 'eslint-plugin-jest': '24.4.0',
19
- 'eslint-plugin-jsx-a11y': '6.4.1',
20
- 'eslint-plugin-mdx': '1.15.0',
21
- 'eslint-plugin-react': '7.25.1',
22
- },
23
- peerDependencies: {
24
- '@testing-library/react': '^12.1.5',
25
- react: '17.0.2',
26
- 'react-dom': '17.0.2',
27
- },
28
- };
29
-
30
- const variants = {
31
- 'teambit.workspace/variants': parse(`{}`),
32
- };
33
-
34
- let configMerged = assign(configParsed, variants);
35
-
36
- if (extraConfig) {
37
- configMerged = assign(configMerged, extraConfig);
38
- }
39
-
40
- return stringifyWorkspaceConfig(configMerged);
41
- }
@@ -1,59 +0,0 @@
1
- import { WorkspaceContext } from '@teambit/generator';
2
- import { workspaceConfig } from './files/workspace-config';
3
- import { readme } from './files/readme-file';
4
- import { gitIgnore } from './files/git-ignore';
5
- import { assetTypes } from './files/types/asset';
6
- import { styleTypes } from './files/types/style';
7
- import { eslintConfig } from './files/eslint-config';
8
- import { tsConfig } from './files/ts-config';
9
- import { prettierConfig } from './files/prettier-config';
10
- import { launchJson } from './files/launch-json';
11
-
12
- type GeneratedFile = {
13
- relativePath: string;
14
- content: string;
15
- };
16
-
17
- export async function generateFiles(
18
- context: WorkspaceContext,
19
- extraConfig?: Record<string, any>
20
- ): Promise<GeneratedFile[]> {
21
- return [
22
- {
23
- relativePath: 'workspace.jsonc',
24
- content: await workspaceConfig(context, extraConfig),
25
- },
26
- {
27
- relativePath: `.gitignore`,
28
- content: gitIgnore(),
29
- },
30
- {
31
- relativePath: '.vscode/launch.json',
32
- content: launchJson(context),
33
- },
34
- {
35
- relativePath: `README.md`,
36
- content: readme(),
37
- },
38
- {
39
- relativePath: `.eslintrc.js`,
40
- content: eslintConfig,
41
- },
42
- {
43
- relativePath: `tsconfig.json`,
44
- content: tsConfig,
45
- },
46
- {
47
- relativePath: `.prettierrc.js`,
48
- content: prettierConfig,
49
- },
50
- {
51
- relativePath: `types/asset.d.ts`,
52
- content: assetTypes,
53
- },
54
- {
55
- relativePath: `types/style.d.ts`,
56
- content: styleTypes,
57
- },
58
- ];
59
- }
@@ -1 +0,0 @@
1
- export { generateFiles } from './generate-files';