mast/mast-react-vite
Anish Lakhwara 791cd547ae feat: new command parser
It's not fully hooked up to the react app, and it's not quite complete
either, but it's a start.
Currently, it will parse filter implicitly, and there's also the done
and add command. For now, all commands must place the command name in
the right location.

Additionally, I've hooked up the react table's selection state to the
command parser. Filter based on _ids_ explicitly does work. Manually
selecting an ID will also place it in the input field for
discoverability. It does not remove ids that were manually deselected
yet, nor does filter based on any other attribute work.

The command parser also parses times, but it does so very poorly
currently. More work will need to go into that, for now it's basically a
stub. I'll also need to convert the parser to Go.

The react table conviently handles virtual tables based on it's internal
`row.id`. I'm still wondering how to implement virtual ids, but at least
on the web app, they are constantly updated since the view is always
visible, which is different to the CLI (though perhaps the same as a
                                               TUI?)

Notably, there's no semantics for the difference between selection and
filtering. I think perhaps the implicit filter command should default to
selection, but the explicit filter command should be handled
differently, and actually execute filtering. I haven't yet looked into
how the TanStack Table handles filtering, but I am aware that it does.

I think for an MVP, once done is implemented, I can deploy this, the web
socket server, and try and start using it.
2024-11-10 02:15:10 -08:00
..
public init mast-react 2024-11-02 17:29:52 -07:00
src feat: new command parser 2024-11-10 02:15:10 -08:00
.gitignore init mast-react 2024-11-02 17:29:52 -07:00
components.json a little nicer looking, but i still don't really understand where to set 2024-11-06 22:21:58 -08:00
eslint.config.js init mast-react 2024-11-02 17:29:52 -07:00
index.html init mast-react 2024-11-02 17:29:52 -07:00
package-lock.json init mast-react 2024-11-02 17:29:52 -07:00
package.json init mast-react 2024-11-02 17:29:52 -07:00
postcss.config.js init mast-react 2024-11-02 17:29:52 -07:00
README.md init mast-react 2024-11-02 17:29:52 -07:00
tailwind.config.js a little nicer looking, but i still don't really understand where to set 2024-11-06 22:21:58 -08:00
tsconfig.app.json init mast-react 2024-11-02 17:29:52 -07:00
tsconfig.json init mast-react 2024-11-02 17:29:52 -07:00
tsconfig.node.json init mast-react 2024-11-02 17:29:52 -07:00
vite.config.ts init mast-react 2024-11-02 17:29:52 -07:00

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

  • Configure the top-level parserOptions property like this:
export default tseslint.config({
  languageOptions: {
    // other options...
    parserOptions: {
      project: ['./tsconfig.node.json', './tsconfig.app.json'],
      tsconfigRootDir: import.meta.dirname,
    },
  },
})
  • Replace tseslint.configs.recommended to tseslint.configs.recommendedTypeChecked or tseslint.configs.strictTypeChecked
  • Optionally add ...tseslint.configs.stylisticTypeChecked
  • Install eslint-plugin-react and update the config:
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
  // Set the react version
  settings: { react: { version: '18.3' } },
  plugins: {
    // Add the react plugin
    react,
  },
  rules: {
    // other rules...
    // Enable its recommended rules
    ...react.configs.recommended.rules,
    ...react.configs['jsx-runtime'].rules,
  },
})