Skip to content

Commit 4ef7ab0

Browse files
authored
fix: use @oxc-project/types for ast types (#332)
1 parent ff71cac commit 4ef7ab0

7 files changed

Lines changed: 14 additions & 7 deletions

File tree

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"magic-regexp": "^0.11.0"
3535
},
3636
"devDependencies": {
37+
"@oxc-project/types": "0.139.0",
3738
"@types/node": "24.10.3",
3839
"@vitest/coverage-v8": "4.1.10",
3940
"knip": "^6.0.0",
@@ -42,10 +43,14 @@
4243
"vite-plus": "catalog:"
4344
},
4445
"peerDependencies": {
46+
"@oxc-project/types": ">=0.98.0",
4547
"oxc-parser": ">=0.98.0",
4648
"rolldown": ">=1.0.0"
4749
},
4850
"peerDependenciesMeta": {
51+
"@oxc-project/types": {
52+
"optional": true
53+
},
4954
"oxc-parser": {
5055
"optional": true
5156
},

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/scope-tracker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {
77
ImportDeclarationSpecifier,
88
Node,
99
VariableDeclaration,
10-
} from "oxc-parser";
10+
} from "@oxc-project/types";
1111
import type { Identifier } from "./walk";
1212
import { walk } from "./walk";
1313

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Node } from "oxc-parser";
1+
import type { Node } from "@oxc-project/types";
22

33
export function isNode(v: unknown): v is Node {
44
return (

src/walk.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import type {
44
IdentifierReference,
55
LabelIdentifier,
66
Node,
7-
ParseResult,
8-
ParserOptions,
97
Program,
108
TSIndexSignatureName,
11-
} from "oxc-parser";
9+
} from "@oxc-project/types";
10+
import type { ParseResult, ParserOptions } from "oxc-parser";
1211
import type { WalkerEnter } from "./walker/base";
1312
import type { WalkOptions } from "./walker/sync";
1413
import { createRequire } from "node:module";

src/walker/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Node, Program } from "oxc-parser";
1+
import type { Node, Program } from "@oxc-project/types";
22
import type { ScopeTracker, ScopeTrackerProtected } from "../scope-tracker";
33

44
export interface WalkerCallbackContext {

src/walker/sync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Node } from "oxc-parser";
1+
import type { Node } from "@oxc-project/types";
22
import type { ScopeTracker } from "../scope-tracker";
33
import type { WalkerCallbackContext, WalkerEnter, WalkerLeave, WalkerOptions } from "./base";
44
import { isNode } from "../utils";

0 commit comments

Comments
 (0)