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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion .c8rc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"all": true
"all": true,
"exclude": [
"eslint.config.mjs",
"**/fixtures/**",
"src/generators/legacy-html/assets/**",
"src/generators/web/ui/**"
]
}
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/
10 changes: 3 additions & 7 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ coverage:
target: 80%
project:
default:
# TODO(@avivkeller): Once our coverage > 50%,
# increase this to 50%, and increase on increments
target: 40%

ignore:
- 'eslint.config.mjs'
- '**/fixtures/'
# TODO(@avivkeller): Once our coverage > 70%,
# increase this to 70%, and increase on increments
target: 60%
38 changes: 33 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
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: {
'object-shorthand': 'error',
'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 Down Expand Up @@ -75,7 +92,18 @@ export default [
},
},
{
files: ['src/generators/legacy-html/assets/*.js'],
languageOptions: { globals: { ...globals.browser } },
files: [
'src/generators/legacy-html/assets/*.js',
'src/generators/web/ui/**/*',
],
languageOptions: {
globals: {
...globals.browser,
// SERVER and CLIENT denote server-only and client-only
// codepaths in our web generator
CLIENT: 'readonly',
SERVER: 'readonly',
},
},
},
];
]);
Loading
Loading