@intentius/chant-lexicon-sql 0.124.10 → 0.124.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@
7
7
  * Every dialect exports tags with the same names (`table`, `view`), so a tag
8
8
  * is a dialect's by the module it is imported from, never by its name.
9
9
  */
10
- import * as ts from "typescript";
10
+ import { ts } from "@intentius/chant/lint/typescript";
11
11
  import type { Token } from "./tokens.js";
12
12
  /** Which imports make a tag one dialect's. */
13
13
  export interface TemplateSource<Tag extends string = string> {
@@ -1 +1 @@
1
- {"version":3,"file":"find-templates.d.ts","sourceRoot":"","sources":["../../src/core/find-templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC,8CAA8C;AAC9C,MAAM,WAAW,cAAc,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACzD,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,gCAAgC;IAChC,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACxD,IAAI,EAAE,EAAE,CAAC,wBAAwB,CAAC;IAClC,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,GAAG,CAAC;IACT,wDAAwD;IACxD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,oDAAoD;IACpD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,0DAA0D;IAC1D,WAAW,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC;CAC9B;AAqBD,wGAAwG;AACxG,wBAAgB,gBAAgB,CAAC,GAAG,SAAS,MAAM,EAAE,MAAM,EAAE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IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAMvF"}
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "f4009714cc6fbb4504249820c398ad1e9f9a2960b7ddac0743867150f784e2f6",
4
+ "manifest.json": "abc64c04738c3920dd5af13052fe0553defa77fa8e2d95818952de287fa837cd",
5
5
  "meta.json": "44b1dcfa5b5e5be2239fdc9614ab6c11d3f1461d64e61d572e3658af6c96aa68",
6
6
  "types/index.d.ts": "0286ebb367773e84c76818b0f69cb14cff8328fd2f8c65ed87563c8d5815458c",
7
- "rules/postgres-templates.ts": "da6e305bc2ff3d0d64a20925fe588e051c2a4b556b37f2581c61c314ef7c580d",
7
+ "rules/postgres-templates.ts": "94c2e73ec885a185fcc51c3346c371144eefe1512bc329f752cc7e609a0b4e5d",
8
8
  "rules/sqlch001.ts": "042af8bf78ea64524657eafa7a739734800cf99956bfa6152948684bede46955",
9
9
  "rules/sqlch002.ts": "d866298167d3f2f7b39bddd28cfbb4a761281a2816d6c21db19b86b32434737a",
10
- "rules/sqlch003.ts": "16ee8bf9369d97cf72b021d32636e5cc23bd168a51981eef826228c24fa8a8e9",
10
+ "rules/sqlch003.ts": "955bd6331af0cf7b4f7cd1656d809b9697a8cc91bb179c38a4bbd086c232354e",
11
11
  "rules/sqlch004.ts": "d97a5c0faaa22e8f0803b2d3cd608df63007b8ddd2edeca883822f8c537fcacf",
12
12
  "rules/sqlpg001.ts": "c6f0cb4da0b8deff16d33be2253eab2d500e82a74d28c264eba9aeada132c85f",
13
- "rules/sqlpg002.ts": "547e10e4da7a78b149b632eba21d876cb710b77fa654c7eed8ce86e27e37e81b",
13
+ "rules/sqlpg002.ts": "54ef045f45df77d2f07eae03417e84a5ce441ac90dc70e0a35f2b596d2104e28",
14
14
  "rules/sqlpg003.ts": "6f4903f9fdd3eb87bd4db3ad7e8fa0320db20f719ead7685a03cf7da677a7183",
15
15
  "rules/sqlpg004.ts": "68e4eaaa455f155d6dfe779eb01d7f134d856ab5db7cf45e2eb110ed7147b580",
16
16
  "rules/sqlpg005.ts": "fe6e2e2bd5b9beaf99187f404a704a25f51d4088737739c7663fcdc9aba94009",
17
- "rules/templates.ts": "f021609378d287d5e2dc763b022fa10ef74f402fa59d380a238c5ceed2995fd8",
18
- "rules/typed-names.ts": "a6d1e8c9e2417c05deec9534bff663c561ba462a1821a235284cba4e273776be",
17
+ "rules/templates.ts": "48e77c2bb24fc7f1792023ce081303e809f2b05a1b51ce790b3f8463f2b2840a",
18
+ "rules/typed-names.ts": "fbd5037dc10987611ad4dfb71ae97102b2bb8916c693033b923c6c0201280419",
19
19
  "rules/audit-entries.ts": "2339bc445687a4037652ffd300e3a230866b8abfd91f08a2ba831179cf646424",
20
20
  "rules/clickhouse-helpers.ts": "cdbbfd53ecf2cf912ecc60a9aeb2fd5d66db3665dc5b541a3a336904dc385b8a",
21
21
  "rules/clickhouse-type-check.ts": "75396cd5aef4ae09d6f7dea92924b0867e5c9182bbf918ade4d9b42823e54538",
@@ -79,5 +79,5 @@
79
79
  "rules/sqlpg125.ts": "cc7411c57c525613dc720ba00e986bbc4e5a84b8b0bcfa7a6ce0d058f039f025",
80
80
  "rules/sqlpg126.ts": "d57b82a5842273876510131d67bf4418cbd61eff821e245edebc644dafd502bb"
81
81
  },
82
- "composite": "d20fc1bf819301ea848e13fa39709a370f997ea504cfcdb77cce100c014b6e60"
82
+ "composite": "0cf2d157a38a4379ca1ca84c7a93c877d6ce5e91bdd31ac2e55803e2dd4abfb3"
83
83
  }
