@Stability(value=Experimental) public static final class NodePackage.Builder extends Object implements software.amazon.jsii.Builder<NodePackage>
NodePackage.| Modifier and Type | Method and Description |
|---|---|
NodePackage.Builder |
allowLibraryDependencies(Boolean allowLibraryDependencies)
(experimental) Allow the project to include `peerDependencies` and `bundledDependencies`.
|
NodePackage.Builder |
authorEmail(String authorEmail)
(experimental) Author's e-mail.
|
NodePackage.Builder |
authorName(String authorName)
(experimental) Author's name.
|
NodePackage.Builder |
authorOrganization(Boolean authorOrganization)
(experimental) Author's Organization.
|
NodePackage.Builder |
authorUrl(String authorUrl)
(experimental) Author's URL / Website.
|
NodePackage.Builder |
autoDetectBin(Boolean autoDetectBin)
(experimental) Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
|
NodePackage.Builder |
bin(Map<String,String> bin)
(experimental) Binary programs vended with your module.
|
NodePackage |
build() |
NodePackage.Builder |
bundledDeps(List<String> bundledDeps)
(experimental) List of dependencies to bundle into this module.
|
NodePackage.Builder |
codeArtifactOptions(CodeArtifactOptions codeArtifactOptions)
(experimental) Options for publishing npm package to AWS CodeArtifact.
|
static NodePackage.Builder |
create(Project project) |
NodePackage.Builder |
deps(List<String> deps)
(experimental) Runtime dependencies of this module.
|
NodePackage.Builder |
description(String description)
(experimental) The description is just a string that helps people understand the purpose of the package.
|
NodePackage.Builder |
devDeps(List<String> devDeps)
(experimental) Build dependencies for this module.
|
NodePackage.Builder |
entrypoint(String entrypoint)
(experimental) Module entrypoint (`main` in `package.json`).
|
NodePackage.Builder |
homepage(String homepage)
(experimental) Package's Homepage / Website.
|
NodePackage.Builder |
keywords(List<String> keywords)
(experimental) Keywords to include in `package.json`.
|
NodePackage.Builder |
license(String license)
(experimental) License's SPDX identifier.
|
NodePackage.Builder |
licensed(Boolean licensed)
(experimental) Indicates if a license should be added.
|
NodePackage.Builder |
maxNodeVersion(String maxNodeVersion)
(experimental) Minimum node.js version to require via `engines` (inclusive).
|
NodePackage.Builder |
minNodeVersion(String minNodeVersion)
(experimental) Minimum Node.js version to require via package.json `engines` (inclusive).
|
NodePackage.Builder |
npmAccess(NpmAccess npmAccess)
(experimental) Access level of the npm package.
|
NodePackage.Builder |
npmRegistry(String npmRegistry)
Deprecated.
use `npmRegistryUrl` instead
|
NodePackage.Builder |
npmRegistryUrl(String npmRegistryUrl)
(experimental) The base URL of the npm package registry.
|
NodePackage.Builder |
npmTokenSecret(String npmTokenSecret)
(experimental) GitHub secret which contains the NPM token to use when publishing packages.
|
NodePackage.Builder |
packageManager(NodePackageManager packageManager)
(experimental) The Node Package Manager used to execute scripts.
|
NodePackage.Builder |
packageName(String packageName)
(experimental) The "name" in package.json.
|
NodePackage.Builder |
peerDependencyOptions(PeerDependencyOptions peerDependencyOptions)
(experimental) Options for `peerDeps`.
|
NodePackage.Builder |
peerDeps(List<String> peerDeps)
(experimental) Peer dependencies for this module.
|
NodePackage.Builder |
repository(String repository)
(experimental) The repository is the location where the actual code for your package lives.
|
NodePackage.Builder |
repositoryDirectory(String repositoryDirectory)
(experimental) If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.
|
NodePackage.Builder |
scripts(Map<String,String> scripts)
(experimental) npm scripts to include.
|
NodePackage.Builder |
stability(String stability)
(experimental) Package's Stability.
|
@Stability(value=Experimental) public static NodePackage.Builder create(Project project)
project - This parameter is required.NodePackage.Builder.@Stability(value=Experimental) public NodePackage.Builder allowLibraryDependencies(Boolean allowLibraryDependencies)
This is normally only allowed for libraries. For apps, there's no meaning for specifying these.
Default: true
allowLibraryDependencies - Allow the project to include `peerDependencies` and `bundledDependencies`. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder authorEmail(String authorEmail)
authorEmail - Author's e-mail. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder authorName(String authorName)
authorName - Author's name. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder authorOrganization(Boolean authorOrganization)
authorOrganization - Author's Organization. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder authorUrl(String authorUrl)
authorUrl - Author's URL / Website. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder autoDetectBin(Boolean autoDetectBin)
Default: true
autoDetectBin - Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder bin(Map<String,String> bin)
You can use this option to add/customize how binaries are represented in
your package.json, but unless autoDetectBin is false, every
executable file under bin will automatically be added to this section.
bin - Binary programs vended with your module. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder bundledDeps(List<String> bundledDeps)
These modules will be
added both to the dependencies section and bundledDependencies section of
your package.json.
The recommendation is to only specify the module name here (e.g.
express). This will behave similar to yarn add or npm install in the
sense that it will add the module as a dependency to your package.json
file with the latest version (^). You can specify semver requirements in
the same syntax passed to npm i or yarn add (e.g. express@^2) and
this will be what you package.json will eventually include.
bundledDeps - List of dependencies to bundle into this module. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder codeArtifactOptions(CodeArtifactOptions codeArtifactOptions)
Default: - undefined
codeArtifactOptions - Options for publishing npm package to AWS CodeArtifact. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder deps(List<String> deps)
The recommendation is to only specify the module name here (e.g.
express). This will behave similar to yarn add or npm install in the
sense that it will add the module as a dependency to your package.json
file with the latest version (^). You can specify semver requirements in
the same syntax passed to npm i or yarn add (e.g. express@^2) and
this will be what you package.json will eventually include.
Default: []
Example:
// Example automatically generated from non-compiling source. May contain errors. [ 'express', 'lodash', 'foo@^2' ]
deps - Runtime dependencies of this module. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder description(String description)
It can be used when searching for packages in a package manager as well. See https://classic.yarnpkg.com/en/docs/package-json/#toc-description
description - The description is just a string that helps people understand the purpose of the package. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder devDeps(List<String> devDeps)
These dependencies will only be available in your build environment but will not be fetched when this module is consumed.
The recommendation is to only specify the module name here (e.g.
express). This will behave similar to yarn add or npm install in the
sense that it will add the module as a dependency to your package.json
file with the latest version (^). You can specify semver requirements in
the same syntax passed to npm i or yarn add (e.g. express@^2) and
this will be what you package.json will eventually include.
Default: []
Example:
// Example automatically generated from non-compiling source. May contain errors. [ 'typescript', '@types/express' ]
devDeps - Build dependencies for this module. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder entrypoint(String entrypoint)
Set to an empty string to not include main in your package.json
Default: "lib/index.js"
entrypoint - Module entrypoint (`main` in `package.json`). This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder homepage(String homepage)
homepage - Package's Homepage / Website. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder keywords(List<String> keywords)
keywords - Keywords to include in `package.json`. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder license(String license)
See https://github.com/projen/projen/tree/main/license-text for a list of supported licenses.
Use the licensed option if you want to no license to be specified.
Default: "Apache-2.0"
license - License's SPDX identifier. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder licensed(Boolean licensed)
Default: true
licensed - Indicates if a license should be added. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder maxNodeVersion(String maxNodeVersion)
Default: - no max
maxNodeVersion - Minimum node.js version to require via `engines` (inclusive). This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder minNodeVersion(String minNodeVersion)
Default: - no "engines" specified
minNodeVersion - Minimum Node.js version to require via package.json `engines` (inclusive). This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder npmAccess(NpmAccess npmAccess)
Default: - for scoped packages (e.g. `foo@bar`), the default is `NpmAccess.RESTRICTED`, for non-scoped packages, the default is `NpmAccess.PUBLIC`.
npmAccess - Access level of the npm package. This parameter is required.this@Stability(value=Deprecated) @Deprecated public NodePackage.Builder npmRegistry(String npmRegistry)
Cannot be set together with npmRegistryUrl.
npmRegistry - The host name of the npm registry to publish to. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder npmRegistryUrl(String npmRegistryUrl)
Must be a URL (e.g. start with "https://" or "http://")
Default: "https://registry.npmjs.org"
npmRegistryUrl - The base URL of the npm package registry. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder npmTokenSecret(String npmTokenSecret)
Default: "NPM_TOKEN"
npmTokenSecret - GitHub secret which contains the NPM token to use when publishing packages. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder packageManager(NodePackageManager packageManager)
Default: NodePackageManager.YARN
packageManager - The Node Package Manager used to execute scripts. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder packageName(String packageName)
Default: - defaults to project name
packageName - The "name" in package.json. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder peerDependencyOptions(PeerDependencyOptions peerDependencyOptions)
peerDependencyOptions - Options for `peerDeps`. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder peerDeps(List<String> peerDeps)
Dependencies listed here are required to
be installed (and satisfied) by the consumer of this library. Using peer
dependencies allows you to ensure that only a single module of a certain
library exists in the node_modules tree of your consumers.
Note that prior to npm@7, peer dependencies are not automatically installed, which means that adding peer dependencies to a library will be a breaking change for your customers.
Unless peerDependencyOptions.pinnedDevDependency is disabled (it is
enabled by default), projen will automatically add a dev dependency with a
pinned version for each peer dependency. This will ensure that you build &
test your module against the lowest peer version required.
Default: []
peerDeps - Peer dependencies for this module. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder repository(String repository)
See https://classic.yarnpkg.com/en/docs/package-json/#toc-repository
repository - The repository is the location where the actual code for your package lives. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder repositoryDirectory(String repositoryDirectory)
repositoryDirectory - If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder scripts(Map<String,String> scripts)
If a script has the same name as a standard script, the standard script will be overwritten.
Default: {}
scripts - npm scripts to include. This parameter is required.this@Stability(value=Experimental) public NodePackage.Builder stability(String stability)
stability - Package's Stability. This parameter is required.this@Stability(value=Experimental) public NodePackage build()
build in interface software.amazon.jsii.Builder<NodePackage>Copyright © 2021. All rights reserved.