Skip to content

Commit

Permalink
feat(react): add skipPackageJson flag to remote and host generators (#…
Browse files Browse the repository at this point in the history
…27116)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
The `host` and `remote` generators do not have an option to skip package
install.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add the `skipPackageJson` flag to the remote and host generators

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
Coly010 authored Jul 25, 2024
1 parent a0ca858 commit 2e8f162
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/generated/packages/react/generators/host.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@
"type": "boolean",
"description": "Whether the module federation configuration and webpack configuration files should use TS. When --js is used, this flag is ignored.",
"default": true
},
"skipPackageJson": {
"description": "Do not add dependencies to `package.json`.",
"type": "boolean",
"default": false,
"x-priority": "internal"
}
},
"required": ["name"],
Expand Down
6 changes: 6 additions & 0 deletions docs/generated/packages/react/generators/remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@
"type": "boolean",
"description": "Whether the module federation configuration and webpack configuration files should use TS. When --js is used, this flag is ignored.",
"default": true
},
"skipPackageJson": {
"description": "Do not add dependencies to `package.json`.",
"type": "boolean",
"default": false,
"x-priority": "internal"
}
},
"required": ["name"],
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/generators/host/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export async function hostGeneratorInternal(
js: options.js,
dynamic: options.dynamic,
host: options.name,
skipPackageJson: options.skipPackageJson,
});
tasks.push(remoteTask);
remotePort++;
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/generators/host/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface Schema {
setParserOptionsProject?: boolean;
skipFormat?: boolean;
skipNxJson?: boolean;
skipPackageJson?: boolean;
ssr?: boolean;
strict?: boolean;
style: SupportedStyles;
Expand Down
6 changes: 6 additions & 0 deletions packages/react/src/generators/host/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@
"type": "boolean",
"description": "Whether the module federation configuration and webpack configuration files should use TS. When --js is used, this flag is ignored.",
"default": true
},
"skipPackageJson": {
"description": "Do not add dependencies to `package.json`.",
"type": "boolean",
"default": false,
"x-priority": "internal"
}
},
"required": ["name"],
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/generators/remote/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface Schema {
setParserOptionsProject?: boolean;
skipFormat: boolean;
skipNxJson?: boolean;
skipPackageJson?: boolean;
ssr?: boolean;
strict?: boolean;
style: SupportedStyles;
Expand Down
6 changes: 6 additions & 0 deletions packages/react/src/generators/remote/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@
"type": "boolean",
"description": "Whether the module federation configuration and webpack configuration files should use TS. When --js is used, this flag is ignored.",
"default": true
},
"skipPackageJson": {
"description": "Do not add dependencies to `package.json`.",
"type": "boolean",
"default": false,
"x-priority": "internal"
}
},
"required": ["name"],
Expand Down

0 comments on commit 2e8f162

Please sign in to comment.