@@ -5,7 +5,7 @@
5
5
  * ClickHouse does not export (the root's `table` and `view` are
6
6
  * ClickHouse's).
7
7
  */
8
- import type * as ts from "typescript";
8
+ import type { ts } from "@intentius/chant/lint/typescript";
9
9
  import { type Token } from "../../postgres/tokens.js";
10
10
  import type { PostgresTag } from "../../postgres/entities.js";
11
11
  import { type FoundTemplate, type TemplateSource } from "../../core/find-templates.js";
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-templates.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/postgres-templates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAoB,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEtG,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE5E,eAAO,MAAM,yBAAyB,EAAE,SAAS,cAAc,CAAC,WAAW,CAAC,EAW3E,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAE/D,2CAA2C;AAC3C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,GAAG,qBAAqB,EAAE,CAEpF;AAED,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,KAAG,KAAK,EAA2B,CAAC"}
1
+ {"version":3,"file":"postgres-templates.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/postgres-templates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAoB,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEtG,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE5E,eAAO,MAAM,yBAAyB,EAAE,SAAS,cAAc,CAAC,WAAW,CAAC,EAW3E,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAE/D,2CAA2C;AAC3C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,GAAG,qBAAqB,EAAE,CAEpF;AAED,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,KAAG,KAAK,EAA2B,CAAC"}
@@ -6,7 +6,7 @@
6
6
  * the shared core's (`../../core/find-templates.ts`); a tag is ClickHouse's
7
7
  * because of the module it is imported from.
8
8
  */
9
- import type * as ts from "typescript";
9
+ import type { ts } from "@intentius/chant/lint/typescript";
10
10
  import { type Token } from "../../clickhouse/tokens.js";
11
11
  import { type FoundTemplate as SqlFoundTemplate, type TemplateSource } from "../../core/find-templates.js";
12
12
  export { templatePosition, tokenPosition } from "../../core/find-templates.js";
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAoB,KAAK,aAAa,IAAI,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE1H,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElH;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,cAAc,CAAC,MAAM,CAI7D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAErD,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,GAAG,aAAa,EAAE,CAEpE;AAED,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,KAAG,KAAK,EAA2B,CAAC"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAoB,KAAK,aAAa,IAAI,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE1H,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElH;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,cAAc,CAAC,MAAM,CAI7D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAErD,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,GAAG,aAAa,EAAE,CAEpE;AAED,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,KAAG,KAAK,EAA2B,CAAC"}
@@ -8,7 +8,7 @@
8
8
  * argument is a constraint, and an unlisted name falls back to unchecked
9
9
  * columns, so a mistyped argument is silent without these rules.
10
10
  */
11
- import * as ts from "typescript";
11
+ import { ts } from "@intentius/chant/lint/typescript";
12
12
  /** The generated file's name, beside the source (`chant sql types`). */
13
13
  export declare const SQL_TYPES_FILE = "sql-types.d.ts";
14
14
  /** A tag's type argument, when it is a string literal: `table<"shop.orders">`. */
