Merge remote-tracking branch 'origin/releases/v3' into backport-v2.25.0-df5a14dc2

This commit is contained in:
github-actions[bot]
2024-04-15 12:22:19 +00:00
152 changed files with 2277 additions and 3101 deletions

106
node_modules/.package-lock.json generated vendored
View File

@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "3.24.10",
"version": "3.25.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
@@ -762,17 +762,17 @@
}
},
"node_modules/@octokit/types": {
"version": "12.6.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz",
"integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==",
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.1.0.tgz",
"integrity": "sha512-nBwAFOYqVUUJ2AZFK4ZzESQptaAVqdTDKk8gE0Xr0o99WuPDSrhUC38x0F40xD9OUxXhOOuZKWNNVVLPSHQDvQ==",
"dependencies": {
"@octokit/openapi-types": "^20.0.0"
"@octokit/openapi-types": "^21.0.0"
}
},
"node_modules/@octokit/types/node_modules/@octokit/openapi-types": {
"version": "20.0.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz",
"integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA=="
"version": "21.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-21.2.0.tgz",
"integrity": "sha512-xx+Xd6I7rYvul/hgUDqv6TeGX0IOGnhSg9IOeYgd/uI7IAqUy6DE2B6Ipv2M4mWoxaMcWjIzgTIcv8pMO3F3vw=="
},
"node_modules/@opentelemetry/api": {
"version": "1.4.1",
@@ -957,16 +957,16 @@
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.4.0.tgz",
"integrity": "sha512-yHMQ/oFaM7HZdVrVm/M2WHaNPgyuJH4WelkSVEWSSsir34kxW2kDJCxlXRhhGWEsMN0WAW/vLpKfKVcm8k+MPw==",
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.5.0.tgz",
"integrity": "sha512-HpqNTH8Du34nLxbKgVMGljZMG0rJd2O9ecvr2QLYp+7512ty1j42KnsFwspPXg1Vh8an9YImf6CokUBltisZFQ==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/type-utils": "7.4.0",
"@typescript-eslint/utils": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"@typescript-eslint/scope-manager": "7.5.0",
"@typescript-eslint/type-utils": "7.5.0",
"@typescript-eslint/utils": "7.5.0",
"@typescript-eslint/visitor-keys": "7.5.0",
"debug": "^4.3.4",
"graphemer": "^1.4.0",
"ignore": "^5.2.4",
@@ -992,15 +992,15 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.4.0.tgz",
"integrity": "sha512-ZvKHxHLusweEUVwrGRXXUVzFgnWhigo4JurEj0dGF1tbcGh6buL+ejDdjxOQxv6ytcY1uhun1p2sm8iWStlgLQ==",
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.5.0.tgz",
"integrity": "sha512-cj+XGhNujfD2/wzR1tabNsidnYRaFfEkcULdcIyVBYcXjBvBKOes+mpMBP7hMpOyk+gBcfXsrg4NBGAStQyxjQ==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"@typescript-eslint/scope-manager": "7.5.0",
"@typescript-eslint/types": "7.5.0",
"@typescript-eslint/typescript-estree": "7.5.0",
"@typescript-eslint/visitor-keys": "7.5.0",
"debug": "^4.3.4"
},
"engines": {
@@ -1020,13 +1020,13 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.4.0.tgz",
"integrity": "sha512-68VqENG5HK27ypafqLVs8qO+RkNc7TezCduYrx8YJpXq2QGZ30vmNZGJJJC48+MVn4G2dCV8m5ZTVnzRexTVtw==",
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.5.0.tgz",
"integrity": "sha512-Z1r7uJY0MDeUlql9XJ6kRVgk/sP11sr3HKXn268HZyqL7i4cEfrdFuSSY/0tUqT37l5zT0tJOsuDP16kio85iA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0"
"@typescript-eslint/types": "7.5.0",
"@typescript-eslint/visitor-keys": "7.5.0"
},
"engines": {
"node": "^18.18.0 || >=20.0.0"
@@ -1037,13 +1037,13 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.4.0.tgz",
"integrity": "sha512-247ETeHgr9WTRMqHbbQdzwzhuyaJ8dPTuyuUEMANqzMRB1rj/9qFIuIXK7l0FX9i9FXbHeBQl/4uz6mYuCE7Aw==",
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.5.0.tgz",
"integrity": "sha512-A021Rj33+G8mx2Dqh0nMO9GyjjIBK3MqgVgZ2qlKf6CJy51wY/lkkFqq3TqqnH34XyAHUkq27IjlUkWlQRpLHw==",
"dev": true,
"dependencies": {
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/utils": "7.4.0",
"@typescript-eslint/typescript-estree": "7.5.0",
"@typescript-eslint/utils": "7.5.0",
"debug": "^4.3.4",
"ts-api-utils": "^1.0.1"
},
@@ -1064,9 +1064,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.4.0.tgz",
"integrity": "sha512-mjQopsbffzJskos5B4HmbsadSJQWaRK0UxqQ7GuNA9Ga4bEKeiO6b2DnB6cM6bpc8lemaPseh0H9B/wyg+J7rw==",
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.5.0.tgz",
"integrity": "sha512-tv5B4IHeAdhR7uS4+bf8Ov3k793VEVHd45viRRkehIUZxm0WF82VPiLgHzA/Xl4TGPg1ZD49vfxBKFPecD5/mg==",
"dev": true,
"engines": {
"node": "^18.18.0 || >=20.0.0"
@@ -1077,13 +1077,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.4.0.tgz",
"integrity": "sha512-A99j5AYoME/UBQ1ucEbbMEmGkN7SE0BvZFreSnTd1luq7yulcHdyGamZKizU7canpGDWGJ+Q6ZA9SyQobipePg==",
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.5.0.tgz",
"integrity": "sha512-YklQQfe0Rv2PZEueLTUffiQGKQneiIEKKnfIqPIOxgM9lKSZFCjT5Ad4VqRKj/U4+kQE3fa8YQpskViL7WjdPQ==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"@typescript-eslint/types": "7.5.0",
"@typescript-eslint/visitor-keys": "7.5.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -1129,17 +1129,17 @@
}
},
"node_modules/@typescript-eslint/utils": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.4.0.tgz",
"integrity": "sha512-NQt9QLM4Tt8qrlBVY9lkMYzfYtNz8/6qwZg8pI3cMGlPnj6mOpRxxAm7BMJN9K0AiY+1BwJ5lVC650YJqYOuNg==",
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.5.0.tgz",
"integrity": "sha512-3vZl9u0R+/FLQcpy2EHyRGNqAS/ofJ3Ji8aebilfJe+fobK8+LbIFmrHciLVDxjDoONmufDcnVSF38KwMEOjzw==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/scope-manager": "7.5.0",
"@typescript-eslint/types": "7.5.0",
"@typescript-eslint/typescript-estree": "7.5.0",
"semver": "^7.5.4"
},
"engines": {
@@ -1154,12 +1154,12 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.4.0.tgz",
"integrity": "sha512-0zkC7YM0iX5Y41homUUeW1CHtZR01K3ybjM1l6QczoMuay0XKtrb93kv95AxUGwdjGr64nNqnOCwmEl616N8CA==",
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.5.0.tgz",
"integrity": "sha512-mcuHM/QircmA6O7fy6nn2w/3ditQkj+SgtOc8DW3uQ10Yfj42amm2i+6F2K4YAOPNNTmE6iM1ynM6lrSwdendA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/types": "7.5.0",
"eslint-visitor-keys": "^3.4.1"
},
"engines": {
@@ -6059,9 +6059,9 @@
}
},
"node_modules/typescript": {
"version": "5.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz",
"integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==",
"version": "5.4.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz",
"integrity": "sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==",
"dev": true,
"bin": {
"tsc": "bin/tsc",

View File

@@ -1 +1 @@
export declare const VERSION = "12.6.0";
export declare const VERSION = "13.1.0";

View File

@@ -431,6 +431,14 @@ export interface Endpoints {
* @see https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment
*/
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}", "delete">;
/**
* @see https://docs.github.com/rest/actions/secrets#delete-an-environment-secret
*/
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}", "delete">;
/**
* @see https://docs.github.com/rest/actions/variables#delete-an-environment-variable
*/
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}", "delete">;
/**
* @see https://docs.github.com/rest/git/refs#delete-a-reference
*/
@@ -543,14 +551,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts
*/
"DELETE /repos/{owner}/{repo}/vulnerability-alerts": Operation<"/repos/{owner}/{repo}/vulnerability-alerts", "delete">;
/**
* @see https://docs.github.com/rest/actions/secrets#delete-an-environment-secret
*/
"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}": Operation<"/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", "delete">;
/**
* @see https://docs.github.com/rest/actions/variables#delete-an-environment-variable
*/
"DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}": Operation<"/repositories/{repository_id}/environments/{environment_name}/variables/{name}", "delete">;
/**
* @see https://docs.github.com/rest/teams/teams#delete-a-team-legacy
*/
@@ -1797,6 +1797,26 @@ export interface Endpoints {
* @see https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule
*/
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}", "get">;
/**
* @see https://docs.github.com/rest/actions/secrets#list-environment-secrets
*/
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/secrets", "get">;
/**
* @see https://docs.github.com/rest/actions/secrets#get-an-environment-public-key
*/
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key", "get">;
/**
* @see https://docs.github.com/rest/actions/secrets#get-an-environment-secret
*/
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}", "get">;
/**
* @see https://docs.github.com/rest/actions/variables#list-environment-variables
*/
"GET /repos/{owner}/{repo}/environments/{environment_name}/variables": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/variables", "get">;
/**
* @see https://docs.github.com/rest/actions/variables#get-an-environment-variable
*/
"GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}", "get">;
/**
* @see https://docs.github.com/rest/activity/events#list-repository-events
*/
@@ -1989,6 +2009,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages
*/
"GET /repos/{owner}/{repo}/pages/health": Operation<"/repos/{owner}/{repo}/pages/health", "get">;
/**
* @see https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository
*/
"GET /repos/{owner}/{repo}/private-vulnerability-reporting": Operation<"/repos/{owner}/{repo}/private-vulnerability-reporting", "get">;
/**
* @see https://docs.github.com/rest/projects/projects#list-repository-projects
*/
@@ -2205,26 +2229,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/repos/repos#list-public-repositories
*/
"GET /repositories": Operation<"/repositories", "get">;
/**
* @see https://docs.github.com/rest/actions/secrets#list-environment-secrets
*/
"GET /repositories/{repository_id}/environments/{environment_name}/secrets": Operation<"/repositories/{repository_id}/environments/{environment_name}/secrets", "get">;
/**
* @see https://docs.github.com/rest/actions/secrets#get-an-environment-public-key
*/
"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key": Operation<"/repositories/{repository_id}/environments/{environment_name}/secrets/public-key", "get">;
/**
* @see https://docs.github.com/rest/actions/secrets#get-an-environment-secret
*/
"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}": Operation<"/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", "get">;
/**
* @see https://docs.github.com/rest/actions/variables#list-environment-variables
*/
"GET /repositories/{repository_id}/environments/{environment_name}/variables": Operation<"/repositories/{repository_id}/environments/{environment_name}/variables", "get">;
/**
* @see https://docs.github.com/rest/actions/variables#get-an-environment-variable
*/
"GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}": Operation<"/repositories/{repository_id}/environments/{environment_name}/variables/{name}", "get">;
/**
* @see https://docs.github.com/rest/search/search#search-code
*/
@@ -2745,6 +2749,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert
*/
"PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}": Operation<"/repos/{owner}/{repo}/dependabot/alerts/{alert_number}", "patch">;
/**
* @see https://docs.github.com/rest/actions/variables#update-an-environment-variable
*/
"PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}", "patch">;
/**
* @see https://docs.github.com/rest/git/refs#update-a-reference
*/
@@ -2817,10 +2825,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/security-advisories/repository-advisories#update-a-repository-security-advisory
*/
"PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}": Operation<"/repos/{owner}/{repo}/security-advisories/{ghsa_id}", "patch">;
/**
* @see https://docs.github.com/rest/actions/variables#update-an-environment-variable
*/
"PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}": Operation<"/repositories/{repository_id}/environments/{environment_name}/variables/{name}", "patch">;
/**
* @see https://docs.github.com/rest/teams/teams#update-a-team-legacy
*/
@@ -3173,6 +3177,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment
*/
"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules", "post">;
/**
* @see https://docs.github.com/rest/actions/variables#create-an-environment-variable
*/
"POST /repos/{owner}/{repo}/environments/{environment_name}/variables": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/variables", "post">;
/**
* @see https://docs.github.com/rest/repos/forks#create-a-fork
*/
@@ -3357,10 +3365,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template
*/
"POST /repos/{template_owner}/{template_repo}/generate": Operation<"/repos/{template_owner}/{template_repo}/generate", "post">;
/**
* @see https://docs.github.com/rest/actions/variables#create-an-environment-variable
*/
"POST /repositories/{repository_id}/environments/{environment_name}/variables": Operation<"/repositories/{repository_id}/environments/{environment_name}/variables", "post">;
/**
* @see https://docs.github.com/rest/teams/discussions#create-a-discussion-legacy
*/
@@ -3681,6 +3685,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy
*/
"PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}", "put">;
/**
* @see https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret
*/
"PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}", "put">;
/**
* @see https://docs.github.com/rest/migrations/source-imports#start-an-import
*/
@@ -3741,10 +3749,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts
*/
"PUT /repos/{owner}/{repo}/vulnerability-alerts": Operation<"/repos/{owner}/{repo}/vulnerability-alerts", "put">;
/**
* @see https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret
*/
"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}": Operation<"/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", "put">;
/**
* @see https://docs.github.com/rest/teams/members#add-team-member-legacy
*/

