@mnrendra/types-package
Version:
package.json interface extended from the official and unofficial fields.
1,397 lines (1,345 loc) • 70 kB
TypeScript
import { Config as Config$1 } from '@jest/types';
type URL = `${string}:${string}`;
type Email = `${string}@${string}.${string}`;
/**
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#people-fields-author-contributors
*/
type People = string | {
name: string;
email?: Email;
url?: URL;
};
type AnyScripts = Record<string, string | undefined>;
type BaseName = `~${string}` | `-${string}` | `0${string}` | `1${string}` | `2${string}` | `3${string}` | `4${string}` | `5${string}` | `6${string}` | `7${string}` | `8${string}` | `9${string}` | `a${string}` | `b${string}` | `c${string}` | `d${string}` | `e${string}` | `f${string}` | `g${string}` | `h${string}` | `i${string}` | `j${string}` | `k${string}` | `l${string}` | `m${string}` | `n${string}` | `o${string}` | `p${string}` | `q${string}` | `r${string}` | `s${string}` | `t${string}` | `u${string}` | `v${string}` | `w${string}` | `x${string}` | `y${string}` | `z${string}`;
/**
* The name of the package.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#name
*/
type Name = BaseName | `@${BaseName}/${BaseName}`;
/**
* Version must be parseable by node-semver, which is bundled with npm as a
* dependency.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#version
*/
type Version = `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}` | `${number}.${number}.${number}+${string}`;
/**
* This helps people discover your package as it's listed in 'npm search'.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#keywords
*/
type Keywords = string[];
/**
* The url to your project's issue tracker and / or the email address to which
* issues should be reported. These are helpful for people who encounter issues
* with your package.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#bugs
*/
type Bugs = URL | Email | {
/**
* The url to your project's issue tracker.
*/
url?: URL;
/**
* The email address to which issues should be reported.
*/
email?: Email;
};
/**
* A list of people who contributed to this package.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#people-fields-author-contributors
*/
type Contributors = People[];
type Fund = URL | {
/**
* URL to a website with details about how to fund the package.
*/
url: URL;
/**
* The type of funding or the platform through which funding can be provided,
* e.g. patreon, opencollective, tidelift or github.
*/
type?: string;
};
/**
* Used to inform about ways to help fund development of the package.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#funding
*/
type Funding = Fund | Fund[];
/**
* The 'files' field is an array of files to include in your project. If you
* name a folder in the array, then it will also include the files inside that
* folder.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#files
*/
type Files = string[];
/**
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#browser
*/
type Browser = string | Record<string, unknown>;
/**
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#bin
*/
type Bin = string | Record<string, string>;
/**
* Specify either a single file or an array of filenames to put in place for
* the man program to find.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#man
*/
type Man = string | string[];
/**
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#directories
*/
interface Directories$2 {
/**
* If you specify a 'bin' directory, then all the files in that folder will
* be used as the 'bin' hash.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#directoriesbin
*/
bin?: string;
/**
* A folder that is full of man pages. Sugar to generate a 'man' array by
* walking the folder.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#directoriesman
*/
man?: string;
}
/**
* Specify the place where your code lives. This is helpful for people who want
* to contribute.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#repository
*/
type Repository = URL | {
type?: string;
url?: URL;
directory?: string;
};
/**
* The 'scripts' member is an object hash of script commands that are run at
* various times in the lifecycle of your package. The key is the lifecycle
* event, and the value is the command to run at that point.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#scripts
*/
interface Scripts$2 {
/**
* install scripts
*/
/**
* Run BEFORE the package is installed.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-install
*/
preinstall?: string;
[key: `preinstall:${string}`]: string;
/**
* Run AFTER the package is installed.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-install
*/
install?: string;
[key: `install:${string}`]: string;
/**
* Run AFTER the package is installed.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-install
*/
postinstall?: string;
[key: `postinstall:${string}`]: string;
/**
* pack scripts
*/
/**
* Run BEFORE a tarball is packed (on npm pack, npm publish, and when
* installing git dependencies).
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-pack
*/
prepack?: string;
[key: `prepack:${string}`]: string;
/**
* Run both BEFORE the package is packed and published, and on local npm
* install without any arguments. This is run AFTER prepublish, but BEFORE
* prepublishOnly.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-pack
*/
prepare?: string;
[key: `prepare:${string}`]: string;
/**
* Run AFTER the tarball has been generated and moved to its final
* destination.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-pack
*/
postpack?: string;
[key: `postpack:${string}`]: string;
/**
* publish scripts
*/
/**
* @deprecated
*
* Run BEFORE the package is published (Also run on local npm install
* without any arguments).
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#prepare-and-prepublish
*/
prepublish?: string;
[key: `prepublish:${string}`]: string;
/**
* Run BEFORE the package is prepared and packed, ONLY on npm publish.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-publish
*/
prepublishOnly?: string;
[key: `prepublishOnly:${string}`]: string;
/**
* Publishes a package to the registry so that it can be installed by name.
* See https://docs.npmjs.com/cli/v8/commands/npm-publish
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-publish
*/
publish?: string;
[key: `publish:${string}`]: string;
/**
* Run AFTER the package is published.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-publish
*/
postpublish?: string;
[key: `postpublish:${string}`]: string;
/**
* restart scripts
*/
/**
* Run by the 'npm restart' command. Note: 'npm restart' will run the stop
* and start scripts if no restart script is provided.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-restart
*/
prerestart?: string;
[key: `prerestart:${string}`]: string;
/**
* Run by the 'npm restart' command. Note: 'npm restart' will run the stop
* and start scripts if no restart script is provided.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-restart
*/
restart?: string;
[key: `restart:${string}`]: string;
/**
* Run by the 'npm restart' command. Note: 'npm restart' will run the stop
* and start scripts if no restart script is provided.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-restart
*/
postrestart?: string;
[key: `postrestart:${string}`]: string;
/**
* start scripts
*/
/**
* Run by the 'npm start' command.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-start
*/
prestart?: string;
[key: `prestart:${string}`]: string;
/**
* Run by the 'npm start' command.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-start
*/
start?: string;
[key: `start:${string}`]: string;
/**
* Run by the 'npm start' command.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-start
*/
poststart?: string;
[key: `poststart:${string}`]: string;
/**
* stop scripts
*/
/**
* Run by the 'npm stop' command.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-stop
*/
prestop?: string;
[key: `prestop:${string}`]: string;
/**
* Run by the 'npm stop' command.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-stop
*/
stop?: string;
[key: `stop:${string}`]: string;
/**
* Run by the 'npm stop' command.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-stop
*/
poststop?: string;
[key: `poststop:${string}`]: string;
/**
* test scripts
*/
/**
* Run by the 'npm test' command.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-test
*/
pretest?: string;
[key: `pretest:${string}`]: string;
/**
* Run by the 'npm test' command.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-test
*/
test?: string;
[key: `test:${string}`]: string;
/**
* Run by the 'npm test' command.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-test
*/
posttest?: string;
[key: `posttest:${string}`]: string;
/**
* uninstall scripts
*/
/**
* Run BEFORE the package is uninstalled.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#a-note-on-a-lack-of-npm-uninstall-scripts
*/
preuninstall?: string;
[key: `preuninstall:${string}`]: string;
/**
* Run BEFORE the package is uninstalled.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#a-note-on-a-lack-of-npm-uninstall-scripts
*/
uninstall?: string;
[key: `uninstall:${string}`]: string;
/**
* Run AFTER the package is uninstalled.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#a-note-on-a-lack-of-npm-uninstall-scripts
*/
postuninstall?: string;
[key: `postuninstall:${string}`]: string;
/**
* version scripts
*/
/**
* Run BEFORE bump the package version.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-version
*/
preversion?: string;
[key: `preversion:${string}`]: string;
/**
* Run BEFORE bump the package version.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-version
*/
version?: string;
[key: `version:${string}`]: string;
/**
* Run AFTER bump the package version.
*
* @see https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-version
*/
postversion?: string;
[key: `postversion:${string}`]: string;
}
/**
* A 'config' hash can be used to set configuration parameters used in package
* scripts that persist across upgrades.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#config
*/
type Config = Record<string, unknown>;
/**
* Dependencies are specified with a simple hash of package name to version
* range. The version range is a string which has one or more space-separated
* descriptors. Dependencies can also be identified with a tarball or git URL.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#dependencies
*/
type Dependencies = Record<string, string>;
/**
* When a user installs your package, warnings are emitted if packages
* specified in "peerDependencies" are not already installed. The
* "peerDependenciesMeta" field serves to provide more information on how your
* peer dependencies are utilized. Most commonly, it allows peer dependencies
* to be marked as optional. Metadata for this field is specified with a simple
* hash of the package name to a metadata object.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependenciesmeta
*/
type PeerDependenciesMeta = Record<string, {
/**
* Specifies that this peer dependency is optional and should not be
* installed automatically.
*/
optional?: boolean;
}>;
/**
* @deprecated This field is honored, but "bundledDependencies" is the correct
* field name.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#bundledependencies
*/
type BundleDependencies = string[] | boolean;
/**
* Overrides is used to support selective version overrides using npm, which
* lets you define custom package versions or ranges inside your dependencies.
* For yarn, use resolutions instead.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides
*/
type Overrides = Record<string, unknown>;
/**
* Engine compatibility.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#engines
*/
interface Engines$2 {
node?: string;
}
/**
* Specify which operating systems your module will run on.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#os
*/
type OS = string[];
/**
* Specify that your code only runs on certain cpu architectures.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#cpu
*/
type CPU = string[];
/**
* If set to true, then npm will refuse to publish it.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#private
*/
type Private = boolean | 'false' | 'true';
/**
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#publishconfig
*/
interface PublishConfig {
access?: 'public' | 'restricted';
registry?: URL;
tag?: string;
}
/**
* Allows packages within a directory to depend on one another using direct
* linking of local files. Additionally, dependencies within a workspace are
* hoisted to the workspace root when possible to reduce duplication. Note:
* It's also a good idea to set "private" to true when using this feature.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#workspaces
*/
type Workspaces = string[] | {
/**
* Workspace package paths. Glob patterns are supported.
*/
packages?: string[];
/**
* Packages to block from hoisting to the workspace root. Currently only
* supported in Yarn only.
*/
nohoist?: string[];
};
/**
* Official `package.json` fields.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json
*/
interface OfficialPackage {
/**
* The name of the package.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#name
*/
name: Name;
/**
* Version must be parseable by node-semver, which is bundled with npm as a
* dependency.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#version
*/
version: Version;
/**
* This helps people discover your package, as it's listed in 'npm search'.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#description
*/
description?: string;
/**
* This helps people discover your package as it's listed in 'npm search'.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#keywords
*/
keywords?: Keywords;
/**
* The url to the project homepage.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#homepage
*/
homepage?: URL;
/**
* The url to your project's issue tracker and / or the email address to
* which issues should be reported. These are helpful for people who
* encounter issues with your package.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#bugs
*/
bugs?: Bugs;
/**
* You should specify a license for your package so that people know how they
* are permitted to use it, and any restrictions you're placing on it.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#license
*/
license?: string;
/**
* A person who has been involved in creating or maintaining this package.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#people-fields-author-contributors
*/
author?: People;
/**
* A list of people who contributed to this package.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#people-fields-author-contributors
*/
contributors?: Contributors;
/**
* Used to inform about ways to help fund development of the package.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#funding
*/
funding?: Funding;
/**
* The 'files' field is an array of files to include in your project. If you
* name a folder in the array, then it will also include the files inside
* that folder.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#files
*/
files?: Files;
/**
* The main field is a module ID that is the primary entry point to your
* program.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#main
*/
main?: string;
/**
* note: There is no this field in vscode.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#browser
*/
browser?: Browser;
/**
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#bin
*/
bin?: Bin;
/**
* Specify either a single file or an array of filenames to put in place for
* the man program to find.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#man
*/
man?: Man;
/**
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#directories
*/
directories?: Directories$2;
/**
* Specify the place where your code lives. This is helpful for people who
* want to contribute.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#repository
*/
repository?: Repository;
/**
* The 'scripts' member is an object hash of script commands that are run at
* various times in the lifecycle of your package. The key is the lifecycle
* event, and the value is the command to run at that point.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#scripts
*/
scripts?: Scripts$2;
/**
* A 'config' hash can be used to set configuration parameters used in
* package scripts that persist across upgrades.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#config
*/
config?: Config;
/**
* Dependencies are specified with a simple hash of package name to version
* range. The version range is a string which has one or more space-separated
* descriptors. Dependencies can also be identified with a tarball or git URL.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#dependencies
*/
dependencies?: Dependencies;
/**
* Dependencies are specified with a simple hash of package name to version
* range. The version range is a string which has one or more space-separated
* descriptors. Dependencies can also be identified with a tarball or git URL.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#devdependencies
*/
devDependencies?: Dependencies;
/**
* Dependencies are specified with a simple hash of package name to version
* range. The version range is a string which has one or more space-separated
* descriptors. Dependencies can also be identified with a tarball or git URL.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependencies
*/
peerDependencies?: Dependencies;
/**
* When a user installs your package, warnings are emitted if packages
* specified in "peerDependencies" are not already installed. The
* "peerDependenciesMeta" field serves to provide more information on how
* your peer dependencies are utilized. Most commonly, it allows peer
* dependencies to be marked as optional. Metadata for this field is
* specified with a simple hash of the package name to a metadata object.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependenciesmeta
*/
peerDependenciesMeta?: PeerDependenciesMeta;
/**
* @deprecated This field is honored, but "bundledDependencies" is the
* correct field name.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#bundledependencies
*/
bundleDependencies?: BundleDependencies;
/**
* Dependencies are specified with a simple hash of package name to version
* range. The version range is a string which has one or more space-separated
* descriptors. Dependencies can also be identified with a tarball or git URL.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#optionaldependencies
*/
optionalDependencies?: Dependencies;
/**
* Overrides is used to support selective version overrides using npm, which
* lets you define custom package versions or ranges inside your
* dependencies. For yarn, use resolutions instead.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides
*/
overrides?: Overrides;
/**
* Engine compatibility.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#engines
*/
engines?: Engines$2;
/**
* Specify which operating systems your module will run on.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#os
*/
os?: OS;
/**
* Specify that your code only runs on certain cpu architectures.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#cpu
*/
cpu?: CPU;
/**
* If set to true, then npm will refuse to publish it.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#private
*/
private?: Private;
/**
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#publishconfig
*/
publishConfig?: PublishConfig;
/**
* Allows packages within a directory to depend on one another using direct
* linking of local files. Additionally, dependencies within a workspace are
* hoisted to the workspace root when possible to reduce duplication. Note:
* It's also a good idea to set "private" to true when using this feature.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#workspaces
*/
workspaces?: Workspaces;
}
/**
* Activation events for the VS Code extension.
*
* note: This is not a `package.json` official field.
*/
type ActivationEvents = Array<'*' | 'onAuthenticationRequest:authenticationProviderId' | 'onCommand:commandId' | 'onCustomEditor:viewType' | 'onDebug' | 'onDebugAdapterProtocolTracker:type' | 'onDebugDynamicConfigurations' | 'onDebugInitialConfigurations' | 'onDebugResolve:type' | 'onEditSession:scheme' | 'onFileSystem:scheme' | 'onLanguage:languageId' | 'onNotebook:type' | 'onOpenExternalUri' | 'onRenderer:rendererId' | 'onSearch:scheme' | 'onStartupFinished' | 'onTaskType:taskType' | 'onTerminalProfile:terminalId' | 'onTerminalQuickFixRequest:quickFixId' | 'onUri' | 'onView:viewId' | 'onWalkthrough:walkthroughID' | 'onWebviewPanel:viewType' | 'workspaceContains:filePattern'>;
/**
* Describe the API provided by this extension. For more details visit:
* https://code.visualstudio.com/api/advanced-topics/remote-extensions#handling-dependencies-with-remote-extensions
*
* `none`: Give up entirely the ability to export any APIs. This allows other
* extensions that depend on this extension to run in a separate extension host
* process or in a remote machine.
*
* note: This is not a `package.json` official field.
*/
type API = 'none';
/**
* AVA Config Schema
*
* Configuration Schema for the JavaScript test runner AVA.
*
* note: This is not a `package.json` official field.
*/
interface AVA {
/**
* Defaults to `true` to cache compiled files under
* `node_modules/.cache/ava.` If `false`, files are cached in a temporary
* directory instead.
*/
cache?: boolean;
/**
* Max number of test files running at the same time (default: CPU cores).
*/
concurrency?: number;
/**
* Environment variables
*
* Specifies environment variables to be made available to the tests. The
* environment variables defined here override the ones from `process.env`.
*/
environmentVariables?: Record<string, string>;
/**
* Extensions of test files. Setting this overrides the default
* `["cjs", "mjs", "js"]` value, so make sure to include those extensions in
* the list. Experimentally you can configure how files are loaded.
*/
extensions?: string[] | Record<string, 'commonjs' | 'module'>;
/**
* Stop running further tests once a test fails.
*/
failFast?: boolean;
/**
* If `false`, does not fail a test if it doesn't run assertions.
*/
failWithoutAssertions?: boolean;
/**
* An array of glob patterns to select test files. Files with an underscore
* prefix are ignored. By default only selects files with `cjs`, `mjs` &
* `js` extensions, even if the pattern matches other files. Specify
* `extensions` to allow other file extensions.
*/
files?: string[];
/**
* An array of glob patterns to match files that, even if changed, are
* ignored by the watcher.
*/
ignoredByWatcher?: string[];
/**
* Not typically useful in the `package.json` configuration, but equivalent
* to specifying `--match` on the CLI.
*/
match?: string[];
/**
* Configure Node.js arguments used to launch worker processes.
*/
nodeArguments?: string[];
/**
* Extra modules to require before tests are run. Modules are required in
* the worker processes.
*/
require?: string[];
/**
* Specifies a fixed location for storing snapshot files. Use this if your
* snapshots are ending up in the wrong location.
*/
snapshotDir?: string;
/**
* If `true`, enables the TAP reporter.
*/
tap?: boolean;
/**
* Timeouts in AVA behave differently than in other test frameworks. AVA
* resets a timer after each test, forcing tests to quit if no new test
* results were received within the specified timeout. This can be used to
* handle stalled tests. See our timeout documentation for more options.
*/
timeout?: number | `${number}s` | `${number}m`;
/**
* Configuration
*
* Configures @ava/typescript for projects that precompile TypeScript.
* Alternatively, you can use `ts-node` to do live testing without
* transpiling, in which case you shouldn't use the `typescript` property.
*/
typescript?: {
/**
* If `false`, AVA will assume you have already compiled your project. If
* set to `'tsc'`, AVA will run the TypeScript compiler before running your
* tests. This can be inefficient when using AVA in watch mode.
*/
compile?: false | 'tsc';
/**
* You can configure AVA to recognize additional file extensions as
* TypeScript (e.g., `["ts", "tsx"]` to add partial JSX support). Note that
* the preserve mode for JSX is not (yet) supported. See also AVA's
* `extensions` object.
*/
extensions?: string[];
/**
* paths
*
* AVA searches your entire project for `*.js`, `*.cjs`, `*.mjs` and `*.ts`
* files (or other extensions you've configured). It will ignore such files
* found in the `rewritePaths` targets (e.g. `build/`). If you use more
* specific paths, for instance `build/main/`, you may need to change AVA's
* `files` configuration to ignore other directories. Paths are relative to
* your project directory.
*/
rewritePaths?: Record<string, unknown>;
};
/**
* If `false`, disable parallel builds (default: `true`).
*/
utilizeParallelBuilds?: boolean;
/**
* If `true`, enables verbose output (though currently non-verbose output
* is not supported).
*/
verbose?: boolean;
/**
* Use worker threads to run tests (enabled by default). If `false`, tests
* will run in child processes.
*/
workerThreads?: boolean;
}
/**
* Array of badges to display in the sidebar of the Marketplace's extension
* page.
*
* note: This is not a `package.json` official field.
*/
type Badges = Array<{
/**
* Badge description.
*/
description: string;
/**
* Badge link.
*/
href: URL;
/**
* Badge image URL.
*/
url: URL;
}>;
/**
* Array of package names that will be bundled when publishing the package.
*
* note: This is not a `package.json` official field.
*/
type BundledDependencies = string[] | boolean;
/**
* Declare the set of supported capabilities by the extension.
*
* note: This is not a `package.json` official field.
*/
interface Capabilities {
/**
* Declares how the extension should be handled in untrusted workspaces.
*/
untrustedWorkspaces?: {
/**
* Declares the level of support for untrusted workspaces by the
* extension.
*
* `limited`: The extension will be enabled in untrusted workspaces with
* some functionality disabled.
*/
supported: 'limited' | boolean;
/**
* A description of how workspace trust affects the extensions behavior
* and why it is needed. This only applies when `supported` is not `true`.
*/
description?: string;
/**
* A list of configuration keys contributed by the extension that should
* not use workspace values in untrusted workspaces.
*/
restrictedConfigurations?: string[];
};
/**
* Declares whether the extension should be enabled in virtual workspaces. A
* virtual workspace is a workspace which is not backed by any on-disk
* resources. When false, this extension will be automatically disabled in
* virtual workspaces. Default is true.
*/
virtualWorkspaces?: boolean | {
/**
* Declares the level of support for virtual workspaces by the
* extension.
*
* `limited`: The extension will be enabled in untrusted workspaces with
* some functionality disabled.
*
* `false`: The extension will not be enabled in virtual workspaces.
*
* `true`: The extension will be enabled in virtual workspaces with all
* functionality enabled.
*/
supported?: 'limited' | boolean;
/**
* A description of how virtual workspaces affects the extensions behavior
* and why it is needed. This only applies when `supported` is not `true`.
*/
description?: string;
};
}
/**
* The categories used by the VS Code gallery to categorize the extension.
*
* note: This is not a `package.json` official field.
*/
type Categories = Array<'Azure' | 'Data Science' | 'Debuggers' | 'Education' | 'Extension Packs' | 'Formatters' | 'Keymaps' | 'Language Packs' | 'Linters' | 'Machine Learning' | 'Notebooks' | 'Other' | 'Programming Languages' | 'SCM Providers' | 'Snippets' | 'Testing' | 'Themes' | 'Visualization'>;
/**
* All contributions of the VS Code extension represented by this package.
*
* note: This is not a `package.json` official field.
*/
type Contributes = Record<string, unknown>;
/**
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#directories
*/
interface Directories$1 {
/**
* Put markdown files in here. Eventually, these will be displayed nicely,
* maybe, someday.
*
* note: This is not a `package.json` official field.
*/
doc?: string;
/**
* Put example scripts in here. Someday, it might be exposed in some clever
* way.
*
* note: This is not a `package.json` official field.
*/
example?: string;
/**
* Tell people where the bulk of your library is. Nothing special is done
* with the lib folder in any way, but it's useful meta info.
*
* note: This is not a `package.json` official field.
*/
lib?: string;
/**
* note: This is not a `package.json` official field.
*/
test?: string;
}
/**
* note: This is not a `package.json` official field.
*/
interface Dist {
shasum?: string;
tarball?: string;
}
/**
* Enable API proposals to try them out. Only valid during development.
* Extensions cannot be published with this property. For more details visit:
* https://code.visualstudio.com/api/advanced-topics/using-proposed-api
*
* note: This is not a `package.json` official field.
*/
type EnabledApiProposals = Array<'authSession' | 'codiconDecoration' | 'commentsDraftState' | 'contribCommentEditorActionsMenu' | 'contribCommentPeekContext' | 'contribCommentThreadAdditionalMenu' | 'contribEditorContentMenu' | 'contribEditSessions' | 'contribLabelFormatterWorkspaceTooltip' | 'contribMenuBarHome' | 'contribMergeEditorMenus' | 'contribNotebookStaticPreloads' | 'contribRemoteHelp' | 'contribShareMenu' | 'contribViewsRemote' | 'contribViewsWelcome' | 'customEditorMove' | 'debugFocus' | 'diffCommand' | 'diffContentOptions' | 'documentFiltersExclusive' | 'documentPaste' | 'dropMetadata' | 'editorInsets' | 'editSessionIdentityProvider' | 'envCollectionWorkspace' | 'envShellEvent' | 'extensionRuntime' | 'extensionsAny' | 'externalUriOpener' | 'fileComments' | 'fileSearchProvider' | 'findTextInFiles' | 'formatMultipleRanges' | 'fsChunks' | 'getSessions' | 'handleIssueUri' | 'idToken' | 'indentSize' | 'inlineCompletionsAdditions' | 'interactive' | 'interactiveWindow' | 'ipc' | 'notebookCellExecutionState' | 'notebookControllerAffinityHidden' | 'notebookDeprecated' | 'notebookExecution' | 'notebookKernelSource' | 'notebookLiveShare' | 'notebookMessaging' | 'notebookMime' | 'portsAttributes' | 'profileContentHandlers' | 'quickDiffProvider' | 'quickPickItemTooltip' | 'quickPickSortByLabel' | 'resolvers' | 'saveEditor' | 'scmActionButton' | 'scmSelectedProvider' | 'scmTextDocument' | 'scmValidation' | 'semanticSimilarity' | 'showLocal' | 'tabInputTextMerge' | 'taskPresentationGroup' | 'telemetry' | 'terminalDataWriteEvent' | 'terminalDimensions' | 'terminalQuickFixProvider' | 'testCoverage' | 'testObserver' | 'textSearchProvider' | 'timeline' | 'tokenInformation' | 'treeItemCheckbox' | 'treeViewReveal' | 'tunnels' | 'workspaceTrust'>;
/**
* Engine compatibility.
*
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#engines
*/
interface Engines$1 {
/**
* For VS Code extensions, specifies the VS Code version that the extension
* is compatible with. Cannot be *. For example: ^0.10.5 indicates
* compatibility with a minimum VS Code version of 0.10.5.
*
* note: This is not a `package.json` official field.
*/
vscode?: string;
}
/**
* JSON schema for ESLint configuration files.
*
* ESLint configuration.
*
* note: This is not a `package.json` official field.
*/
interface ESLintConfig {
/**
* By default, ESLint supports only ECMAScript 5 syntax. You can override
* that setting to enable support for ECMAScript 6 as well as JSX by using
* configuration settings.
*/
ecmaFeatures?: Record<string, unknown>;
/**
* An environment defines global variables that are predefined.
*/
env?: Record<string, unknown>;
/**
* If you want to extend a specific configuration file, you can use the
* extends property and specify the path to the file. The path can be either
* relative or absolute.
*/
extends?: string | string[];
/**
* Set each global variable name equal to true to allow the variable to be
* overwritten or false to disallow overwriting.
*/
globals?: Record<string, 'off' | 'readonly' | 'writable'>;
/**
* Tell ESLint to ignore specific files and directories. Each value uses the
* same pattern as the `.eslintignore` file.
*/
ignorePatterns?: string | string[];
/**
* Prevent comments from changing config or rules.
*/
noInlineConfig?: boolean;
/**
* Allows to override configuration for files and folders, specified by glob
* patterns.
*/
overrides?: Array<Record<string, unknown>>;
parser?: string;
/**
* The JavaScript language options to be supported.
*/
parserOptions?: {
/**
* By default, ESLint supports only ECMAScript 5 syntax. You can override
* that setting to enable support for ECMAScript 6 as well as JSX by using
* configuration settings.
*/
ecmaFeatures?: Record<string, unknown>;
/**
* Set to 3, 5, 6, 7, 8, 9, 10, 11 (default), 12, 13, 14 or "latest" to
* specify the version of ECMAScript syntax you want to use. You can also
* set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same
* as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022
* (same as 13) or 2023 (same as 14) to use the year-based naming. "latest"
* always enables the latest supported ECMAScript version.
*/
ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 'latest';
/**
* Set to "script" (default) or "module" if your code is in ECMAScript
* modules.
*/
sourceType?: 'script' | 'module';
};
/**
* ESLint supports the use of third-party plugins. Before using the plugin,
* you have to install it using npm.
*/
plugins?: string[];
/**
* By default, ESLint will look for configuration files in all parent folders
* up to the root directory. This can be useful if you want all of your
* projects to follow a certain convention, but can sometimes lead to
* unexpected results. To limit ESLint to a specific project, set this to
* `true` in a configuration in the root of your project.
*/
root?: boolean;
/**
* ESLint comes with a large number of rules. You can modify which rules your
* project uses either using configuration comments or configuration files.
*/
rules?: Record<string, unknown>;
/**
* ESLint supports adding shared settings into configuration file. You can
* add settings object to ESLint configuration file and it will be supplied
* to every rule that will be executed. This may be useful if you are adding
* custom rules and want them to have access to the same information and be
* easily configurable.
*/
settings?: Record<string, unknown>;
}
/**
* A module ID with untranspiled code that is the primary entry point to your
* program.
*
* note: This is not a `package.json` official field.
*/
type ESNext = string | {
main?: string;
browser?: string;
};
/**
* Used to specify conditional exports, note that Conditional exports are
* unsupported in older environments, so it's recommended to use the fallback
* array option if support for those environments is a concern.
*
* note: This is not a `package.json` official field.
*/
type Exports = null | `./${string}` | Exports[] | {
/**
* Used to specify conditional exports, note that Conditional exports are
* unsupported in older environments, so it's recommended to use the fallback
* array option if support for those environments is a concern.
*/
'.'?: Exports;
/**
* The module path that is resolved when this specifier is imported. Set to
* `null` to disallow importing this module.
*/
default?: Exports;
/**
* The module path that is resolved when this specifier is imported. Set to
* `null` to disallow importing this module.
*/
import?: Exports;
/**
* The module path that is resolved when this specifier is imported. Set to
* `null` to disallow importing this module.
*/
node?: Exports;
/**
* The module path that is resolved when this specifier is imported. Set to
* `null` to disallow importing this module.
*/
require?: Exports;
/**
* The module path that is resolved when this specifier is imported. Set to
* `null` to disallow importing this module.
*/
types?: Exports;
};
/**
* Dependencies to other extensions. The identifier of an extension is always
* ${publisher}.${name}. For example: vscode.csharp.
*
* note: This is not a `package.json` official field.
*/
type ExtensionDependencies = Array<`${string}.${string}`>;
/**
* Define the kind of an extension. `ui` extensions are installed and run on
* the local machine while `workspace` extensions run on the remote.
*
* note: This is not a `package.json` official field.
*/
type ExtensionKind = Array<'ui' | 'workspace'>;
/**
* A set of extensions that can be installed together. The identifier of an
* extension is always ${publisher}.${name}. For example: vscode.csharp.
*
* note: This is not a `package.json` official field.
*/
type ExtensionPack = Array<`${string}.${string}`>;
/**
* Banner used in the VS Code marketplace.
*
* note: This is not a `package.json` official field.
*/
interface GalleryBanner {
/**
* The banner color on the VS Code marketplace page header.
*/
color?: string;
/**
* The color theme for the font used in the banner.
*/
theme?: 'dark' | 'light';
}
/**
* The path to a 128x128 pixel icon.
*
* note: This is not a `package.json` official field.
*/
type Icon = string;
/**
* Official `Jest` config.
*
* note: This is not a `package.json` official field.
*/
interface Jest extends Config$1.InitialOptions {
}
/**
* note: This is not a `package.json` official field.
*/
interface JSCPD {
/**
* Use absolute paths in report.
*/
absolute?: boolean;
/**
* Get information about authors and dates of duplicated blocks from Git.
*/
blame?: boolean;
/**
* Exit code to use when at least one duplicate code block is detected but
* threshold is not exceeded.
*/
exitCode?: number;
/**
* list of formats for which to detect duplication (default: all);
*
* see https://github.com/kucherenko/jscpd/blob/master/supported_formats.md
*/
format?: Array<'abap' | 'actionscript' | 'ada' | 'apacheconf' | 'apl' | 'applescript' | 'arduino' | 'arff' | 'asciidoc' | 'asm6502' | 'aspnet' | 'autohotkey' | 'autoit' | 'bash' | 'basic' | 'batch' | 'bison' | 'brainfuck' | 'bro' | 'c' | 'c-header' | 'clike' | 'clojure' | 'coffeescript' | 'comments' | 'cpp' | 'cpp-header' | 'crystal' | 'csharp' | 'csp' | 'css' | 'css-extras' | 'd' | 'dart' | 'diff' | 'django' | 'docker' | 'eiffel' | 'elixir' | 'elm' | 'erb' | 'erlang' | 'flow' | 'fortran' | 'fsharp' | 'gedcom' | 'gherkin' | 'git' | 'glsl' | 'go' | 'graphql' | 'groovy' | 'haml' | 'handlebars' | 'haskell' | 'haxe' | 'hpkp' | 'hsts' | 'http' | 'ichigojam' | 'icon' | 'inform7' | 'ini' | 'io' | 'j' | 'java' | 'javascript' | 'jolie' | 'json' | 'jsx' | 'julia' | 'keymap' | 'kotlin' | 'latex' | 'less' | 'liquid' | 'lisp' | 'livescript' | 'lolcode' | 'lua' | 'makefile' | 'markdown' | 'markup' | 'matlab' | 'mel' | 'mizar' | 'monkey' | 'n4js' | 'nasm' | 'nginx' | 'nim' | 'nix' | 'nsis' | 'objectivec' | 'ocaml' | 'opencl' | 'oz' | 'parigp' | 'pascal' | 'perl' | 'php' | 'plsql' | 'powershell' | 'processing' | 'prolog' | 'properties' | 'protobuf' | 'pug' | 'puppet' | 'pure' | 'python' | 'q' | 'qore' | 'r' | 'reason' | 'renpy' | 'rest' | 'rip' | 'roboconf' | 'ruby' | 'rust' | 'sas' | 'sass' | 'scala' | 'scheme' | 'scss' | 'smalltalk' | 'smarty' | 'soy' | 'sql' | 'stylus' | 'swift' | 'tap' | 'tcl' | 'textile' | 'tsx' | 'tt2' | 'twig' | 'typescript' | 'url' | 'vbnet' | 'velocity' | 'verilog' | 'vhdl' | 'vim' | 'visual-basic' | 'wasm' | 'wiki' | 'xeora' | 'xojo' | 'xquery' | 'yaml'>;
/**
* custom mapping from formats to file extensions (default: https://github.com/kucherenko/jscpd/blob/master/packages/tokenizer/src/formats.ts\);
*
* see https://github.com/kucherenko/jscpd/blob/master/supported_formats.md
*/
formatsExts?: Record<string, string[]>;
/**
* Ignore all files from `.gitignore` file.
*/
gitignore?: boolean;
/**
* Glob pattern for files that should be excluded from duplicate detection.
*/
ignore?: string[];
/**
* Ignore case of symbols in code (experimental).
*/
ignoreCase?: boolean;
/**
* Ignore code blocks matching these regular expressions.
*/
ignorePattern?: string[];
/**
* Maximum size of source file in lines to check for duplication.
*/
maxLines?: number;
/**
* Maximum size of source file in bytes to check for duplication (e.g.,: 1kb,
* 1mb, 120kb).
*/
maxSize?: number | `${number}kb` | `${number}kB` | `${number}Kb` | `${number}KB` | `${number}mb` | `${number}mB` | `${number}Mb` | `${number}MB` | `${number}gb` | `${number}gB` | `${number}Gb` | `${number}GB` | `${number}tb` | `${number}tB` | `${number}Tb` | `${number}TB` | `${number}pb` | `${number}pB` | `${number}Pb` | `${number}PB`;
/**
* Minimum size of code block in lines to check for duplication.
*/
minLines?: number;
/**
* Minimum size of code block in tokens to check for duplication.
*/
minTokens?: number;
/**
* Mode of detection quality;
*
* see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#mode
*/
mode?: 'mild' | 'strict' | 'weak';
/**
* Do not follow symlinks.
*/
noSymLinks?: boolean;
/**
* Path to directory for non-console reports.
*/
output?: `./${string}`;
/**
* Paths that should be included in duplicate detection (default:
* [process.cwd()]).
*/
path?: string[];
/**
* Glob pattern for files that should be included in duplicate detection
* (e.g., **\/*.txt); only used to filter directories configured via path
* option.
*/
pattern?: string;
/**
* A list of reporters to use to output information about duplication;
*
* see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#reporters
*/
reporters?: Array<'console' | 'consoleFull' | 'csv' | 'html' | 'json' | 'markdown' | 'silent' | 'threshold' | 'xcode' | 'xml'>;
reportersOptions?: {
badge?: {
/**
* Badge color (name or RGB code without #, default: green if beneath
* threshold, red if above threshold, grey if threshold not set);
*
* see https://github.com/badgen/badgen/blob/master/src/color-presets.ts
*/
color?: 'black' | 'blue' | 'cyan' | 'gray' | 'green' | 'grey' | 'orange' | 'pink' | 'purple' | 'red' | 'yellow';
/**
* URL for icon to display in front of badge subject text (e.g.,
* data:image/svg+xml;base64,...).
*/
icon?: string;
/**
* SVG width of icon to display in front of badge subject text; set this
* if icon is not square.
*/
iconWidth?: number;
/**
* Badge subject text (URL-encoding needed for spaces or special
* characters).
*/
label?: string;
/**
* Badge label color (name or RGB code without #);
*
* see https://github.com/badgen/badgen/blob/master/src/color-presets.ts
*/
labelColor?: '555' | 'black' | 'blue' | 'cyan' | 'gray' | 'green' | 'grey' | 'orange' | 'pink' | 'purple' | 'red' | 'yellow';
/**
* Output path for duplication level badge (default: path.join(output,
* 'jscpd-badge.svg')).
*/
path?: string;
/**
* Size of badge relative to default of 1.
*/
scale?: number;
/**
* Badge value text (URL-encoding needed for spaces or special
* characters, default: duplication %)
*/
status?: string;
style?: 'classic' | 'flat';
};
};
/**
* Do not write duplicate detection progress and result to console.
*/
silent?: boolean;
/**
* Skip duplicates within folders; just detect cross-folder duplicates.
*/
skipLocal?: boolean;
/**
* Store used to collect information about code (default: in-memory store);
* install @jscpd/leveldb-store and use leveldb for big repositories.
*/
store?: 'leveldb' | 'redis';
}
/**
* JSON schema for NPM package.json files.
*
* note: This is not a `package.json` offic