Skip to content

feat(web): add web generator #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Tests files
src/generators/api-links/__tests__/fixtures/
*.snapshot

# Templates
src/generators/web/template.html

# Output
out/
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ coverage:
ignore:
- 'eslint.config.mjs'
- '**/fixtures/'
# These are browser-specific implementations
- 'src/generators/legacy-html/assets'
# These components have been tested in `nodejs/nodejs.org`
- 'src/generators/web/client'
50 changes: 33 additions & 17 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
import pluginJs from '@eslint/js';
import { defineConfig } from 'eslint/config';
import importX from 'eslint-plugin-import-x';
import jsdoc from 'eslint-plugin-jsdoc';
import react from 'eslint-plugin-react';
import globals from 'globals';

export default [
export default defineConfig([
pluginJs.configs.recommended,
importX.flatConfigs.recommended,
{
ignores: ['out/', 'src/generators/api-links/__tests__/fixtures/'],
},
{
files: ['**/*.mjs'],
files: ['**/*.{mjs,jsx}'],
plugins: {
jsdoc,
react,
},
languageOptions: {
ecmaVersion: 'latest',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: { ...globals.nodeBuiltin },
},
rules: {
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'import-x/namespace': 'off',
'import-x/no-named-as-default': 'off',
'import-x/no-named-as-default-member': 'off',
Expand All @@ -34,18 +51,6 @@ export default [
},
},
],
},
},
{
files: ['src/**/*.mjs', 'bin/**/*.mjs'],
plugins: {
jsdoc: jsdoc,
},
languageOptions: {
ecmaVersion: 'latest',
globals: { ...globals.nodeBuiltin },
},
rules: {
'jsdoc/check-alignment': 'error',
'jsdoc/check-indentation': 'error',
'jsdoc/require-jsdoc': [
Expand Down Expand Up @@ -74,7 +79,18 @@ export default [
},
},
{
files: ['src/generators/legacy-html/assets/*.js'],
languageOptions: { globals: { ...globals.browser } },
files: [
'src/generators/legacy-html/assets/*.js',
'src/generators/web/client/**/*',
],
languageOptions: {
globals: {
...globals.browser,
// SERVER and CLIENT denote server-only and client-only
// codepaths in our web generator
CLIENT: 'readonly',
SERVER: 'readonly',
},
},
},
];
]);
Loading
Loading