Skip to content

Update the ensureUptodate procedure to handle workspaces #4239

@sigurdm

Description

@sigurdm

We want:

  • Should be invokable in any directory. The relevant enclosing directory with a package config should be found.
  • a fast-path for dart run that does not have to parse yaml.
  • Only .dart_tool/package_config.json should be parsed, and relevant timestamps compared.
  • If .dart_tool/package_config.json could not be found, or time-stamps mismatch we do a full resolution.
  • A stray package config above the workspaceroot pubspec.yaml should not be used.

The procedure for the fast path would be like:

We then for each parent directory p of current directory (including it):

  • If p is the file system root: use an empty package config.
  • look for $p/.dart_tool/package_config.json. If that exists check if it is up-to-date. (this allows a stand-alone package config).
  • look for $p/pubspec.yaml:
    • If that exists: look for $p/.dart_tool/pub/workspace_ref.json.
      • If that exists: check if the .dart_tool/package_config.json relative to its "workspaceRoot" is up-to-date.
      • Otherwise: do full resolution
    • Otherwise continue to next parent directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions