Skip to content

Commit c2cd596

Browse files
committed
use "rewriteRelativeImportExtensions"
1 parent 6d9fcf6 commit c2cd596

File tree

204 files changed

+948
-941
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+948
-941
lines changed

package-lock.json

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

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
"picocolors": "^1.1.1"
3232
},
3333
"devDependencies": {
34-
"@types/node": "^22.9.0",
34+
"@types/node": "^22.10.1",
3535
"@xieyuheng/test-runner": "^0.2.10",
36-
"prettier": "^3.3.3",
36+
"prettier": "^3.4.1",
3737
"prettier-plugin-organize-imports": "^4.1.0",
38-
"typescript": "^5.6.3",
39-
"vitest": "^2.1.5"
38+
"typescript": "^5.7.2",
39+
"vitest": "^2.1.8"
4040
}
4141
}

src/app/App.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { AppHome } from "./AppHome.js"
2-
import { AppReplEventHandler } from "./AppReplEventHandler.js"
1+
import { AppHome } from "./AppHome.ts"
2+
import { AppReplEventHandler } from "./AppReplEventHandler.ts"
33

44
export class App {
55
home = new AppHome()

src/app/AppReplEventHandler.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { ParsingError } from "@cicada-lang/partech"
66
import fs from "fs"
77
import { relative } from "node:path"
88
import process from "process"
9-
import { Fetcher } from "../fetcher/Fetcher.js"
10-
import { Report } from "../lang/errors/Report.js"
11-
import { execute } from "../lang/execute/index.js"
12-
import { parseStmts } from "../lang/syntax/index.js"
13-
import { Loader } from "../loader/index.js"
14-
import { version } from "../version.js"
9+
import { Fetcher } from "../fetcher/Fetcher.ts"
10+
import { Report } from "../lang/errors/Report.ts"
11+
import { execute } from "../lang/execute/index.ts"
12+
import { parseStmts } from "../lang/syntax/index.ts"
13+
import { Loader } from "../loader/index.ts"
14+
import { version } from "../version.ts"
1515

1616
const fetcher = new Fetcher()
1717

src/app/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { App } from "./App.js"
1+
import { App } from "./App.ts"
22

33
export const app = new App()

src/command-line/commands/Default.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Command, CommandRunner } from "@xieyuheng/command-line"
22
import ty from "@xieyuheng/ty"
3-
import { version } from "../../version.js"
4-
import * as Commands from "../commands/index.js"
3+
import { version } from "../../version.ts"
4+
import * as Commands from "../commands/index.ts"
55

66
type Args = { path?: string }
77
type Opts = { help?: boolean; version?: boolean }

src/command-line/commands/Format.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import ty from "@xieyuheng/ty"
44
import fs from "node:fs"
55
import { relative } from "node:path"
66
import process from "node:process"
7-
import { Fetcher } from "../../fetcher/index.js"
8-
import { Report } from "../../lang/errors/Report.js"
9-
import { formatStmt } from "../../lang/stmt/index.js"
10-
import { parseStmts } from "../../lang/syntax/index.js"
11-
import { createURL } from "../../utils/createURL.js"
7+
import { Fetcher } from "../../fetcher/index.ts"
8+
import { Report } from "../../lang/errors/Report.ts"
9+
import { formatStmt } from "../../lang/stmt/index.ts"
10+
import { parseStmts } from "../../lang/syntax/index.ts"
11+
import { createURL } from "../../utils/createURL.ts"
1212

1313
type Args = { path: string }
1414
type Opts = {}

src/command-line/commands/Parse.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import ty from "@xieyuheng/ty"
44
import fs from "node:fs"
55
import { relative } from "node:path"
66
import process from "node:process"
7-
import { Fetcher } from "../../fetcher/index.js"
8-
import { Report } from "../../lang/errors/Report.js"
9-
import { parseStmts } from "../../lang/syntax/index.js"
10-
import { createURL } from "../../utils/createURL.js"
7+
import { Fetcher } from "../../fetcher/index.ts"
8+
import { Report } from "../../lang/errors/Report.ts"
9+
import { parseStmts } from "../../lang/syntax/index.ts"
10+
import { createURL } from "../../utils/createURL.ts"
1111