@@ -1 +1 @@
1
- {"version":3,"file":"typed-names.d.ts","sourceRoot":"","sources":["../../../src/l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AACxE,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,kFAAkF;AAClF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,wBAAwB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAA;CAAE,GAAG,SAAS,CAK1H;AAED,iHAAiH;AACjH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAoBrD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAUjF;AAED,+EAA+E;AAC/E,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,MAAM,EAAE,KAAG,MAAkE,CAAC;AAE9H,qGAAqG;AACrG,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,MAAyC,CAAC;AAExF,4IAA4I;AAC5I,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,CAgBzF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUtE;AAED,6HAA6H;AAC7H,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,CAQ3F"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sql",
3
- "version": "0.124.10",
3
+ "version": "0.124.12",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "SQL",
6
6
  "intrinsics": [],
@@ -6,7 +6,7 @@
6
6
  * ClickHouse's).
7
7
  */
8
8
 
9
- import type * as ts from "typescript";
9
+ import type { ts } from "@intentius/chant/lint/typescript";
10
10
  import { tokenize, type Token } from "../../postgres/tokens";
11
11
  import type { PostgresTag } from "../../postgres/entities";
12
12
  import { findSqlTemplates, type FoundTemplate, type TemplateSource } from "../../core/find-templates";
@@ -1,4 +1,4 @@
1
- import * as ts from "typescript";
1
+ import { ts } from "@intentius/chant/lint/typescript";
2
2
  import type { LintContext, LintDiagnostic, LintRule } from "@intentius/chant/lint/rule";
3
3
  import { findTemplates } from "./templates";
4
4
 
@@ -1,4 +1,4 @@
1
- import * as ts from "typescript";
1
+ import { ts } from "@intentius/chant/lint/typescript";
2
2
  import type { LintContext, LintDiagnostic, LintRule } from "@intentius/chant/lint/rule";
3
3
  import { findPostgresTemplates as findTemplates } from "./postgres-templates";
4
4
 
@@ -7,7 +7,7 @@
7
7
  * because of the module it is imported from.
8
8
  */
9
9
 
10
- import type * as ts from "typescript";
10
+ import type { ts } from "@intentius/chant/lint/typescript";
11
11
  import { tokenize, type Token } from "../../clickhouse/tokens";
12
12
  import { findSqlTemplates, type FoundTemplate as SqlFoundTemplate, type TemplateSource } from "../../core/find-templates";
13
13
 
@@ -11,7 +11,7 @@
11
11
 
12
12
  import { existsSync, readFileSync } from "node:fs";
13
13
  import { dirname, join, resolve } from "node:path";
14
- import * as ts from "typescript";
14
+ import { ts } from "@intentius/chant/lint/typescript";
15
15
 
16
16
  /** The generated file's name, beside the source (`chant sql types`). */
17
17
  export const SQL_TYPES_FILE = "sql-types.d.ts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-sql",
3
- "version": "0.124.10",
3
+ "version": "0.124.12",
4
4
  "description": "SQL lexicon for chant — database schema as typed declarations, one dialect at a time; ClickHouse first, with types read from a pinned server's catalog",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -70,7 +70,6 @@
70
70
  "typescript": "^5.9.3"
71
71
  },
72
72
  "peerDependencies": {
73
- "@intentius/chant": "^0.124.10",
74
- "typescript": "^5.9.3"
73
+ "@intentius/chant": "^0.124.12"
75
74
  }
76
75
  }
@@ -8,7 +8,7 @@
8
8
  * is a dialect's by the module it is imported from, never by its name.
9
9
  */
10
10
 
11
- import * as ts from "typescript";
11
+ import { ts } from "@intentius/chant/lint/typescript";
12
12
  import type { Token } from "./tokens";
13
13
  import { unescapeTemplateDelimiters } from "./template";
14
14
 
@@ -6,7 +6,7 @@
6
6
  * ClickHouse's).
7
7
  */
8
8
 
9
- import type * as ts from "typescript";
9
+ import type { ts } from "@intentius/chant/lint/typescript";
10
10
  import { tokenize, type Token } from "../../postgres/tokens";
11
11
  import type { PostgresTag } from "../../postgres/entities";
12
12
  import { findSqlTemplates, type FoundTemplate, type TemplateSource } from "../../core/find-templates";
@@ -1,4 +1,4 @@
1
- import * as ts from "typescript";
1
+ import { ts } from "@intentius/chant/lint/typescript";
2
2
  import type { LintContext, LintDiagnostic, LintRule } from "@intentius/chant/lint/rule";
3
3
  import { findTemplates } from "./templates";
4
4
 
@@ -1,4 +1,4 @@
1
- import * as ts from "typescript";
1
+ import { ts } from "@intentius/chant/lint/typescript";
2
2
  import type { LintContext, LintDiagnostic, LintRule } from "@intentius/chant/lint/rule";
3
3
  import { findPostgresTemplates as findTemplates } from "./postgres-templates";
4
4
 
@@ -7,7 +7,7 @@
7
7
  * because of the module it is imported from.
8
8
  */
9
9
 
10
- import type * as ts from "typescript";
10
+ import type { ts } from "@intentius/chant/lint/typescript";
11
11
  import { tokenize, type Token } from "../../clickhouse/tokens";
12
12
  import { findSqlTemplates, type FoundTemplate as SqlFoundTemplate, type TemplateSource } from "../../core/find-templates";
13
13
 
@@ -11,7 +11,7 @@
11
11
 
12
12
  import { existsSync, readFileSync } from "node:fs";
13
13
  import { dirname, join, resolve } from "node:path";
14
- import * as ts from "typescript";
14
+ import { ts } from "@intentius/chant/lint/typescript";
15
15
 
16
16
  /** The generated file's name, beside the source (`chant sql types`). */
17
17
  export const SQL_TYPES_FILE = "sql-types.d.ts";
@@ -0,0 +1,101 @@
1
+ /**
2
+ * The sql lint rules run in a project whose `typescript` is TypeScript 7
3
+ * (chant #3864).
4
+ *
5
+ * TypeScript 7's `typescript` package has no JS compiler API. chant core keeps
6
+ * its own 5.x and parses every file with it, but a rule that imported
7
+ * `typescript` itself got the project's copy, and every rule threw
8
+ * `ts.isImportDeclaration is not a function`, so `chant graph` refused the
9
+ * project. The rules now take `ts` from `@intentius/chant/lint/typescript`.
10
+ *
11
+ * In this repo the rules and core resolve the same `typescript`, so the test
12
+ * lays out the install a user gets: a project whose `node_modules/typescript`
13
+ * is TypeScript 7 (the root's `typescript-native` alias), a copy of this
14
+ * lexicon in it (a copy, because module resolution follows the real path),
15
+ * and chant core keeping its own TypeScript 5. It then runs the rules the way
16
+ * the CLI does, in a separate node process under tsx, over the examples.
17
+ */
18
+ import { afterAll, beforeAll, describe, expect, test } from "vitest";
19
+ import { execFileSync } from "node:child_process";
20
+ import { cpSync, existsSync, mkdirSync, mkdtempSync, readdirSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
21
+ import { tmpdir } from "node:os";
22
+ import { join } from "node:path";
23
+ import { fileURLToPath } from "node:url";
24
+
25
+ const lexiconDir = fileURLToPath(new URL("../../../", import.meta.url));
26
+ const repoRoot = join(lexiconDir, "..", "..");
27
+ const nodeModules = join(repoRoot, "node_modules");
28
+ const ts7 = join(nodeModules, "typescript-native");
29
+ const tsxLoader = join(nodeModules, "tsx", "dist", "loader.mjs");
30
+
31
+ const examples = ["postgres-getting-started", "getting-started"].map((name) => join(lexiconDir, "examples", name, "src"));
32
+
33
+ /** Runs in the child: every rule over every example file, reporting what threw. */
34
+ const RUNNER = `
35
+ import { createRequire } from "node:module";
36
+ import { readdirSync } from "node:fs";
37
+ import { join } from "node:path";
38
+ import { parseFile } from "@intentius/chant/lint/parser";
39
+ import { rules } from "@intentius/chant-lexicon-sql/lint/rules/index";
40
+
41
+ // The \`typescript\` the lexicon would get from a bare import.
42
+ const lexiconTs = createRequire(process.argv[3])("typescript/package.json").version;
43
+ const threw = [];
44
+ let checked = 0;
45
+ for (const dir of JSON.parse(process.argv[2])) {
46
+ for (const name of readdirSync(dir).filter((f) => f.endsWith(".ts"))) {
47
+ const filePath = join(dir, name);
48
+ const sourceFile = parseFile(filePath);
49
+ for (const rule of rules) {
50
+ try {
51
+ rule.check({ sourceFile, entities: [], filePath });
52
+ checked++;
53
+ } catch (err) {
54
+ threw.push(rule.id + " " + name + ": " + (err instanceof Error ? err.message : String(err)));
55
+ }
56
+ }
57
+ }
58
+ }
59
+ console.log(JSON.stringify({ lexiconTs, checked, threw }));
60
+ `;
61
+
62
+ const ready = existsSync(ts7) && existsSync(tsxLoader);
63
+
64
+ describe.skipIf(!ready)("sql lint rules in a TypeScript 7 project (#3864)", () => {
65
+ let project: string;
66
+ let lexiconPackageJson: string;
67
+
68
+ beforeAll(() => {
69
+ project = mkdtempSync(join(tmpdir(), "chant-sql-ts7-"));
70
+ const modules = join(project, "node_modules");
71
+ mkdirSync(join(modules, "@intentius"), { recursive: true });
72
+ symlinkSync(ts7, join(modules, "typescript"), "dir");
73
+ symlinkSync(join(repoRoot, "packages", "core"), join(modules, "@intentius", "chant"), "dir");
74
+ for (const dep of ["pg", "zod"]) symlinkSync(join(nodeModules, dep), join(modules, dep), "dir");
75
+ const copy = join(modules, "@intentius", "chant-lexicon-sql");
76
+ lexiconPackageJson = join(copy, "package.json");
77
+ cpSync(join(lexiconDir, "src"), join(copy, "src"), {
78
+ recursive: true,
79
+ filter: (src) => !src.endsWith(".test.ts"),
80
+ });
81
+ cpSync(join(lexiconDir, "package.json"), join(copy, "package.json"));
82
+ writeFileSync(join(project, "run.mts"), RUNNER);
83
+ });
84
+
85
+ afterAll(() => {
86
+ if (project) rmSync(project, { recursive: true, force: true });
87
+ });
88
+
89
+ test("no rule throws, and the lexicon really sees TypeScript 7", () => {
90
+ for (const dir of examples) expect(readdirSync(dir).length).toBeGreaterThan(0);
91
+ const out = execFileSync(process.execPath, ["--import", `file://${tsxLoader}`, join(project, "run.mts"), JSON.stringify(examples), lexiconPackageJson], {
92
+ cwd: project,
93
+ encoding: "utf-8",
94
+ env: { ...process.env, TSX_DISABLE_CACHE: "1" },
95
+ });
96
+ const { lexiconTs, checked, threw } = JSON.parse(out.trim().split("\n").pop()!);
97
+ expect(lexiconTs).toMatch(/^7\./);
98
+ expect(threw).toEqual([]);
99
+ expect(checked).toBeGreaterThan(0);
100
+ }, 120_000);
101
+ });
@@ -1,4 +1,4 @@
1
- import * as ts from "typescript";
1
+ import { ts } from "@intentius/chant/lint/typescript";
2
2
  import type { CompletionContext, CompletionItem } from "@intentius/chant/lsp/types";
3
3
  import { lexiconCompletions } from "@intentius/chant/lsp/lexicon-providers";
4
4
  import { catalogIndex, type CatalogIndex } from "./catalog";
@@ -4,7 +4,7 @@
4
4
  * rules, so the editor and `chant lint` agree on which tags are Postgres's.
5
5
  */
6
6
 
7
- import * as ts from "typescript";
7
+ import { ts } from "@intentius/chant/lint/typescript";
8
8
  import { isTrivia, tokenize, type Token } from "../postgres/tokens";
9
9
  import { parseStatements, type Span } from "../postgres/parser";
10
10
  import type { PostgresTag } from "../postgres/entities";
@@ -10,7 +10,7 @@
10
10
 
11
11
  import { existsSync, readFileSync } from "fs";
12
12
  import { dirname, resolve } from "path";
13
- import * as ts from "typescript";
13
+ import { ts } from "@intentius/chant/lint/typescript";
14
14
  import type { CompletionContext, CompletionItem, HoverContext, HoverInfo } from "@intentius/chant/lsp/types";
15
15
  import {
16
16
  describeRange,
package/src/lsp/refs.ts CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  import { existsSync, readFileSync } from "fs";
8
8
  import { dirname, resolve } from "path";
9
- import * as ts from "typescript";
9
+ import { ts } from "@intentius/chant/lint/typescript";
10
10
  import { declarations, type Declared } from "./template";
11
11
 
12
12
  function importedFrom(content: string, local: string, fileName: string): { declared: Declared; file: string } | undefined {
@@ -5,7 +5,7 @@
5
5
  * is and which module's tags count.
6
6
  */
7
7
 
8
- import * as ts from "typescript";
8
+ import { ts } from "@intentius/chant/lint/typescript";
9
9
  import { isTrivia, tokenize, type Token } from "../clickhouse/tokens";
10
10
  import { parseCreate, type Span } from "../clickhouse/parser";
11
11
  import { CLICKHOUSE_TEMPLATE_SOURCE, findTemplates, type FoundTemplate, type SqlTag } from "../lint/rules/templates";