Skip to content
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

Multiple files as entry point #81

Open
kaleidawave opened this issue Nov 13, 2023 Discussed in #80 · 1 comment
Open

Multiple files as entry point #81

kaleidawave opened this issue Nov 13, 2023 Discussed in #80 · 1 comment
Labels
architecture type checking and compiler related general structuring cli Command line interface good-first-issue PRs welcome 🙏

Comments

@kaleidawave
Copy link
Owner

kaleidawave commented Nov 13, 2023

Update: after #102 have added multiple entry points to the checker. However it is not fully wired up to Ezno's CLI with:

ezno/src/cli.rs

Lines 170 to 172 in 1aa77e2

CompilerSubCommand::Check(check_arguments) => {
let CheckArguments { input, watch: _, definition_file, timings } = check_arguments;
let entry_points = vec![input];

The next part (that you can contribute to):

  • Get a Vec<PathBuf> from a input path.
    • This could be a glob pattern or just a comma separated list
    • Should consider whether this method will work with the notify crate. While check --watch isn't currently implemented, it would be good if this addition can work with a watch mode in the future

Note I have not checked side-effect edge cases in #102


Currently there is only one entry path. OP wants to check all files in the directory. Note each entry point also type checks its imports, so this isn't necessary for checking imports and exports.

image

Rather than running entry_points.for_each(|path| check_project(path, ...)) this needs to be built into the internal ModuleData. So it should be callable as check_project(vec![...]).

Things to think about

  • Side effects in modules (want to reuse some existing data, but make it distinct)
  • How to get a Vec<PathBuf> from the glob passed to the CLI
    • How this works in the CLI watch mode

Discussed in #80

Originally posted by o-az November 11, 2023
How can I run oxidation-compiler to typecheck multiple files by passing a glob string / directory path?

Works:

npx oxidation-compiler@latest check src/file.tsx

None of these commands check all files:

npx oxidation-compiler@latest check src/*.tsx
npx oxidation-compiler@latest check src/
npx oxidation-compiler@latest check src/*

CleanShot 2023-11-11 at 10 48 53@2x

@kaleidawave kaleidawave added the architecture type checking and compiler related general structuring label Nov 13, 2023
@kaleidawave kaleidawave added cli Command line interface good-first-issue PRs welcome 🙏 labels Jan 5, 2024
@kaleidawave
Copy link
Owner Author

Half of this is implemented in #102. Have updated issue body if anyone is interested in wiring up the second half ☝️

@kaleidawave kaleidawave pinned this issue Mar 28, 2024
kaleidawave added a commit that referenced this issue May 21, 2024
- Add asserts type (technically function return type)
- Add `as` for inteface rule + more
- Add binary *self-upgrade* system
- Start on #81 with allowing multiple entry points
- Rename some examples
- Add 'pretty-printing' example
kaleidawave added a commit that referenced this issue May 24, 2024
* Parser and CLI updates
- Add asserts type (technically function return type)
- Add `as` for inteface rule + more
- Add binary *self-upgrade* system
- Start on #81 with allowing multiple entry points
- Rename some examples
- Add 'pretty-printing' example
- Update fuzzing lock file (should fix them)
- Improvements to the info command and upgrade command output
- Clippy fixes
- Still a fuzzing issue but we will move
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture type checking and compiler related general structuring cli Command line interface good-first-issue PRs welcome 🙏
Projects
None yet
Development

No branches or pull requests

1 participant