From 8549d8719d4e6b1f7e3d392caadb19731fa33ed3 Mon Sep 17 00:00:00 2001 From: Xie Yuheng Date: Tue, 24 Sep 2024 20:55:57 +0800 Subject: [PATCH] use "type": "module" in package.json - remove "node-watch" --- TODO.md | 4 -- bin/cic.js | 10 +---- package-lock.json | 1 - package.json | 2 +- src/app/App.ts | 8 ++-- src/app/AppConfig.ts | 9 ----- src/app/AppHome.ts | 2 +- src/app/AppReplEventHandler.ts | 15 ++++--- src/app/index.ts | 2 +- src/command-line/Runner.ts | 35 +--------------- src/command-line/commands/Default.ts | 9 +---- src/command-line/commands/Repl.ts | 2 +- src/command-line/commands/Run.ts | 13 ++---- src/command-line/commands/index.ts | 8 ++-- src/command-line/index.ts | 7 ++-- src/index.ts | 6 +-- src/lang/actions/doAp.ts | 12 +++--- src/lang/actions/doApImplicit.ts | 12 +++--- src/lang/actions/doCar.ts | 8 ++-- src/lang/actions/doCdr.ts | 12 +++--- src/lang/actions/doDot.ts | 8 ++-- src/lang/actions/doReplace.ts | 14 +++---- src/lang/actions/index.ts | 12 +++--- src/lang/check/check.ts | 40 +++++++++---------- src/lang/check/checkByInfer.ts | 16 ++++---- src/lang/check/checkClazz.ts | 14 +++---- src/lang/check/checkProperties.ts | 20 +++++----- src/lang/check/checkType.ts | 12 +++--- src/lang/check/index.ts | 10 ++--- src/lang/closure/Closure.ts | 6 +-- src/lang/closure/closureApply.ts | 8 ++-- src/lang/closure/index.ts | 4 +- src/lang/core/assertClazz.ts | 6 +-- src/lang/core/clazzAppend.ts | 2 +- src/lang/core/formatCore.ts | 8 ++-- src/lang/core/freeNames.ts | 2 +- src/lang/core/freeOccurred.ts | 4 +- src/lang/core/index.ts | 22 +++++----- src/lang/core/unfoldFormatAp.ts | 4 +- src/lang/core/unfoldFormatClazz.ts | 6 +-- src/lang/core/unfoldFormatFn.ts | 4 +- src/lang/core/unfoldFormatPi.ts | 6 +-- src/lang/core/unfoldFormatSigma.ts | 4 +- src/lang/ctx/Ctx.ts | 2 +- src/lang/ctx/ctxDeleteFirst.ts | 2 +- src/lang/ctx/ctxLookupType.ts | 4 +- src/lang/ctx/ctxLookupValue.ts | 4 +- src/lang/ctx/ctxNames.ts | 2 +- src/lang/ctx/ctxToEnv.ts | 10 ++--- src/lang/ctx/index.ts | 12 +++--- src/lang/env/Env.ts | 2 +- src/lang/env/envDeleteFirst.ts | 2 +- src/lang/env/envLookupValue.ts | 4 +- src/lang/env/envNames.ts | 2 +- src/lang/env/index.ts | 8 ++-- src/lang/equivalent/equivalent.ts | 16 ++++---- src/lang/equivalent/equivalentByType.ts | 24 +++++------ src/lang/equivalent/equivalentByValue.ts | 14 +++---- src/lang/equivalent/equivalentClazz.ts | 22 +++++----- src/lang/equivalent/equivalentNeutral.ts | 16 ++++---- src/lang/equivalent/equivalentProperties.ts | 12 +++--- src/lang/equivalent/equivalentType.ts | 28 +++++++------ src/lang/equivalent/index.ts | 14 +++---- src/lang/errors/AssertionError.ts | 2 +- src/lang/errors/ElaborationError.ts | 4 +- src/lang/errors/EquivalenceError.ts | 2 +- src/lang/errors/ErrorReport.ts | 2 +- src/lang/errors/EvaluationError.ts | 2 +- src/lang/errors/InclusionError.ts | 2 +- src/lang/errors/ReadbackError.ts | 2 +- src/lang/errors/UnificationError.ts | 2 +- src/lang/errors/index.ts | 20 +++++----- src/lang/evaluate/evaluate.ts | 16 ++++---- src/lang/evaluate/index.ts | 2 +- src/lang/exp/Exp.ts | 4 +- src/lang/exp/foldAp.ts | 6 +-- src/lang/exp/foldClazz.ts | 4 +- src/lang/exp/foldFn.ts | 6 +-- src/lang/exp/foldFnWithRetType.ts | 6 +-- src/lang/exp/foldPi.ts | 6 +-- src/lang/exp/foldSequence.ts | 4 +- src/lang/exp/foldSigma.ts | 6 +-- src/lang/exp/freeNames.ts | 4 +- src/lang/exp/index.ts | 24 +++++------ src/lang/exp/prepareProperties.ts | 14 +++---- src/lang/exp/substitute.ts | 6 +-- src/lang/exp/unfoldAp.ts | 4 +- src/lang/globals/GlobalStore.ts | 14 +++---- src/lang/globals/index.ts | 2 +- src/lang/globals/useGlobals.ts | 8 ++-- src/lang/include/include.ts | 24 +++++------ src/lang/include/includeClazz.ts | 18 ++++----- src/lang/include/index.ts | 4 +- src/lang/infer/index.ts | 12 +++--- src/lang/infer/infer.ts | 32 +++++++-------- src/lang/infer/inferExtraProperties.ts | 16 ++++---- src/lang/infer/inferFulfillingClazz.ts | 22 +++++----- src/lang/infer/inferNewArgs.ts | 20 +++++----- src/lang/infer/inferOrUndefined.ts | 8 ++-- src/lang/infer/inferProperties.ts | 22 +++++----- src/lang/insert/Insertion.ts | 6 +-- src/lang/insert/index.ts | 12 +++--- src/lang/insert/insertDuringCheck.ts | 14 +++---- src/lang/insert/insertDuringInfer.ts | 10 ++--- src/lang/insert/insertionApply.ts | 16 ++++---- src/lang/insert/solveByArgs.ts | 34 ++++++++-------- src/lang/insert/solveByRetType.ts | 26 ++++++------ src/lang/macro/Macro.ts | 2 +- src/lang/macro/index.ts | 2 +- src/lang/macros/Equivalent.ts | 10 ++--- src/lang/macros/index.ts | 2 +- src/lang/mod/Mod.ts | 21 ++++++---- src/lang/mod/index.ts | 2 +- src/lang/neutral/Neutral.ts | 2 +- src/lang/neutral/index.ts | 2 +- src/lang/readback/index.ts | 14 +++---- src/lang/readback/readback.ts | 12 +++--- src/lang/readback/readbackByType.ts | 12 +++--- src/lang/readback/readbackByValue.ts | 28 ++++++------- src/lang/readback/readbackClazz.ts | 18 ++++----- src/lang/readback/readbackNeutral.ts | 12 +++--- src/lang/readback/readbackProperties.ts | 14 +++---- src/lang/readback/readbackType.ts | 26 ++++++------ src/lang/solution/Solution.ts | 2 +- src/lang/solution/formatSolution.ts | 12 +++--- src/lang/solution/index.ts | 16 ++++---- src/lang/solution/solutionAdvanceValue.ts | 12 +++--- src/lang/solution/solutionBind.ts | 4 +- src/lang/solution/solutionCleanup.ts | 2 +- src/lang/solution/solutionLookupValue.ts | 4 +- src/lang/solution/solutionNames.ts | 2 +- src/lang/solution/solutionWalk.ts | 6 +-- src/lang/stmt/Stmt.ts | 4 +- src/lang/stmt/index.ts | 2 +- src/lang/stmts/binding/Let.ts | 12 +++--- src/lang/stmts/binding/LetThe.ts | 12 +++--- src/lang/stmts/binding/index.ts | 4 +- src/lang/stmts/clazz/Clazz.ts | 12 +++--- src/lang/stmts/clazz/ClazzExtends.ts | 20 +++++----- src/lang/stmts/clazz/index.ts | 4 +- src/lang/stmts/import/Import.ts | 16 ++++---- src/lang/stmts/import/defineBinding.ts | 6 +-- src/lang/stmts/import/index.ts | 8 ++-- src/lang/stmts/import/undoBinding.ts | 4 +- src/lang/stmts/index.ts | 10 ++--- src/lang/stmts/solve/Equation.ts | 4 +- src/lang/stmts/solve/Solve.ts | 21 +++++----- src/lang/stmts/solve/SolveBinding.ts | 2 +- src/lang/stmts/solve/index.ts | 8 ++-- src/lang/stmts/solve/unifyEquation.ts | 16 ++++---- src/lang/stmts/testing/Check.ts | 12 +++--- src/lang/stmts/testing/Compute.ts | 14 +++---- src/lang/stmts/testing/Include.ts | 14 +++---- src/lang/stmts/testing/index.ts | 6 +-- src/lang/syntax/grammars/index.ts | 30 +++++++------- src/lang/syntax/index.ts | 4 +- src/lang/syntax/matchers/arg_matcher.ts | 4 +- .../syntax/matchers/clazz_binding_matcher.ts | 4 +- src/lang/syntax/matchers/equation_matcher.ts | 4 +- .../matchers/equivalent_entry_matcher.ts | 4 +- src/lang/syntax/matchers/exp_matcher.ts | 8 ++-- .../syntax/matchers/fn_binding_matcher.ts | 4 +- .../syntax/matchers/import_binding_matcher.ts | 2 +- src/lang/syntax/matchers/index.ts | 30 +++++++------- .../syntax/matchers/pi_binding_matcher.ts | 4 +- src/lang/syntax/matchers/property_matcher.ts | 4 +- src/lang/syntax/matchers/sequence_matcher.ts | 4 +- .../syntax/matchers/sigma_binding_matcher.ts | 4 +- .../syntax/matchers/solve_binding_matcher.ts | 4 +- src/lang/syntax/matchers/stmt_matcher.ts | 8 ++-- src/lang/syntax/matchers/utils.ts | 2 +- .../syntax/tests/exps/ap-implicit.test.ts | 6 +-- src/lang/syntax/tests/exps/ap.test.ts | 6 +-- src/lang/syntax/tests/exps/clazz-json.test.ts | 6 +-- src/lang/syntax/tests/exps/clazz.test.ts | 6 +-- src/lang/syntax/tests/exps/dot-json.test.ts | 6 +-- src/lang/syntax/tests/exps/dot.test.ts | 6 +-- .../syntax/tests/exps/fn-annotated.test.ts | 6 +-- .../syntax/tests/exps/fn-implicit.test.ts | 6 +-- .../tests/exps/fn-with-return-type.test.ts | 6 +-- src/lang/syntax/tests/exps/fn.test.ts | 6 +-- .../syntax/tests/exps/objekt-json.test.ts | 6 +-- .../syntax/tests/exps/objekt-spread.test.ts | 6 +-- src/lang/syntax/tests/exps/objekt.test.ts | 6 +-- .../syntax/tests/exps/pi-implicit.test.ts | 6 +-- src/lang/syntax/tests/exps/pi.test.ts | 6 +-- src/lang/syntax/tests/exps/quote.test.ts | 6 +-- src/lang/syntax/tests/exps/sequence.test.ts | 6 +-- src/lang/syntax/tests/exps/sigma.test.ts | 6 +-- src/lang/syntax/tests/exps/var.test.ts | 6 +-- src/lang/syntax/tests/stmts/check.test.ts | 8 ++-- src/lang/syntax/tests/stmts/clazz.test.ts | 8 ++-- .../stmts/function-with-implicit.test.ts | 8 ++-- .../stmts/function-with-return-type.test.ts | 8 ++-- src/lang/syntax/tests/stmts/function.test.ts | 8 ++-- src/lang/syntax/tests/stmts/import.test.ts | 6 +-- src/lang/syntax/tests/stmts/inclusion.test.ts | 8 ++-- src/lang/syntax/tests/stmts/let.test.ts | 8 ++-- src/lang/syntax/tests/stmts/solve.test.ts | 8 ++-- .../check/check-ap-implicit-insertion.test.ts | 2 +- src/lang/tests/check/check-ap.test.ts | 2 +- src/lang/tests/check/check-car.test.ts | 2 +- src/lang/tests/check/check-cdr.test.ts | 2 +- .../check/check-clazz-fulfilling.test.ts | 2 +- src/lang/tests/check/check-clazz.test.ts | 2 +- src/lang/tests/check/check-cons.test.ts | 2 +- src/lang/tests/check/check-dot.test.ts | 2 +- .../tests/check/check-fn-annotated.test.ts | 2 +- .../check/check-fn-implicit-insertion.test.ts | 2 +- .../tests/check/check-fn-implicit.test.ts | 2 +- src/lang/tests/check/check-fn.test.ts | 2 +- src/lang/tests/check/check-new-ap.test.ts | 2 +- src/lang/tests/check/check-new.test.ts | 2 +- .../tests/check/check-objekt-spread.test.ts | 2 +- src/lang/tests/check/check-objekt.test.ts | 2 +- src/lang/tests/check/check-pair.test.ts | 2 +- .../tests/check/check-pi-implicit.test.ts | 2 +- src/lang/tests/check/check-pi.test.ts | 2 +- src/lang/tests/check/check-quote.test.ts | 2 +- src/lang/tests/check/check-refl.test.ts | 2 +- src/lang/tests/check/check-same.test.ts | 2 +- .../check/check-sequence-no-enrich.test.ts | 2 +- src/lang/tests/check/check-sequence.test.ts | 2 +- src/lang/tests/check/check-sigma.test.ts | 2 +- src/lang/tests/check/check-sole.test.ts | 2 +- src/lang/tests/check/check-string.test.ts | 2 +- src/lang/tests/check/check-the.test.ts | 2 +- src/lang/tests/check/check-trivial.test.ts | 2 +- src/lang/tests/check/check-type.test.ts | 2 +- src/lang/tests/check/check-var.test.ts | 2 +- ...ompute-ap-implicit-insertion-scope.test.ts | 2 +- .../compute-ap-implicit-insertion.test.ts | 2 +- .../tests/compute/compute-ap-implicit.test.ts | 2 +- src/lang/tests/compute/compute-ap.test.ts | 2 +- src/lang/tests/compute/compute-car.test.ts | 2 +- src/lang/tests/compute/compute-cdr.test.ts | 2 +- .../tests/compute/compute-clazz-json.test.ts | 2 +- src/lang/tests/compute/compute-clazz.test.ts | 2 +- src/lang/tests/compute/compute-cons.test.ts | 2 +- .../tests/compute/compute-dot-json.test.ts | 2 +- src/lang/tests/compute/compute-dot.test.ts | 2 +- src/lang/tests/compute/compute-equal.test.ts | 2 +- .../compute/compute-fn-annotated.test.ts | 2 +- .../tests/compute/compute-fn-implicit.test.ts | 2 +- .../compute-fn-with-return-type.test.ts | 2 +- src/lang/tests/compute/compute-fn.test.ts | 2 +- src/lang/tests/compute/compute-new.test.ts | 2 +- .../tests/compute/compute-objekt-json.test.ts | 2 +- src/lang/tests/compute/compute-objekt.test.ts | 2 +- src/lang/tests/compute/compute-pair.test.ts | 2 +- .../tests/compute/compute-pi-implicit.test.ts | 2 +- src/lang/tests/compute/compute-pi.test.ts | 2 +- src/lang/tests/compute/compute-quote.test.ts | 2 +- src/lang/tests/compute/compute-refl.test.ts | 2 +- .../tests/compute/compute-replace.test.ts | 2 +- src/lang/tests/compute/compute-same.test.ts | 2 +- .../tests/compute/compute-sequence.test.ts | 2 +- src/lang/tests/compute/compute-sigma.test.ts | 2 +- src/lang/tests/compute/compute-sole.test.ts | 2 +- src/lang/tests/compute/compute-string.test.ts | 2 +- src/lang/tests/compute/compute-the.test.ts | 2 +- .../tests/compute/compute-trivial.test.ts | 2 +- src/lang/tests/compute/compute-type.test.ts | 2 +- .../equivalent-clazz-out-of-order.test.ts | 2 +- .../tests/equivalent/equivalent-clazz.test.ts | 2 +- .../tests/equivalent/equivalent-cons.test.ts | 2 +- .../tests/equivalent/equivalent-fn.test.ts | 2 +- .../equivalent-objekt-out-of-order.test.ts | 2 +- .../equivalent/equivalent-objekt.test.ts | 2 +- .../tests/equivalent/equivalent-pi.test.ts | 2 +- .../tests/equivalent/equivalent-quote.test.ts | 2 +- .../tests/equivalent/equivalent-sigma.test.ts | 2 +- .../tests/equivalent/equivalent-sole.test.ts | 2 +- .../equivalent/equivalent-string.test.ts | 2 +- .../equivalent/equivalent-trivial.test.ts | 2 +- .../tests/equivalent/equivalent-type.test.ts | 2 +- .../include-clazz-out-of-order.test.ts | 2 +- src/lang/tests/include/include-clazz.test.ts | 2 +- src/lang/tests/include/include-equal.test.ts | 2 +- src/lang/tests/include/include-pi.test.ts | 2 +- src/lang/tests/include/include-sigma.test.ts | 2 +- .../tests/solve/solve-ap-implicit.test.ts | 2 +- src/lang/tests/solve/solve-ap.test.ts | 2 +- .../tests/solve/solve-box-implicit.test.ts | 2 +- src/lang/tests/solve/solve-box.test.ts | 2 +- src/lang/tests/solve/solve-car.test.ts | 2 +- src/lang/tests/solve/solve-cdr.test.ts | 2 +- .../solve/solve-clazz-out-of-order.test.ts | 2 +- src/lang/tests/solve/solve-clazz.test.ts | 4 +- src/lang/tests/solve/solve-cons.test.ts | 2 +- src/lang/tests/solve/solve-dot.test.ts | 2 +- .../tests/solve/solve-fn-implicit.test.ts | 4 +- src/lang/tests/solve/solve-fn.test.ts | 2 +- src/lang/tests/solve/solve-objekt.test.ts | 2 +- .../tests/solve/solve-pi-implicit.test.ts | 4 +- src/lang/tests/solve/solve-pi.test.ts | 4 +- src/lang/tests/solve/solve-quote.test.ts | 2 +- src/lang/tests/solve/solve-sigma.test.ts | 4 +- src/lang/tests/solve/solve-sole.test.ts | 2 +- src/lang/tests/solve/solve-string.test.ts | 2 +- src/lang/tests/solve/solve-trivial.test.ts | 2 +- src/lang/tests/solve/solve-type.test.ts | 2 +- src/lang/tests/utils.ts | 8 ++-- src/lang/unify/index.ts | 18 ++++----- src/lang/unify/occur.ts | 22 +++++----- src/lang/unify/unify.ts | 16 ++++---- src/lang/unify/unifyByType.ts | 26 ++++++------ src/lang/unify/unifyByValue.ts | 14 +++---- src/lang/unify/unifyClazz.ts | 18 ++++----- src/lang/unify/unifyNeutral.ts | 18 ++++----- src/lang/unify/unifyPatternVar.ts | 18 ++++----- src/lang/unify/unifyProperties.ts | 12 +++--- src/lang/unify/unifyType.ts | 31 ++++++++------ src/lang/utils/freshen.test.ts | 2 +- src/lang/utils/isIdentifier.test.ts | 2 +- src/lang/value/TypedValue.ts | 2 +- src/lang/value/Value.ts | 6 +-- src/lang/value/assertClazzInCtx.ts | 8 ++-- src/lang/value/assertTypeInCtx.ts | 8 ++-- src/lang/value/assertTypesInCtx.ts | 8 ++-- src/lang/value/clazzClosureApply.ts | 10 ++--- src/lang/value/clazzExtendCtx.ts | 14 +++---- src/lang/value/clazzFromTypedValues.ts | 4 +- src/lang/value/clazzFulfill.ts | 6 +-- src/lang/value/clazzFulfilledPrepend.ts | 4 +- src/lang/value/clazzLookupProperty.ts | 6 +-- src/lang/value/clazzLookupPropertyType.ts | 6 +-- src/lang/value/clazzPropertyNames.ts | 4 +- src/lang/value/formatNeutral.ts | 10 ++--- src/lang/value/formatType.ts | 10 ++--- src/lang/value/formatTypedValue.ts | 10 ++--- src/lang/value/formatValue.ts | 10 ++--- src/lang/value/index.ts | 36 ++++++++--------- src/lang/value/isClazz.ts | 4 +- src/loader/Loader.ts | 8 ++-- src/loader/index.ts | 2 +- src/script/Script.ts | 2 +- src/script/index.ts | 2 +- src/scripts/DefaultScript.ts | 8 ++-- src/scripts/MarkdownScript.ts | 8 ++-- src/scripts/createScript.ts | 6 +-- src/scripts/index.ts | 6 +-- src/utils/assertEqual.ts | 2 +- src/utils/formatDate.ts | 2 +- tsconfig.json | 13 +++--- 345 files changed, 1217 insertions(+), 1266 deletions(-) delete mode 100644 src/app/AppConfig.ts diff --git a/TODO.md b/TODO.md index 74d4dcea..4fb96167 100644 --- a/TODO.md +++ b/TODO.md @@ -1,9 +1,5 @@ -use "type": "module" in package.json - move std/ and tests/ to docs/ -`cic run --watch` should not watch even first run meets error - `Stmts.Test` -- `test { ... }` and `test { ... }` - move snapshot tests to `test:cic` diff --git a/bin/cic.js b/bin/cic.js index 29723189..174fbe94 100755 --- a/bin/cic.js +++ b/bin/cic.js @@ -1,14 +1,6 @@ #!/usr/bin/env -S node --no-warnings -const process = require("process") - -process.on("unhandledRejection", (error) => { - console.error(error) - process.exit(1) -}) +import { createCommandRunner } from "../lib/command-line/index.js" Error.stackTraceLimit = Infinity - -const { createCommandRunner } = require("../lib/command-line") - createCommandRunner().run() diff --git a/package-lock.json b/package-lock.json index 7418b907..d756a790 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "commonmark": "^0.31.2", "fast-deep-equal": "^3.1.3", "lodash": "^4.17.21", - "node-watch": "^0.7.4", "picocolors": "^1.1.0", "readdirp": "^4.0.1" }, diff --git a/package.json b/package.json index 5ef70b42..0cec0f77 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "@cicada-lang/cicada", "version": "0.8.24", "repository": "github:cicada-lang/cicada", + "type": "module", "main": "./lib/index.js", "files": [ "lib" @@ -29,7 +30,6 @@ "commonmark": "^0.31.2", "fast-deep-equal": "^3.1.3", "lodash": "^4.17.21", - "node-watch": "^0.7.4", "picocolors": "^1.1.0", "readdirp": "^4.0.1" }, diff --git a/src/app/App.ts b/src/app/App.ts index e3fa5c53..1d44edca 100644 --- a/src/app/App.ts +++ b/src/app/App.ts @@ -1,11 +1,9 @@ -import * as Loggers from "@cicada-lang/framework/lib/loggers" -import { AppConfig } from "./AppConfig" -import { AppHome } from "./AppHome" -import { AppReplEventHandler } from "./AppReplEventHandler" +import * as Loggers from "@cicada-lang/framework/lib/loggers/index.js" +import { AppHome } from "./AppHome.js" +import { AppReplEventHandler } from "./AppReplEventHandler.js" export class App { logger = new Loggers.PrettyLogger() - config = new AppConfig() home = new AppHome() replEventHandler = new AppReplEventHandler() } diff --git a/src/app/AppConfig.ts b/src/app/AppConfig.ts deleted file mode 100644 index 8a668dbb..00000000 --- a/src/app/AppConfig.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class AppConfig { - pkg: any - - constructor() { - // NOTE We should not use import for module not in `src/`, - // otherwise `lib/` will have a extra level. - this.pkg = require("../../package.json") - } -} diff --git a/src/app/AppHome.ts b/src/app/AppHome.ts index 696006f2..ed7af06f 100644 --- a/src/app/AppHome.ts +++ b/src/app/AppHome.ts @@ -1,4 +1,4 @@ -import { LocalFileStore } from "@cicada-lang/framework/lib/file-stores/LocalFileStore" +import { LocalFileStore } from "@cicada-lang/framework/lib/file-stores/LocalFileStore.js" import os from "os" import Path from "path" import process from "process" diff --git a/src/app/AppReplEventHandler.ts b/src/app/AppReplEventHandler.ts index db93a90d..54bb8788 100644 --- a/src/app/AppReplEventHandler.ts +++ b/src/app/AppReplEventHandler.ts @@ -1,10 +1,13 @@ -import { ReplEvent, ReplEventHandler } from "@cicada-lang/framework/lib/repl" +import { + type ReplEvent, + ReplEventHandler, +} from "@cicada-lang/framework/lib/repl/index.js" import fs from "fs" import process from "process" -import * as Errors from "../lang/errors" -import { parseStmts } from "../lang/syntax" -import { Loader } from "../loader" -import { colors } from "../utils/colors" +import * as Errors from "../lang/errors/index.js" +import { parseStmts } from "../lang/syntax/index.js" +import { Loader } from "../loader/index.js" +import { colors } from "../utils/colors.js" export class AppReplEventHandler extends ReplEventHandler { pathname = process.cwd() + "/repl" @@ -23,7 +26,7 @@ export class AppReplEventHandler extends ReplEventHandler { } greeting(): void { - console.log(`Welcome to cicada ${app.config.pkg.version}`) + console.log(`Welcome to cicada`) } async handle(event: ReplEvent): Promise { diff --git a/src/app/index.ts b/src/app/index.ts index 912d1a31..df1aa1ca 100644 --- a/src/app/index.ts +++ b/src/app/index.ts @@ -1,4 +1,4 @@ -import { App } from "./App" +import { App } from "./App.js" declare global { var app: App diff --git a/src/command-line/Runner.ts b/src/command-line/Runner.ts index 20081c71..7ef0ca7a 100644 --- a/src/command-line/Runner.ts +++ b/src/command-line/Runner.ts @@ -1,8 +1,7 @@ import process from "node:process" import fs from "fs" -import watcher from "node-watch" -import * as Errors from "../lang/errors" -import { Loader } from "../loader" +import * as Errors from "../lang/errors/index.js" +import { Loader } from "../loader/index.js" export class Runner { loader = new Loader() @@ -42,34 +41,4 @@ export class Runner { return { error } } } - - async watch(main: URL): Promise { - const tracked = [main, ...this.loader.loaded] - app.logger.info({ msg: `Watching for changes.`, tracked }) - - for (const url of tracked) { - if (main.protocol !== "file:") continue - - watcher(url.pathname, async (event, _filename) => { - if (event === "remove") { - this.loader.delete(url) - if (url.href === main.href) { - app.logger.info({ tag: event, msg: url.pathname }) - app.logger.info({ msg: "The main file is removed." }) - } else { - const { error } = await this.run(main) - if (error) app.logger.error({ tag: event, msg: url.pathname }) - else app.logger.info({ tag: event, msg: url.pathname }) - } - } - - if (event === "update") { - this.loader.delete(url) - const { error } = await this.run(main) - if (error) app.logger.error({ tag: event, msg: url.pathname }) - else app.logger.info({ tag: event, msg: url.pathname }) - } - }) - } - } } diff --git a/src/command-line/commands/Default.ts b/src/command-line/commands/Default.ts index 6de9283c..996712d2 100644 --- a/src/command-line/commands/Default.ts +++ b/src/command-line/commands/Default.ts @@ -1,6 +1,6 @@ import { Command, CommandRunner } from "@xieyuheng/command-line" import { ty } from "@xieyuheng/ty" -import * as Commands from "." +import * as Commands from "./index.js" type Args = { file?: string } type Opts = { help?: boolean; version?: boolean } @@ -11,7 +11,7 @@ export class Default extends Command { description = "Open REPL or run an file" args = { file: ty.optional(ty.string()) } - opts = { help: ty.optional(ty.boolean()), version: ty.optional(ty.boolean()) } + opts = { help: ty.optional(ty.boolean()) } alias = { help: ["h"], version: ["v"] } async execute(argv: Args & Opts, runner: CommandRunner): Promise { @@ -21,11 +21,6 @@ export class Default extends Command { return } - if (argv["version"]) { - console.log(app.config.pkg.version) - return - } - const file = argv["file"] if (file === undefined) { diff --git a/src/command-line/commands/Repl.ts b/src/command-line/commands/Repl.ts index bb5effa8..543305c7 100644 --- a/src/command-line/commands/Repl.ts +++ b/src/command-line/commands/Repl.ts @@ -1,4 +1,4 @@ -import { ReadlineRepl } from "@cicada-lang/framework/lib/repls/readline-repl" +import { ReadlineRepl } from "@cicada-lang/framework/lib/repls/readline-repl/index.js" import { Command, CommandRunner } from "@xieyuheng/command-line" import Path from "path" diff --git a/src/command-line/commands/Run.ts b/src/command-line/commands/Run.ts index 6d43f06c..469a5904 100644 --- a/src/command-line/commands/Run.ts +++ b/src/command-line/commands/Run.ts @@ -2,7 +2,7 @@ import { Command, CommandRunner } from "@xieyuheng/command-line" import { ty } from "@xieyuheng/ty" import fs from "fs" import Path from "path" -import { Runner } from "../Runner" +import { Runner } from "../Runner.js" type Args = { file: string } type Opts = { watch?: boolean } @@ -43,14 +43,9 @@ export class Run extends Command { async execute(argv: Args & Opts): Promise { const url = createURL(argv["file"]) - if (argv["watch"]) { - await this.runner.run(url) - await this.runner.watch(url) - } else { - const { error } = await this.runner.run(url) - if (error) { - process.exit(1) - } + const { error } = await this.runner.run(url) + if (error) { + process.exit(1) } } } diff --git a/src/command-line/commands/index.ts b/src/command-line/commands/index.ts index 8129549f..be99c0dd 100644 --- a/src/command-line/commands/index.ts +++ b/src/command-line/commands/index.ts @@ -1,4 +1,4 @@ -export * from "@xieyuheng/command-line/lib/commands" -export * from "./Default" -export * from "./Repl" -export * from "./Run" +export * from "@xieyuheng/command-line/lib/commands/index.js" +export * from "./Default.js" +export * from "./Repl.js" +export * from "./Run.js" diff --git a/src/command-line/index.ts b/src/command-line/index.ts index 549f9e00..30e6037b 100644 --- a/src/command-line/index.ts +++ b/src/command-line/index.ts @@ -1,6 +1,7 @@ -import { CommandRunner, CommandRunners } from "@xieyuheng/command-line" -import "../app" -import * as Commands from "./commands" +import { CommandRunner } from "@xieyuheng/command-line/lib/command-runner/index.js" +import * as CommandRunners from "@xieyuheng/command-line/lib/command-runners/index.js" +import "../app/index.js" +import * as Commands from "./commands/index.js" export function createCommandRunner(): CommandRunner { return new CommandRunners.CommonCommandRunner({ diff --git a/src/index.ts b/src/index.ts index c4497fd6..a136591d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ -export * as Errors from "./lang/errors" -export * from "./lang/mod" -export * from "./loader" +export * as Errors from "./lang/errors/index.js" +export * from "./lang/mod/index.js" +export * from "./loader/index.js" diff --git a/src/lang/actions/doAp.ts b/src/lang/actions/doAp.ts index af7c003b..655285a1 100644 --- a/src/lang/actions/doAp.ts +++ b/src/lang/actions/doAp.ts @@ -1,9 +1,9 @@ -import { closureApply } from "../closure" -import * as Errors from "../errors" -import * as Neutrals from "../neutral" -import type { Value } from "../value" -import * as Values from "../value" -import { TypedValue } from "../value" +import { closureApply } from "../closure/index.js" +import * as Errors from "../errors/index.js" +import * as Neutrals from "../neutral/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" +import { TypedValue } from "../value/index.js" export function doAp(target: Value, arg: Value): Value { return tryAp(target, arg) || neutralizeAp(target, arg) diff --git a/src/lang/actions/doApImplicit.ts b/src/lang/actions/doApImplicit.ts index 2a9fda3b..6b247ff0 100644 --- a/src/lang/actions/doApImplicit.ts +++ b/src/lang/actions/doApImplicit.ts @@ -1,9 +1,9 @@ -import { closureApply } from "../closure" -import * as Errors from "../errors" -import * as Neutrals from "../neutral" -import type { Value } from "../value" -import * as Values from "../value" -import { TypedValue } from "../value" +import { closureApply } from "../closure/index.js" +import * as Errors from "../errors/index.js" +import * as Neutrals from "../neutral/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" +import { TypedValue } from "../value/index.js" export function doApImplicit(target: Value, arg: Value): Value { return tryApImplicit(target, arg) || neutralizeApImplicit(target, arg) diff --git a/src/lang/actions/doCar.ts b/src/lang/actions/doCar.ts index d17078e1..0baf864d 100644 --- a/src/lang/actions/doCar.ts +++ b/src/lang/actions/doCar.ts @@ -1,7 +1,7 @@ -import * as Errors from "../errors" -import * as Neutrals from "../neutral" -import type { Value } from "../value" -import * as Values from "../value" +import * as Errors from "../errors/index.js" +import * as Neutrals from "../neutral/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function doCar(target: Value): Value { return tryCar(target) || neutralizeCar(target) diff --git a/src/lang/actions/doCdr.ts b/src/lang/actions/doCdr.ts index 12fff378..e91f93ed 100644 --- a/src/lang/actions/doCdr.ts +++ b/src/lang/actions/doCdr.ts @@ -1,9 +1,9 @@ -import { closureApply } from "../closure" -import * as Errors from "../errors" -import * as Neutrals from "../neutral" -import type { Value } from "../value" -import * as Values from "../value" -import { doCar } from "./doCar" +import { closureApply } from "../closure/index.js" +import * as Errors from "../errors/index.js" +import * as Neutrals from "../neutral/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" +import { doCar } from "./doCar.js" export function doCdr(target: Value): Value { return tryCdr(target) || neutralizeCdr(target) diff --git a/src/lang/actions/doDot.ts b/src/lang/actions/doDot.ts index 4c3c4d82..4d5b59e0 100644 --- a/src/lang/actions/doDot.ts +++ b/src/lang/actions/doDot.ts @@ -1,7 +1,7 @@ -import * as Errors from "../errors" -import * as Neutrals from "../neutral" -import type { Value } from "../value" -import * as Values from "../value" +import * as Errors from "../errors/index.js" +import * as Neutrals from "../neutral/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function doDot(target: Value, name: string): Value { return tryDot(target, name) || neutralizeDot(target, name) diff --git a/src/lang/actions/doReplace.ts b/src/lang/actions/doReplace.ts index c6889bf1..a886cc78 100644 --- a/src/lang/actions/doReplace.ts +++ b/src/lang/actions/doReplace.ts @@ -1,10 +1,10 @@ -import * as Actions from "../actions" -import { ClosureNative } from "../closure" -import * as Errors from "../errors" -import * as Neutrals from "../neutral" -import type { Value } from "../value" -import * as Values from "../value" -import { TypedValue } from "../value" +import * as Actions from "../actions/index.js" +import { ClosureNative } from "../closure/index.js" +import * as Errors from "../errors/index.js" +import * as Neutrals from "../neutral/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" +import { TypedValue } from "../value/index.js" export function doReplace(target: Value, motive: Value, base: Value): Value { return ( diff --git a/src/lang/actions/index.ts b/src/lang/actions/index.ts index 6e470997..06bf59d3 100644 --- a/src/lang/actions/index.ts +++ b/src/lang/actions/index.ts @@ -1,6 +1,6 @@ -export * from "./doAp" -export * from "./doApImplicit" -export * from "./doCar" -export * from "./doCdr" -export * from "./doDot" -export * from "./doReplace" +export * from "./doAp.js" +export * from "./doApImplicit.js" +export * from "./doCar.js" +export * from "./doCdr.js" +export * from "./doDot.js" +export * from "./doReplace.js" diff --git a/src/lang/check/check.ts b/src/lang/check/check.ts index c337ef5c..0dcd4da9 100644 --- a/src/lang/check/check.ts +++ b/src/lang/check/check.ts @@ -1,23 +1,23 @@ -import { indent } from "../../utils/indent" -import { checkByInfer, checkProperties } from "../check" -import { closureApply } from "../closure" -import type { Core } from "../core" -import * as Cores from "../core" -import type { Ctx } from "../ctx" -import { CtxCons, ctxNames, ctxToEnv } from "../ctx" -import * as Errors from "../errors" -import { evaluate } from "../evaluate" -import type { Exp } from "../exp" -import * as Exps from "../exp" -import { infer } from "../infer" -import { insertDuringCheck } from "../insert" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { solutionNames } from "../solution" -import { freshen } from "../utils/freshen" -import type { Value } from "../value" -import * as Values from "../value" -import { formatType } from "../value" +import { indent } from "../../utils/indent.js" +import { checkByInfer, checkProperties } from "../check/index.js" +import { closureApply } from "../closure/index.js" +import type { Core } from "../core/index.js" +import * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, ctxNames, ctxToEnv } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import { evaluate } from "../evaluate/index.js" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" +import { infer } from "../infer/index.js" +import { insertDuringCheck } from "../insert/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { solutionNames } from "../solution/index.js" +import { freshen } from "../utils/freshen.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" +import { formatType } from "../value/index.js" export function check(mod: Mod, ctx: Ctx, exp: Exp, type: Value): Core { switch (exp["@kind"]) { diff --git a/src/lang/check/checkByInfer.ts b/src/lang/check/checkByInfer.ts index d904e380..efb8cdb4 100644 --- a/src/lang/check/checkByInfer.ts +++ b/src/lang/check/checkByInfer.ts @@ -1,11 +1,11 @@ -import type { Core } from "../core" -import type { Ctx } from "../ctx" -import * as Errors from "../errors" -import type { Exp } from "../exp" -import { include } from "../include" -import { infer } from "../infer" -import type { Mod } from "../mod" -import type { Value } from "../value" +import type { Core } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Exp } from "../exp/index.js" +import { include } from "../include/index.js" +import { infer } from "../infer/index.js" +import type { Mod } from "../mod/index.js" +import type { Value } from "../value/index.js" export function checkByInfer(mod: Mod, ctx: Ctx, exp: Exp, type: Value): Core { const inferred = infer(mod, ctx, exp) diff --git a/src/lang/check/checkClazz.ts b/src/lang/check/checkClazz.ts index 8d342307..d6edbd53 100644 --- a/src/lang/check/checkClazz.ts +++ b/src/lang/check/checkClazz.ts @@ -1,10 +1,10 @@ -import { check, checkType } from "../check" -import * as Cores from "../core" -import type { Ctx } from "../ctx" -import { CtxCons, CtxFulfilled, ctxToEnv } from "../ctx" -import { evaluate } from "../evaluate" -import type * as Exps from "../exp" -import type { Mod } from "../mod" +import { check, checkType } from "../check/index.js" +import * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, CtxFulfilled, ctxToEnv } from "../ctx/index.js" +import { evaluate } from "../evaluate/index.js" +import type * as Exps from "../exp/index.js" +import type { Mod } from "../mod/index.js" export function checkClazz(mod: Mod, ctx: Ctx, exp: Exps.Clazz): Cores.Clazz { switch (exp["@kind"]) { diff --git a/src/lang/check/checkProperties.ts b/src/lang/check/checkProperties.ts index 384a4eba..054c50fd 100644 --- a/src/lang/check/checkProperties.ts +++ b/src/lang/check/checkProperties.ts @@ -1,13 +1,13 @@ -import { check } from "../check" -import type { Core } from "../core" -import type { Ctx } from "../ctx" -import { CtxFulfilled, ctxToEnv } from "../ctx" -import { equivalent } from "../equivalent" -import * as Errors from "../errors" -import { evaluate } from "../evaluate" -import type { Exp } from "../exp" -import type { Mod } from "../mod" -import * as Values from "../value" +import { check } from "../check/index.js" +import type { Core } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxFulfilled, ctxToEnv } from "../ctx/index.js" +import { equivalent } from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import { evaluate } from "../evaluate/index.js" +import type { Exp } from "../exp/index.js" +import type { Mod } from "../mod/index.js" +import * as Values from "../value/index.js" export function checkProperties( mod: Mod, diff --git a/src/lang/check/checkType.ts b/src/lang/check/checkType.ts index 1b633e25..b2806b79 100644 --- a/src/lang/check/checkType.ts +++ b/src/lang/check/checkType.ts @@ -1,9 +1,9 @@ -import { check } from "../check" -import type { Core } from "../core" -import type { Ctx } from "../ctx" -import type { Exp } from "../exp" -import type { Mod } from "../mod" -import * as Values from "../value" +import { check } from "../check/index.js" +import type { Core } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import type { Exp } from "../exp/index.js" +import type { Mod } from "../mod/index.js" +import * as Values from "../value/index.js" export function checkType(mod: Mod, ctx: Ctx, type: Exp): Core { return check(mod, ctx, type, Values.Type()) diff --git a/src/lang/check/index.ts b/src/lang/check/index.ts index 7a6707be..36a1354f 100644 --- a/src/lang/check/index.ts +++ b/src/lang/check/index.ts @@ -1,5 +1,5 @@ -export * from "./check" -export * from "./checkByInfer" -export * from "./checkClazz" -export * from "./checkProperties" -export * from "./checkType" +export * from "./check.js" +export * from "./checkByInfer.js" +export * from "./checkClazz.js" +export * from "./checkProperties.js" +export * from "./checkType.js" diff --git a/src/lang/closure/Closure.ts b/src/lang/closure/Closure.ts index e1a919d9..cd789e47 100644 --- a/src/lang/closure/Closure.ts +++ b/src/lang/closure/Closure.ts @@ -1,6 +1,6 @@ -import type { Core } from "../core" -import type { Env } from "../env" -import type { Value } from "../value" +import type { Core } from "../core/index.js" +import type { Env } from "../env/index.js" +import type { Value } from "../value/index.js" export type Closure = ClosureSimple | ClosureNative diff --git a/src/lang/closure/closureApply.ts b/src/lang/closure/closureApply.ts index 3df0e225..8dc88eb7 100644 --- a/src/lang/closure/closureApply.ts +++ b/src/lang/closure/closureApply.ts @@ -1,7 +1,7 @@ -import type { Closure } from "../closure" -import { EnvCons } from "../env" -import { evaluate } from "../evaluate" -import type { Value } from "../value" +import type { Closure } from "../closure/index.js" +import { EnvCons } from "../env/index.js" +import { evaluate } from "../evaluate/index.js" +import type { Value } from "../value/index.js" export function closureApply(closure: Closure, arg: Value): Value { switch (closure["@kind"]) { diff --git a/src/lang/closure/index.ts b/src/lang/closure/index.ts index 1169a32c..3ec5d340 100644 --- a/src/lang/closure/index.ts +++ b/src/lang/closure/index.ts @@ -1,2 +1,2 @@ -export * from "./Closure" -export * from "./closureApply" +export * from "./Closure.js" +export * from "./closureApply.js" diff --git a/src/lang/core/assertClazz.ts b/src/lang/core/assertClazz.ts index 7f86aba4..388c5265 100644 --- a/src/lang/core/assertClazz.ts +++ b/src/lang/core/assertClazz.ts @@ -1,6 +1,6 @@ -import type * as Cores from "../core" -import type { Core } from "../core" -import * as Errors from "../errors" +import type * as Cores from "../core/index.js" +import type { Core } from "../core/index.js" +import * as Errors from "../errors/index.js" export function assertClazz(core: Core): asserts core is Cores.Clazz { if (core["@kind"] === "ClazzNull") return diff --git a/src/lang/core/clazzAppend.ts b/src/lang/core/clazzAppend.ts index b0befec5..0806c9bc 100644 --- a/src/lang/core/clazzAppend.ts +++ b/src/lang/core/clazzAppend.ts @@ -1,4 +1,4 @@ -import * as Cores from "../core" +import * as Cores from "../core/index.js" export function clazzAppend( left: Cores.Clazz, diff --git a/src/lang/core/formatCore.ts b/src/lang/core/formatCore.ts index 78f0d289..7986f527 100644 --- a/src/lang/core/formatCore.ts +++ b/src/lang/core/formatCore.ts @@ -1,7 +1,7 @@ -import { indent } from "../../utils/indent" -import type { Core } from "../core" -import * as Cores from "../core" -import { isIdentifier } from "../utils/isIdentifier" +import { indent } from "../../utils/indent.js" +import type { Core } from "../core/index.js" +import * as Cores from "../core/index.js" +import { isIdentifier } from "../utils/isIdentifier.js" export function formatCore(core: Core): string { switch (core["@kind"]) { diff --git a/src/lang/core/freeNames.ts b/src/lang/core/freeNames.ts index d230a30a..bd6187ea 100644 --- a/src/lang/core/freeNames.ts +++ b/src/lang/core/freeNames.ts @@ -1,4 +1,4 @@ -import type { Core } from "../core" +import type { Core } from "../core/index.js" export function freeNames(boundNames: Set, core: Core): Set { switch (core["@kind"]) { diff --git a/src/lang/core/freeOccurred.ts b/src/lang/core/freeOccurred.ts index a66c6d5d..cd9e35db 100644 --- a/src/lang/core/freeOccurred.ts +++ b/src/lang/core/freeOccurred.ts @@ -1,5 +1,5 @@ -import type { Core } from "../core" -import { freeNames } from "../core" +import type { Core } from "../core/index.js" +import { freeNames } from "../core/index.js" export function freeOccurred(name: string, core: Core): boolean { return freeNames(new Set(), core).has(name) diff --git a/src/lang/core/index.ts b/src/lang/core/index.ts index feaf2fa1..ccc14f83 100644 --- a/src/lang/core/index.ts +++ b/src/lang/core/index.ts @@ -1,11 +1,11 @@ -export * from "./Core" -export * from "./assertClazz" -export * from "./clazzAppend" -export * from "./formatCore" -export * from "./freeNames" -export * from "./freeOccurred" -export * from "./unfoldFormatAp" -export * from "./unfoldFormatClazz" -export * from "./unfoldFormatFn" -export * from "./unfoldFormatPi" -export * from "./unfoldFormatSigma" +export * from "./Core.js" +export * from "./assertClazz.js" +export * from "./clazzAppend.js" +export * from "./formatCore.js" +export * from "./freeNames.js" +export * from "./freeOccurred.js" +export * from "./unfoldFormatAp.js" +export * from "./unfoldFormatClazz.js" +export * from "./unfoldFormatFn.js" +export * from "./unfoldFormatPi.js" +export * from "./unfoldFormatSigma.js" diff --git a/src/lang/core/unfoldFormatAp.ts b/src/lang/core/unfoldFormatAp.ts index 90de98be..145b49b2 100644 --- a/src/lang/core/unfoldFormatAp.ts +++ b/src/lang/core/unfoldFormatAp.ts @@ -1,5 +1,5 @@ -import type { Core } from "../core" -import { formatCore } from "../core" +import type { Core } from "../core/index.js" +import { formatCore } from "../core/index.js" export function unfoldFormatAp(core: Core): { target: string diff --git a/src/lang/core/unfoldFormatClazz.ts b/src/lang/core/unfoldFormatClazz.ts index 240cce49..1fb885da 100644 --- a/src/lang/core/unfoldFormatClazz.ts +++ b/src/lang/core/unfoldFormatClazz.ts @@ -1,6 +1,6 @@ -import type * as Cores from "../core" -import { formatCore } from "../core" -import { isIdentifier } from "../utils/isIdentifier" +import type * as Cores from "../core/index.js" +import { formatCore } from "../core/index.js" +import { isIdentifier } from "../utils/isIdentifier.js" export function unfoldFormatClazz(clazz: Cores.Clazz): { bindings: Array diff --git a/src/lang/core/unfoldFormatFn.ts b/src/lang/core/unfoldFormatFn.ts index 4b6ee6ee..18ce1712 100644 --- a/src/lang/core/unfoldFormatFn.ts +++ b/src/lang/core/unfoldFormatFn.ts @@ -1,5 +1,5 @@ -import type { Core } from "../core" -import { formatCore } from "../core" +import type { Core } from "../core/index.js" +import { formatCore } from "../core/index.js" export function unfoldFormatFn(core: Core): { bindings: Array diff --git a/src/lang/core/unfoldFormatPi.ts b/src/lang/core/unfoldFormatPi.ts index 94dc8e43..3caf6eb2 100644 --- a/src/lang/core/unfoldFormatPi.ts +++ b/src/lang/core/unfoldFormatPi.ts @@ -1,6 +1,6 @@ -import type { Core } from "../core" -import * as Cores from "../core" -import { formatCore } from "../core" +import type { Core } from "../core/index.js" +import * as Cores from "../core/index.js" +import { formatCore } from "../core/index.js" export function unfoldFormatPi(core: Core): { bindings: Array diff --git a/src/lang/core/unfoldFormatSigma.ts b/src/lang/core/unfoldFormatSigma.ts index 55c119ec..5dc8eee9 100644 --- a/src/lang/core/unfoldFormatSigma.ts +++ b/src/lang/core/unfoldFormatSigma.ts @@ -1,5 +1,5 @@ -import type { Core } from "../core" -import { formatCore } from "../core" +import type { Core } from "../core/index.js" +import { formatCore } from "../core/index.js" export function unfoldFormatSigma(core: Core): { bindings: Array diff --git a/src/lang/ctx/Ctx.ts b/src/lang/ctx/Ctx.ts index 0afde27b..b1e8d710 100644 --- a/src/lang/ctx/Ctx.ts +++ b/src/lang/ctx/Ctx.ts @@ -1,4 +1,4 @@ -import type { Value } from "../value" +import type { Value } from "../value/index.js" export type Ctx = CtxNull | CtxCons | CtxFulfilled diff --git a/src/lang/ctx/ctxDeleteFirst.ts b/src/lang/ctx/ctxDeleteFirst.ts index 75a9e629..23cb50c0 100644 --- a/src/lang/ctx/ctxDeleteFirst.ts +++ b/src/lang/ctx/ctxDeleteFirst.ts @@ -1,4 +1,4 @@ -import type { Ctx } from "../ctx" +import type { Ctx } from "../ctx/index.js" export function ctxDeleteFirst(ctx: Ctx, name: string): Ctx { switch (ctx["@kind"]) { diff --git a/src/lang/ctx/ctxLookupType.ts b/src/lang/ctx/ctxLookupType.ts index 618a9754..02d5a9e9 100644 --- a/src/lang/ctx/ctxLookupType.ts +++ b/src/lang/ctx/ctxLookupType.ts @@ -1,5 +1,5 @@ -import type { Ctx } from "../ctx" -import type { Value } from "../value" +import type { Ctx } from "../ctx/index.js" +import type { Value } from "../value/index.js" export function ctxLookupType(ctx: Ctx, name: string): Value | undefined { while (ctx["@kind"] !== "CtxNull") { diff --git a/src/lang/ctx/ctxLookupValue.ts b/src/lang/ctx/ctxLookupValue.ts index 77aca979..ab6a6133 100644 --- a/src/lang/ctx/ctxLookupValue.ts +++ b/src/lang/ctx/ctxLookupValue.ts @@ -1,5 +1,5 @@ -import type { Ctx } from "../ctx" -import type { Value } from "../value" +import type { Ctx } from "../ctx/index.js" +import type { Value } from "../value/index.js" export function ctxLookupValue(ctx: Ctx, name: string): Value | undefined { while (ctx["@kind"] !== "CtxNull") { diff --git a/src/lang/ctx/ctxNames.ts b/src/lang/ctx/ctxNames.ts index 33619013..87263a4a 100644 --- a/src/lang/ctx/ctxNames.ts +++ b/src/lang/ctx/ctxNames.ts @@ -1,4 +1,4 @@ -import type { Ctx } from "../ctx" +import type { Ctx } from "../ctx/index.js" export function ctxNames(ctx: Ctx, names: Array = []): Array { while (ctx["@kind"] !== "CtxNull") { diff --git a/src/lang/ctx/ctxToEnv.ts b/src/lang/ctx/ctxToEnv.ts index ae7d1946..b0857a1c 100644 --- a/src/lang/ctx/ctxToEnv.ts +++ b/src/lang/ctx/ctxToEnv.ts @@ -1,8 +1,8 @@ -import type { Ctx } from "../ctx" -import type { Env } from "../env" -import { EnvCons, EnvNull } from "../env" -import * as Neutrals from "../neutral" -import { TypedNeutral } from "../value" +import type { Ctx } from "../ctx/index.js" +import type { Env } from "../env/index.js" +import { EnvCons, EnvNull } from "../env/index.js" +import * as Neutrals from "../neutral/index.js" +import { TypedNeutral } from "../value/index.js" export function ctxToEnv(ctx: Ctx): Env { switch (ctx["@kind"]) { diff --git a/src/lang/ctx/index.ts b/src/lang/ctx/index.ts index 30f697c7..b9bc8a2d 100644 --- a/src/lang/ctx/index.ts +++ b/src/lang/ctx/index.ts @@ -1,6 +1,6 @@ -export * from "./Ctx" -export * from "./ctxDeleteFirst" -export * from "./ctxLookupType" -export * from "./ctxLookupValue" -export * from "./ctxNames" -export * from "./ctxToEnv" +export * from "./Ctx.js" +export * from "./ctxDeleteFirst.js" +export * from "./ctxLookupType.js" +export * from "./ctxLookupValue.js" +export * from "./ctxNames.js" +export * from "./ctxToEnv.js" diff --git a/src/lang/env/Env.ts b/src/lang/env/Env.ts index eb9efbb9..b36bfa6e 100644 --- a/src/lang/env/Env.ts +++ b/src/lang/env/Env.ts @@ -1,4 +1,4 @@ -import type { Value } from "../value" +import type { Value } from "../value/index.js" export type Env = EnvNull | EnvCons diff --git a/src/lang/env/envDeleteFirst.ts b/src/lang/env/envDeleteFirst.ts index 2ab392e5..70ce28cc 100644 --- a/src/lang/env/envDeleteFirst.ts +++ b/src/lang/env/envDeleteFirst.ts @@ -1,4 +1,4 @@ -import type { Env } from "../env" +import type { Env } from "../env/index.js" export function envDeleteFirst(env: Env, name: string): Env { switch (env["@kind"]) { diff --git a/src/lang/env/envLookupValue.ts b/src/lang/env/envLookupValue.ts index 820e68a9..49662d7f 100644 --- a/src/lang/env/envLookupValue.ts +++ b/src/lang/env/envLookupValue.ts @@ -1,5 +1,5 @@ -import type { Env } from "../env" -import type { Value } from "../value" +import type { Env } from "../env/index.js" +import type { Value } from "../value/index.js" export function envLookupValue(env: Env, name: string): Value | undefined { while (env["@kind"] !== "EnvNull") { diff --git a/src/lang/env/envNames.ts b/src/lang/env/envNames.ts index f139db8c..1c427545 100644 --- a/src/lang/env/envNames.ts +++ b/src/lang/env/envNames.ts @@ -1,4 +1,4 @@ -import type { Env } from "../env" +import type { Env } from "../env/index.js" export function envNames(env: Env, names: Array = []): Array { while (env["@kind"] !== "EnvNull") { diff --git a/src/lang/env/index.ts b/src/lang/env/index.ts index df2ec4bd..59019aa4 100644 --- a/src/lang/env/index.ts +++ b/src/lang/env/index.ts @@ -1,4 +1,4 @@ -export * from "./Env" -export * from "./envDeleteFirst" -export * from "./envLookupValue" -export * from "./envNames" +export * from "./Env.js" +export * from "./envDeleteFirst.js" +export * from "./envLookupValue.js" +export * from "./envNames.js" diff --git a/src/lang/equivalent/equivalent.ts b/src/lang/equivalent/equivalent.ts index ccc7249c..d58bf954 100644 --- a/src/lang/equivalent/equivalent.ts +++ b/src/lang/equivalent/equivalent.ts @@ -1,11 +1,11 @@ -import { indent } from "../../utils/indent" -import type { Ctx } from "../ctx" -import { equivalentByType, equivalentByValue } from "../equivalent" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import { solutionAdvanceValue } from "../solution" -import type { Value } from "../value" -import { formatType, formatValue } from "../value" +import { indent } from "../../utils/indent.js" +import type { Ctx } from "../ctx/index.js" +import { equivalentByType, equivalentByValue } from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import { solutionAdvanceValue } from "../solution/index.js" +import type { Value } from "../value/index.js" +import { formatType, formatValue } from "../value/index.js" /** diff --git a/src/lang/equivalent/equivalentByType.ts b/src/lang/equivalent/equivalentByType.ts index 650eb9a1..d7f9485c 100644 --- a/src/lang/equivalent/equivalentByType.ts +++ b/src/lang/equivalent/equivalentByType.ts @@ -1,16 +1,16 @@ import _ from "lodash" -import * as Actions from "../actions" -import { closureApply } from "../closure" -import type { Ctx } from "../ctx" -import { CtxCons, ctxNames } from "../ctx" -import { equivalent, equivalentProperties, equivalentType } from "../equivalent" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { solutionNames } from "../solution" -import { freshen } from "../utils/freshen" -import type { Value } from "../value" -import * as Values from "../value" +import * as Actions from "../actions/index.js" +import { closureApply } from "../closure/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, ctxNames } from "../ctx/index.js" +import { equivalent, equivalentProperties, equivalentType } from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { solutionNames } from "../solution/index.js" +import { freshen } from "../utils/freshen.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function equivalentByType( mod: Mod, diff --git a/src/lang/equivalent/equivalentByValue.ts b/src/lang/equivalent/equivalentByValue.ts index 02b46785..8e3f6795 100644 --- a/src/lang/equivalent/equivalentByValue.ts +++ b/src/lang/equivalent/equivalentByValue.ts @@ -1,10 +1,10 @@ -import { indent } from "../../utils/indent" -import type { Ctx } from "../ctx" -import { equivalent, equivalentNeutral, equivalentType } from "../equivalent" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import type { Value } from "../value" -import { formatType, formatValue } from "../value" +import { indent } from "../../utils/indent.js" +import type { Ctx } from "../ctx/index.js" +import { equivalent, equivalentNeutral, equivalentType } from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import type { Value } from "../value/index.js" +import { formatType, formatValue } from "../value/index.js" export function equivalentByValue( mod: Mod, diff --git a/src/lang/equivalent/equivalentClazz.ts b/src/lang/equivalent/equivalentClazz.ts index 7773ad47..61d907b3 100644 --- a/src/lang/equivalent/equivalentClazz.ts +++ b/src/lang/equivalent/equivalentClazz.ts @@ -1,14 +1,14 @@ -import { indent } from "../../utils/indent" -import type { Ctx } from "../ctx" -import { ctxNames } from "../ctx" -import { equivalent, equivalentType } from "../equivalent" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { solutionNames } from "../solution" -import { freshen } from "../utils/freshen" -import * as Values from "../value" -import { formatType } from "../value" +import { indent } from "../../utils/indent.js" +import type { Ctx } from "../ctx/index.js" +import { ctxNames } from "../ctx/index.js" +import { equivalent, equivalentType } from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { solutionNames } from "../solution/index.js" +import { freshen } from "../utils/freshen.js" +import * as Values from "../value/index.js" +import { formatType } from "../value/index.js" export function equivalentClazz( mod: Mod, diff --git a/src/lang/equivalent/equivalentNeutral.ts b/src/lang/equivalent/equivalentNeutral.ts index a711246f..3fd8d78f 100644 --- a/src/lang/equivalent/equivalentNeutral.ts +++ b/src/lang/equivalent/equivalentNeutral.ts @@ -1,11 +1,11 @@ -import { indent } from "../../utils/indent" -import type { Ctx } from "../ctx" -import { equivalent, equivalentType } from "../equivalent" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import type { Neutral } from "../neutral" -import type { Value } from "../value" -import { TypedValue, formatNeutral } from "../value" +import { indent } from "../../utils/indent.js" +import type { Ctx } from "../ctx/index.js" +import { equivalent, equivalentType } from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import type { Neutral } from "../neutral/index.js" +import type { Value } from "../value/index.js" +import { TypedValue, formatNeutral } from "../value/index.js" function equivalentTypedValue( mod: Mod, diff --git a/src/lang/equivalent/equivalentProperties.ts b/src/lang/equivalent/equivalentProperties.ts index 1d514035..67335fea 100644 --- a/src/lang/equivalent/equivalentProperties.ts +++ b/src/lang/equivalent/equivalentProperties.ts @@ -1,9 +1,9 @@ -import * as Actions from "../actions" -import type { Ctx } from "../ctx" -import { equivalent } from "../equivalent" -import type { Mod } from "../mod" -import type { Value } from "../value" -import * as Values from "../value" +import * as Actions from "../actions/index.js" +import type { Ctx } from "../ctx/index.js" +import { equivalent } from "../equivalent/index.js" +import type { Mod } from "../mod/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function equivalentProperties( mod: Mod, diff --git a/src/lang/equivalent/equivalentType.ts b/src/lang/equivalent/equivalentType.ts index 998e0187..2a95687c 100644 --- a/src/lang/equivalent/equivalentType.ts +++ b/src/lang/equivalent/equivalentType.ts @@ -1,15 +1,19 @@ -import { indent } from "../../utils/indent" -import { closureApply } from "../closure" -import type { Ctx } from "../ctx" -import { CtxCons, ctxNames } from "../ctx" -import { equivalent, equivalentClazz, equivalentNeutral } from "../equivalent" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { solutionAdvanceValue, solutionNames } from "../solution" -import { freshen } from "../utils/freshen" -import * as Values from "../value" -import { Value, formatType, isClazz } from "../value" +import { indent } from "../../utils/indent.js" +import { closureApply } from "../closure/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, ctxNames } from "../ctx/index.js" +import { + equivalent, + equivalentClazz, + equivalentNeutral, +} from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { solutionAdvanceValue, solutionNames } from "../solution/index.js" +import { freshen } from "../utils/freshen.js" +import * as Values from "../value/index.js" +import { type Value, formatType, isClazz } from "../value/index.js" export function equivalentType( mod: Mod, diff --git a/src/lang/equivalent/index.ts b/src/lang/equivalent/index.ts index 52077b61..190638c6 100644 --- a/src/lang/equivalent/index.ts +++ b/src/lang/equivalent/index.ts @@ -1,7 +1,7 @@ -export * from "./equivalent" -export * from "./equivalentByType" -export * from "./equivalentByValue" -export * from "./equivalentClazz" -export * from "./equivalentNeutral" -export * from "./equivalentProperties" -export * from "./equivalentType" +export * from "./equivalent.js" +export * from "./equivalentByType.js" +export * from "./equivalentByValue.js" +export * from "./equivalentClazz.js" +export * from "./equivalentNeutral.js" +export * from "./equivalentProperties.js" +export * from "./equivalentType.js" diff --git a/src/lang/errors/AssertionError.ts b/src/lang/errors/AssertionError.ts index dd765ad3..62b50548 100644 --- a/src/lang/errors/AssertionError.ts +++ b/src/lang/errors/AssertionError.ts @@ -1,4 +1,4 @@ -import { LangError } from "./LangError" +import { LangError } from "./LangError.js" export class AssertionError extends LangError { constructor(public message: string) { diff --git a/src/lang/errors/ElaborationError.ts b/src/lang/errors/ElaborationError.ts index 3ee29d5c..cf08ed98 100644 --- a/src/lang/errors/ElaborationError.ts +++ b/src/lang/errors/ElaborationError.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import type { Span } from "../span" -import { LangError } from "./LangError" +import type { Span } from "../span/index.js" +import { LangError } from "./LangError.js" export class ElaborationError extends LangError { constructor( diff --git a/src/lang/errors/EquivalenceError.ts b/src/lang/errors/EquivalenceError.ts index f5323e81..52c05ae3 100644 --- a/src/lang/errors/EquivalenceError.ts +++ b/src/lang/errors/EquivalenceError.ts @@ -1,4 +1,4 @@ -import { LangError } from "./LangError" +import { LangError } from "./LangError.js" export class EquivalenceError extends LangError { trace: Array = [] diff --git a/src/lang/errors/ErrorReport.ts b/src/lang/errors/ErrorReport.ts index 0899e773..c1e06e0e 100644 --- a/src/lang/errors/ErrorReport.ts +++ b/src/lang/errors/ErrorReport.ts @@ -1,4 +1,4 @@ -import { LangError } from "./LangError" +import { LangError } from "./LangError.js" export class ErrorReport extends LangError { constructor(public message: string) { diff --git a/src/lang/errors/EvaluationError.ts b/src/lang/errors/EvaluationError.ts index 11266a4e..21adef0a 100644 --- a/src/lang/errors/EvaluationError.ts +++ b/src/lang/errors/EvaluationError.ts @@ -1,4 +1,4 @@ -import { LangError } from "./LangError" +import { LangError } from "./LangError.js" export class EvaluationError extends LangError { constructor(public message: string) { diff --git a/src/lang/errors/InclusionError.ts b/src/lang/errors/InclusionError.ts index d8f65a21..ec6b2a79 100644 --- a/src/lang/errors/InclusionError.ts +++ b/src/lang/errors/InclusionError.ts @@ -1,4 +1,4 @@ -import { LangError } from "./LangError" +import { LangError } from "./LangError.js" export class InclusionError extends LangError { trace: Array = [] diff --git a/src/lang/errors/ReadbackError.ts b/src/lang/errors/ReadbackError.ts index 5727c7a6..bf5129ce 100644 --- a/src/lang/errors/ReadbackError.ts +++ b/src/lang/errors/ReadbackError.ts @@ -1,4 +1,4 @@ -import { LangError } from "./LangError" +import { LangError } from "./LangError.js" export class ReadbackError extends LangError { constructor(public message: string) { diff --git a/src/lang/errors/UnificationError.ts b/src/lang/errors/UnificationError.ts index 019dc70b..aa81a13d 100644 --- a/src/lang/errors/UnificationError.ts +++ b/src/lang/errors/UnificationError.ts @@ -1,4 +1,4 @@ -import { LangError } from "./LangError" +import { LangError } from "./LangError.js" export class UnificationError extends LangError { trace: Array = [] diff --git a/src/lang/errors/index.ts b/src/lang/errors/index.ts index bc2faa62..18a9864a 100644 --- a/src/lang/errors/index.ts +++ b/src/lang/errors/index.ts @@ -1,11 +1,11 @@ export { ParsingError } from "@cicada-lang/partech" -export * from "./AssertionError" -export * from "./ElaborationError" -export * from "./EquivalenceError" -export * from "./ErrorReport" -export * from "./EvaluationError" -export * from "./InclusionError" -export * from "./InternalError" -export * from "./LangError" -export * from "./ReadbackError" -export * from "./UnificationError" +export * from "./AssertionError.js" +export * from "./ElaborationError.js" +export * from "./EquivalenceError.js" +export * from "./ErrorReport.js" +export * from "./EvaluationError.js" +export * from "./InclusionError.js" +export * from "./InternalError.js" +export * from "./LangError.js" +export * from "./ReadbackError.js" +export * from "./UnificationError.js" diff --git a/src/lang/evaluate/evaluate.ts b/src/lang/evaluate/evaluate.ts index 4d43f275..8b2da691 100644 --- a/src/lang/evaluate/evaluate.ts +++ b/src/lang/evaluate/evaluate.ts @@ -1,11 +1,11 @@ -import * as Actions from "../actions" -import { ClosureSimple } from "../closure" -import type { Core } from "../core" -import type { Env } from "../env" -import { EnvCons, envLookupValue } from "../env" -import * as Errors from "../errors" -import type { Value } from "../value" -import * as Values from "../value" +import * as Actions from "../actions/index.js" +import { ClosureSimple } from "../closure/index.js" +import type { Core } from "../core/index.js" +import type { Env } from "../env/index.js" +import { EnvCons, envLookupValue } from "../env/index.js" +import * as Errors from "../errors/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function evaluate(env: Env, core: Core): Value { switch (core["@kind"]) { diff --git a/src/lang/evaluate/index.ts b/src/lang/evaluate/index.ts index 7394ad83..e544feb0 100644 --- a/src/lang/evaluate/index.ts +++ b/src/lang/evaluate/index.ts @@ -1 +1 @@ -export * from "./evaluate" +export * from "./evaluate.js" diff --git a/src/lang/exp/Exp.ts b/src/lang/exp/Exp.ts index 0c2730f5..27a06ca8 100644 --- a/src/lang/exp/Exp.ts +++ b/src/lang/exp/Exp.ts @@ -1,5 +1,5 @@ -import type { Macro } from "../macro" -import type { Span } from "../span" +import type { Macro } from "../macro/index.js" +import type { Span } from "../span/index.js" type ExpMeta = { span?: Span } diff --git a/src/lang/exp/foldAp.ts b/src/lang/exp/foldAp.ts index e6725059..202d801b 100644 --- a/src/lang/exp/foldAp.ts +++ b/src/lang/exp/foldAp.ts @@ -1,6 +1,6 @@ -import type { Exp } from "../exp" -import * as Exps from "../exp" -import { spanUnion } from "../span" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" +import { spanUnion } from "../span/index.js" export function foldAp(target: Exp, args: Array): Exp { if (args.length === 0) return target diff --git a/src/lang/exp/foldClazz.ts b/src/lang/exp/foldClazz.ts index 18fb127a..a6fedee9 100644 --- a/src/lang/exp/foldClazz.ts +++ b/src/lang/exp/foldClazz.ts @@ -1,5 +1,5 @@ -import * as Exps from "../exp" -import { spanUnion } from "../span" +import * as Exps from "../exp/index.js" +import { spanUnion } from "../span/index.js" export function foldClazz( bindings: Array, diff --git a/src/lang/exp/foldFn.ts b/src/lang/exp/foldFn.ts index 34f0a9f0..72b2c760 100644 --- a/src/lang/exp/foldFn.ts +++ b/src/lang/exp/foldFn.ts @@ -1,6 +1,6 @@ -import type { Exp } from "../exp" -import * as Exps from "../exp" -import { spanUnion } from "../span" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" +import { spanUnion } from "../span/index.js" export function foldFn(bindings: Array, ret: Exp): Exp { if (bindings.length === 0) return ret diff --git a/src/lang/exp/foldFnWithRetType.ts b/src/lang/exp/foldFnWithRetType.ts index ae3c293d..ed5dfba3 100644 --- a/src/lang/exp/foldFnWithRetType.ts +++ b/src/lang/exp/foldFnWithRetType.ts @@ -1,6 +1,6 @@ -import type { Exp } from "../exp" -import * as Exps from "../exp" -import { spanUnion } from "../span" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" +import { spanUnion } from "../span/index.js" export function foldFnWithRetType( bindings: Array, diff --git a/src/lang/exp/foldPi.ts b/src/lang/exp/foldPi.ts index 968f9d88..5684159d 100644 --- a/src/lang/exp/foldPi.ts +++ b/src/lang/exp/foldPi.ts @@ -1,6 +1,6 @@ -import type { Exp } from "../exp" -import * as Exps from "../exp" -import { spanUnion } from "../span" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" +import { spanUnion } from "../span/index.js" export function foldPi(bindings: Array, retType: Exp): Exp { if (bindings.length === 0) return retType diff --git a/src/lang/exp/foldSequence.ts b/src/lang/exp/foldSequence.ts index eb153af1..62e41340 100644 --- a/src/lang/exp/foldSequence.ts +++ b/src/lang/exp/foldSequence.ts @@ -1,5 +1,5 @@ -import type { Exp } from "../exp" -import * as Exps from "../exp" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" export function foldSequence( bindings: Array, diff --git a/src/lang/exp/foldSigma.ts b/src/lang/exp/foldSigma.ts index b2e41f3b..22a9b65b 100644 --- a/src/lang/exp/foldSigma.ts +++ b/src/lang/exp/foldSigma.ts @@ -1,6 +1,6 @@ -import type { Exp } from "../exp" -import * as Exps from "../exp" -import { spanUnion } from "../span" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" +import { spanUnion } from "../span/index.js" export function foldSigma( bindings: Array, diff --git a/src/lang/exp/freeNames.ts b/src/lang/exp/freeNames.ts index ccd08a09..ef398891 100644 --- a/src/lang/exp/freeNames.ts +++ b/src/lang/exp/freeNames.ts @@ -1,5 +1,5 @@ -import type { Exp } from "../exp" -import * as Exps from "../exp" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" export function freeNames(boundNames: Set, exp: Exp): Set { switch (exp["@kind"]) { diff --git a/src/lang/exp/index.ts b/src/lang/exp/index.ts index ecf9e4fd..63d7de89 100644 --- a/src/lang/exp/index.ts +++ b/src/lang/exp/index.ts @@ -1,12 +1,12 @@ -export * from "./Exp" -export * from "./foldAp" -export * from "./foldClazz" -export * from "./foldFn" -export * from "./foldFnWithRetType" -export * from "./foldPi" -export * from "./foldSequence" -export * from "./foldSigma" -export * from "./freeNames" -export * from "./prepareProperties" -export * from "./substitute" -export * from "./unfoldAp" +export * from "./Exp.js" +export * from "./foldAp.js" +export * from "./foldClazz.js" +export * from "./foldFn.js" +export * from "./foldFnWithRetType.js" +export * from "./foldPi.js" +export * from "./foldSequence.js" +export * from "./foldSigma.js" +export * from "./freeNames.js" +export * from "./prepareProperties.js" +export * from "./substitute.js" +export * from "./unfoldAp.js" diff --git a/src/lang/exp/prepareProperties.ts b/src/lang/exp/prepareProperties.ts index d63e322c..c8c091fc 100644 --- a/src/lang/exp/prepareProperties.ts +++ b/src/lang/exp/prepareProperties.ts @@ -1,10 +1,10 @@ -import type { Ctx } from "../ctx" -import * as Errors from "../errors" -import type { Exp } from "../exp" -import * as Exps from "../exp" -import { infer } from "../infer" -import type { Mod } from "../mod" -import * as Values from "../value" +import type { Ctx } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" +import { infer } from "../infer/index.js" +import type { Mod } from "../mod/index.js" +import * as Values from "../value/index.js" export function prepareProperties( mod: Mod, diff --git a/src/lang/exp/substitute.ts b/src/lang/exp/substitute.ts index d895589e..bf48e90c 100644 --- a/src/lang/exp/substitute.ts +++ b/src/lang/exp/substitute.ts @@ -1,6 +1,6 @@ -import type { Exp } from "../exp" -import * as Exps from "../exp" -import { freshen } from "../utils/freshen" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" +import { freshen } from "../utils/freshen.js" export function substitute(body: Exp, name: string, exp: Exp): Exp { switch (body["@kind"]) { diff --git a/src/lang/exp/unfoldAp.ts b/src/lang/exp/unfoldAp.ts index 57199c75..a1d55046 100644 --- a/src/lang/exp/unfoldAp.ts +++ b/src/lang/exp/unfoldAp.ts @@ -1,5 +1,5 @@ -import type { Exp } from "../exp" -import * as Exps from "../exp" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" /** diff --git a/src/lang/globals/GlobalStore.ts b/src/lang/globals/GlobalStore.ts index 2a13eaf3..5a775a34 100644 --- a/src/lang/globals/GlobalStore.ts +++ b/src/lang/globals/GlobalStore.ts @@ -1,10 +1,10 @@ -import { Loader } from "../../loader" -import { check, checkType } from "../check" -import { CtxFulfilled } from "../ctx" -import { evaluate } from "../evaluate" -import { Mod } from "../mod" -import { parseExp } from "../syntax" -import type { Value } from "../value" +import { Loader } from "../../loader/index.js" +import { check, checkType } from "../check/index.js" +import { CtxFulfilled } from "../ctx/index.js" +import { evaluate } from "../evaluate/index.js" +import { Mod } from "../mod/index.js" +import { parseExp } from "../syntax/index.js" +import type { Value } from "../value/index.js" export class GlobalStore { claimed: Map = new Map() diff --git a/src/lang/globals/index.ts b/src/lang/globals/index.ts index 594170d3..ba7eb821 100644 --- a/src/lang/globals/index.ts +++ b/src/lang/globals/index.ts @@ -1 +1 @@ -export * from "./useGlobals" +export * from "./useGlobals.js" diff --git a/src/lang/globals/useGlobals.ts b/src/lang/globals/useGlobals.ts index 84d08553..537ae26a 100644 --- a/src/lang/globals/useGlobals.ts +++ b/src/lang/globals/useGlobals.ts @@ -1,7 +1,7 @@ -import * as Actions from "../actions" -import { ClosureNative } from "../closure" -import * as Values from "../value" -import { GlobalStore } from "./GlobalStore" +import * as Actions from "../actions/index.js" +import { ClosureNative } from "../closure/index.js" +import * as Values from "../value/index.js" +import { GlobalStore } from "./GlobalStore.js" let globals: GlobalStore | undefined = undefined diff --git a/src/lang/include/include.ts b/src/lang/include/include.ts index 44c15a88..226a15e3 100644 --- a/src/lang/include/include.ts +++ b/src/lang/include/include.ts @@ -1,15 +1,15 @@ -import { indent } from "../../utils/indent" -import { closureApply } from "../closure" -import type { Ctx } from "../ctx" -import { CtxCons, ctxNames } from "../ctx" -import { equivalent, equivalentType } from "../equivalent" -import * as Errors from "../errors" -import { includeClazz } from "../include" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { freshen } from "../utils/freshen" -import type { Value } from "../value" -import * as Values from "../value" +import { indent } from "../../utils/indent.js" +import { closureApply } from "../closure/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, ctxNames } from "../ctx/index.js" +import { equivalent, equivalentType } from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import { includeClazz } from "../include/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { freshen } from "../utils/freshen.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" /** diff --git a/src/lang/include/includeClazz.ts b/src/lang/include/includeClazz.ts index cc166b88..074f8b5d 100644 --- a/src/lang/include/includeClazz.ts +++ b/src/lang/include/includeClazz.ts @@ -1,13 +1,13 @@ import _ from "lodash" -import type { Ctx } from "../ctx" -import { ctxNames } from "../ctx" -import { equivalent } from "../equivalent" -import * as Errors from "../errors" -import { include } from "../include" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { freshen } from "../utils/freshen" -import * as Values from "../value" +import type { Ctx } from "../ctx/index.js" +import { ctxNames } from "../ctx/index.js" +import { equivalent } from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import { include } from "../include/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { freshen } from "../utils/freshen.js" +import * as Values from "../value/index.js" export function includeClazz( mod: Mod, diff --git a/src/lang/include/index.ts b/src/lang/include/index.ts index 1bb1dac0..dac56420 100644 --- a/src/lang/include/index.ts +++ b/src/lang/include/index.ts @@ -1,2 +1,2 @@ -export * from "./include" -export * from "./includeClazz" +export * from "./include.js" +export * from "./includeClazz.js" diff --git a/src/lang/infer/index.ts b/src/lang/infer/index.ts index 09768bc2..4dc9c4a7 100644 --- a/src/lang/infer/index.ts +++ b/src/lang/infer/index.ts @@ -1,6 +1,6 @@ -export * from "./infer" -export * from "./inferExtraProperties" -export * from "./inferFulfillingClazz" -export * from "./inferNewArgs" -export * from "./inferOrUndefined" -export * from "./inferProperties" +export * from "./infer.js" +export * from "./inferExtraProperties.js" +export * from "./inferFulfillingClazz.js" +export * from "./inferNewArgs.js" +export * from "./inferOrUndefined.js" +export * from "./inferProperties.js" diff --git a/src/lang/infer/infer.ts b/src/lang/infer/infer.ts index c57df6b8..fc10bcee 100644 --- a/src/lang/infer/infer.ts +++ b/src/lang/infer/infer.ts @@ -1,30 +1,30 @@ -import { check, checkClazz, checkType } from "../check" -import { ClosureNative, ClosureSimple, closureApply } from "../closure" -import type { Core } from "../core" -import * as Cores from "../core" -import type { Ctx } from "../ctx" +import { check, checkClazz, checkType } from "../check/index.js" +import { ClosureNative, ClosureSimple, closureApply } from "../closure/index.js" +import type { Core } from "../core/index.js" +import * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" import { CtxCons, CtxFulfilled, ctxLookupType, ctxLookupValue, ctxToEnv, -} from "../ctx" -import * as Errors from "../errors" -import { evaluate } from "../evaluate" -import type { Exp } from "../exp" -import * as Exps from "../exp" +} from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import { evaluate } from "../evaluate/index.js" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" import { inferExtraProperties, inferFulfillingClazz, inferNewArgs, inferProperties, -} from "../infer" -import { insertDuringInfer } from "../insert" -import type { Mod } from "../mod" -import { readbackType } from "../readback" -import type { Value } from "../value" -import * as Values from "../value" +} from "../infer/index.js" +import { insertDuringInfer } from "../insert/index.js" +import type { Mod } from "../mod/index.js" +import { readbackType } from "../readback/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export type Inferred = { type: Value diff --git a/src/lang/infer/inferExtraProperties.ts b/src/lang/infer/inferExtraProperties.ts index 004c8db6..3738110f 100644 --- a/src/lang/infer/inferExtraProperties.ts +++ b/src/lang/infer/inferExtraProperties.ts @@ -1,11 +1,11 @@ -import type { Core } from "../core" -import type { Ctx } from "../ctx" -import { ctxToEnv } from "../ctx" -import { evaluate } from "../evaluate" -import type { Exp } from "../exp" -import { infer, Inferred } from "../infer" -import type { Mod } from "../mod" -import * as Values from "../value" +import type { Core } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import { ctxToEnv } from "../ctx/index.js" +import { evaluate } from "../evaluate/index.js" +import type { Exp } from "../exp/index.js" +import { infer, Inferred } from "../infer/index.js" +import type { Mod } from "../mod/index.js" +import * as Values from "../value/index.js" export function inferExtraProperties( mod: Mod, diff --git a/src/lang/infer/inferFulfillingClazz.ts b/src/lang/infer/inferFulfillingClazz.ts index 966aded3..9c27c52c 100644 --- a/src/lang/infer/inferFulfillingClazz.ts +++ b/src/lang/infer/inferFulfillingClazz.ts @@ -1,14 +1,14 @@ -import { check } from "../check" -import type { Core } from "../core" -import * as Cores from "../core" -import type { Ctx } from "../ctx" -import { ctxToEnv } from "../ctx" -import * as Errors from "../errors" -import { evaluate } from "../evaluate" -import type { Exp } from "../exp" -import { Inferred } from "../infer" -import type { Mod } from "../mod" -import * as Values from "../value" +import { check } from "../check/index.js" +import type { Core } from "../core/index.js" +import * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import { ctxToEnv } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import { evaluate } from "../evaluate/index.js" +import type { Exp } from "../exp/index.js" +import { Inferred } from "../infer/index.js" +import type { Mod } from "../mod/index.js" +import * as Values from "../value/index.js" export function inferFulfillingClazz( mod: Mod, diff --git a/src/lang/infer/inferNewArgs.ts b/src/lang/infer/inferNewArgs.ts index 13ca293c..1d843f22 100644 --- a/src/lang/infer/inferNewArgs.ts +++ b/src/lang/infer/inferNewArgs.ts @@ -1,13 +1,13 @@ -import { check } from "../check" -import type { Core } from "../core" -import type { Ctx } from "../ctx" -import { CtxCons, ctxToEnv } from "../ctx" -import * as Errors from "../errors" -import { evaluate } from "../evaluate" -import type * as Exps from "../exp" -import type { Mod } from "../mod" -import { readback } from "../readback" -import * as Values from "../value" +import { check } from "../check/index.js" +import type { Core } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, ctxToEnv } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import { evaluate } from "../evaluate/index.js" +import type * as Exps from "../exp/index.js" +import type { Mod } from "../mod/index.js" +import { readback } from "../readback/index.js" +import * as Values from "../value/index.js" export function inferNewArgs( mod: Mod, diff --git a/src/lang/infer/inferOrUndefined.ts b/src/lang/infer/inferOrUndefined.ts index b46ed4a0..ca7d8fb0 100644 --- a/src/lang/infer/inferOrUndefined.ts +++ b/src/lang/infer/inferOrUndefined.ts @@ -1,7 +1,7 @@ -import type { Ctx } from "../ctx" -import type { Exp } from "../exp" -import { infer, Inferred } from "../infer" -import type { Mod } from "../mod" +import type { Ctx } from "../ctx/index.js" +import type { Exp } from "../exp/index.js" +import { infer, Inferred } from "../infer/index.js" +import type { Mod } from "../mod/index.js" export function inferOrUndefined( mod: Mod, diff --git a/src/lang/infer/inferProperties.ts b/src/lang/infer/inferProperties.ts index b6aa3f68..b3fc0f5c 100644 --- a/src/lang/infer/inferProperties.ts +++ b/src/lang/infer/inferProperties.ts @@ -1,14 +1,14 @@ -import { check } from "../check" -import type { Core } from "../core" -import type { Ctx } from "../ctx" -import { CtxFulfilled, ctxToEnv } from "../ctx" -import { equivalent } from "../equivalent" -import * as Errors from "../errors" -import { evaluate } from "../evaluate" -import type { Exp } from "../exp" -import type { Mod } from "../mod" -import { readback } from "../readback" -import * as Values from "../value" +import { check } from "../check/index.js" +import type { Core } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxFulfilled, ctxToEnv } from "../ctx/index.js" +import { equivalent } from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import { evaluate } from "../evaluate/index.js" +import type { Exp } from "../exp/index.js" +import type { Mod } from "../mod/index.js" +import { readback } from "../readback/index.js" +import * as Values from "../value/index.js" export function inferProperties( mod: Mod, diff --git a/src/lang/insert/Insertion.ts b/src/lang/insert/Insertion.ts index 7b2b6ffb..946c443b 100644 --- a/src/lang/insert/Insertion.ts +++ b/src/lang/insert/Insertion.ts @@ -1,6 +1,6 @@ -import type { Core } from "../core" -import type { Exp } from "../exp" -import type * as Values from "../value" +import type { Core } from "../core/index.js" +import type { Exp } from "../exp/index.js" +import type * as Values from "../value/index.js" export type Insertion = | InsertionPatternVar diff --git a/src/lang/insert/index.ts b/src/lang/insert/index.ts index 19b95a92..8f9be2a4 100644 --- a/src/lang/insert/index.ts +++ b/src/lang/insert/index.ts @@ -1,6 +1,6 @@ -export * from "./Insertion" -export * from "./insertDuringCheck" -export * from "./insertDuringInfer" -export * from "./insertionApply" -export * from "./solveByArgs" -export * from "./solveByRetType" +export * from "./Insertion.js" +export * from "./insertDuringCheck.js" +export * from "./insertDuringInfer.js" +export * from "./insertionApply.js" +export * from "./solveByArgs.js" +export * from "./solveByRetType.js" diff --git a/src/lang/insert/insertDuringCheck.ts b/src/lang/insert/insertDuringCheck.ts index 105439f1..06739e9e 100644 --- a/src/lang/insert/insertDuringCheck.ts +++ b/src/lang/insert/insertDuringCheck.ts @@ -1,10 +1,10 @@ -import type { Core } from "../core" -import type { Ctx } from "../ctx" -import type * as Exps from "../exp" -import type { Inferred } from "../infer" -import { insertionApply, solveByArgs, solveByRetType } from "../insert" -import type { Mod } from "../mod" -import type { Value } from "../value" +import type { Core } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import type * as Exps from "../exp/index.js" +import type { Inferred } from "../infer/index.js" +import { insertionApply, solveByArgs, solveByRetType } from "../insert/index.js" +import type { Mod } from "../mod/index.js" +import type { Value } from "../value/index.js" export function insertDuringCheck( mod: Mod, diff --git a/src/lang/insert/insertDuringInfer.ts b/src/lang/insert/insertDuringInfer.ts index 7d629e1e..754eef80 100644 --- a/src/lang/insert/insertDuringInfer.ts +++ b/src/lang/insert/insertDuringInfer.ts @@ -1,8 +1,8 @@ -import type { Ctx } from "../ctx" -import type * as Exps from "../exp" -import { Inferred } from "../infer" -import { insertionApply, solveByArgs } from "../insert" -import type { Mod } from "../mod" +import type { Ctx } from "../ctx/index.js" +import type * as Exps from "../exp/index.js" +import { Inferred } from "../infer/index.js" +import { insertionApply, solveByArgs } from "../insert/index.js" +import type { Mod } from "../mod/index.js" export function insertDuringInfer( mod: Mod, diff --git a/src/lang/insert/insertionApply.ts b/src/lang/insert/insertionApply.ts index e2096f8f..9847308f 100644 --- a/src/lang/insert/insertionApply.ts +++ b/src/lang/insert/insertionApply.ts @@ -1,11 +1,11 @@ -import type { Core } from "../core" -import * as Cores from "../core" -import type { Ctx } from "../ctx" -import * as Errors from "../errors" -import type { Insertion } from "../insert" -import type { Mod } from "../mod" -import { readback } from "../readback" -import { solutionLookupValue } from "../solution" +import type { Core } from "../core/index.js" +import * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Insertion } from "../insert/index.js" +import type { Mod } from "../mod/index.js" +import { readback } from "../readback/index.js" +import { solutionLookupValue } from "../solution/index.js" export function insertionApply( mod: Mod, diff --git a/src/lang/insert/solveByArgs.ts b/src/lang/insert/solveByArgs.ts index 8423eaee..6c9677ea 100644 --- a/src/lang/insert/solveByArgs.ts +++ b/src/lang/insert/solveByArgs.ts @@ -1,20 +1,20 @@ -import { check } from "../check" -import { closureApply } from "../closure" -import type { Ctx } from "../ctx" -import { CtxFulfilled, ctxNames, ctxToEnv } from "../ctx" -import * as Errors from "../errors" -import { evaluate } from "../evaluate" -import type * as Exps from "../exp" -import { freeNames } from "../exp" -import { inferOrUndefined } from "../infer" -import type { Insertion } from "../insert" -import type { Mod } from "../mod" -import { solutionNames } from "../solution" -import { unifyType } from "../unify" -import { freshen } from "../utils/freshen" -import type { Value } from "../value" -import * as Values from "../value" -import * as Insertions from "./Insertion" +import { check } from "../check/index.js" +import { closureApply } from "../closure/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxFulfilled, ctxNames, ctxToEnv } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import { evaluate } from "../evaluate/index.js" +import type * as Exps from "../exp/index.js" +import { freeNames } from "../exp/index.js" +import { inferOrUndefined } from "../infer/index.js" +import type { Insertion } from "../insert/index.js" +import type { Mod } from "../mod/index.js" +import { solutionNames } from "../solution/index.js" +import { unifyType } from "../unify/index.js" +import { freshen } from "../utils/freshen.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" +import * as Insertions from "./Insertion.js" export function solveByArgs( mod: Mod, diff --git a/src/lang/insert/solveByRetType.ts b/src/lang/insert/solveByRetType.ts index 6a386e13..a752bef4 100644 --- a/src/lang/insert/solveByRetType.ts +++ b/src/lang/insert/solveByRetType.ts @@ -1,16 +1,16 @@ -import { closureApply } from "../closure" -import type { Ctx } from "../ctx" -import { CtxFulfilled, ctxNames } from "../ctx" -import type * as Exps from "../exp" -import { freeNames } from "../exp" -import type { Mod } from "../mod" -import { solutionNames } from "../solution" -import { unifyType } from "../unify" -import { freshen } from "../utils/freshen" -import type { Value } from "../value" -import * as Values from "../value" -import type { Insertion } from "./Insertion" -import * as Insertions from "./Insertion" +import { closureApply } from "../closure/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxFulfilled, ctxNames } from "../ctx/index.js" +import type * as Exps from "../exp/index.js" +import { freeNames } from "../exp/index.js" +import type { Mod } from "../mod/index.js" +import { solutionNames } from "../solution/index.js" +import { unifyType } from "../unify/index.js" +import { freshen } from "../utils/freshen.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" +import type { Insertion } from "./Insertion.js" +import * as Insertions from "./Insertion.js" export function solveByRetType( mod: Mod, diff --git a/src/lang/macro/Macro.ts b/src/lang/macro/Macro.ts index f4fd978f..3064da62 100644 --- a/src/lang/macro/Macro.ts +++ b/src/lang/macro/Macro.ts @@ -1,4 +1,4 @@ -import type { Exp } from "../exp" +import type { Exp } from "../exp/index.js" export abstract class Macro { abstract expand(): Exp diff --git a/src/lang/macro/index.ts b/src/lang/macro/index.ts index 6f96761b..7398a570 100644 --- a/src/lang/macro/index.ts +++ b/src/lang/macro/index.ts @@ -1 +1 @@ -export * from "./Macro" +export * from "./Macro.js" diff --git a/src/lang/macros/Equivalent.ts b/src/lang/macros/Equivalent.ts index bcfc5040..672140dd 100644 --- a/src/lang/macros/Equivalent.ts +++ b/src/lang/macros/Equivalent.ts @@ -1,8 +1,8 @@ -import type { Exp } from "../exp" -import * as Exps from "../exp" -import { Macro } from "../macro" -import type { Span } from "../span" -import { spanUnion } from "../span" +import type { Exp } from "../exp/index.js" +import * as Exps from "../exp/index.js" +import { Macro } from "../macro/index.js" +import type { Span } from "../span/index.js" +import { spanUnion } from "../span/index.js" export type EquivalentEntry = { via?: Exp diff --git a/src/lang/macros/index.ts b/src/lang/macros/index.ts index 744a5e20..c354b455 100644 --- a/src/lang/macros/index.ts +++ b/src/lang/macros/index.ts @@ -1 +1 @@ -export * from "./Equivalent" +export * from "./Equivalent.js" diff --git a/src/lang/mod/Mod.ts b/src/lang/mod/Mod.ts index 1fe00bda..49257748 100644 --- a/src/lang/mod/Mod.ts +++ b/src/lang/mod/Mod.ts @@ -1,11 +1,16 @@ -import type { Loader } from "../../loader" -import type { Ctx } from "../ctx" -import { ctxDeleteFirst, CtxFulfilled, CtxNull, ctxToEnv } from "../ctx" -import type { Env } from "../env" -import { useGlobals } from "../globals" -import { Solution, solutionCleanup } from "../solution" -import type { Stmt } from "../stmt" -import type { Value } from "../value" +import type { Loader } from "../../loader/index.js" +import type { Ctx } from "../ctx/index.js" +import { + ctxDeleteFirst, + CtxFulfilled, + CtxNull, + ctxToEnv, +} from "../ctx/index.js" +import type { Env } from "../env/index.js" +import { useGlobals } from "../globals/index.js" +import { Solution, solutionCleanup } from "../solution/index.js" +import type { Stmt } from "../stmt/index.js" +import type { Value } from "../value/index.js" export interface ModOptions { loader: Loader diff --git a/src/lang/mod/index.ts b/src/lang/mod/index.ts index 69d5b6bc..8ce4a08a 100644 --- a/src/lang/mod/index.ts +++ b/src/lang/mod/index.ts @@ -1 +1 @@ -export * from "./Mod" +export * from "./Mod.js" diff --git a/src/lang/neutral/Neutral.ts b/src/lang/neutral/Neutral.ts index 64a1b8b0..8fcddc95 100644 --- a/src/lang/neutral/Neutral.ts +++ b/src/lang/neutral/Neutral.ts @@ -1,4 +1,4 @@ -import type { TypedValue, Value } from "../value" +import type { TypedValue, Value } from "../value/index.js" export type Neutral = | Var diff --git a/src/lang/neutral/index.ts b/src/lang/neutral/index.ts index b54ff74a..8af48679 100644 --- a/src/lang/neutral/index.ts +++ b/src/lang/neutral/index.ts @@ -1 +1 @@ -export * from "./Neutral" +export * from "./Neutral.js" diff --git a/src/lang/readback/index.ts b/src/lang/readback/index.ts index a894f11f..3ae8d65b 100644 --- a/src/lang/readback/index.ts +++ b/src/lang/readback/index.ts @@ -1,7 +1,7 @@ -export * from "./readback" -export * from "./readbackByType" -export * from "./readbackByValue" -export * from "./readbackClazz" -export * from "./readbackNeutral" -export * from "./readbackProperties" -export * from "./readbackType" +export * from "./readback.js" +export * from "./readbackByType.js" +export * from "./readbackByValue.js" +export * from "./readbackClazz.js" +export * from "./readbackNeutral.js" +export * from "./readbackProperties.js" +export * from "./readbackType.js" diff --git a/src/lang/readback/readback.ts b/src/lang/readback/readback.ts index 4d2c5c1b..9f4059cd 100644 --- a/src/lang/readback/readback.ts +++ b/src/lang/readback/readback.ts @@ -1,9 +1,9 @@ -import type { Core } from "../core" -import type { Ctx } from "../ctx" -import type { Mod } from "../mod" -import { readbackByType, readbackByValue } from "../readback" -import { solutionAdvanceValue } from "../solution" -import type { Value } from "../value" +import type { Core } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import { readbackByType, readbackByValue } from "../readback/index.js" +import { solutionAdvanceValue } from "../solution/index.js" +import type { Value } from "../value/index.js" /** diff --git a/src/lang/readback/readbackByType.ts b/src/lang/readback/readbackByType.ts index dacff039..2c529d1c 100644 --- a/src/lang/readback/readbackByType.ts +++ b/src/lang/readback/readbackByType.ts @@ -1,9 +1,9 @@ -import type { Core } from "../core" -import * as Cores from "../core" -import type { Ctx } from "../ctx" -import type { Mod } from "../mod" -import { readbackType } from "../readback" -import type { Value } from "../value" +import type { Core } from "../core/index.js" +import * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import { readbackType } from "../readback/index.js" +import type { Value } from "../value/index.js" /** diff --git a/src/lang/readback/readbackByValue.ts b/src/lang/readback/readbackByValue.ts index 59e9ea55..57a80484 100644 --- a/src/lang/readback/readbackByValue.ts +++ b/src/lang/readback/readbackByValue.ts @@ -1,22 +1,22 @@ -import * as Actions from "../actions" -import { closureApply } from "../closure" -import type { Core } from "../core" -import * as Cores from "../core" -import type { Ctx } from "../ctx" -import { CtxCons, ctxNames } from "../ctx" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" +import * as Actions from "../actions/index.js" +import { closureApply } from "../closure/index.js" +import type { Core } from "../core/index.js" +import * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, ctxNames } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" import { readback, readbackNeutral, readbackProperties, readbackType, -} from "../readback" -import { solutionNames } from "../solution" -import { freshen } from "../utils/freshen" -import type { Value } from "../value" -import * as Values from "../value" +} from "../readback/index.js" +import { solutionNames } from "../solution/index.js" +import { freshen } from "../utils/freshen.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function readbackByValue( mod: Mod, diff --git a/src/lang/readback/readbackClazz.ts b/src/lang/readback/readbackClazz.ts index fdb9935f..2c016c20 100644 --- a/src/lang/readback/readbackClazz.ts +++ b/src/lang/readback/readbackClazz.ts @@ -1,12 +1,12 @@ -import * as Cores from "../core" -import type { Ctx } from "../ctx" -import { CtxCons, ctxNames } from "../ctx" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { readback, readbackType } from "../readback" -import { solutionNames } from "../solution" -import { freshen } from "../utils/freshen" -import * as Values from "../value" +import * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, ctxNames } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { readback, readbackType } from "../readback/index.js" +import { solutionNames } from "../solution/index.js" +import { freshen } from "../utils/freshen.js" +import * as Values from "../value/index.js" export function readbackClazz( mod: Mod, diff --git a/src/lang/readback/readbackNeutral.ts b/src/lang/readback/readbackNeutral.ts index 6829587e..f3e18ed6 100644 --- a/src/lang/readback/readbackNeutral.ts +++ b/src/lang/readback/readbackNeutral.ts @@ -1,9 +1,9 @@ -import type { Core } from "../core" -import * as Cores from "../core" -import type { Ctx } from "../ctx" -import type { Mod } from "../mod" -import type { Neutral } from "../neutral" -import { readback } from "../readback" +import type { Core } from "../core/index.js" +import * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import type { Neutral } from "../neutral/index.js" +import { readback } from "../readback/index.js" export function readbackNeutral(mod: Mod, ctx: Ctx, neutral: Neutral): Core { switch (neutral["@kind"]) { diff --git a/src/lang/readback/readbackProperties.ts b/src/lang/readback/readbackProperties.ts index 7d6596b1..f0ec89ee 100644 --- a/src/lang/readback/readbackProperties.ts +++ b/src/lang/readback/readbackProperties.ts @@ -1,10 +1,10 @@ -import * as Actions from "../actions" -import type * as Cores from "../core" -import type { Ctx } from "../ctx" -import type { Mod } from "../mod" -import { readback } from "../readback" -import type { Value } from "../value" -import * as Values from "../value" +import * as Actions from "../actions/index.js" +import type * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import { readback } from "../readback/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function readbackProperties( mod: Mod, diff --git a/src/lang/readback/readbackType.ts b/src/lang/readback/readbackType.ts index 04065bfe..718414bb 100644 --- a/src/lang/readback/readbackType.ts +++ b/src/lang/readback/readbackType.ts @@ -1,16 +1,16 @@ -import { closureApply } from "../closure" -import type { Core } from "../core" -import * as Cores from "../core" -import type { Ctx } from "../ctx" -import { CtxCons, ctxNames } from "../ctx" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { readback, readbackClazz, readbackNeutral } from "../readback" -import { solutionAdvanceValue, solutionNames } from "../solution" -import { freshen } from "../utils/freshen" -import type { Value } from "../value" -import * as Values from "../value" +import { closureApply } from "../closure/index.js" +import type { Core } from "../core/index.js" +import * as Cores from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, ctxNames } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { readback, readbackClazz, readbackNeutral } from "../readback/index.js" +import { solutionAdvanceValue, solutionNames } from "../solution/index.js" +import { freshen } from "../utils/freshen.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function readbackType(mod: Mod, ctx: Ctx, type: Value): Core { type = solutionAdvanceValue(mod, type) diff --git a/src/lang/solution/Solution.ts b/src/lang/solution/Solution.ts index f23130bc..540af253 100644 --- a/src/lang/solution/Solution.ts +++ b/src/lang/solution/Solution.ts @@ -1,4 +1,4 @@ -import type { Value } from "../value" +import type { Value } from "../value/index.js" export class Solution { bindings: Map = new Map() diff --git a/src/lang/solution/formatSolution.ts b/src/lang/solution/formatSolution.ts index fda79eb3..eb1ea914 100644 --- a/src/lang/solution/formatSolution.ts +++ b/src/lang/solution/formatSolution.ts @@ -1,9 +1,9 @@ -import { indent } from "../../utils/indent" -import type { Ctx } from "../ctx" -import { ctxLookupType } from "../ctx" -import type { Mod } from "../mod" -import type { Solution } from "../solution" -import * as Values from "../value" +import { indent } from "../../utils/indent.js" +import type { Ctx } from "../ctx/index.js" +import { ctxLookupType } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import type { Solution } from "../solution/index.js" +import * as Values from "../value/index.js" export function formatSolution( mod: Mod, diff --git a/src/lang/solution/index.ts b/src/lang/solution/index.ts index b1d3b868..bba9f517 100644 --- a/src/lang/solution/index.ts +++ b/src/lang/solution/index.ts @@ -1,8 +1,8 @@ -export * from "./Solution" -export * from "./formatSolution" -export * from "./solutionAdvanceValue" -export * from "./solutionBind" -export * from "./solutionCleanup" -export * from "./solutionLookupValue" -export * from "./solutionNames" -export * from "./solutionWalk" +export * from "./Solution.js" +export * from "./formatSolution.js" +export * from "./solutionAdvanceValue.js" +export * from "./solutionBind.js" +export * from "./solutionCleanup.js" +export * from "./solutionLookupValue.js" +export * from "./solutionNames.js" +export * from "./solutionWalk.js" diff --git a/src/lang/solution/solutionAdvanceValue.ts b/src/lang/solution/solutionAdvanceValue.ts index f5012146..cccf7997 100644 --- a/src/lang/solution/solutionAdvanceValue.ts +++ b/src/lang/solution/solutionAdvanceValue.ts @@ -1,9 +1,9 @@ -import * as Actions from "../actions" -import type { Mod } from "../mod" -import type { Neutral } from "../neutral" -import { solutionWalk } from "../solution" -import type { Value } from "../value" -import * as Values from "../value" +import * as Actions from "../actions/index.js" +import type { Mod } from "../mod/index.js" +import type { Neutral } from "../neutral/index.js" +import { solutionWalk } from "../solution/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function solutionAdvanceValue(mod: Mod, value: Value): Value { if (value["@kind"] === "TypedNeutral") { diff --git a/src/lang/solution/solutionBind.ts b/src/lang/solution/solutionBind.ts index 6d7e0d04..a768f6ad 100644 --- a/src/lang/solution/solutionBind.ts +++ b/src/lang/solution/solutionBind.ts @@ -1,5 +1,5 @@ -import type { Solution } from "../solution" -import type { Value } from "../value" +import type { Solution } from "../solution/index.js" +import type { Value } from "../value/index.js" export function solutionBind( solution: Solution, diff --git a/src/lang/solution/solutionCleanup.ts b/src/lang/solution/solutionCleanup.ts index 4ca5513d..ee9cba9f 100644 --- a/src/lang/solution/solutionCleanup.ts +++ b/src/lang/solution/solutionCleanup.ts @@ -1,4 +1,4 @@ -import type { Solution } from "../solution" +import type { Solution } from "../solution/index.js" export function solutionCleanup(solution: Solution): void { solution.bindings = new Map() diff --git a/src/lang/solution/solutionLookupValue.ts b/src/lang/solution/solutionLookupValue.ts index 216e687c..db42fb05 100644 --- a/src/lang/solution/solutionLookupValue.ts +++ b/src/lang/solution/solutionLookupValue.ts @@ -1,5 +1,5 @@ -import type { Solution } from "../solution" -import type { Value } from "../value" +import type { Solution } from "../solution/index.js" +import type { Value } from "../value/index.js" export function solutionLookupValue( solution: Solution, diff --git a/src/lang/solution/solutionNames.ts b/src/lang/solution/solutionNames.ts index 5b7cc254..4b00b639 100644 --- a/src/lang/solution/solutionNames.ts +++ b/src/lang/solution/solutionNames.ts @@ -1,4 +1,4 @@ -import type { Solution } from "../solution" +import type { Solution } from "../solution/index.js" export function solutionNames(solution: Solution): Array { return Array.from(solution.bindings.keys()) diff --git a/src/lang/solution/solutionWalk.ts b/src/lang/solution/solutionWalk.ts index 68d2d4ac..940c18a3 100644 --- a/src/lang/solution/solutionWalk.ts +++ b/src/lang/solution/solutionWalk.ts @@ -1,6 +1,6 @@ -import { Solution, solutionLookupValue } from "../solution" -import type { Value } from "../value" -import * as Values from "../value" +import { Solution, solutionLookupValue } from "../solution/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function solutionWalk(solution: Solution, value: Value): Value { while (Values.isPatternVar(value)) { diff --git a/src/lang/stmt/Stmt.ts b/src/lang/stmt/Stmt.ts index d9cb0610..37363a6f 100644 --- a/src/lang/stmt/Stmt.ts +++ b/src/lang/stmt/Stmt.ts @@ -1,5 +1,5 @@ -import type { Mod } from "../mod" -import type { Span } from "../span" +import type { Mod } from "../mod/index.js" +import type { Span } from "../span/index.js" /** diff --git a/src/lang/stmt/index.ts b/src/lang/stmt/index.ts index b071b5d6..b54cfa1f 100644 --- a/src/lang/stmt/index.ts +++ b/src/lang/stmt/index.ts @@ -1 +1 @@ -export * from "./Stmt" +export * from "./Stmt.js" diff --git a/src/lang/stmts/binding/Let.ts b/src/lang/stmts/binding/Let.ts index 772f20bc..c0b25f86 100644 --- a/src/lang/stmts/binding/Let.ts +++ b/src/lang/stmts/binding/Let.ts @@ -1,9 +1,9 @@ -import { evaluate } from "../../evaluate" -import type { Exp } from "../../exp" -import { infer } from "../../infer" -import type { Mod } from "../../mod" -import type { Span } from "../../span" -import { Stmt } from "../../stmt" +import { evaluate } from "../../evaluate/index.js" +import type { Exp } from "../../exp/index.js" +import { infer } from "../../infer/index.js" +import type { Mod } from "../../mod/index.js" +import type { Span } from "../../span/index.js" +import { Stmt } from "../../stmt/index.js" export class Let extends Stmt { constructor( diff --git a/src/lang/stmts/binding/LetThe.ts b/src/lang/stmts/binding/LetThe.ts index 261ed8a2..af3ca1b5 100644 --- a/src/lang/stmts/binding/LetThe.ts +++ b/src/lang/stmts/binding/LetThe.ts @@ -1,9 +1,9 @@ -import { check, checkType } from "../../check" -import { evaluate } from "../../evaluate" -import type { Exp } from "../../exp" -import type { Mod } from "../../mod" -import type { Span } from "../../span" -import { Stmt } from "../../stmt" +import { check, checkType } from "../../check/index.js" +import { evaluate } from "../../evaluate/index.js" +import type { Exp } from "../../exp/index.js" +import type { Mod } from "../../mod/index.js" +import type { Span } from "../../span/index.js" +import { Stmt } from "../../stmt/index.js" export class LetThe extends Stmt { constructor( diff --git a/src/lang/stmts/binding/index.ts b/src/lang/stmts/binding/index.ts index f8ca48df..66da9bb6 100644 --- a/src/lang/stmts/binding/index.ts +++ b/src/lang/stmts/binding/index.ts @@ -1,2 +1,2 @@ -export * from "./Let" -export * from "./LetThe" +export * from "./Let.js" +export * from "./LetThe.js" diff --git a/src/lang/stmts/clazz/Clazz.ts b/src/lang/stmts/clazz/Clazz.ts index 1b06f1f3..b1521f2f 100644 --- a/src/lang/stmts/clazz/Clazz.ts +++ b/src/lang/stmts/clazz/Clazz.ts @@ -1,9 +1,9 @@ -import { evaluate } from "../../evaluate" -import type * as Exps from "../../exp" -import { infer } from "../../infer" -import type { Mod } from "../../mod" -import type { Span } from "../../span" -import { Stmt } from "../../stmt" +import { evaluate } from "../../evaluate/index.js" +import type * as Exps from "../../exp/index.js" +import { infer } from "../../infer/index.js" +import type { Mod } from "../../mod/index.js" +import type { Span } from "../../span/index.js" +import { Stmt } from "../../stmt/index.js" export class Clazz extends Stmt { constructor( diff --git a/src/lang/stmts/clazz/ClazzExtends.ts b/src/lang/stmts/clazz/ClazzExtends.ts index b54e00c2..042b547c 100644 --- a/src/lang/stmts/clazz/ClazzExtends.ts +++ b/src/lang/stmts/clazz/ClazzExtends.ts @@ -1,13 +1,13 @@ -import * as Cores from "../../core" -import { evaluate } from "../../evaluate" -import type { Exp } from "../../exp" -import * as Exps from "../../exp" -import { infer } from "../../infer" -import type { Mod } from "../../mod" -import { readbackClazz } from "../../readback" -import type { Span } from "../../span" -import { Stmt } from "../../stmt" -import * as Values from "../../value" +import * as Cores from "../../core/index.js" +import { evaluate } from "../../evaluate/index.js" +import type { Exp } from "../../exp/index.js" +import * as Exps from "../../exp/index.js" +import { infer } from "../../infer/index.js" +import type { Mod } from "../../mod/index.js" +import { readbackClazz } from "../../readback/index.js" +import type { Span } from "../../span/index.js" +import { Stmt } from "../../stmt/index.js" +import * as Values from "../../value/index.js" export class ClazzExtends extends Stmt { constructor( diff --git a/src/lang/stmts/clazz/index.ts b/src/lang/stmts/clazz/index.ts index 41609256..593cbe10 100644 --- a/src/lang/stmts/clazz/index.ts +++ b/src/lang/stmts/clazz/index.ts @@ -1,2 +1,2 @@ -export * from "./Clazz" -export * from "./ClazzExtends" +export * from "./Clazz.js" +export * from "./ClazzExtends.js" diff --git a/src/lang/stmts/import/Import.ts b/src/lang/stmts/import/Import.ts index 735ef266..d0c18636 100644 --- a/src/lang/stmts/import/Import.ts +++ b/src/lang/stmts/import/Import.ts @@ -1,11 +1,11 @@ -import { ctxLookupType } from "../../ctx" -import { envLookupValue } from "../../env" -import * as Errors from "../../errors" -import type { Mod } from "../../mod" -import type { Span } from "../../span" -import { Stmt } from "../../stmt" -import type { ImportBinding } from "../import" -import { defineBinding, undoBinding } from "../import" +import { ctxLookupType } from "../../ctx/index.js" +import { envLookupValue } from "../../env/index.js" +import * as Errors from "../../errors/index.js" +import type { Mod } from "../../mod/index.js" +import type { Span } from "../../span/index.js" +import { Stmt } from "../../stmt/index.js" +import type { ImportBinding } from "../import/index.js" +import { defineBinding, undoBinding } from "../import/index.js" export class Import extends Stmt { constructor( diff --git a/src/lang/stmts/import/defineBinding.ts b/src/lang/stmts/import/defineBinding.ts index ce4e381b..37893071 100644 --- a/src/lang/stmts/import/defineBinding.ts +++ b/src/lang/stmts/import/defineBinding.ts @@ -1,6 +1,6 @@ -import type { Mod } from "../../mod" -import type { Value } from "../../value" -import type { ImportBinding } from "../import" +import type { Mod } from "../../mod/index.js" +import type { Value } from "../../value/index.js" +import type { ImportBinding } from "../import/index.js" export function defineBinding( mod: Mod, diff --git a/src/lang/stmts/import/index.ts b/src/lang/stmts/import/index.ts index 745fa913..65aa5964 100644 --- a/src/lang/stmts/import/index.ts +++ b/src/lang/stmts/import/index.ts @@ -1,4 +1,4 @@ -export * from "./Import" -export * from "./ImportBinding" -export * from "./defineBinding" -export * from "./undoBinding" +export * from "./Import.js" +export * from "./ImportBinding.js" +export * from "./defineBinding.js" +export * from "./undoBinding.js" diff --git a/src/lang/stmts/import/undoBinding.ts b/src/lang/stmts/import/undoBinding.ts index 1afda2d8..6144fc8c 100644 --- a/src/lang/stmts/import/undoBinding.ts +++ b/src/lang/stmts/import/undoBinding.ts @@ -1,5 +1,5 @@ -import type { Mod } from "../../mod" -import type { ImportBinding } from "../import" +import type { Mod } from "../../mod/index.js" +import type { ImportBinding } from "../import/index.js" export function undoBinding(mod: Mod, binding: ImportBinding): void { switch (binding["@kind"]) { diff --git a/src/lang/stmts/index.ts b/src/lang/stmts/index.ts index 04a70e47..49ebdb00 100644 --- a/src/lang/stmts/index.ts +++ b/src/lang/stmts/index.ts @@ -1,5 +1,5 @@ -export * from "./binding" -export * from "./clazz" -export * from "./import" -export * from "./solve" -export * from "./testing" +export * from "./binding/index.js" +export * from "./clazz/index.js" +export * from "./import/index.js" +export * from "./solve/index.js" +export * from "./testing/index.js" diff --git a/src/lang/stmts/solve/Equation.ts b/src/lang/stmts/solve/Equation.ts index a2f8fcff..6e4fc6a7 100644 --- a/src/lang/stmts/solve/Equation.ts +++ b/src/lang/stmts/solve/Equation.ts @@ -1,5 +1,5 @@ -import type { Exp } from "../../exp" -import type { Span } from "../../span" +import type { Exp } from "../../exp/index.js" +import type { Span } from "../../span/index.js" export type Equation = EquationUnifyTyped | EquationUnify diff --git a/src/lang/stmts/solve/Solve.ts b/src/lang/stmts/solve/Solve.ts index 7a0d5ed2..5bf9bd57 100644 --- a/src/lang/stmts/solve/Solve.ts +++ b/src/lang/stmts/solve/Solve.ts @@ -1,14 +1,13 @@ -import { checkType } from "../../check" -import { CtxFulfilled, ctxToEnv } from "../../ctx" -import * as Errors from "../../errors" -import { evaluate } from "../../evaluate" -import type { Mod } from "../../mod" -import { formatSolution } from "../../solution" -import type { Span } from "../../span" -import { Stmt } from "../../stmt" -import * as Values from "../../value" - -import { Equation, SolveBinding, unifyEquation } from "../solve" +import { checkType } from "../../check/index.js" +import { CtxFulfilled, ctxToEnv } from "../../ctx/index.js" +import * as Errors from "../../errors/index.js" +import { evaluate } from "../../evaluate/index.js" +import type { Mod } from "../../mod/index.js" +import { formatSolution } from "../../solution/index.js" +import type { Span } from "../../span/index.js" +import { Stmt } from "../../stmt/index.js" +import * as Values from "../../value/index.js" +import { type Equation, SolveBinding, unifyEquation } from "../solve/index.js" export class Solve extends Stmt { constructor( diff --git a/src/lang/stmts/solve/SolveBinding.ts b/src/lang/stmts/solve/SolveBinding.ts index fb903ff6..a8d10233 100644 --- a/src/lang/stmts/solve/SolveBinding.ts +++ b/src/lang/stmts/solve/SolveBinding.ts @@ -1,4 +1,4 @@ -import type { Exp } from "../../exp" +import type { Exp } from "../../exp/index.js" export type SolveBinding = { name: string diff --git a/src/lang/stmts/solve/index.ts b/src/lang/stmts/solve/index.ts index 01a8722f..9c634dcf 100644 --- a/src/lang/stmts/solve/index.ts +++ b/src/lang/stmts/solve/index.ts @@ -1,4 +1,4 @@ -export * from "./Equation" -export * from "./Solve" -export * from "./SolveBinding" -export * from "./unifyEquation" +export * from "./Equation.js" +export * from "./Solve.js" +export * from "./SolveBinding.js" +export * from "./unifyEquation.js" diff --git a/src/lang/stmts/solve/unifyEquation.ts b/src/lang/stmts/solve/unifyEquation.ts index 0c5dcb2d..c1d43898 100644 --- a/src/lang/stmts/solve/unifyEquation.ts +++ b/src/lang/stmts/solve/unifyEquation.ts @@ -1,11 +1,11 @@ -import type { Mod } from "src/lang/mod" -import { check, checkType } from "../../check" -import type { Ctx } from "../../ctx" -import { ctxToEnv } from "../../ctx" -import { evaluate } from "../../evaluate" -import { infer, inferOrUndefined } from "../../infer" -import { unify, unifyType } from "../../unify" -import type { Equation } from "../solve" +import { check, checkType } from "../../check/index.js" +import type { Ctx } from "../../ctx/index.js" +import { ctxToEnv } from "../../ctx/index.js" +import { evaluate } from "../../evaluate/index.js" +import { infer, inferOrUndefined } from "../../infer/index.js" +import type { Mod } from "../../mod/index.js" +import { unify, unifyType } from "../../unify/index.js" +import type { Equation } from "../solve/index.js" export function unifyEquation(mod: Mod, ctx: Ctx, equation: Equation): void { switch (equation["@kind"]) { diff --git a/src/lang/stmts/testing/Check.ts b/src/lang/stmts/testing/Check.ts index 3c22084b..b2e2b246 100644 --- a/src/lang/stmts/testing/Check.ts +++ b/src/lang/stmts/testing/Check.ts @@ -1,9 +1,9 @@ -import { check, checkType } from "../../check" -import { evaluate } from "../../evaluate" -import type { Exp } from "../../exp" -import type { Mod } from "../../mod" -import type { Span } from "../../span" -import { Stmt } from "../../stmt" +import { check, checkType } from "../../check/index.js" +import { evaluate } from "../../evaluate/index.js" +import type { Exp } from "../../exp/index.js" +import type { Mod } from "../../mod/index.js" +import type { Span } from "../../span/index.js" +import { Stmt } from "../../stmt/index.js" export class Check extends Stmt { constructor( diff --git a/src/lang/stmts/testing/Compute.ts b/src/lang/stmts/testing/Compute.ts index 223d8383..63ed6533 100644 --- a/src/lang/stmts/testing/Compute.ts +++ b/src/lang/stmts/testing/Compute.ts @@ -1,10 +1,10 @@ -import { evaluate } from "../../evaluate" -import type { Exp } from "../../exp" -import { infer } from "../../infer" -import type { Mod } from "../../mod" -import type { Span } from "../../span" -import { Stmt } from "../../stmt" -import { formatTypedValue, TypedValue } from "../../value" +import { evaluate } from "../../evaluate/index.js" +import type { Exp } from "../../exp/index.js" +import { infer } from "../../infer/index.js" +import type { Mod } from "../../mod/index.js" +import type { Span } from "../../span/index.js" +import { Stmt } from "../../stmt/index.js" +import { formatTypedValue, TypedValue } from "../../value/index.js" export class Compute extends Stmt { constructor( diff --git a/src/lang/stmts/testing/Include.ts b/src/lang/stmts/testing/Include.ts index a26844c8..e575522a 100644 --- a/src/lang/stmts/testing/Include.ts +++ b/src/lang/stmts/testing/Include.ts @@ -1,10 +1,10 @@ -import { checkType } from "../../check" -import { evaluate } from "../../evaluate" -import type { Exp } from "../../exp" -import { include } from "../../include" -import type { Mod } from "../../mod" -import type { Span } from "../../span" -import { Stmt } from "../../stmt" +import { checkType } from "../../check/index.js" +import { evaluate } from "../../evaluate/index.js" +import type { Exp } from "../../exp/index.js" +import { include } from "../../include/index.js" +import type { Mod } from "../../mod/index.js" +import type { Span } from "../../span/index.js" +import { Stmt } from "../../stmt/index.js" export class Include extends Stmt { constructor( diff --git a/src/lang/stmts/testing/index.ts b/src/lang/stmts/testing/index.ts index 664fd8cc..3f68efa7 100644 --- a/src/lang/stmts/testing/index.ts +++ b/src/lang/stmts/testing/index.ts @@ -1,3 +1,3 @@ -export * from "./Check" -export * from "./Compute" -export * from "./Include" +export * from "./Check.js" +export * from "./Compute.js" +export * from "./Include.js" diff --git a/src/lang/syntax/grammars/index.ts b/src/lang/syntax/grammars/index.ts index a7a5d0c6..4ad6f863 100644 --- a/src/lang/syntax/grammars/index.ts +++ b/src/lang/syntax/grammars/index.ts @@ -4,18 +4,18 @@ export const zero_or_more = pt.grammars.zero_or_more export const one_or_more = pt.grammars.one_or_more export const optional = pt.grammars.optional -export * from "./arg" -export * from "./clazz_binding" -export * from "./equation" -export * from "./equivalent_entry" -export * from "./exp" -export * from "./fn_binding" -export * from "./import_binding" -export * from "./key" -export * from "./name" -export * from "./pi_binding" -export * from "./property" -export * from "./sequence" -export * from "./sigma_binding" -export * from "./solve_binding" -export * from "./stmt" +export * from "./arg.js" +export * from "./clazz_binding.js" +export * from "./equation.js" +export * from "./equivalent_entry.js" +export * from "./exp.js" +export * from "./fn_binding.js" +export * from "./import_binding.js" +export * from "./key.js" +export * from "./name.js" +export * from "./pi_binding.js" +export * from "./property.js" +export * from "./sequence.js" +export * from "./sigma_binding.js" +export * from "./solve_binding.js" +export * from "./stmt.js" diff --git a/src/lang/syntax/index.ts b/src/lang/syntax/index.ts index a02bfd50..12a89cb1 100644 --- a/src/lang/syntax/index.ts +++ b/src/lang/syntax/index.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as grammars from "./grammars" -import * as matchers from "./matchers" +import * as grammars from "./grammars/index.js" +import * as matchers from "./matchers/index.js" /** diff --git a/src/lang/syntax/matchers/arg_matcher.ts b/src/lang/syntax/matchers/arg_matcher.ts index f5cc8a07..6801600f 100644 --- a/src/lang/syntax/matchers/arg_matcher.ts +++ b/src/lang/syntax/matchers/arg_matcher.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import * as Exps from "../../exp" +import * as matchers from "./index.js" +import * as Exps from "../../exp/index.js" export function arg_matcher(tree: pt.Tree): Exps.Arg { return pt.matcher({ diff --git a/src/lang/syntax/matchers/clazz_binding_matcher.ts b/src/lang/syntax/matchers/clazz_binding_matcher.ts index 4ce9d885..e2bd06d1 100644 --- a/src/lang/syntax/matchers/clazz_binding_matcher.ts +++ b/src/lang/syntax/matchers/clazz_binding_matcher.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import * as Exps from "../../exp" +import * as matchers from "./index.js" +import * as Exps from "../../exp/index.js" export function clazz_binding_matcher(tree: pt.Tree): Exps.ClazzBinding { return pt.matcher({ diff --git a/src/lang/syntax/matchers/equation_matcher.ts b/src/lang/syntax/matchers/equation_matcher.ts index 93517cfd..d3f5a576 100644 --- a/src/lang/syntax/matchers/equation_matcher.ts +++ b/src/lang/syntax/matchers/equation_matcher.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import * as Stmts from "../../stmts" +import * as matchers from "./index.js" +import * as Stmts from "../../stmts/index.js" export function equation_matcher(tree: pt.Tree): Stmts.Equation { return pt.matcher({ diff --git a/src/lang/syntax/matchers/equivalent_entry_matcher.ts b/src/lang/syntax/matchers/equivalent_entry_matcher.ts index 4acdfc9c..53e8c924 100644 --- a/src/lang/syntax/matchers/equivalent_entry_matcher.ts +++ b/src/lang/syntax/matchers/equivalent_entry_matcher.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import type * as Macros from "../../macros" +import * as matchers from "./index.js" +import type * as Macros from "../../macros/index.js" export function equivalent_entry_matcher( tree: pt.Tree, diff --git a/src/lang/syntax/matchers/exp_matcher.ts b/src/lang/syntax/matchers/exp_matcher.ts index 9f4569f4..e6010664 100644 --- a/src/lang/syntax/matchers/exp_matcher.ts +++ b/src/lang/syntax/matchers/exp_matcher.ts @@ -1,8 +1,8 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import type { Exp } from "../../exp" -import * as Exps from "../../exp" -import * as Macros from "../../macros" +import * as matchers from "./index.js" +import type { Exp } from "../../exp/index.js" +import * as Exps from "../../exp/index.js" +import * as Macros from "../../macros/index.js" export function exp_matcher(tree: pt.Tree): Exp { return pt.matcher({ diff --git a/src/lang/syntax/matchers/fn_binding_matcher.ts b/src/lang/syntax/matchers/fn_binding_matcher.ts index 1da301df..898a1e64 100644 --- a/src/lang/syntax/matchers/fn_binding_matcher.ts +++ b/src/lang/syntax/matchers/fn_binding_matcher.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import * as Exps from "../../exp" +import * as matchers from "./index.js" +import * as Exps from "../../exp/index.js" export function fn_binding_matcher(tree: pt.Tree): Exps.FnBinding { return pt.matcher({ diff --git a/src/lang/syntax/matchers/import_binding_matcher.ts b/src/lang/syntax/matchers/import_binding_matcher.ts index f11a76cd..acbfcb6d 100644 --- a/src/lang/syntax/matchers/import_binding_matcher.ts +++ b/src/lang/syntax/matchers/import_binding_matcher.ts @@ -1,5 +1,5 @@ import * as pt from "@cicada-lang/partech" -import * as Stmts from "../../stmts" +import * as Stmts from "../../stmts/index.js" export function import_binding_matcher(tree: pt.Tree): Stmts.ImportBinding { return pt.matcher({ diff --git a/src/lang/syntax/matchers/index.ts b/src/lang/syntax/matchers/index.ts index a3154b1c..1f7133f2 100644 --- a/src/lang/syntax/matchers/index.ts +++ b/src/lang/syntax/matchers/index.ts @@ -1,15 +1,15 @@ -export * from "./arg_matcher" -export * from "./clazz_binding_matcher" -export * from "./equation_matcher" -export * from "./equivalent_entry_matcher" -export * from "./exp_matcher" -export * from "./fn_binding_matcher" -export * from "./import_binding_matcher" -export * from "./key_matcher" -export * from "./pi_binding_matcher" -export * from "./property_matcher" -export * from "./sequence_matcher" -export * from "./sigma_binding_matcher" -export * from "./solve_binding_matcher" -export * from "./stmt_matcher" -export * from "./utils" +export * from "./arg_matcher.js" +export * from "./clazz_binding_matcher.js" +export * from "./equation_matcher.js" +export * from "./equivalent_entry_matcher.js" +export * from "./exp_matcher.js" +export * from "./fn_binding_matcher.js" +export * from "./import_binding_matcher.js" +export * from "./key_matcher.js" +export * from "./pi_binding_matcher.js" +export * from "./property_matcher.js" +export * from "./sequence_matcher.js" +export * from "./sigma_binding_matcher.js" +export * from "./solve_binding_matcher.js" +export * from "./stmt_matcher.js" +export * from "./utils.js" diff --git a/src/lang/syntax/matchers/pi_binding_matcher.ts b/src/lang/syntax/matchers/pi_binding_matcher.ts index 3e2c7663..67c6e967 100644 --- a/src/lang/syntax/matchers/pi_binding_matcher.ts +++ b/src/lang/syntax/matchers/pi_binding_matcher.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import * as Exps from "../../exp" +import * as matchers from "./index.js" +import * as Exps from "../../exp/index.js" export function pi_binding_matcher(tree: pt.Tree): Exps.PiBinding { return pt.matcher({ diff --git a/src/lang/syntax/matchers/property_matcher.ts b/src/lang/syntax/matchers/property_matcher.ts index fe8915ec..f64a50fd 100644 --- a/src/lang/syntax/matchers/property_matcher.ts +++ b/src/lang/syntax/matchers/property_matcher.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import * as Exps from "../../exp" +import * as matchers from "./index.js" +import * as Exps from "../../exp/index.js" export function property_matcher(tree: pt.Tree): Exps.Property { return pt.matcher({ diff --git a/src/lang/syntax/matchers/sequence_matcher.ts b/src/lang/syntax/matchers/sequence_matcher.ts index e65cd620..b7478a8b 100644 --- a/src/lang/syntax/matchers/sequence_matcher.ts +++ b/src/lang/syntax/matchers/sequence_matcher.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import * as Exps from "../../exp" +import * as matchers from "./index.js" +import * as Exps from "../../exp/index.js" export function sequence_matcher(tree: pt.Tree): Exps.SequenceUnfolded { return pt.matcher({ diff --git a/src/lang/syntax/matchers/sigma_binding_matcher.ts b/src/lang/syntax/matchers/sigma_binding_matcher.ts index 3f99df03..c26cbf5b 100644 --- a/src/lang/syntax/matchers/sigma_binding_matcher.ts +++ b/src/lang/syntax/matchers/sigma_binding_matcher.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import * as Exps from "../../exp" +import * as matchers from "./index.js" +import * as Exps from "../../exp/index.js" export function sigma_binding_matcher(tree: pt.Tree): Exps.SigmaBinding { return pt.matcher({ diff --git a/src/lang/syntax/matchers/solve_binding_matcher.ts b/src/lang/syntax/matchers/solve_binding_matcher.ts index 3c097f5a..fc875254 100644 --- a/src/lang/syntax/matchers/solve_binding_matcher.ts +++ b/src/lang/syntax/matchers/solve_binding_matcher.ts @@ -1,6 +1,6 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import type * as Stmts from "../../stmts" +import * as matchers from "./index.js" +import type * as Stmts from "../../stmts/index.js" export function solve_binding_matcher(tree: pt.Tree): Stmts.SolveBinding { return pt.matcher({ diff --git a/src/lang/syntax/matchers/stmt_matcher.ts b/src/lang/syntax/matchers/stmt_matcher.ts index 8e194827..ef3fba29 100644 --- a/src/lang/syntax/matchers/stmt_matcher.ts +++ b/src/lang/syntax/matchers/stmt_matcher.ts @@ -1,8 +1,8 @@ import * as pt from "@cicada-lang/partech" -import * as matchers from "." -import * as Exps from "../../exp" -import type { Stmt } from "../../stmt" -import * as Stmts from "../../stmts" +import * as matchers from "./index.js" +import * as Exps from "../../exp/index.js" +import type { Stmt } from "../../stmt/index.js" +import * as Stmts from "../../stmts/index.js" export function stmt_matcher(tree: pt.Tree): Stmt { return pt.matcher({ diff --git a/src/lang/syntax/matchers/utils.ts b/src/lang/syntax/matchers/utils.ts index e90128be..49c5e309 100644 --- a/src/lang/syntax/matchers/utils.ts +++ b/src/lang/syntax/matchers/utils.ts @@ -1,4 +1,4 @@ -import * as Exps from "../../exp" +import * as Exps from "../../exp/index.js" export function piBindingtoFnBindingFrom( binding: Exps.PiBinding, diff --git a/src/lang/syntax/tests/exps/ap-implicit.test.ts b/src/lang/syntax/tests/exps/ap-implicit.test.ts index b723a393..eed4190a 100644 --- a/src/lang/syntax/tests/exps/ap-implicit.test.ts +++ b/src/lang/syntax/tests/exps/ap-implicit.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse ApImplicit", () => { expect(parseExp("f(implicit x)")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/ap.test.ts b/src/lang/syntax/tests/exps/ap.test.ts index a3525fe3..051f6997 100644 --- a/src/lang/syntax/tests/exps/ap.test.ts +++ b/src/lang/syntax/tests/exps/ap.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Ap", () => { expect(parseExp("f(x)")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/clazz-json.test.ts b/src/lang/syntax/tests/exps/clazz-json.test.ts index 5644f409..95d185b4 100644 --- a/src/lang/syntax/tests/exps/clazz-json.test.ts +++ b/src/lang/syntax/tests/exps/clazz-json.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Clazz -- JSON", () => { expect(parseExp('class { "Hello, World!": String }')).toMatchObject( diff --git a/src/lang/syntax/tests/exps/clazz.test.ts b/src/lang/syntax/tests/exps/clazz.test.ts index 29508bf0..19468bbf 100644 --- a/src/lang/syntax/tests/exps/clazz.test.ts +++ b/src/lang/syntax/tests/exps/clazz.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Clazz", () => { expect(parseExp("class { T: Type, x: T }")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/dot-json.test.ts b/src/lang/syntax/tests/exps/dot-json.test.ts index f4c58c32..8aa8b126 100644 --- a/src/lang/syntax/tests/exps/dot-json.test.ts +++ b/src/lang/syntax/tests/exps/dot-json.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Dot", () => { expect(parseExp('object["Hello, World!"]')).toMatchObject( diff --git a/src/lang/syntax/tests/exps/dot.test.ts b/src/lang/syntax/tests/exps/dot.test.ts index 408d41b8..9e56c89b 100644 --- a/src/lang/syntax/tests/exps/dot.test.ts +++ b/src/lang/syntax/tests/exps/dot.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Dot", () => { expect(parseExp("object.x")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/fn-annotated.test.ts b/src/lang/syntax/tests/exps/fn-annotated.test.ts index 011f4821..8c795cb2 100644 --- a/src/lang/syntax/tests/exps/fn-annotated.test.ts +++ b/src/lang/syntax/tests/exps/fn-annotated.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Fn -- annotated", () => { expect(parseExp("(x: Type, y: Type) => x")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/fn-implicit.test.ts b/src/lang/syntax/tests/exps/fn-implicit.test.ts index 55302eb8..c7ea8faa 100644 --- a/src/lang/syntax/tests/exps/fn-implicit.test.ts +++ b/src/lang/syntax/tests/exps/fn-implicit.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Fn -- implicit", () => { expect(parseExp("(implicit x) => x")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/fn-with-return-type.test.ts b/src/lang/syntax/tests/exps/fn-with-return-type.test.ts index 53af22db..3012e133 100644 --- a/src/lang/syntax/tests/exps/fn-with-return-type.test.ts +++ b/src/lang/syntax/tests/exps/fn-with-return-type.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Fn -- with return type", () => { expect(parseExp("function (x: String): String { return x }")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/fn.test.ts b/src/lang/syntax/tests/exps/fn.test.ts index c6ba040a..30f50ba6 100644 --- a/src/lang/syntax/tests/exps/fn.test.ts +++ b/src/lang/syntax/tests/exps/fn.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Fn", () => { expect(parseExp("(x) => x")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/objekt-json.test.ts b/src/lang/syntax/tests/exps/objekt-json.test.ts index ea8a0d26..85be3a0c 100644 --- a/src/lang/syntax/tests/exps/objekt-json.test.ts +++ b/src/lang/syntax/tests/exps/objekt-json.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Objekt -- JSON", () => { expect(parseExp('{ "Hello, World!": "Hi!" }')).toMatchObject( diff --git a/src/lang/syntax/tests/exps/objekt-spread.test.ts b/src/lang/syntax/tests/exps/objekt-spread.test.ts index fa97310e..3ca15dd7 100644 --- a/src/lang/syntax/tests/exps/objekt-spread.test.ts +++ b/src/lang/syntax/tests/exps/objekt-spread.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Objekt -- spread", () => { expect(parseExp("{ a, ...b }")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/objekt.test.ts b/src/lang/syntax/tests/exps/objekt.test.ts index 9e194d83..10305aa0 100644 --- a/src/lang/syntax/tests/exps/objekt.test.ts +++ b/src/lang/syntax/tests/exps/objekt.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Objekt", () => { expect(parseExp("{ T: Type, x: T }")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/pi-implicit.test.ts b/src/lang/syntax/tests/exps/pi-implicit.test.ts index 8d1badf8..6e41616c 100644 --- a/src/lang/syntax/tests/exps/pi-implicit.test.ts +++ b/src/lang/syntax/tests/exps/pi-implicit.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse PiImplicit", () => { expect(parseExp("(implicit T: Type, x: T) -> Type")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/pi.test.ts b/src/lang/syntax/tests/exps/pi.test.ts index 67ec0da4..9b637061 100644 --- a/src/lang/syntax/tests/exps/pi.test.ts +++ b/src/lang/syntax/tests/exps/pi.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Pi", () => { expect(parseExp("(n: Nat) -> Nat")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/quote.test.ts b/src/lang/syntax/tests/exps/quote.test.ts index e1fa3229..0c975b54 100644 --- a/src/lang/syntax/tests/exps/quote.test.ts +++ b/src/lang/syntax/tests/exps/quote.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Quote", () => { expect(parseExp('"abc"')).toMatchObject(deleteUndefined(Exps.Quote("abc"))) diff --git a/src/lang/syntax/tests/exps/sequence.test.ts b/src/lang/syntax/tests/exps/sequence.test.ts index 76080cfa..8e4fca0c 100644 --- a/src/lang/syntax/tests/exps/sequence.test.ts +++ b/src/lang/syntax/tests/exps/sequence.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Sequence", () => { expect( diff --git a/src/lang/syntax/tests/exps/sigma.test.ts b/src/lang/syntax/tests/exps/sigma.test.ts index ad5e7eab..bbbd2cd6 100644 --- a/src/lang/syntax/tests/exps/sigma.test.ts +++ b/src/lang/syntax/tests/exps/sigma.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Sigma", () => { expect(parseExp("exists (n: Nat) Nat")).toMatchObject( diff --git a/src/lang/syntax/tests/exps/var.test.ts b/src/lang/syntax/tests/exps/var.test.ts index 4c693379..01960fa3 100644 --- a/src/lang/syntax/tests/exps/var.test.ts +++ b/src/lang/syntax/tests/exps/var.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import { parseExp } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import { parseExp } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Var", () => { expect(parseExp("x")).toMatchObject(deleteUndefined(Exps.Var("x"))) diff --git a/src/lang/syntax/tests/stmts/check.test.ts b/src/lang/syntax/tests/stmts/check.test.ts index 4e36b8e5..c693d14a 100644 --- a/src/lang/syntax/tests/stmts/check.test.ts +++ b/src/lang/syntax/tests/stmts/check.test.ts @@ -1,8 +1,8 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import * as Stmts from "../../../stmts" -import { parseStmts } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import * as Stmts from "../../../stmts/index.js" +import { parseStmts } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Check", () => { expect(parseStmts("check t: Type")).toMatchObject( diff --git a/src/lang/syntax/tests/stmts/clazz.test.ts b/src/lang/syntax/tests/stmts/clazz.test.ts index f77131b0..856d9b6f 100644 --- a/src/lang/syntax/tests/stmts/clazz.test.ts +++ b/src/lang/syntax/tests/stmts/clazz.test.ts @@ -1,8 +1,8 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import * as Stmts from "../../../stmts" -import { parseStmts } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import * as Stmts from "../../../stmts/index.js" +import { parseStmts } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Clazz", () => { expect( diff --git a/src/lang/syntax/tests/stmts/function-with-implicit.test.ts b/src/lang/syntax/tests/stmts/function-with-implicit.test.ts index d3439ca5..97924b54 100644 --- a/src/lang/syntax/tests/stmts/function-with-implicit.test.ts +++ b/src/lang/syntax/tests/stmts/function-with-implicit.test.ts @@ -1,8 +1,8 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import * as Stmts from "../../../stmts" -import { parseStmts } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import * as Stmts from "../../../stmts/index.js" +import { parseStmts } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Let -- function with implicit", () => { expect( diff --git a/src/lang/syntax/tests/stmts/function-with-return-type.test.ts b/src/lang/syntax/tests/stmts/function-with-return-type.test.ts index ca9effd6..dc53255d 100644 --- a/src/lang/syntax/tests/stmts/function-with-return-type.test.ts +++ b/src/lang/syntax/tests/stmts/function-with-return-type.test.ts @@ -1,8 +1,8 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import * as Stmts from "../../../stmts" -import { parseStmts } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import * as Stmts from "../../../stmts/index.js" +import { parseStmts } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Let -- function with return type", () => { expect( diff --git a/src/lang/syntax/tests/stmts/function.test.ts b/src/lang/syntax/tests/stmts/function.test.ts index 0f682828..62b3b1d2 100644 --- a/src/lang/syntax/tests/stmts/function.test.ts +++ b/src/lang/syntax/tests/stmts/function.test.ts @@ -1,8 +1,8 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import * as Stmts from "../../../stmts" -import { parseStmts } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import * as Stmts from "../../../stmts/index.js" +import { parseStmts } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Let -- function", () => { expect(parseStmts("function id(T: Type, x: T) { return x }")).toMatchObject( diff --git a/src/lang/syntax/tests/stmts/import.test.ts b/src/lang/syntax/tests/stmts/import.test.ts index b0c78d76..952e05f1 100644 --- a/src/lang/syntax/tests/stmts/import.test.ts +++ b/src/lang/syntax/tests/stmts/import.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "vitest" -import * as Stmts from "../../../stmts" -import { parseStmts } from "../../index" -import { deleteUndefined } from "../utils" +import * as Stmts from "../../../stmts/index.js" +import { parseStmts } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Import", () => { expect(parseStmts('import { a, b, c } from "./abc.cic"')).toMatchObject( diff --git a/src/lang/syntax/tests/stmts/inclusion.test.ts b/src/lang/syntax/tests/stmts/inclusion.test.ts index eb2607fa..16aee5aa 100644 --- a/src/lang/syntax/tests/stmts/inclusion.test.ts +++ b/src/lang/syntax/tests/stmts/inclusion.test.ts @@ -1,8 +1,8 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import * as Stmts from "../../../stmts" -import { parseStmts } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import * as Stmts from "../../../stmts/index.js" +import { parseStmts } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Inclusion", () => { expect( diff --git a/src/lang/syntax/tests/stmts/let.test.ts b/src/lang/syntax/tests/stmts/let.test.ts index e41bf1b8..c046d1df 100644 --- a/src/lang/syntax/tests/stmts/let.test.ts +++ b/src/lang/syntax/tests/stmts/let.test.ts @@ -1,8 +1,8 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import * as Stmts from "../../../stmts" -import { parseStmts } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import * as Stmts from "../../../stmts/index.js" +import { parseStmts } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Let", () => { expect(parseStmts("let U = Type")).toMatchObject( diff --git a/src/lang/syntax/tests/stmts/solve.test.ts b/src/lang/syntax/tests/stmts/solve.test.ts index 737a105f..b458775b 100644 --- a/src/lang/syntax/tests/stmts/solve.test.ts +++ b/src/lang/syntax/tests/stmts/solve.test.ts @@ -1,8 +1,8 @@ import { expect, test } from "vitest" -import * as Exps from "../../../exp" -import * as Stmts from "../../../stmts" -import { parseStmts } from "../../index" -import { deleteUndefined } from "../utils" +import * as Exps from "../../../exp/index.js" +import * as Stmts from "../../../stmts/index.js" +import { parseStmts } from "../../index.js" +import { deleteUndefined } from "../utils.js" test("parse Solve", () => { expect( diff --git a/src/lang/tests/check/check-ap-implicit-insertion.test.ts b/src/lang/tests/check/check-ap-implicit-insertion.test.ts index 64957625..7547b05c 100644 --- a/src/lang/tests/check/check-ap-implicit-insertion.test.ts +++ b/src/lang/tests/check/check-ap-implicit-insertion.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check ApImplicit -- insertion -- id", async () => { await runCode(` diff --git a/src/lang/tests/check/check-ap.test.ts b/src/lang/tests/check/check-ap.test.ts index 697ee232..f23e4240 100644 --- a/src/lang/tests/check/check-ap.test.ts +++ b/src/lang/tests/check/check-ap.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("check Ap", async () => { await runCode(` diff --git a/src/lang/tests/check/check-car.test.ts b/src/lang/tests/check/check-car.test.ts index 32863daf..b825e9f0 100644 --- a/src/lang/tests/check/check-car.test.ts +++ b/src/lang/tests/check/check-car.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Car", async () => { await runCode(` diff --git a/src/lang/tests/check/check-cdr.test.ts b/src/lang/tests/check/check-cdr.test.ts index a71ec80b..ac00194d 100644 --- a/src/lang/tests/check/check-cdr.test.ts +++ b/src/lang/tests/check/check-cdr.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Cdr", async () => { await runCode(` diff --git a/src/lang/tests/check/check-clazz-fulfilling.test.ts b/src/lang/tests/check/check-clazz-fulfilling.test.ts index 8df74b68..e0377e12 100644 --- a/src/lang/tests/check/check-clazz-fulfilling.test.ts +++ b/src/lang/tests/check/check-clazz-fulfilling.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("check Clazz -- fulfilling type", async () => { await runCode(` diff --git a/src/lang/tests/check/check-clazz.test.ts b/src/lang/tests/check/check-clazz.test.ts index 58e8e967..5d1926ca 100644 --- a/src/lang/tests/check/check-clazz.test.ts +++ b/src/lang/tests/check/check-clazz.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Clazz is a Type", async () => { await runCode(` diff --git a/src/lang/tests/check/check-cons.test.ts b/src/lang/tests/check/check-cons.test.ts index ea0e637b..ec93b57d 100644 --- a/src/lang/tests/check/check-cons.test.ts +++ b/src/lang/tests/check/check-cons.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Cons", async () => { await runCode(` diff --git a/src/lang/tests/check/check-dot.test.ts b/src/lang/tests/check/check-dot.test.ts index 3d243c36..86e71faf 100644 --- a/src/lang/tests/check/check-dot.test.ts +++ b/src/lang/tests/check/check-dot.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Dot", async () => { await runCode(` diff --git a/src/lang/tests/check/check-fn-annotated.test.ts b/src/lang/tests/check/check-fn-annotated.test.ts index 4c06fbb1..7bde2b3c 100644 --- a/src/lang/tests/check/check-fn-annotated.test.ts +++ b/src/lang/tests/check/check-fn-annotated.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check FnAnnotated", async () => { await runCode(` diff --git a/src/lang/tests/check/check-fn-implicit-insertion.test.ts b/src/lang/tests/check/check-fn-implicit-insertion.test.ts index fe727b4f..f5e05611 100644 --- a/src/lang/tests/check/check-fn-implicit-insertion.test.ts +++ b/src/lang/tests/check/check-fn-implicit-insertion.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check FnImplicit -- FnImplicit insertion", async () => { await runCode(` diff --git a/src/lang/tests/check/check-fn-implicit.test.ts b/src/lang/tests/check/check-fn-implicit.test.ts index f7cff680..32b0cb35 100644 --- a/src/lang/tests/check/check-fn-implicit.test.ts +++ b/src/lang/tests/check/check-fn-implicit.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check FnImplicit", async () => { await runCode(` diff --git a/src/lang/tests/check/check-fn.test.ts b/src/lang/tests/check/check-fn.test.ts index 5b3656ad..69f5533f 100644 --- a/src/lang/tests/check/check-fn.test.ts +++ b/src/lang/tests/check/check-fn.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("check Fn", async () => { await runCode(` diff --git a/src/lang/tests/check/check-new-ap.test.ts b/src/lang/tests/check/check-new-ap.test.ts index 1501da48..86e390ed 100644 --- a/src/lang/tests/check/check-new-ap.test.ts +++ b/src/lang/tests/check/check-new-ap.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("check NewAp", async () => { await runCode(` diff --git a/src/lang/tests/check/check-new.test.ts b/src/lang/tests/check/check-new.test.ts index c68a34a9..b1e8033e 100644 --- a/src/lang/tests/check/check-new.test.ts +++ b/src/lang/tests/check/check-new.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("check New", async () => { await runCode(` diff --git a/src/lang/tests/check/check-objekt-spread.test.ts b/src/lang/tests/check/check-objekt-spread.test.ts index 60ed6cf2..936a1620 100644 --- a/src/lang/tests/check/check-objekt-spread.test.ts +++ b/src/lang/tests/check/check-objekt-spread.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Objekt -- spread", async () => { await runCode(` diff --git a/src/lang/tests/check/check-objekt.test.ts b/src/lang/tests/check/check-objekt.test.ts index 5b106367..f083924f 100644 --- a/src/lang/tests/check/check-objekt.test.ts +++ b/src/lang/tests/check/check-objekt.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("check Objekt", async () => { await runCode(` diff --git a/src/lang/tests/check/check-pair.test.ts b/src/lang/tests/check/check-pair.test.ts index 69f60f3d..c9290fae 100644 --- a/src/lang/tests/check/check-pair.test.ts +++ b/src/lang/tests/check/check-pair.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Pair is a Type", async () => { await runCode(` diff --git a/src/lang/tests/check/check-pi-implicit.test.ts b/src/lang/tests/check/check-pi-implicit.test.ts index f7ab5de5..9a250271 100644 --- a/src/lang/tests/check/check-pi-implicit.test.ts +++ b/src/lang/tests/check/check-pi-implicit.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check PiImplicit is a Type", async () => { await runCode(` diff --git a/src/lang/tests/check/check-pi.test.ts b/src/lang/tests/check/check-pi.test.ts index 43d9b005..a921c534 100644 --- a/src/lang/tests/check/check-pi.test.ts +++ b/src/lang/tests/check/check-pi.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Pi is a Type", async () => { await runCode(` diff --git a/src/lang/tests/check/check-quote.test.ts b/src/lang/tests/check/check-quote.test.ts index 2e66cf93..f1e3d7ac 100644 --- a/src/lang/tests/check/check-quote.test.ts +++ b/src/lang/tests/check/check-quote.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Quote is String", async () => { await runCode(` diff --git a/src/lang/tests/check/check-refl.test.ts b/src/lang/tests/check/check-refl.test.ts index 7c198923..fd03a058 100644 --- a/src/lang/tests/check/check-refl.test.ts +++ b/src/lang/tests/check/check-refl.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("check Refl", async () => { await runCode(` diff --git a/src/lang/tests/check/check-same.test.ts b/src/lang/tests/check/check-same.test.ts index 89d5e0be..b518ea7b 100644 --- a/src/lang/tests/check/check-same.test.ts +++ b/src/lang/tests/check/check-same.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("check Same", async () => { await runCode(` diff --git a/src/lang/tests/check/check-sequence-no-enrich.test.ts b/src/lang/tests/check/check-sequence-no-enrich.test.ts index 2a40b5ac..63460b5c 100644 --- a/src/lang/tests/check/check-sequence-no-enrich.test.ts +++ b/src/lang/tests/check/check-sequence-no-enrich.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check SequenceLetThe -- no enrich", async () => { await runCode(` diff --git a/src/lang/tests/check/check-sequence.test.ts b/src/lang/tests/check/check-sequence.test.ts index 5249f24c..ca0161c7 100644 --- a/src/lang/tests/check/check-sequence.test.ts +++ b/src/lang/tests/check/check-sequence.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Sequence -- single return", async () => { await runCode(` diff --git a/src/lang/tests/check/check-sigma.test.ts b/src/lang/tests/check/check-sigma.test.ts index 1a5c612a..d48983a5 100644 --- a/src/lang/tests/check/check-sigma.test.ts +++ b/src/lang/tests/check/check-sigma.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Sigma is a Type", async () => { await runCode(` diff --git a/src/lang/tests/check/check-sole.test.ts b/src/lang/tests/check/check-sole.test.ts index d8281373..6c67a7e1 100644 --- a/src/lang/tests/check/check-sole.test.ts +++ b/src/lang/tests/check/check-sole.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Sole is Trivial", async () => { await runCode(` diff --git a/src/lang/tests/check/check-string.test.ts b/src/lang/tests/check/check-string.test.ts index 01e025b1..81b01e1f 100644 --- a/src/lang/tests/check/check-string.test.ts +++ b/src/lang/tests/check/check-string.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check String is Type", async () => { await runCode(` diff --git a/src/lang/tests/check/check-the.test.ts b/src/lang/tests/check/check-the.test.ts index 32b27ada..4bd72357 100644 --- a/src/lang/tests/check/check-the.test.ts +++ b/src/lang/tests/check/check-the.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("check the", async () => { await runCode(` diff --git a/src/lang/tests/check/check-trivial.test.ts b/src/lang/tests/check/check-trivial.test.ts index dd3950e8..2db74f1b 100644 --- a/src/lang/tests/check/check-trivial.test.ts +++ b/src/lang/tests/check/check-trivial.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Trivial is Type", async () => { await runCode(` diff --git a/src/lang/tests/check/check-type.test.ts b/src/lang/tests/check/check-type.test.ts index 1d52b38e..47003fa5 100644 --- a/src/lang/tests/check/check-type.test.ts +++ b/src/lang/tests/check/check-type.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("check Type in Type", async () => { await runCode(` diff --git a/src/lang/tests/check/check-var.test.ts b/src/lang/tests/check/check-var.test.ts index a440c579..509c01ca 100644 --- a/src/lang/tests/check/check-var.test.ts +++ b/src/lang/tests/check/check-var.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("check Var", async () => { await runCode(` diff --git a/src/lang/tests/compute/compute-ap-implicit-insertion-scope.test.ts b/src/lang/tests/compute/compute-ap-implicit-insertion-scope.test.ts index a16c6b30..902c4a97 100644 --- a/src/lang/tests/compute/compute-ap-implicit-insertion-scope.test.ts +++ b/src/lang/tests/compute/compute-ap-implicit-insertion-scope.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail } from "../utils" +import { expectCodeToFail } from "../utils.js" test("compute ApImplicit -- scope", async () => { await expectCodeToFail(` diff --git a/src/lang/tests/compute/compute-ap-implicit-insertion.test.ts b/src/lang/tests/compute/compute-ap-implicit-insertion.test.ts index 4762436d..8e94fb02 100644 --- a/src/lang/tests/compute/compute-ap-implicit-insertion.test.ts +++ b/src/lang/tests/compute/compute-ap-implicit-insertion.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute ApImplicit -- insertion -- id", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-ap-implicit.test.ts b/src/lang/tests/compute/compute-ap-implicit.test.ts index c6451769..87b10eca 100644 --- a/src/lang/tests/compute/compute-ap-implicit.test.ts +++ b/src/lang/tests/compute/compute-ap-implicit.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute ApImplicit", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-ap.test.ts b/src/lang/tests/compute/compute-ap.test.ts index 1995f8ff..d1d0f5dc 100644 --- a/src/lang/tests/compute/compute-ap.test.ts +++ b/src/lang/tests/compute/compute-ap.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Ap", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-car.test.ts b/src/lang/tests/compute/compute-car.test.ts index 893dde04..9722347f 100644 --- a/src/lang/tests/compute/compute-car.test.ts +++ b/src/lang/tests/compute/compute-car.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Car", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-cdr.test.ts b/src/lang/tests/compute/compute-cdr.test.ts index 513e6447..ea585b23 100644 --- a/src/lang/tests/compute/compute-cdr.test.ts +++ b/src/lang/tests/compute/compute-cdr.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Cdr", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-clazz-json.test.ts b/src/lang/tests/compute/compute-clazz-json.test.ts index 8f43c2b8..481cd1cf 100644 --- a/src/lang/tests/compute/compute-clazz-json.test.ts +++ b/src/lang/tests/compute/compute-clazz-json.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Clazz -- JSON", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-clazz.test.ts b/src/lang/tests/compute/compute-clazz.test.ts index 936238c8..8d3f9857 100644 --- a/src/lang/tests/compute/compute-clazz.test.ts +++ b/src/lang/tests/compute/compute-clazz.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Clazz", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-cons.test.ts b/src/lang/tests/compute/compute-cons.test.ts index 22a184ff..816973d3 100644 --- a/src/lang/tests/compute/compute-cons.test.ts +++ b/src/lang/tests/compute/compute-cons.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Cons", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-dot-json.test.ts b/src/lang/tests/compute/compute-dot-json.test.ts index ed2bc921..d6156835 100644 --- a/src/lang/tests/compute/compute-dot-json.test.ts +++ b/src/lang/tests/compute/compute-dot-json.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Dot -- JSON", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-dot.test.ts b/src/lang/tests/compute/compute-dot.test.ts index 84bf66c7..4d5c9ef8 100644 --- a/src/lang/tests/compute/compute-dot.test.ts +++ b/src/lang/tests/compute/compute-dot.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Dot", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-equal.test.ts b/src/lang/tests/compute/compute-equal.test.ts index 8a44bf22..e88c742d 100644 --- a/src/lang/tests/compute/compute-equal.test.ts +++ b/src/lang/tests/compute/compute-equal.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Equal", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-fn-annotated.test.ts b/src/lang/tests/compute/compute-fn-annotated.test.ts index 2d8faec7..8bcc4e58 100644 --- a/src/lang/tests/compute/compute-fn-annotated.test.ts +++ b/src/lang/tests/compute/compute-fn-annotated.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute FnAnnotated", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-fn-implicit.test.ts b/src/lang/tests/compute/compute-fn-implicit.test.ts index 0cfe6b9b..04cf7aab 100644 --- a/src/lang/tests/compute/compute-fn-implicit.test.ts +++ b/src/lang/tests/compute/compute-fn-implicit.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute FnImplicit", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-fn-with-return-type.test.ts b/src/lang/tests/compute/compute-fn-with-return-type.test.ts index 1286dd1e..dd28014c 100644 --- a/src/lang/tests/compute/compute-fn-with-return-type.test.ts +++ b/src/lang/tests/compute/compute-fn-with-return-type.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("compute Fn with return type", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-fn.test.ts b/src/lang/tests/compute/compute-fn.test.ts index be33abfc..d04e40bb 100644 --- a/src/lang/tests/compute/compute-fn.test.ts +++ b/src/lang/tests/compute/compute-fn.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Fn", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-new.test.ts b/src/lang/tests/compute/compute-new.test.ts index 65514b3c..b14bb681 100644 --- a/src/lang/tests/compute/compute-new.test.ts +++ b/src/lang/tests/compute/compute-new.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute New", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-objekt-json.test.ts b/src/lang/tests/compute/compute-objekt-json.test.ts index 34762133..aee2c9d6 100644 --- a/src/lang/tests/compute/compute-objekt-json.test.ts +++ b/src/lang/tests/compute/compute-objekt-json.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Objekt -- JSON", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-objekt.test.ts b/src/lang/tests/compute/compute-objekt.test.ts index 3b9c5cac..59066c74 100644 --- a/src/lang/tests/compute/compute-objekt.test.ts +++ b/src/lang/tests/compute/compute-objekt.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Objekt", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-pair.test.ts b/src/lang/tests/compute/compute-pair.test.ts index 74c38443..c81926e4 100644 --- a/src/lang/tests/compute/compute-pair.test.ts +++ b/src/lang/tests/compute/compute-pair.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Pair", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-pi-implicit.test.ts b/src/lang/tests/compute/compute-pi-implicit.test.ts index c70c064c..69773cc9 100644 --- a/src/lang/tests/compute/compute-pi-implicit.test.ts +++ b/src/lang/tests/compute/compute-pi-implicit.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute PiImplicit", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-pi.test.ts b/src/lang/tests/compute/compute-pi.test.ts index 4cf83901..b9aafe9e 100644 --- a/src/lang/tests/compute/compute-pi.test.ts +++ b/src/lang/tests/compute/compute-pi.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Pi", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-quote.test.ts b/src/lang/tests/compute/compute-quote.test.ts index 1f4b860a..fb62487d 100644 --- a/src/lang/tests/compute/compute-quote.test.ts +++ b/src/lang/tests/compute/compute-quote.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Quote", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-refl.test.ts b/src/lang/tests/compute/compute-refl.test.ts index 5a73c4a3..bc644dde 100644 --- a/src/lang/tests/compute/compute-refl.test.ts +++ b/src/lang/tests/compute/compute-refl.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Refl -- under the", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-replace.test.ts b/src/lang/tests/compute/compute-replace.test.ts index f6eb0fba..c2d0802e 100644 --- a/src/lang/tests/compute/compute-replace.test.ts +++ b/src/lang/tests/compute/compute-replace.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Replace -- just replace", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-same.test.ts b/src/lang/tests/compute/compute-same.test.ts index c3a1d822..6161f347 100644 --- a/src/lang/tests/compute/compute-same.test.ts +++ b/src/lang/tests/compute/compute-same.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Same -- under the", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-sequence.test.ts b/src/lang/tests/compute/compute-sequence.test.ts index 8df65027..d4b67227 100644 --- a/src/lang/tests/compute/compute-sequence.test.ts +++ b/src/lang/tests/compute/compute-sequence.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Sequence -- single return", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-sigma.test.ts b/src/lang/tests/compute/compute-sigma.test.ts index 8b85a427..34f5eb5d 100644 --- a/src/lang/tests/compute/compute-sigma.test.ts +++ b/src/lang/tests/compute/compute-sigma.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Sigma", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-sole.test.ts b/src/lang/tests/compute/compute-sole.test.ts index 524e0bfa..ec98e409 100644 --- a/src/lang/tests/compute/compute-sole.test.ts +++ b/src/lang/tests/compute/compute-sole.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Sole", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-string.test.ts b/src/lang/tests/compute/compute-string.test.ts index 72a9aaf7..6cf6aeea 100644 --- a/src/lang/tests/compute/compute-string.test.ts +++ b/src/lang/tests/compute/compute-string.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute String", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-the.test.ts b/src/lang/tests/compute/compute-the.test.ts index 78556597..3dc2b90b 100644 --- a/src/lang/tests/compute/compute-the.test.ts +++ b/src/lang/tests/compute/compute-the.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute the", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-trivial.test.ts b/src/lang/tests/compute/compute-trivial.test.ts index f24edbfc..c81934ee 100644 --- a/src/lang/tests/compute/compute-trivial.test.ts +++ b/src/lang/tests/compute/compute-trivial.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Trivial", async () => { const output = await runCode(` diff --git a/src/lang/tests/compute/compute-type.test.ts b/src/lang/tests/compute/compute-type.test.ts index ae5ba701..493b0af4 100644 --- a/src/lang/tests/compute/compute-type.test.ts +++ b/src/lang/tests/compute/compute-type.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("compute Type", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-clazz-out-of-order.test.ts b/src/lang/tests/equivalent/equivalent-clazz-out-of-order.test.ts index d39a4eba..6b94a5fb 100644 --- a/src/lang/tests/equivalent/equivalent-clazz-out-of-order.test.ts +++ b/src/lang/tests/equivalent/equivalent-clazz-out-of-order.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("equivalent Clazz -- out of order", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-clazz.test.ts b/src/lang/tests/equivalent/equivalent-clazz.test.ts index 90a326d3..22d10ac3 100644 --- a/src/lang/tests/equivalent/equivalent-clazz.test.ts +++ b/src/lang/tests/equivalent/equivalent-clazz.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("equivalent Clazz", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-cons.test.ts b/src/lang/tests/equivalent/equivalent-cons.test.ts index 9d45ec8c..8ad8fd38 100644 --- a/src/lang/tests/equivalent/equivalent-cons.test.ts +++ b/src/lang/tests/equivalent/equivalent-cons.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("equivalent Cons", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-fn.test.ts b/src/lang/tests/equivalent/equivalent-fn.test.ts index a934ddb0..0c00e125 100644 --- a/src/lang/tests/equivalent/equivalent-fn.test.ts +++ b/src/lang/tests/equivalent/equivalent-fn.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("equivalent Fn", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-objekt-out-of-order.test.ts b/src/lang/tests/equivalent/equivalent-objekt-out-of-order.test.ts index 07e8ff87..f96d3472 100644 --- a/src/lang/tests/equivalent/equivalent-objekt-out-of-order.test.ts +++ b/src/lang/tests/equivalent/equivalent-objekt-out-of-order.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("equivalent Objekt -- out of order", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-objekt.test.ts b/src/lang/tests/equivalent/equivalent-objekt.test.ts index b6c52f08..3377f4db 100644 --- a/src/lang/tests/equivalent/equivalent-objekt.test.ts +++ b/src/lang/tests/equivalent/equivalent-objekt.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("equivalent Objekt", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-pi.test.ts b/src/lang/tests/equivalent/equivalent-pi.test.ts index 2974ce33..05aa9238 100644 --- a/src/lang/tests/equivalent/equivalent-pi.test.ts +++ b/src/lang/tests/equivalent/equivalent-pi.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("equivalent Pi", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-quote.test.ts b/src/lang/tests/equivalent/equivalent-quote.test.ts index 3ff01757..1698b2e6 100644 --- a/src/lang/tests/equivalent/equivalent-quote.test.ts +++ b/src/lang/tests/equivalent/equivalent-quote.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("equivalent Quote", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-sigma.test.ts b/src/lang/tests/equivalent/equivalent-sigma.test.ts index 9e1e0144..89db1c8f 100644 --- a/src/lang/tests/equivalent/equivalent-sigma.test.ts +++ b/src/lang/tests/equivalent/equivalent-sigma.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("equivalent Sigma", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-sole.test.ts b/src/lang/tests/equivalent/equivalent-sole.test.ts index 000784c9..360a3715 100644 --- a/src/lang/tests/equivalent/equivalent-sole.test.ts +++ b/src/lang/tests/equivalent/equivalent-sole.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("equivalent Sole", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-string.test.ts b/src/lang/tests/equivalent/equivalent-string.test.ts index a24c9d57..65815fc3 100644 --- a/src/lang/tests/equivalent/equivalent-string.test.ts +++ b/src/lang/tests/equivalent/equivalent-string.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("equivalent String", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-trivial.test.ts b/src/lang/tests/equivalent/equivalent-trivial.test.ts index 013ad834..7e855530 100644 --- a/src/lang/tests/equivalent/equivalent-trivial.test.ts +++ b/src/lang/tests/equivalent/equivalent-trivial.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("equivalent Trivial", async () => { const output = await runCode(` diff --git a/src/lang/tests/equivalent/equivalent-type.test.ts b/src/lang/tests/equivalent/equivalent-type.test.ts index 5218d558..c0e41cab 100644 --- a/src/lang/tests/equivalent/equivalent-type.test.ts +++ b/src/lang/tests/equivalent/equivalent-type.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("equivalent Type", async () => { const output = await runCode(` diff --git a/src/lang/tests/include/include-clazz-out-of-order.test.ts b/src/lang/tests/include/include-clazz-out-of-order.test.ts index ffc083e6..98085df4 100644 --- a/src/lang/tests/include/include-clazz-out-of-order.test.ts +++ b/src/lang/tests/include/include-clazz-out-of-order.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("include Clazz -- out of order", async () => { await runCode(` diff --git a/src/lang/tests/include/include-clazz.test.ts b/src/lang/tests/include/include-clazz.test.ts index 6c894884..b087fe05 100644 --- a/src/lang/tests/include/include-clazz.test.ts +++ b/src/lang/tests/include/include-clazz.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("include Clazz", async () => { await runCode(` diff --git a/src/lang/tests/include/include-equal.test.ts b/src/lang/tests/include/include-equal.test.ts index cc5e6369..61509083 100644 --- a/src/lang/tests/include/include-equal.test.ts +++ b/src/lang/tests/include/include-equal.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("include Equal", async () => { await runCode(` diff --git a/src/lang/tests/include/include-pi.test.ts b/src/lang/tests/include/include-pi.test.ts index d29ccd69..9b2fec36 100644 --- a/src/lang/tests/include/include-pi.test.ts +++ b/src/lang/tests/include/include-pi.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("include Pi", async () => { await runCode(` diff --git a/src/lang/tests/include/include-sigma.test.ts b/src/lang/tests/include/include-sigma.test.ts index 5e6ba306..1d752791 100644 --- a/src/lang/tests/include/include-sigma.test.ts +++ b/src/lang/tests/include/include-sigma.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("include Sigma", async () => { await runCode(` diff --git a/src/lang/tests/solve/solve-ap-implicit.test.ts b/src/lang/tests/solve/solve-ap-implicit.test.ts index 0c6fadfb..16f20de3 100644 --- a/src/lang/tests/solve/solve-ap-implicit.test.ts +++ b/src/lang/tests/solve/solve-ap-implicit.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve ApImplicit -- same PatternVar", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-ap.test.ts b/src/lang/tests/solve/solve-ap.test.ts index 2eec1007..a165b3e0 100644 --- a/src/lang/tests/solve/solve-ap.test.ts +++ b/src/lang/tests/solve/solve-ap.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Ap -- same PatternVar", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-box-implicit.test.ts b/src/lang/tests/solve/solve-box-implicit.test.ts index 7ad67f0e..8fb2850a 100644 --- a/src/lang/tests/solve/solve-box-implicit.test.ts +++ b/src/lang/tests/solve/solve-box-implicit.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Box -- implicit", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-box.test.ts b/src/lang/tests/solve/solve-box.test.ts index 787e11ae..2520c450 100644 --- a/src/lang/tests/solve/solve-box.test.ts +++ b/src/lang/tests/solve/solve-box.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Box", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-car.test.ts b/src/lang/tests/solve/solve-car.test.ts index 0212e2d9..8b018281 100644 --- a/src/lang/tests/solve/solve-car.test.ts +++ b/src/lang/tests/solve/solve-car.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Car", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-cdr.test.ts b/src/lang/tests/solve/solve-cdr.test.ts index de682107..f033103c 100644 --- a/src/lang/tests/solve/solve-cdr.test.ts +++ b/src/lang/tests/solve/solve-cdr.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Cdr", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-clazz-out-of-order.test.ts b/src/lang/tests/solve/solve-clazz-out-of-order.test.ts index f1ecf346..5d67a9be 100644 --- a/src/lang/tests/solve/solve-clazz-out-of-order.test.ts +++ b/src/lang/tests/solve/solve-clazz-out-of-order.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { expectCodeToFail } from "../utils" +import { expectCodeToFail } from "../utils.js" test("solve Clazz -- out of order", async () => { await expectCodeToFail(` diff --git a/src/lang/tests/solve/solve-clazz.test.ts b/src/lang/tests/solve/solve-clazz.test.ts index 35a95091..0b78ff11 100644 --- a/src/lang/tests/solve/solve-clazz.test.ts +++ b/src/lang/tests/solve/solve-clazz.test.ts @@ -1,6 +1,6 @@ import { expect, test } from "vitest" -import * as Errors from "../../errors" -import { expectCodeToFail, runCode } from "../utils" +import * as Errors from "../../errors/index.js" +import { expectCodeToFail, runCode } from "../utils.js" test("solve Clazz", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-cons.test.ts b/src/lang/tests/solve/solve-cons.test.ts index 2ab4dcff..5484b6ab 100644 --- a/src/lang/tests/solve/solve-cons.test.ts +++ b/src/lang/tests/solve/solve-cons.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Cons -- car", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-dot.test.ts b/src/lang/tests/solve/solve-dot.test.ts index 59aaf835..d62e12af 100644 --- a/src/lang/tests/solve/solve-dot.test.ts +++ b/src/lang/tests/solve/solve-dot.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Dot", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-fn-implicit.test.ts b/src/lang/tests/solve/solve-fn-implicit.test.ts index 0d606f69..ca40a99f 100644 --- a/src/lang/tests/solve/solve-fn-implicit.test.ts +++ b/src/lang/tests/solve/solve-fn-implicit.test.ts @@ -1,6 +1,6 @@ import { expect, test } from "vitest" -import * as Errors from "../../errors" -import { expectCodeToFail, runCode } from "../utils" +import * as Errors from "../../errors/index.js" +import { expectCodeToFail, runCode } from "../utils.js" test("solve FnImplicit", async () => { await expectCodeToFail(` diff --git a/src/lang/tests/solve/solve-fn.test.ts b/src/lang/tests/solve/solve-fn.test.ts index 03f101a0..b2c94fdd 100644 --- a/src/lang/tests/solve/solve-fn.test.ts +++ b/src/lang/tests/solve/solve-fn.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { expectCodeToFail, runCode } from "../utils" +import { expectCodeToFail, runCode } from "../utils.js" test("solve Fn", async () => { await expectCodeToFail(` diff --git a/src/lang/tests/solve/solve-objekt.test.ts b/src/lang/tests/solve/solve-objekt.test.ts index 8d77c374..2a2f339c 100644 --- a/src/lang/tests/solve/solve-objekt.test.ts +++ b/src/lang/tests/solve/solve-objekt.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Objekt", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-pi-implicit.test.ts b/src/lang/tests/solve/solve-pi-implicit.test.ts index 27038bed..30ad4a42 100644 --- a/src/lang/tests/solve/solve-pi-implicit.test.ts +++ b/src/lang/tests/solve/solve-pi-implicit.test.ts @@ -1,6 +1,6 @@ import { expect, test } from "vitest" -import * as Errors from "../../errors" -import { expectCodeToFail, runCode } from "../utils" +import * as Errors from "../../errors/index.js" +import { expectCodeToFail, runCode } from "../utils.js" test("solve PiImplicit -- occur twice", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-pi.test.ts b/src/lang/tests/solve/solve-pi.test.ts index 11ce1f40..a3963034 100644 --- a/src/lang/tests/solve/solve-pi.test.ts +++ b/src/lang/tests/solve/solve-pi.test.ts @@ -1,6 +1,6 @@ import { expect, test } from "vitest" -import * as Errors from "../../errors" -import { expectCodeToFail, runCode } from "../utils" +import * as Errors from "../../errors/index.js" +import { expectCodeToFail, runCode } from "../utils.js" test("solve Pi", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-quote.test.ts b/src/lang/tests/solve/solve-quote.test.ts index 5bb4d369..f125190c 100644 --- a/src/lang/tests/solve/solve-quote.test.ts +++ b/src/lang/tests/solve/solve-quote.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Quote -- data", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-sigma.test.ts b/src/lang/tests/solve/solve-sigma.test.ts index 8b9407e5..80d43218 100644 --- a/src/lang/tests/solve/solve-sigma.test.ts +++ b/src/lang/tests/solve/solve-sigma.test.ts @@ -1,6 +1,6 @@ import { expect, test } from "vitest" -import * as Errors from "../../errors" -import { expectCodeToFail, runCode } from "../utils" +import * as Errors from "../../errors/index.js" +import { expectCodeToFail, runCode } from "../utils.js" test("solve Sigma", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-sole.test.ts b/src/lang/tests/solve/solve-sole.test.ts index 6e709e3e..8bd6c5a8 100644 --- a/src/lang/tests/solve/solve-sole.test.ts +++ b/src/lang/tests/solve/solve-sole.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Sole", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-string.test.ts b/src/lang/tests/solve/solve-string.test.ts index 69aeeeed..22ef49e7 100644 --- a/src/lang/tests/solve/solve-string.test.ts +++ b/src/lang/tests/solve/solve-string.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve String", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-trivial.test.ts b/src/lang/tests/solve/solve-trivial.test.ts index 73c46c48..ec0cb0ba 100644 --- a/src/lang/tests/solve/solve-trivial.test.ts +++ b/src/lang/tests/solve/solve-trivial.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Trivial", async () => { const output = await runCode(` diff --git a/src/lang/tests/solve/solve-type.test.ts b/src/lang/tests/solve/solve-type.test.ts index 2b95fbd1..75c52c6a 100644 --- a/src/lang/tests/solve/solve-type.test.ts +++ b/src/lang/tests/solve/solve-type.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { runCode } from "../utils" +import { runCode } from "../utils.js" test("solve Type", async () => { const output = await runCode(` diff --git a/src/lang/tests/utils.ts b/src/lang/tests/utils.ts index e5e10874..bbe84f4f 100644 --- a/src/lang/tests/utils.ts +++ b/src/lang/tests/utils.ts @@ -1,8 +1,8 @@ import { expect } from "vitest" -import { Loader } from "../../loader" -import * as Errors from "../errors" -import { Mod } from "../mod" -import { parseStmts } from "../syntax" +import { Loader } from "../../loader/index.js" +import * as Errors from "../errors/index.js" +import { Mod } from "../mod/index.js" +import { parseStmts } from "../syntax/index.js" export async function runCode(code: string): Promise { const loader = new Loader() diff --git a/src/lang/unify/index.ts b/src/lang/unify/index.ts index 824657dd..1230418d 100644 --- a/src/lang/unify/index.ts +++ b/src/lang/unify/index.ts @@ -1,9 +1,9 @@ -export * from "./occur" -export * from "./unify" -export * from "./unifyByType" -export * from "./unifyByValue" -export * from "./unifyClazz" -export * from "./unifyNeutral" -export * from "./unifyPatternVar" -export * from "./unifyProperties" -export * from "./unifyType" +export * from "./occur.js" +export * from "./unify.js" +export * from "./unifyByType.js" +export * from "./unifyByValue.js" +export * from "./unifyClazz.js" +export * from "./unifyNeutral.js" +export * from "./unifyPatternVar.js" +export * from "./unifyProperties.js" +export * from "./unifyType.js" diff --git a/src/lang/unify/occur.ts b/src/lang/unify/occur.ts index bd85e878..d9ea0ab6 100644 --- a/src/lang/unify/occur.ts +++ b/src/lang/unify/occur.ts @@ -1,14 +1,14 @@ -import * as Actions from "../actions" -import { closureApply } from "../closure" -import type { Ctx } from "../ctx" -import { ctxNames } from "../ctx" -import type { Mod } from "../mod" -import type { Neutral } from "../neutral" -import * as Neutrals from "../neutral" -import { solutionNames } from "../solution" -import { freshen } from "../utils/freshen" -import type { TypedValue, Value } from "../value" -import * as Values from "../value" +import * as Actions from "../actions/index.js" +import { closureApply } from "../closure/index.js" +import type { Ctx } from "../ctx/index.js" +import { ctxNames } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import type { Neutral } from "../neutral/index.js" +import * as Neutrals from "../neutral/index.js" +import { solutionNames } from "../solution/index.js" +import { freshen } from "../utils/freshen.js" +import type { TypedValue, Value } from "../value/index.js" +import * as Values from "../value/index.js" function occurType(mod: Mod, ctx: Ctx, name: string, value: Value): boolean { return occur(mod, ctx, name, Values.Type(), value) diff --git a/src/lang/unify/unify.ts b/src/lang/unify/unify.ts index c32ae32f..2400d12a 100644 --- a/src/lang/unify/unify.ts +++ b/src/lang/unify/unify.ts @@ -1,11 +1,11 @@ -import { indent } from "../../utils/indent" -import type { Ctx } from "../ctx" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import { solutionAdvanceValue } from "../solution" -import { unifyByType, unifyByValue, unifyPatternVar } from "../unify" -import type { Value } from "../value" -import { formatType, formatValue } from "../value" +import { indent } from "../../utils/indent.js" +import type { Ctx } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import { solutionAdvanceValue } from "../solution/index.js" +import { unifyByType, unifyByValue, unifyPatternVar } from "../unify/index.js" +import type { Value } from "../value/index.js" +import { formatType, formatValue } from "../value/index.js" /** diff --git a/src/lang/unify/unifyByType.ts b/src/lang/unify/unifyByType.ts index 7ccaf44a..cc0ddcc4 100644 --- a/src/lang/unify/unifyByType.ts +++ b/src/lang/unify/unifyByType.ts @@ -1,17 +1,17 @@ import _ from "lodash" -import * as Actions from "../actions" -import { closureApply } from "../closure" -import type { Ctx } from "../ctx" -import { CtxCons, ctxNames } from "../ctx" -import { equivalent } from "../equivalent" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { solutionNames } from "../solution" -import { unify, unifyProperties, unifyType } from "../unify" -import { freshen } from "../utils/freshen" -import type { Value } from "../value" -import * as Values from "../value" +import * as Actions from "../actions/index.js" +import { closureApply } from "../closure/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, ctxNames } from "../ctx/index.js" +import { equivalent } from "../equivalent/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { solutionNames } from "../solution/index.js" +import { unify, unifyProperties, unifyType } from "../unify/index.js" +import { freshen } from "../utils/freshen.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function unifyByType( mod: Mod, diff --git a/src/lang/unify/unifyByValue.ts b/src/lang/unify/unifyByValue.ts index d56004fe..5c21c886 100644 --- a/src/lang/unify/unifyByValue.ts +++ b/src/lang/unify/unifyByValue.ts @@ -1,10 +1,10 @@ -import { indent } from "../../utils/indent" -import type { Ctx } from "../ctx" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import { unify, unifyNeutral, unifyType } from "../unify" -import type { Value } from "../value" -import { formatType, formatValue } from "../value" +import { indent } from "../../utils/indent.js" +import type { Ctx } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import { unify, unifyNeutral, unifyType } from "../unify/index.js" +import type { Value } from "../value/index.js" +import { formatType, formatValue } from "../value/index.js" export function unifyByValue( mod: Mod, diff --git a/src/lang/unify/unifyClazz.ts b/src/lang/unify/unifyClazz.ts index 2ea1d68e..9b063786 100644 --- a/src/lang/unify/unifyClazz.ts +++ b/src/lang/unify/unifyClazz.ts @@ -1,13 +1,13 @@ import _ from "lodash" -import type { Ctx } from "../ctx" -import { ctxNames } from "../ctx" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { solutionNames } from "../solution" -import { unify, unifyType } from "../unify" -import { freshen } from "../utils/freshen" -import * as Values from "../value" +import type { Ctx } from "../ctx/index.js" +import { ctxNames } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { solutionNames } from "../solution/index.js" +import { unify, unifyType } from "../unify/index.js" +import { freshen } from "../utils/freshen.js" +import * as Values from "../value/index.js" export function unifyClazz( mod: Mod, diff --git a/src/lang/unify/unifyNeutral.ts b/src/lang/unify/unifyNeutral.ts index 682e874e..80a05373 100644 --- a/src/lang/unify/unifyNeutral.ts +++ b/src/lang/unify/unifyNeutral.ts @@ -1,12 +1,12 @@ -import { indent } from "../../utils/indent" -import type { Ctx } from "../ctx" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import type { Neutral } from "../neutral" -import { unify, unifyPatternVar, unifyType } from "../unify" -import type { Value } from "../value" -import * as Values from "../value" -import { TypedValue, formatNeutral } from "../value" +import { indent } from "../../utils/indent.js" +import type { Ctx } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import type { Neutral } from "../neutral/index.js" +import { unify, unifyPatternVar, unifyType } from "../unify/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" +import { TypedValue, formatNeutral } from "../value/index.js" function unifyTypedValue( mod: Mod, diff --git a/src/lang/unify/unifyPatternVar.ts b/src/lang/unify/unifyPatternVar.ts index c6d4c092..1f56c1f2 100644 --- a/src/lang/unify/unifyPatternVar.ts +++ b/src/lang/unify/unifyPatternVar.ts @@ -1,12 +1,12 @@ -import { indent } from "../../utils/indent" -import type { Ctx } from "../ctx" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import { solutionBind } from "../solution" -import { occur } from "../unify" -import type { Value } from "../value" -import * as Values from "../value" -import { formatType, formatValue } from "../value" +import { indent } from "../../utils/indent.js" +import type { Ctx } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import { solutionBind } from "../solution/index.js" +import { occur } from "../unify/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" +import { formatType, formatValue } from "../value/index.js" export function unifyPatternVar( mod: Mod, diff --git a/src/lang/unify/unifyProperties.ts b/src/lang/unify/unifyProperties.ts index 77751155..20257b98 100644 --- a/src/lang/unify/unifyProperties.ts +++ b/src/lang/unify/unifyProperties.ts @@ -1,9 +1,9 @@ -import * as Actions from "../actions" -import type { Ctx } from "../ctx" -import type { Mod } from "../mod" -import { unify } from "../unify" -import type { Value } from "../value" -import * as Values from "../value" +import * as Actions from "../actions/index.js" +import type { Ctx } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import { unify } from "../unify/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function unifyProperties( mod: Mod, diff --git a/src/lang/unify/unifyType.ts b/src/lang/unify/unifyType.ts index 11c4caab..41ec0715 100644 --- a/src/lang/unify/unifyType.ts +++ b/src/lang/unify/unifyType.ts @@ -1,16 +1,21 @@ -import { indent } from "../../utils/indent" -import type { Closure } from "../closure" -import { closureApply } from "../closure" -import type { Ctx } from "../ctx" -import { CtxCons, ctxNames } from "../ctx" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { solutionAdvanceValue, solutionNames } from "../solution" -import { unify, unifyClazz, unifyNeutral, unifyPatternVar } from "../unify" -import { freshen } from "../utils/freshen" -import * as Values from "../value" -import { Value, formatType, isClazz } from "../value" +import { indent } from "../../utils/indent.js" +import type { Closure } from "../closure/index.js" +import { closureApply } from "../closure/index.js" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, ctxNames } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { solutionAdvanceValue, solutionNames } from "../solution/index.js" +import { + unify, + unifyClazz, + unifyNeutral, + unifyPatternVar, +} from "../unify/index.js" +import { freshen } from "../utils/freshen.js" +import * as Values from "../value/index.js" +import { type Value, formatType, isClazz } from "../value/index.js" export function unifyType(mod: Mod, ctx: Ctx, left: Value, right: Value): void { left = solutionAdvanceValue(mod, left) diff --git a/src/lang/utils/freshen.test.ts b/src/lang/utils/freshen.test.ts index d775cd61..10c2cd33 100644 --- a/src/lang/utils/freshen.test.ts +++ b/src/lang/utils/freshen.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { freshen } from "./freshen" +import { freshen } from "./freshen.js" test("freshen create new string not in set", () => { expect(freshen(["x"], "x")).toBe("x1") diff --git a/src/lang/utils/isIdentifier.test.ts b/src/lang/utils/isIdentifier.test.ts index 0219a510..bef8052d 100644 --- a/src/lang/utils/isIdentifier.test.ts +++ b/src/lang/utils/isIdentifier.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "vitest" -import { isIdentifier } from "./isIdentifier" +import { isIdentifier } from "./isIdentifier.js" test("isIdentifier", () => { expect(isIdentifier("_")).toBe(true) diff --git a/src/lang/value/TypedValue.ts b/src/lang/value/TypedValue.ts index 23eecf03..e7765508 100644 --- a/src/lang/value/TypedValue.ts +++ b/src/lang/value/TypedValue.ts @@ -1,4 +1,4 @@ -import type { Value } from "../value" +import type { Value } from "../value/index.js" export type TypedValue = { type: Value diff --git a/src/lang/value/Value.ts b/src/lang/value/Value.ts index 32b65f70..7a8b60b2 100644 --- a/src/lang/value/Value.ts +++ b/src/lang/value/Value.ts @@ -1,6 +1,6 @@ -import type { Closure } from "../closure" -import type { Neutral } from "../neutral" -import * as Neutrals from "../neutral" +import type { Closure } from "../closure/index.js" +import type { Neutral } from "../neutral/index.js" +import * as Neutrals from "../neutral/index.js" export type Value = | TypedNeutral diff --git a/src/lang/value/assertClazzInCtx.ts b/src/lang/value/assertClazzInCtx.ts index af201eb1..5203a87f 100644 --- a/src/lang/value/assertClazzInCtx.ts +++ b/src/lang/value/assertClazzInCtx.ts @@ -1,7 +1,7 @@ -import type { Ctx } from "../ctx" -import type { Mod } from "../mod" -import type * as Values from "../value" -import { assertTypesInCtx, Value } from "../value" +import type { Ctx } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import type * as Values from "../value/index.js" +import { assertTypesInCtx, type Value } from "../value/index.js" export function assertClazzInCtx( mod: Mod, diff --git a/src/lang/value/assertTypeInCtx.ts b/src/lang/value/assertTypeInCtx.ts index 30067741..cdc99619 100644 --- a/src/lang/value/assertTypeInCtx.ts +++ b/src/lang/value/assertTypeInCtx.ts @@ -1,7 +1,7 @@ -import type { Ctx } from "../ctx" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import { AlreadyType, formatType, Value } from "../value" +import type { Ctx } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import { type AlreadyType, formatType, type Value } from "../value/index.js" export function assertTypeInCtx( mod: Mod, diff --git a/src/lang/value/assertTypesInCtx.ts b/src/lang/value/assertTypesInCtx.ts index df22578a..e5f1efc9 100644 --- a/src/lang/value/assertTypesInCtx.ts +++ b/src/lang/value/assertTypesInCtx.ts @@ -1,7 +1,7 @@ -import type { Ctx } from "../ctx" -import * as Errors from "../errors" -import type { Mod } from "../mod" -import { AlreadyType, formatType, Value } from "../value" +import type { Ctx } from "../ctx/index.js" +import * as Errors from "../errors/index.js" +import type { Mod } from "../mod/index.js" +import { type AlreadyType, formatType, type Value } from "../value/index.js" type ElementExtractTypeUnion> = Kinds extends (infer Kind extends AlreadyType["@kind"])[] diff --git a/src/lang/value/clazzClosureApply.ts b/src/lang/value/clazzClosureApply.ts index 6e64e49c..61a48e0b 100644 --- a/src/lang/value/clazzClosureApply.ts +++ b/src/lang/value/clazzClosureApply.ts @@ -1,8 +1,8 @@ -import type { Closure } from "../closure" -import { closureApply } from "../closure" -import * as Errors from "../errors" -import type { Value } from "../value" -import * as Values from "../value" +import type { Closure } from "../closure/index.js" +import { closureApply } from "../closure/index.js" +import * as Errors from "../errors/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function clazzClosureApply(closure: Closure, arg: Value): Values.Clazz { const value = closureApply(closure, arg) diff --git a/src/lang/value/clazzExtendCtx.ts b/src/lang/value/clazzExtendCtx.ts index 4339cdda..d1589836 100644 --- a/src/lang/value/clazzExtendCtx.ts +++ b/src/lang/value/clazzExtendCtx.ts @@ -1,10 +1,10 @@ -import type { Ctx } from "../ctx" -import { CtxCons, CtxFulfilled, ctxNames } from "../ctx" -import type { Mod } from "../mod" -import * as Neutrals from "../neutral" -import { solutionNames } from "../solution" -import { freshen } from "../utils/freshen" -import * as Values from "../value" +import type { Ctx } from "../ctx/index.js" +import { CtxCons, CtxFulfilled, ctxNames } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import * as Neutrals from "../neutral/index.js" +import { solutionNames } from "../solution/index.js" +import { freshen } from "../utils/freshen.js" +import * as Values from "../value/index.js" export function clazzExtendCtx(mod: Mod, ctx: Ctx, clazz: Values.Clazz): Ctx { switch (clazz["@kind"]) { diff --git a/src/lang/value/clazzFromTypedValues.ts b/src/lang/value/clazzFromTypedValues.ts index 9771e433..ce3cf316 100644 --- a/src/lang/value/clazzFromTypedValues.ts +++ b/src/lang/value/clazzFromTypedValues.ts @@ -1,5 +1,5 @@ -import type { TypedValue } from "../value" -import * as Values from "../value" +import type { TypedValue } from "../value/index.js" +import * as Values from "../value/index.js" export function clazzFromTypedValues( typedValues: Record, diff --git a/src/lang/value/clazzFulfill.ts b/src/lang/value/clazzFulfill.ts index cc182100..0b8001dd 100644 --- a/src/lang/value/clazzFulfill.ts +++ b/src/lang/value/clazzFulfill.ts @@ -1,6 +1,6 @@ -import * as Errors from "../errors" -import type { Value } from "../value" -import * as Values from "../value" +import * as Errors from "../errors/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function clazzFulfill(clazz: Values.Clazz, arg: Value): Values.Clazz { switch (clazz["@kind"]) { diff --git a/src/lang/value/clazzFulfilledPrepend.ts b/src/lang/value/clazzFulfilledPrepend.ts index 41f31822..2f1335f5 100644 --- a/src/lang/value/clazzFulfilledPrepend.ts +++ b/src/lang/value/clazzFulfilledPrepend.ts @@ -1,5 +1,5 @@ -import * as Errors from "../errors" -import * as Values from "../value" +import * as Errors from "../errors/index.js" +import * as Values from "../value/index.js" export function clazzFulfilledPrepend( left: Values.Clazz, diff --git a/src/lang/value/clazzLookupProperty.ts b/src/lang/value/clazzLookupProperty.ts index 6b8eec89..fc8f448e 100644 --- a/src/lang/value/clazzLookupProperty.ts +++ b/src/lang/value/clazzLookupProperty.ts @@ -1,6 +1,6 @@ -import * as Actions from "../actions" -import type { Value } from "../value" -import * as Values from "../value" +import * as Actions from "../actions/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function clazzLookupProperty( target: Value, diff --git a/src/lang/value/clazzLookupPropertyType.ts b/src/lang/value/clazzLookupPropertyType.ts index c64f17d1..dd7893d4 100644 --- a/src/lang/value/clazzLookupPropertyType.ts +++ b/src/lang/value/clazzLookupPropertyType.ts @@ -1,6 +1,6 @@ -import * as Actions from "../actions" -import type { Value } from "../value" -import * as Values from "../value" +import * as Actions from "../actions/index.js" +import type { Value } from "../value/index.js" +import * as Values from "../value/index.js" export function clazzLookupPropertyType( target: Value, diff --git a/src/lang/value/clazzPropertyNames.ts b/src/lang/value/clazzPropertyNames.ts index ec4098f4..667986ed 100644 --- a/src/lang/value/clazzPropertyNames.ts +++ b/src/lang/value/clazzPropertyNames.ts @@ -1,5 +1,5 @@ -import * as Neutrals from "../neutral" -import * as Values from "../value" +import * as Neutrals from "../neutral/index.js" +import * as Values from "../value/index.js" export function clazzPropertyNames(clazz: Values.Clazz): Array { switch (clazz["@kind"]) { diff --git a/src/lang/value/formatNeutral.ts b/src/lang/value/formatNeutral.ts index 73daef9c..300410f7 100644 --- a/src/lang/value/formatNeutral.ts +++ b/src/lang/value/formatNeutral.ts @@ -1,8 +1,8 @@ -import { formatCore } from "../core" -import type { Ctx } from "../ctx" -import type { Mod } from "../mod" -import type { Neutral } from "../neutral" -import { readbackNeutral } from "../readback" +import { formatCore } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import type { Neutral } from "../neutral/index.js" +import { readbackNeutral } from "../readback/index.js" export function formatNeutral(mod: Mod, ctx: Ctx, neutral: Neutral): string { return formatCore(readbackNeutral(mod, ctx, neutral)) diff --git a/src/lang/value/formatType.ts b/src/lang/value/formatType.ts index 9f4a4b15..b8c7b1be 100644 --- a/src/lang/value/formatType.ts +++ b/src/lang/value/formatType.ts @@ -1,8 +1,8 @@ -import { formatCore } from "../core" -import type { Ctx } from "../ctx" -import type { Mod } from "../mod" -import { readbackType } from "../readback" -import type { Value } from "../value" +import { formatCore } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import { readbackType } from "../readback/index.js" +import type { Value } from "../value/index.js" export function formatType(mod: Mod, ctx: Ctx, type: Value): string { return formatCore(readbackType(mod, ctx, type)) diff --git a/src/lang/value/formatTypedValue.ts b/src/lang/value/formatTypedValue.ts index 1a4f5cbd..4d5f262e 100644 --- a/src/lang/value/formatTypedValue.ts +++ b/src/lang/value/formatTypedValue.ts @@ -1,8 +1,8 @@ -import { formatCore } from "../core" -import type { Ctx } from "../ctx" -import type { Mod } from "../mod" -import { readback, readbackType } from "../readback" -import type { TypedValue } from "../value" +import { formatCore } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import { readback, readbackType } from "../readback/index.js" +import type { TypedValue } from "../value/index.js" export function formatTypedValue( mod: Mod, diff --git a/src/lang/value/formatValue.ts b/src/lang/value/formatValue.ts index c87bed97..59ad1de1 100644 --- a/src/lang/value/formatValue.ts +++ b/src/lang/value/formatValue.ts @@ -1,8 +1,8 @@ -import { formatCore } from "../core" -import type { Ctx } from "../ctx" -import type { Mod } from "../mod" -import { readback } from "../readback" -import type { Value } from "../value" +import { formatCore } from "../core/index.js" +import type { Ctx } from "../ctx/index.js" +import type { Mod } from "../mod/index.js" +import { readback } from "../readback/index.js" +import type { Value } from "../value/index.js" export function formatValue( mod: Mod, diff --git a/src/lang/value/index.ts b/src/lang/value/index.ts index 745ef279..77133717 100644 --- a/src/lang/value/index.ts +++ b/src/lang/value/index.ts @@ -1,18 +1,18 @@ -export * from "./TypedValue" -export * from "./Value" -export * from "./assertClazzInCtx" -export * from "./assertTypeInCtx" -export * from "./assertTypesInCtx" -export * from "./clazzClosureApply" -export * from "./clazzExtendCtx" -export * from "./clazzFromTypedValues" -export * from "./clazzFulfill" -export * from "./clazzFulfilledPrepend" -export * from "./clazzLookupProperty" -export * from "./clazzLookupPropertyType" -export * from "./clazzPropertyNames" -export * from "./formatNeutral" -export * from "./formatType" -export * from "./formatTypedValue" -export * from "./formatValue" -export * from "./isClazz" +export * from "./TypedValue.js" +export * from "./Value.js" +export * from "./assertClazzInCtx.js" +export * from "./assertTypeInCtx.js" +export * from "./assertTypesInCtx.js" +export * from "./clazzClosureApply.js" +export * from "./clazzExtendCtx.js" +export * from "./clazzFromTypedValues.js" +export * from "./clazzFulfill.js" +export * from "./clazzFulfilledPrepend.js" +export * from "./clazzLookupProperty.js" +export * from "./clazzLookupPropertyType.js" +export * from "./clazzPropertyNames.js" +export * from "./formatNeutral.js" +export * from "./formatType.js" +export * from "./formatTypedValue.js" +export * from "./formatValue.js" +export * from "./isClazz.js" diff --git a/src/lang/value/isClazz.ts b/src/lang/value/isClazz.ts index ce8a7c84..ff741de9 100644 --- a/src/lang/value/isClazz.ts +++ b/src/lang/value/isClazz.ts @@ -1,5 +1,5 @@ -import type * as Values from "../value" -import type { Value } from "../value" +import type * as Values from "../value/index.js" +import type { Value } from "../value/index.js" export function isClazz(value: Value): value is Values.Clazz { return ["ClazzNull", "ClazzCons", "ClazzFulfilled"].includes(value["@kind"]) diff --git a/src/loader/Loader.ts b/src/loader/Loader.ts index 5c235a98..e7f781a3 100644 --- a/src/loader/Loader.ts +++ b/src/loader/Loader.ts @@ -1,7 +1,7 @@ -import { Fetcher } from "@cicada-lang/framework/lib/fetcher" -import { Mod } from "../lang/mod" -import type { Script } from "../script" -import * as Scripts from "../scripts" +import { Fetcher } from "@cicada-lang/framework/lib/fetcher/index.js" +import { Mod } from "../lang/mod/index.js" +import type { Script } from "../script/index.js" +import * as Scripts from "../scripts/index.js" export class Loader { private cache: Map = new Map() diff --git a/src/loader/index.ts b/src/loader/index.ts index 80aacd08..753abcad 100644 --- a/src/loader/index.ts +++ b/src/loader/index.ts @@ -1 +1 @@ -export * from "./Loader" +export * from "./Loader.js" diff --git a/src/script/Script.ts b/src/script/Script.ts index c3910027..84efd813 100644 --- a/src/script/Script.ts +++ b/src/script/Script.ts @@ -1,4 +1,4 @@ -import type { Mod } from "../lang/mod" +import type { Mod } from "../lang/mod/index.js" export abstract class Script { abstract mod: Mod diff --git a/src/script/index.ts b/src/script/index.ts index b03cdbec..9d4044c1 100644 --- a/src/script/index.ts +++ b/src/script/index.ts @@ -1 +1 @@ -export * from "./Script" +export * from "./Script.js" diff --git a/src/scripts/DefaultScript.ts b/src/scripts/DefaultScript.ts index f1728e26..d19f7e07 100644 --- a/src/scripts/DefaultScript.ts +++ b/src/scripts/DefaultScript.ts @@ -1,7 +1,7 @@ -import * as Errors from "../lang/errors" -import type { Mod } from "../lang/mod" -import { parseStmts } from "../lang/syntax" -import { Script } from "../script" +import * as Errors from "../lang/errors/index.js" +import type { Mod } from "../lang/mod/index.js" +import { parseStmts } from "../lang/syntax/index.js" +import { Script } from "../script/index.js" export class DefaultScript extends Script { constructor( diff --git a/src/scripts/MarkdownScript.ts b/src/scripts/MarkdownScript.ts index f3582fc4..62756503 100644 --- a/src/scripts/MarkdownScript.ts +++ b/src/scripts/MarkdownScript.ts @@ -1,8 +1,8 @@ import * as commonmark from "commonmark" -import * as Errors from "../lang/errors" -import type { Mod } from "../lang/mod" -import { parseStmts } from "../lang/syntax" -import { Script } from "../script" +import * as Errors from "../lang/errors/index.js" +import type { Mod } from "../lang/mod/index.js" +import { parseStmts } from "../lang/syntax/index.js" +import { Script } from "../script/index.js" export class MarkdownScript extends Script { constructor( diff --git a/src/scripts/createScript.ts b/src/scripts/createScript.ts index c94e1aa9..8ea9ab61 100644 --- a/src/scripts/createScript.ts +++ b/src/scripts/createScript.ts @@ -1,6 +1,6 @@ -import type { Mod } from "../lang/mod" -import type { Script } from "../script" -import * as Scripts from "../scripts" +import type { Mod } from "../lang/mod/index.js" +import type { Script } from "../script/index.js" +import * as Scripts from "../scripts/index.js" export function createScript(mod: Mod, text: string): Script { if (mod.options.url.href.endsWith(".md")) { diff --git a/src/scripts/index.ts b/src/scripts/index.ts index 69c97c44..6c6d90a5 100644 --- a/src/scripts/index.ts +++ b/src/scripts/index.ts @@ -1,3 +1,3 @@ -export * from "./DefaultScript" -export * from "./MarkdownScript" -export * from "./createScript" +export * from "./DefaultScript.js" +export * from "./MarkdownScript.js" +export * from "./createScript.js" diff --git a/src/utils/assertEqual.ts b/src/utils/assertEqual.ts index 0378276c..1738ce61 100644 --- a/src/utils/assertEqual.ts +++ b/src/utils/assertEqual.ts @@ -1,4 +1,4 @@ -import { equal } from "./equal" +import { equal } from "./equal.js" export function assertEqual(x: any, y: any): void { if (!equal(x, y)) { diff --git a/src/utils/formatDate.ts b/src/utils/formatDate.ts index e9cebceb..ee901029 100644 --- a/src/utils/formatDate.ts +++ b/src/utils/formatDate.ts @@ -1,4 +1,4 @@ -import { leftPad } from "./leftPad" +import { leftPad } from "./leftPad.js" export function formatDate(t: Date | number): string { if (typeof t === "number") t = new Date(t) diff --git a/tsconfig.json b/tsconfig.json index 7acf723a..4b7619c5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,15 +2,14 @@ "include": ["src"], "compilerOptions": { "lib": ["esnext", "dom"], + "module": "node16", "target": "es6", - "module": "commonjs", - "moduleResolution": "node", - "esModuleInterop": true, - "resolveJsonModule": true, + "strict": true, + "verbatimModuleSyntax": true, "declaration": true, "sourceMap": true, - "strict": true, - "outDir": "lib", - "baseUrl": "." + "declarationMap": true, + "resolveJsonModule": true, + "outDir": "lib" } }