1 line
6.3 KiB
Plaintext
1 line
6.3 KiB
Plaintext
{"version":3,"file":"IPackageJson.js","sourceRoot":"","sources":["../src/IPackageJson.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * This interface is part of the {@link IPackageJson} file format. It is used for the\n * \"dependencies\", \"optionalDependencies\", and \"devDependencies\" fields.\n * @public\n */\nexport interface IPackageJsonDependencyTable {\n /**\n * The key is the name of a dependency. The value is a Semantic Versioning (SemVer)\n * range specifier.\n */\n [dependencyName: string]: string;\n}\n\n/**\n * This interface is part of the {@link IPackageJson} file format. It is used for the\n * \"scripts\" field.\n * @public\n */\nexport interface IPackageJsonScriptTable {\n /**\n * The key is the name of the script hook. The value is the script body which may\n * be a file path or shell script command.\n */\n [scriptName: string]: string;\n}\n\n/**\n * This interface is part of the {@link IPackageJson} file format. It is used for the\n * \"repository\" field.\n * @public\n */\nexport interface IPackageJsonRepository {\n /**\n * The source control type for the repository that hosts the project. This is typically \"git\".\n */\n type: string;\n\n /**\n * The URL of the repository that hosts the project.\n */\n url: string;\n\n /**\n * If the project does not exist at the root of the repository, its path is specified here.\n */\n directory?: string;\n}\n\n/**\n * This interface is part of the {@link IPackageJson} file format. It is used for the\n * \"peerDependenciesMeta\" field.\n * @public\n */\nexport interface IPeerDependenciesMetaTable {\n [dependencyName: string]: {\n optional?: boolean;\n };\n}\n\n/**\n * An interface for accessing common fields from a package.json file whose version field may be missing.\n *\n * @remarks\n * This interface is the same as {@link IPackageJson}, except that the `version` field is optional.\n * According to the {@link https://docs.npmjs.com/files/package.json | NPM documentation}\n * and {@link http://wiki.commonjs.org/wiki/Packages/1.0 | CommonJS Packages specification}, the `version` field\n * is normally a required field for package.json files.\n *\n * However, NodeJS relaxes this requirement for its `require()` API. The\n * {@link https://nodejs.org/dist/latest-v10.x/docs/api/modules.html#modules_folders_as_modules\n * | \"Folders as Modules\" section} from the NodeJS documentation gives an example of a package.json file\n * that has only the `name` and `main` fields. NodeJS does not consider the `version` field during resolution,\n * so it can be omitted. Some libraries do this.\n *\n * Use the `INodePackageJson` interface when loading such files. Use `IPackageJson` for package.json files\n * that are installed from an NPM registry, or are otherwise known to have a `version` field.\n *\n * @public\n */\nexport interface INodePackageJson {\n /**\n * The name of the package.\n */\n name: string;\n\n /**\n * A version number conforming to the Semantic Versioning (SemVer) standard.\n */\n version?: string;\n\n /**\n * Indicates whether this package is allowed to be published or not.\n */\n private?: boolean;\n\n /**\n * A brief description of the package.\n */\n description?: string;\n\n /**\n * The URL of the project's repository.\n */\n repository?: string | IPackageJsonRepository;\n\n /**\n * The URL to the project's web page.\n */\n homepage?: string;\n\n /**\n * The name of the license.\n */\n license?: string;\n\n /**\n * The path to the module file that will act as the main entry point.\n */\n main?: string;\n\n /**\n * The path to the TypeScript *.d.ts file describing the module file\n * that will act as the main entry point.\n */\n types?: string;\n\n /**\n * Alias for `types`\n */\n typings?: string;\n\n /**\n * The path to the TSDoc metadata file.\n * This is still being standardized: https://github.com/microsoft/tsdoc/issues/7#issuecomment-442271815\n * @beta\n */\n tsdocMetadata?: string;\n\n /**\n * The main entry point for the package.\n */\n bin?: string;\n\n /**\n * An array of dependencies that must always be installed for this package.\n */\n dependencies?: IPackageJsonDependencyTable;\n\n /**\n * An array of optional dependencies that may be installed for this package.\n */\n optionalDependencies?: IPackageJsonDependencyTable;\n\n /**\n * An array of dependencies that must only be installed for developers who will\n * build this package.\n */\n devDependencies?: IPackageJsonDependencyTable;\n\n /**\n * An array of dependencies that must be installed by a consumer of this package,\n * but which will not be automatically installed by this package.\n */\n peerDependencies?: IPackageJsonDependencyTable;\n\n /**\n * An array of metadata about peer dependencies.\n */\n peerDependenciesMeta?: IPeerDependenciesMetaTable;\n\n /**\n * A table of script hooks that a package manager or build tool may invoke.\n */\n scripts?: IPackageJsonScriptTable;\n\n /**\n * A table of package version resolutions. This feature is only implemented by the Yarn package manager.\n *\n * @remarks\n * See the {@link https://github.com/yarnpkg/rfcs/blob/master/implemented/0000-selective-versions-resolutions.md\n * | 0000-selective-versions-resolutions.md RFC} for details.\n */\n resolutions?: Record<string, string>;\n}\n\n/**\n * An interface for accessing common fields from a package.json file.\n *\n * @remarks\n * This interface describes a package.json file format whose `name` and `version` field are required.\n * In some situations, the `version` field is optional; in that case, use the {@link INodePackageJson}\n * interface instead.\n *\n * More fields may be added to this interface in the future. For documentation about the package.json file format,\n * see the {@link http://wiki.commonjs.org/wiki/Packages/1.0 | CommonJS Packages specification}\n * and the {@link https://docs.npmjs.com/files/package.json | NPM manual page}.\n *\n * @public\n */\nexport interface IPackageJson extends INodePackageJson {\n // Make the \"version\" field non-optional.\n /** {@inheritDoc INodePackageJson.version} */\n version: string;\n}\n"]} |