Skip to content

chore: fix cyclic dependency in repo caused by generate-lib script changes #7603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/actions/prepare-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ runs:
run: |
yarn install --immutable --inline-builds
yarn check-clean-workspace-after-install
yarn patch-package
env:
# CI optimizations. Overrides yarnrc.yml options (or their defaults) in the CI action.
YARN_ENABLE_GLOBAL_CACHE: 'false' # Use local cache folder to keep downloaded archives
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ jobs:

- name: Build website
if: github.repository != 'typescript-eslint/typescript-eslint' || github.ref != 'refs/heads/main'
run: NX_VERBOSE_LOGGING=true yarn patch-package && yarn nx build website
run: NX_VERBOSE_LOGGING=true yarn nx build website

- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/node_modules/react-split-pane/index.d.ts b/node_modules/react-split-pane/index.d.ts
index d116f54..20a132e 100644
--- a/node_modules/react-split-pane/index.d.ts
+++ b/node_modules/react-split-pane/index.d.ts
diff --git a/index.d.ts b/index.d.ts
index d116f54d6da12d24b48e24ff3636c9066059aa58..20a132e2a8a2bf0b023af87699d6b0703c9b1a1a 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -6,6 +6,7 @@ export type Split = 'vertical' | 'horizontal';

export type SplitPaneProps = {
Expand Down
84 changes: 84 additions & 0 deletions .yarn/patches/typescript-npm-5.2.2-01717e9f84.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038a7fe4164 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -371,8 +371,8 @@ declare namespace ts {
JSDocFunctionType = 324,
JSDocVariadicType = 325,
JSDocNamepathType = 326,
+ /** @deprecated This was only added in 4.7 */
JSDoc = 327,
- /** @deprecated Use SyntaxKind.JSDoc */
JSDocComment = 327,
JSDocText = 328,
JSDocTypeLiteral = 329,
@@ -738,6 +738,8 @@ declare namespace ts {
readonly name: PropertyName;
readonly questionToken?: QuestionToken;
readonly type?: TypeNode;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly initializer?: Expression | undefined;
}
interface PropertyDeclaration extends ClassElement, JSDocContainer {
readonly kind: SyntaxKind.PropertyDeclaration;
@@ -763,6 +765,10 @@ declare namespace ts {
readonly parent: ObjectLiteralExpression;
readonly name: PropertyName;
readonly initializer: Expression;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly questionToken?: QuestionToken | undefined;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly exclamationToken?: ExclamationToken | undefined;
}
interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer {
readonly kind: SyntaxKind.ShorthandPropertyAssignment;
@@ -770,6 +776,12 @@ declare namespace ts {
readonly name: Identifier;
readonly equalsToken?: EqualsToken;
readonly objectAssignmentInitializer?: Expression;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly modifiers?: NodeArray<Modifier> | undefined;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly questionToken?: QuestionToken | undefined;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly exclamationToken?: ExclamationToken | undefined;
}
interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer {
readonly kind: SyntaxKind.SpreadAssignment;
@@ -892,6 +904,8 @@ declare namespace ts {
}
interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer {
readonly kind: SyntaxKind.FunctionType;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly modifiers?: NodeArray<Modifier> | undefined;
}
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer {
readonly kind: SyntaxKind.ConstructorType;
@@ -4584,7 +4598,13 @@ declare namespace ts {
function symbolName(symbol: Symbol): string;
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined;
+ /**
+ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getDecorators from `@typescript-eslint/type-utils`.
+ */
function getDecorators(node: HasDecorators): readonly Decorator[] | undefined;
+ /**
+ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getModifiers from `@typescript-eslint/type-utils`.
+ */
function getModifiers(node: HasModifiers): readonly Modifier[] | undefined;
/**
* Gets the JSDoc parameter tags for the node if present.
@@ -5110,7 +5130,13 @@ declare namespace ts {
function isModuleName(node: Node): node is ModuleName;
function isBinaryOperatorToken(node: Node): node is BinaryOperatorToken;
function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T;
+ /**
+ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getModifiers from `@typescript-eslint/type-utils`.
+ */
function canHaveModifiers(node: Node): node is HasModifiers;
+ /**
+ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getDecorators from `@typescript-eslint/type-utils`.
+ */
function canHaveDecorators(node: Node): node is HasDecorators;
/**
* Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[build]
base = ""
publish = "packages/website/build"
command = "NX_VERBOSE_LOGGING=true yarn patch-package && yarn nx build website"
command = "NX_VERBOSE_LOGGING=true yarn nx build website"
[build.environment]
NETLIFY_USE_YARN = "true"
# TODO: adjust these once https://github.com/netlify/build-image/issues/612 is resolved
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"generate-contributors": "nx run repo-tools:generate-contributors",
"generate-sponsors": "nx run repo-tools:generate-sponsors",
"generate-website-dts": "nx run website:generate-website-dts",
"generate-lib": "nx run scope-manager:generate-lib",
"generate-lib": "nx run repo-tools:generate-lib",
"lint-fix": "yarn lint --fix",
"lint-markdown-fix": "yarn lint-markdown --fix",
"lint-markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore",
Expand Down Expand Up @@ -108,7 +108,6 @@
"netlify": "^13.1.9",
"nx": "16.7.2",
"nx-cloud": "16.4.0-beta.1",
"patch-package": "^8.0.0",
"prettier": "^2.8.4",
"pretty-format": "^29.6.2",
"raw-loader": "^4.0.2",
Expand Down Expand Up @@ -141,8 +140,9 @@
"jest-resolve": "^29",
"jest-util": "^29",
"pretty-format": "^29",
"react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch",
"tsx": "^3.12.7",
"typescript": "5.2.2"
"typescript": "patch:typescript@npm%3A5.2.2#./.yarn/patches/typescript-npm-5.2.2-01717e9f84.patch"
},
"packageManager": "yarn@3.6.3"
}
7 changes: 5 additions & 2 deletions packages/repo-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"version": "6.6.0",
"private": true,
"scripts": {
"build": "tsc -b tsconfig.build.json",
"//": "NOTE: intentionally no build step in this package",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"generate-contributors": "tsx ./src/generate-contributors.ts",
"generate-sponsors": "tsx ./src/generate-sponsors.ts",
"generate-lib": "tsx ./src/generate-lib.ts",
"lint": "nx lint",
"postinstall-script": "tsx ./src/postinstall.mts",
"test": "jest --coverage",
Expand All @@ -17,6 +18,8 @@
"cross-fetch": "*",
"execa": "*",
"prettier": "^2.8.4",
"tmp": "*"
"rimraf": "*",
"tmp": "*",
"typescript": "*"
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
import type {
AnalyzeOptions,
ScopeManager,
Variable,
} from '@typescript-eslint/scope-manager';
import { analyze } from '@typescript-eslint/scope-manager';
import type { TSESTree } from '@typescript-eslint/types';
import { AST_TOKEN_TYPES } from '@typescript-eslint/types';
import type { TSESTreeOptions } from '@typescript-eslint/typescript-estree';
import { parse } from '@typescript-eslint/typescript-estree';
import { ESLint } from '@typescript-eslint/utils/ts-eslint';
import * as fs from 'fs';
import * as path from 'path';
import { format, resolveConfig } from 'prettier';
import { rimraf } from 'rimraf';
import * as ts from 'typescript';

import type { ScopeManager, Variable } from '../src';
import { parseAndAnalyze } from '../tests/util/parse';
function parseAndAnalyze(
code: string,
analyzeOptions: AnalyzeOptions,
parserOptions: TSESTreeOptions,
): {
ast: ReturnType<typeof parse>;
scopeManager: ReturnType<typeof analyze>;
} {
const ast = parse(code, { ...parserOptions });
const scopeManager = analyze(ast, analyzeOptions);

return { ast, scopeManager };
}

const libMap = new Map(ts.libMap);
// add the "full" libs as well - these are used by the default config resolution system
Expand All @@ -29,7 +48,7 @@ function addAutoGeneratedComment(code: string[]): string {
'// THIS CODE WAS AUTOMATICALLY GENERATED',
'// DO NOT EDIT THIS CODE BY HAND',
'// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:',
'// npx nx generate-lib @typescript-eslint/scope-manager',
'// npx nx generate-lib @typescript-eslint/repo-tools',
'',
...code,
].join('\n');
Expand All @@ -45,7 +64,14 @@ const TS_LIB_FOLDER = path.resolve(
'typescript',
'lib',
);
const OUTPUT_FOLDER = path.resolve(__dirname, '..', 'src', 'lib');
const OUTPUT_FOLDER = path.resolve(
__dirname,
'..',
'..',
'scope-manager',
'src',
'lib',
);
const TYPES_FILE = path.resolve(
__dirname,
'..',
Expand Down
3 changes: 0 additions & 3 deletions packages/repo-tools/src/postinstall.mts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ void (async function (): Promise<void> {
} = await import('@nx/devkit');
process.chdir(workspaceRoot);

// Apply patches to installed node_modules
await $`yarn patch-package`;

// Install git hooks
await $`yarn husky install`;

Expand Down
2 changes: 1 addition & 1 deletion packages/rule-tester/src/utils/config-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function validateRuleSchema(
const validateRule = ruleValidators.get(rule);

if (validateRule) {
validateRule(localOptions);
void validateRule(localOptions);
if (validateRule.errors) {
throw new Error(
validateRule.errors
Expand Down
2 changes: 0 additions & 2 deletions packages/scope-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@
"glob": "*",
"jest-specific-snapshot": "*",
"make-dir": "*",
"prettier": "^2.8.4",
"pretty-format": "*",
"rimraf": "*",
"typescript": "*"
},
"funding": {
Expand Down
4 changes: 2 additions & 2 deletions packages/scope-manager/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"executor": "nx:run-commands",
"options": {
"parallel": false,
"cwd": "packages/scope-manager",
"commands": ["yarn tsx tools/generate-lib.ts"]
"cwd": "packages/repo-tools",
"commands": ["yarn generate-lib"]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/base-config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

export const TYPE = Object.freeze({
eslintImplicitGlobalSetting: 'readonly',
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/decorators.legacy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/decorators.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/dom.iterable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/dom.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE, TYPE_VALUE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/es2015.collection.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE, TYPE_VALUE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/es2015.core.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/es2015.generator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/es2015.iterable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/es2015.promise.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/es2015.proxy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/es2015.reflect.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE_VALUE } from './base-config';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/es2015.symbol.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib @typescript-eslint/scope-manager
// npx nx generate-lib @typescript-eslint/repo-tools

import type { ImplicitLibVariableOptions } from '../variable';
import { TYPE } from './base-config';
Expand Down
Loading