1212
type Args = { path: string }
1313
type Opts = {}

src/command-line/commands/Repl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ReadlineRepl } from "@cicada-lang/framework/lib/repls/readline-repl/index.js"
22
import { Command, CommandRunner } from "@xieyuheng/command-line"
33
import Path from "path"
4-
import { app } from "../../app/index.js"
4+
import { app } from "../../app/index.ts"
55

66
type Args = {}
77

src/command-line/commands/Run.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import ty from "@xieyuheng/ty"
44
import fs from "node:fs"
55
import { relative } from "node:path"
66
import process from "node:process"
7-
import { Fetcher } from "../../fetcher/index.js"
8-
import { Report } from "../../lang/errors/Report.js"
9-
import { Loader } from "../../loader/index.js"
10-
import { createURL } from "../../utils/createURL.js"
7+
import { Fetcher } from "../../fetcher/index.ts"
8+
import { Report } from "../../lang/errors/Report.ts"
9+
import { Loader } from "../../loader/index.ts"
10+
import { createURL } from "../../utils/createURL.ts"
1111

1212
type Args = { path: string }
1313
type Opts = {}

src/command-line/commands/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export * from "@xieyuheng/command-line/lib/commands/index.js"
2-
export * from "./Default.js"
3-
export * from "./Format.js"
4-
export * from "./Parse.js"
5-
export * from "./Repl.js"
6-
export * from "./Run.js"
2+
export * from "./Default.ts"
3+
export * from "./Format.ts"
4+
export * from "./Parse.ts"
5+
export * from "./Repl.ts"
6+
export * from "./Run.ts"

src/command-line/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommandRunner, CommandRunners } from "@xieyuheng/command-line"
2-
import * as Commands from "./commands/index.js"
2+
import * as Commands from "./commands/index.ts"
33

44
export function createCommandRunner(): CommandRunner {
55
return new CommandRunners.CommonCommandRunner({

src/fetcher/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "./Fetcher.js"
1+
export * from "./Fetcher.ts"

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export * from "./fetcher/index.js"
2-
export * from "./lang/index.js"
3-
export * from "./loader/index.js"
1+
export * from "./fetcher/index.ts"
2+
export * from "./lang/index.ts"
3+
export * from "./loader/index.ts"

src/lang/apply/apply.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { type Env } from "../env/index.js"
2-
import { type EvaluateOptions } from "../evaluate/index.js"
3-
import { formatValue, type Value } from "../value/index.js"
4-
import { applyFunction } from "./applyFunction.js"
5-
import { applyNode } from "./applyNode.js"
6-
import { applyTypeCtor } from "./applyTypeCtor.js"
1+
import { type Env } from "../env/index.ts"
2+
import { type EvaluateOptions } from "../evaluate/index.ts"
3+
import { formatValue, type Value } from "../value/index.ts"
4+
import { applyFunction } from "./applyFunction.ts"
5+
import { applyNode } from "./applyNode.ts"
6+
import { applyTypeCtor } from "./applyTypeCtor.ts"
77

88
export function apply(
99
env: Env,

src/lang/apply/applyFunction.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { manyTimes } from "../../utils/manyTimes.js"
2-
import { connectValues } from "../connect/connectValues.js"
3-
import { defineLocals } from "../env/defineLocals.js"
4-
import { type Env } from "../env/index.js"
5-
import { evaluateBlock } from "../evaluate/evaluateBlock.js"
6-
import { type EvaluateOptions } from "../evaluate/index.js"
7-
import { addEdge } from "../net/addEdge.js"
8-
import { formatValues } from "../value/formatValues.js"
9-
import { formatValue, type Function, type Value } from "../value/index.js"
1+
import { manyTimes } from "../../utils/manyTimes.ts"
2+
import { connectValues } from "../connect/connectValues.ts"
3+
import { defineLocals } from "../env/defineLocals.ts"
4+
import { type Env } from "../env/index.ts"
5+
import { evaluateBlock } from "../evaluate/evaluateBlock.ts"
6+
import { type EvaluateOptions } from "../evaluate/index.ts"
7+
import { addEdge } from "../net/addEdge.ts"
8+
import { formatValues } from "../value/formatValues.ts"
9+
import { formatValue, type Function, type Value } from "../value/index.ts"
1010

1111
export function applyFunction(
1212
env: Env,

src/lang/apply/applyNode.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { checkHalfEdges } from "../check/checkHalfEdges.js"
2-
import { connectHalfEdges } from "../connect/connectHalfEdges.js"
3-
import { type Env } from "../env/index.js"
4-
import { type EvaluateOptions } from "../evaluate/index.js"
5-
import { refreshNode } from "../freshen/refreshNode.js"
6-
import { halfEdgeFromPort } from "../half-edge/halfEdgeFromPort.js"
7-
import { findInputPorts } from "../net/findInputPorts.js"
8-
import { findOutputPorts } from "../net/findOutputPorts.js"
9-
import { formatNode, type Node } from "../node/index.js"
10-
import { formatPort } from "../port/formatPort.js"
11-
import { formatValue, type Value } from "../value/index.js"
1+
import { checkHalfEdges } from "../check/checkHalfEdges.ts"
2+
import { connectHalfEdges } from "../connect/connectHalfEdges.ts"
3+
import { type Env } from "../env/index.ts"
4+
import { type EvaluateOptions } from "../evaluate/index.ts"
5+
import { refreshNode } from "../freshen/refreshNode.ts"
6+
import { halfEdgeFromPort } from "../half-edge/halfEdgeFromPort.ts"
7+
import { findInputPorts } from "../net/findInputPorts.ts"
8+
import { findOutputPorts } from "../net/findOutputPorts.ts"
9+
import { formatNode, type Node } from "../node/index.ts"
10+
import { formatPort } from "../port/formatPort.ts"
11+
import { formatValue, type Value } from "../value/index.ts"
1212

1313
export function applyNode(
1414
env: Env,

src/lang/apply/applyTypeCtor.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { checkTypeTermArgs } from "../check/checkTypeTermArgs.js"
2-
import { type Env } from "../env/index.js"
3-
import { type EvaluateOptions } from "../evaluate/index.js"
4-
import { formatParameters } from "../parameter/index.js"
5-
import { formatValues } from "../value/formatValues.js"
6-
import { type TypeCtor, type Value } from "../value/index.js"
1+
import { checkTypeTermArgs } from "../check/checkTypeTermArgs.ts"
2+
import { type Env } from "../env/index.ts"
3+
import { type EvaluateOptions } from "../evaluate/index.ts"
4+
import { formatParameters } from "../parameter/index.ts"
5+
import { formatValues } from "../value/formatValues.ts"
6+
import { type TypeCtor, type Value } from "../value/index.ts"
77

88
export function applyTypeCtor(
99
env: Env,

src/lang/apply/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "./apply.js"
1+
export * from "./apply.ts"

src/lang/builtins/connect.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { checkHalfEdges } from "../check/checkHalfEdges.js"
2-
import { connectHalfEdges } from "../connect/connectHalfEdges.js"
3-
import { type PrimitiveApply } from "../definition/index.js"
4-
import { formatValue } from "../value/formatValue.js"
1+
import { checkHalfEdges } from "../check/checkHalfEdges.ts"
2+
import { connectHalfEdges } from "../connect/connectHalfEdges.ts"
3+
import { type PrimitiveApply } from "../definition/index.ts"
4+
import { formatValue } from "../value/formatValue.ts"
55

66
export const apply: PrimitiveApply = (env, args, options) => {
77
if (args.length !== 2) {

src/lang/builtins/defineBuiltinPrimitiveFunction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { type PrimitiveApply } from "../definition/index.js"
2-
import { type Mod } from "../mod/index.js"
1+
import { type PrimitiveApply } from "../definition/index.ts"
2+
import { type Mod } from "../mod/index.ts"
33

44
export function defineBuiltinPrimitiveFunction(
55
mod: Mod,

src/lang/builtins/defineBuiltinValue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { type Mod } from "../mod/index.js"
2-
import { type Value } from "../value/index.js"
1+
import { type Mod } from "../mod/index.ts"
2+
import { type Value } from "../value/index.ts"
33

44
export function defineBuiltinValue(mod: Mod, name: string, value: Value): void {
55
mod.builtins.set(name, {

src/lang/builtins/defineBuiltins.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { type Mod } from "../mod/index.js"
2-
import * as connect from "./connect.js"
3-
import { defineBuiltinPrimitiveFunction } from "./defineBuiltinPrimitiveFunction.js"
4-
import { defineBuiltinValue } from "./defineBuiltinValue.js"
5-
import * as inspect from "./inspect.js"
6-
import * as run from "./run.js"
1+
import { type Mod } from "../mod/index.ts"
2+
import * as connect from "./connect.ts"
3+
import { defineBuiltinPrimitiveFunction } from "./defineBuiltinPrimitiveFunction.ts"
4+
import { defineBuiltinValue } from "./defineBuiltinValue.ts"
5+
import * as inspect from "./inspect.ts"
6+
import * as run from "./run.ts"
77

88
export function defineBuiltins(mod: Mod): void {
99
defineBuiltinPrimitiveFunction(mod, "connect", connect)

src/lang/builtins/inspect.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { indent } from "../../utils/indent.js"
2-
import { type PrimitiveApply } from "../definition/index.js"
3-
import { findConnectedComponent } from "../net/findConnectedComponent.js"
4-
import { findHalfEdgeEntryOrFail } from "../net/findHalfEdgeEntryOrFail.js"
5-
import { findHalfEdgePortOrFail } from "../net/findHalfEdgePortOrFail.js"
6-
import { formatNet } from "../net/formatNet.js"
7-
import { formatPort } from "../port/formatPort.js"
8-
import { formatValue } from "../value/formatValue.js"
1+
import { indent } from "../../utils/indent.ts"
2+
import { type PrimitiveApply } from "../definition/index.ts"
3+
import { findConnectedComponent } from "../net/findConnectedComponent.ts"
4+
import { findHalfEdgeEntryOrFail } from "../net/findHalfEdgeEntryOrFail.ts"
5+
import { findHalfEdgePortOrFail } from "../net/findHalfEdgePortOrFail.ts"
6+
import { formatNet } from "../net/formatNet.ts"
7+
import { formatPort } from "../port/formatPort.ts"
8+
import { formatValue } from "../value/formatValue.ts"
99

1010
export const apply: PrimitiveApply = (env, args) => {
1111
if (args.length !== 1) {

src/lang/builtins/run.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { type PrimitiveApply } from "../definition/index.js"
2-
import { runHalfEdge } from "../run/runHalfEdge.js"
3-
import { formatValue } from "../value/formatValue.js"
1+
import { type PrimitiveApply } from "../definition/index.ts"
2+
import { runHalfEdge } from "../run/runHalfEdge.ts"
3+
import { formatValue } from "../value/formatValue.ts"
44

55
export const apply: PrimitiveApply = (env, args) => {
66
if (args.length !== 1) {

src/lang/cap/capInputPort.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { connectPorts } from "../connect/connectPorts.js"
2-
import { type Mod } from "../mod/index.js"
3-
import { addNode } from "../net/addNode.js"
4-
import { findNodeEntryOrFail } from "../net/findNodeEntryOrFail.js"
5-
import { findOutputPorts } from "../net/findOutputPorts.js"
6-
import { type Net } from "../net/index.js"
7-
import { type Port } from "../port/index.js"
1+
import { connectPorts } from "../connect/connectPorts.ts"
2+
import { type Mod } from "../mod/index.ts"
3+
import { addNode } from "../net/addNode.ts"
4+
import { findNodeEntryOrFail } from "../net/findNodeEntryOrFail.ts"
5+
import { findOutputPorts } from "../net/findOutputPorts.ts"
6+
import { type Net } from "../net/index.ts"
7+
import { type Port } from "../port/index.ts"
88

99
export function capInputPort(mod: Mod, net: Net, port: Port): Port {
1010
const parameter = {

src/lang/cap/capNodeAllPorts.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { type Mod } from "../mod/index.js"
2-
import { findInputPorts } from "../net/findInputPorts.js"
3-
import { findOutputPorts } from "../net/findOutputPorts.js"
4-
import { type Net } from "../net/index.js"
5-
import { type Node } from "../node/index.js"
6-
import { capInputPort } from "./capInputPort.js"
7-
import { capOutputPort } from "./capOutputPort.js"
1+
import { type Mod } from "../mod/index.ts"
2+
import { findInputPorts } from "../net/findInputPorts.ts"
3+
import { findOutputPorts } from "../net/findOutputPorts.ts"
4+
import { type Net } from "../net/index.ts"
5+
import { type Node } from "../node/index.ts"
6+
import { capInputPort } from "./capInputPort.ts"
7+
import { capOutputPort } from "./capOutputPort.ts"
88

99
export function capNodeAllPorts(mod: Mod, net: Net, node: Node): void {
1010
for (const port of findInputPorts(net, node)) {

src/lang/cap/capNodeNonPrinciplePorts.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { type Mod } from "../mod/index.js"
2-
import { findInputPorts } from "../net/findInputPorts.js"
3-
import { findOutputPorts } from "../net/findOutputPorts.js"
4-
import { type Net } from "../net/index.js"
5-
import { type Node } from "../node/index.js"
6-
import { capInputPort } from "./capInputPort.js"
7-
import { capOutputPort } from "./capOutputPort.js"
1+
import { type Mod } from "../mod/index.ts"
2+
import { findInputPorts } from "../net/findInputPorts.ts"
3+
import { findOutputPorts } from "../net/findOutputPorts.ts"
4+
import { type Net } from "../net/index.ts"
5+
import { type Node } from "../node/index.ts"
6+
import { capInputPort } from "./capInputPort.ts"
7+
import { capOutputPort } from "./capOutputPort.ts"
88

99
export function capNodeNonPrinciplePorts(mod: Mod, net: Net, node: Node): void {
1010
for (const port of findInputPorts(net, node)) {

src/lang/cap/capOutputPort.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { connectPorts } from "../connect/connectPorts.js"
2-
import { type Mod } from "../mod/index.js"
3-
import { addNode } from "../net/addNode.js"
4-
import { findInputPorts } from "../net/findInputPorts.js"
5-
import { findNodeEntryOrFail } from "../net/findNodeEntryOrFail.js"
6-
import { type Net } from "../net/index.js"
7-
import { type Port } from "../port/index.js"
1+
import { connectPorts } from "../connect/connectPorts.ts"
2+
import { type Mod } from "../mod/index.ts"
3+
import { addNode } from "../net/addNode.ts"
4+
import { findInputPorts } from "../net/findInputPorts.ts"
5+
import { findNodeEntryOrFail } from "../net/findNodeEntryOrFail.ts"
6+
import { type Net } from "../net/index.ts"
7+
import { type Port } from "../port/index.ts"
88

99
export function capOutputPort(mod: Mod, net: Net, port: Port): Port {
1010
const parameter = {

src/lang/cap/capType.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { type Mod } from "../mod/index.js"
2-
import { addNode } from "../net/addNode.js"
3-
import { findNodeEntryOrFail } from "../net/findNodeEntryOrFail.js"
4-
import { findOutputPorts } from "../net/findOutputPorts.js"
5-
import { type Net } from "../net/index.js"
6-
import { type Port } from "../port/index.js"
7-
import { type Value } from "../value/index.js"
1+
import { type Mod } from "../mod/index.ts"
2+
import { addNode } from "../net/addNode.ts"
3+
import { findNodeEntryOrFail } from "../net/findNodeEntryOrFail.ts"
4+
import { findOutputPorts } from "../net/findOutputPorts.ts"
5+
import { type Net } from "../net/index.ts"
6+
import { type Port } from "../port/index.ts"
7+
import { type Value } from "../value/index.ts"
88

99
export function capType(mod: Mod, net: Net, t: Value): Port {
1010
const parameter = {

0 commit comments

Comments
 (0)