Skip to content

Commit bd79e82

Browse files
committed
update typescript
1 parent bc97f18 commit bd79e82

File tree

174 files changed

+1010
-951
lines changed

Some content is hidden

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

174 files changed

+1010
-951
lines changed

package-lock.json

+323-265
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
"dependencies": {
2525
"@cicada-lang/framework": "^0.2.0",
2626
"@cicada-lang/partech": "^0.2.5",
27-
"@xieyuheng/command-line": "^0.1.2",
27+
"@xieyuheng/command-line": "^0.1.3",
2828
"@xieyuheng/ty": "^0.3.1",
2929
"picocolors": "^1.1.1",
30-
"vitest": "^2.1.4"
30+
"vitest": "^2.1.8"
3131
},
3232
"devDependencies": {
33-
"@types/node": "^22.9.0",
33+
"@types/node": "^22.10.2",
3434
"@xieyuheng/test-runner": "^0.2.10",
35-
"prettier": "^3.3.3",
35+
"prettier": "^3.4.2",
3636
"prettier-plugin-organize-imports": "^4.1.0",
37-
"typescript": "^5.6.3"
37+
"typescript": "^5.7.2"
3838
}
3939
}

src/app/App.ts

+2-2
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

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ 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 { parseStmts } from "../lang/syntax/index.js"
12-
import { Loader } from "../loader/index.js"
13-
import { version } from "../version.js"
9+
import { Fetcher } from "../fetcher/Fetcher.ts"
10+
import { Report } from "../lang/errors/Report.ts"
11+
import { parseStmts } from "../lang/syntax/index.ts"
12+
import { Loader } from "../loader/index.ts"
13+
import { version } from "../version.ts"
1414

1515
const fetcher = new Fetcher()
1616

src/app/index.ts

+1-1
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

+2-2
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 "./index.js"
3+
import { version } from "../../version.ts"
4+
import * as Commands from "./index.ts"
55

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

src/command-line/commands/Repl.ts

+1-1
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

+4-4
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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export * from "@xieyuheng/command-line/lib/commands/index.js"
2-
export * from "./Default.js"
3-
export * from "./Repl.js"
4-
export * from "./Run.js"
2+
export * from "./Default.ts"
3+
export * from "./Repl.ts"
4+
export * from "./Run.ts"

src/command-line/index.ts

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "./Fetcher.js"
1+
export * from "./Fetcher.ts"

src/index.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
export * from "./fetcher/index.js"
2-
export * from "./lang/cap/index.js"
3-
export * from "./lang/definition/index.js"
4-
export * from "./lang/edge/index.js"
5-
export * from "./lang/env/index.js"
6-
export * from "./lang/errors/index.js"
7-
export * from "./lang/interact/index.js"
8-
export * from "./lang/mod/index.js"
9-
export * from "./lang/net/index.js"
10-
export * from "./lang/node/index.js"
11-
export * from "./lang/port/index.js"
12-
export * from "./lang/present/index.js"
13-
export * from "./lang/rule/index.js"
14-
export * from "./lang/run/index.js"
15-
export * from "./lang/syntax/index.js"
16-
export * from "./lang/value/index.js"
17-
export * from "./lang/word/index.js"
18-
export * from "./loader/index.js"
1+
export * from "./fetcher/index.ts"
2+
export * from "./lang/cap/index.ts"
3+
export * from "./lang/definition/index.ts"
4+
export * from "./lang/edge/index.ts"
5+
export * from "./lang/env/index.ts"
6+
export * from "./lang/errors/index.ts"
7+
export * from "./lang/interact/index.ts"
8+
export * from "./lang/mod/index.ts"
9+
export * from "./lang/net/index.ts"
10+
export * from "./lang/node/index.ts"
11+
export * from "./lang/port/index.ts"
12+
export * from "./lang/present/index.ts"
13+
export * from "./lang/rule/index.ts"
14+
export * from "./lang/run/index.ts"
15+
export * from "./lang/syntax/index.ts"
16+
export * from "./lang/value/index.ts"
17+
export * from "./lang/word/index.ts"
18+
export * from "./loader/index.ts"

src/lang/builtins/Type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Env } from "../env/index.js"
1+
import { type Env } from "../env/index.ts"
22

