diff --git a/packages/coil-monorepo-upkeep/resources/package-json-schema.json b/packages/coil-monorepo-upkeep/resources/package-json-schema.json index 98d7b6b78f..ea4dd9cd5f 100644 --- a/packages/coil-monorepo-upkeep/resources/package-json-schema.json +++ b/packages/coil-monorepo-upkeep/resources/package-json-schema.json @@ -3,9 +3,14 @@ "title": "JSON schema for NPM package.json files", "definitions": { "person": { - "description": "A person who has been involved in creating or maintaining this package", - "type": [ "object", "string" ], - "required": [ "name" ], + "description": "A person who has been involved in creating or maintaining this package.", + "type": [ + "object", + "string" + ], + "required": [ + "name" + ], "properties": { "name": { "type": "string" @@ -20,13 +25,6 @@ } } }, - "bundledDependency": { - "description": "Array of package names that will be bundled when publishing the package.", - "type": "array", - "items": { - "type": "string" - } - }, "dependency": { "description": "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.", "type": "object", @@ -35,447 +33,775 @@ } }, "scriptsInstallAfter": { - "description": "Run AFTER the package is installed", - "type": "string" + "description": "Run AFTER the package is installed.", + "type": "string", + "x-intellij-language-injection": "Shell Script" }, "scriptsPublishAfter": { - "description": "Run AFTER the package is published", - "type": "string" + "description": "Run AFTER the package is published.", + "type": "string", + "x-intellij-language-injection": "Shell Script" }, "scriptsRestart": { "description": "Run by the 'npm restart' command. Note: 'npm restart' will run the stop and start scripts if no restart script is provided.", - "type": "string" + "type": "string", + "x-intellij-language-injection": "Shell Script" }, "scriptsStart": { - "description": "Run by the 'npm start' command", - "type": "string" + "description": "Run by the 'npm start' command.", + "type": "string", + "x-intellij-language-injection": "Shell Script" }, "scriptsStop": { - "description": "Run by the 'npm stop' command", - "type": "string" + "description": "Run by the 'npm stop' command.", + "type": "string", + "x-intellij-language-injection": "Shell Script" }, "scriptsTest": { - "description": "Run by the 'npm test' command", - "type": "string" + "description": "Run by the 'npm test' command.", + "type": "string", + "x-intellij-language-injection": "Shell Script" }, "scriptsUninstallBefore": { - "description": "Run BEFORE the package is uninstalled", - "type": "string" + "description": "Run BEFORE the package is uninstalled.", + "type": "string", + "x-intellij-language-injection": "Shell Script" }, "scriptsVersionBefore": { - "description": "Run BEFORE bump the package version", - "type": "string" + "description": "Run BEFORE bump the package version.", + "type": "string", + "x-intellij-language-injection": "Shell Script" }, - "coreProperties": { + "packageExportsEntryPath": { + "type": [ + "string", + "null" + ], + "description": "The module path that is resolved when this specifier is imported. Set to `null` to disallow importing this module.", + "pattern": "^\\./" + }, + "packageExportsEntryObject": { "type": "object", - + "description": "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.", + "properties": { + "require": { + "$ref": "#/definitions/packageExportsEntryOrFallback", + "description": "The module path that is resolved when this specifier is imported as a CommonJS module using the `require(...)` function." + }, + "import": { + "$ref": "#/definitions/packageExportsEntryOrFallback", + "description": "The module path that is resolved when this specifier is imported as an ECMAScript module using an `import` declaration or the dynamic `import(...)` function." + }, + "node": { + "$ref": "#/definitions/packageExportsEntryOrFallback", + "description": "The module path that is resolved when this environment is Node.js." + }, + "default": { + "$ref": "#/definitions/packageExportsEntryOrFallback", + "description": "The module path that is resolved when no other export type matches." + } + }, "patternProperties": { - "^_": { - "description": "Any property starting with _ is valid.", - "additionalProperties": true, - "additionalItems": true, - "tsType": "any" + "^(?![\\.0-9]).": { + "$ref": "#/definitions/packageExportsEntryOrFallback", + "description": "The module path that is resolved when this environment matches the property name." } }, - - "properties": { - "name": { - "description": "The name of the package.", - "type": "string", - "maxLength": 214, - "minLength": 1, - "pattern": "^(?:@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*$" + "additionalProperties": false + }, + "packageExportsEntry": { + "oneOf": [ + { + "$ref": "#/definitions/packageExportsEntryPath" }, - "version": { - "description": "Version must be parseable by node-semver, which is bundled with npm as a dependency.", - "type": "string" + { + "$ref": "#/definitions/packageExportsEntryObject" + } + ] + }, + "packageExportsFallback": { + "type": "array", + "description": "Used to allow fallbacks in case this environment doesn't support the preceding entries.", + "items": { + "$ref": "#/definitions/packageExportsEntry" + } + }, + "packageExportsEntryOrFallback": { + "oneOf": [ + { + "$ref": "#/definitions/packageExportsEntry" }, - "description": { - "description": "This helps people discover your package, as it's listed in 'npm search'.", - "type": "string" + { + "$ref": "#/definitions/packageExportsFallback" + } + ] + }, + "fundingUrl": { + "type": "string", + "format": "uri", + "description": "URL to a website with details about how to fund the package." + }, + "fundingWay": { + "type": "object", + "description": "Used to inform about ways to help fund development of the package.", + "properties": { + "url": { + "$ref": "#/definitions/fundingUrl" }, - "keywords": { - "description": "This helps people discover your package as it's listed in 'npm search'.", - "type": "array", - "items": { - "type": "string" - } + "type": { + "type": "string", + "description": "The type of funding or the platform through which funding can be provided, e.g. patreon, opencollective, tidelift or github." + } + }, + "additionalProperties": false, + "required": [ + "url" + ] + } + }, + "type": "object", + "patternProperties": { + "^_": { + "description": "Any property starting with _ is valid.", + "tsType": "any" + } + }, + "properties": { + "name": { + "description": "The name of the package.", + "type": "string", + "maxLength": 214, + "minLength": 1, + "pattern": "^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?[a-z0-9-~][a-z0-9-._~]*$" + }, + "version": { + "description": "Version must be parseable by node-semver, which is bundled with npm as a dependency.", + "type": "string" + }, + "description": { + "description": "This helps people discover your package, as it's listed in 'npm search'.", + "type": "string" + }, + "keywords": { + "description": "This helps people discover your package as it's listed in 'npm search'.", + "type": "array", + "items": { + "type": "string" + } + }, + "homepage": { + "description": "The url to the project homepage.", + "type": "string" + }, + "bugs": { + "description": "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.", + "type": [ + "object", + "string" + ], + "properties": { + "url": { + "type": "string", + "description": "The url to your project's issue tracker.", + "format": "uri" }, - "homepage": { - "description": "The url to the project homepage.", + "email": { "type": "string", - "oneOf": [ - {"format": "uri"}, - {"enum": ["."]} - ] + "description": "The email address to which issues should be reported.", + "format": "email" + } + } + }, + "license": { + "type": "string", + "description": "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." + }, + "licenses": { + "description": "DEPRECATED: Instead, use SPDX expressions, like this: { \"license\": \"ISC\" } or { \"license\": \"(MIT OR Apache-2.0)\" } see: 'https://docs.npmjs.com/files/package.json#license'.", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + } + } + }, + "author": { + "$ref": "#/definitions/person" + }, + "contributors": { + "description": "A list of people who contributed to this package.", + "type": "array", + "items": { + "$ref": "#/definitions/person" + } + }, + "maintainers": { + "description": "A list of people who maintains this package.", + "type": "array", + "items": { + "$ref": "#/definitions/person" + } + }, + "files": { + "description": "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.", + "type": "array", + "items": { + "type": "string" + } + }, + "main": { + "description": "The main field is a module ID that is the primary entry point to your program.", + "type": "string" + }, + "exports": { + "description": "The \"exports\" field is used to restrict external access to non-exported module files, also enables a module to import itself using \"name\".", + "oneOf": [ + { + "$ref": "#/definitions/packageExportsEntryPath", + "description": "The module path that is resolved when the module specifier matches \"name\", shadows the \"main\" field." }, - "bugs": { - "description": "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.", - "type": [ "object", "string" ], + { + "type": "object", "properties": { - "url": { - "type": "string", - "description": "The url to your project's issue tracker.", - "format": "uri" - }, - "email": { + ".": { + "$ref": "#/definitions/packageExportsEntryOrFallback", + "description": "The module path that is resolved when the module specifier matches \"name\", shadows the \"main\" field." + } + }, + "patternProperties": { + "^\\./.+": { + "$ref": "#/definitions/packageExportsEntryOrFallback", + "description": "The module path prefix that is resolved when the module specifier starts with \"name/\", set to \"./*\" to allow external modules to import any subpath." + } + }, + "additionalProperties": false + }, + { + "$ref": "#/definitions/packageExportsEntryObject", + "description": "The module path that is resolved when the module specifier matches \"name\", shadows the \"main\" field." + }, + { + "$ref": "#/definitions/packageExportsFallback", + "description": "The module path that is resolved when the module specifier matches \"name\", shadows the \"main\" field." + } + ] + }, + "bin": { + "type": [ + "string", + "object" + ], + "additionalProperties": { + "type": "string" + } + }, + "type": { + "description": "When set to \"module\", the type field allows a package to specify all .js files within are ES modules. If the \"type\" field is omitted or set to \"commonjs\", all .js files are treated as CommonJS.", + "type": "string", + "enum": [ + "commonjs", + "module" + ], + "default": "commonjs" + }, + "types": { + "description": "Set the types property to point to your bundled declaration file.", + "type": "string" + }, + "typings": { + "description": "Note that the \"typings\" field is synonymous with \"types\", and could be used as well.", + "type": "string" + }, + "typesVersions": { + "description": "The \"typesVersions\" field is used since TypeScript 3.1 to support features that were only made available in newer TypeScript versions.", + "type": "object", + "additionalProperties": { + "description": "Contains overrides for the TypeScript version that matches the version range matching the property key.", + "type": "object", + "properties": { + "*": { + "description": "Maps all file paths to the file paths specified in the array.", + "type": "array", + "items": { "type": "string", - "description": "The email address to which issues should be reported.", - "format": "email" + "pattern": "^[^*]*(?:\\*[^*]*)?$" } } }, - "license": { - "type": "string", - "description": "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." - }, - "licenses": { - "description": "DEPRECATED: Instead, use SPDX expressions, like this: { \"license\": \"ISC\" } or { \"license\": \"(MIT OR Apache-2.0)\" } see: 'https://docs.npmjs.com/files/package.json#license'", - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } + "patternProperties": { + "^[^*]+$": { + "description": "Maps the file path matching the property key to the file paths specified in the array.", + "type": "array", + "items": { + "type": "string" + } + }, + "^[^*]*\\*[^*]*$": { + "description": "Maps file paths matching the pattern specified in property key to file paths specified in the array.", + "type": "array", + "items": { + "type": "string", + "pattern": "^[^*]*(?:\\*[^*]*)?$" } } }, - "author": { - "$ref": "#/definitions/person" + "additionalProperties": false + } + }, + "man": { + "type": [ + "array", + "string" + ], + "description": "Specify either a single file or an array of filenames to put in place for the man program to find.", + "items": { + "type": "string" + } + }, + "directories": { + "type": "object", + "properties": { + "bin": { + "description": "If you specify a 'bin' directory, then all the files in that folder will be used as the 'bin' hash.", + "type": "string" }, - "contributors": { - "description": "A list of people who contributed to this package.", - "type": "array", - "items": { - "$ref": "#/definitions/person" - } + "doc": { + "description": "Put markdown files in here. Eventually, these will be displayed nicely, maybe, someday.", + "type": "string" }, - "maintainers": { - "description": "A list of people who maintains this package.", - "type": "array", - "items": { - "$ref": "#/definitions/person" - } + "example": { + "description": "Put example scripts in here. Someday, it might be exposed in some clever way.", + "type": "string" }, - "files": { - "description": "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.", - "type": "array", - "items": { - "type": "string" - } + "lib": { + "description": "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.", + "type": "string" }, - "main": { - "description": "The main field is a module ID that is the primary entry point to your program.", + "man": { + "description": "A folder that is full of man pages. Sugar to generate a 'man' array by walking the folder.", "type": "string" }, - "bin": { - "type": [ "string", "object" ], - "additionalProperties": { - "type": "string" - } + "test": { + "type": "string" + } + } + }, + "repository": { + "description": "Specify the place where your code lives. This is helpful for people who want to contribute.", + "type": [ + "object", + "string" + ], + "properties": { + "type": { + "type": "string" }, - "types": { - "description": "Set the types property to point to your bundled declaration file", + "url": { "type": "string" }, - "typings": { - "description": "Note that the \"typings\" field is synonymous with \"types\", and could be used as well.", + "directory": { "type": "string" + } + } + }, + "funding": { + "oneOf": [ + { + "$ref": "#/definitions/fundingUrl" }, - "man": { - "type": [ "array", "string" ], - "description": "Specify either a single file or an array of filenames to put in place for the man program to find.", + { + "$ref": "#/definitions/fundingWay" + }, + { + "type": "array", "items": { - "type": "string" - } + "oneOf": [ + { + "$ref": "#/definitions/fundingUrl" + }, + { + "$ref": "#/definitions/fundingWay" + } + ] + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "scripts": { + "description": "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.", + "type": "object", + "properties": { + "lint": { + "type": "string", + "description": "Run code quality tools, e.g. ESLint, TSLint, etc." }, - "directories": { - "type": "object", - "properties": { - "bin": { - "description": "If you specify a 'bin' directory, then all the files in that folder will be used as the 'bin' hash.", - "type": "string" - }, - "doc": { - "description": "Put markdown files in here. Eventually, these will be displayed nicely, maybe, someday.", - "type": "string" - }, - "example": { - "description": "Put example scripts in here. Someday, it might be exposed in some clever way.", - "type": "string" - }, - "lib": { - "description": "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.", - "type": "string" - }, - "man": { - "description": "A folder that is full of man pages. Sugar to generate a 'man' array by walking the folder.", - "type": "string" - }, - "test": { - "type": "string" - } - } + "prepublish": { + "type": "string", + "description": "Run BEFORE the package is published (Also run on local npm install without any arguments)." }, - "repository": { - "description": "Specify the place where your code lives. This is helpful for people who want to contribute.", - "type": ["object", "string"], - "properties": { - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - } + "prepare": { + "type": "string", + "description": "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." }, - "scripts": { - "description": "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.", - "type": "object", - "properties": { - "prepublish": { - "type": "string", - "description": "Run BEFORE the package is published (Also run on local npm install without any arguments)" - }, - "prepare": { - "type": "string", - "description": "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" - }, - "prepublishOnly": { - "type": "string", - "description": "Run BEFORE the package is prepared and packed, ONLY on npm publish" - }, - "prepack": { - "type": "string", - "description": "run BEFORE a tarball is packed (on npm pack, npm publish, and when installing git dependencies)" - }, - "postpack": { - "type": "string", - "description": "Run AFTER the tarball has been generated and moved to its final destination." - }, - "publish": { - "$ref": "#/definitions/scriptsPublishAfter" - }, - "postpublish": { - "$ref": "#/definitions/scriptsPublishAfter" - }, - "preinstall": { - "type": "string", - "description": "Run BEFORE the package is installed" - }, - "install": { - "$ref": "#/definitions/scriptsInstallAfter" - }, - "postinstall": { - "$ref": "#/definitions/scriptsInstallAfter" - }, - "preuninstall": { - "$ref": "#/definitions/scriptsUninstallBefore" - }, - "uninstall": { - "$ref": "#/definitions/scriptsUninstallBefore" - }, - "postuninstall": { - "type": "string", - "description": "Run AFTER the package is uninstalled" - }, - "preversion": { - "$ref": "#/definitions/scriptsVersionBefore" - }, - "version": { - "$ref": "#/definitions/scriptsVersionBefore" - }, - "postversion": { - "type": "string", - "description": "Run AFTER bump the package version" - }, - "pretest": { - "$ref": "#/definitions/scriptsTest" - }, - "test": { - "$ref": "#/definitions/scriptsTest" - }, - "posttest": { - "$ref": "#/definitions/scriptsTest" - }, - "prestop": { - "$ref": "#/definitions/scriptsStop" - }, - "stop": { - "$ref": "#/definitions/scriptsStop" - }, - "poststop": { - "$ref": "#/definitions/scriptsStop" - }, - "prestart": { - "$ref": "#/definitions/scriptsStart" - }, - "start": { - "$ref": "#/definitions/scriptsStart" - }, - "poststart": { - "$ref": "#/definitions/scriptsStart" - }, - "prerestart": { - "$ref": "#/definitions/scriptsRestart" - }, - "restart": { - "$ref": "#/definitions/scriptsRestart" - }, - "postrestart": { - "$ref": "#/definitions/scriptsRestart" - } - }, - "additionalProperties": { - "type": "string", - "tsType": "string | undefined" - } + "prepublishOnly": { + "type": "string", + "description": "Run BEFORE the package is prepared and packed, ONLY on npm publish." }, - "config": { - "description": "A 'config' hash can be used to set configuration parameters used in package scripts that persist across upgrades.", - "type": "object", - "additionalProperties": true + "prepack": { + "type": "string", + "description": "run BEFORE a tarball is packed (on npm pack, npm publish, and when installing git dependencies)." }, - "dependencies": { - "$ref": "#/definitions/dependency" + "postpack": { + "type": "string", + "description": "Run AFTER the tarball has been generated and moved to its final destination." }, - "devDependencies": { - "$ref": "#/definitions/dependency" + "publish": { + "type": "string", + "description": "Publishes a package to the registry so that it can be installed by name. See https://docs.npmjs.com/cli/v8/commands/npm-publish" }, - "optionalDependencies": { - "$ref": "#/definitions/dependency" + "postpublish": { + "$ref": "#/definitions/scriptsPublishAfter" }, - "peerDependencies": { - "$ref": "#/definitions/dependency" + "preinstall": { + "type": "string", + "description": "Run BEFORE the package is installed." }, - "resolutions": { - "$ref": "#/definitions/dependency" + "install": { + "$ref": "#/definitions/scriptsInstallAfter" }, - "engines": { - "type": "object", - "additionalProperties": { - "type": "string" - } + "postinstall": { + "$ref": "#/definitions/scriptsInstallAfter" }, - "engineStrict": { - "type": "boolean" + "preuninstall": { + "$ref": "#/definitions/scriptsUninstallBefore" }, - "os": { - "description": "You can specify which operating systems your module will run on", + "uninstall": { + "$ref": "#/definitions/scriptsUninstallBefore" + }, + "postuninstall": { + "type": "string", + "description": "Run AFTER the package is uninstalled." + }, + "preversion": { + "$ref": "#/definitions/scriptsVersionBefore" + }, + "version": { + "$ref": "#/definitions/scriptsVersionBefore" + }, + "postversion": { + "type": "string", + "description": "Run AFTER bump the package version." + }, + "pretest": { + "$ref": "#/definitions/scriptsTest" + }, + "test": { + "$ref": "#/definitions/scriptsTest" + }, + "posttest": { + "$ref": "#/definitions/scriptsTest" + }, + "prestop": { + "$ref": "#/definitions/scriptsStop" + }, + "stop": { + "$ref": "#/definitions/scriptsStop" + }, + "poststop": { + "$ref": "#/definitions/scriptsStop" + }, + "prestart": { + "$ref": "#/definitions/scriptsStart" + }, + "start": { + "$ref": "#/definitions/scriptsStart" + }, + "poststart": { + "$ref": "#/definitions/scriptsStart" + }, + "prerestart": { + "$ref": "#/definitions/scriptsRestart" + }, + "restart": { + "$ref": "#/definitions/scriptsRestart" + }, + "postrestart": { + "$ref": "#/definitions/scriptsRestart" + }, + "serve": { + "type": "string", + "description": "Start dev server to serve application files" + } + }, + "additionalProperties": { + "type": "string", + "tsType": "string | undefined", + "x-intellij-language-injection": "Shell Script" + } + }, + "config": { + "description": "A 'config' hash can be used to set configuration parameters used in package scripts that persist across upgrades.", + "type": "object", + "additionalProperties": true + }, + "dependencies": { + "$ref": "#/definitions/dependency" + }, + "devDependencies": { + "$ref": "#/definitions/dependency" + }, + "optionalDependencies": { + "$ref": "#/definitions/dependency" + }, + "peerDependencies": { + "$ref": "#/definitions/dependency" + }, + "peerDependenciesMeta": { + "description": "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.", + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": true, + "properties": { + "optional": { + "description": "Specifies that this peer dependency is optional and should not be installed automatically.", + "type": "boolean" + } + } + } + }, + "bundledDependencies": { + "description": "Array of package names that will be bundled when publishing the package.", + "oneOf": [ + { "type": "array", "items": { "type": "string" } }, - "cpu": { - "description": "If your code only runs on certain cpu architectures, you can specify which ones.", + { + "type": "boolean" + } + ] + }, + "bundleDependencies": { + "description": "DEPRECATED: This field is honored, but \"bundledDependencies\" is the correct field name.", + "oneOf": [ + { "type": "array", "items": { "type": "string" } }, - "preferGlobal": { - "type": "boolean", - "description": "DEPRECATED: This option used to trigger an npm warning, but it will no longer warn. It is purely there for informational purposes. It is now recommended that you install any binaries as local devDependencies wherever possible." - }, - "private": { - "type": "boolean", - "description": "If set to true, then npm will refuse to publish it." - }, - "eslintConfig" : {"$ref": "http://json.schemastore.org/eslintrc#"}, - "eslintIgnore" : {"type": "array", "items": {"type": "string"}, "description": "List of files to be ignored by ESLint"}, - "prettier" : {"$ref": "http://json.schemastore.org/prettierrc#"}, - "stylelint" : {"$ref": "http://json.schemastore.org/stylelintrc#"}, - "jest" : {"type": "object", "$ref": "https://facebook.github.io/jest/docs/configuration.html!#"}, - "jshintConfig" : {"$ref": "http://json.schemastore.org/jshintrc#"}, - "jscsConfig" : {"$ref": "http://json.schemastore.org/jscsrc#"}, - "nodemonConfig" : {"$ref": "http://json.schemastore.org/nodemon#"}, - "husky" : {"$ref": "http://json.schemastore.org/huskyrc#"}, - "renovate" : {"$ref": "http://json.schemastore.org/renovate#"}, - "lint-staged" : {"$ref": "http://json.schemastore.org/lintstagedrc.schema#"}, - "browserslist" : {"oneOf": [{"type": "array", "items": {"type": "string"}}, {"type": "object", "additionalProperties": {"type": "array", "items": {"type": "string"}}}] , "description": "List of Browserslist queries"}, - "publishConfig": { - "type": "object", - "additionalProperties": true + { + "type": "boolean" + } + ] + }, + "resolutions": { + "description": "Resolutions is used to support selective version resolutions, which lets you define custom package versions or ranges inside your dependencies. See: https://classic.yarnpkg.com/en/docs/selective-version-resolutions", + "type": "object" + }, + "packageManager": { + "description": "Defines which package manager is expected to be used when working on the current project. This field is currently experimental and needs to be opted-in; see https://nodejs.org/api/corepack.html", + "type": "string", + "pattern": "(npm|pnpm|yarn)@\\d+\\.\\d+\\.\\d+(-.+)?" + }, + "engines": { + "type": "object", + "properties": { + "node": { + "type": "string" + } + }, + "additionalProperties": { + "type": "string" + } + }, + "engineStrict": { + "type": "boolean" + }, + "os": { + "description": "Specify which operating systems your module will run on.", + "type": "array", + "items": { + "type": "string" + } + }, + "cpu": { + "description": "Specify that your code only runs on certain cpu architectures.", + "type": "array", + "items": { + "type": "string" + } + }, + "preferGlobal": { + "type": "boolean", + "description": "DEPRECATED: This option used to trigger an npm warning, but it will no longer warn. It is purely there for informational purposes. It is now recommended that you install any binaries as local devDependencies wherever possible." + }, + "private": { + "description": "If set to true, then npm will refuse to publish it.", + "oneOf": [ + { + "type": "boolean" }, - "dist": { - "type": "object", - "properties": { - "shasum": { - "type": "string" - }, - "tarball": { - "type": "string" - } - } + { + "enum": [ + "false", + "true" + ] + } + ] + }, + "publishConfig": { + "type": "object", + "properties": { + "access": { + "type": "string", + "enum": [ + "public", + "restricted" + ] }, - "readme": { + "tag": { "type": "string" }, - "module": { - "description": "An ECMAScript module ID that is the primary entry point to your program.", + "registry": { + "type": "string", + "format": "uri" + } + }, + "additionalProperties": true + }, + "dist": { + "type": "object", + "properties": { + "shasum": { "type": "string" }, - "esnext": { - "description": "A module ID with untranspiled code that is the primary entry point to your program.", - "type": [ "string", "object" ], - "properties": { - "main": { - "type": "string" - }, - "browser": { - "type": "string" - } - }, - "additionalProperties": { - "type": "string" - } + "tarball": { + "type": "string" } } }, - "jspmDefinition": { + "readme": { + "type": "string" + }, + "module": { + "description": "An ECMAScript module ID that is the primary entry point to your program.", + "type": "string" + }, + "esnext": { + "description": "A module ID with untranspiled code that is the primary entry point to your program.", + "type": [ + "string", + "object" + ], "properties": { - "jspm": { "$ref": "#/definitions/coreProperties" } + "main": { + "type": "string" + }, + "browser": { + "type": "string" + } + }, + "additionalProperties": { + "type": "string" } - } - }, - "allOf": [ - { "$ref": "#/definitions/coreProperties" }, - { "$ref": "#/definitions/jspmDefinition" }, - { + }, + "workspaces": { + "description": "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.", "anyOf": [ { - "properties": { - "bundleDependencies": { - "$ref": "#/definitions/bundledDependency" - } - }, - "not": { - "properties": { - "bundledDependencies": { } - }, - "required": [ "bundledDependencies" ] + "type": "array", + "description": "Workspace package paths. Glob patterns are supported.", + "items": { + "type": "string" } }, { + "type": "object", "properties": { - "bundledDependencies": { - "$ref": "#/definitions/bundledDependency" - } - }, - "not": { - "properties": { - "bundleDependencies": { } + "packages": { + "type": "array", + "description": "Workspace package paths. Glob patterns are supported.", + "items": { + "type": "string" + } }, - "required": [ "bundleDependencies" ] + "nohoist": { + "type": "array", + "description": "Packages to block from hoisting to the workspace root. Currently only supported in Yarn only.", + "items": { + "type": "string" + } + } } } ] + }, + "jspm": { + "$ref": "#" + }, + "eslintConfig": { + "$ref": "https://json.schemastore.org/eslintrc.json" + }, + "prettier": { + "$ref": "https://json.schemastore.org/prettierrc.json" + }, + "stylelint": { + "$ref": "https://json.schemastore.org/stylelintrc.json" + }, + "ava": { + "$ref": "https://json.schemastore.org/ava.json" + }, + "release": { + "$ref": "https://json.schemastore.org/semantic-release.json" + }, + "jscpd": { + "$ref": "https://json.schemastore.org/jscpd.json" + } + }, + "anyOf": [ + { + "type": "object", + "not": { + "required": [ + "bundledDependencies", + "bundleDependencies" + ] + } + }, + { + "type": "object", + "not": { + "required": [ + "bundleDependencies" + ] + }, + "required": [ + "bundledDependencies" + ] + }, + { + "type": "object", + "not": { + "required": [ + "bundledDependencies" + ] + }, + "required": [ + "bundleDependencies" + ] } ] } diff --git a/packages/coil-monorepo-upkeep/resources/tsconfig-schema.json b/packages/coil-monorepo-upkeep/resources/tsconfig-schema.json index 5ec9c1b217..c37f477166 100644 --- a/packages/coil-monorepo-upkeep/resources/tsconfig-schema.json +++ b/packages/coil-monorepo-upkeep/resources/tsconfig-schema.json @@ -1,13 +1,56 @@ { - "title": "JSON schema for the TypeScript compiler's configuration file", "$schema": "http://json-schema.org/draft-04/schema#", - + "allOf": [ + { + "$ref": "#/definitions/compilerOptionsDefinition" + }, + { + "$ref": "#/definitions/compileOnSaveDefinition" + }, + { + "$ref": "#/definitions/typeAcquisitionDefinition" + }, + { + "$ref": "#/definitions/extendsDefinition" + }, + { + "$ref": "#/definitions/watchOptionsDefinition" + }, + { + "$ref": "#/definitions/buildOptionsDefinition" + }, + { + "$ref": "#/definitions/tsNodeDefinition" + }, + { + "anyOf": [ + { + "$ref": "#/definitions/filesDefinition" + }, + { + "$ref": "#/definitions/excludeDefinition" + }, + { + "$ref": "#/definitions/includeDefinition" + }, + { + "$ref": "#/definitions/referencesDefinition" + } + ] + } + ], "definitions": { + "//": { + "explainer": "https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#overview", + "reference": "https://www.typescriptlang.org/tsconfig", + "reference metadata": "https://github.com/microsoft/TypeScript-Website/blob/v2/packages/tsconfig-reference/scripts/tsconfigRules.ts" + }, "filesDefinition": { "properties": { "files": { "description": "If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. When a 'files' property is specified, only those files and those specified by 'include' are included.", "type": "array", + "uniqueItems": true, "items": { "type": "string" } @@ -19,6 +62,7 @@ "exclude": { "description": "Specifies a list of files to be excluded from compilation. The 'exclude' property only affects the files included via the 'include' property and not the 'files' property. Glob patterns require TypeScript version 2.0 or later.", "type": "array", + "uniqueItems": true, "items": { "type": "string" } @@ -30,6 +74,7 @@ "include": { "description": "Specifies a list of glob patterns that match files to be included in compilation. If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. Requires TypeScript version 2.0 or later.", "type": "array", + "uniqueItems": true, "items": { "type": "string" } @@ -52,6 +97,101 @@ } } }, + "buildOptionsDefinition": { + "properties": { + "buildOptions": { + "properties": { + "dry": { + "description": "~", + "type": "boolean", + "default": false + }, + "force": { + "description": "Build all projects, including those that appear to be up to date", + "type": "boolean", + "default": false, + "markdownDescription": "Build all projects, including those that appear to be up to date\n\nSee more: https://www.typescriptlang.org/tsconfig#force" + }, + "verbose": { + "description": "Enable verbose logging", + "type": "boolean", + "default": false, + "markdownDescription": "Enable verbose logging\n\nSee more: https://www.typescriptlang.org/tsconfig#verbose" + }, + "incremental": { + "description": "Save .tsbuildinfo files to allow for incremental compilation of projects.", + "type": "boolean", + "default": false, + "markdownDescription": "Save .tsbuildinfo files to allow for incremental compilation of projects.\n\nSee more: https://www.typescriptlang.org/tsconfig#incremental" + }, + "assumeChangesOnlyAffectDirectDependencies": { + "description": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.", + "type": "boolean", + "default": false, + "markdownDescription": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.\n\nSee more: https://www.typescriptlang.org/tsconfig#assumeChangesOnlyAffectDirectDependencies" + }, + "traceResolution": { + "description": "Log paths used during the `moduleResolution` process.", + "type": "boolean", + "default": false, + "markdownDescription": "Log paths used during the `moduleResolution` process.\n\nSee more: https://www.typescriptlang.org/tsconfig#traceResolution" + } + } + } + } + }, + "watchOptionsDefinition": { + "properties": { + "watchOptions": { + "type": "object", + "description": "Settings for the watch mode in TypeScript.", + "properties": { + "force": { + "description": "~", + "type": "string" + }, + "watchFile": { + "description": "Specify how the TypeScript watch mode works.", + "type": "string", + "markdownDescription": "Specify how the TypeScript watch mode works.\n\nSee more: https://www.typescriptlang.org/tsconfig#watchFile" + }, + "watchDirectory": { + "description": "Specify how directories are watched on systems that lack recursive file-watching functionality.", + "type": "string", + "markdownDescription": "Specify how directories are watched on systems that lack recursive file-watching functionality.\n\nSee more: https://www.typescriptlang.org/tsconfig#watchDirectory" + }, + "fallbackPolling": { + "description": "Specify what approach the watcher should use if the system runs out of native file watchers.", + "type": "string", + "markdownDescription": "Specify what approach the watcher should use if the system runs out of native file watchers.\n\nSee more: https://www.typescriptlang.org/tsconfig#fallbackPolling" + }, + "synchronousWatchDirectory": { + "description": "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively.", + "type": "boolean", + "markdownDescription": "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively.\n\nSee more: https://www.typescriptlang.org/tsconfig#synchronousWatchDirectory" + }, + "excludeFiles": { + "description": "Remove a list of files from the watch mode's processing.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Remove a list of files from the watch mode's processing.\n\nSee more: https://www.typescriptlang.org/tsconfig#excludeFiles" + }, + "excludeDirectories": { + "description": "Remove a list of directories from the watch process.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Remove a list of directories from the watch process.\n\nSee more: https://www.typescriptlang.org/tsconfig#excludeDirectories" + } + } + } + } + }, "compilerOptionsDefinition": { "properties": { "compilerOptions": { @@ -59,283 +199,480 @@ "description": "Instructs the TypeScript compiler how to compile .ts files.", "properties": { "charset": { - "description": "The character set of the input files.", - "type": "string" + "description": "No longer supported. In early versions, manually set the text encoding for reading files.", + "type": "string", + "markdownDescription": "No longer supported. In early versions, manually set the text encoding for reading files.\n\nSee more: https://www.typescriptlang.org/tsconfig#charset" }, "composite": { - "description": "Enables building for project references.", - "type": "boolean" + "description": "Enable constraints that allow a TypeScript project to be used with project references.", + "type": "boolean", + "default": true, + "markdownDescription": "Enable constraints that allow a TypeScript project to be used with project references.\n\nSee more: https://www.typescriptlang.org/tsconfig#composite" }, "declaration": { - "description": "Generates corresponding d.ts files.", - "type": "boolean" + "description": "Generate .d.ts files from TypeScript and JavaScript files in your project.", + "type": "boolean", + "default": false, + "markdownDescription": "Generate .d.ts files from TypeScript and JavaScript files in your project.\n\nSee more: https://www.typescriptlang.org/tsconfig#declaration" }, "declarationDir": { - "type": "string", - "description": "Specify output directory for generated declaration files. Requires TypeScript version 2.0 or later." + "description": "Specify the output directory for generated declaration files.", + "type": ["string", "null"], + "markdownDescription": "Specify the output directory for generated declaration files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationDir" }, "diagnostics": { - "description": "Show diagnostic information.", - "type": "boolean" + "description": "Output compiler performance information after building.", + "type": "boolean", + "markdownDescription": "Output compiler performance information after building.\n\nSee more: https://www.typescriptlang.org/tsconfig#diagnostics" + }, + "disableReferencedProjectLoad": { + "description": "Reduce the number of projects loaded automatically by TypeScript.", + "type": "boolean", + "markdownDescription": "Reduce the number of projects loaded automatically by TypeScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableReferencedProjectLoad" + }, + "noPropertyAccessFromIndexSignature": { + "description": "Enforces using indexed accessors for keys declared using an indexed type", + "type": "boolean", + "markdownDescription": "Enforces using indexed accessors for keys declared using an indexed type\n\nSee more: https://www.typescriptlang.org/tsconfig#noPropertyAccessFromIndexSignature" }, "emitBOM": { "description": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.", - "type": "boolean" + "type": "boolean", + "default": false, + "markdownDescription": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitBOM" }, "emitDeclarationOnly": { - "description": "Only emit '.d.ts' declaration files.", - "type": "boolean" + "description": "Only output d.ts files and not JavaScript files.", + "type": "boolean", + "default": false, + "markdownDescription": "Only output d.ts files and not JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDeclarationOnly" + }, + "exactOptionalPropertyTypes": { + "description": "Differentiate between undefined and not present when type checking", + "type": "boolean", + "default": false, + "markdownDescription": "Differentiate between undefined and not present when type checking\n\nSee more: https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes" }, "incremental": { - "description": "Enable incremental compilation.", + "description": "Enable incremental compilation. Requires TypeScript version 3.4 or later.", "type": "boolean" }, - "tsBuildInfoFile": { - "description": "Specify file to store incremental compilation information.", - "type": "string" + "tsBuildInfoFile": { + "description": "Specify the folder for .tsbuildinfo incremental compilation files.", + "default": ".tsbuildinfo", + "type": "string", + "markdownDescription": "Specify the folder for .tsbuildinfo incremental compilation files.\n\nSee more: https://www.typescriptlang.org/tsconfig#tsBuildInfoFile" }, - "inlineSourceMap": { - "description": "Emit a single file with source maps instead of having a separate file.", - "type": "boolean" + "description": "Include sourcemap files inside the emitted JavaScript.", + "type": "boolean", + "default": false, + "markdownDescription": "Include sourcemap files inside the emitted JavaScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#inlineSourceMap" }, "inlineSources": { - "description": "Emit the source alongside the sourcemaps within a single file; requires --inlineSourceMap to be set.", - "type": "boolean" + "description": "Include source code in the sourcemaps inside the emitted JavaScript.", + "type": "boolean", + "default": false, + "markdownDescription": "Include source code in the sourcemaps inside the emitted JavaScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#inlineSources" }, "jsx": { - "description": "Specify JSX code generation: 'preserve', 'react', or 'react-native'.", - "enum": [ "preserve", "react", "react-native" ] + "description": "Specify what JSX code is generated.", + "enum": [ + "preserve", + "react", + "react-jsx", + "react-jsxdev", + "react-native" + ] }, "reactNamespace": { - "description": "Specifies the object invoked for createElement and __spread when targeting 'react' JSX emit.", - "type": "string" + "description": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.", + "type": "string", + "default": "React", + "markdownDescription": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.\n\nSee more: https://www.typescriptlang.org/tsconfig#reactNamespace" + }, + "jsxFactory": { + "description": "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'", + "type": "string", + "default": "React.createElement", + "markdownDescription": "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxFactory" + }, + "jsxFragmentFactory": { + "description": "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.", + "type": "string", + "default": "React.Fragment", + "markdownDescription": "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxFragmentFactory" + }, + "jsxImportSource": { + "description": "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx`.", + "type": "string", + "default": "react", + "markdownDescription": "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx`.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxImportSource" }, "listFiles": { - "description": "Print names of files part of the compilation.", - "type": "boolean" + "description": "Print all of the files read during the compilation.", + "type": "boolean", + "default": false, + "markdownDescription": "Print all of the files read during the compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#listFiles" }, "mapRoot": { - "description": "Specifies the location where debugger should locate map files instead of generated locations", - "type": "string" + "description": "Specify the location where debugger should locate map files instead of generated locations.", + "type": "string", + "markdownDescription": "Specify the location where debugger should locate map files instead of generated locations.\n\nSee more: https://www.typescriptlang.org/tsconfig#mapRoot" }, "module": { - "description": "Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015' or 'esnext'.", + "description": "Specify what module code is generated.", + "type": "string", + "anyOf": [ + { + "enum": [ + "CommonJS", + "AMD", + "System", + "UMD", + "ES6", + "ES2015", + "ES2020", + "ESNext", + "None", + "ES2022", + "Node16", + "NodeNext" + ] + }, + { + "pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|20(1[567]|2[02])|[Nn][Ee][Xx][Tt])|[Nn][Oo][dD][Ee]16|[Nn][Oo][Dd][Ed][Nn][Ee][Xx][Tt]|[Nn][Oo][Nn][Ee])$" + } + ], + "markdownDescription": "Specify what module code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#module" + }, + "moduleResolution": { + "description": "Specify how TypeScript looks up a file from a given module specifier.", "type": "string", "anyOf": [ { - "enum": [ "commonjs", "amd", "umd", "system", "es6", "es2015", "esnext", "none" ] - }, { - "pattern": "^([cC][oO][mM][mM][oO][nN][jJ][sS]|[aAuU][mM][dD]|[sS][yY][sS][tT][eE][mM]|[eE][sS]([356]|(201[567])|[nN][eE][xX][tT])|[nN][oO][nN][eE])$" + "enum": ["Classic", "Node", "Node16", "NodeNext"] + }, + { + "pattern": "^(([Nn]ode)|([Nn]ode16)|([Nn]ode[Nn]ext)|([Cc]lassic))$" } - ] + ], + "default": "classic", + "markdownDescription": "Specify how TypeScript looks up a file from a given module specifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#moduleResolution" }, "newLine": { - "description": "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix).", + "description": "Set the newline character for emitting files.", "type": "string", "anyOf": [ { - "enum": [ - "CRLF", - "LF" - ] + "enum": ["crlf", "lf"] }, { "pattern": "^(CRLF|LF|crlf|lf)$" } - ] + ], + "markdownDescription": "Set the newline character for emitting files.\n\nSee more: https://www.typescriptlang.org/tsconfig#newLine" }, "noEmit": { - "description": "Do not emit output.", - "type": "boolean" + "description": "Disable emitting file from a compilation.", + "type": "boolean", + "default": false, + "markdownDescription": "Disable emitting file from a compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmit" }, "noEmitHelpers": { - "description": "Do not generate custom helper functions like __extends in compiled output.", - "type": "boolean" + "description": "Disable generating custom helper functions like `__extends` in compiled output.", + "type": "boolean", + "default": false, + "markdownDescription": "Disable generating custom helper functions like `__extends` in compiled output.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmitHelpers" }, "noEmitOnError": { - "description": "Do not emit outputs if any type checking errors were reported.", - "type": "boolean" + "description": "Disable emitting files if any type checking errors are reported.", + "type": "boolean", + "default": false, + "markdownDescription": "Disable emitting files if any type checking errors are reported.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmitOnError" }, "noImplicitAny": { - "description": "Warn on expressions and declarations with an implied 'any' type.", - "type": "boolean" + "description": "Enable error reporting for expressions and declarations with an implied `any` type..", + "type": "boolean", + "markdownDescription": "Enable error reporting for expressions and declarations with an implied `any` type..\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitAny" }, "noImplicitThis": { - "description": "Raise error on 'this' expressions with an implied any type.", - "type": "boolean" + "description": "Enable error reporting when `this` is given the type `any`.", + "type": "boolean", + "markdownDescription": "Enable error reporting when `this` is given the type `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitThis" }, "noUnusedLocals": { - "description": "Report errors on unused locals. Requires TypeScript version 2.0 or later.", - "type": "boolean" + "description": "Enable error reporting when a local variables aren't read.", + "type": "boolean", + "default": false, + "markdownDescription": "Enable error reporting when a local variables aren't read.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedLocals" }, "noUnusedParameters": { - "description": "Report errors on unused parameters. Requires TypeScript version 2.0 or later.", - "type": "boolean" + "description": "Raise an error when a function parameter isn't read", + "type": "boolean", + "default": false, + "markdownDescription": "Raise an error when a function parameter isn't read\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedParameters" }, "noLib": { - "description": "Do not include the default library file (lib.d.ts).", - "type": "boolean" + "description": "Disable including any library files, including the default lib.d.ts.", + "type": "boolean", + "default": false, + "markdownDescription": "Disable including any library files, including the default lib.d.ts.\n\nSee more: https://www.typescriptlang.org/tsconfig#noLib" }, "noResolve": { - "description": "Do not add triple-slash references or module import targets to the list of compiled files.", - "type": "boolean" + "description": "Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project.", + "type": "boolean", + "default": false, + "markdownDescription": "Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project.\n\nSee more: https://www.typescriptlang.org/tsconfig#noResolve" }, "noStrictGenericChecks": { "description": "Disable strict checking of generic signatures in function types.", - "type": "boolean" + "type": "boolean", + "default": false, + "markdownDescription": "Disable strict checking of generic signatures in function types.\n\nSee more: https://www.typescriptlang.org/tsconfig#noStrictGenericChecks" }, "skipDefaultLibCheck": { - "type": "boolean" + "description": "Skip type checking .d.ts files that are included with TypeScript.", + "type": "boolean", + "default": false, + "markdownDescription": "Skip type checking .d.ts files that are included with TypeScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#skipDefaultLibCheck" }, "skipLibCheck": { - "description": "Skip type checking of declaration files. Requires TypeScript version 2.0 or later.", - "type": "boolean" + "description": "Skip type checking all .d.ts files.", + "type": "boolean", + "default": false, + "markdownDescription": "Skip type checking all .d.ts files.\n\nSee more: https://www.typescriptlang.org/tsconfig#skipLibCheck" }, "outFile": { - "description": "Concatenate and emit output to single file.", - "type": "string" + "description": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.", + "type": "string", + "markdownDescription": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.\n\nSee more: https://www.typescriptlang.org/tsconfig#outFile" }, "outDir": { - "description": "Redirect output structure to the directory.", - "type": "string" + "description": "Specify an output folder for all emitted files.", + "type": "string", + "markdownDescription": "Specify an output folder for all emitted files.\n\nSee more: https://www.typescriptlang.org/tsconfig#outDir" }, "preserveConstEnums": { - "description": "Do not erase const enum declarations in generated code.", - "type": "boolean" + "description": "Disable erasing `const enum` declarations in generated code.", + "type": "boolean", + "default": false, + "markdownDescription": "Disable erasing `const enum` declarations in generated code.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveConstEnums" }, "preserveSymlinks": { - "description": "Do not resolve symlinks to their real path; treat a symlinked file like a real one.", - "type": "boolean" + "description": "Disable resolving symlinks to their realpath. This correlates to the same flag in node.", + "type": "boolean", + "default": false, + "markdownDescription": "Disable resolving symlinks to their realpath. This correlates to the same flag in node.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveSymlinks" + }, + "preserveValueImports": { + "description": "Preserve unused imported values in the JavaScript output that would otherwise be removed", + "type": "boolean", + "default": false, + "markdownDescription": "Preserve unused imported values in the JavaScript output that would otherwise be removed\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveValueImports" }, "preserveWatchOutput": { - "description": "Keep outdated console output in watch mode instead of clearing the screen.", - "type": "boolean" + "description": "Disable wiping the console in watch mode", + "type": "boolean", + "markdownDescription": "Disable wiping the console in watch mode\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveWatchOutput" }, "pretty": { - "description": "Stylize errors and messages using color and context (experimental).", - "type": "boolean" + "description": "Enable color and formatting in output to make compiler errors easier to read", + "type": "boolean", + "default": true, + "markdownDescription": "Enable color and formatting in output to make compiler errors easier to read\n\nSee more: https://www.typescriptlang.org/tsconfig#pretty" }, "removeComments": { - "description": "Do not emit comments to output.", - "type": "boolean" + "description": "Disable emitting comments.", + "type": "boolean", + "default": false, + "markdownDescription": "Disable emitting comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#removeComments" }, "rootDir": { - "description": "Specifies the root directory of input files. Use to control the output directory structure with --outDir.", - "type": "string" + "description": "Specify the root folder within your source files.", + "type": "string", + "markdownDescription": "Specify the root folder within your source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDir" }, "isolatedModules": { - "description": "Unconditionally emit imports for unresolved files.", - "type": "boolean" + "description": "Ensure that each file can be safely transpiled without relying on other imports.", + "type": "boolean", + "default": false, + "markdownDescription": "Ensure that each file can be safely transpiled without relying on other imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#isolatedModules" }, "sourceMap": { - "description": "Generates corresponding '.map' file.", - "type": "boolean" + "description": "Create source map files for emitted JavaScript files.", + "type": "boolean", + "default": false, + "markdownDescription": "Create source map files for emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#sourceMap" }, "sourceRoot": { - "description": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "type": "string" + "description": "Specify the root path for debuggers to find the reference source code.", + "type": "string", + "markdownDescription": "Specify the root path for debuggers to find the reference source code.\n\nSee more: https://www.typescriptlang.org/tsconfig#sourceRoot" }, "suppressExcessPropertyErrors": { - "description": "Suppress excess property checks for object literals.", - "type": "boolean" + "description": "Disable reporting of excess property errors during the creation of object literals.", + "type": "boolean", + "default": false, + "markdownDescription": "Disable reporting of excess property errors during the creation of object literals.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressExcessPropertyErrors" }, "suppressImplicitAnyIndexErrors": { - "description": "Suppress noImplicitAny errors for indexing objects lacking index signatures.", - "type": "boolean" + "description": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.", + "type": "boolean", + "default": false, + "markdownDescription": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressImplicitAnyIndexErrors" }, "stripInternal": { - "description": "Do not emit declarations for code that has an '@internal' annotation.", - "type": "boolean" + "description": "Disable emitting declarations that have `@internal` in their JSDoc comments.", + "type": "boolean", + "markdownDescription": "Disable emitting declarations that have `@internal` in their JSDoc comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#stripInternal" }, "target": { - "description": "Specify ECMAScript target version. Permitted values are 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020' or 'esnext'.", + "description": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.", "type": "string", - "default": "es3", + "default": "ES3", "anyOf": [ { "enum": [ - "es3", - "es5", - "es6", - "es2015", - "es2016", - "es2017", - "es2018", - "es2019", - "es2020", - "esnext" + "ES3", + "ES5", + "ES6", + "ES2015", + "ES2016", + "ES2017", + "ES2018", + "ES2019", + "ES2020", + "ES2021", + "ES2022", + "ESNext" ] - }, { - "pattern": "^([eE][sS]([356]|(20(1[56789]|20))|[nN][eE][xX][tT]))$" + }, + { + "pattern": "^([Ee][Ss]([356]|(20(1[56789]|2[012]))|[Nn][Ee][Xx][Tt]))$" } - ] + ], + "markdownDescription": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.\n\nSee more: https://www.typescriptlang.org/tsconfig#target" + }, + "useUnknownInCatchVariables": { + "description": "Default catch clause variables as `unknown` instead of `any`.", + "type": "boolean", + "default": false, + "markdownDescription": "Default catch clause variables as `unknown` instead of `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables" }, "watch": { "description": "Watch input files.", "type": "boolean" }, + "fallbackPolling": { + "description": "Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. Requires TypeScript version 3.8 or later.", + "enum": [ + "fixedPollingInterval", + "priorityPollingInterval", + "dynamicPriorityPolling", + "fixedInterval", + "priorityInterval", + "dynamicPriority", + "fixedChunkSize" + ] + }, + "watchDirectory": { + "description": "Specify the strategy for watching directories under systems that lack recursive file-watching functionality. Requires TypeScript version 3.8 or later.", + "enum": [ + "useFsEvents", + "fixedPollingInterval", + "dynamicPriorityPolling", + "fixedChunkSizePolling" + ], + "default": "useFsEvents" + }, + "watchFile": { + "description": "Specify the strategy for watching individual files. Requires TypeScript version 3.8 or later.", + "enum": [ + "fixedPollingInterval", + "priorityPollingInterval", + "dynamicPriorityPolling", + "useFsEvents", + "useFsEventsOnParentDirectory", + "fixedChunkSizePolling" + ], + "default": "useFsEvents" + }, "experimentalDecorators": { - "description": "Enables experimental support for ES7 decorators.", - "type": "boolean" + "description": "Enable experimental support for TC39 stage 2 draft decorators.", + "type": "boolean", + "markdownDescription": "Enable experimental support for TC39 stage 2 draft decorators.\n\nSee more: https://www.typescriptlang.org/tsconfig#experimentalDecorators" }, "emitDecoratorMetadata": { - "description": "Emit design-type metadata for decorated declarations in source.", - "type": "boolean" - }, - "moduleResolution": { - "description": "Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6) .", - "type": "string", - "anyOf": [ - { - "enum": [ - "classic", - "node" - ] - }, - { - "pattern": "^(([Nn]ode)|([Cc]lassic))$" - } - ], - "default": "classic" + "description": "Emit design-type metadata for decorated declarations in source files.", + "type": "boolean", + "markdownDescription": "Emit design-type metadata for decorated declarations in source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDecoratorMetadata" }, "allowUnusedLabels": { + "description": "Disable error reporting for unused labels.", "type": "boolean", - "description": "Do not report errors on unused labels." + "markdownDescription": "Disable error reporting for unused labels.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUnusedLabels" }, "noImplicitReturns": { - "description": "Report error when not all code paths in function return a value.", - "type": "boolean" + "description": "Enable error reporting for codepaths that do not explicitly return in a function.", + "type": "boolean", + "default": false, + "markdownDescription": "Enable error reporting for codepaths that do not explicitly return in a function.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitReturns" + }, + "noUncheckedIndexedAccess": { + "description": "Add `undefined` to a type when accessed using an index.", + "type": "boolean", + "markdownDescription": "Add `undefined` to a type when accessed using an index.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess" }, "noFallthroughCasesInSwitch": { - "description": "Report errors for fallthrough cases in switch statement.", - "type": "boolean" + "description": "Enable error reporting for fallthrough cases in switch statements.", + "type": "boolean", + "default": false, + "markdownDescription": "Enable error reporting for fallthrough cases in switch statements.\n\nSee more: https://www.typescriptlang.org/tsconfig#noFallthroughCasesInSwitch" + }, + "noImplicitOverride": { + "description": "Ensure overriding members in derived classes are marked with an override modifier.", + "type": "boolean", + "default": false, + "markdownDescription": "Ensure overriding members in derived classes are marked with an override modifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitOverride" }, "allowUnreachableCode": { - "description": "Do not report errors on unreachable code.", - "type": "boolean" + "description": "Disable error reporting for unreachable code.", + "type": "boolean", + "markdownDescription": "Disable error reporting for unreachable code.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUnreachableCode" }, "forceConsistentCasingInFileNames": { - "description": "Disallow inconsistently-cased references to the same file.", - "type": "boolean" + "description": "Ensure that casing is correct in imports.", + "type": "boolean", + "default": false, + "markdownDescription": "Ensure that casing is correct in imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#forceConsistentCasingInFileNames" + }, + "generateCpuProfile": { + "description": "Emit a v8 CPU profile of the compiler run for debugging.", + "type": "string", + "default": "profile.cpuprofile", + "markdownDescription": "Emit a v8 CPU profile of the compiler run for debugging.\n\nSee more: https://www.typescriptlang.org/tsconfig#generateCpuProfile" }, "baseUrl": { - "description": "Base directory to resolve non-relative module names.", - "type": "string" + "description": "Specify the base directory to resolve non-relative module names.", + "type": "string", + "markdownDescription": "Specify the base directory to resolve non-relative module names.\n\nSee more: https://www.typescriptlang.org/tsconfig#baseUrl" }, "paths": { - "description": "Specify path mapping to be computed relative to baseUrl option.", + "description": "Specify a set of entries that re-map imports to additional lookup locations.", "type": "object", "additionalProperties": { "type": "array", + "uniqueItems": true, "items": { "type": "string", "description": "Path mapping to be computed relative to baseUrl option." } - } + }, + "markdownDescription": "Specify a set of entries that re-map imports to additional lookup locations.\n\nSee more: https://www.typescriptlang.org/tsconfig#paths" }, "plugins": { - "description": "List of TypeScript language server plugins to load. Requires TypeScript version 2.3 or later.", + "description": "Specify a list of language service plugins to include.", "type": "array", "items": { "type": "object", @@ -345,138 +682,323 @@ "type": "string" } } - } + }, + "markdownDescription": "Specify a list of language service plugins to include.\n\nSee more: https://www.typescriptlang.org/tsconfig#plugins" }, "rootDirs": { - "description": "Specify list of root directories to be used when resolving modules.", + "description": "Allow multiple folders to be treated as one when resolving modules.", "type": "array", + "uniqueItems": true, "items": { "type": "string" - } + }, + "markdownDescription": "Allow multiple folders to be treated as one when resolving modules.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDirs" }, "typeRoots": { - "description": "Specify list of directories for type definition files to be included. Requires TypeScript version 2.0 or later.", + "description": "Specify multiple folders that act like `./node_modules/@types`.", "type": "array", + "uniqueItems": true, "items": { "type": "string" - } + }, + "markdownDescription": "Specify multiple folders that act like `./node_modules/@types`.\n\nSee more: https://www.typescriptlang.org/tsconfig#typeRoots" }, "types": { - "description": "Type declaration files to be included in compilation. Requires TypeScript version 2.0 or later.", + "description": "Specify type package names to be included without being referenced in a source file.", "type": "array", + "uniqueItems": true, "items": { "type": "string" - } + }, + "markdownDescription": "Specify type package names to be included without being referenced in a source file.\n\nSee more: https://www.typescriptlang.org/tsconfig#types" }, "traceResolution": { - "description": "Enable tracing of the name resolution process.", - "type": "boolean" + "description": "Enable tracing of the name resolution process. Requires TypeScript version 2.0 or later.", + "type": "boolean", + "default": false }, "allowJs": { - "description": "Allow javascript files to be compiled.", - "type": "boolean" + "description": "Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.", + "type": "boolean", + "default": false, + "markdownDescription": "Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowJs" }, "noErrorTruncation": { - "description": "Do not truncate error messages.", - "type": "boolean" + "description": "Disable truncating types in error messages.", + "type": "boolean", + "default": false, + "markdownDescription": "Disable truncating types in error messages.\n\nSee more: https://www.typescriptlang.org/tsconfig#noErrorTruncation" }, "allowSyntheticDefaultImports": { - "description": "Allow default imports from modules with no default export. This does not affect code emit, just typechecking.", - "type": "boolean" + "description": "Allow 'import x from y' when a module doesn't have a default export.", + "type": "boolean", + "markdownDescription": "Allow 'import x from y' when a module doesn't have a default export.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowSyntheticDefaultImports" }, "noImplicitUseStrict": { - "description": "Do not emit 'use strict' directives in module output.", - "type": "boolean" + "description": "Disable adding 'use strict' directives in emitted JavaScript files.", + "type": "boolean", + "default": false, + "markdownDescription": "Disable adding 'use strict' directives in emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitUseStrict" }, "listEmittedFiles": { - "description": "Enable to list all emitted files. Requires TypeScript version 2.0 or later.", - "type": "boolean" + "description": "Print the names of emitted files after a compilation.", + "type": "boolean", + "default": false, + "markdownDescription": "Print the names of emitted files after a compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#listEmittedFiles" }, "disableSizeLimit": { - "description": "Disable size limit for JavaScript project. Requires TypeScript version 2.0 or later.", + "description": "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.", "type": "boolean", - "default": false + "default": false, + "markdownDescription": "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSizeLimit" }, "lib": { - "description": "Specify library file to be included in the compilation. Requires TypeScript version 2.0 or later.", + "description": "Specify a set of bundled library declaration files that describe the target runtime environment.", "type": "array", + "uniqueItems": true, "items": { "type": "string", - "enum": [ "es5", "es6", "es2015", "es7", "es2016", "es2017", "es2018", "es2019", "es2020", "esnext", "dom", "dom.iterable", "webworker", "webworker.importscripts", "scripthost", - "es2015.core", "es2015.collection", "es2015.generator", "es2015.iterable", "es2015.promise", "es2015.proxy", "es2015.reflect", "es2015.symbol", "es2015.symbol.wellknown", - "es2016.array.include", - "es2017.object", "es2017.intl", "es2017.sharedmemory", "es2017.string", "es2017.typedarrays", - "es2018.asynciterable", "es2018.intl", "es2018.promise", "es2018.regexp", - "es2019.array", "es2019.object", "es2019.string", "es2019.symbol", - "es2020.string", "es2020.symbol.wellknown", - "esnext.asynciterable", "esnext.array", "esnext.bigint", "esnext.intl", "esnext.symbol"] - } + "anyOf": [ + { + "enum": [ + "ES5", + "ES6", + "ES2015", + "ES2015.Collection", + "ES2015.Core", + "ES2015.Generator", + "ES2015.Iterable", + "ES2015.Promise", + "ES2015.Proxy", + "ES2015.Reflect", + "ES2015.Symbol.WellKnown", + "ES2015.Symbol", + "ES2016", + "ES2016.Array.Include", + "ES2017", + "ES2017.Intl", + "ES2017.Object", + "ES2017.SharedMemory", + "ES2017.String", + "ES2017.TypedArrays", + "ES2018", + "ES2018.AsyncGenerator", + "ES2018.AsyncIterable", + "ES2018.Intl", + "ES2018.Promise", + "ES2018.Regexp", + "ES2019", + "ES2019.Array", + "ES2019.Intl", + "ES2019.Object", + "ES2019.String", + "ES2019.Symbol", + "ES2020", + "ES2020.BigInt", + "ES2020.Promise", + "ES2020.String", + "ES2020.Symbol.WellKnown", + "ESNext", + "ESNext.Array", + "ESNext.AsyncIterable", + "ESNext.BigInt", + "ESNext.Intl", + "ESNext.Promise", + "ESNext.String", + "ESNext.Symbol", + "DOM", + "DOM.Iterable", + "ScriptHost", + "WebWorker", + "WebWorker.ImportScripts", + "Webworker.Iterable", + "ES7", + "ES2021", + "ES2020.SharedMemory", + "ES2020.Intl", + "ES2021.Promise", + "ES2021.String", + "ES2021.WeakRef", + "ESNext.WeakRef", + "es2021.intl", + "ES2022", + "ES2022.Array", + "ES2022.Error", + "ES2022.Intl", + "ES2022.Object", + "ES2022.String" + ] + }, + { + "pattern": "^[Ee][Ss]5|[Ee][Ss]6|[Ee][Ss]7$" + }, + { + "pattern": "^[Ee][Ss]2015(\\.([Cc][Oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]|[Cc][Oo][Rr][Ee]|[Gg][Ee][Nn][Ee][Rr][Aa][Tt][Oo][Rr]|[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Pp][Rr][Oo][Xx][Yy]|[Rr][Ee][Ff][Ll][Ee][Cc][Tt]|[Ss][Yy][Mm][Bb][Oo][Ll].[Ww][Ee][Ll][Ll][Kk][Nn][Oo][Ww][Nn]|[Ss][Yy][Mm][Bb][Oo][Ll]))?$" + }, + { + "pattern": "^[Ee][Ss]2016(\\.[Aa][Rr][Rr][Aa][Yy].[Ii][Nn][Cc][Ll][Uu][Dd][Ee])?$" + }, + { + "pattern": "^[Ee][Ss]2017(\\.([Ii][Nn][Tt][Ll]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Tt][Yy][Pp][Ee][Dd][Aa][Rr][Rr][Aa][Yy][Ss]))?$" + }, + { + "pattern": "^[Ee][Ss]2018(\\.([Aa][Ss][Yy][Nn][Cc][Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Rr][Ee][Gg][Ee][Xx][Pp]))?$" + }, + { + "pattern": "^[Ee][Ss]2019(\\.([Aa][Rr][Rr][Aa][Yy]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]))?$" + }, + { + "pattern": "^[Ee][Ss]2020(\\.([Bb][Ii][Gg][Ii][Nn][Tt]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll].[Ww][Ee][Ll][Ll][Kk][Nn][Oo][Ww][Nn]))?$" + }, + { + "pattern": "^[Ee][Ss]2021(\\.([Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ww][Ee][Aa][Kk][Rr][Ee][Ff]))?$" + }, + { + "pattern": "^[Ee][Ss]2022(\\.([Aa][Rr][Rr][Aa][Yy]|[Ee][Rr][Rr][Oo][Rr]|[Ii][Nn][Tt][Ll]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Tt][Rr][Ii][Nn][Gg]))?$" + }, + { + "pattern": "^[Ee][Ss][Nn][Ee][Xx][Tt](\\.([Aa][Rr][Rr][Aa][Yy]|[Aa][Ss][Yy][Nn][Cc][Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Bb][Ii][Gg][Ii][Nn][Tt]|[Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]|[Ww][Ee][Aa][Kk][Rr][Ee][Ff]))?$" + }, + { + "pattern": "^[Dd][Oo][Mm](\\.[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee])?$" + }, + { + "pattern": "^[Ss][Cc][Rr][Ii][Pp][Tt][Hh][Oo][Ss][Tt]$" + }, + { + "pattern": "^[Ww][Ee][Bb][Ww][Oo][Rr][Kk][Ee][Rr](\\.[Ii][Mm][Pp][Oo][Rr][Tt][Ss][Cc][Rr][Ii][Pp][Tt][Ss])?$" + } + ] + }, + "markdownDescription": "Specify a set of bundled library declaration files that describe the target runtime environment.\n\nSee more: https://www.typescriptlang.org/tsconfig#lib" + }, + "moduleDetection": { + "description": "Specify how TypeScript determine a file as module.", + "enum": ["auto", "legacy", "force"] }, "strictNullChecks": { - "description": "Enable strict null checks. Requires TypeScript version 2.0 or later.", - "type": "boolean" + "description": "When type checking, take into account `null` and `undefined`.", + "type": "boolean", + "default": false, + "markdownDescription": "When type checking, take into account `null` and `undefined`.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictNullChecks" }, "maxNodeModuleJsDepth": { - "description": "The maximum dependency depth to search under node_modules and load JavaScript files. Only applicable with --allowJs.", + "description": "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.", "type": "number", - "default": 0 + "default": 0, + "markdownDescription": "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.\n\nSee more: https://www.typescriptlang.org/tsconfig#maxNodeModuleJsDepth" }, "importHelpers": { - "description": "Import emit helpers (e.g. '__extends', '__rest', etc..) from tslib. Requires TypeScript version 2.1 or later.", - "type": "boolean" + "description": "Allow importing helper functions from tslib once per project, instead of including them per-file.", + "type": "boolean", + "default": false, + "markdownDescription": "Allow importing helper functions from tslib once per project, instead of including them per-file.\n\nSee more: https://www.typescriptlang.org/tsconfig#importHelpers" }, - "jsxFactory": { - "description": "Specify the JSX factory function to use when targeting react JSX emit, e.g. 'React.createElement' or 'h'. Requires TypeScript version 2.1 or later.", - "type": "string", - "default": "React.createElement" + "importsNotUsedAsValues": { + "description": "Specify emit/checking behavior for imports that are only used for types.", + "default": "remove", + "enum": ["remove", "preserve", "error"] }, "alwaysStrict": { - "description": "Parse in strict mode and emit 'use strict' for each source file. Requires TypeScript version 2.1 or later.", - "type": "boolean" + "description": "Ensure 'use strict' is always emitted.", + "type": "boolean", + "markdownDescription": "Ensure 'use strict' is always emitted.\n\nSee more: https://www.typescriptlang.org/tsconfig#alwaysStrict" }, "strict": { - "description": "Enable all strict type checking options. Requires TypeScript version 2.3 or later.", - "type": "boolean" + "description": "Enable all strict type checking options.", + "type": "boolean", + "default": false, + "markdownDescription": "Enable all strict type checking options.\n\nSee more: https://www.typescriptlang.org/tsconfig#strict" }, "strictBindCallApply": { - "description": "Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions.", - "type": "boolean" + "description": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.", + "type": "boolean", + "default": false, + "markdownDescription": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictBindCallApply" }, "downlevelIteration": { - "description": "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. Requires TypeScript version 2.3 or later.", - "type": "boolean" + "description": "Emit more compliant, but verbose and less performant JavaScript for iteration.", + "type": "boolean", + "default": false, + "markdownDescription": "Emit more compliant, but verbose and less performant JavaScript for iteration.\n\nSee more: https://www.typescriptlang.org/tsconfig#downlevelIteration" }, "checkJs": { - "description": "Report errors in .js files. Requires TypeScript version 2.3 or later.", - "type": "boolean" + "description": "Enable error reporting in type-checked JavaScript files.", + "type": "boolean", + "default": false, + "markdownDescription": "Enable error reporting in type-checked JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#checkJs" }, "strictFunctionTypes": { - "description": "Disable bivariant parameter checking for function types. Requires TypeScript version 2.6 or later.", - "type": "boolean" + "description": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.", + "type": "boolean", + "default": false, + "markdownDescription": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictFunctionTypes" }, "strictPropertyInitialization": { - "description": "Ensure non-undefined class properties are initialized in the constructor. Requires TypeScript version 2.7 or later.", - "type": "boolean" + "description": "Check for class properties that are declared but not set in the constructor.", + "type": "boolean", + "default": false, + "markdownDescription": "Check for class properties that are declared but not set in the constructor.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictPropertyInitialization" }, "esModuleInterop": { - "description": "Emit '__importStar' and '__importDefault' helpers for runtime babel ecosystem compatibility and enable '--allowSyntheticDefaultImports' for typesystem compatibility. Requires TypeScript version 2.7 or later.", - "type": "boolean" + "description": "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.", + "type": "boolean", + "default": false, + "markdownDescription": "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.\n\nSee more: https://www.typescriptlang.org/tsconfig#esModuleInterop" }, "allowUmdGlobalAccess": { "description": "Allow accessing UMD globals from modules.", - "type": "boolean" + "type": "boolean", + "default": false, + "markdownDescription": "Allow accessing UMD globals from modules.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUmdGlobalAccess" }, "keyofStringsOnly": { - "description": "Resolve 'keyof' to string valued property names only (no numbers or symbols). Requires TypeScript version 2.9 or later.", - "type": "boolean" + "description": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.", + "type": "boolean", + "default": false, + "markdownDescription": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.\n\nSee more: https://www.typescriptlang.org/tsconfig#keyofStringsOnly" + }, + "useDefineForClassFields": { + "description": "Emit ECMAScript-standard-compliant class fields.", + "type": "boolean", + "default": false, + "markdownDescription": "Emit ECMAScript-standard-compliant class fields.\n\nSee more: https://www.typescriptlang.org/tsconfig#useDefineForClassFields" }, "declarationMap": { - "description": "Generates a sourcemap for each corresponding '.d.ts' file. Requires TypeScript version 2.9 or later.", - "type": "boolean" + "description": "Create sourcemaps for d.ts files.", + "type": "boolean", + "default": false, + "markdownDescription": "Create sourcemaps for d.ts files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationMap" }, "resolveJsonModule": { - "description": "Include modules imported with '.json' extension. Requires TypeScript version 2.9 or later.", - "type": "boolean" + "description": "Enable importing .json files", + "type": "boolean", + "default": false, + "markdownDescription": "Enable importing .json files\n\nSee more: https://www.typescriptlang.org/tsconfig#resolveJsonModule" + }, + "assumeChangesOnlyAffectDirectDependencies": { + "description": "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. Requires TypeScript version 3.8 or later.", + "type": "boolean" + }, + "extendedDiagnostics": { + "description": "Output more detailed compiler performance information after building.", + "type": "boolean", + "default": false, + "markdownDescription": "Output more detailed compiler performance information after building.\n\nSee more: https://www.typescriptlang.org/tsconfig#extendedDiagnostics" + }, + "listFilesOnly": { + "description": "Print names of files that are part of the compilation and then stop processing.", + "type": "boolean" + }, + "disableSourceOfProjectReferenceRedirect": { + "description": "Disable preferring source files instead of declaration files when referencing composite projects", + "type": "boolean", + "markdownDescription": "Disable preferring source files instead of declaration files when referencing composite projects\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSourceOfProjectReferenceRedirect" + }, + "disableSolutionSearching": { + "description": "Opt a project out of multi-project reference checking when editing.", + "type": "boolean", + "markdownDescription": "Opt a project out of multi-project reference checking when editing.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSolutionSearching" } } } @@ -496,6 +1018,7 @@ "include": { "description": "Specifies a list of type declarations to be included in auto type acquisition. Ex. [\"jquery\", \"lodash\"]", "type": "array", + "uniqueItems": true, "items": { "type": "string" } @@ -503,6 +1026,7 @@ "exclude": { "description": "Specifies a list of type declarations to be excluded from auto type acquisition. Ex. [\"jquery\", \"lodash\"]", "type": "array", + "uniqueItems": true, "items": { "type": "string" } @@ -515,6 +1039,7 @@ "properties": { "references": { "type": "array", + "uniqueItems": true, "description": "Referenced projects. Requires TypeScript version 3.0 or later.", "items": { "type": "object", @@ -528,21 +1053,162 @@ } } } + }, + "tsNodeModuleTypes": { + "type": "object" + }, + "tsNodeDefinition": { + "properties": { + "ts-node": { + "description": "ts-node options. See also: https://typestrong.org/ts-node/docs/configuration\n\nts-node offers TypeScript execution and REPL for node.js, with source map support.", + "properties": { + "compiler": { + "default": "typescript", + "description": "Specify a custom TypeScript compiler.", + "type": "string" + }, + "compilerHost": { + "default": false, + "description": "Use TypeScript's compiler host API instead of the language service API.", + "type": "boolean" + }, + "compilerOptions": { + "additionalProperties": true, + "allOf": [ + { + "$ref": "#/definitions/compilerOptionsDefinition/properties/compilerOptions" + } + ], + "description": "JSON object to merge with TypeScript `compilerOptions`.", + "properties": {}, + "type": "object" + }, + "emit": { + "default": false, + "description": "Emit output files into `.ts-node` directory.", + "type": "boolean" + }, + "esm": { + "description": "Enable native ESM support.\n\nFor details, see https://typestrong.org/ts-node/docs/imports#native-ecmascript-modules", + "type": "boolean" + }, + "experimentalReplAwait": { + "description": "Allows the usage of top level await in REPL.\n\nUses node's implementation which accomplishes this with an AST syntax transformation.\n\nEnabled by default when tsconfig target is es2018 or above. Set to false to disable.\n\n**Note**: setting to `true` when tsconfig target is too low will throw an Error. Leave as `undefined`\nto get default, automatic behavior.", + "type": "boolean" + }, + "experimentalResolver": { + "description": "Enable experimental features that re-map imports and require calls to support:\n`baseUrl`, `paths`, `rootDirs`, `.js` to `.ts` file extension mappings,\n`outDir` to `rootDir` mappings for composite projects and monorepos.\n\nFor details, see https://github.com/TypeStrong/ts-node/issues/1514", + "type": "boolean" + }, + "experimentalSpecifierResolution": { + "description": "Like node's `--experimental-specifier-resolution`, , but can also be set in your `tsconfig.json` for convenience.\n\nFor details, see https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm", + "enum": ["explicit", "node"], + "type": "string" + }, + "files": { + "default": false, + "description": "Load \"files\" and \"include\" from `tsconfig.json` on startup.\n\nDefault is to override `tsconfig.json` \"files\" and \"include\" to only include the entrypoint script.", + "type": "boolean" + }, + "ignore": { + "default": ["(?:^|/)node_modules/"], + "description": "Paths which should not be compiled.\n\nEach string in the array is converted to a regular expression via `new RegExp()` and tested against source paths prior to compilation.\n\nSource paths are normalized to posix-style separators, relative to the directory containing `tsconfig.json` or to cwd if no `tsconfig.json` is loaded.\n\nDefault is to ignore all node_modules subdirectories.", + "items": { + "type": "string" + }, + "type": "array" + }, + "ignoreDiagnostics": { + "description": "Ignore TypeScript warnings by diagnostic code.", + "items": { + "type": ["string", "number"] + }, + "type": "array" + }, + "logError": { + "default": false, + "description": "Logs TypeScript errors to stderr instead of throwing exceptions.", + "type": "boolean" + }, + "moduleTypes": { + "$ref": "#/definitions/tsNodeModuleTypes", + "description": "Override certain paths to be compiled and executed as CommonJS or ECMAScript modules.\nWhen overridden, the tsconfig \"module\" and package.json \"type\" fields are overridden, and\nthe file extension is ignored.\nThis is useful if you cannot use .mts, .cts, .mjs, or .cjs file extensions;\nit achieves the same effect.\n\nEach key is a glob pattern following the same rules as tsconfig's \"include\" array.\nWhen multiple patterns match the same file, the last pattern takes precedence.\n\n`cjs` overrides matches files to compile and execute as CommonJS.\n`esm` overrides matches files to compile and execute as native ECMAScript modules.\n`package` overrides either of the above to default behavior, which obeys package.json \"type\" and\ntsconfig.json \"module\" options." + }, + "preferTsExts": { + "default": false, + "description": "Re-order file extensions so that TypeScript imports are preferred.\n\nFor example, when both `index.js` and `index.ts` exist, enabling this option causes `require('./index')` to resolve to `index.ts` instead of `index.js`", + "type": "boolean" + }, + "pretty": { + "default": false, + "description": "Use pretty diagnostic formatter.", + "type": "boolean" + }, + "require": { + "description": "Modules to require, like node's `--require` flag.\n\nIf specified in `tsconfig.json`, the modules will be resolved relative to the `tsconfig.json` file.\n\nIf specified programmatically, each input string should be pre-resolved to an absolute path for\nbest results.", + "items": { + "type": "string" + }, + "type": "array" + }, + "scope": { + "default": false, + "description": "Scope compiler to files within `scopeDir`.", + "type": "boolean" + }, + "scopeDir": { + "default": "First of: `tsconfig.json` \"rootDir\" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded.", + "type": "string" + }, + "skipIgnore": { + "default": false, + "description": "Skip ignore check, so that compilation will be attempted for all files with matching extensions.", + "type": "boolean" + }, + "swc": { + "description": "Transpile with swc instead of the TypeScript compiler, and skip typechecking.\n\nEquivalent to setting both `transpileOnly: true` and `transpiler: 'ts-node/transpilers/swc'`\n\nFor complete instructions: https://typestrong.org/ts-node/docs/transpilers", + "type": "boolean" + }, + "transpileOnly": { + "default": false, + "description": "Use TypeScript's faster `transpileModule`.", + "type": "boolean" + }, + "transpiler": { + "anyOf": [ + { + "items": [ + { + "type": "string" + }, + { + "additionalProperties": true, + "properties": {}, + "type": "object" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + { + "type": "string" + } + ], + "description": "Specify a custom transpiler for use with transpileOnly" + }, + "typeCheck": { + "default": true, + "description": "**DEPRECATED** Specify type-check is enabled (e.g. `transpileOnly == false`).", + "type": "boolean" + } + }, + "type": "object" + } + } } }, - "type": "object", - "allOf": [ - { "$ref": "#/definitions/compilerOptionsDefinition" }, - { "$ref": "#/definitions/compileOnSaveDefinition" }, - { "$ref": "#/definitions/typeAcquisitionDefinition" }, - { "$ref": "#/definitions/extendsDefinition" }, - { - "anyOf": [ - { "$ref": "#/definitions/filesDefinition" }, - { "$ref": "#/definitions/excludeDefinition" }, - { "$ref": "#/definitions/includeDefinition" }, - { "$ref": "#/definitions/referencesDefinition" } - ] - } - ] + "id": "https://json.schemastore.org/tsconfig", + "title": "JSON schema for the TypeScript compiler's configuration file", + "type": "object" } diff --git a/packages/coil-monorepo-upkeep/src/commands/doUpKeep/doUpKeep.ts b/packages/coil-monorepo-upkeep/src/commands/doUpKeep/doUpKeep.ts index 8ced740311..ce9aed37ac 100644 --- a/packages/coil-monorepo-upkeep/src/commands/doUpKeep/doUpKeep.ts +++ b/packages/coil-monorepo-upkeep/src/commands/doUpKeep/doUpKeep.ts @@ -218,33 +218,37 @@ function upKeepIDETsConfigPaths(subPackages: LernaListItem[]) { const packagePath = `packages/${getPackageFolder(li)}` const path = `${packagePath}/src` paths[li.name] = [path] - const subPackageJSON = readPackageJSON(`${li.location}/package.json`) + const subPackageJSONPath = `${li.location}/package.json` + const subPackageJSON = readPackageJSON(subPackageJSONPath) // Handle any @ns/package/derp redirects if (subPackageJSON.subpackages) { + delete subPackageJSON.exports + const makeEl = (n: string) => ({ + default: n, + types: `${n}` + }) + + const exports = (subPackageJSON.exports = { + '.': makeEl('./build') + } as Record) + subPackageJSON.subpackages.forEach(name => { + const subpackageName = `${li.name}/${name}` + console.log(subpackageName, exports) + exports[`./${name}`] = makeEl(`./build/${name}`) + const folderPath = pathModule.join(fromRoot(path), name) const tsPath = pathModule.join(fromRoot(path), `${name}.ts`) - let isFolder = true if (existsSync(folderPath)) { // folder - paths[`${li.name}/${name}`] = [`${path}/${name}`] + paths[subpackageName] = [`${path}/${name}`] } else if (existsSync(tsPath)) { - isFolder = false - paths[`${li.name}/${name}`] = [`${path}/${name}.ts`] + paths[subpackageName] = [`${path}/${name}.ts`] } else { throw new Error() } - cmd(`rm -rf ${packagePath}/${name}`, { cwd: fromRoot('.') }) - cmd(`mkdir ${packagePath}/${name}`, { cwd: fromRoot('.') }) - - writeFileJSON(`${packagePath}/${name}/package.json`, { - name: `${li.name}/${name}`, - private: true, - version: '0.0.0', - main: `../build/${isFolder ? name : `${name}.js`}`, - types: `../build/${isFolder ? name : `${name}.d.ts`}` - }) }) + writePackageJSON(subPackageJSONPath, subPackageJSON) } }) tsconfig.compilerOptions.paths = paths diff --git a/packages/coil-monorepo-upkeep/src/types.ts b/packages/coil-monorepo-upkeep/src/types.ts index 7211473522..f703f27b5d 100644 --- a/packages/coil-monorepo-upkeep/src/types.ts +++ b/packages/coil-monorepo-upkeep/src/types.ts @@ -16,6 +16,7 @@ export interface PackageJSON extends Record { types?: string main?: string subpackages?: string[] + exports?: Record resolutions?: StringMap upkeep?: { privatePackages?: boolean diff --git a/packages/webmonetization-wext/content/package.json b/packages/webmonetization-wext/content/package.json deleted file mode 100644 index f770e179ee..0000000000 --- a/packages/webmonetization-wext/content/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@webmonetization/wext/content", - "private": true, - "version": "0.0.0", - "main": "../build/content", - "types": "../build/content" -} diff --git a/packages/webmonetization-wext/package.json b/packages/webmonetization-wext/package.json index f1fd0ace73..712016dc6c 100644 --- a/packages/webmonetization-wext/package.json +++ b/packages/webmonetization-wext/package.json @@ -13,13 +13,35 @@ }, "license": "Apache-2.0", "author": "Coil Team ", + "exports": { + ".": { + "default": "./build", + "types": "./build" + }, + "./undecorated": { + "default": "./build/undecorated", + "types": "./build/undecorated" + }, + "./services": { + "default": "./build/services", + "types": "./build/services" + }, + "./content": { + "default": "./build/content", + "types": "./build/content" + }, + "./tokens": { + "default": "./build/tokens", + "types": "./build/tokens" + } + }, "main": "./build", "types": "./build", "subpackages": [ - "tokens", "undecorated", "services", - "content" + "content", + "tokens" ], "scripts": { "build:ts": "tsc --build tsconfig.build.json", diff --git a/packages/webmonetization-wext/services/package.json b/packages/webmonetization-wext/services/package.json deleted file mode 100644 index f5a545a5cb..0000000000 --- a/packages/webmonetization-wext/services/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@webmonetization/wext/services", - "private": true, - "version": "0.0.0", - "main": "../build/services", - "types": "../build/services" -} diff --git a/packages/webmonetization-wext/tokens/package.json b/packages/webmonetization-wext/tokens/package.json deleted file mode 100644 index a830edd781..0000000000 --- a/packages/webmonetization-wext/tokens/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@webmonetization/wext/tokens", - "private": true, - "version": "0.0.0", - "main": "../build/tokens.js", - "types": "../build/tokens.d.ts" -} diff --git a/packages/webmonetization-wext/undecorated/package.json b/packages/webmonetization-wext/undecorated/package.json deleted file mode 100644 index 51ab52f8b4..0000000000 --- a/packages/webmonetization-wext/undecorated/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@webmonetization/wext/undecorated", - "private": true, - "version": "0.0.0", - "main": "../build/undecorated", - "types": "../build/undecorated" -} diff --git a/tsconfig.json b/tsconfig.json index 7311d8d860..cd5d7ce2e6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -72,9 +72,6 @@ "@webmonetization/wext": [ "packages/webmonetization-wext/src" ], - "@webmonetization/wext/tokens": [ - "packages/webmonetization-wext/src/tokens.ts" - ], "@webmonetization/wext/undecorated": [ "packages/webmonetization-wext/src/undecorated" ], @@ -83,6 +80,9 @@ ], "@webmonetization/wext/content": [ "packages/webmonetization-wext/src/content" + ], + "@webmonetization/wext/tokens": [ + "packages/webmonetization-wext/src/tokens.ts" ] } }, diff --git a/tsconfig.settings.json b/tsconfig.settings.json index c533526b7c..560cc58d27 100644 --- a/tsconfig.settings.json +++ b/tsconfig.settings.json @@ -13,7 +13,7 @@ "jsx": "react", "downlevelIteration": true, - "moduleResolution": "node", + "moduleResolution": "node16", "isolatedModules": true,