-
Notifications
You must be signed in to change notification settings - Fork 20
Migrate to using Vite #487
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bdc0504
vite
pjaudiomv bc85da6
use vitest
pjaudiomv 5ee715f
Add pettier
pjaudiomv a24a25e
add terser
pjaudiomv 1d5088d
update compiler target, eslint config
pjaudiomv 69a9a42
update contributing notes
pjaudiomv 9e3f0c1
add lint action step
pjaudiomv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,62 @@ | ||
| import js from '@eslint/js'; | ||
| import globals from 'globals' | ||
| import ts from 'typescript-eslint'; | ||
| import reactPlugin from 'eslint-plugin-react'; | ||
| import reactHooksPlugin from 'eslint-plugin-react-hooks'; | ||
| import reactRefresh from 'eslint-plugin-react-refresh' | ||
| import { defineConfig, globalIgnores } from 'eslint/config'; | ||
|
|
||
| export default defineConfig([ | ||
| globalIgnores(['public']), | ||
| { | ||
| files: ['**/*.{ts,tsx}'], | ||
| extends: [ | ||
| js.configs.recommended, | ||
| ...ts.configs.recommended, | ||
| reactPlugin.configs.flat.recommended, | ||
| reactHooksPlugin.configs.flat.recommended, | ||
| reactRefresh.configs.vite, | ||
| reactPlugin.configs.flat['jsx-runtime'], | ||
| ], | ||
| languageOptions: { | ||
| parserOptions: { | ||
| ecmaFeatures: { | ||
| jsx: true, | ||
| }, | ||
| ecmaVersion: 2020, | ||
| sourceType: 'module', | ||
| }, | ||
| globals: { | ||
| ...globals.browser, | ||
| // Custom globals | ||
| Lang: 'readonly', | ||
| TSMLReactConfig: 'readonly', | ||
| Translation: 'readonly', | ||
| }, | ||
| }, | ||
| settings: { | ||
| react: { | ||
| version: 'detect', | ||
| }, | ||
| }, | ||
| rules: { | ||
| 'react/jsx-uses-react': 'off', | ||
| 'react/react-in-jsx-scope': 'off', | ||
| 'react/no-unknown-property': ['error', { ignore: ['css'] }], | ||
| 'no-unused-vars': [ | ||
| 'error', | ||
| { | ||
| argsIgnorePattern: '^_', | ||
| varsIgnorePattern: '^_', | ||
| caughtErrorsIgnorePattern: '^_', | ||
| }, | ||
| ], | ||
| // Turning these off for now to clean up warnings | ||
| 'react-refresh/only-export-components': 'off', | ||
| 'react-hooks/exhaustive-deps': 'off', | ||
| 'react-hooks/set-state-in-effect': 'off', | ||
| 'react-hooks/immutability': 'off', | ||
| 'react-hooks/preserve-manual-memoization': 'off' | ||
| }, | ||
| }, | ||
| ]); |
This file contains hidden or 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,16 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>TSML UI - Development</title> | ||
| </head> | ||
| <body> | ||
| <div | ||
| id="tsml-ui" | ||
| data-src="https://sheets.code4recovery.org/storage/12Ga8uwMG4WJ8pZ_SEU7vNETp_aQZ-2yNVsYDFqIwHyE.json" | ||
| data-timezone="America/New_York" | ||
| ></div> | ||
| <script type="module" src="/src/app.tsx"></script> | ||
| </body> | ||
| </html> | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,4 +1,7 @@ | ||
| [build] | ||
| publish = "public/" | ||
| command = "npx mix --production" | ||
| command = "npm run build" | ||
|
|
||
| [build.environment] | ||
| NODE_VERSION = "20" | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not clear on what this file is doing - we do want to preserve this page: https://tsml-ui.code4recovery.org
it still works for me locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The separate
index.htmlat the root is strictly for dev (npm run devwith HMR) and public/index.html stays there and is for the actual site page. This was the cleanest way to have HMR working and the separate public/index.html site. The files in public/tests/ cant be used with hmr (though viewing works fine fornpm run dev) as need to have the one valid entrypoint. They can be tested withnpm run previewafter build though ornpm run serve`Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TL;DR its needed for dev entrypoint,
public/index.htmlis still preserved for https://tsml-ui.code4recovery.org/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't have HMR on multiple entry points in a single dev server (the public/tests/*.html files) so we have to pick one test to develop against with HMR (the root index.html)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://vite.dev/guide/#index-html-and-project-root