From 876d932c268c838d023d9e7aebbaefb97a5b81e7 Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Sun, 27 Aug 2023 17:34:58 -0700 Subject: [PATCH 1/9] =?UTF-8?q?=F0=9F=90=88.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/config.coffee | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/config.coffee b/source/config.coffee index db0aeb53..2a931715 100644 --- a/source/config.coffee +++ b/source/config.coffee @@ -6,12 +6,12 @@ import { pathToFileURL } from "url" findInDir = (dirPath) -> dir = await fs.opendir dirPath for await entry from dir - if entry.isDirectory() and entry.name is '.config' # scan for ./config.civet as well as ./.config/config.civet + if entry.isDirectory() and entry.name is '.config' # scan for ./civet.json as well as ./.config/civet.json return findInDir path.join dirPath, entry.name - if entry.isFile() - name = entry.name.replace(/^\./, '') # allow both .civetconfig.civet and civetconfig.civet - if name in ['config.civet', 'civet.json', 'civetconfig.civet', 'civetconfig.json'] - return path.join dirPath, entry.name + if entry.isFile() + name = entry.name.replace(/^\./, '') # allow both .civetconfig.civet and civetconfig.civet + if name in ['🐈.json', 'civet.json', 'civetconfig.json'] + return path.join dirPath, entry.name null export findConfig = (startDir) -> @@ -30,7 +30,7 @@ export loadConfig = (path) -> JSON.parse config else js = compile config, js: true - + tmpPath = path + ".civet-tmp-#{Date.now()}.mjs" await fs.writeFile tmpPath, js try @@ -40,4 +40,3 @@ export loadConfig = (path) -> if typeof exports.default isnt 'object' or exports.default is null throw new Error "civet config file must export an object" exports.default - \ No newline at end of file From 9ef1a4b4f96bc7d8fdbfb9b3302da3fd19ff7bda Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Sun, 27 Aug 2023 18:52:16 -0700 Subject: [PATCH 2/9] only json for now --- source/config.coffee | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/source/config.coffee b/source/config.coffee index 2a931715..1e801694 100644 --- a/source/config.coffee +++ b/source/config.coffee @@ -25,18 +25,4 @@ export findConfig = (startDir) -> null export loadConfig = (path) -> - config = await fs.readFile path, 'utf8' - if path.endsWith '.json' - JSON.parse config - else - js = compile config, js: true - - tmpPath = path + ".civet-tmp-#{Date.now()}.mjs" - await fs.writeFile tmpPath, js - try - exports = await import(pathToFileURL(tmpPath)) - finally - await fs.unlink tmpPath - if typeof exports.default isnt 'object' or exports.default is null - throw new Error "civet config file must export an object" - exports.default + JSON.parse await fs.readFile path, 'utf8' From 2fda1f795c8047494c85cfb511466b9dc16a1167 Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Mon, 28 Aug 2023 20:27:30 -0700 Subject: [PATCH 3/9] Added back some .civet config files; config.coffee -> config.mts; more coverage reporting --- build/coffee-esm.mjs | 4 +- build/esbuild.coffee | 22 +++++---- build/hera-esm.mjs | 2 +- package.json | 3 ++ source/config.coffee | 28 ------------ source/config.mts | 72 ++++++++++++++++++++++++++++++ test/infra/config.civet | 9 ++++ test/infra/config/civetconfig.json | 3 ++ 8 files changed, 102 insertions(+), 41 deletions(-) delete mode 100644 source/config.coffee create mode 100644 source/config.mts create mode 100644 test/infra/config.civet create mode 100644 test/infra/config/civetconfig.json diff --git a/build/coffee-esm.mjs b/build/coffee-esm.mjs index e0e673cb..4e55ab4f 100644 --- a/build/coffee-esm.mjs +++ b/build/coffee-esm.mjs @@ -3,9 +3,7 @@ import { readFile } from 'fs/promises'; import { pathToFileURL, fileURLToPath } from 'url'; -import CoffeeScript, { compile } from "coffeescript"; -// Handle cjs .coffee files -CoffeeScript.register() +import { compile } from "coffeescript"; const baseURL = pathToFileURL(process.cwd() + '/').href; const extensionsRegex = /\.coffee$/; diff --git a/build/esbuild.coffee b/build/esbuild.coffee index 2ce6a6fb..1245e4a9 100644 --- a/build/esbuild.coffee +++ b/build/esbuild.coffee @@ -51,21 +51,25 @@ esbuild.build({ }).catch -> process.exit 1 esbuild.build({ - entryPoints: ['source/config.coffee'] - bundle: false + entryPoints: ['source/config.mts'] + bundle: true sourcemap minify watch platform: 'node' format: 'cjs' outfile: 'dist/config.js' - plugins: [ - resolveExtensions - coffeeScriptPlugin - bare: true - inlineMap: sourcemap - heraPlugin - ] + # To get proper extension resolution for non-bundled files, we need to use + # a plugin hack: https://github.com/evanw/esbuild/issues/622#issuecomment-769462611 + # set bundle: true, then rewrite .coffee -> .js and mark as external + plugins: [{ + name: 'rewrite-coffee', + setup: (build) -> + build.onResolve { filter: /\.coffee$/ }, (args) -> + if (args.importer) + path: args.path.replace(/\.coffee$/, ".js") + external: true + }] }).catch -> process.exit 1 for esm in [false, true] diff --git a/build/hera-esm.mjs b/build/hera-esm.mjs index 5b830806..5570d660 100644 --- a/build/hera-esm.mjs +++ b/build/hera-esm.mjs @@ -20,7 +20,7 @@ export async function resolve(specifier, context, defaultResolve) { export async function load(url, context, next) { if (extensionsRegex.test(url)) { - return next(url.replace(extensionsRegex, ".cjs"), { + return next(url, { format: "commonjs" }); } diff --git a/package.json b/package.json index 7bba7a5e..07bfacf5 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,10 @@ "extension": [ ".civet", ".coffee", + ".hera", ".js", + ".mjs", + ".mts", ".ts" ], "include": [ diff --git a/source/config.coffee b/source/config.coffee deleted file mode 100644 index 1e801694..00000000 --- a/source/config.coffee +++ /dev/null @@ -1,28 +0,0 @@ -import path from "path" -import fs from "fs/promises" -import { compile } from "./main" -import { pathToFileURL } from "url" - -findInDir = (dirPath) -> - dir = await fs.opendir dirPath - for await entry from dir - if entry.isDirectory() and entry.name is '.config' # scan for ./civet.json as well as ./.config/civet.json - return findInDir path.join dirPath, entry.name - if entry.isFile() - name = entry.name.replace(/^\./, '') # allow both .civetconfig.civet and civetconfig.civet - if name in ['🐈.json', 'civet.json', 'civetconfig.json'] - return path.join dirPath, entry.name - null - -export findConfig = (startDir) -> - curr = startDir - parent = path.dirname curr - while curr isnt parent # root directory (/, C:, etc.) - if configPath = await findInDir curr - return configPath - curr = parent - parent = path.dirname curr - null - -export loadConfig = (path) -> - JSON.parse await fs.readFile path, 'utf8' diff --git a/source/config.mts b/source/config.mts new file mode 100644 index 00000000..ab7bb6fa --- /dev/null +++ b/source/config.mts @@ -0,0 +1,72 @@ +import path from "path"; +import fs from "fs/promises"; +import { compile } from "./main.coffee"; + +const findInDir = async function (dirPath: string): Promise { + const dir = await fs.opendir(dirPath); + for await (const entry of dir) { + if ( + entry.isDirectory() && + entry.name === ".config" + ) { + // scan for ./civet.json as well as ./.config/civet.json + const found = await findInDir( + path.join(dirPath, entry.name) + ); + if (found) { + return found; + } + } + if (entry.isFile()) { + const name = entry.name.replace(/^\./, ""); // allow both .civetconfig.civet and civetconfig.civet + if ([ + "🐈.json", + "🐈.civet", + "civetconfig.json", + "civetconfig.civet", + ].includes(name)) { + return path.join(dirPath, entry.name); + } + } + } + return +}; + +export var findConfig = async function (startDir: string) { + let curr = startDir, + parent = path.dirname(curr); + + while (curr !== parent) { + // root directory (/, C:, etc.) + const configPath = await findInDir(curr); + if (configPath) { + return configPath; + } + curr = parent; + parent = path.dirname(curr); + } + return; +}; + +export var loadConfig = async function (path: string) { + const config = await fs.readFile(path, "utf8"); + if (path.endsWith(".json")) { + return JSON.parse(config); + } else { + const js = compile(config, { js: true }); + let exports; + + try { + exports = await import(`data:text/javascript,${js}`); + } catch (e) { + console.error("Error loading config file", path, e); + } + + if (typeof exports.default !== "object" || exports.default === null) { + throw new Error( + "civet config file must export an object" + ); + } + return exports.default; + } +}; diff --git a/test/infra/config.civet b/test/infra/config.civet new file mode 100644 index 00000000..7ef058f2 --- /dev/null +++ b/test/infra/config.civet @@ -0,0 +1,9 @@ +assert from assert +{ findConfig, loadConfig } from ../../source/config.mts + +describe "loading config", -> + it "should load from civetconfig.json", -> + path := await findConfig("test/infra/config/") + config := await loadConfig(path) + + assert config.coffeeCompat diff --git a/test/infra/config/civetconfig.json b/test/infra/config/civetconfig.json new file mode 100644 index 00000000..986c6f07 --- /dev/null +++ b/test/infra/config/civetconfig.json @@ -0,0 +1,3 @@ +{ + "coffeeCompat": true +} From 9c68c69d687f41b65fe5c06fcfad673df65cd5ff Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Mon, 28 Aug 2023 20:37:15 -0700 Subject: [PATCH 4/9] more config tests --- test/infra/config.civet | 4 ++++ test/infra/config/customconfig.civet | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 test/infra/config/customconfig.civet diff --git a/test/infra/config.civet b/test/infra/config.civet index 7ef058f2..f8889e30 100644 --- a/test/infra/config.civet +++ b/test/infra/config.civet @@ -7,3 +7,7 @@ describe "loading config", -> config := await loadConfig(path) assert config.coffeeCompat + + it "should load specified custom files", -> + customConfig := await loadConfig("test/infra/config/customconfig.civet") + assert.equal customConfig.someConfig, "heyy" diff --git a/test/infra/config/customconfig.civet b/test/infra/config/customconfig.civet new file mode 100644 index 00000000..0103218f --- /dev/null +++ b/test/infra/config/customconfig.civet @@ -0,0 +1,3 @@ +export default { + someConfig: "heyy" +} From 7517e14e1e4fa50be026194b31f52048221cb5da Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Tue, 29 Aug 2023 09:06:14 -0700 Subject: [PATCH 5/9] =?UTF-8?q?=F0=9F=90=88=F0=9F=90=88=F0=9F=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/esbuild.coffee | 57 ++++++++++---------- package.json | 4 +- source/{bun-civet.coffee => bun-civet.civet} | 0 source/{cli.coffee => cli.civet} | 4 +- source/{config.mts => config.civet} | 2 +- source/{generate.coffee => generate.civet} | 0 source/{main.coffee => main.civet} | 7 ++- source/{util.coffee => util.civet} | 2 +- test/helper.civet | 2 +- test/infra/config.civet | 2 +- test/integration.civet | 4 +- test/sourcemap.civet | 4 +- test/types/js.civet | 2 +- test/util/locations.civet | 2 +- yarn.lock | 7 +++ 15 files changed, 52 insertions(+), 47 deletions(-) rename source/{bun-civet.coffee => bun-civet.civet} (100%) rename source/{cli.coffee => cli.civet} (99%) rename source/{config.mts => config.civet} (97%) rename source/{generate.coffee => generate.civet} (100%) rename source/{main.coffee => main.civet} (95%) rename source/{util.coffee => util.civet} (99%) diff --git a/build/esbuild.coffee b/build/esbuild.coffee index 1245e4a9..ec019afc 100644 --- a/build/esbuild.coffee +++ b/build/esbuild.coffee @@ -1,6 +1,6 @@ esbuild = require "esbuild" -coffeeScriptPlugin = require "esbuild-coffeescript" heraPlugin = require "@danielx/hera/esbuild-plugin" +civetPlugin = require "@danielx/civet/esbuild-plugin" watch = process.argv.includes '--watch' minify = false @@ -30,10 +30,22 @@ extensionResolverPlugin = (extensions) -> return undefined -resolveExtensions = extensionResolverPlugin(["hera", "coffee"]) +resolveExtensions = extensionResolverPlugin(["civet", "hera"]) + +# To get proper extension resolution for non-bundled files, we need to use +# a plugin hack: https://github.com/evanw/esbuild/issues/622#issuecomment-769462611 +# set bundle: true, then rewrite .coffee -> .js and mark as external +rewriteCivetImports = { + name: 'rewrite-civet', + setup: (build) -> + build.onResolve { filter: /\.civet$/ }, (args) -> + if (args.importer) + path: args.path.replace(/\.civet$/, ".js") + external: true +} esbuild.build({ - entryPoints: ['source/cli.coffee'] + entryPoints: ['source/cli.civet'] bundle: false sourcemap minify @@ -43,15 +55,13 @@ esbuild.build({ outfile: 'dist/cli.js' plugins: [ resolveExtensions - coffeeScriptPlugin - bare: true - inlineMap: sourcemap + civetPlugin() heraPlugin ] }).catch -> process.exit 1 esbuild.build({ - entryPoints: ['source/config.mts'] + entryPoints: ['source/config.civet'] bundle: true sourcemap minify @@ -59,22 +69,15 @@ esbuild.build({ platform: 'node' format: 'cjs' outfile: 'dist/config.js' - # To get proper extension resolution for non-bundled files, we need to use - # a plugin hack: https://github.com/evanw/esbuild/issues/622#issuecomment-769462611 - # set bundle: true, then rewrite .coffee -> .js and mark as external - plugins: [{ - name: 'rewrite-coffee', - setup: (build) -> - build.onResolve { filter: /\.coffee$/ }, (args) -> - if (args.importer) - path: args.path.replace(/\.coffee$/, ".js") - external: true - }] + plugins: [ + rewriteCivetImports + civetPlugin() + ] }).catch -> process.exit 1 for esm in [false, true] esbuild.build({ - entryPoints: ['source/main.coffee'] + entryPoints: ['source/main.civet'] bundle: true watch platform: 'node' @@ -82,15 +85,13 @@ for esm in [false, true] outfile: "dist/main.#{if esm then 'mjs' else 'js'}" plugins: [ resolveExtensions - coffeeScriptPlugin - bare: true - inlineMap: sourcemap + civetPlugin() heraPlugin ] }).catch -> process.exit 1 esbuild.build({ - entryPoints: ['source/main.coffee'] + entryPoints: ['source/main.civet'] globalName: "Civet" bundle: true sourcemap @@ -99,15 +100,13 @@ esbuild.build({ outfile: 'dist/browser.js' plugins: [ resolveExtensions - coffeeScriptPlugin - bare: true - inlineMap: sourcemap + civetPlugin() heraPlugin ] }).catch -> process.exit 1 esbuild.build({ - entryPoints: ['source/bun-civet.coffee'] + entryPoints: ['source/bun-civet.civet'] bundle: false sourcemap minify @@ -117,8 +116,6 @@ esbuild.build({ target: "esNext" outfile: 'dist/bun-civet.mjs' plugins: [ - coffeeScriptPlugin - bare: true - inlineMap: sourcemap + civetPlugin() ] }).catch -> process.exit 1 diff --git a/package.json b/package.json index 07bfacf5..623e5e63 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "@cspotcode/source-map-support": "^0.8.1" }, "devDependencies": { + "@danielx/civet": "^0.6.26", "@danielx/hera": "^0.8.8", "@types/assert": "^1.5.6", "@types/coffeescript": "^2.5.2", @@ -88,9 +89,8 @@ ], "loader": [ "ts-node/esm", - "./build/coffee-esm.mjs", "./build/hera-esm.mjs", - "./dist/esm.mjs" + "@danielx/civet/esm" ], "reporter": "dot", "recursive": true, diff --git a/source/bun-civet.coffee b/source/bun-civet.civet similarity index 100% rename from source/bun-civet.coffee rename to source/bun-civet.civet diff --git a/source/cli.coffee b/source/cli.civet similarity index 99% rename from source/cli.coffee rename to source/cli.civet index 8b3f1faa..15194783 100644 --- a/source/cli.coffee +++ b/source/cli.civet @@ -1,3 +1,5 @@ +"civet coffeeCompat" + import {parse, compile, generate} from "./main" import {findConfig, loadConfig} from "./config" {prune} = generate @@ -196,7 +198,7 @@ cli = -> if options.config isnt false # --no-config options.config ?= await findConfig(process.cwd()) - + if options.config options = { ...(await loadConfig options.config), diff --git a/source/config.mts b/source/config.civet similarity index 97% rename from source/config.mts rename to source/config.civet index ab7bb6fa..4ea8dbb8 100644 --- a/source/config.mts +++ b/source/config.civet @@ -1,6 +1,6 @@ import path from "path"; import fs from "fs/promises"; -import { compile } from "./main.coffee"; +import { compile } from "./main.civet"; const findInDir = async function (dirPath: string): Promise { const dir = await fs.opendir(dirPath); diff --git a/source/generate.coffee b/source/generate.civet similarity index 100% rename from source/generate.coffee rename to source/generate.civet diff --git a/source/main.coffee b/source/main.civet similarity index 95% rename from source/main.coffee rename to source/main.civet index 281bdca7..c12476e5 100644 --- a/source/main.coffee +++ b/source/main.civet @@ -2,8 +2,8 @@ import parser from "./parser.hera" { parse } = parser -import generate, { prune } from "./generate.coffee" -import * as util from "./util.coffee" +import generate, { prune } from "./generate.civet" +import * as util from "./util.civet" { SourceMap } = util export { parse, generate, util } @@ -68,8 +68,7 @@ export compile = (src, options) -> filename = options.filename or "unknown" - if filename.endsWith('.coffee') and not - /^(#![^\r\n]*(\r\n|\n|\r))?\s*['"]civet/.test src + if filename.endsWith('.coffee') and not /^(#![^\r\n]*(\r\n|\n|\r))?\s*['"]civet/.test src options.parseOptions.coffeeCompat = true if !options.noCache diff --git a/source/util.coffee b/source/util.civet similarity index 99% rename from source/util.coffee rename to source/util.civet index 1c02070c..4250644b 100644 --- a/source/util.coffee +++ b/source/util.civet @@ -225,7 +225,7 @@ export base64Encode = (src) -> # Accelerate VLQ decoding with a lookup table vlqTable = new Uint8Array(128) -vlqChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +vlqChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; do -> i = 0 l = vlqTable.length diff --git a/test/helper.civet b/test/helper.civet index e6d44f9d..c6c71085 100644 --- a/test/helper.civet +++ b/test/helper.civet @@ -1,4 +1,4 @@ -{ compile } from ../source/main.coffee +{ compile } from ../source/main.civet assert from assert cache := true diff --git a/test/infra/config.civet b/test/infra/config.civet index f8889e30..8bbd0535 100644 --- a/test/infra/config.civet +++ b/test/infra/config.civet @@ -1,5 +1,5 @@ assert from assert -{ findConfig, loadConfig } from ../../source/config.mts +{ findConfig, loadConfig } from ../../source/config.civet describe "loading config", -> it "should load from civetconfig.json", -> diff --git a/test/integration.civet b/test/integration.civet index 378b2c0e..cf8ec88d 100644 --- a/test/integration.civet +++ b/test/integration.civet @@ -1,10 +1,10 @@ fs from fs -{compile as civetCompile} from ../source/main.coffee +{compile as civetCompile} from ../source/main.civet Hera from ../source/parser.hera {parse} := Hera -gen from ../source/generate.coffee +gen from ../source/generate.civet assert from assert diff --git a/test/sourcemap.civet b/test/sourcemap.civet index d5886f2a..b5d1d126 100644 --- a/test/sourcemap.civet +++ b/test/sourcemap.civet @@ -1,7 +1,7 @@ -{compile} from ../source/main.coffee +{compile} from ../source/main.civet assert from assert -{SourceMap} from ../source/util.coffee +{SourceMap} from ../source/util.civet describe "source map", -> it "should generate a source mapping", -> diff --git a/test/types/js.civet b/test/types/js.civet index b1c5bf7a..5fb2de5c 100644 --- a/test/types/js.civet +++ b/test/types/js.civet @@ -1,5 +1,5 @@ assert from assert -{ compile } from ../../source/main.coffee +{ compile } from ../../source/main.civet { testCase } from ../helper.civet describe "Types", -> diff --git a/test/util/locations.civet b/test/util/locations.civet index 19c66f97..5cbcd9f9 100644 --- a/test/util/locations.civet +++ b/test/util/locations.civet @@ -1,5 +1,5 @@ assert from assert -{locationTable, lookupLineColumn} from ../../source/util.coffee +{locationTable, lookupLineColumn} from ../../source/util.civet describe "util", -> describe "locationTable", -> diff --git a/yarn.lock b/yarn.lock index a09ae924..e5035840 100644 --- a/yarn.lock +++ b/yarn.lock @@ -329,6 +329,13 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" +"@danielx/civet@^0.6.26": + version "0.6.26" + resolved "https://registry.yarnpkg.com/@danielx/civet/-/civet-0.6.26.tgz#854ede4134957fbe949a3091e621ecf8cf94a70b" + integrity sha512-YQKANR9Ow3NvzOZAVjTpiniSRWBjIWW8v6KAgVIlrzd8XBbAP1cyeAaWFXzAqOXylzL0map0gyw2tQO5pQq7bw== + dependencies: + "@cspotcode/source-map-support" "^0.8.1" + "@danielx/hera@^0.8.8": version "0.8.8" resolved "https://registry.yarnpkg.com/@danielx/hera/-/hera-0.8.8.tgz#bb64156a9eba75e0c0475091ef78a47470a6d0da" From 4665c87ca2d61cf9998d1c423bbc017d4d8d19b1 Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Tue, 29 Aug 2023 10:15:12 -0700 Subject: [PATCH 6/9] fix build --- build/build.sh | 8 +- build/coffee-esm.mjs | 45 ---- build/{esbuild.coffee => esbuild.civet} | 64 ++--- package.json | 5 +- source/cli.civet | 4 +- source/esbuild-plugin.civet | 10 +- source/esm.civet | 3 +- test/infra/esbuild.civet | 3 +- test/infra/import.civet | 9 +- test/integration.civet | 8 - yarn.lock | 335 +----------------------- 11 files changed, 56 insertions(+), 438 deletions(-) delete mode 100644 build/coffee-esm.mjs rename build/{esbuild.coffee => esbuild.civet} (67%) diff --git a/build/build.sh b/build/build.sh index 0c0ca55b..bdb3e77a 100755 --- a/build/build.sh +++ b/build/build.sh @@ -2,7 +2,7 @@ set -euo pipefail # normal files -coffee build/esbuild.coffee +civet --no-config build/esbuild.civet # cli BIN="dist/civet" @@ -10,12 +10,6 @@ echo "#!/usr/bin/env node" | cat - dist/cli.js > "$BIN" chmod +x "$BIN" rm dist/cli.js -# esbuild-plugin -./dist/civet --no-config --js -c source/esbuild-plugin.civet -o dist/esbuild-plugin.js - -# esm loader -./dist/civet --no-config --js -c source/esm.civet -o dist/esm.mjs - # babel plugin cp source/babel-plugin.mjs dist/babel-plugin.mjs diff --git a/build/coffee-esm.mjs b/build/coffee-esm.mjs deleted file mode 100644 index 4e55ab4f..00000000 --- a/build/coffee-esm.mjs +++ /dev/null @@ -1,45 +0,0 @@ -// Quick and dirty esm loader for .coffee until I transition to .civet - -import { readFile } from 'fs/promises'; -import { pathToFileURL, fileURLToPath } from 'url'; - -import { compile } from "coffeescript"; - -const baseURL = pathToFileURL(process.cwd() + '/').href; -const extensionsRegex = /\.coffee$/; - -export async function resolve(specifier, context, next) { - const { parentURL = baseURL } = context; - - if (extensionsRegex.test(specifier)) { - return { - shortCircuit: true, - format: "coffee", - url: new URL(specifier, parentURL).href, - }; - } - - // Let Node.js handle all other specifiers. - return next(specifier, context); -} - -export async function load(url, context, next) { - if (context.format === "coffee") { - const path = fileURLToPath(url) - const source = await readFile(path, "utf8") - const jsSource = compile(source, { - bare: true, - inlineMap: true, - noHeader: true, - }) - const isESM = /^\s*(import(?!\()|export)\b/m.test(jsSource); - - return next(url + (isESM ? ".mjs" : ".cjs"), { - format: isESM ? "module" : "commonjs", - source: jsSource - }); - } - - // Let Node.js handle all other URLs. - return next(url, context); -} diff --git a/build/esbuild.coffee b/build/esbuild.civet similarity index 67% rename from build/esbuild.coffee rename to build/esbuild.civet index ec019afc..26c8ed1d 100644 --- a/build/esbuild.coffee +++ b/build/esbuild.civet @@ -1,6 +1,9 @@ +"civet coffeeCompat" + esbuild = require "esbuild" heraPlugin = require "@danielx/hera/esbuild-plugin" -civetPlugin = require "@danielx/civet/esbuild-plugin" +# Need to use the packaged version because we may not have built our own yet +civetPlugin = require "../node_modules/@danielx/civet/dist/esbuild-plugin.js" watch = process.argv.includes '--watch' minify = false @@ -35,45 +38,44 @@ resolveExtensions = extensionResolverPlugin(["civet", "hera"]) # To get proper extension resolution for non-bundled files, we need to use # a plugin hack: https://github.com/evanw/esbuild/issues/622#issuecomment-769462611 # set bundle: true, then rewrite .coffee -> .js and mark as external +# Also marking everything else as external since we don't want to bundle anything rewriteCivetImports = { name: 'rewrite-civet', setup: (build) -> - build.onResolve { filter: /\.civet$/ }, (args) -> + build.onResolve { filter: /.*/ }, (args) -> if (args.importer) path: args.path.replace(/\.civet$/, ".js") external: true } -esbuild.build({ - entryPoints: ['source/cli.civet'] - bundle: false - sourcemap - minify - watch - platform: 'node' - format: 'cjs' - outfile: 'dist/cli.js' - plugins: [ - resolveExtensions - civetPlugin() - heraPlugin - ] -}).catch -> process.exit 1 +# Files that need civet imports re-written +# since they aren't actually bundled +["cli", "config", "esbuild-plugin"].forEach (name) -> + esbuild.build({ + entryPoints: ["source/#{name}.civet"] + bundle: true + platform: 'node' + format: 'cjs' + outfile: "dist/#{name}.js" + plugins: [ + rewriteCivetImports + civetPlugin() + ] + }).catch -> process.exit 1 -esbuild.build({ - entryPoints: ['source/config.civet'] - bundle: true - sourcemap - minify - watch - platform: 'node' - format: 'cjs' - outfile: 'dist/config.js' - plugins: [ - rewriteCivetImports - civetPlugin() - ] -}).catch -> process.exit 1 +# esm needs to be a module for import.meta +["esm"].forEach (name) -> + esbuild.build({ + entryPoints: ["source/#{name}.civet"] + bundle: true + platform: 'node' + format: 'esm' + outfile: "dist/#{name}.mjs" + plugins: [ + rewriteCivetImports + civetPlugin() + ] + }).catch -> process.exit 1 for esm in [false, true] esbuild.build({ diff --git a/package.json b/package.json index 7106540a..ea505e38 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "./esm": "./dist/esm.mjs", "./esbuild-plugin": "./dist/esbuild-plugin.js", "./register": "./register.js", - "./config": "./dist/config.js", "./*": "./*", "./dist/*": "./dist/*" }, @@ -46,13 +45,11 @@ "@danielx/civet": "^0.6.26", "@danielx/hera": "^0.8.10", "@types/assert": "^1.5.6", - "@types/coffeescript": "^2.5.2", "@types/mocha": "^9.1.1", "@types/node": "^18.7.8", "axios": "^1.2.2", "c8": "^7.12.0", "esbuild": "^0.14.49", - "esbuild-coffeescript": "^2.1.0", "marked": "^4.2.4", "mocha": "^10.0.0", "prettier": "^2.8.1", @@ -90,7 +87,7 @@ "loader": [ "ts-node/esm", "./build/hera-esm.mjs", - "@danielx/civet/esm" + "./node_modules/@danielx/civet/dist/esm.mjs" ], "reporter": "dot", "recursive": true, diff --git a/source/cli.civet b/source/cli.civet index 15194783..349d7541 100644 --- a/source/cli.civet +++ b/source/cli.civet @@ -1,7 +1,7 @@ "civet coffeeCompat" -import {parse, compile, generate} from "./main" -import {findConfig, loadConfig} from "./config" +import {parse, compile, generate} from "./main.civet" +import {findConfig, loadConfig} from "./config.civet" {prune} = generate version = -> require("../package.json").version diff --git a/source/esbuild-plugin.civet b/source/esbuild-plugin.civet index f76c0288..7174c123 100644 --- a/source/esbuild-plugin.civet +++ b/source/esbuild-plugin.civet @@ -44,11 +44,9 @@ interface Options { next?: Plugin } -{ readFile, writeFile, mkdtemp, rmdir } := require 'fs/promises' -path := require 'path' - -// NOTE: this references the built version of the module, not the source -{ compile } := require "../dist/main.js" +{ readFile, writeFile, mkdtemp, rmdir } from 'fs/promises' +path from 'path' +{ compile } from "./main.civet" // NOTE: this function is named civet so esbuild gets "civet" as the name of the plugin civet := (options: Options = {}): Plugin -> @@ -132,4 +130,4 @@ defaultPlugin := civet() // Default zero-config plugin civet.setup = defaultPlugin.setup -module.exports = civet +export default civet diff --git a/source/esm.civet b/source/esm.civet index c5b60406..3c4913a9 100644 --- a/source/esm.civet +++ b/source/esm.civet @@ -15,8 +15,7 @@ node --loader ts-node/esm --loader @danielx/civet/esm source.civet sourceMapSupport from @cspotcode/source-map-support -// NOTE: this references the built version of the module, not the source -Civet from ../dist/main.js +Civet from ./main.civet { compile, util } := Civet { SourceMap } := util diff --git a/test/infra/esbuild.civet b/test/infra/esbuild.civet index 14eec78a..1a7d848c 100644 --- a/test/infra/esbuild.civet +++ b/test/infra/esbuild.civet @@ -1,6 +1,5 @@ import { createRequire } from 'module' -require := createRequire import.meta.url -esbuildPlugin := require "../../source/esbuild-plugin.civet" +esbuildPlugin from "../../source/esbuild-plugin.civet" assert from assert diff --git a/test/infra/import.civet b/test/infra/import.civet index 9e63f225..eba3b652 100644 --- a/test/infra/import.civet +++ b/test/infra/import.civet @@ -5,16 +5,21 @@ require := createRequire import.meta.url assert from assert -describe "build importable", -> +// The first require is always slow as heck... +describe.skip "build importable", -> it "CommonJS file", -> + @timeout 10000 + // TODO: Why does this take so long here? It is instant in the node repl... Civet := require "../../dist/main.js" assert Civet.compile it "CommonJS directory", -> + @timeout 10000 + // TODO: Why does this take so long here? It is instant in the node repl... Civet := require "../.." assert Civet.compile - it.skip "dynamic ESM file", -> + it "dynamic ESM file", -> @timeout 10000 // TODO: Why does this take 3s? Civet := await import "../../dist/main.mjs" diff --git a/test/integration.civet b/test/integration.civet index cf8ec88d..ed2608e0 100644 --- a/test/integration.civet +++ b/test/integration.civet @@ -8,8 +8,6 @@ gen from ../source/generate.civet assert from assert -CoffeeScript from coffeescript - {convert} from ../source/coffee2civet.civet compile := (src: string) -> @@ -26,9 +24,3 @@ describe "integration", -> src := fs.readFileSync("integration/example/compiler.civet", "utf8") assert civetCompile(src, { sourceMap: true, filename: "integration/example/compiler.civet" }) - -describe "convert coffee ast to civet", -> - it.skip "converts", -> - src := fs.readFileSync("integration/example/generate.coffee", "utf8") - coffeeAst := CoffeeScript.nodes(src).ast({}) - console.log convert(coffeeAst) diff --git a/yarn.lock b/yarn.lock index 1b7a3e21..e04f6fc8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -125,198 +125,11 @@ "@algolia/logger-common" "4.14.3" "@algolia/requester-common" "4.14.3" -"@ampproject/remapping@^2.1.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" - integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== - dependencies: - "@jridgewell/gen-mapping" "^0.1.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@babel/code-frame@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== - dependencies: - "@babel/highlight" "^7.18.6" - -"@babel/compat-data@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.1.tgz#72d647b4ff6a4f82878d184613353af1dd0290f9" - integrity sha512-72a9ghR0gnESIa7jBN53U32FOVCEoztyIlKaNoU05zRhEecduGK9L9c3ww7Mp06JiR+0ls0GBPFJQwwtjn9ksg== - -"@babel/core@^7.1.15": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.1.tgz#c8fa615c5e88e272564ace3d42fbc8b17bfeb22b" - integrity sha512-1H8VgqXme4UXCRv7/Wa1bq7RVymKOzC7znjyFM8KiEzwFqcKUKYNoQef4GhdklgNvoBXyW4gYhuBNCM5o1zImw== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.0" - "@babel/helper-compilation-targets" "^7.19.1" - "@babel/helper-module-transforms" "^7.19.0" - "@babel/helpers" "^7.19.0" - "@babel/parser" "^7.19.1" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.1" - "@babel/types" "^7.19.0" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.1" - semver "^6.3.0" - -"@babel/generator@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.0.tgz#785596c06425e59334df2ccee63ab166b738419a" - integrity sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg== - dependencies: - "@babel/types" "^7.19.0" - "@jridgewell/gen-mapping" "^0.3.2" - jsesc "^2.5.1" - -"@babel/helper-compilation-targets@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.1.tgz#7f630911d83b408b76fe584831c98e5395d7a17c" - integrity sha512-LlLkkqhCMyz2lkQPvJNdIYU7O5YjWRgC2R4omjCTpZd8u8KMQzZvX4qce+/BluN1rcQiV7BoGUpmQ0LeHerbhg== - dependencies: - "@babel/compat-data" "^7.19.1" - "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.21.3" - semver "^6.3.0" - -"@babel/helper-environment-visitor@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" - integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== - -"@babel/helper-function-name@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" - integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== - dependencies: - "@babel/template" "^7.18.10" - "@babel/types" "^7.19.0" - -"@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-module-imports@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" - integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-module-transforms@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz#309b230f04e22c58c6a2c0c0c7e50b216d350c30" - integrity sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.18.6" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.0" - "@babel/types" "^7.19.0" - -"@babel/helper-simple-access@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz#d6d8f51f4ac2978068df934b569f08f29788c7ea" - integrity sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-split-export-declaration@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-string-parser@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz#181f22d28ebe1b3857fa575f5c290b1aaf659b56" - integrity sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw== - -"@babel/helper-validator-identifier@^7.18.6": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - -"@babel/helper-validator-option@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" - integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== - -"@babel/helpers@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.19.0.tgz#f30534657faf246ae96551d88dd31e9d1fa1fc18" - integrity sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg== - dependencies: - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.0" - "@babel/types" "^7.19.0" - -"@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - chalk "^2.0.0" - js-tokens "^4.0.0" - "@babel/parser@^7.16.4": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== -"@babel/parser@^7.18.10", "@babel/parser@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.1.tgz#6f6d6c2e621aad19a92544cc217ed13f1aac5b4c" - integrity sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A== - -"@babel/template@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" - integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.18.10" - "@babel/types" "^7.18.10" - -"@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.1.tgz#0fafe100a8c2a603b4718b1d9bf2568d1d193347" - integrity sha512-0j/ZfZMxKukDaag2PtOPDbwuELqIar6lLskVPPJDjXMXjfLb1Obo/1yjxIGqqAJrmfaTIY3z2wFLAQ7qSkLsuA== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.0" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.19.1" - "@babel/types" "^7.19.0" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.0.tgz#75f21d73d73dc0351f3368d28db73465f4814600" - integrity sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA== - dependencies: - "@babel/helper-string-parser" "^7.18.10" - "@babel/helper-validator-identifier" "^7.18.6" - to-fast-properties "^2.0.0" - "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -484,15 +297,7 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jridgewell/gen-mapping@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" - integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": +"@jridgewell/gen-mapping@^0.3.0": version "0.3.2" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== @@ -506,7 +311,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": +"@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== @@ -565,13 +370,6 @@ resolved "https://registry.yarnpkg.com/@types/assert/-/assert-1.5.6.tgz#a8b5a94ce5fb8f4ba65fdc37fc9507609114189e" integrity sha512-Y7gDJiIqb9qKUHfBQYOWGngUpLORtirAVPuj/CWJrU2C6ZM4/y3XLwuwfGMF8s7QzW746LQZx23m0+1FSgjfug== -"@types/coffeescript@^2.5.2": - version "2.5.2" - resolved "https://registry.yarnpkg.com/@types/coffeescript/-/coffeescript-2.5.2.tgz#6e8c40f49c01612dc3b99580942112ae60ad630a" - integrity sha512-uXfyTfLGQIneVvFuo8jcDSTVjOdiaLZkdkqgZZLy1jhpQqeDetqIBlNtwHzo31bI+krpayapirQjIxXzNtxUxA== - dependencies: - "@babel/core" "^7.1.15" - "@types/istanbul-lib-coverage@^2.0.1": version "2.0.4" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" @@ -764,13 +562,6 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -852,16 +643,6 @@ browser-stdout@1.3.1: resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserslist@^4.21.3: - version "4.21.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" - integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== - dependencies: - caniuse-lite "^1.0.30001400" - electron-to-chromium "^1.4.251" - node-releases "^2.0.6" - update-browserslist-db "^1.0.9" - buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" @@ -890,20 +671,6 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001400: - version "1.0.30001411" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001411.tgz#303c8594ca5903b193a6d875ac613548cb73379a" - integrity sha512-HPnJKESKuhKpHvMY1/ux7J3nG7xG8jRuL4lbyCjDRm0doTNV91tcRk60xrP7Ym9DtJH/yuqntDWBJCqpXB4b7g== - -chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -936,18 +703,6 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" -coffeescript@^2.6.1: - version "2.7.0" - resolved "https://registry.yarnpkg.com/coffeescript/-/coffeescript-2.7.0.tgz#a43ec03be6885d6d1454850ea70b9409c391279c" - integrity sha512-hzWp6TUE2d/jCcN67LrW1eh5b/rSDKQK6oD6VMLlggYVUUFexgTH9z3dNYihzX4RMhze5FTUsUmOXViJKFQR/A== - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -955,11 +710,6 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -982,7 +732,7 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -convert-source-map@^1.6.0, convert-source-map@^1.7.0: +convert-source-map@^1.6.0: version "1.8.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== @@ -1008,7 +758,7 @@ csstype@^2.6.8: resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.21.tgz#2efb85b7cc55c80017c66a5ad7cbd931fda3a90e" integrity sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w== -debug@4.3.4, debug@^4.1.0: +debug@4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -1035,11 +785,6 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -electron-to-chromium@^1.4.251: - version "1.4.261" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.261.tgz#31f14ad60c6f95bec404a77a2fd5e1962248e112" - integrity sha512-fVXliNUGJ7XUVJSAasPseBbVgJIeyw5M1xIkgXdTSRjlmCqBbiSTsEdLOCJS31Fc8B7CaloQ/BFAg8By3ODLdg== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -1055,14 +800,6 @@ esbuild-android-arm64@0.14.53: resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.53.tgz#2158253d4e8f9fdd2a081bbb4f73b8806178841e" integrity sha512-PC7KaF1v0h/nWpvlU1UMN7dzB54cBH8qSsm7S9mkwFA1BXpaEOufCg8hdoEI1jep0KeO/rjZVWrsH8+q28T77A== -esbuild-coffeescript@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/esbuild-coffeescript/-/esbuild-coffeescript-2.1.0.tgz#0e254d5d9eab8613d224c6ff0ffb7156743b3f7d" - integrity sha512-pIgTShNLhKnaK/+EKYP3MCmpNFTptHi/jCvJBcIU2vLuTFlHmFfZy88NcqWu9ykKCTMBHV/slq2hsr+TYDgU2g== - dependencies: - coffeescript "^2.6.1" - esbuild "^0.14.14" - esbuild-darwin-64@0.14.53: version "0.14.53" resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.53.tgz#b4681831fd8f8d06feb5048acbe90d742074cc2a" @@ -1153,7 +890,7 @@ esbuild-windows-arm64@0.14.53: resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.53.tgz#f71d403806bdf9f4a1f9d097db9aec949bd675c8" integrity sha512-E+5Gvb+ZWts+00T9II6wp2L3KG2r3iGxByqd/a1RmLmYWVsSVUjkvIxZuJ3hYTIbhLkH5PRwpldGTKYqVz0nzQ== -esbuild@^0.14.14, esbuild@^0.14.49: +esbuild@^0.14.49: version "0.14.53" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.53.tgz#20b1007f686e8584f2a01a1bec5a37aac9498ce4" integrity sha512-ohO33pUBQ64q6mmheX1mZ8mIXj8ivQY/L4oVuAshr+aJI+zLl+amrp3EodrUNDNYVrKJXGPfIHFGhO8slGRjuw== @@ -1218,11 +955,6 @@ escape-string-regexp@4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - estree-walker@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" @@ -1280,11 +1012,6 @@ fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -1321,16 +1048,6 @@ glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -1425,11 +1142,6 @@ istanbul-reports@^3.1.4: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - js-yaml@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -1437,16 +1149,6 @@ js-yaml@4.1.0: dependencies: argparse "^2.0.1" -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -json5@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab" - integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ== - jsonc-parser@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" @@ -1570,11 +1272,6 @@ nanoid@^3.3.6: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== -node-releases@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" - integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== - normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -1702,7 +1399,7 @@ safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -semver@^6.0.0, semver@^6.3.0: +semver@^6.0.0: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== @@ -1791,13 +1488,6 @@ supports-color@8.1.1: dependencies: has-flag "^4.0.0" -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -1824,11 +1514,6 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -1865,14 +1550,6 @@ typescript@^4.7.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== -update-browserslist-db@^1.0.9: - version "1.0.9" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.9.tgz#2924d3927367a38d5c555413a7ce138fc95fcb18" - integrity sha512-/xsqn21EGVdXI3EXSum1Yckj3ZVZugqyOZQ/CxYPBD/R+ko9NSUScf8tFF4dOKY+2pvSSJA/S+5B8s4Zr4kyvg== - dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" - v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" From 6a980b241ff84860c1cf4282391934ec04c08dba Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Tue, 29 Aug 2023 19:43:00 -0700 Subject: [PATCH 7/9] lib.ts -> lib.civet --- source/{lib.ts => lib.civet} | 146 +++++++++++++++++------------------ source/parser.hera | 2 +- 2 files changed, 73 insertions(+), 75 deletions(-) rename source/{lib.ts => lib.civet} (96%) diff --git a/source/lib.ts b/source/lib.civet similarity index 96% rename from source/lib.ts rename to source/lib.civet index 4b64c26b..0cfca5d4 100644 --- a/source/lib.ts +++ b/source/lib.civet @@ -124,10 +124,10 @@ function addPostfixStatement(statement: StatementTuple, ws: ASTNode, post) { } children = [...post.children] - children./**/push(block) + children.push(block) // This removes trailing whitespace for easier testing - if (!isWhitespaceOrEmpty(ws)) children./**/push(ws) + if (!isWhitespaceOrEmpty(ws)) children.push(ws) post = { ...post, children, block } if (post.type === "IfStatement") { @@ -141,8 +141,8 @@ function addPostfixStatement(statement: StatementTuple, ws: ASTNode, post) { * see test/function.civet binding pattern */ function adjustAtBindings(statements: ASTNode, asThis = false) { - gatherRecursiveAll(statements, n => n.type === "AtBindingProperty") - .forEach(binding => { + gatherRecursiveAll(statements, (n) => n.type === "AtBindingProperty") + .forEach((binding) => { const { ref } = binding if (asThis) { @@ -190,7 +190,7 @@ function adjustBindingElements(elements: ASTNodeBase[]) { const after = elements.slice(restIndex + 1) const restIdentifier = rest.binding.ref || rest.binding - names./**/push(...rest.names || []) + names.push(...rest.names || []) let l = after.length @@ -201,7 +201,7 @@ function adjustBindingElements(elements: ASTNodeBase[]) { blockPrefix = { type: "PostRestBindingElements", children: ["[", insertTrimmingSpace(after, ""), "] = ", restIdentifier, ".splice(-", l.toString(), ")"], - names: after.flatMap(p => p.names), + names: after.flatMap((p) => p.names), } } @@ -419,7 +419,7 @@ function dedentBlockString({ $loc, token: str }: ASTLeaf, spacing, trim = true) } // escape unescaped backticks and `${` - str = str.replace(/(\\.|`|\$\{)/g, s => { + str = str.replace(/(\\.|`|\$\{)/g, (s) => { if (s[0] === "\\") { return s } @@ -496,10 +496,10 @@ function deepCopy(node: ASTNode) { function expressionizeIfClause(clause, b, e) { const children = clause.children.slice(1) // Remove 'if' - children./**/push("?", b) // Add ternary + children.push("?", b) // Add ternary if (e) { // Remove 'else' - children./**/push(e[0], ":", ...e.slice(2)) + children.push(e[0], ":", ...e.slice(2)) } else { children.push(":void 0") @@ -531,7 +531,8 @@ function expressionizeIteration(exp) { insertPush(block, resultsRef) // Wrap with IIFE - children.splice(i, 1, + children.splice(i, + 1, ...wrapIIFE([ ["", ["const ", resultsRef, "=[]"], ";"], ...children, @@ -818,7 +819,7 @@ function insertPush(node, ref) { // NOTE: CoffeeScript doesn't add a push to an empty catch block but does add if there is any statement in the catch block // we always add a push to the catch block // NOTE: does not insert a push in the finally block - exp.blocks.forEach(block => insertPush(block, ref)) + exp.blocks.forEach((block) => insertPush(block, ref)) return } @@ -933,7 +934,7 @@ function expandChainedComparisons([first, binops]) { return existence.expression } return exp - } + }; } function processParams(f) { @@ -968,7 +969,7 @@ function processParams(f) { } const prefix = splices - .map(s => ["let ", s]) + .map((s) => ["let ", s]) .concat(thisAssignments) .map((s) => s.type ? { @@ -981,11 +982,11 @@ function processParams(f) { if (!prefix.length) return // In constructor definition, insert prefix after first super() call if (isConstructor) { - const superCalls = gatherNodes(expressions, exp => - exp.type === "CallExpression" && exp.children[0]?.token === "super") + const superCalls = gatherNodes expressions, (exp) => + exp.type === "CallExpression" && exp.children[0]?.token === "super" if (superCalls.length) { const {child} = findAncestor(superCalls[0], - ancestor => ancestor === block) + (ancestor) => ancestor === block) const index = findChildIndex(expressions, child) if (index < 0) { throw new Error("Could not find super call within top-level expressions") @@ -1030,13 +1031,15 @@ function findChildIndex(parent, child) { const len = children.length for (let i = 0; i < len; i++) { const c = children[i] - if (c === child || (Array.isArray(c) && arrayRecurse(c))) return i + if (c === child || (Array.isArray(c) && arrayRecurse(c))) + return i } function arrayRecurse(array) { const len = array.length for (let i = 0; i < len; i++) { const c = array[i] - if (c === child || (Array.isArray(c) && arrayRecurse(c))) return true + if (c === child || (Array.isArray(c) && arrayRecurse(c))) + return true } } return -1 @@ -1159,12 +1162,12 @@ function hasYield(exp) { function hoistRefDecs(statements: StatementTuple[]) { gatherRecursiveAll(statements, (s) => s.hoistDec) - .forEach(node => { + .forEach((node) => { let { hoistDec } = node node.hoistDec = null - const { ancestor, child } = findAncestor(node, (ancestor) => - ancestor.type === "BlockStatement" && (!ancestor.bare || ancestor.root)) + const { ancestor, child } = findAncestor node, (ancestor) => + ancestor.type === "BlockStatement" && (!ancestor.bare || ancestor.root) if (ancestor) { insertHoistDec(ancestor, child, hoistDec) @@ -1179,7 +1182,7 @@ function hoistRefDecs(statements: StatementTuple[]) { function insertHoistDec(block, node, dec) { // NOTE: This is more accurately 'statements' const { expressions } = block - const index = expressions.findIndex(exp => exp === node || + const index = expressions.findIndex((exp) => exp === node || (Array.isArray(exp) && exp[1] === node)) if (index < 0) throw new Error("Couldn't find expression in block for hoistable declaration.") if (expressions[index] === node) { @@ -1196,7 +1199,7 @@ function patternAsValue(pattern) { const children = [...pattern.children] const index = children.indexOf(pattern.elements) if (index < 0) throw new Error("failed to find elements in ArrayBindingPattern") - children[index] = pattern.elements.map(el => { + children[index] = pattern.elements.map((el) => { const [ws, e, delim] = el.children return { ...el, children: [ws, patternAsValue(e), delim] } }) @@ -1301,7 +1304,7 @@ function insertReturn(node) { insertSwitchReturns(exp) return case "TryStatement": - exp.blocks.forEach(block => insertReturn(block)) + exp.blocks.forEach((block) => insertReturn(block)) // NOTE: do not insert a return in the finally block return } @@ -1658,7 +1661,7 @@ function gatherBindingCode(statements: ASTNode, opts?: { injectParamProps?: bool const splices: unknown[] = [] function insertRestSplices(s, p: unknown[], thisAssignments: ThisAssignments) { - gatherRecursiveAll(s, n => n.blockPrefix || (opts?.injectParamProps && n.accessModifier) || n.type === "AtBinding") + gatherRecursiveAll(s, (n) => n.blockPrefix || (opts?.injectParamProps && n.accessModifier) || n.type === "AtBinding") .forEach((n) => { // Insert `this` assignments if (n.type === "AtBinding") { @@ -1668,7 +1671,7 @@ function gatherBindingCode(statements: ASTNode, opts?: { injectParamProps?: bool } if (opts?.injectParamProps && n.type === "Parameter" && n.accessModifier) { - n.names.forEach(id => { + n.names.forEach((id) => { thisAssignments.push({ type: "AssignmentExpression", children: [`this.${id} = `, id], @@ -1927,7 +1930,7 @@ function maybeRef(exp: ASTNode, base: string = "ref"): ASTNode { // Return an array of Rule names that correspond to the current call stack function parsePosition() { let s = Error().stack.split(/\n at /) - s./**/shift() + s.shift() s = s.filter((e) => !e.match(/^eval/)).map((e) => e.split(' ')[0]) s = s.slice(1, s.indexOf('Program') + 1) @@ -1986,7 +1989,7 @@ function processAssignmentDeclaration(decl, id, suffix, ws, assign, e) { if (exp?.children?.[0]?.token?.match(/^\s+$/)) exp.children.shift() if (id.type === "Identifier" && exp?.type === "FunctionExpression" && !exp.id) { - const i = exp.children.findIndex(c => c?.token === "function") + 1 + const i = exp.children.findIndex((c) => c?.token === "function") + 1 exp = { ...exp, // Insert id, type suffix, spacing @@ -1998,8 +2001,8 @@ function processAssignmentDeclaration(decl, id, suffix, ws, assign, e) { let [splices, thisAssignments] = gatherBindingCode(id) - splices = splices.map(s => [", ", s]) - thisAssignments = thisAssignments.map(a => ["", a, ";"]) + splices = splices.map((s) => [", ", s]) + thisAssignments = thisAssignments.map((a) => ["", a, ";"]) const initializer = [ws, assign, e] const binding = { @@ -2082,13 +2085,13 @@ function processFunctions(statements, config) { function processSwitchExpressions(statements) { // switch expressions are wrapped in iife and need returns added - gatherRecursiveAll(statements, n => n.type === "SwitchExpression") + gatherRecursiveAll(statements, (n) => n.type === "SwitchExpression") .forEach(insertSwitchReturns) } function processTryExpressions(statements) { // try expressions are wrapped in iife and need returns added - gatherRecursiveAll(statements, n => n.type === "TryExpression") + gatherRecursiveAll(statements, (n) => n.type === "TryExpression") .forEach(({ blocks }) => { blocks.forEach(insertReturn); }) @@ -2099,14 +2102,14 @@ function processBindingPatternLHS(lhs, tail) { adjustAtBindings(lhs, true) const [splices, thisAssignments] = gatherBindingCode(lhs) // TODO: This isn't quite right for compound assignments, may need to wrap with parens and use comma to return the complete value - tail.push(...splices.map(s => [", ", s]), ...thisAssignments.map(a => [", ", a])) + tail.push(...splices.map((s) => [", ", s]), ...thisAssignments.map((a) => [", ", a])) } function processAssignments(statements) { // Move assignments/updates within LHS of assignments/updates // to run earlier via comma operator - gatherRecursiveAll(statements, n => n.type === "AssignmentExpression" || n.type === "UpdateExpression") - .forEach(exp => { + gatherRecursiveAll(statements, (n) => n.type === "AssignmentExpression" || n.type === "UpdateExpression") + .forEach((exp) => { function extractAssignment(lhs) { let expr = lhs while (expr.type === "ParenthesizedExpression") { @@ -2147,8 +2150,8 @@ function processAssignments(statements) { if (post.length) exp.children.push(...post) }) - gatherRecursiveAll(statements, n => n.type === "AssignmentExpression" && n.names === null) - .forEach(exp => { + gatherRecursiveAll(statements, (n) => n.type === "AssignmentExpression" && n.names === null) + .forEach((exp) => { let { lhs: $1, exp: $2 } = exp, tail = [], i = 0, len = $1.length // identifier= @@ -2180,8 +2183,8 @@ function processAssignments(statements) { // Wrap with parens to distinguish from braced blocks if (!wrapped) { wrapped = true - lhs.children./**/splice(0, 0, "(") - tail./**/push(")") + lhs.children.splice(0, 0, "(") + tail.push(")") } } } @@ -2216,8 +2219,8 @@ function processAssignments(statements) { c[5] = ")" // Remove assignment token - lastAssignment./**/pop() - if (isWhitespaceOrEmpty(lastAssignment[2])) lastAssignment./**/pop() + lastAssignment.pop() + if (isWhitespaceOrEmpty(lastAssignment[2])) lastAssignment.pop() // TODO: this only works for the last assignment, not multiple splice assignments, or splice assignments earlier in the chain if ($1.length > 1) { throw new Error("Not implemented yet! TODO: Handle multiple splice assignments") @@ -2270,7 +2273,7 @@ function getPatternConditions(pattern, ref, conditions) { switch (pattern.type) { case "ArrayBindingPattern": { const { elements, length } = pattern, - hasRest = elements.some(e => e.rest), + hasRest = elements.some((e) => e.rest), comparator = hasRest ? " >= " : " === ", l = [comparator, (length - hasRest).toString()] @@ -2465,8 +2468,8 @@ function nonMatcherBindings(pattern) { } function aggregateDuplicateBindings(bindings, ReservedWord) { - const props = gatherRecursiveAll(bindings, n => n.type === "BindingProperty") - const arrayBindings = gatherRecursiveAll(bindings, n => n.type === "ArrayBindingPattern") + const props = gatherRecursiveAll(bindings, (n) => n.type === "BindingProperty") + const arrayBindings = gatherRecursiveAll(bindings, (n) => n.type === "ArrayBindingPattern") arrayBindings.forEach((a) => { const { elements } = a @@ -2534,7 +2537,7 @@ function aggregateDuplicateBindings(bindings, ReservedWord) { } function processPatternMatching(statements, ReservedWord) { - gatherRecursiveAll(statements, n => n.type === "SwitchStatement" || n.type === "SwitchExpression") + gatherRecursiveAll(statements, (n) => n.type === "SwitchStatement" || n.type === "SwitchExpression") .forEach((s) => { const { caseBlock } = s const { clauses } = caseBlock @@ -2627,14 +2630,14 @@ function processPatternMatching(statements, ReservedWord) { let [splices, thisAssignments] = gatherBindingCode(pattern) const patternBindings = nonMatcherBindings(pattern) - splices = splices.map(s => [", ", nonMatcherBindings(s)]) - thisAssignments = thisAssignments.map(a => [indent, a, ";"]) + splices = splices.map((s) => [", ", nonMatcherBindings(s)]) + thisAssignments = thisAssignments.map((a) => [indent, a, ";"]) const duplicateDeclarations = aggregateDuplicateBindings([patternBindings, splices], ReservedWord) prefix.push([indent, "const ", patternBindings, " = ", ref, splices, ";"]) prefix.push(...thisAssignments) - prefix.push(...duplicateDeclarations.map(d => [indent, d, ";"])) + prefix.push(...duplicateDeclarations.map((d) => [indent, d, ";"])) break } @@ -2682,7 +2685,7 @@ function processPatternMatching(statements, ReservedWord) { // body: [ws, pipe, ws, expr][] function processPipelineExpressions(statements) { - gatherRecursiveAll(statements, n => n.type === "PipelineExpression") + gatherRecursiveAll(statements, (n) => n.type === "PipelineExpression") .forEach((s) => { const [ws, , body] = s.children let [, arg] = s.children @@ -2703,7 +2706,7 @@ function processPipelineExpressions(statements) { if (pipe.token === "|>=") { let initRef if (i === 0) { - outer: switch (arg.type) { + :outer switch (arg.type) { case "MemberExpression": // If there is only a single access then we don't need a ref if (arg.children.length <= 2) break @@ -2857,7 +2860,7 @@ function processProgram(root: BlockStatement, config, m, ReservedWord) { processTryExpressions(statements) // Modify iteration expressions - gatherRecursiveAll(statements, n => n.type === "IterationExpression") + gatherRecursiveAll(statements, (n) => n.type === "IterationExpression") .forEach((e) => expressionizeIteration(e)) // Hoist hoistDec attributes to actual declarations. @@ -2886,7 +2889,7 @@ function processProgram(root: BlockStatement, config, m, ReservedWord) { function findDecs(statements) { const declarationNames = gatherNodes(statements, ({ type }) => type === "Declaration") - .flatMap(d => d.names) + .flatMap((d) => d.names) return new Set(declarationNames) } @@ -2938,7 +2941,7 @@ function createVarDecs(statements, scopes, pushVar) { if (assignmentStatements.length) { // Get nested assignments that could be in expressions assignmentStatements = assignmentStatements - .concat(findAssignments(assignmentStatements.map(s => s.children), decs)) + .concat(findAssignments(assignmentStatements.map((s) => s.children), decs)) } return assignmentStatements @@ -2947,7 +2950,7 @@ function createVarDecs(statements, scopes, pushVar) { // Let descendent blocks add the var at the outer enclosing function scope if (!pushVar) { pushVar = function (name) { - varIds./**/push(name) + varIds.push(name) decs.add(name) } } @@ -2956,7 +2959,7 @@ function createVarDecs(statements, scopes, pushVar) { scopes.push(decs) const varIds = [] const assignmentStatements = findAssignments(statements, scopes) - const undeclaredIdentifiers = assignmentStatements.flatMap(a => a.names) + const undeclaredIdentifiers = assignmentStatements.flatMap((a) => a.names) // Unique, undeclared identifiers in this scope undeclaredIdentifiers.filter((x, i, a) => { @@ -2972,23 +2975,20 @@ function createVarDecs(statements, scopes, pushVar) { forNodes.forEach(({ block }) => blockNodes.delete(block)) // recurse into nested blocks - blockNodes.forEach((block) => { + blockNodes.forEach (block) => createVarDecs(block.expressions, scopes, pushVar) - }) // recurse into for loops - forNodes.forEach(({ block, declaration }) => { + forNodes.forEach ({ block, declaration }) => scopes.push(new Set(declaration.names)) createVarDecs(block.expressions, scopes, pushVar) scopes.pop() - }) // recurse into nested functions - fnNodes.forEach(({ block, parameters }) => { + fnNodes.forEach ({ block, parameters }) => scopes.push(new Set(parameters.names)) createVarDecs(block.expressions, scopes) scopes.pop() - }) if (varIds.length) { // get indent from first statement @@ -3006,16 +3006,15 @@ function createVarDecs(statements, scopes, pushVar) { function createConstLetDecs(statements, scopes, letOrConst: "let" | "const") { function findVarDecs(statements, decs) { - const declarationNames = gatherRecursive(statements, - (node) => + const declarationNames = gatherRecursive statements, (node) => node.type === "Declaration" && node.children && node.children.length > 0 && node.children[0].token && node.children[0].token.startsWith('var') || - node.type === "FunctionExpression") - .filter(node => node.type === "Declaration") - .flatMap(node => node.names) + node.type === "FunctionExpression" + .filter((node) => node.type === "Declaration") + .flatMap((node) => node.names) return new Set(declarationNames) } @@ -3069,7 +3068,7 @@ function createConstLetDecs(statements, scopes, letOrConst: "let" | "const") { } // Assignment and Declaration all use 'names'. if (node.names == null) continue - let names = node.names.filter(name => !hasDec(name)) + let names = node.names.filter((name) => !hasDec(name)) if (node.type == "AssignmentExpression") undeclaredIdentifiers.push(...names) names.forEach((name) => currentScope.add(name)) @@ -3117,7 +3116,7 @@ function processReturnValue(func) { const ref = makeRef("ret") let declared - values.forEach(value => { + values.forEach((value) => { value.children = [ref] // Check whether return.value already declared within this function @@ -3151,7 +3150,7 @@ function processReturnValue(func) { // Transform existing `return` -> `return ret` gatherRecursiveWithinFunction(block, - r => r.type === "ReturnStatement" && !r.expression) + (r) => r.type === "ReturnStatement" && !r.expression) .forEach((r) => { r.expression = ref r.children.splice(-1, 1, " ", ref) @@ -3198,7 +3197,7 @@ function processUnaryExpression(pre, exp, post) { if (exp.type === "Literal") { if (pre.length === 1 && pre[0].token === "-") { const children = [pre[0], ...exp.children] - if (post) exp.children./**/push(post) + if (post) exp.children.push(post) return { type: "Literal", @@ -3252,7 +3251,7 @@ function prune(node: ASTNode): ASTNode { } function reorderBindingRestProperty(props) { - const names = props.flatMap(p => p.names) + const names = props.flatMap((p) => p.names) let restIndex = -1 let restCount = 0 @@ -3276,8 +3275,7 @@ function reorderBindingRestProperty(props) { // Swap delimiters of last property and rest so that an omitted trailing comma doesn't end up in the middle if (after.length) { - const - {delim: restDelim} = rest, + const {delim: restDelim} = rest, lastAfterProp = after[after.length - 1], {delim: lastDelim, children: lastAfterChildren} = lastAfterProp @@ -3339,7 +3337,7 @@ function skipIfOnlyWS(target) { if (Array.isArray(target)) { if (target.length === 1) { return skipIfOnlyWS(target[0]) - } else if (target.every(e => (skipIfOnlyWS(e) === undefined))) { + } else if (target.every((e) => (skipIfOnlyWS(e) === undefined))) { return undefined } return target diff --git a/source/parser.hera b/source/parser.hera index 87f8b78f..fc2081e5 100644 --- a/source/parser.hera +++ b/source/parser.hera @@ -42,7 +42,7 @@ const { replaceNodes, typeOfJSX, wrapIIFE, -} = require("./lib.ts") +} = require("./lib.civet") ``` Program From efb2e0606aac4f430ee3c7f373185e040024e513 Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Tue, 29 Aug 2023 19:53:46 -0700 Subject: [PATCH 8/9] civitify config.civet --- source/config.civet | 106 ++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 59 deletions(-) diff --git a/source/config.civet b/source/config.civet index 4ea8dbb8..2570b875 100644 --- a/source/config.civet +++ b/source/config.civet @@ -1,72 +1,60 @@ -import path from "path"; -import fs from "fs/promises"; -import { compile } from "./main.civet"; +path from path +fs from fs/promises +{ compile } from ./main.civet -const findInDir = async function (dirPath: string): Promise { - const dir = await fs.opendir(dirPath); - for await (const entry of dir) { - if ( - entry.isDirectory() && - entry.name === ".config" - ) { +configFileNames := new Set [ + "🐈.json" + "🐈.civet" + "civetconfig.json" + "civetconfig.civet" +] + +function findInDir(dirPath: string): Promise + dir := await fs.opendir(dirPath) + for await entry of dir + if entry.isDirectory() and entry.name === ".config" // scan for ./civet.json as well as ./.config/civet.json const found = await findInDir( path.join(dirPath, entry.name) ); - if (found) { - return found; - } - } - if (entry.isFile()) { + return found if found + + if entry.isFile() const name = entry.name.replace(/^\./, ""); // allow both .civetconfig.civet and civetconfig.civet - if ([ - "🐈.json", - "🐈.civet", - "civetconfig.json", - "civetconfig.civet", - ].includes(name)) { - return path.join(dirPath, entry.name); - } - } - } + if configFileNames.has name + return path.join dirPath, entry.name + return -}; -export var findConfig = async function (startDir: string) { - let curr = startDir, - parent = path.dirname(curr); +export function findConfig(startDir: string) + curr .= startDir + parent .= path.dirname curr - while (curr !== parent) { + while curr !== parent // root directory (/, C:, etc.) - const configPath = await findInDir(curr); - if (configPath) { - return configPath; - } - curr = parent; - parent = path.dirname(curr); - } - return; -}; + configPath := await findInDir curr + return configPath if configPath -export var loadConfig = async function (path: string) { - const config = await fs.readFile(path, "utf8"); - if (path.endsWith(".json")) { - return JSON.parse(config); - } else { - const js = compile(config, { js: true }); - let exports; + curr = parent + parent = path.dirname curr - try { - exports = await import(`data:text/javascript,${js}`); - } catch (e) { - console.error("Error loading config file", path, e); - } + return - if (typeof exports.default !== "object" || exports.default === null) { - throw new Error( - "civet config file must export an object" - ); - } - return exports.default; - } -}; +export function loadConfig(path: string) + config := await fs.readFile path, "utf8" + + if path.endsWith ".json" + JSON.parse config + else + js := compile config, js: true + let exports + + try + exports = await import `data:text/javascript,${js}` + catch e + console.error "Error loading config file", path, e + + if typeof exports.default !== "object" or exports.default === null + throw new Error "civet config file must export an object" + + exports.default From 330cb36331d1d11d43006db3589f4c8c7401f338 Mon Sep 17 00:00:00 2001 From: Daniel Moore Date: Tue, 29 Aug 2023 20:02:07 -0700 Subject: [PATCH 9/9] state-cache.civet --- source/main.civet | 2 +- source/{state-cache.mts => state-cache.civet} | 0 test/util/state-cache.civet | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename source/{state-cache.mts => state-cache.civet} (100%) diff --git a/source/main.civet b/source/main.civet index c12476e5..cd7e88a6 100644 --- a/source/main.civet +++ b/source/main.civet @@ -7,7 +7,7 @@ import * as util from "./util.civet" { SourceMap } = util export { parse, generate, util } -import StateCache from "./state-cache.mts" +import StateCache from "./state-cache.civet" # Need to no-cache any rule that directly modifies parser state # indentation stack, jsx stack, etc. diff --git a/source/state-cache.mts b/source/state-cache.civet similarity index 100% rename from source/state-cache.mts rename to source/state-cache.civet diff --git a/test/util/state-cache.civet b/test/util/state-cache.civet index d9534580..d0034d20 100644 --- a/test/util/state-cache.civet +++ b/test/util/state-cache.civet @@ -1,4 +1,4 @@ -StateCache from ../../source/state-cache.mts +StateCache from ../../source/state-cache.civet assert from assert describe "StateCache", ->