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

feat(js): skipPackageJson in js lib generator #19821

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all 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 docs/generated/packages/js/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"description": "Do not add dependencies to `package.json`.",
"type": "boolean",
"default": false,
"x-priority": "internal"
},
"skipTsConfig": {
"type": "boolean",
"description": "Do not update tsconfig.json for development experience.",
Expand Down
5 changes: 3 additions & 2 deletions packages/js/src/generators/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ export async function libraryGeneratorInternal(

addProject(tree, options);

tasks.push(addProjectDependencies(tree, options));
if (!options.skipPackageJson) {
tasks.push(addProjectDependencies(tree, options));
}

if (options.publishable) {
tasks.push(await setupVerdaccio(tree, { ...options, skipFormat: true }));
Expand Down Expand Up @@ -706,7 +708,6 @@ function addProjectDependencies(
}

// Vite is being installed in the next step if bundler is vite

// noop
return () => {};
}
Expand Down
6 changes: 6 additions & 0 deletions packages/js/src/generators/library/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"description": "Do not add dependencies to `package.json`.",
"type": "boolean",
"default": false,
"x-priority": "internal"
},
"skipTsConfig": {
"type": "boolean",
"description": "Do not update tsconfig.json for development experience.",
Expand Down
1 change: 1 addition & 0 deletions packages/js/src/utils/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface LibraryGeneratorSchema {
skipFormat?: boolean;
tags?: string;
skipTsConfig?: boolean;
skipPackageJson?: boolean;
includeBabelRc?: boolean;
unitTestRunner?: 'jest' | 'vitest' | 'none';
linter?: Linter;
Expand Down