Skip to content

Commit 61de068

Browse files
build: complete TypeScript project references and fix import paths
- Update tsconfig.json to solution-style with project references (cli, preset-basic) - Fix import paths: util/glob.ts → utils/glob.ts after folder consolidation - Improve type safety: Rule[] → ReadonlyArray<Rule> in RuleRunner - Update preset-basic typecheck to use tsc -b for project references - Add @types/node to preset-basic devDependencies - Update pnpm-lock.yaml Completes the TypeScript project references setup started in commit 3. Related thread: T-dadffd74-9b38-4d2d-bb50-2f7dfcebd980 Amp-Thread-ID: https://ampcode.com/threads/T-725adb55-57d9-49d1-a637-3a756efeb447 Co-authored-by: Amp <amp@ampcode.com>
1 parent c0ad50a commit 61de068

7 files changed

Lines changed: 13 additions & 27 deletions

File tree

packages/cli/tsconfig.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
{
2-
"extends": "../../tsconfig.base.json",
3-
"compilerOptions": {
4-
"composite": true,
5-
"noEmit": false,
6-
"rootDir": "./src",
7-
"outDir": "./build/esm",
8-
"tsBuildInfoFile": "./build/.tsbuildinfo"
9-
},
10-
"include": ["src/**/*"],
11-
"exclude": ["**/*.test.ts", "**/__tests__/**", "node_modules"],
12-
"references": [{ "path": "../core/tsconfig.build.json" }]
2+
"files": [],
3+
"references": [{ "path": "./tsconfig.src.json" }, { "path": "./tsconfig.test.json" }]
134
}

packages/core/src/engines/BoundaryEngine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import type { ImportIndexResult, Rule, RuleContext, RuleResult } from "../rules/
2020
import type { Config } from "../schema/Config.js"
2121
import type { FileDiscoveryService } from "../services/FileDiscovery.js"
2222
import type { ImportIndexService } from "../services/ImportIndex.js"
23-
import { matchGlob } from "../util/glob.js"
23+
import { matchGlob } from "../utils/glob.js"
2424

2525
/**
2626
* Execute boundary rules across project files.

packages/core/src/services/FileDiscovery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import * as Path from "@effect/platform/Path"
1717
import * as Context from "effect/Context"
1818
import * as Effect from "effect/Effect"
1919
import * as Layer from "effect/Layer"
20-
import { matchGlob } from "../util/glob.js"
20+
import { matchGlob } from "../utils/glob.js"
2121

2222
/**
2323
* Supported text file extensions for content reading.

packages/core/src/services/RuleRunner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface RuleRunnerService {
3333
/**
3434
* Run all rules against the project
3535
*/
36-
runRules: (rules: Rule[], config: Config) => Effect.Effect<RuleResult[]>
36+
runRules: (rules: ReadonlyArray<Rule>, config: Config) => Effect.Effect<RuleResult[]>
3737
}
3838

3939
/**
@@ -71,7 +71,7 @@ export const RuleRunnerLive = Layer.effect(
7171
const importIndexService = yield* ImportIndex
7272
const pathSvc = yield* Path.Path
7373

74-
const runRules = (rules: Rule[], config: Config): Effect.Effect<RuleResult[]> =>
74+
const runRules = (rules: ReadonlyArray<Rule>, config: Config): Effect.Effect<RuleResult[]> =>
7575
Effect.gen(function*() {
7676
yield* Console.log(`Running ${rules.length} rules...`)
7777

packages/preset-basic/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"pack": "build-utils pack-v4",
3636
"test": "vitest",
3737
"test:ci": "vitest run",
38-
"typecheck": "tsc --noEmit",
38+
"typecheck": "tsc -b",
3939
"lint": "eslint . --max-warnings 0 && prettier --check \"**/*.{json,md,yml,yaml}\"",
4040
"lint:fix": "eslint . --fix && prettier --write \"**/*.{json,md,yml,yaml}\""
4141
},
@@ -45,6 +45,7 @@
4545
},
4646
"devDependencies": {
4747
"@effect/vitest": "^0.27.0",
48+
"@types/node": "^24.10.0",
4849
"typescript": "^5.9.3",
4950
"vitest": "^3.2.4"
5051
},
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
{
2-
"extends": "../../tsconfig.base.json",
3-
"compilerOptions": {
4-
"composite": true,
5-
"noEmit": false,
6-
"rootDir": "./src",
7-
"outDir": "./build/esm",
8-
"tsBuildInfoFile": "./build/.tsbuildinfo"
9-
},
10-
"include": ["src/**/*"],
11-
"exclude": ["**/*.test.ts", "**/__tests__/**", "node_modules"],
12-
"references": [{ "path": "../core/tsconfig.build.json" }]
2+
"files": [],
3+
"references": [{ "path": "./tsconfig.src.json" }, { "path": "./tsconfig.test.json" }]
134
}

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.

0 commit comments

Comments
 (0)