Skip to content

Commit e771607

Browse files
committed
feat(web): add web generator
1 parent 580bc4d commit e771607

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+7904
-789
lines changed

.c8rc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{
2-
"all": true
2+
"all": true,
3+
"exclude": [
4+
"eslint.config.mjs",
5+
"**/fixtures/**",
6+
"src/generators/legacy-html/assets/**",
7+
"src/generators/web/ui/**"
8+
]
39
}

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# Tests files
22
src/generators/api-links/__tests__/fixtures/
33
*.snapshot
4+
5+
# Templates
6+
src/generators/web/template.html
7+
8+
# Output
9+
out/

codecov.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,3 @@ coverage:
1212
# TODO(@avivkeller): Once our coverage > 70%,
1313
# increase this to 70%, and increase on increments
1414
target: 60%
15-
16-
ignore:
17-
- 'eslint.config.mjs'
18-
- '**/fixtures/'

eslint.config.mjs

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
11
import pluginJs from '@eslint/js';
2+
import { defineConfig } from 'eslint/config';
23
import importX from 'eslint-plugin-import-x';
34
import jsdoc from 'eslint-plugin-jsdoc';
5+
import react from 'eslint-plugin-react';
46
import globals from 'globals';
57

6-
export default [
8+
export default defineConfig([
79
pluginJs.configs.recommended,
810
importX.flatConfigs.recommended,
911
{
1012
ignores: ['out/', 'src/generators/api-links/__tests__/fixtures/'],
1113
},
1214
{
13-
files: ['**/*.mjs'],
15+
files: ['**/*.{mjs,jsx}'],
16+
plugins: {
17+
jsdoc,
18+
react,
19+
},
20+
languageOptions: {
21+
ecmaVersion: 'latest',
22+
parserOptions: {
23+
ecmaFeatures: {
24+
jsx: true,
25+
},
26+
},
27+
globals: { ...globals.nodeBuiltin },
28+
},
1429
rules: {
1530
'object-shorthand': 'error',
31+
'react/jsx-uses-react': 'error',
32+
'react/jsx-uses-vars': 'error',
1633
'import-x/namespace': 'off',
1734
'import-x/no-named-as-default': 'off',
1835
'import-x/no-named-as-default-member': 'off',
@@ -75,7 +92,18 @@ export default [
7592
},
7693
},
7794
{
78-
files: ['src/generators/legacy-html/assets/*.js'],
79-
languageOptions: { globals: { ...globals.browser } },
95+
files: [
96+
'src/generators/legacy-html/assets/*.js',
97+
'src/generators/web/ui/**/*',
98+
],
99+
languageOptions: {
100+
globals: {
101+
...globals.browser,
102+
// SERVER and CLIENT denote server-only and client-only
103+
// codepaths in our web generator
104+
CLIENT: 'readonly',
105+
SERVER: 'readonly',
106+
},
107+
},
80108
},
81-
];
109+
]);

0 commit comments

Comments
 (0)