Skip to content

Commit 99176ba

Browse files
committed
feat(web): add web generator
1 parent 6d86c0c commit 99176ba

Some content is hidden

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

49 files changed

+8834
-1576
lines changed

.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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ coverage:
1616
ignore:
1717
- 'eslint.config.mjs'
1818
- '**/fixtures/'
19+
# These are browser-specific implementations
20+
- 'src/generators/legacy-html/assets'
21+
# These components have been tested in `nodejs/nodejs.org`
22+
- 'src/generators/web/client'

eslint.config.mjs

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
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: {
30+
'react/jsx-uses-react': 'error',
31+
'react/jsx-uses-vars': 'error',
1532
'import-x/namespace': 'off',
1633
'import-x/no-named-as-default': 'off',
1734
'import-x/no-named-as-default-member': 'off',
@@ -34,18 +51,6 @@ export default [
3451
},
3552
},
3653
],
37-
},
38-
},
39-
{
40-
files: ['src/**/*.mjs', 'bin/**/*.mjs'],
41-
plugins: {
42-
jsdoc: jsdoc,
43-
},
44-
languageOptions: {
45-
ecmaVersion: 'latest',
46-
globals: { ...globals.nodeBuiltin },
47-
},
48-
rules: {
4954
'jsdoc/check-alignment': 'error',
5055
'jsdoc/check-indentation': 'error',
5156
'jsdoc/require-jsdoc': [
@@ -74,7 +79,18 @@ export default [
7479
},
7580
},
7681
{
77-
files: ['src/generators/legacy-html/assets/*.js'],
78-
languageOptions: { globals: { ...globals.browser } },
82+
files: [
83+
'src/generators/legacy-html/assets/*.js',
84+
'src/generators/web/client/**/*',
85+
],
86+
languageOptions: {
87+
globals: {
88+
...globals.browser,
89+
// SERVER and CLIENT denote server-only and client-only
90+
// codepaths in our web generator
91+
CLIENT: 'readonly',
92+
SERVER: 'readonly',
93+
},
94+
},
7995
},
80-
];
96+
]);

0 commit comments

Comments
 (0)