33
export function compose(env: Env): void {
44
env.stack.push({

src/lang/builtins/apply.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { type ComposeOptions } from "../compose/compose.js"
2-
import { composeNode } from "../compose/composeNode.js"
3-
import { type Env } from "../env/index.js"
4-
import { formatValue } from "../value/index.js"
1+
import { type ComposeOptions } from "../compose/compose.ts"
2+
import { composeNode } from "../compose/composeNode.ts"
3+
import { type Env } from "../env/index.ts"
4+
import { formatValue } from "../value/index.ts"
55

66
export function compose(env: Env, options: ComposeOptions): void {
77
const value = env.stack.pop()

src/lang/builtins/connect.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { type ComposeOptions } from "../compose/compose.js"
2-
import { connect } from "../connect/connect.js"
3-
import { type Env } from "../env/index.js"
4-
import { unifyTypes } from "../unify/unifyTypes.js"
5-
import { formatValue } from "../value/formatValue.js"
1+
import { type ComposeOptions } from "../compose/compose.ts"
2+
import { connect } from "../connect/connect.ts"
3+
import { type Env } from "../env/index.ts"
4+
import { unifyTypes } from "../unify/unifyTypes.ts"
5+
import { formatValue } from "../value/formatValue.ts"
66

77
export function compose(env: Env, options: ComposeOptions): void {
88
const first = env.stack.pop()

src/lang/builtins/defineBuiltinOperator.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { type ComposeOptions } from "../compose/compose.js"
2-
import { type Env } from "../env/index.js"
3-
import { type Mod } from "../mod/index.js"
1+
import { type ComposeOptions } from "../compose/compose.ts"
2+
import { type Env } from "../env/index.ts"
3+
import { type Mod } from "../mod/index.ts"
44

55
export function defineBuiltinOperator(
66
mod: Mod,

src/lang/builtins/defineBuiltinOperators.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { type Mod } from "../mod/index.js"
2-
import * as Type from "./Type.js"
3-
import * as apply from "./apply.js"
4-
import * as connect from "./connect.js"
5-
import { defineBuiltinOperator } from "./defineBuiltinOperator.js"
6-
import * as inspect from "./inspect.js"
7-
import * as rot from "./rot.js"
8-
import * as run from "./run.js"
9-
import * as spread from "./spread.js"
10-
import * as swap from "./swap.js"
1+
import { type Mod } from "../mod/index.ts"
2+
import * as Type from "./Type.ts"
3+
import * as apply from "./apply.ts"
4+
import * as connect from "./connect.ts"
5+
import { defineBuiltinOperator } from "./defineBuiltinOperator.ts"
6+
import * as inspect from "./inspect.ts"
7+
import * as rot from "./rot.ts"
8+
import * as run from "./run.ts"
9+
import * as spread from "./spread.ts"
10+
import * as swap from "./swap.ts"
1111

1212
export function defineBuiltinOperators(mod: Mod): void {
1313
defineBuiltinOperator(mod, "swap", swap)

src/lang/builtins/inspect.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { indent } from "../../utils/indent.js"
2-
import { type Env } from "../env/index.js"
3-
import { findConnectedComponent } from "../net/findConnectedComponent.js"
4-
import { formatNet } from "../net/formatNet.js"
5-
import { formatValue } from "../value/formatValue.js"
1+
import { indent } from "../../utils/indent.ts"
2+
import { type Env } from "../env/index.ts"
3+
import { findConnectedComponent } from "../net/findConnectedComponent.ts"
4+
import { formatNet } from "../net/formatNet.ts"
5+
import { formatValue } from "../value/formatValue.ts"
66

77
export function compose(env: Env): void {
88
const value = env.stack[env.stack.length - 1]

src/lang/builtins/rot.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { type Env } from "../env/index.js"
2-
import { formatValue } from "../value/formatValue.js"
1+
import { type Env } from "../env/index.ts"
2+
import { formatValue } from "../value/formatValue.ts"
33

44
export function compose(env: Env): void {
55
const first = env.stack.pop()

src/lang/builtins/run.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { type Env } from "../env/index.js"
2-
import { runPort } from "../run/runPort.js"
3-
import { formatValue } from "../value/formatValue.js"
1+
import { type Env } from "../env/index.ts"
2+
import { runPort } from "../run/runPort.ts"
3+
import { formatValue } from "../value/formatValue.ts"
44

55
export function compose(env: Env): void {
66
const port = env.stack.pop()

src/lang/builtins/spread.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { type ComposeOptions } from "../compose/compose.js"
2-
import { type Env } from "../env/index.js"
3-
import { findInputPorts } from "../net/findInputPorts.js"
4-
import { findOutputPorts } from "../net/findOutputPorts.js"
5-
import { formatValue } from "../value/index.js"
1+
import { type ComposeOptions } from "../compose/compose.ts"
2+
import { type Env } from "../env/index.ts"
3+
import { findInputPorts } from "../net/findInputPorts.ts"
4+
import { findOutputPorts } from "../net/findOutputPorts.ts"
5+
import { formatValue } from "../value/index.ts"
66

77
export function compose(env: Env, options: ComposeOptions): void {
88
const value = env.stack.pop()

src/lang/builtins/swap.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { type Env } from "../env/index.js"
2-
import { formatValue } from "../value/formatValue.js"
1+
import { type Env } from "../env/index.ts"
2+
import { formatValue } from "../value/formatValue.ts"
33

44
export function compose(env: Env): void {
55
const first = env.stack.pop()

src/lang/cap/capInputPort.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { connect } from "../connect/connect.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 PortExp } from "../port/PortExp.js"
8-
import { type Port } from "../port/index.js"
1+
import { connect } from "../connect/connect.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 PortExp } from "../port/PortExp.ts"
8+
import { type Port } from "../port/index.ts"
99

1010
export function capInputPort(mod: Mod, net: Net, port: Port): Port {
1111
const portExp: PortExp = {

src/lang/cap/capNodeAllPorts.ts

+7-7
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

+7-7
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

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { connect } from "../connect/connect.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 PortExp } from "../port/PortExp.js"
8-
import { type Port } from "../port/index.js"
1+
import { connect } from "../connect/connect.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 PortExp } from "../port/PortExp.ts"
8+
import { type Port } from "../port/index.ts"
99

1010
export function capOutputPort(mod: Mod, net: Net, port: Port): Port {
1111
const portExp: PortExp = {

src/lang/cap/capType.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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 PortExp } from "../port/PortExp.js"
7-
import { type Port } from "../port/index.js"
8-
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 PortExp } from "../port/PortExp.ts"
7+
import { type Port } from "../port/index.ts"
8+
import { type Value } from "../value/index.ts"
99

1010
export function capType(mod: Mod, net: Net, t: Value): Port {
1111
const portExp: PortExp = {

src/lang/cap/index.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export * from "./capInputPort.js"
2-
export * from "./capNodeAllPorts.js"
3-
export * from "./capNodeNonPrinciplePorts.js"
4-
export * from "./capOutputPort.js"
5-
export * from "./capType.js"
1+
export * from "./capInputPort.ts"
2+
export * from "./capNodeAllPorts.ts"
3+
export * from "./capNodeNonPrinciplePorts.ts"
4+
export * from "./capOutputPort.ts"
5+
export * from "./capType.ts"

src/lang/check/checkAllLocalsAreUsed.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Value } from "../value/index.js"
1+
import { type Value } from "../value/index.ts"
22

33
export function checkAllLocalsAreUsed(locals: Map<string, Value>): void {
44
if (locals.size > 0) {

src/lang/check/checkNode.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { createChecking } from "../checking/createChecking.js"
2-
import { collectWords } from "../compose/collectWords.js"
3-
import { createEnv } from "../env/createEnv.js"
4-
import { type Mod } from "../mod/index.js"
5-
import { type PortExp } from "../port/PortExp.js"
6-
import { formatValue } from "../value/formatValue.js"
7-
import { type Value } from "../value/index.js"
8-
import { type Word } from "../word/index.js"
9-
import { checkAllLocalsAreUsed } from "./checkAllLocalsAreUsed.js"
1+
import { createChecking } from "../checking/createChecking.ts"
2+
import { collectWords } from "../compose/collectWords.ts"
3+
import { createEnv } from "../env/createEnv.ts"
4+
import { type Mod } from "../mod/index.ts"
5+
import { type PortExp } from "../port/PortExp.ts"
6+
import { formatValue } from "../value/formatValue.ts"
7+
import { type Value } from "../value/index.ts"
8+
import { type Word } from "../word/index.ts"
9+
import { checkAllLocalsAreUsed } from "./checkAllLocalsAreUsed.ts"
1010

1111
export function checkNode(
1212
mod: Mod,

0 commit comments

Comments
 (0)