-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the build tool from Webpack to Vite (#16)
* Changed the build tool from Webpack to Vite. Added React Hook Form. Added .env support. Added recommended VS Code extensions. * Updated comet-uswds version
- Loading branch information
1 parent
76fe837
commit b01e2f7
Showing
71 changed files
with
4,931 additions
and
8,145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
API_BASE_URL=/api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:prettier/recommended', | ||
'prettier', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh', 'prettier'], | ||
rules: { | ||
'react/react-in-jsx-scope': 'off', | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
'@typescript-eslint/no-unused-vars': 'error', | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
semi: true, | ||
tabWidth: 2, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
bracketSpacing: true, | ||
useTabs: false, | ||
}, | ||
], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/*.test.ts', '**/*.test.tsx'], | ||
env: { | ||
jest: true, | ||
}, | ||
}, | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto eol=lf | ||
|
||
# Explicitly declare text files you want to always be normalized and converted | ||
# to native line endings on checkout. | ||
# *.c text | ||
# *.h text | ||
|
||
# Declare files that will always have CRLF line endings on checkout. | ||
# *.sln text eol=crlf | ||
|
||
# Denote all files that are truly binary and should not be modified. | ||
# *.png binary | ||
# *.jpg binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ignore artifacts: | ||
build | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"semi": true, | ||
"tabWidth": 2, | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"bracketSpacing": true | ||
"bracketSpacing": true, | ||
"useTabs": false, | ||
"plugins": ["prettier-plugin-organize-imports"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
{ | ||
"recommendations": ["editorconfig.editorconfig"] | ||
"recommendations": [ | ||
"mgmcdermott.vscode-language-babel", | ||
"editorconfig.editorconfig", | ||
"irongeek.vscode-env", | ||
"dbaeumer.vscode-eslint", | ||
"wix.vscode-import-cost", | ||
"esbenp.prettier-vscode", | ||
"pflannery.vscode-versionlens", | ||
"orta.vscode-jest" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
// Formatting | ||
// Uncomment the following line to allow Prettier to auto format your code on save 👇 | ||
// "editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[html]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
|
||
// Code highlighting | ||
"files.associations": { | ||
"*.env.*": "env" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-typescript", | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"useBuiltIns": "usage", | ||
"corejs": 3 | ||
} | ||
], | ||
"@babel/preset-react" | ||
["@babel/preset-env", { "targets": { "node": "current" } }], | ||
"@babel/preset-typescript" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
import { defineConfig } from 'cypress'; | ||
import customViteConfig from './vite.config'; | ||
|
||
export default defineConfig({ | ||
component: { | ||
devServer: { | ||
framework: 'react', | ||
bundler: 'vite', | ||
// optionally pass in vite config | ||
viteConfig: customViteConfig, | ||
// or a function - the result is merged with | ||
// any `vite.config` file that is detected | ||
// viteConfig: async () => { | ||
// // ... do things ... | ||
// const modifiedConfig = await injectCustomConfig(baseConfig); | ||
// return modifiedConfig; | ||
// }, | ||
}, | ||
}, | ||
|
||
e2e: { | ||
baseUrl: 'http://localhost:8080', | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
}, | ||
env: { | ||
base_url: 'http://localhost:8080', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,59 @@ | ||
/// <reference types="cypress" /> | ||
// *********************************************** | ||
// This example commands.ts shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add('login', (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
// | ||
// declare global { | ||
// namespace Cypress { | ||
// interface Chainable { | ||
// login(email: string, password: string): Chainable<void> | ||
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> | ||
// } | ||
// } | ||
// } | ||
|
||
// Sign-in command | ||
Cypress.Commands.add('signIn', (username, password) => { | ||
cy.get('input[name="username"]').type(`${username}`).should('have.value', `${username}`); | ||
cy.get('input[name="password"]').type(`${password}`).should('have.value', `${password}`); | ||
cy.get('input[name="username"]') | ||
.type(`${username}`) | ||
.should('have.value', `${username}`); | ||
cy.get('input[name="password"]') | ||
.type(`${password}`) | ||
.should('have.value', `${password}`); | ||
cy.get('#submit').click(); | ||
}); | ||
|
||
declare global { | ||
// eslint-disable-next-line @typescript-eslint/no-namespace | ||
namespace Cypress { | ||
interface Chainable { | ||
signIn(email: string, password: string): Chainable<void>; | ||
signIn(username: string, password: string): Chainable<void>; | ||
} | ||
} | ||
} | ||
|
||
export {}; |
Oops, something went wrong.