Skip to content

Multiple files as entry point #81

Closed
@kaleidawave

Description

@kaleidawave

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    architecturetype checking and compiler related general structuringcliCommand line interfacegood-first-issuePRs welcome 🙏

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions