Interface NodePackageOptions
-
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
AwsCdkConstructLibraryOptions,AwsCdkTypeScriptAppOptions,Cdk8sTypeScriptAppOptions,ConstructLibraryAwsOptions,ConstructLibraryCdk8sOptions,ConstructLibraryCdktfOptions,ConstructLibraryOptions,JsiiProjectOptions,NextJsProjectOptions,NextJsTypeScriptProjectOptions,NodeProjectOptions,ReactProjectOptions,ReactTypeScriptProjectOptions,TypeScriptLibraryProjectOptions,TypeScriptProjectOptions
- All Known Implementing Classes:
AwsCdkConstructLibraryOptions.Jsii$Proxy,AwsCdkTypeScriptAppOptions.Jsii$Proxy,Cdk8sTypeScriptAppOptions.Jsii$Proxy,ConstructLibraryAwsOptions.Jsii$Proxy,ConstructLibraryCdk8sOptions.Jsii$Proxy,ConstructLibraryCdktfOptions.Jsii$Proxy,ConstructLibraryOptions.Jsii$Proxy,JsiiProjectOptions.Jsii$Proxy,NextJsProjectOptions.Jsii$Proxy,NextJsTypeScriptProjectOptions.Jsii$Proxy,NodePackageOptions.Jsii$Proxy,NodeProjectOptions.Jsii$Proxy,ReactProjectOptions.Jsii$Proxy,ReactTypeScriptProjectOptions.Jsii$Proxy,TypeScriptLibraryProjectOptions.Jsii$Proxy,TypeScriptProjectOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-03-28T21:16:43.176Z") @Stability(Experimental) public interface NodePackageOptions extends software.amazon.jsii.JsiiSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classNodePackageOptions.BuilderA builder forNodePackageOptionsstatic classNodePackageOptions.Jsii$ProxyAn implementation forNodePackageOptions
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description static NodePackageOptions.Builderbuilder()default BooleangetAllowLibraryDependencies()(experimental) Allow the project to includepeerDependenciesandbundledDependencies.default StringgetAuthorEmail()(experimental) Author's e-mail.default StringgetAuthorName()(experimental) Author's name.default BooleangetAuthorOrganization()(experimental) Is the author an organization.default StringgetAuthorUrl()(experimental) Author's URL / Website.default BooleangetAutoDetectBin()(experimental) Automatically add all executables under thebindirectory to yourpackage.jsonfile under thebinsection.default Map<String,String>getBin()(experimental) Binary programs vended with your module.default StringgetBugsEmail()(experimental) The email address to which issues should be reported.default StringgetBugsUrl()(experimental) The url to your project's issue tracker.default List<String>getBundledDeps()(experimental) List of dependencies to bundle into this module.default CodeArtifactOptionsgetCodeArtifactOptions()(experimental) Options for npm packages using AWS CodeArtifact.default List<String>getDeps()(experimental) Runtime dependencies of this module.default StringgetDescription()(experimental) The description is just a string that helps people understand the purpose of the package.default List<String>getDevDeps()(experimental) Build dependencies for this module.default StringgetEntrypoint()(experimental) Module entrypoint (maininpackage.json).default StringgetHomepage()(experimental) Package's Homepage / Website.default List<String>getKeywords()(experimental) Keywords to include inpackage.json.default StringgetLicense()(experimental) License's SPDX identifier.default BooleangetLicensed()(experimental) Indicates if a license should be added.default StringgetMaxNodeVersion()(experimental) Minimum node.js version to require viaengines(inclusive).default StringgetMinNodeVersion()(experimental) Minimum Node.js version to require via package.jsonengines(inclusive).default NpmAccessgetNpmAccess()(experimental) Access level of the npm package.default BooleangetNpmProvenance()(experimental) Should provenance statements be generated when the package is published.default StringgetNpmRegistry()Deprecated.usenpmRegistryUrlinsteaddefault StringgetNpmRegistryUrl()(experimental) The base URL of the npm package registry.default StringgetNpmTokenSecret()(experimental) GitHub secret which contains the NPM token to use when publishing packages.default NodePackageManagergetPackageManager()(experimental) The Node Package Manager used to execute scripts.default StringgetPackageName()(experimental) The "name" in package.json.default PeerDependencyOptionsgetPeerDependencyOptions()(experimental) Options forpeerDeps.default List<String>getPeerDeps()(experimental) Peer dependencies for this module.default StringgetPnpmVersion()(experimental) The version of PNPM to use if using PNPM as a package manager.default StringgetRepository()(experimental) The repository is the location where the actual code for your package lives.default StringgetRepositoryDirectory()(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.default List<ScopedPackagesOptions>getScopedPackagesOptions()(experimental) Options for privately hosted scoped packages.default Map<String,String>getScripts()Deprecated.useproject.addTask()orpackage.setScript()default StringgetStability()(experimental) Package's Stability.default YarnBerryOptionsgetYarnBerryOptions()(experimental) Options for Yarn Berry.
-
-
-
Method Detail
-
getAllowLibraryDependencies
@Stability(Experimental) @Nullable default Boolean getAllowLibraryDependencies()
(experimental) Allow the project to includepeerDependenciesandbundledDependencies.This is normally only allowed for libraries. For apps, there's no meaning for specifying these.
Default: true
-
getAuthorEmail
@Stability(Experimental) @Nullable default String getAuthorEmail()
(experimental) Author's e-mail.
-
getAuthorName
@Stability(Experimental) @Nullable default String getAuthorName()
(experimental) Author's name.
-
getAuthorOrganization
@Stability(Experimental) @Nullable default Boolean getAuthorOrganization()
(experimental) Is the author an organization.
-
getAuthorUrl
@Stability(Experimental) @Nullable default String getAuthorUrl()
(experimental) Author's URL / Website.
-
getAutoDetectBin
@Stability(Experimental) @Nullable default Boolean getAutoDetectBin()
(experimental) Automatically add all executables under thebindirectory to yourpackage.jsonfile under thebinsection.Default: true
-
getBin
@Stability(Experimental) @Nullable default Map<String,String> getBin()
(experimental) Binary programs vended with your module.You can use this option to add/customize how binaries are represented in your
package.json, but unlessautoDetectBinisfalse, every executable file underbinwill automatically be added to this section.
-
getBugsEmail
@Stability(Experimental) @Nullable default String getBugsEmail()
(experimental) The email address to which issues should be reported.
-
getBugsUrl
@Stability(Experimental) @Nullable default String getBugsUrl()
(experimental) The url to your project's issue tracker.
-
getBundledDeps
@Stability(Experimental) @Nullable default List<String> getBundledDeps()
(experimental) List of dependencies to bundle into this module.These modules will be added both to the
dependenciessection andbundledDependenciessection of yourpackage.json.The recommendation is to only specify the module name here (e.g.
express). This will behave similar toyarn addornpm installin the sense that it will add the module as a dependency to yourpackage.jsonfile with the latest version (^). You can specify semver requirements in the same syntax passed tonpm ioryarn add(e.g.express@^2) and this will be what youpackage.jsonwill eventually include.
-
getCodeArtifactOptions
@Stability(Experimental) @Nullable default CodeArtifactOptions getCodeArtifactOptions()
(experimental) Options for npm packages using AWS CodeArtifact.This is required if publishing packages to, or installing scoped packages from AWS CodeArtifact
Default: - undefined
-
getDeps
@Stability(Experimental) @Nullable default List<String> getDeps()
(experimental) Runtime dependencies of this module.The recommendation is to only specify the module name here (e.g.
express). This will behave similar toyarn addornpm installin the sense that it will add the module as a dependency to yourpackage.jsonfile with the latest version (^). You can specify semver requirements in the same syntax passed tonpm ioryarn add(e.g.express@^2) and this will be what youpackage.jsonwill eventually include.Default: []
Example:
[ 'express', 'lodash', 'foo@^2' ]
-
getDescription
@Stability(Experimental) @Nullable default String getDescription()
(experimental) The description is just a string that helps people understand the purpose of the package.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
-
getDevDeps
@Stability(Experimental) @Nullable default List<String> getDevDeps()
(experimental) Build dependencies for this module.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 toyarn addornpm installin the sense that it will add the module as a dependency to yourpackage.jsonfile with the latest version (^). You can specify semver requirements in the same syntax passed tonpm ioryarn add(e.g.express@^2) and this will be what youpackage.jsonwill eventually include.Default: []
Example:
[ 'typescript', '@types/express' ]
-
getEntrypoint
@Stability(Experimental) @Nullable default String getEntrypoint()
(experimental) Module entrypoint (maininpackage.json).Set to an empty string to not include
mainin your package.jsonDefault: "lib/index.js"
-
getHomepage
@Stability(Experimental) @Nullable default String getHomepage()
(experimental) Package's Homepage / Website.
-
getKeywords
@Stability(Experimental) @Nullable default List<String> getKeywords()
(experimental) Keywords to include inpackage.json.
-
getLicense
@Stability(Experimental) @Nullable default String getLicense()
(experimental) License's SPDX identifier.See https://github.com/projen/projen/tree/main/license-text for a list of supported licenses. Use the
licensedoption if you want to no license to be specified.Default: "Apache-2.0"
-
getLicensed
@Stability(Experimental) @Nullable default Boolean getLicensed()
(experimental) Indicates if a license should be added.Default: true
-
getMaxNodeVersion
@Stability(Experimental) @Nullable default String getMaxNodeVersion()
(experimental) Minimum node.js version to require viaengines(inclusive).Default: - no max
-
getMinNodeVersion
@Stability(Experimental) @Nullable default String getMinNodeVersion()
(experimental) Minimum Node.js version to require via package.jsonengines(inclusive).Default: - no "engines" specified
-
getNpmAccess
@Stability(Experimental) @Nullable default NpmAccess getNpmAccess()
(experimental) Access level of the npm package.Default: - for scoped packages (e.g. `foo@bar`), the default is `NpmAccess.RESTRICTED`, for non-scoped packages, the default is `NpmAccess.PUBLIC`.
-
getNpmProvenance
@Stability(Experimental) @Nullable default Boolean getNpmProvenance()
(experimental) Should provenance statements be generated when the package is published.A supported package manager is required to publish a package with npm provenance statements and you will need to use a supported CI/CD provider.
Note that the projen
ReleaseandPublishercomponents are usingpublibto publish packages, which is using npm internally and supports provenance statements independently of the package manager used.Default: - true for public packages, false otherwise
-
getNpmRegistry
@Stability(Deprecated) @Deprecated @Nullable default String getNpmRegistry()
Deprecated.usenpmRegistryUrlinstead(deprecated) The host name of the npm registry to publish to.Cannot be set together with
npmRegistryUrl.
-
getNpmRegistryUrl
@Stability(Experimental) @Nullable default String getNpmRegistryUrl()
(experimental) The base URL of the npm package registry.Must be a URL (e.g. start with "https://" or "http://")
Default: "https://registry.npmjs.org"
-
getNpmTokenSecret
@Stability(Experimental) @Nullable default String getNpmTokenSecret()
(experimental) GitHub secret which contains the NPM token to use when publishing packages.Default: "NPM_TOKEN"
-
getPackageManager
@Stability(Experimental) @Nullable default NodePackageManager getPackageManager()
(experimental) The Node Package Manager used to execute scripts.Default: NodePackageManager.YARN_CLASSIC
-
getPackageName
@Stability(Experimental) @Nullable default String getPackageName()
(experimental) The "name" in package.json.Default: - defaults to project name
-
getPeerDependencyOptions
@Stability(Experimental) @Nullable default PeerDependencyOptions getPeerDependencyOptions()
(experimental) Options forpeerDeps.
-
getPeerDeps
@Stability(Experimental) @Nullable default List<String> getPeerDeps()
(experimental) Peer dependencies for this module.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_modulestree 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.pinnedDevDependencyis 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: []
-
getPnpmVersion
@Stability(Experimental) @Nullable default String getPnpmVersion()
(experimental) The version of PNPM to use if using PNPM as a package manager.Default: "7"
-
getRepository
@Stability(Experimental) @Nullable default String getRepository()
(experimental) The repository is the location where the actual code for your package lives.See https://classic.yarnpkg.com/en/docs/package-json/#toc-repository
-
getRepositoryDirectory
@Stability(Experimental) @Nullable default String getRepositoryDirectory()
(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.
-
getScopedPackagesOptions
@Stability(Experimental) @Nullable default List<ScopedPackagesOptions> getScopedPackagesOptions()
(experimental) Options for privately hosted scoped packages.Default: - fetch all scoped packages from the public npm registry
-
getScripts
@Stability(Deprecated) @Deprecated @Nullable default Map<String,String> getScripts()
Deprecated.useproject.addTask()orpackage.setScript()(deprecated) npm scripts to include.If a script has the same name as a standard script, the standard script will be overwritten. Also adds the script as a task.
Default: {}
-
getStability
@Stability(Experimental) @Nullable default String getStability()
(experimental) Package's Stability.
-
getYarnBerryOptions
@Stability(Experimental) @Nullable default YarnBerryOptions getYarnBerryOptions()
(experimental) Options for Yarn Berry.Default: - Yarn Berry v4 with all default options
-
builder
@Stability(Experimental) static NodePackageOptions.Builder builder()
- Returns:
- a
NodePackageOptions.BuilderofNodePackageOptions
-
-