View File

@@ -7,14 +7,15 @@
"directory": "packages/openapi-types"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
},
"version": "20.0.0",
"version": "21.2.0",
"main": "",
"types": "types.d.ts",
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"octokit": {
"openapi-version": "14.0.0"
"openapi-version": "15.0.0"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,13 @@
{
"name": "@octokit/types",
"version": "12.6.0",
"version": "13.1.0",
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
},
"description": "Shared TypeScript definitions for Octokit projects",
"dependencies": {
"@octokit/openapi-types": "^20.0.0"
"@octokit/openapi-types": "^21.0.0"
},
"repository": "github:octokit/types.ts",
"keywords": [
@@ -26,7 +27,7 @@
"json-schema-to-typescript": "^13.0.0",
"lodash.set": "^4.3.2",
"npm-run-all2": "^6.0.0",
"pascal-case": "^3.1.1",
"pascal-case": "^4.0.0",
"prettier": "^3.0.0",
"semantic-release": "^23.0.0",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
@@ -36,7 +37,7 @@
"typescript": "^5.0.0"
},
"octokit": {
"openapi-version": "14.0.0"
"openapi-version": "14.1.0"
},
"files": [
"dist-types/**"

View File

@@ -225,6 +225,9 @@ exports.default = (0, util_1.createRule)({
// All other cases are unhandled.
return { isUnhandled: true };
}
else if (node.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) {
return { isUnhandled: true };
}
else if (node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) {
// We must be getting the promise-like value from one of the branches of the
// ternary. Check them directly.

File diff suppressed because one or more lines are too long

View File

@@ -114,6 +114,27 @@ exports.default = (0, util_1.createRule)({
return (maybeDeclarationNode.type === utils_1.AST_NODE_TYPES.VariableDeclaration &&
maybeDeclarationNode.kind === 'const');
}
function isTypeUnchanged(uncast, cast) {
if (uncast === cast) {
return true;
}
if ((0, util_1.isTypeFlagSet)(uncast, ts.TypeFlags.Undefined) &&
(0, util_1.isTypeFlagSet)(cast, ts.TypeFlags.Undefined) &&
tsutils.isCompilerOptionEnabled(compilerOptions, 'exactOptionalPropertyTypes')) {
const uncastParts = tsutils
.unionTypeParts(uncast)
.filter(part => !(0, util_1.isTypeFlagSet)(part, ts.TypeFlags.Undefined));
const castParts = tsutils
.unionTypeParts(cast)
.filter(part => !(0, util_1.isTypeFlagSet)(part, ts.TypeFlags.Undefined));
if (uncastParts.length !== castParts.length) {
return false;
}
const uncastPartsSet = new Set(uncastParts);
return castParts.every(part => uncastPartsSet.has(part));
}
return false;
}
return {
TSNonNullExpression(node) {
if (node.parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression &&
@@ -191,7 +212,7 @@ exports.default = (0, util_1.createRule)({
}
const castType = services.getTypeAtLocation(node);
const uncastType = services.getTypeAtLocation(node.expression);
const typeIsUnchanged = uncastType === castType;
const typeIsUnchanged = isTypeUnchanged(uncastType, castType);
const wouldSameTypeBeInferred = castType.isLiteral()
? isLiteralVariableDeclarationChangingTypeWithConst(node)
: !isConstAssertion(node.typeAnnotation);

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin",
"version": "7.4.0",
"version": "7.5.0",
"description": "TypeScript plugin for ESLint",
"files": [
"dist",
@@ -38,6 +38,7 @@
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io/packages/eslint-plugin",
"license": "MIT",
"keywords": [
"eslint",
@@ -61,10 +62,10 @@
},
"dependencies": {
"@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/type-utils": "7.4.0",
"@typescript-eslint/utils": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"@typescript-eslint/scope-manager": "7.5.0",
"@typescript-eslint/type-utils": "7.5.0",
"@typescript-eslint/utils": "7.5.0",
"@typescript-eslint/visitor-keys": "7.5.0",
"debug": "^4.3.4",
"graphemer": "^1.4.0",
"ignore": "^5.2.4",
@@ -76,8 +77,8 @@
"@types/debug": "*",
"@types/marked": "*",
"@types/natural-compare": "*",
"@typescript-eslint/rule-schema-to-typescript-types": "7.3.1",
"@typescript-eslint/rule-tester": "7.4.0",
"@typescript-eslint/rule-schema-to-typescript-types": "7.5.0",
"@typescript-eslint/rule-tester": "7.5.0",
"ajv": "^6.12.6",
"chalk": "^5.3.0",
"cross-env": "^7.0.3",

View File

@@ -1 +1 @@
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAO,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAC9D,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;AAGnE,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAKtC,UAAU,oBAAoB;IAC5B,GAAG,EAAE,QAAQ,CAAC,OAAO,GAAG;QACtB,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzB,MAAM,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC1B,QAAQ,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;KAC/B,CAAC;IACF,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;CAC5B;AAmDD,iBAAS,KAAK,CACZ,IAAI,EAAE,EAAE,CAAC,UAAU,GAAG,MAAM,EAC5B,OAAO,CAAC,EAAE,aAAa,GACtB,oBAAoB,CAAC,KAAK,CAAC,CAE7B;AAED,iBAAS,cAAc,CACrB,IAAI,EAAE,EAAE,CAAC,UAAU,GAAG,MAAM,EAC5B,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,GAC7B,oBAAoB,CAuFtB;AAED,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"}

View File

@@ -74,6 +74,11 @@ function parseForESLint(code, options) {
const parserOptions = {};
Object.assign(parserOptions, options, {
jsx: validateBoolean(options.ecmaFeatures.jsx),
/**
* Override errorOnTypeScriptSyntacticAndSemanticIssues and set it to false to prevent use from user config
* https://github.com/typescript-eslint/typescript-eslint/issues/8681#issuecomment-2000411834
*/
errorOnTypeScriptSyntacticAndSemanticIssues: false,
});
const analyzeOptions = {
globalReturn: options.ecmaFeatures.globalReturn,

View File

@@ -1 +1 @@
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":";;;;;;AAIA,oEAA2D;AAO3D,4EAAgF;AAEhF,kEAA8D;AAC9D,kDAA0B;AAE1B,2CAA0C;AAE1C,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,iCAAiC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AAW,EAAE,CAAC;AACtD,CAAC;AAEe,wCAAc"}

View File

@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/parser",
"version": "7.4.0",
"version": "7.5.0",
"description": "An ESLint custom parser which leverages TypeScript ESTree",
"files": [
"dist",
@@ -27,6 +27,7 @@
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io/packages/parser",
"license": "BSD-2-Clause",
"keywords": [
"ast",
@@ -51,10 +52,10 @@
"eslint": "^8.56.0"
},
"dependencies": {
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"@typescript-eslint/scope-manager": "7.5.0",
"@typescript-eslint/types": "7.5.0",
"@typescript-eslint/typescript-estree": "7.5.0",
"@typescript-eslint/visitor-keys": "7.5.0",
"debug": "^4.3.4"
},
"devDependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/scope-manager",
"version": "7.4.0",
"version": "7.5.0",
"description": "TypeScript scope analyser for ESLint",
"files": [
"dist",
@@ -28,6 +28,7 @@
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io/packages/scope-manager",
"license": "MIT",
"keywords": [
"eslint",
@@ -45,12 +46,12 @@
"typecheck": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0"
"@typescript-eslint/types": "7.5.0",
"@typescript-eslint/visitor-keys": "7.5.0"
},
"devDependencies": {
"@types/glob": "*",
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/typescript-estree": "7.5.0",
"glob": "*",
"jest-specific-snapshot": "*",
"make-dir": "*",

View File

@@ -7,8 +7,6 @@
The utilities in this package are separated from `@typescript-eslint/utils` so that that package does not require a dependency on `typescript`.
👉 See **https://typescript-eslint.io/packages/type-utils** for documentation on this package.
> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code.
<!-- Local path for docs: docs/packages/Type_Utils.mdx -->

View File

@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/type-utils",
"version": "7.4.0",
"version": "7.5.0",
"description": "Type utilities for working with TypeScript + ESLint together",
"files": [
"dist",
@@ -28,6 +28,7 @@
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io",
"license": "MIT",
"keywords": [
"eslint",
@@ -45,13 +46,13 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/utils": "7.4.0",
"@typescript-eslint/typescript-estree": "7.5.0",
"@typescript-eslint/utils": "7.5.0",
"debug": "^4.3.4",
"ts-api-utils": "^1.0.1"
},
"devDependencies": {
"@typescript-eslint/parser": "7.4.0",
"@typescript-eslint/parser": "7.5.0",
"ajv": "^6.10.0",
"downlevel-dts": "*",
"jest": "29.7.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/types",
"version": "7.4.0",
"version": "7.5.0",
"description": "Types for the TypeScript-ESTree AST spec",
"files": [
"dist",
@@ -29,6 +29,7 @@
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io",
"license": "MIT",
"keywords": [
"eslint",

View File

@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/typescript-estree",
"version": "7.4.0",
"version": "7.5.0",
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
"files": [
"dist",
@@ -32,6 +32,7 @@
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io/packages/typescript-estree",
"license": "BSD-2-Clause",
"keywords": [
"ast",
@@ -53,8 +54,8 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/visitor-keys": "7.4.0",
"@typescript-eslint/types": "7.5.0",
"@typescript-eslint/visitor-keys": "7.5.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",

View File

@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/utils",
"version": "7.4.0",
"version": "7.5.0",
"description": "Utilities for working with TypeScript + ESLint together",
"files": [
"dist",
@@ -49,6 +49,7 @@
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io/packages/utils",
"license": "MIT",
"keywords": [
"eslint",
@@ -69,16 +70,16 @@
"@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/scope-manager": "7.5.0",
"@typescript-eslint/types": "7.5.0",
"@typescript-eslint/typescript-estree": "7.5.0",
"semver": "^7.5.4"
},
"peerDependencies": {
"eslint": "^8.56.0"
},
"devDependencies": {
"@typescript-eslint/parser": "7.4.0",
"@typescript-eslint/parser": "7.5.0",
"downlevel-dts": "*",
"jest": "29.7.0",
"prettier": "^3.0.3",

View File

@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/visitor-keys",
"version": "7.4.0",
"version": "7.5.0",
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
"files": [
"dist",
@@ -29,6 +29,7 @@
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io",
"license": "MIT",
"keywords": [
"eslint",
@@ -46,7 +47,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@typescript-eslint/types": "7.4.0",
"@typescript-eslint/types": "7.5.0",
"eslint-visitor-keys": "^3.4.1"
},
"devDependencies": {

64
node_modules/typescript/lib/tsc.js generated vendored
View File

@@ -18,7 +18,7 @@ and limitations under the License.
// src/compiler/corePublic.ts
var versionMajorMinor = "5.4";
var version = "5.4.3";
var version = "5.4.4";
// src/compiler/core.ts
var emptyArray = [];
@@ -4145,14 +4145,17 @@ function createDynamicPriorityPollingWatchFile(host) {
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
}
}
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp) {
const fileWatcherCallbacks = createMultiMap();
const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0;
const dirWatchers = /* @__PURE__ */ new Map();
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
return nonPollingWatchFile;
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
const filePath = toCanonicalName(fileName);
fileWatcherCallbacks.add(filePath, callback);
if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) {
fileTimestamps.set(filePath, getModifiedTime3(fileName) || missingFileModifiedTime);
}
const dirPath = getDirectoryPath(filePath) || ".";
const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions);
watcher.referenceCount++;
@@ -4172,14 +4175,31 @@ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFi
const watcher = fsWatch(
dirName,
1 /* Directory */,
(_eventName, relativeFileName, modifiedTime) => {
(eventName, relativeFileName) => {
if (!isString(relativeFileName))
return;
const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
const callbacks = fileName && fileWatcherCallbacks.get(toCanonicalName(fileName));
const filePath = toCanonicalName(fileName);
const callbacks = fileName && fileWatcherCallbacks.get(filePath);
if (callbacks) {
let currentModifiedTime;
let eventKind = 1 /* Changed */;
if (fileTimestamps) {
const existingTime = fileTimestamps.get(filePath);
if (eventName === "change") {
currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime;
if (currentModifiedTime.getTime() === existingTime.getTime())
return;
}
currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime);
fileTimestamps.set(filePath, currentModifiedTime);
if (existingTime === missingFileModifiedTime)
eventKind = 0 /* Created */;
else if (currentModifiedTime === missingFileModifiedTime)
eventKind = 2 /* Deleted */;
}
for (const fileCallback of callbacks) {
fileCallback(fileName, 1 /* Changed */, modifiedTime);
fileCallback(fileName, eventKind, currentModifiedTime);
}
}
},
@@ -4573,7 +4593,7 @@ function createSystemWatchFunctions({
);
case 5 /* UseFsEventsOnParentDirectory */:
if (!nonPollingWatchFile) {
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp);
}
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
default:
@@ -4748,7 +4768,7 @@ function createSystemWatchFunctions({
return watchPresentFileSystemEntryWithFsWatchFile();
}
try {
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
fileOrDirectory,
recursive,
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
@@ -42862,13 +42882,21 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
}
const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath));
const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
if (nearestSourcePackageJson !== nearestTargetPackageJson) {
const ignoreCase = !hostUsesCaseSensitiveFileNames(host);
if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) {
return maybeNonRelative;
}
return relativePath;
}
return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
}
function packageJsonPathsAreEqual(a, b, ignoreCase) {
if (a === b)
return true;
if (a === void 0 || b === void 0)
return false;
return comparePaths(a, b, ignoreCase) === 0 /* EqualTo */;
}
function countPathComponents(path) {
let count = 0;
for (let i = startsWith(path, "./") ? 2 : 0; i < path.length; i++) {
@@ -47996,15 +48024,19 @@ function createTypeChecker(host) {
return true;
}
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
function getMeaningOfEntityNameReference(entityName) {
let meaning;
if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */) {
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) {
meaning = 1920 /* Namespace */;
} else {
meaning = 788968 /* Type */;
}
return meaning;
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
const meaning = getMeaningOfEntityNameReference(entityName);
const firstIdentifier = getFirstIdentifier(entityName);
const symbol = resolveName(
enclosingDeclaration,
@@ -50065,9 +50097,10 @@ function createTypeChecker(host) {
introducesError = true;
return { introducesError, node };
}
const meaning = getMeaningOfEntityNameReference(node);
const sym = resolveEntityName(
leftmost,
-1 /* All */,
meaning,
/*ignoreErrors*/
true,
/*dontResolveAlias*/
@@ -50077,13 +50110,13 @@ function createTypeChecker(host) {
if (isSymbolAccessible(
sym,
context.enclosingDeclaration,
-1 /* All */,
meaning,
/*shouldComputeAliasesToMakeVisible*/
false
).accessibility !== 0 /* Accessible */) {
introducesError = true;
} else {
context.tracker.trackSymbol(sym, context.enclosingDeclaration, -1 /* All */);
context.tracker.trackSymbol(sym, context.enclosingDeclaration, meaning);
includePrivateSymbol == null ? void 0 : includePrivateSymbol(sym);
}
if (isIdentifier(node)) {
@@ -57990,6 +58023,9 @@ function createTypeChecker(host) {
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
removeFromEach(typeSet, 65536 /* Null */);
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
} else if (typeSet.length >= 4) {
const middle = Math.floor(typeSet.length / 2);
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
} else {
if (!checkCrossProductUnion(typeSet)) {
return errorType;

View File

@@ -2340,7 +2340,7 @@ module.exports = __toCommonJS(server_exports);
// src/compiler/corePublic.ts
var versionMajorMinor = "5.4";
var version = "5.4.3";
var version = "5.4.4";
var Comparison = /* @__PURE__ */ ((Comparison3) => {
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7688,14 +7688,17 @@ function createDynamicPriorityPollingWatchFile(host) {
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
}
}
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp) {
const fileWatcherCallbacks = createMultiMap();
const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0;
const dirWatchers = /* @__PURE__ */ new Map();
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
return nonPollingWatchFile;
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
const filePath = toCanonicalName(fileName);
fileWatcherCallbacks.add(filePath, callback);
if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) {
fileTimestamps.set(filePath, getModifiedTime3(fileName) || missingFileModifiedTime);
}
const dirPath = getDirectoryPath(filePath) || ".";
const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions);
watcher.referenceCount++;
@@ -7715,14 +7718,31 @@ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFi
const watcher = fsWatch(
dirName,
1 /* Directory */,
(_eventName, relativeFileName, modifiedTime) => {
(eventName, relativeFileName) => {
if (!isString(relativeFileName))
return;
const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
const callbacks = fileName && fileWatcherCallbacks.get(toCanonicalName(fileName));
const filePath = toCanonicalName(fileName);
const callbacks = fileName && fileWatcherCallbacks.get(filePath);
if (callbacks) {
let currentModifiedTime;
let eventKind = 1 /* Changed */;
if (fileTimestamps) {
const existingTime = fileTimestamps.get(filePath);
if (eventName === "change") {
currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime;
if (currentModifiedTime.getTime() === existingTime.getTime())
return;
}
currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime);
fileTimestamps.set(filePath, currentModifiedTime);
if (existingTime === missingFileModifiedTime)
eventKind = 0 /* Created */;
else if (currentModifiedTime === missingFileModifiedTime)
eventKind = 2 /* Deleted */;
}
for (const fileCallback of callbacks) {
fileCallback(fileName, 1 /* Changed */, modifiedTime);
fileCallback(fileName, eventKind, currentModifiedTime);
}
}
},
@@ -8121,7 +8141,7 @@ function createSystemWatchFunctions({
);
case 5 /* UseFsEventsOnParentDirectory */:
if (!nonPollingWatchFile) {
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp);
}
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
default:
@@ -8296,7 +8316,7 @@ function createSystemWatchFunctions({
return watchPresentFileSystemEntryWithFsWatchFile();
}
try {
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
fileOrDirectory,
recursive,
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
@@ -47606,13 +47626,21 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
}
const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath));
const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
if (nearestSourcePackageJson !== nearestTargetPackageJson) {
const ignoreCase = !hostUsesCaseSensitiveFileNames(host);
if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) {
return maybeNonRelative;
}
return relativePath;
}
return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
}
function packageJsonPathsAreEqual(a, b, ignoreCase) {
if (a === b)
return true;
if (a === void 0 || b === void 0)
return false;
return comparePaths(a, b, ignoreCase) === 0 /* EqualTo */;
}
function countPathComponents(path) {
let count = 0;
for (let i = startsWith(path, "./") ? 2 : 0; i < path.length; i++) {
@@ -52740,15 +52768,19 @@ function createTypeChecker(host) {
return true;
}
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
function getMeaningOfEntityNameReference(entityName) {
let meaning;
if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */) {
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) {
meaning = 1920 /* Namespace */;
} else {
meaning = 788968 /* Type */;
}
return meaning;
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
const meaning = getMeaningOfEntityNameReference(entityName);
const firstIdentifier = getFirstIdentifier(entityName);
const symbol = resolveName(
enclosingDeclaration,
@@ -54809,9 +54841,10 @@ function createTypeChecker(host) {
introducesError = true;
return { introducesError, node };
}
const meaning = getMeaningOfEntityNameReference(node);
const sym = resolveEntityName(
leftmost,
-1 /* All */,
meaning,
/*ignoreErrors*/
true,
/*dontResolveAlias*/
@@ -54821,13 +54854,13 @@ function createTypeChecker(host) {
if (isSymbolAccessible(
sym,
context.enclosingDeclaration,
-1 /* All */,
meaning,
/*shouldComputeAliasesToMakeVisible*/
false
).accessibility !== 0 /* Accessible */) {
introducesError = true;
} else {
context.tracker.trackSymbol(sym, context.enclosingDeclaration, -1 /* All */);
context.tracker.trackSymbol(sym, context.enclosingDeclaration, meaning);
includePrivateSymbol == null ? void 0 : includePrivateSymbol(sym);
}
if (isIdentifier(node)) {
@@ -62734,6 +62767,9 @@ function createTypeChecker(host) {
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
removeFromEach(typeSet, 65536 /* Null */);
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
} else if (typeSet.length >= 4) {
const middle = Math.floor(typeSet.length / 2);
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
} else {
if (!checkCrossProductUnion(typeSet)) {
return errorType;
@@ -160728,10 +160764,7 @@ function getContextualType(previousToken, position, sourceFile, checker) {
return isJsxExpression(parent2) && !isJsxElement(parent2.parent) && !isJsxFragment(parent2.parent) ? checker.getContextualTypeForJsxAttribute(parent2.parent) : void 0;
default:
const argInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(previousToken, position, sourceFile, checker);
return argInfo ? (
// At `,`, treat this as the next argument after the comma.
checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (previousToken.kind === 28 /* CommaToken */ ? 1 : 0))
) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
return argInfo ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
// completion at `x ===/**/` should be for the right side
checker.getTypeAtLocation(parent2.left)
) : checker.getContextualType(previousToken, 4 /* Completions */) || checker.getContextualType(previousToken);
@@ -169099,12 +169132,7 @@ function getArgumentOrParameterListInfo(node, position, sourceFile, checker) {
if (!info)
return void 0;
const { list, argumentIndex } = info;
const argumentCount = getArgumentCount(
list,
/*ignoreTrailingComma*/
isInString(sourceFile, position, node),
checker
);
const argumentCount = getArgumentCount(checker, list);
if (argumentIndex !== 0) {
Debug.assertLessThan(argumentIndex, argumentCount);
}
@@ -169116,7 +169144,7 @@ function getArgumentOrParameterListAndIndex(node, sourceFile, checker) {
return { list: getChildListThatStartsWithOpenerToken(node.parent, node, sourceFile), argumentIndex: 0 };
} else {
const list = findContainingList(node);
return list && { list, argumentIndex: getArgumentIndex(list, node, checker) };
return list && { list, argumentIndex: getArgumentIndex(checker, list, node) };
}
}
function getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker) {
@@ -169246,24 +169274,6 @@ function chooseBetterSymbol(s) {
return isFunctionTypeNode(d) ? (_a = tryCast(d.parent, canHaveSymbol)) == null ? void 0 : _a.symbol : void 0;
}) || s : s;
}
function getArgumentIndex(argumentsList, node, checker) {
const args = argumentsList.getChildren();
let argumentIndex = 0;
for (let pos = 0; pos < length(args); pos++) {
const child = args[pos];
if (child === node) {
break;
}
if (isSpreadElement(child)) {
argumentIndex = argumentIndex + getSpreadElementCount(child, checker) + (pos > 0 ? pos : 0);
} else {
if (child.kind !== 28 /* CommaToken */) {
argumentIndex++;
}
}
}
return argumentIndex;
}
function getSpreadElementCount(node, checker) {
const spreadType = checker.getTypeAtLocation(node.expression);
if (checker.isTupleType(spreadType)) {
@@ -169276,19 +169286,48 @@ function getSpreadElementCount(node, checker) {
}
return 0;
}
function getArgumentCount(argumentsList, ignoreTrailingComma, checker) {
const listChildren = argumentsList.getChildren();
let argumentCount = 0;
for (const child of listChildren) {
if (isSpreadElement(child)) {
argumentCount = argumentCount + getSpreadElementCount(child, checker);
function getArgumentIndex(checker, argumentsList, node) {
return getArgumentIndexOrCount(checker, argumentsList, node);
}
function getArgumentCount(checker, argumentsList) {
return getArgumentIndexOrCount(
checker,
argumentsList,
/*node*/
void 0
);
}
function getArgumentIndexOrCount(checker, argumentsList, node) {
const args = argumentsList.getChildren();
let argumentIndex = 0;
let skipComma = false;
for (const child of args) {
if (node && child === node) {
if (!skipComma && child.kind === 28 /* CommaToken */) {
argumentIndex++;
}
return argumentIndex;
}
if (isSpreadElement(child)) {
argumentIndex += getSpreadElementCount(child, checker);
skipComma = true;
continue;
}
if (child.kind !== 28 /* CommaToken */) {
argumentIndex++;
skipComma = true;
continue;
}
if (skipComma) {
skipComma = false;
continue;
}
argumentIndex++;
}
argumentCount = argumentCount + countWhere(listChildren, (arg) => arg.kind !== 28 /* CommaToken */);
if (!ignoreTrailingComma && listChildren.length > 0 && last(listChildren).kind === 28 /* CommaToken */) {
argumentCount++;
if (node) {
return argumentIndex;
}
return argumentCount;
return args.length && last(args).kind === 28 /* CommaToken */ ? argumentIndex + 1 : argumentIndex;
}
function getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile) {
Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node.");
@@ -181088,7 +181127,16 @@ function createWatchFactoryHostUsingWatchEvents(service, canUseWatchEvents) {
recursive ? watchedDirectoriesRecursive : watchedDirectories,
path,
callback,
(id) => ({ eventName: CreateDirectoryWatcherEvent, data: { id, path, recursive: !!recursive } })
(id) => ({
eventName: CreateDirectoryWatcherEvent,
data: {
id,
path,
recursive: !!recursive,
// Special case node_modules as we watch it for changes to closed script infos as well
ignoreUpdate: !path.endsWith("/node_modules") ? true : void 0
}
})
);
}
function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path, callback, event) {
@@ -181115,24 +181163,28 @@ function createWatchFactoryHostUsingWatchEvents(service, canUseWatchEvents) {
}
};
}
function onWatchChange({ id, path, eventType }) {
onFileWatcherCallback(id, path, eventType);
onDirectoryWatcherCallback(watchedDirectories, id, path, eventType);
onDirectoryWatcherCallback(watchedDirectoriesRecursive, id, path, eventType);
function onWatchChange(args) {
if (isArray(args))
args.forEach(onWatchChangeRequestArgs);
else
onWatchChangeRequestArgs(args);
}
function onFileWatcherCallback(id, eventPath, eventType) {
var _a;
(_a = watchedFiles.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
const eventKind = eventType === "create" ? 0 /* Created */ : eventType === "delete" ? 2 /* Deleted */ : 1 /* Changed */;
callback(eventPath, eventKind);
});
function onWatchChangeRequestArgs({ id, created, deleted, updated }) {
onWatchEventType(id, created, 0 /* Created */);
onWatchEventType(id, deleted, 2 /* Deleted */);
onWatchEventType(id, updated, 1 /* Changed */);
}
function onDirectoryWatcherCallback({ idToCallbacks }, id, eventPath, eventType) {
var _a;
if (eventType === "update")
function onWatchEventType(id, paths, eventKind) {
if (!(paths == null ? void 0 : paths.length))
return;
(_a = idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
callback(eventPath);
forEachCallback(watchedFiles, id, paths, (callback, eventPath) => callback(eventPath, eventKind));
forEachCallback(watchedDirectories, id, paths, (callback, eventPath) => callback(eventPath));
forEachCallback(watchedDirectoriesRecursive, id, paths, (callback, eventPath) => callback(eventPath));
}
function forEachCallback(hostWatcherMap, id, eventPaths, cb) {
var _a;
(_a = hostWatcherMap.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
eventPaths.forEach((eventPath) => cb(callback, normalizeSlashes(eventPath)));
});
}
}

View File

@@ -1510,12 +1510,13 @@ declare namespace ts {
}
interface WatchChangeRequest extends Request {
command: CommandTypes.WatchChange;
arguments: WatchChangeRequestArgs;
arguments: WatchChangeRequestArgs | readonly WatchChangeRequestArgs[];
}
interface WatchChangeRequestArgs {
id: number;
path: string;
eventType: "create" | "delete" | "update";
created?: string[];
deleted?: string[];
updated?: string[];
}
/**
* Request to obtain the list of files that should be regenerated if target file is recompiled.
@@ -2452,6 +2453,7 @@ declare namespace ts {
readonly id: number;
readonly path: string;
readonly recursive: boolean;
readonly ignoreUpdate?: boolean;
}
type CloseFileWatcherEventName = "closeFileWatcher";
interface CloseFileWatcherEvent extends Event {

View File

@@ -35,7 +35,7 @@ var ts = (() => {
"src/compiler/corePublic.ts"() {
"use strict";
versionMajorMinor = "5.4";
version = "5.4.3";
version = "5.4.4";
Comparison = /* @__PURE__ */ ((Comparison3) => {
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -5423,14 +5423,17 @@ ${lanes.join("\n")}
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
}
}
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp) {
const fileWatcherCallbacks = createMultiMap();
const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0;
const dirWatchers = /* @__PURE__ */ new Map();
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
return nonPollingWatchFile;
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
const filePath = toCanonicalName(fileName);
fileWatcherCallbacks.add(filePath, callback);
if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) {
fileTimestamps.set(filePath, getModifiedTime3(fileName) || missingFileModifiedTime);
}
const dirPath = getDirectoryPath(filePath) || ".";
const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions);
watcher.referenceCount++;
@@ -5450,14 +5453,31 @@ ${lanes.join("\n")}
const watcher = fsWatch(
dirName,
1 /* Directory */,
(_eventName, relativeFileName, modifiedTime) => {
(eventName, relativeFileName) => {
if (!isString(relativeFileName))
return;
const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
const callbacks = fileName && fileWatcherCallbacks.get(toCanonicalName(fileName));
const filePath = toCanonicalName(fileName);
const callbacks = fileName && fileWatcherCallbacks.get(filePath);
if (callbacks) {
let currentModifiedTime;
let eventKind = 1 /* Changed */;
if (fileTimestamps) {
const existingTime = fileTimestamps.get(filePath);
if (eventName === "change") {
currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime;
if (currentModifiedTime.getTime() === existingTime.getTime())
return;
}
currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime);
fileTimestamps.set(filePath, currentModifiedTime);
if (existingTime === missingFileModifiedTime)
eventKind = 0 /* Created */;
else if (currentModifiedTime === missingFileModifiedTime)
eventKind = 2 /* Deleted */;
}
for (const fileCallback of callbacks) {
fileCallback(fileName, 1 /* Changed */, modifiedTime);
fileCallback(fileName, eventKind, currentModifiedTime);
}
}
},
@@ -5849,7 +5869,7 @@ ${lanes.join("\n")}
);
case 5 /* UseFsEventsOnParentDirectory */:
if (!nonPollingWatchFile) {
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp);
}
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
default:
@@ -6024,7 +6044,7 @@ ${lanes.join("\n")}
return watchPresentFileSystemEntryWithFsWatchFile();
}
try {
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
fileOrDirectory,
recursive,
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
@@ -45450,13 +45470,21 @@ ${lanes.join("\n")}
}
const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath));
const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
if (nearestSourcePackageJson !== nearestTargetPackageJson) {
const ignoreCase = !hostUsesCaseSensitiveFileNames(host);
if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) {
return maybeNonRelative;
}
return relativePath;
}
return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
}
function packageJsonPathsAreEqual(a, b, ignoreCase) {
if (a === b)
return true;
if (a === void 0 || b === void 0)
return false;
return comparePaths(a, b, ignoreCase) === 0 /* EqualTo */;
}
function countPathComponents(path) {
let count = 0;
for (let i = startsWith(path, "./") ? 2 : 0; i < path.length; i++) {
@@ -50495,15 +50523,19 @@ ${lanes.join("\n")}
return true;
}
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
function getMeaningOfEntityNameReference(entityName) {
let meaning;
if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */) {
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) {
meaning = 1920 /* Namespace */;
} else {
meaning = 788968 /* Type */;
}
return meaning;
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
const meaning = getMeaningOfEntityNameReference(entityName);
const firstIdentifier = getFirstIdentifier(entityName);
const symbol = resolveName(
enclosingDeclaration,
@@ -52564,9 +52596,10 @@ ${lanes.join("\n")}
introducesError = true;
return { introducesError, node };
}
const meaning = getMeaningOfEntityNameReference(node);
const sym = resolveEntityName(
leftmost,
-1 /* All */,
meaning,
/*ignoreErrors*/
true,
/*dontResolveAlias*/
@@ -52576,13 +52609,13 @@ ${lanes.join("\n")}
if (isSymbolAccessible(
sym,
context.enclosingDeclaration,
-1 /* All */,
meaning,
/*shouldComputeAliasesToMakeVisible*/
false
).accessibility !== 0 /* Accessible */) {
introducesError = true;
} else {
context.tracker.trackSymbol(sym, context.enclosingDeclaration, -1 /* All */);
context.tracker.trackSymbol(sym, context.enclosingDeclaration, meaning);
includePrivateSymbol == null ? void 0 : includePrivateSymbol(sym);
}
if (isIdentifier(node)) {
@@ -60489,6 +60522,9 @@ ${lanes.join("\n")}
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
removeFromEach(typeSet, 65536 /* Null */);
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
} else if (typeSet.length >= 4) {
const middle = Math.floor(typeSet.length / 2);
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
} else {
if (!checkCrossProductUnion(typeSet)) {
return errorType;
@@ -159942,10 +159978,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
return isJsxExpression(parent2) && !isJsxElement(parent2.parent) && !isJsxFragment(parent2.parent) ? checker.getContextualTypeForJsxAttribute(parent2.parent) : void 0;
default:
const argInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(previousToken, position, sourceFile, checker);
return argInfo ? (
// At `,`, treat this as the next argument after the comma.
checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (previousToken.kind === 28 /* CommaToken */ ? 1 : 0))
) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
return argInfo ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
// completion at `x ===/**/` should be for the right side
checker.getTypeAtLocation(parent2.left)
) : checker.getContextualType(previousToken, 4 /* Completions */) || checker.getContextualType(previousToken);
@@ -168509,12 +168542,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
if (!info)
return void 0;
const { list, argumentIndex } = info;
const argumentCount = getArgumentCount(
list,
/*ignoreTrailingComma*/
isInString(sourceFile, position, node),
checker
);
const argumentCount = getArgumentCount(checker, list);
if (argumentIndex !== 0) {
Debug.assertLessThan(argumentIndex, argumentCount);
}
@@ -168526,7 +168554,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
return { list: getChildListThatStartsWithOpenerToken(node.parent, node, sourceFile), argumentIndex: 0 };
} else {
const list = findContainingList(node);
return list && { list, argumentIndex: getArgumentIndex(list, node, checker) };
return list && { list, argumentIndex: getArgumentIndex(checker, list, node) };
}
}
function getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker) {
@@ -168656,24 +168684,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
return isFunctionTypeNode(d) ? (_a = tryCast(d.parent, canHaveSymbol)) == null ? void 0 : _a.symbol : void 0;
}) || s : s;
}
function getArgumentIndex(argumentsList, node, checker) {
const args = argumentsList.getChildren();
let argumentIndex = 0;
for (let pos = 0; pos < length(args); pos++) {
const child = args[pos];
if (child === node) {
break;
}
if (isSpreadElement(child)) {
argumentIndex = argumentIndex + getSpreadElementCount(child, checker) + (pos > 0 ? pos : 0);
} else {
if (child.kind !== 28 /* CommaToken */) {
argumentIndex++;
}
}
}
return argumentIndex;
}
function getSpreadElementCount(node, checker) {
const spreadType = checker.getTypeAtLocation(node.expression);
if (checker.isTupleType(spreadType)) {
@@ -168686,19 +168696,48 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
}
return 0;
}
function getArgumentCount(argumentsList, ignoreTrailingComma, checker) {
const listChildren = argumentsList.getChildren();
let argumentCount = 0;
for (const child of listChildren) {
if (isSpreadElement(child)) {
argumentCount = argumentCount + getSpreadElementCount(child, checker);
function getArgumentIndex(checker, argumentsList, node) {
return getArgumentIndexOrCount(checker, argumentsList, node);
}
function getArgumentCount(checker, argumentsList) {
return getArgumentIndexOrCount(
checker,
argumentsList,
/*node*/
void 0
);
}
function getArgumentIndexOrCount(checker, argumentsList, node) {
const args = argumentsList.getChildren();
let argumentIndex = 0;
let skipComma = false;
for (const child of args) {
if (node && child === node) {
if (!skipComma && child.kind === 28 /* CommaToken */) {
argumentIndex++;
}
return argumentIndex;
}
if (isSpreadElement(child)) {
argumentIndex += getSpreadElementCount(child, checker);
skipComma = true;
continue;
}
if (child.kind !== 28 /* CommaToken */) {
argumentIndex++;
skipComma = true;
continue;
}
if (skipComma) {
skipComma = false;
continue;
}
argumentIndex++;
}
argumentCount = argumentCount + countWhere(listChildren, (arg) => arg.kind !== 28 /* CommaToken */);
if (!ignoreTrailingComma && listChildren.length > 0 && last(listChildren).kind === 28 /* CommaToken */) {
argumentCount++;
if (node) {
return argumentIndex;
}
return argumentCount;
return args.length && last(args).kind === 28 /* CommaToken */ ? argumentIndex + 1 : argumentIndex;
}
function getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile) {
Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node.");
@@ -178286,7 +178325,16 @@ ${options.prefix}` : "\n" : options.prefix
recursive ? watchedDirectoriesRecursive : watchedDirectories,
path,
callback,
(id) => ({ eventName: CreateDirectoryWatcherEvent, data: { id, path, recursive: !!recursive } })
(id) => ({
eventName: CreateDirectoryWatcherEvent,
data: {
id,
path,
recursive: !!recursive,
// Special case node_modules as we watch it for changes to closed script infos as well
ignoreUpdate: !path.endsWith("/node_modules") ? true : void 0
}
})
);
}
function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path, callback, event) {
@@ -178313,24 +178361,28 @@ ${options.prefix}` : "\n" : options.prefix
}
};
}
function onWatchChange({ id, path, eventType }) {
onFileWatcherCallback(id, path, eventType);
onDirectoryWatcherCallback(watchedDirectories, id, path, eventType);
onDirectoryWatcherCallback(watchedDirectoriesRecursive, id, path, eventType);
function onWatchChange(args) {
if (isArray(args))
args.forEach(onWatchChangeRequestArgs);
else
onWatchChangeRequestArgs(args);
}
function onFileWatcherCallback(id, eventPath, eventType) {
var _a;
(_a = watchedFiles.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
const eventKind = eventType === "create" ? 0 /* Created */ : eventType === "delete" ? 2 /* Deleted */ : 1 /* Changed */;
callback(eventPath, eventKind);
});
function onWatchChangeRequestArgs({ id, created, deleted, updated }) {
onWatchEventType(id, created, 0 /* Created */);
onWatchEventType(id, deleted, 2 /* Deleted */);
onWatchEventType(id, updated, 1 /* Changed */);
}
function onDirectoryWatcherCallback({ idToCallbacks }, id, eventPath, eventType) {
var _a;
if (eventType === "update")
function onWatchEventType(id, paths, eventKind) {
if (!(paths == null ? void 0 : paths.length))
return;
(_a = idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
callback(eventPath);
forEachCallback(watchedFiles, id, paths, (callback, eventPath) => callback(eventPath, eventKind));
forEachCallback(watchedDirectories, id, paths, (callback, eventPath) => callback(eventPath));
forEachCallback(watchedDirectoriesRecursive, id, paths, (callback, eventPath) => callback(eventPath));
}
function forEachCallback(hostWatcherMap, id, eventPaths, cb) {
var _a;
(_a = hostWatcherMap.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
eventPaths.forEach((eventPath) => cb(callback, normalizeSlashes(eventPath)));
});
}
}

View File

@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
// src/compiler/corePublic.ts
var versionMajorMinor = "5.4";
var version = "5.4.3";
var version = "5.4.4";
// src/compiler/core.ts
var emptyArray = [];
@@ -3560,14 +3560,17 @@ function createDynamicPriorityPollingWatchFile(host) {
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
}
}
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime2, fsWatchWithTimestamp) {
const fileWatcherCallbacks = createMultiMap();
const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0;
const dirWatchers = /* @__PURE__ */ new Map();
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
return nonPollingWatchFile;
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
const filePath = toCanonicalName(fileName);
fileWatcherCallbacks.add(filePath, callback);
if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) {
fileTimestamps.set(filePath, getModifiedTime2(fileName) || missingFileModifiedTime);
}
const dirPath = getDirectoryPath(filePath) || ".";
const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions);
watcher.referenceCount++;
@@ -3587,14 +3590,31 @@ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFi
const watcher = fsWatch(
dirName,
1 /* Directory */,
(_eventName, relativeFileName, modifiedTime) => {
(eventName, relativeFileName) => {
if (!isString(relativeFileName))
return;
const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
const callbacks = fileName && fileWatcherCallbacks.get(toCanonicalName(fileName));
const filePath = toCanonicalName(fileName);
const callbacks = fileName && fileWatcherCallbacks.get(filePath);
if (callbacks) {
let currentModifiedTime;
let eventKind = 1 /* Changed */;
if (fileTimestamps) {
const existingTime = fileTimestamps.get(filePath);
if (eventName === "change") {
currentModifiedTime = getModifiedTime2(fileName) || missingFileModifiedTime;
if (currentModifiedTime.getTime() === existingTime.getTime())
return;
}
currentModifiedTime || (currentModifiedTime = getModifiedTime2(fileName) || missingFileModifiedTime);
fileTimestamps.set(filePath, currentModifiedTime);
if (existingTime === missingFileModifiedTime)
eventKind = 0 /* Created */;
else if (currentModifiedTime === missingFileModifiedTime)
eventKind = 2 /* Deleted */;
}
for (const fileCallback of callbacks) {
fileCallback(fileName, 1 /* Changed */, modifiedTime);
fileCallback(fileName, eventKind, currentModifiedTime);
}
}
},
@@ -3985,7 +4005,7 @@ function createSystemWatchFunctions({
);
case 5 /* UseFsEventsOnParentDirectory */:
if (!nonPollingWatchFile) {
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime2, fsWatchWithTimestamp);
}
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
default:
@@ -4160,7 +4180,7 @@ function createSystemWatchFunctions({
return watchPresentFileSystemEntryWithFsWatchFile();
}
try {
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
fileOrDirectory,
recursive,
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback

View File

@@ -2,7 +2,7 @@
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "5.4.3",
"version": "5.4.4",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [