@rushstack/node-core-library
Advanced tools
Comparing version 5.1.0 to 5.2.0
@@ -14,3 +14,3 @@ /** | ||
export { IFileErrorOptions, IFileErrorFormattingOptions, FileError } from './FileError'; | ||
export { INodePackageJson, IPackageJson, IPackageJsonDependencyTable, IPackageJsonScriptTable, IPackageJsonRepository, IPeerDependenciesMetaTable, IDependenciesMetaTable } from './IPackageJson'; | ||
export { INodePackageJson, IPackageJson, IPackageJsonDependencyTable, IPackageJsonScriptTable, IPackageJsonRepository, IPeerDependenciesMetaTable, IDependenciesMetaTable, IPackageJsonExports } from './IPackageJson'; | ||
export { Import, IImportResolveOptions, IImportResolveAsyncOptions, IImportResolveModuleOptions, IImportResolveModuleAsyncOptions, IImportResolvePackageOptions, IImportResolvePackageAsyncOptions } from './Import'; | ||
@@ -17,0 +17,0 @@ export { InternalError } from './InternalError'; |
@@ -65,2 +65,56 @@ /** | ||
/** | ||
* This interface is part of the {@link IPackageJson} file format. It is used for the values | ||
* of the "exports" field. | ||
* | ||
* See {@link https://nodejs.org/api/packages.html#conditional-exports | Node.js documentation on Conditional Exports} and | ||
* {@link https://nodejs.org/api/packages.html#community-conditions-definitions | Node.js documentation on Community Conditional Exports}. | ||
* | ||
* @public | ||
*/ | ||
export interface IPackageJsonExports { | ||
/** | ||
* This export is like {@link IPackageJsonExports.node} in that it matches for any NodeJS environment. | ||
* This export is specifically for native C++ addons. | ||
*/ | ||
'node-addons'?: string | IPackageJsonExports; | ||
/** | ||
* This export matches for any NodeJS environment. | ||
*/ | ||
node?: string | IPackageJsonExports; | ||
/** | ||
* This export matches when loaded via ESM syntax (i.e. - `import '...'` or `import('...')`). | ||
* This is always mutually exclusive with {@link IPackageJsonExports.require}. | ||
*/ | ||
import?: string | IPackageJsonExports; | ||
/** | ||
* This export matches when loaded via `require()`. | ||
* This is always mutually exclusive with {@link IPackageJsonExports.import}. | ||
*/ | ||
require?: string | IPackageJsonExports; | ||
/** | ||
* This export matches as a fallback when no other conditions match. Because exports are evaluated in | ||
* the order that they are specified in the `package.json` file, this condition should always come last | ||
* as no later exports will match if this one does. | ||
*/ | ||
default?: string | IPackageJsonExports; | ||
/** | ||
* This export matches when loaded by the typing system (i.e. - the TypeScript compiler). | ||
*/ | ||
types?: string | IPackageJsonExports; | ||
/** | ||
* Any web browser environment. | ||
*/ | ||
browser?: string | IPackageJsonExports; | ||
/** | ||
* This export matches in development-only environments. | ||
* This is always mutually exclusive with {@link IPackageJsonExports.production}. | ||
*/ | ||
development?: string | IPackageJsonExports; | ||
/** | ||
* This export matches in production-only environments. | ||
* This is always mutually exclusive with {@link IPackageJsonExports.development}. | ||
*/ | ||
production?: string | IPackageJsonExports; | ||
} | ||
/** | ||
* An interface for accessing common fields from a package.json file whose version field may be missing. | ||
@@ -176,2 +230,43 @@ * | ||
resolutions?: Record<string, string>; | ||
/** | ||
* A table of TypeScript *.d.ts file paths that are compatible with specific TypeScript version | ||
* selectors. This data take a form similar to that of the {@link INodePackageJson.exports} field, | ||
* with fallbacks listed in order in the value array for example: | ||
* | ||
* ```JSON | ||
* "typesVersions": { | ||
* ">=3.1": { | ||
* "*": ["./types-3.1/*", "./types-3.1-fallback/*"] | ||
* }, | ||
* ">=3.0": { | ||
* "*": ["./types-legacy/*"] | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* or | ||
* | ||
* ```JSON | ||
* "typesVersions": { | ||
* ">=3.1": { | ||
* "app/*": ["./app/types-3.1/*"], | ||
* "lib/*": ["./lib/types-3.1/*"] | ||
* }, | ||
* ">=3.0": { | ||
* "app/*": ["./app/types-legacy/*"], | ||
* "lib/*": ["./lib/types-legacy/*"] | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* See the | ||
* {@link https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#version-selection-with-typesversions | ||
* | TypeScript documentation} for details. | ||
*/ | ||
typesVersions?: Record<string, Record<string, [string, ...string[]]>>; | ||
/** | ||
* The "exports" field is used to specify the entry points for a package. | ||
* See {@link https://nodejs.org/api/packages.html#exports | Node.js documentation} | ||
*/ | ||
exports?: string | string[] | Record<string, null | string | IPackageJsonExports>; | ||
} | ||
@@ -178,0 +273,0 @@ /** |
@@ -278,2 +278,3 @@ "use strict"; | ||
packageJson.devDependencies = loadedPackageJson.devDependencies; | ||
packageJson.exports = loadedPackageJson.exports; | ||
packageJson.homepage = loadedPackageJson.homepage; | ||
@@ -287,4 +288,4 @@ packageJson.license = loadedPackageJson.license; | ||
packageJson.scripts = loadedPackageJson.scripts; | ||
packageJson.tsdocMetadata = loadedPackageJson.tsdocMetadata; | ||
packageJson.typings = loadedPackageJson.typings || loadedPackageJson.types; | ||
packageJson.tsdocMetadata = loadedPackageJson.tsdocMetadata; | ||
packageJson.version = loadedPackageJson.version; | ||
@@ -291,0 +292,0 @@ } |
{ | ||
"name": "@rushstack/node-core-library", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"description": "Core libraries that every NodeJS toolchain project should use", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1066552
13796