Skip to content

Add command (or template) to bootstrap pub workspace #61237

@parlough

Description

@parlough

It'd be nice to have a new template or new command to bootstrap a pub workspace, both for a new workspace or in the current directory.

We'd like to use this in some future Dart and Flutter tutorials to streamline the instructions but I also expect it'd be useful for other developers.

dart create -t workspace <directory> [--packages-directory=<workspace packages root directory>] [--packages=<list of workspace package names>]
  1. Add a new workspace template.
  • Creates the specified directory if it doesn't exist.
  • If the specified directory doesn't have a pubspec.yaml, create it.
  1. Add an option to create the directory for packages
  • It's long, but perhaps --packages-directory
  • Defaults to pkgs/ or packages/ (I'm not sure, but dart-lang uses pkgs/)
  1. Add an option to create directories for specified sub packages
  • Even though we used it for package configs in the past, I believe --packages would be the best option.
  • Creates directories for the packages in the --packages-directory from earlier.
  • Adds the packages directories to the workspace map in the pubspec.yaml

Related: #61238

\cc @sigurdm

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions