Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/turbo-gen/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ In this case, you must specify the path to the example separately:
"Do not filter available dependencies by the workspace type"
).default(false)
)
.addOption(
new Option(
"--add-dependencies",
"Add workspace dependencies to the new package.",
).default(true),
)
.action(workspace);

turboGenCli
Expand Down
1 change: 1 addition & 0 deletions packages/turbo-gen/src/commands/workspace/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface TurboGeneratorCLIOptions {
examplePath?: string;
// defaults to false
showAllDependencies: boolean;
addDependencies?: boolean;
}

// convert CLI options to generator options
Expand Down
7 changes: 6 additions & 1 deletion packages/turbo-gen/src/commands/workspace/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,24 @@ export async function dependencies({
workspaceName,
project,
workspaceSource,
showAllDependencies
showAllDependencies,
...opts
}: {
workspaceName: string;
project: Project;
workspaceSource?: Workspace;
showAllDependencies?: boolean;
addDependencies?: boolean;
}) {
const selectedDependencies: DependencyGroups = {
dependencies: {},
devDependencies: {},
peerDependencies: {},
optionalDependencies: {}
};
if (opts.addDependencies === false) {
return selectedDependencies;
}
const { answer: addDependencies } = await confirm({
message: `Add workspace dependencies to "${workspaceName}"?`
});
Expand Down
Loading