From 6f9ccd08950d4bf0f6f2096d443984fd8d52084c Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Sat, 21 Dec 2024 03:28:36 +0300 Subject: [PATCH 01/22] Update dependabot.yml --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b417983..bab7b01 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,8 @@ updates: directory: "/" # Location of package manifests schedule: interval: "daily" + groups: + all: + patterns: + - "*" + From 73cf66e831eef3a1a081ee818a59992dd530dc69 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Sun, 22 Dec 2024 04:22:49 +0300 Subject: [PATCH 02/22] saving and loading import dependencies --- src/library-manager.ts | 88 ++++++++++++++++++++++++++------- src/preexpand-helpers.ts | 1 + test-project/.rts/main.rts.json | 8 ++- test-project/.rts/mod.rts.json | 3 +- 4 files changed, 81 insertions(+), 19 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index 326bc36..03eda69 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -19,10 +19,11 @@ import { Binding, CompilationUnit, Context, Loc, Rib } from "./syntax-structures import stringify from "json-stringify-pretty-compact"; import { init_global_context } from "./global-module"; -const cookie = "rewrite-ts-013"; +const cookie = "rewrite-ts-016"; type module_state = | { type: "initial" } + | { type: "initializing"; promise: Promise } | { type: "stale"; cid: string; pkg: Package; pkg_relative_path: string } | { type: "fresh"; @@ -32,6 +33,7 @@ type module_state = exported_identifiers: { [name: string]: import_resolution[] }; context: Context; unit: CompilationUnit; + mtime: number; } | { type: "error"; reason: string }; @@ -64,6 +66,7 @@ class RtsModule implements imported_module { return this.initialize().then(() => this.ensureUpToDate()); case "stale": return this.recompile().then(() => this.ensureUpToDate()); + case "initializing": case "fresh": case "error": return; @@ -90,11 +93,11 @@ class RtsModule implements imported_module { return this.path + ".ts"; } - async initialize() { + private async do_initialize() { assert(this.state.type === "initial"); - console.log(`initializing ${this.path}`); const [pkg, pkg_relative_path] = await this.library_manager.findPackage(this.path); const cid = `${pkg_relative_path} ${pkg.name} ${pkg.version}`; + console.log(`initializing ${cid}`); const json_path = this.get_json_path(); const json_mtime = await mtime(json_path); const my_mtime = await mtime(this.path); @@ -111,7 +114,28 @@ class RtsModule implements imported_module { assert(json.cid === cid); assert(json.exported_identifiers !== undefined, `no exported_identifiers in ${json_path}`); assert(json.context !== undefined, `no exported_identifiers in ${json_path}`); - console.error("TODO: check dependencies"); + assert(json.imports); + const imported_modules: imported_module[] = await Promise.all( + json.imports.map( + (x: { pkg: { name: string; version: string }; pkg_relative_path: string }) => { + const { + pkg: { name, version }, + pkg_relative_path, + } = x; + const pkg = this.library_manager.get_package(name, version); + assert(pkg !== undefined); + const path = join(pkg.dir, pkg_relative_path); + const mod = this.library_manager.ensureUpToDate(path); + return mod; + }, + ), + ); + if (imported_modules.some((x) => x.get_mtime() > my_mtime)) { + this.state = { type: "stale", cid, pkg, pkg_relative_path }; + return; + } + this.imported_modules = imported_modules; + console.log(`up to date ${cid}`); this.state = { type: "fresh", cid, @@ -120,12 +144,25 @@ class RtsModule implements imported_module { exported_identifiers: json.exported_identifiers, context: json.context, unit: json.unit, + mtime: my_mtime, }; } + async initialize() { + switch (this.state.type) { + case "initial": { + const promise = this.do_initialize(); + this.state = { type: "initializing", promise }; + return promise; + } + case "initializing": + return this.state.promise; + } + } + async recompile() { assert(this.state.type === "stale"); - console.log(`expanding ${this.state.cid}`); + console.log(`recompiling ${this.state.cid} ...`); const code = await fs.readFile(this.path, { encoding: "utf-8" }); const my_pkg = this.state.pkg; const my_path = this.state.pkg_relative_path; @@ -188,9 +225,14 @@ class RtsModule implements imported_module { const json_content = { cid: this.state.cid, cookie, + imports: this.imported_modules.map((x) => { + const [pkg, path] = x.get_pkg_and_path(); + return { pkg: { name: pkg.name, version: pkg.version }, pkg_relative_path: path }; + }), exported_identifiers, context, unit, + mtime: Date.now(), }; const code_path = this.get_generated_code_absolute_path(); await fs.mkdir(dirname(code_path), { recursive: true }); @@ -231,6 +273,15 @@ class RtsModule implements imported_module { } } + get_mtime(): number { + switch (this.state.type) { + case "fresh": + return this.state.mtime; + default: + throw new Error(`invalid state`); + } + } + find_module_by_cid(cid: string): imported_module | undefined { if (this.get_cid() === cid) return this; for (const m of this.imported_modules) { @@ -265,8 +316,11 @@ class RtsModule implements imported_module { return [this.state.pkg, this.state.pkg_relative_path]; } - private get_imported_modules_for_path(import_path: string, loc: Loc): imported_module { - const mod = this.library_manager.do_import(import_path, this.path); + private async get_imported_modules_for_path( + import_path: string, + loc: Loc, + ): Promise { + const mod = await this.library_manager.do_import(import_path, this.path); if (this.imported_modules.includes(mod)) return mod; const self = this; function check(mod: imported_module) { @@ -305,7 +359,8 @@ export class LibraryManager { private libs: string[]; private global_unit: CompilationUnit; private global_context: Context; - private modules: { [path: string]: imported_module } = {}; + private modules_by_path: { [path: string]: imported_module } = {}; + private modules_by_cid: { [cid: string]: imported_module } = {}; private packages: { [dir: string]: Package } = {}; constructor(patterns: { [k: string]: AST }, globals: string[], libs: string[]) { @@ -315,19 +370,18 @@ export class LibraryManager { this.global_context = global_context; } - private get_or_create_module(path: string) { - const mod = (this.modules[path] ??= new RtsModule( - path, - this, - this.libs, - this.global_unit, - this.global_context, - )); + private async get_or_create_module(path: string) { + const existing = this.modules_by_path[path]; + if (existing) return existing; + const mod = new RtsModule(path, this, this.libs, this.global_unit, this.global_context); + this.modules_by_path[path] = mod; + await mod.initialize(); + this.modules_by_cid[mod.get_cid()] = mod; return mod; } async ensureUpToDate(path: string) { - const mod = this.get_or_create_module(path); + const mod = await this.get_or_create_module(path); await mod.ensureUpToDate(); return mod; } diff --git a/src/preexpand-helpers.ts b/src/preexpand-helpers.ts index a65c964..994a984 100644 --- a/src/preexpand-helpers.ts +++ b/src/preexpand-helpers.ts @@ -17,6 +17,7 @@ export type imported_module = { resolve_label(name: string): Promise; get_pkg_and_path(): [{ name: string; version: string }, string]; resolve_rib: (rib_id: string) => Rib; + get_mtime(): number; }; export type manager = { diff --git a/test-project/.rts/main.rts.json b/test-project/.rts/main.rts.json index 4a1f1db..0aaf239 100644 --- a/test-project/.rts/main.rts.json +++ b/test-project/.rts/main.rts.json @@ -1,6 +1,12 @@ { "cid": "test-project/main.rts rewrite-ts-visualized 0.0.0", - "cookie": "rewrite-ts-013", + "cookie": "rewrite-ts-016", + "imports": [ + { + "pkg": {"name": "rewrite-ts-visualized", "version": "0.0.0"}, + "pkg_relative_path": "test-project/mod.rts" + } + ], "exported_identifiers": {}, "context": {"l1": {"type": "lexical", "name": "y_1"}}, "unit": { diff --git a/test-project/.rts/mod.rts.json b/test-project/.rts/mod.rts.json index 491c564..74f50cf 100644 --- a/test-project/.rts/mod.rts.json +++ b/test-project/.rts/mod.rts.json @@ -1,6 +1,7 @@ { "cid": "test-project/mod.rts rewrite-ts-visualized 0.0.0", - "cookie": "rewrite-ts-013", + "cookie": "rewrite-ts-016", + "imports": [], "exported_identifiers": { "x": [ { From e34f5372e8e09e2e9ead5fc6a52882efbacee21d Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Sun, 22 Dec 2024 04:51:11 +0300 Subject: [PATCH 03/22] avoiding reinitialization on concurrent loading --- src/library-manager.ts | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index 03eda69..2849a9a 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -64,9 +64,10 @@ class RtsModule implements imported_module { switch (this.state.type) { case "initial": return this.initialize().then(() => this.ensureUpToDate()); + case "initializing": + return this.state.promise.then(() => this.ensureUpToDate()); case "stale": return this.recompile().then(() => this.ensureUpToDate()); - case "initializing": case "fresh": case "error": return; @@ -102,7 +103,7 @@ class RtsModule implements imported_module { const json_mtime = await mtime(json_path); const my_mtime = await mtime(this.path); assert(my_mtime !== undefined); - if (my_mtime >= (json_mtime ?? 0)) { + if (json_mtime === undefined || my_mtime >= json_mtime) { this.state = { type: "stale", cid, pkg, pkg_relative_path }; return; } @@ -115,9 +116,9 @@ class RtsModule implements imported_module { assert(json.exported_identifiers !== undefined, `no exported_identifiers in ${json_path}`); assert(json.context !== undefined, `no exported_identifiers in ${json_path}`); assert(json.imports); - const imported_modules: imported_module[] = await Promise.all( - json.imports.map( - (x: { pkg: { name: string; version: string }; pkg_relative_path: string }) => { + const imported_modules = await Promise.all( + (json.imports as { pkg: { name: string; version: string }; pkg_relative_path: string }[]).map( + (x) => { const { pkg: { name, version }, pkg_relative_path, @@ -130,7 +131,7 @@ class RtsModule implements imported_module { }, ), ); - if (imported_modules.some((x) => x.get_mtime() > my_mtime)) { + if (imported_modules.some((x) => x.get_mtime() > json_mtime)) { this.state = { type: "stale", cid, pkg, pkg_relative_path }; return; } @@ -144,7 +145,7 @@ class RtsModule implements imported_module { exported_identifiers: json.exported_identifiers, context: json.context, unit: json.unit, - mtime: my_mtime, + mtime: json_mtime, }; } @@ -232,14 +233,14 @@ class RtsModule implements imported_module { exported_identifiers, context, unit, - mtime: Date.now(), }; const code_path = this.get_generated_code_absolute_path(); await fs.mkdir(dirname(code_path), { recursive: true }); await fs.writeFile(code_path, await pprint(loc)); await fs.writeFile(this.get_proxy_path(), proxy_code); + const mtime = Date.now(); await fs.writeFile(this.get_json_path(), stringify(json_content)); - this.state = { ...this.state, type: "fresh", ...json_content }; + this.state = { ...this.state, type: "fresh", ...json_content, mtime }; } catch (error) { if (error instanceof StxError) { await print_stx_error(error, this.library_manager); @@ -320,7 +321,7 @@ class RtsModule implements imported_module { import_path: string, loc: Loc, ): Promise { - const mod = await this.library_manager.do_import(import_path, this.path); + const mod = this.library_manager.do_import(import_path, this.path); if (this.imported_modules.includes(mod)) return mod; const self = this; function check(mod: imported_module) { @@ -359,8 +360,7 @@ export class LibraryManager { private libs: string[]; private global_unit: CompilationUnit; private global_context: Context; - private modules_by_path: { [path: string]: imported_module } = {}; - private modules_by_cid: { [cid: string]: imported_module } = {}; + private modules: { [path: string]: imported_module } = {}; private packages: { [dir: string]: Package } = {}; constructor(patterns: { [k: string]: AST }, globals: string[], libs: string[]) { @@ -370,18 +370,16 @@ export class LibraryManager { this.global_context = global_context; } - private async get_or_create_module(path: string) { - const existing = this.modules_by_path[path]; + private get_or_create_module(path: string) { + const existing = this.modules[path]; if (existing) return existing; const mod = new RtsModule(path, this, this.libs, this.global_unit, this.global_context); - this.modules_by_path[path] = mod; - await mod.initialize(); - this.modules_by_cid[mod.get_cid()] = mod; + this.modules[path] = mod; return mod; } async ensureUpToDate(path: string) { - const mod = await this.get_or_create_module(path); + const mod = this.get_or_create_module(path); await mod.ensureUpToDate(); return mod; } From edbc03951d7816edac17a281589e094e8c16dba4 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Sun, 22 Dec 2024 13:21:39 +0300 Subject: [PATCH 04/22] detecting and recompiling on file change --- rtsc/watch.ts | 11 +++--- src/library-manager.ts | 83 +++++++++++++++++++++++++++++++++------- src/preexpand-helpers.ts | 1 + 3 files changed, 76 insertions(+), 19 deletions(-) diff --git a/rtsc/watch.ts b/rtsc/watch.ts index d3c3e28..815afd9 100755 --- a/rtsc/watch.ts +++ b/rtsc/watch.ts @@ -7,10 +7,6 @@ import { get_globals } from "../src/global-module.ts"; import { core_patterns } from "../src/syntax-core-patterns.ts"; import { parse } from "../src/parse.ts"; -const globals = get_globals("es2024.full"); -const patterns = core_patterns(parse); -const library_manager = new LibraryManager(patterns, globals, ["es2024.full"]); - const watch_reporter: TS.WatchStatusReporter = (diagnostics, _newline, _options, error_count) => { console.log(`rtsc: ${diagnostics.messageText}`); if (error_count) { @@ -68,7 +64,8 @@ function check_path(path: string) { if (path.endsWith(suffix)) { const module_dir = dirname(path); const module_name = basename(path, suffix) + ".rts"; - const rts_file = join(module_dir, module_name); + if (host.realpath === undefined) throw new Error("host has no real path"); + const rts_file = host.realpath(join(module_dir, module_name)); if (fileExists(rts_file)) { library_manager.ensureUpToDate(rts_file); } @@ -96,4 +93,8 @@ host.watchDirectory = (path, callback, recursive, options) => { return watchDirectory(path, callback, recursive, options); }; +const globals = get_globals("es2024.full"); +const patterns = core_patterns(parse); +const library_manager = new LibraryManager(patterns, globals, ["es2024.full"], host); + const prog = TS.createWatchProgram(host); diff --git a/src/library-manager.ts b/src/library-manager.ts index 2849a9a..37e3e74 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -25,6 +25,13 @@ type module_state = | { type: "initial" } | { type: "initializing"; promise: Promise } | { type: "stale"; cid: string; pkg: Package; pkg_relative_path: string } + | { + type: "compiling"; + cid: string; + pkg: Package; + pkg_relative_path: string; + promise: Promise; + } | { type: "fresh"; cid: string; @@ -68,6 +75,8 @@ class RtsModule implements imported_module { return this.state.promise.then(() => this.ensureUpToDate()); case "stale": return this.recompile().then(() => this.ensureUpToDate()); + case "compiling": + return this.state.promise.then(() => this.ensureUpToDate()); case "fresh": case "error": return; @@ -95,7 +104,7 @@ class RtsModule implements imported_module { } private async do_initialize() { - assert(this.state.type === "initial"); + assert(this.state.type === "initial", `invalid state ${this.state.type}`); const [pkg, pkg_relative_path] = await this.library_manager.findPackage(this.path); const cid = `${pkg_relative_path} ${pkg.name} ${pkg.version}`; console.log(`initializing ${cid}`); @@ -161,17 +170,18 @@ class RtsModule implements imported_module { } } - async recompile() { - assert(this.state.type === "stale"); - console.log(`recompiling ${this.state.cid} ...`); + async do_recompile() { + const state = this.state; + assert(state.type === "stale"); + console.log(`recompiling ${state.cid} ...`); const code = await fs.readFile(this.path, { encoding: "utf-8" }); - const my_pkg = this.state.pkg; - const my_path = this.state.pkg_relative_path; + const my_pkg = state.pkg; + const my_path = state.pkg_relative_path; const source_file: source_file = { package: { name: my_pkg.name, version: my_pkg.version }, path: my_path, }; - const [_loc0, expand] = initial_step(parse(code, source_file), this.state.cid, this.libs); + const [_loc0, expand] = initial_step(parse(code, source_file), state.cid, this.libs); try { const helpers: preexpand_helpers = { manager: { @@ -220,11 +230,11 @@ class RtsModule implements imported_module { ); const exported_identifiers = get_exported_identifiers_from_rib( modular.explicit, - this.state.cid, + state.cid, context, ); const json_content = { - cid: this.state.cid, + cid: state.cid, cookie, imports: this.imported_modules.map((x) => { const [pkg, path] = x.get_pkg_and_path(); @@ -240,14 +250,45 @@ class RtsModule implements imported_module { await fs.writeFile(this.get_proxy_path(), proxy_code); const mtime = Date.now(); await fs.writeFile(this.get_json_path(), stringify(json_content)); - this.state = { ...this.state, type: "fresh", ...json_content, mtime }; + this.state = { ...state, type: "fresh", ...json_content, mtime }; + console.log(`up to date ${state.cid}`); } catch (error) { + this.state = { type: "error", reason: String(error) }; if (error instanceof StxError) { await print_stx_error(error, this.library_manager); } else { console.error(error); } - this.state = { type: "error", reason: String(error) }; + } + } + + async recompile() { + const state = this.state; + switch (state.type) { + case "stale": { + const promise = this.do_recompile(); + this.state = { ...state, type: "compiling", promise }; + return promise; + } + case "compiling": + return state.promise; + } + } + + async file_changed(): Promise { + const t = await mtime(this.path); + await this.ensureUpToDate(); + const state = this.state; + switch (state.type) { + case "fresh": { + if (t && t > state.mtime) { + this.state = { ...state, type: "stale" }; + this.ensureUpToDate(); + } + return; + } + default: + throw new Error(`invalid state? '${state.type}'`); } } @@ -264,13 +305,13 @@ class RtsModule implements imported_module { } get_cid(): string { - //await this.ensureUpToDate(); switch (this.state.type) { case "fresh": case "stale": + case "compiling": return this.state.cid; default: - throw new Error(`invalid state`); + throw new Error(`invalid state ${this.state.type}`); } } @@ -356,15 +397,25 @@ class Package { } } +type watcher = { + close: () => void; +}; + +type host = { + watchFile: (path: string, callback: (path: string) => void) => watcher; +}; + export class LibraryManager { private libs: string[]; private global_unit: CompilationUnit; private global_context: Context; private modules: { [path: string]: imported_module } = {}; private packages: { [dir: string]: Package } = {}; + private host: host; - constructor(patterns: { [k: string]: AST }, globals: string[], libs: string[]) { + constructor(patterns: { [k: string]: AST }, globals: string[], libs: string[], host: host) { this.libs = libs; + this.host = host; const [global_unit, global_context] = init_global_context(patterns, globals); this.global_unit = global_unit; this.global_context = global_context; @@ -375,6 +426,10 @@ export class LibraryManager { if (existing) return existing; const mod = new RtsModule(path, this, this.libs, this.global_unit, this.global_context); this.modules[path] = mod; + const watcher = this.host.watchFile(path, (p) => { + if (p !== path) return; + mod.file_changed(); + }); return mod; } diff --git a/src/preexpand-helpers.ts b/src/preexpand-helpers.ts index 994a984..06f7ee2 100644 --- a/src/preexpand-helpers.ts +++ b/src/preexpand-helpers.ts @@ -18,6 +18,7 @@ export type imported_module = { get_pkg_and_path(): [{ name: string; version: string }, string]; resolve_rib: (rib_id: string) => Rib; get_mtime(): number; + file_changed(): Promise; }; export type manager = { From 9fbdd522d2a2fe2e73bd21a91f74c143ad3cc095 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Sun, 22 Dec 2024 14:04:52 +0300 Subject: [PATCH 05/22] reverse dependencies for recompiling modules when their imports change --- src/library-manager.ts | 24 ++++++++++++++++++++++-- src/preexpand-helpers.ts | 2 ++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index 37e3e74..10b4da5 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -52,6 +52,7 @@ class RtsModule implements imported_module { private global_unit: CompilationUnit; private global_context: Context; public imported_modules: imported_module[] = []; + public dependant_modules: imported_module[] = []; constructor( path: string, @@ -145,6 +146,7 @@ class RtsModule implements imported_module { return; } this.imported_modules = imported_modules; + imported_modules.forEach((x) => x.dependant_modules.push(this)); console.log(`up to date ${cid}`); this.state = { type: "fresh", @@ -275,6 +277,24 @@ class RtsModule implements imported_module { } } + async force_recompile() { + const state = this.state; + await this.ensureUpToDate(); + assert(state.type === "fresh"); + this.state = { ...state, type: "stale" }; + const dependant_modules = this.dependant_modules; + dependant_modules.forEach( + (x) => (x.imported_modules = x.imported_modules.filter((x) => x !== this)), + ); + this.dependant_modules = []; + this.imported_modules.forEach( + (x) => (x.dependant_modules = x.dependant_modules.filter((x) => x !== this)), + ); + this.imported_modules = []; + dependant_modules.forEach((x) => x.force_recompile()); + this.ensureUpToDate(); + } + async file_changed(): Promise { const t = await mtime(this.path); await this.ensureUpToDate(); @@ -282,8 +302,7 @@ class RtsModule implements imported_module { switch (state.type) { case "fresh": { if (t && t > state.mtime) { - this.state = { ...state, type: "stale" }; - this.ensureUpToDate(); + this.force_recompile(); } return; } @@ -373,6 +392,7 @@ class RtsModule implements imported_module { } check(mod); this.imported_modules.push(mod); + mod.dependant_modules.push(self); return mod; } diff --git a/src/preexpand-helpers.ts b/src/preexpand-helpers.ts index 06f7ee2..c1d5add 100644 --- a/src/preexpand-helpers.ts +++ b/src/preexpand-helpers.ts @@ -10,6 +10,7 @@ export type import_resolution = { export type imported_module = { imported_modules: imported_module[]; + dependant_modules: imported_module[]; resolve_exported_identifier: (name: string, loc: Loc) => Promise; ensureUpToDate(): Promise; get_cid(): string; @@ -19,6 +20,7 @@ export type imported_module = { resolve_rib: (rib_id: string) => Rib; get_mtime(): number; file_changed(): Promise; + force_recompile(): Promise; }; export type manager = { From b02981fefe148c517f0a44b282d67fb68ddafc00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 06:11:32 +0300 Subject: [PATCH 06/22] Bump the all group with 5 updates (#56) Bumps the all group with 5 updates: | Package | From | To | | --- | --- | --- | | [json-stable-stringify](https://github.com/ljharb/json-stable-stringify) | `1.1.1` | `1.2.0` | | [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) | `7.0.2` | `7.1.0` | | [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `19.0.1` | `19.0.2` | | [globals](https://github.com/sindresorhus/globals) | `15.13.0` | `15.14.0` | | [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `6.0.3` | `6.0.5` | Updates `json-stable-stringify` from 1.1.1 to 1.2.0 - [Changelog](https://github.com/ljharb/json-stable-stringify/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/json-stable-stringify/compare/v1.1.1...v1.2.0) Updates `react-router-dom` from 7.0.2 to 7.1.0 - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@7.1.0/packages/react-router-dom) Updates `@types/react` from 19.0.1 to 19.0.2 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) Updates `globals` from 15.13.0 to 15.14.0 - [Release notes](https://github.com/sindresorhus/globals/releases) - [Commits](https://github.com/sindresorhus/globals/compare/v15.13.0...v15.14.0) Updates `vite` from 6.0.3 to 6.0.5 - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v6.0.5/packages/vite) --- updated-dependencies: - dependency-name: json-stable-stringify dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all - dependency-name: "@types/react" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: all - dependency-name: globals dependency-type: direct:development update-type: version-update:semver-minor dependency-group: all - dependency-name: vite dependency-type: direct:development update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 204 ++++++++++++++++++++++++++-------------------- package.json | 10 +-- 2 files changed, 121 insertions(+), 93 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f2caa5..70ae2f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,27 +16,27 @@ "@uiw/codemirror-theme-abcdef": "^4.23.7", "@uiw/react-codemirror": "^4.23.7", "index-to-position": "^1.0.0", - "json-stable-stringify": "^1.1.1", + "json-stable-stringify": "^1.2.0", "json-stringify-pretty-compact": "^4.0.0", "prettier": "^3.4.2", "react": "^19.0.0", "react-dom": "^19.0.0", - "react-router-dom": "^7.0.2", + "react-router-dom": "^7.1.0", "typescript": "^5.5.3", "zipper": "github:azizghuloum/zipper" }, "devDependencies": { "@eslint/js": "^9.11.1", - "@types/react": "^19.0.1", + "@types/react": "^19.0.2", "@types/react-dom": "^19.0.2", "@vitejs/plugin-react": "^4.3.4", "@vitest/coverage-v8": "^2.1.8", "eslint": "^9.17.0", "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.16", - "globals": "^15.13.0", + "globals": "^15.14.0", "typescript-eslint": "^8.18.1", - "vite": "^6.0.3", + "vite": "^6.0.5", "vitest": "^2.1.5" } }, @@ -1541,8 +1541,7 @@ "node_modules/@types/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", - "license": "MIT" + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==" }, "node_modules/@types/estree": { "version": "1.0.6", @@ -1574,11 +1573,10 @@ } }, "node_modules/@types/react": { - "version": "19.0.1", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.1.tgz", - "integrity": "sha512-YW6614BDhqbpR5KtUYzTA+zlA7nayzJRA9ljz9CQoxthR0sDisYZLuvSMsil36t4EH/uAt8T52Xb4sVw17G+SQ==", + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.2.tgz", + "integrity": "sha512-USU8ZI/xyKJwFTpjSVIrSeHBVAGagkHQKPNbxeWwql/vDmnTIBgx+TJnhFnj1NXgz8XfprU0egV2dROLGpsBEg==", "dev": true, - "license": "MIT", "dependencies": { "csstype": "^3.0.2" } @@ -2179,16 +2177,41 @@ } }, "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "license": "MIT", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -2325,7 +2348,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", - "license": "MIT", "engines": { "node": ">=18" } @@ -2397,7 +2419,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -2410,6 +2431,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -2432,13 +2466,9 @@ "license": "MIT" }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "engines": { "node": ">= 0.4" } @@ -2447,7 +2477,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", "engines": { "node": ">= 0.4" } @@ -2459,6 +2488,17 @@ "dev": true, "license": "MIT" }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", @@ -2875,7 +2915,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2891,16 +2930,20 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "license": "MIT", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -2970,11 +3013,10 @@ } }, "node_modules/globals": { - "version": "15.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.13.0.tgz", - "integrity": "sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==", + "version": "15.14.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.14.0.tgz", + "integrity": "sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" }, @@ -2983,12 +3025,11 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.1.3" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3014,7 +3055,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -3022,23 +3062,10 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "license": "MIT", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "engines": { "node": ">= 0.4" }, @@ -3050,7 +3077,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -3286,12 +3312,12 @@ "license": "MIT" }, "node_modules/json-stable-stringify": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.1.1.tgz", - "integrity": "sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg==", - "license": "MIT", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.0.tgz", + "integrity": "sha512-ex8jk9BZHBolvbd5cRnAgwyaYcYB0qZldy1e+LCOdcF6+AUmVZ6LcGUMzsRTW83QMeu+GxZGrcLqxqrgfXGvIw==", "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "isarray": "^2.0.5", "jsonify": "^0.0.1", "object-keys": "^1.1.1" @@ -3453,6 +3479,14 @@ "node": ">=10" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -3812,10 +3846,9 @@ } }, "node_modules/react-router": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.0.2.tgz", - "integrity": "sha512-m5AcPfTRUcjwmhBzOJGEl6Y7+Crqyju0+TgTQxoS4SO+BkWbhOrcfZNq6wSWdl2BBbJbsAoBUb8ZacOFT+/JlA==", - "license": "MIT", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.0.tgz", + "integrity": "sha512-VcFhWqkNIcojDRYaUO8qV0Jib52s9ULpCp3nkBbmrvtoCVFRp6tmk3tJ2w9BZauVctA1YRnJlFYDn9iJRuCpGA==", "dependencies": { "@types/cookie": "^0.6.0", "cookie": "^1.0.1", @@ -3836,12 +3869,11 @@ } }, "node_modules/react-router-dom": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.0.2.tgz", - "integrity": "sha512-VJOQ+CDWFDGaWdrG12Nl+d7yHtLaurNgAQZVgaIy7/Xd+DojgmYLosFfZdGz1wpxmjJIAkAMVTKWcvkx1oggAw==", - "license": "MIT", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.1.0.tgz", + "integrity": "sha512-F4/nYBC9e4s0/ZjxM8GkZ9a68DpX76LN1a9W9mfPl2GfbDJ9/vzJro6MThNR5qGBH6KkgcK1BziyEzXhHV46Xw==", "dependencies": { - "react-router": "7.0.2" + "react-router": "7.1.0" }, "engines": { "node": ">=20.0.0" @@ -3957,14 +3989,12 @@ "node_modules/set-cookie-parser": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz", - "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==", - "license": "MIT" + "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==" }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -4292,8 +4322,7 @@ "node_modules/turbo-stream": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.0.tgz", - "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==", - "license": "ISC" + "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==" }, "node_modules/type-check": { "version": "0.4.0", @@ -4391,13 +4420,12 @@ } }, "node_modules/vite": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.3.tgz", - "integrity": "sha512-Cmuo5P0ENTN6HxLSo6IHsjCLn/81Vgrp81oaiFFMRa8gGDj5xEjIcEpf2ZymZtZR8oU0P2JX5WuUp/rlXcHkAw==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.5.tgz", + "integrity": "sha512-akD5IAH/ID5imgue2DYhzsEwCi0/4VKY31uhMLEYJwPP4TiUp8pL5PIK+Wo7H8qT8JY9i+pVfPydcFPYD1EL7g==", "dev": true, - "license": "MIT", "dependencies": { - "esbuild": "^0.24.0", + "esbuild": "0.24.0", "postcss": "^8.4.49", "rollup": "^4.23.0" }, diff --git a/package.json b/package.json index c132099..794ddf3 100644 --- a/package.json +++ b/package.json @@ -23,27 +23,27 @@ "@uiw/codemirror-theme-abcdef": "^4.23.7", "@uiw/react-codemirror": "^4.23.7", "index-to-position": "^1.0.0", - "json-stable-stringify": "^1.1.1", + "json-stable-stringify": "^1.2.0", "json-stringify-pretty-compact": "^4.0.0", "prettier": "^3.4.2", "react": "^19.0.0", "react-dom": "^19.0.0", - "react-router-dom": "^7.0.2", + "react-router-dom": "^7.1.0", "typescript": "^5.5.3", "zipper": "github:azizghuloum/zipper" }, "devDependencies": { "@eslint/js": "^9.11.1", - "@types/react": "^19.0.1", + "@types/react": "^19.0.2", "@types/react-dom": "^19.0.2", "@vitejs/plugin-react": "^4.3.4", "@vitest/coverage-v8": "^2.1.8", "eslint": "^9.17.0", "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.16", - "globals": "^15.13.0", + "globals": "^15.14.0", "typescript-eslint": "^8.18.1", - "vite": "^6.0.3", + "vite": "^6.0.5", "vitest": "^2.1.5" } } From 5d7b316502333e8dbd6bd097d393648c84b4edf8 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Mon, 23 Dec 2024 08:22:19 +0300 Subject: [PATCH 07/22] upgraded dependencies in deno.lock --- deno.lock | 108 +++--------------------------------------------------- 1 file changed, 5 insertions(+), 103 deletions(-) diff --git a/deno.lock b/deno.lock index b68a9f7..12f5d6b 100644 --- a/deno.lock +++ b/deno.lock @@ -6,8 +6,6 @@ "npm:@types/json-stable-stringify@^1.1.0": "1.1.0", "npm:@types/node@^22.10.1": "22.10.1", "npm:@vitest/coverage-v8@^2.1.8": "2.1.8_vitest@2.1.8__@types+node@22.10.1__vite@5.4.11___@types+node@22.10.1_@types+node@22.10.1", - "npm:globals@^15.13.0": "15.13.0", - "npm:json-stable-stringify@^1.1.1": "1.1.1", "npm:typescript@^5.5.3": "5.7.2", "npm:vitest@^2.1.5": "2.1.8_@types+node@22.10.1_vite@5.4.11__@types+node@22.10.1" }, @@ -395,16 +393,6 @@ "cac@6.7.14": { "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==" }, - "call-bind@1.0.7": { - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dependencies": [ - "es-define-property", - "es-errors", - "function-bind", - "get-intrinsic", - "set-function-length" - ] - }, "chai@5.1.2": { "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dependencies": [ @@ -447,14 +435,6 @@ "deep-eql@5.0.2": { "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==" }, - "define-data-property@1.1.4": { - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dependencies": [ - "es-define-property", - "es-errors", - "gopd" - ] - }, "eastasianwidth@0.2.0": { "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, @@ -464,15 +444,6 @@ "emoji-regex@9.2.2": { "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, - "es-define-property@1.0.0": { - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dependencies": [ - "get-intrinsic" - ] - }, - "es-errors@1.3.0": { - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" - }, "es-module-lexer@1.5.4": { "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==" }, @@ -523,19 +494,6 @@ "fsevents@2.3.3": { "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==" }, - "function-bind@1.1.2": { - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" - }, - "get-intrinsic@1.2.4": { - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dependencies": [ - "es-errors", - "function-bind", - "has-proto", - "has-symbols", - "hasown" - ] - }, "glob@10.4.5": { "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dependencies": [ @@ -547,45 +505,15 @@ "path-scurry" ] }, - "globals@15.13.0": { - "integrity": "sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==" - }, - "gopd@1.0.1": { - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": [ - "get-intrinsic" - ] - }, "has-flag@4.0.0": { "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, - "has-property-descriptors@1.0.2": { - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dependencies": [ - "es-define-property" - ] - }, - "has-proto@1.0.3": { - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" - }, - "has-symbols@1.0.3": { - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" - }, - "hasown@2.0.2": { - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dependencies": [ - "function-bind" - ] - }, "html-escaper@2.0.2": { "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==" }, "is-fullwidth-code-point@3.0.0": { "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, - "isarray@2.0.5": { - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" - }, "isexe@2.0.0": { "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, @@ -622,18 +550,6 @@ "@pkgjs/parseargs" ] }, - "json-stable-stringify@1.1.1": { - "integrity": "sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg==", - "dependencies": [ - "call-bind", - "isarray", - "jsonify", - "object-keys" - ] - }, - "jsonify@0.0.1": { - "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==" - }, "loupe@3.1.2": { "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==" }, @@ -675,9 +591,6 @@ "nanoid@3.3.8": { "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==" }, - "object-keys@1.1.1": { - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - }, "package-json-from-dist@1.0.1": { "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" }, @@ -736,17 +649,6 @@ "semver@7.6.3": { "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==" }, - "set-function-length@1.2.2": { - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dependencies": [ - "define-data-property", - "es-errors", - "function-bind", - "get-intrinsic", - "gopd", - "has-property-descriptors" - ] - }, "shebang-command@2.0.0": { "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dependencies": [ @@ -926,7 +828,7 @@ "npm:@types/json-stable-stringify@^1.1.0", "npm:@types/node@^22.10.2", "npm:@types/react-dom@^19.0.2", - "npm:@types/react@^19.0.1", + "npm:@types/react@^19.0.2", "npm:@uiw/codemirror-theme-abcdef@^4.23.7", "npm:@uiw/react-codemirror@^4.23.7", "npm:@vitejs/plugin-react@^4.3.4", @@ -934,17 +836,17 @@ "npm:eslint-plugin-react-hooks@^5.1.0", "npm:eslint-plugin-react-refresh@~0.4.16", "npm:eslint@^9.17.0", - "npm:globals@^15.13.0", + "npm:globals@^15.14.0", "npm:index-to-position@1", - "npm:json-stable-stringify@^1.1.1", + "npm:json-stable-stringify@^1.2.0", "npm:json-stringify-pretty-compact@4", "npm:prettier@^3.4.2", "npm:react-dom@19", - "npm:react-router-dom@^7.0.2", + "npm:react-router-dom@^7.1.0", "npm:react@19", "npm:typescript-eslint@^8.18.1", "npm:typescript@^5.5.3", - "npm:vite@^6.0.3", + "npm:vite@^6.0.5", "npm:vitest@^2.1.5" ] } From 3763e6f2df37455bf744b09fb316b1328ec8f124 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Mon, 23 Dec 2024 08:23:19 +0300 Subject: [PATCH 08/22] resolving simple imported package based on node resolution --- src/library-manager.ts | 70 ++++++++++++++++++++++++++++++++++-------- test-project/main.rts | 1 + 2 files changed, 58 insertions(+), 13 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index 10b4da5..0678d96 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -381,7 +381,7 @@ class RtsModule implements imported_module { import_path: string, loc: Loc, ): Promise { - const mod = this.library_manager.do_import(import_path, this.path); + const mod = await this.library_manager.do_import(import_path, this.path); if (this.imported_modules.includes(mod)) return mod; const self = this; function check(mod: imported_module) { @@ -405,15 +405,19 @@ class RtsModule implements imported_module { } } +type package_props = { types_file?: string }; + class Package { name: string; version: string; dir: string; + props: package_props; - constructor(name: string, version: string, dir: string) { + constructor(name: string, version: string, dir: string, props?: package_props) { this.name = name; this.version = version; this.dir = dir; + this.props = props ?? {}; } } @@ -444,7 +448,15 @@ export class LibraryManager { private get_or_create_module(path: string) { const existing = this.modules[path]; if (existing) return existing; - const mod = new RtsModule(path, this, this.libs, this.global_unit, this.global_context); + const mod = (() => { + if (path.endsWith(".rts")) { + return new RtsModule(path, this, this.libs, this.global_unit, this.global_context); + } else if (path.endsWith(".d.ts")) { + throw new Error(`TODO import .d.ts ${path}`); + } else { + throw new Error(`don't know how to import ${path}`); + } + })(); this.modules[path] = mod; const watcher = this.host.watchFile(path, (p) => { if (p !== path) return; @@ -465,20 +477,20 @@ export class LibraryManager { async findPackage(path: string): Promise<[Package, string]> { const base = basename(path); - const dir = dirname(path); - const existing = this.packages[dir]; + const pkg_dir = dirname(path); + const existing = this.packages[pkg_dir]; if (existing) return [existing, base]; - const pkg_path = join(dir, "package.json"); + const pkg_path = join(pkg_dir, "package.json"); try { const content = await fs.readFile(pkg_path, { encoding: "utf8" }); const json = JSON.parse(content); const { name, version } = json; assert(typeof name === "string"); assert(typeof version === "string"); - return [(this.packages[dir] ??= new Package(name, version, dir)), base]; + return [(this.packages[pkg_dir] ??= new Package(name, version, pkg_dir)), base]; } catch (err: any) { if (err?.code === "ENOENT") { - const [pkg, pkg_base] = await this.findPackage(dir); + const [pkg, pkg_base] = await this.findPackage(pkg_dir); return [pkg, join(pkg_base, base)]; } else { throw err; @@ -486,7 +498,31 @@ export class LibraryManager { } } - do_import(import_path: string, importer_path: string) { + async resolve_node_module_package(pkg_name: string, dir: string): Promise { + const pkg_dir = `${dir}/node_modules/${pkg_name}`; + const existing = this.packages[pkg_dir]; + if (existing) return existing; + const pkg_path = join(pkg_dir, "package.json"); + try { + const content = await fs.readFile(pkg_path, { encoding: "utf8" }); + const json = JSON.parse(content); + const { name, version, types } = json; + assert(name === pkg_name); + assert(typeof version === "string"); + assert(typeof types === "string"); + return (this.packages[pkg_dir] ??= new Package(pkg_name, version, pkg_dir, { + types_file: types, + })); + } catch (err: any) { + if (err?.code === "ENOENT") { + return this.resolve_node_module_package(pkg_name, dirname(dir)); + } else { + throw err; + } + } + } + + async do_import(import_path: string, importer_path: string) { function is_relative(path: string): boolean { return path.startsWith("./") || path.startsWith("../"); } @@ -494,12 +530,20 @@ export class LibraryManager { const path = dirname(importer_path) + "/" + import_path; return normalize(path); } - function find_absolute_path(_import_path: string): string { - throw new Error("TODO find_absolute_path"); - } + const find_absolute_path = async (import_path: string) => { + const b = basename(import_path); + if (b === import_path) { + const pkg = await this.resolve_node_module_package(b, dirname(importer_path)); + assert(pkg.props.types_file !== undefined, `no types_file found in ${pkg.name}`); + const types_path = join(pkg.dir, pkg.props.types_file); + return types_path; + } else { + throw new Error(`TODO nested import of ${b} from ${dirname(import_path)}`); + } + }; const actual_path = is_relative(import_path) ? join_relative(import_path, importer_path) - : find_absolute_path(import_path); + : await find_absolute_path(import_path); const mod = this.get_or_create_module(actual_path); return mod; } diff --git a/test-project/main.rts b/test-project/main.rts index 2753fe8..72ad509 100644 --- a/test-project/main.rts +++ b/test-project/main.rts @@ -1,3 +1,4 @@ import { x, t, fref } from "./mod.rts"; +import { expect, test, suite } from "vitest"; const y: t = x + fref; console.log(y); From d47310e47433a8dbd0be9e4923b26983d8e8b7f2 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Mon, 23 Dec 2024 08:29:27 +0300 Subject: [PATCH 09/22] added .gitattributes files --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..276d2dd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.rts linguist-language=TypeScript + From 5265935b3e5c76f1a9c69b364836e328a4be1c5b Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Tue, 24 Dec 2024 03:39:22 +0300 Subject: [PATCH 10/22] parsing most of vitest dts file --- src/expander.ts | 18 +++ src/library-manager.ts | 259 ++++++++++++++++++++++------------------- src/parse-dts.ts | 177 ++++++++++++++++++++++++++++ src/parse.ts | 39 +++++++ src/tags.ts | 18 +++ 5 files changed, 392 insertions(+), 119 deletions(-) create mode 100644 src/parse-dts.ts diff --git a/src/expander.ts b/src/expander.ts index b698e14..4ea2f14 100644 --- a/src/expander.ts +++ b/src/expander.ts @@ -262,6 +262,24 @@ const list_handlers_table: { [tag in list_tag]: "descend" | "stop" | "todo" } = type_parameter: "todo", type_parameters: "todo", type_query: "todo", + function_type: "todo", + interface_declaration: "todo", + module_block: "todo", + module_declaration: "todo", + array_type: "todo", + call_signature: "todo", + conditional_type: "todo", + expression_with_type_arguments: "todo", + function_declaration: "todo", + heritage_clause: "todo", + indexed_access_type: "todo", + mapped_type: "todo", + method_signature: "todo", + parenthesized_type: "todo", + type_literal: "todo", + type_operator: "todo", + type_predicate: "todo", + type_reference: "todo", syntax_list: "descend", }; diff --git a/src/library-manager.ts b/src/library-manager.ts index 0678d96..0b4d143 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -18,6 +18,7 @@ import { normalize } from "node:path"; import { Binding, CompilationUnit, Context, Loc, Rib } from "./syntax-structures"; import stringify from "json-stringify-pretty-compact"; import { init_global_context } from "./global-module"; +import { parse_dts } from "./parse-dts"; const cookie = "rewrite-ts-016"; @@ -44,15 +45,17 @@ type module_state = } | { type: "error"; reason: string }; -class RtsModule implements imported_module { - private path: string; - private library_manager: LibraryManager; - private state: module_state = { type: "initial" }; - private libs: string[]; - private global_unit: CompilationUnit; - private global_context: Context; - public imported_modules: imported_module[] = []; - public dependant_modules: imported_module[] = []; +abstract class Module implements imported_module { + path: string; + library_manager: LibraryManager; + state: module_state = { type: "initial" }; + libs: string[]; + global_unit: CompilationUnit; + global_context: Context; + imported_modules: imported_module[] = []; + dependant_modules: imported_module[] = []; + + abstract do_recompile(): Promise; constructor( path: string, @@ -88,22 +91,10 @@ class RtsModule implements imported_module { } } - private get_json_path(): string { + get_json_path(): string { return join(dirname(this.path), ".rts", basename(this.path) + ".json"); } - private get_generated_code_absolute_path(): string { - return join(dirname(this.path), ".rts", basename(this.path) + ".ts"); - } - - private get_generated_code_relative_path(): string { - return "./.rts/" + basename(this.path) + ".ts"; - } - - private get_proxy_path(): string { - return this.path + ".ts"; - } - private async do_initialize() { assert(this.state.type === "initial", `invalid state ${this.state.type}`); const [pkg, pkg_relative_path] = await this.library_manager.findPackage(this.path); @@ -172,98 +163,6 @@ class RtsModule implements imported_module { } } - async do_recompile() { - const state = this.state; - assert(state.type === "stale"); - console.log(`recompiling ${state.cid} ...`); - const code = await fs.readFile(this.path, { encoding: "utf-8" }); - const my_pkg = state.pkg; - const my_path = state.pkg_relative_path; - const source_file: source_file = { - package: { name: my_pkg.name, version: my_pkg.version }, - path: my_path, - }; - const [_loc0, expand] = initial_step(parse(code, source_file), state.cid, this.libs); - try { - const helpers: preexpand_helpers = { - manager: { - resolve_import: async (loc) => { - assert(loc.t.tag === "string"); - const import_path = JSON.parse(loc.t.content); - const mod = this.get_imported_modules_for_path(import_path, loc); - return mod; - }, - resolve_label: async (label) => { - const mod = this.find_module_by_cid(label.cuid); - if (!mod) throw new Error(`cannot find module with cuid = ${label.cuid}`); - return mod.resolve_label(label.name); - }, - get_import_path: async (cuid) => { - const mod = this.find_module_by_cid(cuid); - if (!mod) throw new Error(`cannot find module with cuid = ${cuid}`); - const [mod_pkg, mod_path] = mod.get_pkg_and_path(); - if (mod_pkg === my_pkg) { - const dir0 = join(dirname(my_path), ".rts"); - const dir1 = join(dirname(mod_path), ".rts"); - if (dir0 !== dir1) throw new Error(`TODO relative path imports`); - return `./${basename(mod_path)}.ts`; - } else { - throw new Error(`TODO cross package imports`); - } - }, - resolve_rib: (rib_id, cuid) => { - const mod = this.find_module_by_cid(cuid); - if (!mod) throw new Error(`cannot find module with cuid = ${cuid}`); - return mod.resolve_rib(rib_id); - }, - }, - global_unit: this.global_unit, - global_context: this.global_context, - inspect(_loc, _reason, k) { - return k(); - }, - }; - const { loc, unit, context, modular } = await expand(helpers); - assert(modular.extensible); - const proxy_code = generate_proxy_code( - this.get_generated_code_relative_path(), - modular, - context, - ); - const exported_identifiers = get_exported_identifiers_from_rib( - modular.explicit, - state.cid, - context, - ); - const json_content = { - cid: state.cid, - cookie, - imports: this.imported_modules.map((x) => { - const [pkg, path] = x.get_pkg_and_path(); - return { pkg: { name: pkg.name, version: pkg.version }, pkg_relative_path: path }; - }), - exported_identifiers, - context, - unit, - }; - const code_path = this.get_generated_code_absolute_path(); - await fs.mkdir(dirname(code_path), { recursive: true }); - await fs.writeFile(code_path, await pprint(loc)); - await fs.writeFile(this.get_proxy_path(), proxy_code); - const mtime = Date.now(); - await fs.writeFile(this.get_json_path(), stringify(json_content)); - this.state = { ...state, type: "fresh", ...json_content, mtime }; - console.log(`up to date ${state.cid}`); - } catch (error) { - this.state = { type: "error", reason: String(error) }; - if (error instanceof StxError) { - await print_stx_error(error, this.library_manager); - } else { - console.error(error); - } - } - } - async recompile() { const state = this.state; switch (state.type) { @@ -377,10 +276,7 @@ class RtsModule implements imported_module { return [this.state.pkg, this.state.pkg_relative_path]; } - private async get_imported_modules_for_path( - import_path: string, - loc: Loc, - ): Promise { + async get_imported_modules_for_path(import_path: string, loc: Loc): Promise { const mod = await this.library_manager.do_import(import_path, this.path); if (this.imported_modules.includes(mod)) return mod; const self = this; @@ -403,6 +299,131 @@ class RtsModule implements imported_module { assert(rib !== undefined); return rib; } + + get_preexpand_helpers(my_pkg: Package, my_path: string): preexpand_helpers { + const helpers: preexpand_helpers = { + manager: { + resolve_import: async (loc) => { + assert(loc.t.tag === "string"); + const import_path = JSON.parse(loc.t.content); + const mod = this.get_imported_modules_for_path(import_path, loc); + return mod; + }, + resolve_label: async (label) => { + const mod = this.find_module_by_cid(label.cuid); + if (!mod) throw new Error(`cannot find module with cuid = ${label.cuid}`); + return mod.resolve_label(label.name); + }, + get_import_path: async (cuid) => { + const mod = this.find_module_by_cid(cuid); + if (!mod) throw new Error(`cannot find module with cuid = ${cuid}`); + const [mod_pkg, mod_path] = mod.get_pkg_and_path(); + if (mod_pkg === my_pkg) { + const dir0 = join(dirname(my_path), ".rts"); + const dir1 = join(dirname(mod_path), ".rts"); + if (dir0 !== dir1) throw new Error(`TODO relative path imports`); + return `./${basename(mod_path)}.ts`; + } else { + throw new Error(`TODO cross package imports`); + } + }, + resolve_rib: (rib_id, cuid) => { + const mod = this.find_module_by_cid(cuid); + if (!mod) throw new Error(`cannot find module with cuid = ${cuid}`); + return mod.resolve_rib(rib_id); + }, + }, + global_unit: this.global_unit, + global_context: this.global_context, + inspect(_loc, _reason, k) { + return k(); + }, + }; + return helpers; + } +} + +class RtsModule extends Module { + private get_generated_code_absolute_path(): string { + return join(dirname(this.path), ".rts", basename(this.path) + ".ts"); + } + + private get_generated_code_relative_path(): string { + return "./.rts/" + basename(this.path) + ".ts"; + } + + private get_proxy_path(): string { + return this.path + ".ts"; + } + + async do_recompile() { + const state = this.state; + assert(state.type === "stale"); + console.log(`recompiling ${state.cid} ...`); + const code = await fs.readFile(this.path, { encoding: "utf-8" }); + const my_pkg = state.pkg; + const my_path = state.pkg_relative_path; + const source_file: source_file = { + package: { name: my_pkg.name, version: my_pkg.version }, + path: my_path, + }; + const [_loc0, expand] = initial_step(parse(code, source_file), state.cid, this.libs); + try { + const helpers = this.get_preexpand_helpers(my_pkg, my_path); + const { loc, unit, context, modular } = await expand(helpers); + assert(modular.extensible); + const proxy_code = generate_proxy_code( + this.get_generated_code_relative_path(), + modular, + context, + ); + const exported_identifiers = get_exported_identifiers_from_rib( + modular.explicit, + state.cid, + context, + ); + const json_content = { + cid: state.cid, + cookie, + imports: this.imported_modules.map((x) => { + const [pkg, path] = x.get_pkg_and_path(); + return { pkg: { name: pkg.name, version: pkg.version }, pkg_relative_path: path }; + }), + exported_identifiers, + context, + unit, + }; + const code_path = this.get_generated_code_absolute_path(); + await fs.mkdir(dirname(code_path), { recursive: true }); + await fs.writeFile(code_path, await pprint(loc)); + await fs.writeFile(this.get_proxy_path(), proxy_code); + const mtime = Date.now(); + await fs.writeFile(this.get_json_path(), stringify(json_content)); + this.state = { ...state, type: "fresh", ...json_content, mtime }; + console.log(`up to date ${state.cid}`); + } catch (error) { + this.state = { type: "error", reason: String(error) }; + if (error instanceof StxError) { + await print_stx_error(error, this.library_manager); + } else { + console.error(error); + } + } + } +} + +class DtsModule extends Module { + async do_recompile() { + const state = this.state; + assert(state.type === "stale"); + console.log(`recompiling ${state.cid} ...`); + const my_pkg = state.pkg; + const my_path = state.pkg_relative_path; + const code = await fs.readFile(this.path, { encoding: "utf-8" }); + const stuff = parse_dts(code, my_path); + console.log(stuff); + throw new Error("not yet"); + } } type package_props = { types_file?: string }; @@ -452,7 +473,7 @@ export class LibraryManager { if (path.endsWith(".rts")) { return new RtsModule(path, this, this.libs, this.global_unit, this.global_context); } else if (path.endsWith(".d.ts")) { - throw new Error(`TODO import .d.ts ${path}`); + return new DtsModule(path, this, this.libs, this.global_unit, this.global_context); } else { throw new Error(`don't know how to import ${path}`); } diff --git a/src/parse-dts.ts b/src/parse-dts.ts new file mode 100644 index 0000000..27716dc --- /dev/null +++ b/src/parse-dts.ts @@ -0,0 +1,177 @@ +import TS from "typescript"; +import { assert } from "./assert"; + +function parse_statements(statements: TS.NodeArray) { + const types: { [name: string]: { defined: boolean; exported: boolean } } = {}; + const lexicals: { [name: string]: { declared: boolean; exported: boolean } } = {}; + const imported: { [name: string]: { exported_name: string; exporting_module: string } } = {}; + const namespace_imported: { [name: string]: { exporting_module: string } } = {}; + const exported: { [name: string]: { local_name: string; module_name: string | undefined } } = {}; + function push_lexical(name: string, props: { declared: boolean; exported: boolean }) { + assert(!lexicals[name]); + lexicals[name] = props; + } + function push_type(name: string, props: { defined: boolean; exported: boolean }) { + assert(!types[name]); + types[name] = props; + } + function push_imported(name: string, exported_name: string, exporting_module: string) { + assert(!imported[name]); + imported[name] = { exported_name, exporting_module }; + } + function push_namespace_imported(name: string, exporting_module: string) { + assert(!namespace_imported[name]); + namespace_imported[name] = { exporting_module }; + } + function push_exported(local_name: string, name: string, module_name: string | undefined) { + assert(!exported[name], `duplicate export ${local_name} as ${name}`); + exported[name] = { local_name, module_name }; + } + function handle_import_declaration(decl: TS.ImportDeclaration) { + const specifier = decl.moduleSpecifier; + assert(specifier.kind === TS.SyntaxKind.StringLiteral); + const module_name = (specifier as TS.StringLiteral).text; + function handle_clause_name(name: string) { + throw new Error(`import ${name} from ${module_name}`); + } + function handle_import_specifier(spec: TS.ImportSpecifier) { + const name = spec.name.text; + const exported_name = spec.propertyName?.text; + if (exported_name === undefined) { + push_imported(name, name, module_name); + } else { + push_imported(name, exported_name, module_name); + } + } + function handle_clause_bindings(bindings: TS.NamedImportBindings) { + switch (bindings.kind) { + case TS.SyntaxKind.NamedImports: + return bindings.elements.forEach(handle_import_specifier); + case TS.SyntaxKind.NamespaceImport: + return push_namespace_imported(bindings.name.text, module_name); + default: + const invalid: never = bindings; + throw invalid; + } + } + const clause = decl.importClause; + if (clause) { + if (clause.name) { + handle_clause_name(clause.name.text); + } + if (clause.namedBindings) { + handle_clause_bindings(clause.namedBindings); + } + } + } + function handle_export_declaration(decl: TS.ExportDeclaration) { + const module_name = decl.moduleSpecifier + ? (decl.moduleSpecifier as TS.StringLiteral).text + : undefined; + assert(module_name === undefined || typeof module_name === "string"); + function handle_export_specifier(spec: TS.ExportSpecifier) { + const name = spec.name.text; + const specname = spec.propertyName?.text; + if (specname) { + push_exported(specname, name, module_name); + } else { + push_exported(name, name, module_name); + } + } + function handle_named_exports(named_exports: TS.NamedExports) { + named_exports.elements.forEach(handle_export_specifier); + } + function handle_named_export_bindings(bindings: TS.NamedExportBindings) { + switch (bindings.kind) { + case TS.SyntaxKind.NamedExports: + return handle_named_exports(bindings); + default: + throw new Error(`unhandled named export binding type '${TS.SyntaxKind[bindings.kind]}'`); + } + } + assert(!decl.isTypeOnly); + const name = decl.name?.text; + if (name) { + throw new Error(`export name '${name}'`); + } + const clause = decl.exportClause; + if (clause) { + handle_named_export_bindings(clause); + } + } + function handle_module_declaration(decl: TS.ModuleDeclaration) { + const module_name = decl.name.text; + throw new Error(`module declaration '${module_name}'`); + } + function handle_interface_declaration(decl: TS.InterfaceDeclaration) { + const name = decl.name.text; + const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; + const declared = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; + assert(!declared); + push_type(name, { defined: true, exported }); + } + function handle_type_alias_declaration(decl: TS.TypeAliasDeclaration) { + const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; + const declared = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; + assert(!declared); + const name = decl.name.text; + push_type(name, { defined: true, exported }); + } + function handle_function_declaration(decl: TS.FunctionDeclaration) { + const name = decl.name?.text; + const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; + const declared = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; + assert(name !== undefined); + assert(declared); + push_lexical(name, { declared, exported }); + } + function handle_variable_statement(decl: TS.VariableStatement) { + const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; + const declared = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; + assert(declared); + function handle_binding_name(binding: TS.BindingName) { + switch (binding.kind) { + case TS.SyntaxKind.Identifier: + return push_lexical(binding.text, { declared, exported }); + default: + throw new Error(`unhandled binding type '${TS.SyntaxKind[binding.kind]}'`); + } + } + function handle_decl(decl: TS.VariableDeclaration) { + handle_binding_name(decl.name); + } + decl.declarationList.declarations.forEach(handle_decl); + } + function handle_statement(stmt: TS.Statement) { + switch (stmt.kind) { + case TS.SyntaxKind.ImportDeclaration: + return handle_import_declaration(stmt as TS.ImportDeclaration); + case TS.SyntaxKind.ExportDeclaration: + return handle_export_declaration(stmt as TS.ExportDeclaration); + case TS.SyntaxKind.ModuleDeclaration: + return handle_module_declaration(stmt as TS.ModuleDeclaration); + case TS.SyntaxKind.InterfaceDeclaration: + return handle_interface_declaration(stmt as TS.InterfaceDeclaration); + case TS.SyntaxKind.TypeAliasDeclaration: + return handle_type_alias_declaration(stmt as TS.TypeAliasDeclaration); + case TS.SyntaxKind.FunctionDeclaration: + return handle_function_declaration(stmt as TS.FunctionDeclaration); + case TS.SyntaxKind.VariableStatement: + return handle_variable_statement(stmt as TS.VariableStatement); + default: + throw new Error(`unhandled statement in d.ts file '${TS.SyntaxKind[stmt.kind]}'`); + } + } + statements.forEach(handle_statement); + return { types, lexicals, imported, namespace_imported, exported }; +} + +export function parse_dts(code: string, my_path: string) { + const options: TS.CreateSourceFileOptions = { + languageVersion: TS.ScriptTarget.ESNext, + jsDocParsingMode: TS.JSDocParsingMode.ParseNone, + }; + const src = TS.createSourceFile(my_path, code, options); + if (src.libReferenceDirectives.length !== 0) throw new Error("not handled"); + const data = parse_statements(src.statements); +} diff --git a/src/parse.ts b/src/parse.ts index fff3fa7..596c4f4 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -17,6 +17,26 @@ const pass_through: { [k in SyntaxKind]?: list_tag } = { [SyntaxKind.ImportClause]: "import_clause", [SyntaxKind.ImportDeclaration]: "import_declaration", [SyntaxKind.NamespaceImport]: "namespace_import", + [SyntaxKind.FunctionType]: "function_type", + [SyntaxKind.PropertySignature]: "property_signature", + [SyntaxKind.InterfaceDeclaration]: "interface_declaration", + [SyntaxKind.ModuleBlock]: "module_block", + [SyntaxKind.ModuleDeclaration]: "module_declaration", + [SyntaxKind.TypeOperator]: "type_operator", + [SyntaxKind.MappedType]: "mapped_type", + [SyntaxKind.TypeReference]: "type_reference", + [SyntaxKind.CallSignature]: "call_signature", + [SyntaxKind.ArrayType]: "array_type", + [SyntaxKind.TypeLiteral]: "type_literal", + [SyntaxKind.FunctionDeclaration]: "function_declaration", + [SyntaxKind.IndexedAccessType]: "indexed_access_type", + [SyntaxKind.ExpressionWithTypeArguments]: "expression_with_type_arguments", + [SyntaxKind.HeritageClause]: "heritage_clause", + [SyntaxKind.ConditionalType]: "conditional_type", + [SyntaxKind.TypeQuery]: "type_query", + [SyntaxKind.MethodSignature]: "method_signature", + [SyntaxKind.ParenthesizedType]: "parenthesized_type", + [SyntaxKind.TypePredicate]: "type_predicate", [SyntaxKind.SyntaxList]: "syntax_list", }; @@ -103,6 +123,25 @@ function absurdly(node: TS.Node, source: TS.SourceFile, f: source_file): AST { case SyntaxKind.NullKeyword: case SyntaxKind.StringKeyword: case SyntaxKind.NumberKeyword: + case SyntaxKind.DeclareKeyword: + case SyntaxKind.NamespaceKeyword: + case SyntaxKind.InterfaceKeyword: + case SyntaxKind.AnyKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.InKeyword: + case SyntaxKind.KeyOfKeyword: + case SyntaxKind.ModuleKeyword: + case SyntaxKind.NeverKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.UndefinedKeyword: + case SyntaxKind.UnknownKeyword: + case SyntaxKind.FunctionKeyword: + case SyntaxKind.FalseKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.TypeOfKeyword: + case SyntaxKind.IsKeyword: + case SyntaxKind.SymbolKeyword: + case SyntaxKind.ReadonlyKeyword: return { type: "atom", tag: "other", content, src }; case SyntaxKind.EndOfFileToken: return { type: "atom", tag: "other", content, src }; diff --git a/src/tags.ts b/src/tags.ts index 5d0f377..41ff175 100644 --- a/src/tags.ts +++ b/src/tags.ts @@ -50,5 +50,23 @@ export type list_tag = | "array_pattern" | "object_pattern" | "slice" + | "function_type" + | "interface_declaration" + | "module_block" + | "module_declaration" + | "type_operator" + | "mapped_type" + | "type_reference" + | "call_signature" + | "array_type" + | "type_literal" + | "function_declaration" + | "indexed_access_type" + | "expression_with_type_arguments" + | "heritage_clause" + | "conditional_type" + | "method_signature" + | "parenthesized_type" + | "type_predicate" | "syntax_list" | "ERROR"; From 1f06c53a248a67f3a7f4b46303683fd70079b6c4 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Tue, 24 Dec 2024 05:39:05 +0300 Subject: [PATCH 11/22] finished parsing dst declarations --- src/parse-dts.ts | 356 ++++++++++++++++++++++++++++------------------- 1 file changed, 212 insertions(+), 144 deletions(-) diff --git a/src/parse-dts.ts b/src/parse-dts.ts index 27716dc..e187946 100644 --- a/src/parse-dts.ts +++ b/src/parse-dts.ts @@ -2,168 +2,235 @@ import TS from "typescript"; import { assert } from "./assert"; function parse_statements(statements: TS.NodeArray) { - const types: { [name: string]: { defined: boolean; exported: boolean } } = {}; - const lexicals: { [name: string]: { declared: boolean; exported: boolean } } = {}; - const imported: { [name: string]: { exported_name: string; exporting_module: string } } = {}; - const namespace_imported: { [name: string]: { exporting_module: string } } = {}; - const exported: { [name: string]: { local_name: string; module_name: string | undefined } } = {}; - function push_lexical(name: string, props: { declared: boolean; exported: boolean }) { - assert(!lexicals[name]); - lexicals[name] = props; - } - function push_type(name: string, props: { defined: boolean; exported: boolean }) { - assert(!types[name]); - types[name] = props; - } - function push_imported(name: string, exported_name: string, exporting_module: string) { - assert(!imported[name]); - imported[name] = { exported_name, exporting_module }; - } - function push_namespace_imported(name: string, exporting_module: string) { - assert(!namespace_imported[name]); - namespace_imported[name] = { exporting_module }; - } - function push_exported(local_name: string, name: string, module_name: string | undefined) { - assert(!exported[name], `duplicate export ${local_name} as ${name}`); - exported[name] = { local_name, module_name }; - } - function handle_import_declaration(decl: TS.ImportDeclaration) { - const specifier = decl.moduleSpecifier; - assert(specifier.kind === TS.SyntaxKind.StringLiteral); - const module_name = (specifier as TS.StringLiteral).text; - function handle_clause_name(name: string) { - throw new Error(`import ${name} from ${module_name}`); + // type id = ... + const types: { [id: string]: { global: boolean } } = {}; + // const id = ... + const lexicals: { [id: string]: { global: boolean } } = {}; + // import { id } from origin_module or import { origin_name as id } from origin_module + const imported: { + [id: string]: { global: boolean; origin_name: string; origin_module: string }; + } = {}; + // import * as id from origin_module or import id from origin_module + const namespace_imported: { [id: string]: { global: boolean; origin_module: string } } = {}; + // module id { ... } + const id_namespaces: { [id: string]: { global: boolean } } = {}; + // module "id" { ... } + const literal_namespaces: { [id: string]: { global: boolean } } = {}; + // export { id } or export { origin_name as id } or + // export { id } from origin_module or export { origin_name as id } from origin_module + const exported: { + [id: string]: { + global: boolean; + type_only: boolean; + origin_name: string; + origin_module: string | undefined; + }; + } = {}; + + function handle_main_definition(global: boolean) { + function push_lexical(name: string) { + assert(!lexicals[name]); + lexicals[name] = { global }; } - function handle_import_specifier(spec: TS.ImportSpecifier) { - const name = spec.name.text; - const exported_name = spec.propertyName?.text; - if (exported_name === undefined) { - push_imported(name, name, module_name); - } else { - push_imported(name, exported_name, module_name); - } + function push_type(name: string) { + assert(!types[name]); + types[name] = { global }; } - function handle_clause_bindings(bindings: TS.NamedImportBindings) { - switch (bindings.kind) { - case TS.SyntaxKind.NamedImports: - return bindings.elements.forEach(handle_import_specifier); - case TS.SyntaxKind.NamespaceImport: - return push_namespace_imported(bindings.name.text, module_name); - default: - const invalid: never = bindings; - throw invalid; + function push_imported(name: string, origin_name: string, origin_module: string) { + assert(!imported[name]); + imported[name] = { origin_name, origin_module, global }; + } + function push_namespace_imported(name: string, origin_module: string) { + assert(!namespace_imported[name]); + namespace_imported[name] = { origin_module, global }; + } + function push_exported( + name: string, + type_only: boolean, + origin_name: string, + origin_module: string | undefined, + ) { + assert(!exported[name], `duplicate export ${origin_name} as ${name}`); + exported[name] = { type_only, origin_name, origin_module, global }; + } + function push_namespace(name: string, literal: boolean) { + const ns = literal ? literal_namespaces : id_namespaces; + assert(!ns[name]); + ns[name] = { global }; + } + function handle_import_declaration(decl: TS.ImportDeclaration) { + const specifier = decl.moduleSpecifier; + assert(specifier.kind === TS.SyntaxKind.StringLiteral); + const module_name = (specifier as TS.StringLiteral).text; + function handle_clause_name(name: string) { + throw new Error(`import ${name} from ${module_name}`); + } + function handle_import_specifier(spec: TS.ImportSpecifier) { + const name = spec.name.text; + const exported_name = spec.propertyName?.text; + assert(!spec.isTypeOnly, `unhandled type only import`); + if (exported_name === undefined) { + push_imported(name, name, module_name); + } else { + push_imported(name, exported_name, module_name); + } + } + function handle_clause_bindings(bindings: TS.NamedImportBindings) { + switch (bindings.kind) { + case TS.SyntaxKind.NamedImports: + return bindings.elements.forEach(handle_import_specifier); + case TS.SyntaxKind.NamespaceImport: + return push_namespace_imported(bindings.name.text, module_name); + default: + const invalid: never = bindings; + throw invalid; + } + } + const clause = decl.importClause; + if (clause) { + if (clause.name) { + handle_clause_name(clause.name.text); + } + if (clause.namedBindings) { + handle_clause_bindings(clause.namedBindings); + } } } - const clause = decl.importClause; - if (clause) { - if (clause.name) { - handle_clause_name(clause.name.text); + function handle_export_declaration(decl: TS.ExportDeclaration) { + const module_name = decl.moduleSpecifier + ? (decl.moduleSpecifier as TS.StringLiteral).text + : undefined; + assert(module_name === undefined || typeof module_name === "string"); + function handle_export_specifier(spec: TS.ExportSpecifier) { + const name = spec.name.text; + const specname = spec.propertyName?.text; + const type_only = spec.isTypeOnly; + push_exported(name, type_only, specname ?? name, module_name); + } + function handle_named_exports(named_exports: TS.NamedExports) { + named_exports.elements.forEach(handle_export_specifier); } - if (clause.namedBindings) { - handle_clause_bindings(clause.namedBindings); + function handle_named_export_bindings(bindings: TS.NamedExportBindings) { + switch (bindings.kind) { + case TS.SyntaxKind.NamedExports: + return handle_named_exports(bindings); + default: + throw new Error( + `unhandled named export binding type '${TS.SyntaxKind[bindings.kind]}'`, + ); + } + } + assert(!decl.isTypeOnly); + const name = decl.name?.text; + if (name) { + throw new Error(`export name '${name}'`); + } + const clause = decl.exportClause; + if (clause) { + handle_named_export_bindings(clause); } } - } - function handle_export_declaration(decl: TS.ExportDeclaration) { - const module_name = decl.moduleSpecifier - ? (decl.moduleSpecifier as TS.StringLiteral).text - : undefined; - assert(module_name === undefined || typeof module_name === "string"); - function handle_export_specifier(spec: TS.ExportSpecifier) { - const name = spec.name.text; - const specname = spec.propertyName?.text; - if (specname) { - push_exported(specname, name, module_name); + function handle_module_declaration(decl: TS.ModuleDeclaration) { + const module_name = decl.name.text; + const kind = decl.name.kind; + const literal_table: { [k in typeof kind]: boolean } = { + [TS.SyntaxKind.Identifier]: false, + [TS.SyntaxKind.StringLiteral]: true, + }; + const literal = literal_table[kind]; + assert(literal !== undefined); + if (!literal && module_name === "global") { + const body = decl.body; + assert(body !== undefined); + switch (body.kind) { + case TS.SyntaxKind.ModuleBlock: + return body.statements.forEach(handle_main_definition(true)); + default: + throw new Error(`unhandled module body '${TS.SyntaxKind[body.kind]}'`); + } } else { - push_exported(name, name, module_name); + push_namespace(module_name, literal); } } - function handle_named_exports(named_exports: TS.NamedExports) { - named_exports.elements.forEach(handle_export_specifier); + function handle_interface_declaration(decl: TS.InterfaceDeclaration) { + const name = decl.name.text; + const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; + const declared = + decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; + assert(!declared); + assert(!exported); + push_type(name); } - function handle_named_export_bindings(bindings: TS.NamedExportBindings) { - switch (bindings.kind) { - case TS.SyntaxKind.NamedExports: - return handle_named_exports(bindings); - default: - throw new Error(`unhandled named export binding type '${TS.SyntaxKind[bindings.kind]}'`); - } + function handle_type_alias_declaration(decl: TS.TypeAliasDeclaration) { + const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; + const declared = + decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; + assert(!declared); + assert(!exported); + const name = decl.name.text; + push_type(name); } - assert(!decl.isTypeOnly); - const name = decl.name?.text; - if (name) { - throw new Error(`export name '${name}'`); + function handle_function_declaration(decl: TS.FunctionDeclaration) { + const name = decl.name?.text; + const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; + assert(!exported); + const declared = + decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; + assert(name !== undefined); + assert(declared); + push_lexical(name); } - const clause = decl.exportClause; - if (clause) { - handle_named_export_bindings(clause); + function handle_variable_statement(decl: TS.VariableStatement) { + const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; + assert(!exported); + const declared = + decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; + assert(declared); + function handle_binding_name(binding: TS.BindingName) { + switch (binding.kind) { + case TS.SyntaxKind.Identifier: + return push_lexical(binding.text); + default: + throw new Error(`unhandled binding type '${TS.SyntaxKind[binding.kind]}'`); + } + } + function handle_decl(decl: TS.VariableDeclaration) { + handle_binding_name(decl.name); + } + decl.declarationList.declarations.forEach(handle_decl); } - } - function handle_module_declaration(decl: TS.ModuleDeclaration) { - const module_name = decl.name.text; - throw new Error(`module declaration '${module_name}'`); - } - function handle_interface_declaration(decl: TS.InterfaceDeclaration) { - const name = decl.name.text; - const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; - const declared = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; - assert(!declared); - push_type(name, { defined: true, exported }); - } - function handle_type_alias_declaration(decl: TS.TypeAliasDeclaration) { - const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; - const declared = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; - assert(!declared); - const name = decl.name.text; - push_type(name, { defined: true, exported }); - } - function handle_function_declaration(decl: TS.FunctionDeclaration) { - const name = decl.name?.text; - const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; - const declared = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; - assert(name !== undefined); - assert(declared); - push_lexical(name, { declared, exported }); - } - function handle_variable_statement(decl: TS.VariableStatement) { - const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; - const declared = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; - assert(declared); - function handle_binding_name(binding: TS.BindingName) { - switch (binding.kind) { - case TS.SyntaxKind.Identifier: - return push_lexical(binding.text, { declared, exported }); + function handle_statement(stmt: TS.Statement) { + switch (stmt.kind) { + case TS.SyntaxKind.ImportDeclaration: + return handle_import_declaration(stmt as TS.ImportDeclaration); + case TS.SyntaxKind.ExportDeclaration: + return handle_export_declaration(stmt as TS.ExportDeclaration); + case TS.SyntaxKind.ModuleDeclaration: + return handle_module_declaration(stmt as TS.ModuleDeclaration); + case TS.SyntaxKind.InterfaceDeclaration: + return handle_interface_declaration(stmt as TS.InterfaceDeclaration); + case TS.SyntaxKind.TypeAliasDeclaration: + return handle_type_alias_declaration(stmt as TS.TypeAliasDeclaration); + case TS.SyntaxKind.FunctionDeclaration: + return handle_function_declaration(stmt as TS.FunctionDeclaration); + case TS.SyntaxKind.VariableStatement: + return handle_variable_statement(stmt as TS.VariableStatement); default: - throw new Error(`unhandled binding type '${TS.SyntaxKind[binding.kind]}'`); + throw new Error(`unhandled statement in d.ts file '${TS.SyntaxKind[stmt.kind]}'`); } } - function handle_decl(decl: TS.VariableDeclaration) { - handle_binding_name(decl.name); - } - decl.declarationList.declarations.forEach(handle_decl); - } - function handle_statement(stmt: TS.Statement) { - switch (stmt.kind) { - case TS.SyntaxKind.ImportDeclaration: - return handle_import_declaration(stmt as TS.ImportDeclaration); - case TS.SyntaxKind.ExportDeclaration: - return handle_export_declaration(stmt as TS.ExportDeclaration); - case TS.SyntaxKind.ModuleDeclaration: - return handle_module_declaration(stmt as TS.ModuleDeclaration); - case TS.SyntaxKind.InterfaceDeclaration: - return handle_interface_declaration(stmt as TS.InterfaceDeclaration); - case TS.SyntaxKind.TypeAliasDeclaration: - return handle_type_alias_declaration(stmt as TS.TypeAliasDeclaration); - case TS.SyntaxKind.FunctionDeclaration: - return handle_function_declaration(stmt as TS.FunctionDeclaration); - case TS.SyntaxKind.VariableStatement: - return handle_variable_statement(stmt as TS.VariableStatement); - default: - throw new Error(`unhandled statement in d.ts file '${TS.SyntaxKind[stmt.kind]}'`); - } + return handle_statement; } - statements.forEach(handle_statement); - return { types, lexicals, imported, namespace_imported, exported }; + statements.forEach(handle_main_definition(false)); + return { + types, + lexicals, + imported, + namespace_imported, + exported, + id_namespaces, + literal_namespaces, + }; } export function parse_dts(code: string, my_path: string) { @@ -174,4 +241,5 @@ export function parse_dts(code: string, my_path: string) { const src = TS.createSourceFile(my_path, code, options); if (src.libReferenceDirectives.length !== 0) throw new Error("not handled"); const data = parse_statements(src.statements); + console.log(data); } From 5c79fcead71267996fd9043fa815989409137c1b Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Tue, 24 Dec 2024 05:46:37 +0300 Subject: [PATCH 12/22] removed incorrect passthrough type --- src/parse.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/parse.ts b/src/parse.ts index 596c4f4..645fd6d 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -24,7 +24,6 @@ const pass_through: { [k in SyntaxKind]?: list_tag } = { [SyntaxKind.ModuleDeclaration]: "module_declaration", [SyntaxKind.TypeOperator]: "type_operator", [SyntaxKind.MappedType]: "mapped_type", - [SyntaxKind.TypeReference]: "type_reference", [SyntaxKind.CallSignature]: "call_signature", [SyntaxKind.ArrayType]: "array_type", [SyntaxKind.TypeLiteral]: "type_literal", From 6f67cd1fa02a78ebb2e49ac186208d0c8436c8cc Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Tue, 24 Dec 2024 11:59:22 +0300 Subject: [PATCH 13/22] finished ts_exports --- src/library-manager.ts | 4 +-- src/parse-dts.ts | 62 +++++++++++++++++++++++++++++++++--------- 2 files changed, 51 insertions(+), 15 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index 0b4d143..df00d6b 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -420,8 +420,8 @@ class DtsModule extends Module { const my_pkg = state.pkg; const my_path = state.pkg_relative_path; const code = await fs.readFile(this.path, { encoding: "utf-8" }); - const stuff = parse_dts(code, my_path); - console.log(stuff); + const ts_exports = parse_dts(code, my_path); + console.log(ts_exports); throw new Error("not yet"); } } diff --git a/src/parse-dts.ts b/src/parse-dts.ts index e187946..ed86cde 100644 --- a/src/parse-dts.ts +++ b/src/parse-dts.ts @@ -1,7 +1,13 @@ import TS from "typescript"; import { assert } from "./assert"; -function parse_statements(statements: TS.NodeArray) { +export type ts_export_binding = + | { type: "local"; name: string; is_type: boolean; is_lexical: boolean } + | { type: "imported"; name: string | undefined; module: string; type_only: boolean }; + +export type ts_exports = { [id: string]: ts_export_binding }; + +function parse_statements(statements: TS.NodeArray): ts_exports { // type id = ... const types: { [id: string]: { global: boolean } } = {}; // const id = ... @@ -27,6 +33,45 @@ function parse_statements(statements: TS.NodeArray) { }; } = {}; + function extract_exports(): ts_exports { + const all_exports: ts_exports = {}; + Object.entries(exported).forEach(([id, { global, type_only, origin_name, origin_module }]) => { + if (global) return; + assert(!all_exports[id]); + if (origin_module === undefined) { + if (imported[origin_name]) { + assert(!types[origin_name]); + assert(!namespace_imported[origin_name]); + assert(!lexicals[origin_name]); + assert(!id_namespaces[origin_name]); + const { origin_name: name, origin_module: module, global } = imported[origin_name]; + assert(!global); + all_exports[id] = { type: "imported", name, module, type_only }; + } else if (type_only) { + const t = types[origin_name]; + assert(t !== undefined); + all_exports[id] = { type: "local", name: origin_name, is_type: true, is_lexical: false }; + } else if (namespace_imported[origin_name]) { + assert(!types[origin_name]); + assert(!lexicals[origin_name]); + assert(!id_namespaces[origin_name]); + const { origin_module: module, global } = namespace_imported[origin_name]; + assert(!global); + all_exports[id] = { type: "imported", name: undefined, module, type_only: false }; + } else { + const is_type = !!types[origin_name]; + const is_lexical = !!lexicals[origin_name]; + assert(is_type || is_lexical); + assert(!id_namespaces[origin_name]); + all_exports[id] = { type: "local", name: origin_name, is_type, is_lexical }; + } + } else { + all_exports[id] = { type: "imported", name: origin_name, module: origin_module, type_only }; + } + }); + return all_exports; + } + function handle_main_definition(global: boolean) { function push_lexical(name: string) { assert(!lexicals[name]); @@ -222,24 +267,15 @@ function parse_statements(statements: TS.NodeArray) { return handle_statement; } statements.forEach(handle_main_definition(false)); - return { - types, - lexicals, - imported, - namespace_imported, - exported, - id_namespaces, - literal_namespaces, - }; + return extract_exports(); } -export function parse_dts(code: string, my_path: string) { +export function parse_dts(code: string, my_path: string): ts_exports { const options: TS.CreateSourceFileOptions = { languageVersion: TS.ScriptTarget.ESNext, jsDocParsingMode: TS.JSDocParsingMode.ParseNone, }; const src = TS.createSourceFile(my_path, code, options); if (src.libReferenceDirectives.length !== 0) throw new Error("not handled"); - const data = parse_statements(src.statements); - console.log(data); + return parse_statements(src.statements); } From 8f0cdfb30e7ecd71db53d072e281812bb7dd6b9d Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 25 Dec 2024 04:44:56 +0300 Subject: [PATCH 14/22] more progress towards resolving node modules --- src/library-manager.ts | 80 ++++++++++++++++++++++++++++++++++++++-- src/preexpand-helpers.ts | 2 +- 2 files changed, 78 insertions(+), 4 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index df00d6b..c968a2c 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -12,6 +12,7 @@ import { import_resolution, preexpand_helpers, get_exported_identifiers_from_rib, + exported_identifiers, } from "./preexpand-helpers"; import { AST, source_file } from "./ast"; import { normalize } from "node:path"; @@ -421,8 +422,59 @@ class DtsModule extends Module { const my_path = state.pkg_relative_path; const code = await fs.readFile(this.path, { encoding: "utf-8" }); const ts_exports = parse_dts(code, my_path); - console.log(ts_exports); - throw new Error("not yet"); + const cid = state.cid; + const rib: Rib = { type: "rib", types_env: {}, normal_env: {} }; + const unit: CompilationUnit = { + cu_id: cid, + store: { r0: rib }, + }; + const context: Context = {}; + const unique_imports: { [k: string]: boolean } = {}; + for (const x of Object.values(ts_exports)) { + if (x.type === "imported") { + const module_name = x.module; + unique_imports[module_name] = true; + } + } + for (const module_name of Object.keys(unique_imports)) { + const mod = await this.library_manager.do_import(module_name, this.path); + if (!this.imported_modules.includes(mod)) { + this.imported_modules.push(mod); + } + } + const export_ids = Object.entries(ts_exports).map(([name, binding]) => { + switch (binding.type) { + case "local": { + throw new Error("local"); + } + case "imported": { + console.log(binding); + throw new Error("imported"); + } + default: + const invalid: never = binding; + throw invalid; + } + }); + const exported_identifiers: exported_identifiers = {}; + const json_content = { + cid: state.cid, + cookie, + imports: this.imported_modules.map((x) => { + const [pkg, path] = x.get_pkg_and_path(); + return { pkg: { name: pkg.name, version: pkg.version }, pkg_relative_path: path }; + }), + exported_identifiers, + context, + unit, + }; + // const json_path = this.get_json_path(); + // await fs.mkdir(dirname(json_path), { recursive: true }); + const mtime = Date.now(); + // await fs.writeFile(this.get_json_path(), stringify(json_content)); + + this.state = { ...state, type: "fresh", ...json_content, mtime }; + console.log(`up to date ${state.cid}`); } } @@ -474,6 +526,14 @@ export class LibraryManager { return new RtsModule(path, this, this.libs, this.global_unit, this.global_context); } else if (path.endsWith(".d.ts")) { return new DtsModule(path, this, this.libs, this.global_unit, this.global_context); + } else if (path.endsWith(".js")) { + return new DtsModule( + path.replace(/\.js$/, ".d.ts"), + this, + this.libs, + this.global_unit, + this.global_context, + ); } else { throw new Error(`don't know how to import ${path}`); } @@ -521,6 +581,8 @@ export class LibraryManager { async resolve_node_module_package(pkg_name: string, dir: string): Promise { const pkg_dir = `${dir}/node_modules/${pkg_name}`; + console.log(`resolve_node_module_package ${pkg_dir}`); + assert(dir !== "/"); const existing = this.packages[pkg_dir]; if (existing) return existing; const pkg_path = join(pkg_dir, "package.json"); @@ -559,12 +621,24 @@ export class LibraryManager { const types_path = join(pkg.dir, pkg.props.types_file); return types_path; } else { - throw new Error(`TODO nested import of ${b} from ${dirname(import_path)}`); + const pkg = await this.resolve_node_module_package(import_path, dirname(importer_path)); + assert(pkg.props.types_file !== undefined); + return join(pkg.dir, pkg.props.types_file); + //throw new Error(`TODO nested import '${import_path}' of ${b} from ${dirname(import_path)}`); } }; + // const resolve_import_path: (import_path: string, importer_path: string) => Promise<[]> = async ( + // import_path, + // importer_path, + // ) => { + // const dir = dirname(importer_path); + // const pkg_file = `${dir}/node_modules/${import_path}/package.json`; + // const dts_file = `${dir}/node_modules/${import_path}.d.ts`; + // }; const actual_path = is_relative(import_path) ? join_relative(import_path, importer_path) : await find_absolute_path(import_path); + console.log(`import of ${import_path} from ${importer_path} resolved to ${actual_path}`); const mod = this.get_or_create_module(actual_path); return mod; } diff --git a/src/preexpand-helpers.ts b/src/preexpand-helpers.ts index c1d5add..0e84a02 100644 --- a/src/preexpand-helpers.ts +++ b/src/preexpand-helpers.ts @@ -37,7 +37,7 @@ export type preexpand_helpers = { global_context: Context; }; -type exported_identifiers = { +export type exported_identifiers = { [name: string]: import_resolution[]; }; From 46d61d6c63b80d2a3ef3e86574b8fc38b5ce93d6 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 25 Dec 2024 06:51:40 +0300 Subject: [PATCH 15/22] first stab at constructing exports --- src/library-manager.ts | 110 +++++++++++++++++++++++++-------------- src/preexpand-helpers.ts | 6 +++ tsconfig.tsbuildinfo | 2 +- 3 files changed, 77 insertions(+), 41 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index c968a2c..cf8f6e5 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -428,7 +428,6 @@ class DtsModule extends Module { cu_id: cid, store: { r0: rib }, }; - const context: Context = {}; const unique_imports: { [k: string]: boolean } = {}; for (const x of Object.values(ts_exports)) { if (x.type === "imported") { @@ -442,21 +441,34 @@ class DtsModule extends Module { this.imported_modules.push(mod); } } - const export_ids = Object.entries(ts_exports).map(([name, binding]) => { - switch (binding.type) { - case "local": { - throw new Error("local"); - } - case "imported": { - console.log(binding); - throw new Error("imported"); + const context: Context = {}; + const export_entries: [string, import_resolution[]][] = Object.entries(ts_exports).map( + ([name, binding]) => { + switch (binding.type) { + case "local": { + const res: import_resolution[] = []; + if (binding.is_type) { + res.push({ type: "type", label: { cuid: cid, name: `t.${binding.name}` } }); + } + if (binding.is_lexical) { + res.push({ type: "lexical", label: { cuid: cid, name: `l.${binding.name}` } }); + } + return [name, res]; + } + case "imported": { + const res: import_resolution = { + type: "ts", + label: { cuid: cid, name: `e.${binding.name}.${binding.module}` }, + }; + return [name, [res]]; + } + default: + const invalid: never = binding; + throw invalid; } - default: - const invalid: never = binding; - throw invalid; - } - }); - const exported_identifiers: exported_identifiers = {}; + }, + ); + const exported_identifiers: exported_identifiers = Object.fromEntries(export_entries); const json_content = { cid: state.cid, cookie, @@ -478,7 +490,11 @@ class DtsModule extends Module { } } -type package_props = { types_file?: string }; +type package_props = { + types?: string; + main?: string; + exports?: { [k: string]: string | { types?: string } }; +}; class Package { name: string; @@ -524,7 +540,7 @@ export class LibraryManager { const mod = (() => { if (path.endsWith(".rts")) { return new RtsModule(path, this, this.libs, this.global_unit, this.global_context); - } else if (path.endsWith(".d.ts")) { + } else if (path.endsWith(".d.ts") || path.endsWith(".d.cts")) { return new DtsModule(path, this, this.libs, this.global_unit, this.global_context); } else if (path.endsWith(".js")) { return new DtsModule( @@ -589,12 +605,13 @@ export class LibraryManager { try { const content = await fs.readFile(pkg_path, { encoding: "utf8" }); const json = JSON.parse(content); - const { name, version, types } = json; + const { name, version, types, main, exports } = json; assert(name === pkg_name); assert(typeof version === "string"); - assert(typeof types === "string"); return (this.packages[pkg_dir] ??= new Package(pkg_name, version, pkg_dir, { - types_file: types, + main, + types, + exports, })); } catch (err: any) { if (err?.code === "ENOENT") { @@ -613,31 +630,44 @@ export class LibraryManager { const path = dirname(importer_path) + "/" + import_path; return normalize(path); } - const find_absolute_path = async (import_path: string) => { - const b = basename(import_path); - if (b === import_path) { - const pkg = await this.resolve_node_module_package(b, dirname(importer_path)); - assert(pkg.props.types_file !== undefined, `no types_file found in ${pkg.name}`); - const types_path = join(pkg.dir, pkg.props.types_file); - return types_path; + function is_scoped(path: string): boolean { + return path.startsWith("@"); + } + const find_normal_path = async (import_path: string) => { + const [pkg_name, ...import_parts] = import_path.split("/"); + const pkg = await this.resolve_node_module_package(pkg_name, dirname(importer_path)); + if (import_parts.length !== 0) throw new Error(`TODO import parts`); + if (pkg.props.types) { + return normalize(pkg.dir + "/" + pkg.props.types); + } else if (pkg.props.main) { + return normalize(pkg.dir + "/" + pkg.props.main); + } else { + throw new Error(`cannot find main file in ${pkg.dir}`); + } + }; + const find_scoped_path = async (import_path: string) => { + const [scope_name, scoped_name, ...import_parts] = import_path.split("/"); + const pkg_name = scope_name + "/" + scoped_name; + const pkg = await this.resolve_node_module_package(pkg_name, dirname(importer_path)); + if (import_parts.length === 0) { + assert(pkg.props.types !== undefined); + return normalize(pkg.dir + "/" + pkg.props.types); } else { - const pkg = await this.resolve_node_module_package(import_path, dirname(importer_path)); - assert(pkg.props.types_file !== undefined); - return join(pkg.dir, pkg.props.types_file); - //throw new Error(`TODO nested import '${import_path}' of ${b} from ${dirname(import_path)}`); + const p = "./" + import_parts.join("/"); + const entry = pkg.props.exports?.[p]; + if (entry === undefined) throw new Error(`cannot locate ${import_path} in ${pkg.dir}`); + if (typeof entry === "string") throw new Error(`TODO export string in ${pkg.dir}`); + const types_file = entry.types; + if (types_file === undefined) throw new Error(`not types for ${import_path} in ${pkg.dir}`); + const filepath = normalize(pkg.dir + "/" + types_file); + return filepath; } }; - // const resolve_import_path: (import_path: string, importer_path: string) => Promise<[]> = async ( - // import_path, - // importer_path, - // ) => { - // const dir = dirname(importer_path); - // const pkg_file = `${dir}/node_modules/${import_path}/package.json`; - // const dts_file = `${dir}/node_modules/${import_path}.d.ts`; - // }; const actual_path = is_relative(import_path) ? join_relative(import_path, importer_path) - : await find_absolute_path(import_path); + : is_scoped(import_path) + ? await find_scoped_path(import_path) + : await find_normal_path(import_path); console.log(`import of ${import_path} from ${importer_path} resolved to ${actual_path}`); const mod = this.get_or_create_module(actual_path); return mod; diff --git a/src/preexpand-helpers.ts b/src/preexpand-helpers.ts index 0e84a02..1a9647f 100644 --- a/src/preexpand-helpers.ts +++ b/src/preexpand-helpers.ts @@ -7,6 +7,12 @@ export type import_resolution = { type: Binding["type"]; label: Label; }; +// | { +// type: "imported"; +// name: string | undefined; +// module: string; +// type_only: boolean; +// }; export type imported_module = { imported_modules: imported_module[]; diff --git a/tsconfig.tsbuildinfo b/tsconfig.tsbuildinfo index c92621a..20624f8 100644 --- a/tsconfig.tsbuildinfo +++ b/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./files.test.ts","./generate-stdlibs.test.ts","./vite.config.ts","./vitest.config.ts","./rtsc/watch.ts","./src/assert.ts","./src/ast.ts","./src/data.ts","./src/expander.ts","./src/fs-helpers.ts","./src/generate-stdlibs.ts","./src/generated-stdlibs.ts","./src/global-module.ts","./src/library-manager.ts","./src/llhelpers.ts","./src/parse.ts","./src/pprint.ts","./src/preexpand-handlers.ts","./src/preexpand-helpers.ts","./src/proxy-code.ts","./src/serialize.ts","./src/stx-error.ts","./src/stx.ts","./src/syntax-core-patterns.ts","./src/syntax-structures.ts","./src/tags.ts","./src/zipper.ts","./test-project/index.ts","./test-project/main.rts.ts","./test-project/mod.rts.ts","./ui/astvis.tsx","./ui/app.tsx","./ui/editor.tsx","./ui/main.tsx","./ui/vite-env.d.ts"],"version":"5.7.2"} \ No newline at end of file +{"root":["./files.test.ts","./generate-stdlibs.test.ts","./vite.config.ts","./vitest.config.ts","./rtsc/watch.ts","./src/assert.ts","./src/ast.ts","./src/data.ts","./src/expander.ts","./src/fs-helpers.ts","./src/generate-stdlibs.ts","./src/generated-stdlibs.ts","./src/global-module.ts","./src/library-manager.ts","./src/llhelpers.ts","./src/parse-dts.ts","./src/parse.ts","./src/pprint.ts","./src/preexpand-handlers.ts","./src/preexpand-helpers.ts","./src/proxy-code.ts","./src/serialize.ts","./src/stx-error.ts","./src/stx.ts","./src/syntax-core-patterns.ts","./src/syntax-structures.ts","./src/tags.ts","./src/zipper.ts","./test-project/index.ts","./test-project/main.rts.ts","./test-project/mod.rts.ts","./ui/astvis.tsx","./ui/app.tsx","./ui/editor.tsx","./ui/main.tsx","./ui/vite-env.d.ts"],"version":"5.7.2"} \ No newline at end of file From ba1f7db024ada0f4e082e3c832deb6d125b8bcf0 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 25 Dec 2024 07:31:56 +0300 Subject: [PATCH 16/22] removed pkg and pkg_relative_path from state and moved them to module object --- rtsc/watch.ts | 4 +- src/library-manager.ts | 99 ++++++++++++++++++++------------- src/parse-dts.ts | 3 +- test-project/.rts/main.rts.json | 61 ++++++++++++++++++++ test-project/main.rts | 1 + 5 files changed, 127 insertions(+), 41 deletions(-) diff --git a/rtsc/watch.ts b/rtsc/watch.ts index 815afd9..57b5d6f 100755 --- a/rtsc/watch.ts +++ b/rtsc/watch.ts @@ -67,7 +67,9 @@ function check_path(path: string) { if (host.realpath === undefined) throw new Error("host has no real path"); const rts_file = host.realpath(join(module_dir, module_name)); if (fileExists(rts_file)) { - library_manager.ensureUpToDate(rts_file); + library_manager + .findPackage(rts_file) + .then(([pkg, rel]) => library_manager.ensureUpToDate(pkg, rel, rts_file)); } } } diff --git a/src/library-manager.ts b/src/library-manager.ts index cf8f6e5..a75def9 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -1,6 +1,6 @@ import { assert } from "./assert"; import fs from "node:fs/promises"; -import { dirname, basename, join } from "node:path"; +import { dirname, basename, join, relative } from "node:path"; import { mtime } from "./fs-helpers"; import { parse } from "./parse"; import { initial_step } from "./expander"; @@ -26,19 +26,15 @@ const cookie = "rewrite-ts-016"; type module_state = | { type: "initial" } | { type: "initializing"; promise: Promise } - | { type: "stale"; cid: string; pkg: Package; pkg_relative_path: string } + | { type: "stale"; cid: string } | { type: "compiling"; cid: string; - pkg: Package; - pkg_relative_path: string; promise: Promise; } | { type: "fresh"; cid: string; - pkg: Package; - pkg_relative_path: string; exported_identifiers: { [name: string]: import_resolution[] }; context: Context; unit: CompilationUnit; @@ -47,6 +43,8 @@ type module_state = | { type: "error"; reason: string }; abstract class Module implements imported_module { + pkg: Package; + pkg_relative_path: string; path: string; library_manager: LibraryManager; state: module_state = { type: "initial" }; @@ -59,12 +57,16 @@ abstract class Module implements imported_module { abstract do_recompile(): Promise; constructor( + pkg: Package, + pkg_relative_path: string, path: string, library_manager: LibraryManager, libs: string[], global_unit: CompilationUnit, global_context: Context, ) { + this.pkg = pkg; + this.pkg_relative_path = pkg_relative_path; this.path = path; this.library_manager = library_manager; this.libs = libs; @@ -106,12 +108,12 @@ abstract class Module implements imported_module { const my_mtime = await mtime(this.path); assert(my_mtime !== undefined); if (json_mtime === undefined || my_mtime >= json_mtime) { - this.state = { type: "stale", cid, pkg, pkg_relative_path }; + this.state = { type: "stale", cid }; return; } const json = JSON.parse(await fs.readFile(json_path, { encoding: "utf8" })); if (json.cookie !== cookie) { - this.state = { type: "stale", cid, pkg, pkg_relative_path }; + this.state = { type: "stale", cid }; return; } assert(json.cid === cid); @@ -127,14 +129,14 @@ abstract class Module implements imported_module { } = x; const pkg = this.library_manager.get_package(name, version); assert(pkg !== undefined); - const path = join(pkg.dir, pkg_relative_path); - const mod = this.library_manager.ensureUpToDate(path); + const path = normalize(join(pkg.dir, pkg_relative_path)); + const mod = this.library_manager.ensureUpToDate(pkg, pkg_relative_path, path); return mod; }, ), ); if (imported_modules.some((x) => x.get_mtime() > json_mtime)) { - this.state = { type: "stale", cid, pkg, pkg_relative_path }; + this.state = { type: "stale", cid }; return; } this.imported_modules = imported_modules; @@ -143,8 +145,6 @@ abstract class Module implements imported_module { this.state = { type: "fresh", cid, - pkg, - pkg_relative_path, exported_identifiers: json.exported_identifiers, context: json.context, unit: json.unit, @@ -273,12 +273,11 @@ abstract class Module implements imported_module { } get_pkg_and_path(): [{ name: string; version: string }, string] { - assert(this.state.type === "fresh"); - return [this.state.pkg, this.state.pkg_relative_path]; + return [this.pkg, this.pkg_relative_path]; } async get_imported_modules_for_path(import_path: string, loc: Loc): Promise { - const mod = await this.library_manager.do_import(import_path, this.path); + const mod = await this.library_manager.do_import(import_path, this.path, this.pkg); if (this.imported_modules.includes(mod)) return mod; const self = this; function check(mod: imported_module) { @@ -362,8 +361,8 @@ class RtsModule extends Module { assert(state.type === "stale"); console.log(`recompiling ${state.cid} ...`); const code = await fs.readFile(this.path, { encoding: "utf-8" }); - const my_pkg = state.pkg; - const my_path = state.pkg_relative_path; + const my_pkg = this.pkg; + const my_path = this.pkg_relative_path; const source_file: source_file = { package: { name: my_pkg.name, version: my_pkg.version }, path: my_path, @@ -418,10 +417,10 @@ class DtsModule extends Module { const state = this.state; assert(state.type === "stale"); console.log(`recompiling ${state.cid} ...`); - const my_pkg = state.pkg; - const my_path = state.pkg_relative_path; + const my_pkg = this.pkg; + const my_path = this.pkg_relative_path; const code = await fs.readFile(this.path, { encoding: "utf-8" }); - const ts_exports = parse_dts(code, my_path); + const ts_exports = parse_dts(code, my_path, this.path); const cid = state.cid; const rib: Rib = { type: "rib", types_env: {}, normal_env: {} }; const unit: CompilationUnit = { @@ -436,7 +435,7 @@ class DtsModule extends Module { } } for (const module_name of Object.keys(unique_imports)) { - const mod = await this.library_manager.do_import(module_name, this.path); + const mod = await this.library_manager.do_import(module_name, this.path, this.pkg); if (!this.imported_modules.includes(mod)) { this.imported_modules.push(mod); } @@ -534,16 +533,34 @@ export class LibraryManager { this.global_context = global_context; } - private get_or_create_module(path: string) { + private get_or_create_module(pkg: Package, pkg_relative_path: string, path: string) { const existing = this.modules[path]; if (existing) return existing; const mod = (() => { if (path.endsWith(".rts")) { - return new RtsModule(path, this, this.libs, this.global_unit, this.global_context); + return new RtsModule( + pkg, + pkg_relative_path, + path, + this, + this.libs, + this.global_unit, + this.global_context, + ); } else if (path.endsWith(".d.ts") || path.endsWith(".d.cts")) { - return new DtsModule(path, this, this.libs, this.global_unit, this.global_context); + return new DtsModule( + pkg, + pkg_relative_path, + path, + this, + this.libs, + this.global_unit, + this.global_context, + ); } else if (path.endsWith(".js")) { return new DtsModule( + pkg, + pkg_relative_path.replace(/\.js$/, ".d.ts"), path.replace(/\.js$/, ".d.ts"), this, this.libs, @@ -562,8 +579,8 @@ export class LibraryManager { return mod; } - async ensureUpToDate(path: string) { - const mod = this.get_or_create_module(path); + async ensureUpToDate(pkg: Package, pkg_relative_path: string, path: string) { + const mod = this.get_or_create_module(pkg, pkg_relative_path, path); await mod.ensureUpToDate(); return mod; } @@ -597,7 +614,6 @@ export class LibraryManager { async resolve_node_module_package(pkg_name: string, dir: string): Promise { const pkg_dir = `${dir}/node_modules/${pkg_name}`; - console.log(`resolve_node_module_package ${pkg_dir}`); assert(dir !== "/"); const existing = this.packages[pkg_dir]; if (existing) return existing; @@ -622,7 +638,7 @@ export class LibraryManager { } } - async do_import(import_path: string, importer_path: string) { + async do_import(import_path: string, importer_path: string, importer_pkg: Package) { function is_relative(path: string): boolean { return path.startsWith("./") || path.startsWith("../"); } @@ -633,25 +649,31 @@ export class LibraryManager { function is_scoped(path: string): boolean { return path.startsWith("@"); } - const find_normal_path = async (import_path: string) => { + type T = (path: string) => Promise<[Package, string, string]>; + const find_relative_path: T = async (import_path: string) => { + const absolute_path = join_relative(import_path, importer_path); + const pkg_relative_path = relative(importer_pkg.dir, absolute_path); + return [importer_pkg, pkg_relative_path, absolute_path]; + }; + const find_normal_path: T = async (import_path: string) => { const [pkg_name, ...import_parts] = import_path.split("/"); const pkg = await this.resolve_node_module_package(pkg_name, dirname(importer_path)); if (import_parts.length !== 0) throw new Error(`TODO import parts`); if (pkg.props.types) { - return normalize(pkg.dir + "/" + pkg.props.types); + return [pkg, pkg.props.types, normalize(pkg.dir + "/" + pkg.props.types)]; } else if (pkg.props.main) { - return normalize(pkg.dir + "/" + pkg.props.main); + return [pkg, pkg.props.main, normalize(pkg.dir + "/" + pkg.props.main)]; } else { throw new Error(`cannot find main file in ${pkg.dir}`); } }; - const find_scoped_path = async (import_path: string) => { + const find_scoped_path: T = async (import_path: string) => { const [scope_name, scoped_name, ...import_parts] = import_path.split("/"); const pkg_name = scope_name + "/" + scoped_name; const pkg = await this.resolve_node_module_package(pkg_name, dirname(importer_path)); if (import_parts.length === 0) { assert(pkg.props.types !== undefined); - return normalize(pkg.dir + "/" + pkg.props.types); + return [pkg, pkg.props.types, normalize(pkg.dir + "/" + pkg.props.types)]; } else { const p = "./" + import_parts.join("/"); const entry = pkg.props.exports?.[p]; @@ -660,16 +682,15 @@ export class LibraryManager { const types_file = entry.types; if (types_file === undefined) throw new Error(`not types for ${import_path} in ${pkg.dir}`); const filepath = normalize(pkg.dir + "/" + types_file); - return filepath; + return [pkg, types_file, filepath]; } }; - const actual_path = is_relative(import_path) - ? join_relative(import_path, importer_path) + const [module_pkg, module_pkg_relative_path, actual_path] = is_relative(import_path) + ? await find_relative_path(import_path) : is_scoped(import_path) ? await find_scoped_path(import_path) : await find_normal_path(import_path); - console.log(`import of ${import_path} from ${importer_path} resolved to ${actual_path}`); - const mod = this.get_or_create_module(actual_path); + const mod = this.get_or_create_module(module_pkg, module_pkg_relative_path, actual_path); return mod; } } diff --git a/src/parse-dts.ts b/src/parse-dts.ts index ed86cde..2f6c531 100644 --- a/src/parse-dts.ts +++ b/src/parse-dts.ts @@ -270,7 +270,8 @@ function parse_statements(statements: TS.NodeArray): ts_exports { return extract_exports(); } -export function parse_dts(code: string, my_path: string): ts_exports { +export function parse_dts(code: string, my_path: string, full_path: string): ts_exports { + console.log(`parsing ${full_path}`); const options: TS.CreateSourceFileOptions = { languageVersion: TS.ScriptTarget.ESNext, jsDocParsingMode: TS.JSDocParsingMode.ParseNone, diff --git a/test-project/.rts/main.rts.json b/test-project/.rts/main.rts.json index 0aaf239..bf253cf 100644 --- a/test-project/.rts/main.rts.json +++ b/test-project/.rts/main.rts.json @@ -5,6 +5,10 @@ { "pkg": {"name": "rewrite-ts-visualized", "version": "0.0.0"}, "pkg_relative_path": "test-project/mod.rts" + }, + { + "pkg": {"name": "vitest", "version": "2.1.8"}, + "pkg_relative_path": "./dist/index.d.ts" } ], "exported_identifiers": {}, @@ -39,6 +43,39 @@ } ] ], + "suite": [ + [ + [ + "test-project/main.rts rewrite-ts-visualized 0.0.0", + ["top", null] + ], + { + "cuid": "dist/index.d.ts vitest 2.1.8", + "name": "e.suite.@vitest/runner" + } + ] + ], + "test": [ + [ + [ + "test-project/main.rts rewrite-ts-visualized 0.0.0", + ["top", null] + ], + { + "cuid": "dist/index.d.ts vitest 2.1.8", + "name": "e.test.@vitest/runner" + } + ] + ], + "expect": [ + [ + [ + "test-project/main.rts rewrite-ts-visualized 0.0.0", + ["top", null] + ], + {"cuid": "dist/index.d.ts vitest 2.1.8", "name": "l.globalExpect"} + ] + ], "y": [ [ [ @@ -76,6 +113,30 @@ "name": "l2" } ] + ], + "suite": [ + [ + [ + "test-project/main.rts rewrite-ts-visualized 0.0.0", + ["top", null] + ], + { + "cuid": "dist/index.d.ts vitest 2.1.8", + "name": "e.suite.@vitest/runner" + } + ] + ], + "test": [ + [ + [ + "test-project/main.rts rewrite-ts-visualized 0.0.0", + ["top", null] + ], + { + "cuid": "dist/index.d.ts vitest 2.1.8", + "name": "e.test.@vitest/runner" + } + ] ] }, "libs": ["es2024.full"] diff --git a/test-project/main.rts b/test-project/main.rts index 72ad509..30e5e11 100644 --- a/test-project/main.rts +++ b/test-project/main.rts @@ -1,4 +1,5 @@ import { x, t, fref } from "./mod.rts"; import { expect, test, suite } from "vitest"; const y: t = x + fref; +console.log(expect); console.log(y); From 8bb78b05eb974889aa5b99e16de451792c1b3261 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 25 Dec 2024 07:59:26 +0300 Subject: [PATCH 17/22] handled class declarations in dts files; initialized context for dts modules --- src/library-manager.ts | 11 ++++++++--- src/parse-dts.ts | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index a75def9..bcb6301 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -256,6 +256,7 @@ abstract class Module implements imported_module { assert(this.state.type === "fresh"); const context = this.state.context; const binding = context[name]; + if (!binding) throw new Error(`binding missing for ${name} in ${this.path}`); switch (binding.type) { case "lexical": return { type: "imported_lexical", cuid: this.state.cid, name: binding.name }; @@ -268,7 +269,7 @@ abstract class Module implements imported_module { clauses: binding.clauses, }; default: - throw new Error(`unhandled binding type ${binding.type}`); + throw new Error(`unhandled binding type ${binding.type} for label '${name}'`); } } @@ -447,10 +448,14 @@ class DtsModule extends Module { case "local": { const res: import_resolution[] = []; if (binding.is_type) { - res.push({ type: "type", label: { cuid: cid, name: `t.${binding.name}` } }); + const label = `t.${binding.name}`; + context[label] = { type: "type", name: binding.name }; + res.push({ type: "type", label: { cuid: cid, name: label } }); } if (binding.is_lexical) { - res.push({ type: "lexical", label: { cuid: cid, name: `l.${binding.name}` } }); + const label = `l.${binding.name}`; + context[label] = { type: "lexical", name: binding.name }; + res.push({ type: "lexical", label: { cuid: cid, name: label } }); } return [name, res]; } diff --git a/src/parse-dts.ts b/src/parse-dts.ts index 2f6c531..25b7155 100644 --- a/src/parse-dts.ts +++ b/src/parse-dts.ts @@ -74,7 +74,7 @@ function parse_statements(statements: TS.NodeArray): ts_exports { function handle_main_definition(global: boolean) { function push_lexical(name: string) { - assert(!lexicals[name]); + assert(!lexicals[name], `lexical '${name}' is multiply defined`); lexicals[name] = { global }; } function push_type(name: string) { @@ -244,6 +244,17 @@ function parse_statements(statements: TS.NodeArray): ts_exports { } decl.declarationList.declarations.forEach(handle_decl); } + function handle_class_declaration(decl: TS.ClassDeclaration) { + const name = decl.name?.text; + const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; + assert(!exported); + const declared = + decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; + assert(declared); + assert(name !== undefined); + push_lexical(name); + push_type(name); + } function handle_statement(stmt: TS.Statement) { switch (stmt.kind) { case TS.SyntaxKind.ImportDeclaration: @@ -260,6 +271,8 @@ function parse_statements(statements: TS.NodeArray): ts_exports { return handle_function_declaration(stmt as TS.FunctionDeclaration); case TS.SyntaxKind.VariableStatement: return handle_variable_statement(stmt as TS.VariableStatement); + case TS.SyntaxKind.ClassDeclaration: + return handle_class_declaration(stmt as TS.ClassDeclaration); default: throw new Error(`unhandled statement in d.ts file '${TS.SyntaxKind[stmt.kind]}'`); } From c7a477085ae98a13b36214919d66f9c15b166d11 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 25 Dec 2024 13:38:57 +0300 Subject: [PATCH 18/22] successfully importing expect from vitest --- src/library-manager.ts | 31 ++++++++++++++++++++++--------- src/preexpand-helpers.ts | 9 ++++++++- test-project/.rts/main.rts.ts | 2 ++ 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index bcb6301..57d65e4 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -273,7 +273,14 @@ abstract class Module implements imported_module { } } - get_pkg_and_path(): [{ name: string; version: string }, string] { + get_pkg_and_path(): [ + { + name: string; + version: string; + reverse_resolve(path: string): string; + }, + string, + ] { return [this.pkg, this.pkg_relative_path]; } @@ -325,7 +332,7 @@ abstract class Module implements imported_module { if (dir0 !== dir1) throw new Error(`TODO relative path imports`); return `./${basename(mod_path)}.ts`; } else { - throw new Error(`TODO cross package imports`); + return mod_pkg.reverse_resolve(mod_path); } }, resolve_rib: (rib_id, cuid) => { @@ -418,8 +425,9 @@ class DtsModule extends Module { const state = this.state; assert(state.type === "stale"); console.log(`recompiling ${state.cid} ...`); - const my_pkg = this.pkg; const my_path = this.pkg_relative_path; + const dts_mtime = await mtime(this.path); + assert(dts_mtime !== undefined, `error reading mtime of ${this.path}`); const code = await fs.readFile(this.path, { encoding: "utf-8" }); const ts_exports = parse_dts(code, my_path, this.path); const cid = state.cid; @@ -449,12 +457,12 @@ class DtsModule extends Module { const res: import_resolution[] = []; if (binding.is_type) { const label = `t.${binding.name}`; - context[label] = { type: "type", name: binding.name }; + context[label] = { type: "type", name }; res.push({ type: "type", label: { cuid: cid, name: label } }); } if (binding.is_lexical) { const label = `l.${binding.name}`; - context[label] = { type: "lexical", name: binding.name }; + context[label] = { type: "lexical", name }; res.push({ type: "lexical", label: { cuid: cid, name: label } }); } return [name, res]; @@ -484,12 +492,12 @@ class DtsModule extends Module { context, unit, }; + console.log(json_content); // const json_path = this.get_json_path(); // await fs.mkdir(dirname(json_path), { recursive: true }); - const mtime = Date.now(); + //const mtime = Date.now(); // await fs.writeFile(this.get_json_path(), stringify(json_content)); - - this.state = { ...state, type: "fresh", ...json_content, mtime }; + this.state = { ...state, type: "fresh", ...json_content, mtime: dts_mtime }; console.log(`up to date ${state.cid}`); } } @@ -512,6 +520,11 @@ class Package { this.dir = dir; this.props = props ?? {}; } + + reverse_resolve(path: string): string { + if (path === this.props.types) return this.name; + throw new Error(`reverse resolving ${path} in '${this.name}'`); + } } type watcher = { @@ -577,7 +590,7 @@ export class LibraryManager { } })(); this.modules[path] = mod; - const watcher = this.host.watchFile(path, (p) => { + this.host.watchFile(path, (p) => { if (p !== path) return; mod.file_changed(); }); diff --git a/src/preexpand-helpers.ts b/src/preexpand-helpers.ts index 1a9647f..0e600b6 100644 --- a/src/preexpand-helpers.ts +++ b/src/preexpand-helpers.ts @@ -22,7 +22,14 @@ export type imported_module = { get_cid(): string; find_module_by_cid(cid: string): imported_module | undefined; resolve_label(name: string): Promise; - get_pkg_and_path(): [{ name: string; version: string }, string]; + get_pkg_and_path(): [ + { + name: string; + version: string; + reverse_resolve(path: string): string; + }, + string, + ]; resolve_rib: (rib_id: string) => Rib; get_mtime(): number; file_changed(): Promise; diff --git a/test-project/.rts/main.rts.ts b/test-project/.rts/main.rts.ts index b341a40..e7e4287 100644 --- a/test-project/.rts/main.rts.ts +++ b/test-project/.rts/main.rts.ts @@ -1,3 +1,5 @@ import { type t_2 as t_2, x_1 as x_3, f_3 as f_4 } from "./mod.rts.ts"; +import { expect as expect_5 } from "vitest"; export const y_1: t_2 = x_3 + f_4; +console.log(expect_5); console.log(y_1); From d884dd947eb381881a926ae23ba69af4d06422be Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 25 Dec 2024 14:52:46 +0300 Subject: [PATCH 19/22] loading imported packages if not already loaded --- src/library-manager.ts | 25 ++++++++++++++++++------- src/parse-dts.ts | 6 +++--- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index 57d65e4..e59067c 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -106,7 +106,7 @@ abstract class Module implements imported_module { const json_path = this.get_json_path(); const json_mtime = await mtime(json_path); const my_mtime = await mtime(this.path); - assert(my_mtime !== undefined); + assert(my_mtime !== undefined, `no mtime for '${this.path}'`); if (json_mtime === undefined || my_mtime >= json_mtime) { this.state = { type: "stale", cid }; return; @@ -122,13 +122,13 @@ abstract class Module implements imported_module { assert(json.imports); const imported_modules = await Promise.all( (json.imports as { pkg: { name: string; version: string }; pkg_relative_path: string }[]).map( - (x) => { + async (x) => { const { pkg: { name, version }, pkg_relative_path, } = x; - const pkg = this.library_manager.get_package(name, version); - assert(pkg !== undefined); + const pkg = await this.library_manager.load_package(name, version, this.path); + assert(pkg !== undefined, `failed to get package '${name}:${version}'`); const path = normalize(join(pkg.dir, pkg_relative_path)); const mod = this.library_manager.ensureUpToDate(pkg, pkg_relative_path, path); return mod; @@ -239,7 +239,7 @@ abstract class Module implements imported_module { case "fresh": return this.state.mtime; default: - throw new Error(`invalid state`); + throw new Error(`invalid state for '${this.path}'`); } } @@ -492,7 +492,7 @@ class DtsModule extends Module { context, unit, }; - console.log(json_content); + //console.log(json_content); // const json_path = this.get_json_path(); // await fs.mkdir(dirname(json_path), { recursive: true }); //const mtime = Date.now(); @@ -551,7 +551,7 @@ export class LibraryManager { this.global_context = global_context; } - private get_or_create_module(pkg: Package, pkg_relative_path: string, path: string) { + get_or_create_module(pkg: Package, pkg_relative_path: string, path: string) { const existing = this.modules[path]; if (existing) return existing; const mod = (() => { @@ -607,6 +607,17 @@ export class LibraryManager { return Object.values(this.packages).find((x) => x.name === name && x.version === version); } + async load_package(name: string, version: string, importing_path: string): Promise { + const existing = this.get_package(name, version); + if (existing) return existing; + const pkg = await this.resolve_node_module_package(name, dirname(importing_path)); + assert( + pkg.version === version, + `package version mismatch; expected ${version}, found ${pkg.version}`, + ); + return pkg; + } + async findPackage(path: string): Promise<[Package, string]> { const base = basename(path); const pkg_dir = dirname(path); diff --git a/src/parse-dts.ts b/src/parse-dts.ts index 25b7155..7ad10d3 100644 --- a/src/parse-dts.ts +++ b/src/parse-dts.ts @@ -7,7 +7,7 @@ export type ts_export_binding = export type ts_exports = { [id: string]: ts_export_binding }; -function parse_statements(statements: TS.NodeArray): ts_exports { +function parse_statements(statements: TS.NodeArray, path: string): ts_exports { // type id = ... const types: { [id: string]: { global: boolean } } = {}; // const id = ... @@ -74,7 +74,7 @@ function parse_statements(statements: TS.NodeArray): ts_exports { function handle_main_definition(global: boolean) { function push_lexical(name: string) { - assert(!lexicals[name], `lexical '${name}' is multiply defined`); + assert(!lexicals[name], `lexical '${name}' is multiply defined in '${path}'`); lexicals[name] = { global }; } function push_type(name: string) { @@ -291,5 +291,5 @@ export function parse_dts(code: string, my_path: string, full_path: string): ts_ }; const src = TS.createSourceFile(my_path, code, options); if (src.libReferenceDirectives.length !== 0) throw new Error("not handled"); - return parse_statements(src.statements); + return parse_statements(src.statements, full_path); } From bb2562e73e994006ed35d1779e3f135ac4ad6eb5 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 25 Dec 2024 15:23:50 +0300 Subject: [PATCH 20/22] removed .js hack --- src/library-manager.ts | 12 +----------- src/parse-dts.ts | 41 ++++++++++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/library-manager.ts b/src/library-manager.ts index e59067c..e46fdd0 100644 --- a/src/library-manager.ts +++ b/src/library-manager.ts @@ -565,7 +565,7 @@ export class LibraryManager { this.global_unit, this.global_context, ); - } else if (path.endsWith(".d.ts") || path.endsWith(".d.cts")) { + } else if (path.endsWith(".d.ts") || path.endsWith(".d.cts") || path.endsWith(".js")) { return new DtsModule( pkg, pkg_relative_path, @@ -575,16 +575,6 @@ export class LibraryManager { this.global_unit, this.global_context, ); - } else if (path.endsWith(".js")) { - return new DtsModule( - pkg, - pkg_relative_path.replace(/\.js$/, ".d.ts"), - path.replace(/\.js$/, ".d.ts"), - this, - this.libs, - this.global_unit, - this.global_context, - ); } else { throw new Error(`don't know how to import ${path}`); } diff --git a/src/parse-dts.ts b/src/parse-dts.ts index 7ad10d3..531a36f 100644 --- a/src/parse-dts.ts +++ b/src/parse-dts.ts @@ -74,7 +74,6 @@ function parse_statements(statements: TS.NodeArray, path: string): function handle_main_definition(global: boolean) { function push_lexical(name: string) { - assert(!lexicals[name], `lexical '${name}' is multiply defined in '${path}'`); lexicals[name] = { global }; } function push_type(name: string) { @@ -98,6 +97,14 @@ function parse_statements(statements: TS.NodeArray, path: string): assert(!exported[name], `duplicate export ${origin_name} as ${name}`); exported[name] = { type_only, origin_name, origin_module, global }; } + function push_exported_local_type(name: string) { + assert(!exported[name], `duplicate export ${name}`); + exported[name] = { type_only: true, origin_name: name, origin_module: undefined, global }; + } + function push_exported_local_value(name: string) { + assert(!exported[name], `duplicate export ${name}`); + exported[name] = { type_only: false, origin_name: name, origin_module: undefined, global }; + } function push_namespace(name: string, literal: boolean) { const ns = literal ? literal_namespaces : id_namespaces; assert(!ns[name]); @@ -203,40 +210,45 @@ function parse_statements(statements: TS.NodeArray, path: string): const declared = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; assert(!declared); - assert(!exported); push_type(name); + if (exported) push_exported_local_type(name); } function handle_type_alias_declaration(decl: TS.TypeAliasDeclaration) { const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; const declared = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; assert(!declared); - assert(!exported); const name = decl.name.text; push_type(name); + if (exported) push_exported_local_type(name); } function handle_function_declaration(decl: TS.FunctionDeclaration) { const name = decl.name?.text; const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; assert(!exported); - const declared = - decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; assert(name !== undefined); - assert(declared); push_lexical(name); } function handle_variable_statement(decl: TS.VariableStatement) { const exported = decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.ExportKeyword) ?? false; - assert(!exported); - const declared = - decl.modifiers?.some((x) => x.kind === TS.SyntaxKind.DeclareKeyword) ?? false; - assert(declared); + function handle_binding_element(binding: TS.BindingElement) { + handle_binding_name(binding.name); + } function handle_binding_name(binding: TS.BindingName) { switch (binding.kind) { - case TS.SyntaxKind.Identifier: - return push_lexical(binding.text); + case TS.SyntaxKind.Identifier: { + push_lexical(binding.text); + if (exported) push_exported_local_value(binding.text); + return; + } + case TS.SyntaxKind.ObjectBindingPattern: { + binding.elements.forEach(handle_binding_element); + return; + } default: - throw new Error(`unhandled binding type '${TS.SyntaxKind[binding.kind]}'`); + throw new Error( + `unhandled binding type '${TS.SyntaxKind[binding.kind]}' in ${path}:${binding.pos}`, + ); } } function handle_decl(decl: TS.VariableDeclaration) { @@ -273,6 +285,9 @@ function parse_statements(statements: TS.NodeArray, path: string): return handle_variable_statement(stmt as TS.VariableStatement); case TS.SyntaxKind.ClassDeclaration: return handle_class_declaration(stmt as TS.ClassDeclaration); + case TS.SyntaxKind.ExpressionStatement: + case TS.SyntaxKind.TryStatement: + return; default: throw new Error(`unhandled statement in d.ts file '${TS.SyntaxKind[stmt.kind]}'`); } From dc64bc0e69d7ba399e10507fa4e570cecde3c885 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Dec 2024 15:33:00 +0300 Subject: [PATCH 21/22] Bump the all group across 1 directory with 3 updates (#62) Bumps the all group with 3 updates in the / directory: [json-stable-stringify](https://github.com/ljharb/json-stable-stringify), [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint). Updates `json-stable-stringify` from 1.2.0 to 1.2.1 - [Changelog](https://github.com/ljharb/json-stable-stringify/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/json-stable-stringify/compare/v1.2.0...v1.2.1) Updates `react-router-dom` from 7.1.0 to 7.1.1 - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@7.1.1/packages/react-router-dom) Updates `typescript-eslint` from 8.18.1 to 8.18.2 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.18.2/packages/typescript-eslint) --- updated-dependencies: - dependency-name: json-stable-stringify dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: typescript-eslint dependency-type: direct:development update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 128 +++++++++++++++++++++++----------------------- package.json | 6 +-- 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70ae2f1..339f1e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,12 +16,12 @@ "@uiw/codemirror-theme-abcdef": "^4.23.7", "@uiw/react-codemirror": "^4.23.7", "index-to-position": "^1.0.0", - "json-stable-stringify": "^1.2.0", + "json-stable-stringify": "^1.2.1", "json-stringify-pretty-compact": "^4.0.0", "prettier": "^3.4.2", "react": "^19.0.0", "react-dom": "^19.0.0", - "react-router-dom": "^7.1.0", + "react-router-dom": "^7.1.1", "typescript": "^5.5.3", "zipper": "github:azizghuloum/zipper" }, @@ -35,7 +35,7 @@ "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.16", "globals": "^15.14.0", - "typescript-eslint": "^8.18.1", + "typescript-eslint": "^8.18.2", "vite": "^6.0.5", "vitest": "^2.1.5" } @@ -1591,16 +1591,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.1.tgz", - "integrity": "sha512-Ncvsq5CT3Gvh+uJG0Lwlho6suwDfUXH0HztslDf5I+F2wAFAZMRwYLEorumpKLzmO2suAXZ/td1tBg4NZIi9CQ==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.2.tgz", + "integrity": "sha512-adig4SzPLjeQ0Tm+jvsozSGiCliI2ajeURDGHjZ2llnA+A67HihCQ+a3amtPhUakd1GlwHxSRvzOZktbEvhPPg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.18.1", - "@typescript-eslint/type-utils": "8.18.1", - "@typescript-eslint/utils": "8.18.1", - "@typescript-eslint/visitor-keys": "8.18.1", + "@typescript-eslint/scope-manager": "8.18.2", + "@typescript-eslint/type-utils": "8.18.2", + "@typescript-eslint/utils": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1620,15 +1620,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.1.tgz", - "integrity": "sha512-rBnTWHCdbYM2lh7hjyXqxk70wvon3p2FyaniZuey5TrcGBpfhVp0OxOa6gxr9Q9YhZFKyfbEnxc24ZnVbbUkCA==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.2.tgz", + "integrity": "sha512-y7tcq4StgxQD4mDr9+Jb26dZ+HTZ/SkfqpXSiqeUXZHxOUyjWDKsmwKhJ0/tApR08DgOhrFAoAhyB80/p3ViuA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.18.1", - "@typescript-eslint/types": "8.18.1", - "@typescript-eslint/typescript-estree": "8.18.1", - "@typescript-eslint/visitor-keys": "8.18.1", + "@typescript-eslint/scope-manager": "8.18.2", + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/typescript-estree": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2", "debug": "^4.3.4" }, "engines": { @@ -1644,13 +1644,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.1.tgz", - "integrity": "sha512-HxfHo2b090M5s2+/9Z3gkBhI6xBH8OJCFjH9MhQ+nnoZqxU3wNxkLT+VWXWSFWc3UF3Z+CfPAyqdCTdoXtDPCQ==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.2.tgz", + "integrity": "sha512-YJFSfbd0CJjy14r/EvWapYgV4R5CHzptssoag2M7y3Ra7XNta6GPAJPPP5KGB9j14viYXyrzRO5GkX7CRfo8/g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.18.1", - "@typescript-eslint/visitor-keys": "8.18.1" + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1661,13 +1661,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.1.tgz", - "integrity": "sha512-jAhTdK/Qx2NJPNOTxXpMwlOiSymtR2j283TtPqXkKBdH8OAMmhiUfP0kJjc/qSE51Xrq02Gj9NY7MwK+UxVwHQ==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.2.tgz", + "integrity": "sha512-AB/Wr1Lz31bzHfGm/jgbFR0VB0SML/hd2P1yxzKDM48YmP7vbyJNHRExUE/wZsQj2wUCvbWH8poNHFuxLqCTnA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.18.1", - "@typescript-eslint/utils": "8.18.1", + "@typescript-eslint/typescript-estree": "8.18.2", + "@typescript-eslint/utils": "8.18.2", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1684,9 +1684,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.1.tgz", - "integrity": "sha512-7uoAUsCj66qdNQNpH2G8MyTFlgerum8ubf21s3TSM3XmKXuIn+H2Sifh/ES2nPOPiYSRJWAk0fDkW0APBWcpfw==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.2.tgz", + "integrity": "sha512-Z/zblEPp8cIvmEn6+tPDIHUbRu/0z5lqZ+NvolL5SvXWT5rQy7+Nch83M0++XzO0XrWRFWECgOAyE8bsJTl1GQ==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1697,13 +1697,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.1.tgz", - "integrity": "sha512-z8U21WI5txzl2XYOW7i9hJhxoKKNG1kcU4RzyNvKrdZDmbjkmLBo8bgeiOJmA06kizLI76/CCBAAGlTlEeUfyg==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.2.tgz", + "integrity": "sha512-WXAVt595HjpmlfH4crSdM/1bcsqh+1weFRWIa9XMTx/XHZ9TCKMcr725tLYqWOgzKdeDrqVHxFotrvWcEsk2Tg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.18.1", - "@typescript-eslint/visitor-keys": "8.18.1", + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1759,15 +1759,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.1.tgz", - "integrity": "sha512-8vikiIj2ebrC4WRdcAdDcmnu9Q/MXXwg+STf40BVfT8exDqBCUPdypvzcUPxEqRGKg9ALagZ0UWcYCtn+4W2iQ==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.2.tgz", + "integrity": "sha512-Cr4A0H7DtVIPkauj4sTSXVl+VBWewE9/o40KcF3TV9aqDEOWoXF3/+oRXNby3DYzZeCATvbdksYsGZzplwnK/Q==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.18.1", - "@typescript-eslint/types": "8.18.1", - "@typescript-eslint/typescript-estree": "8.18.1" + "@typescript-eslint/scope-manager": "8.18.2", + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/typescript-estree": "8.18.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1782,12 +1782,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.1.tgz", - "integrity": "sha512-Vj0WLm5/ZsD013YeUKn+K0y8p1M0jPpxOkKdbD1wB0ns53a5piVY02zjf072TblEweAbcYiFiPoSMF3kp+VhhQ==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.2.tgz", + "integrity": "sha512-zORcwn4C3trOWiCqFQP1x6G3xTRyZ1LYydnj51cRnJ6hxBlr/cKPckk+PKPUw/fXmvfKTcw7bwY3w9izgx5jZw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/types": "8.18.2", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -2808,9 +2808,9 @@ "license": "MIT" }, "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", + "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -3312,9 +3312,9 @@ "license": "MIT" }, "node_modules/json-stable-stringify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.0.tgz", - "integrity": "sha512-ex8jk9BZHBolvbd5cRnAgwyaYcYB0qZldy1e+LCOdcF6+AUmVZ6LcGUMzsRTW83QMeu+GxZGrcLqxqrgfXGvIw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.1.tgz", + "integrity": "sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA==", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -3846,9 +3846,9 @@ } }, "node_modules/react-router": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.0.tgz", - "integrity": "sha512-VcFhWqkNIcojDRYaUO8qV0Jib52s9ULpCp3nkBbmrvtoCVFRp6tmk3tJ2w9BZauVctA1YRnJlFYDn9iJRuCpGA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.1.tgz", + "integrity": "sha512-39sXJkftkKWRZ2oJtHhCxmoCrBCULr/HAH4IT5DHlgu/Q0FCPV0S4Lx+abjDTx/74xoZzNYDYbOZWlJjruyuDQ==", "dependencies": { "@types/cookie": "^0.6.0", "cookie": "^1.0.1", @@ -3869,11 +3869,11 @@ } }, "node_modules/react-router-dom": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.1.0.tgz", - "integrity": "sha512-F4/nYBC9e4s0/ZjxM8GkZ9a68DpX76LN1a9W9mfPl2GfbDJ9/vzJro6MThNR5qGBH6KkgcK1BziyEzXhHV46Xw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.1.1.tgz", + "integrity": "sha512-vSrQHWlJ5DCfyrhgo0k6zViOe9ToK8uT5XGSmnuC2R3/g261IdIMpZVqfjD6vWSXdnf5Czs4VA/V60oVR6/jnA==", "dependencies": { - "react-router": "7.1.0" + "react-router": "7.1.1" }, "engines": { "node": ">=20.0.0" @@ -4351,14 +4351,14 @@ } }, "node_modules/typescript-eslint": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.1.tgz", - "integrity": "sha512-Mlaw6yxuaDEPQvb/2Qwu3/TfgeBHy9iTJ3mTwe7OvpPmF6KPQjVOfGyEJpPv6Ez2C34OODChhXrzYw/9phI0MQ==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.2.tgz", + "integrity": "sha512-KuXezG6jHkvC3MvizeXgupZzaG5wjhU3yE8E7e6viOvAvD9xAWYp8/vy0WULTGe9DYDWcQu7aW03YIV3mSitrQ==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.18.1", - "@typescript-eslint/parser": "8.18.1", - "@typescript-eslint/utils": "8.18.1" + "@typescript-eslint/eslint-plugin": "8.18.2", + "@typescript-eslint/parser": "8.18.2", + "@typescript-eslint/utils": "8.18.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/package.json b/package.json index 794ddf3..5ee9f23 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,12 @@ "@uiw/codemirror-theme-abcdef": "^4.23.7", "@uiw/react-codemirror": "^4.23.7", "index-to-position": "^1.0.0", - "json-stable-stringify": "^1.2.0", + "json-stable-stringify": "^1.2.1", "json-stringify-pretty-compact": "^4.0.0", "prettier": "^3.4.2", "react": "^19.0.0", "react-dom": "^19.0.0", - "react-router-dom": "^7.1.0", + "react-router-dom": "^7.1.1", "typescript": "^5.5.3", "zipper": "github:azizghuloum/zipper" }, @@ -42,7 +42,7 @@ "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.16", "globals": "^15.14.0", - "typescript-eslint": "^8.18.1", + "typescript-eslint": "^8.18.2", "vite": "^6.0.5", "vitest": "^2.1.5" } From aaf5f872d3dde4a899ba3ca826bf9198fa509348 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 25 Dec 2024 15:37:59 +0300 Subject: [PATCH 22/22] updated dependencies --- deno.lock | 6 +- package-lock.json | 420 +++++++++++++++++++++++++++------------------- 2 files changed, 255 insertions(+), 171 deletions(-) diff --git a/deno.lock b/deno.lock index 12f5d6b..88093bb 100644 --- a/deno.lock +++ b/deno.lock @@ -838,13 +838,13 @@ "npm:eslint@^9.17.0", "npm:globals@^15.14.0", "npm:index-to-position@1", - "npm:json-stable-stringify@^1.2.0", + "npm:json-stable-stringify@^1.2.1", "npm:json-stringify-pretty-compact@4", "npm:prettier@^3.4.2", "npm:react-dom@19", - "npm:react-router-dom@^7.1.0", + "npm:react-router-dom@^7.1.1", "npm:react@19", - "npm:typescript-eslint@^8.18.1", + "npm:typescript-eslint@^8.18.2", "npm:typescript@^5.5.3", "npm:vite@^6.0.5", "npm:vitest@^2.1.5" diff --git a/package-lock.json b/package-lock.json index 339f1e4..ab1a44f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -69,9 +69,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz", - "integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.3.tgz", + "integrity": "sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g==", "dev": true, "license": "MIT", "engines": { @@ -110,14 +110,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", - "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz", + "integrity": "sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.26.2", - "@babel/types": "^7.26.0", + "@babel/parser": "^7.26.3", + "@babel/types": "^7.26.3", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -229,13 +229,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", - "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.26.0" + "@babel/types": "^7.26.3" }, "bin": { "parser": "bin/babel-parser.js" @@ -304,17 +304,17 @@ } }, "node_modules/@babel/traverse": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", - "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", + "version": "7.26.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.4.tgz", + "integrity": "sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.9", - "@babel/generator": "^7.25.9", - "@babel/parser": "^7.25.9", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.3", + "@babel/parser": "^7.26.3", "@babel/template": "^7.25.9", - "@babel/types": "^7.25.9", + "@babel/types": "^7.26.3", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -333,9 +333,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", "dev": true, "license": "MIT", "dependencies": { @@ -354,21 +354,15 @@ "license": "MIT" }, "node_modules/@codemirror/autocomplete": { - "version": "6.18.3", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.3.tgz", - "integrity": "sha512-1dNIOmiM0z4BIBwxmxEfA1yoxh1MF/6KPBbh20a5vphGV0ictKlgQsbJs6D6SkR6iJpGbpwRsa6PFMNlg9T9pQ==", + "version": "6.18.4", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.4.tgz", + "integrity": "sha512-sFAphGQIqyQZfP2ZBsSHV7xQvo9Py0rV0dW7W3IMRdS+zDuNb2l3no78CvUaWKGfzFjI4FTrLdUSj86IGb2hRA==", "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.17.0", "@lezer/common": "^1.0.0" - }, - "peerDependencies": { - "@codemirror/language": "^6.0.0", - "@codemirror/state": "^6.0.0", - "@codemirror/view": "^6.0.0", - "@lezer/common": "^1.0.0" } }, "node_modules/@codemirror/commands": { @@ -399,9 +393,9 @@ } }, "node_modules/@codemirror/language": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.3.tgz", - "integrity": "sha512-kDqEU5sCP55Oabl6E7m5N+vZRoc0iWqgDVhEKifcHzPzjqCegcO4amfrYVL9PmPZpl4G0yjkpTpUO/Ui8CzO8A==", + "version": "6.10.8", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.8.tgz", + "integrity": "sha512-wcP8XPPhDH2vTqf181U8MbZnW+tDyPYy0UzVOa+oHORjyT+mhhom9vBd7dApJwoDz9Nb/a8kHjJIsuA/t8vNFw==", "license": "MIT", "dependencies": { "@codemirror/state": "^6.0.0", @@ -413,9 +407,9 @@ } }, "node_modules/@codemirror/lint": { - "version": "6.8.3", - "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.3.tgz", - "integrity": "sha512-GSGfKxCo867P7EX1k2LoCrjuQFeqVgPGRRsSl4J4c0KMkD+k1y6WYvTQkzv0iZ8JhLJDujEvlnMchv4CZQLh3Q==", + "version": "6.8.4", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.4.tgz", + "integrity": "sha512-u4q7PnZlJUojeRe8FJa/njJcMctISGgPQ4PnWsd9268R4ZTtU+tfFYmwkBvgcrK2+QQ8tYFVALVb5fVJykKc5A==", "license": "MIT", "dependencies": { "@codemirror/state": "^6.0.0", @@ -435,10 +429,13 @@ } }, "node_modules/@codemirror/state": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.4.1.tgz", - "integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==", - "license": "MIT" + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.0.tgz", + "integrity": "sha512-MwBHVK60IiIHDcoMet78lxt6iw5gJOGSbNbOIVBHWVXIH4/Nq1+GQgLLGgI1KlnN86WDXsPudVaqYHKBIx7Eyw==", + "license": "MIT", + "dependencies": { + "@marijn/find-cluster-break": "^1.0.0" + } }, "node_modules/@codemirror/theme-one-dark": { "version": "6.1.2", @@ -453,12 +450,12 @@ } }, "node_modules/@codemirror/view": { - "version": "6.35.0", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.35.0.tgz", - "integrity": "sha512-I0tYy63q5XkaWsJ8QRv5h6ves7kvtrBWjBcnf/bzohFJQc5c14a1AQRdE8QpPF9eMp5Mq2FMm59TCj1gDfE7kw==", + "version": "6.36.1", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.36.1.tgz", + "integrity": "sha512-miD1nyT4m4uopZaDdO2uXU/LLHliKNYL9kB1C1wJHrunHLm/rpkb5QVSokqgw9hFqEZakrdlb/VGWX8aYZTslQ==", "license": "MIT", "dependencies": { - "@codemirror/state": "^6.4.0", + "@codemirror/state": "^6.5.0", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } @@ -914,13 +911,13 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", - "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz", + "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.4", + "@eslint/object-schema": "^2.1.5", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -929,11 +926,14 @@ } }, "node_modules/@eslint/core": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", - "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.1.tgz", + "integrity": "sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==", "dev": true, "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -980,14 +980,15 @@ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.17.0.tgz", "integrity": "sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", + "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -995,9 +996,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", - "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz", + "integrity": "sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -1102,9 +1103,9 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "dev": true, "license": "MIT", "dependencies": { @@ -1170,9 +1171,9 @@ } }, "node_modules/@lezer/javascript": { - "version": "1.4.19", - "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.19.tgz", - "integrity": "sha512-j44kbR1QL26l6dMunZ1uhKBFteVGLVCBGNUD2sUaMnic+rbTviVuoK0CD1l9FTW31EueWvFFswCKMH7Z+M3JRA==", + "version": "1.4.21", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.21.tgz", + "integrity": "sha512-lL+1fcuxWYPURMM/oFZLEDm0XuLN128QPV+VuGtKpeaOGdcl9F2LYC3nh1S9LkPqx9M0mndZFdXCipNAZpzIkQ==", "license": "MIT", "dependencies": { "@lezer/common": "^1.2.0", @@ -1189,11 +1190,18 @@ "@lezer/common": "^1.0.0" } }, + "node_modules/@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "license": "MIT" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1207,6 +1215,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -1216,6 +1225,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1236,9 +1246,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.27.4.tgz", - "integrity": "sha512-2Y3JT6f5MrQkICUyRVCw4oa0sutfAsgaSsb0Lmmy1Wi2y7X5vT9Euqw4gOsCyy0YfKURBg35nhUKZS4mDcfULw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.29.1.tgz", + "integrity": "sha512-ssKhA8RNltTZLpG6/QNkCSge+7mBQGUqJRisZ2MDQcEGaK93QESEgWK2iOpIDZ7k9zPVkG5AS3ksvD5ZWxmItw==", "cpu": [ "arm" ], @@ -1250,9 +1260,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.27.4.tgz", - "integrity": "sha512-wzKRQXISyi9UdCVRqEd0H4cMpzvHYt1f/C3CoIjES6cG++RHKhrBj2+29nPF0IB5kpy9MS71vs07fvrNGAl/iA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.29.1.tgz", + "integrity": "sha512-CaRfrV0cd+NIIcVVN/jx+hVLN+VRqnuzLRmfmlzpOzB87ajixsN/+9L5xNmkaUUvEbI5BmIKS+XTwXsHEb65Ew==", "cpu": [ "arm64" ], @@ -1264,9 +1274,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.4.tgz", - "integrity": "sha512-PlNiRQapift4LNS8DPUHuDX/IdXiLjf8mc5vdEmUR0fF/pyy2qWwzdLjB+iZquGr8LuN4LnUoSEvKRwjSVYz3Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.29.1.tgz", + "integrity": "sha512-2ORr7T31Y0Mnk6qNuwtyNmy14MunTAMx06VAPI6/Ju52W10zk1i7i5U3vlDRWjhOI5quBcrvhkCHyF76bI7kEw==", "cpu": [ "arm64" ], @@ -1278,9 +1288,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.27.4.tgz", - "integrity": "sha512-o9bH2dbdgBDJaXWJCDTNDYa171ACUdzpxSZt+u/AAeQ20Nk5x+IhA+zsGmrQtpkLiumRJEYef68gcpn2ooXhSQ==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.29.1.tgz", + "integrity": "sha512-j/Ej1oanzPjmN0tirRd5K2/nncAhS9W6ICzgxV+9Y5ZsP0hiGhHJXZ2JQ53iSSjj8m6cRY6oB1GMzNn2EUt6Ng==", "cpu": [ "x64" ], @@ -1292,9 +1302,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.27.4.tgz", - "integrity": "sha512-NBI2/i2hT9Q+HySSHTBh52da7isru4aAAo6qC3I7QFVsuhxi2gM8t/EI9EVcILiHLj1vfi+VGGPaLOUENn7pmw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.29.1.tgz", + "integrity": "sha512-91C//G6Dm/cv724tpt7nTyP+JdN12iqeXGFM1SqnljCmi5yTXriH7B1r8AD9dAZByHpKAumqP1Qy2vVNIdLZqw==", "cpu": [ "arm64" ], @@ -1306,9 +1316,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.27.4.tgz", - "integrity": "sha512-wYcC5ycW2zvqtDYrE7deary2P2UFmSh85PUpAx+dwTCO9uw3sgzD6Gv9n5X4vLaQKsrfTSZZ7Z7uynQozPVvWA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.29.1.tgz", + "integrity": "sha512-hEioiEQ9Dec2nIRoeHUP6hr1PSkXzQaCUyqBDQ9I9ik4gCXQZjJMIVzoNLBRGet+hIUb3CISMh9KXuCcWVW/8w==", "cpu": [ "x64" ], @@ -1320,9 +1330,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.27.4.tgz", - "integrity": "sha512-9OwUnK/xKw6DyRlgx8UizeqRFOfi9mf5TYCw1uolDaJSbUmBxP85DE6T4ouCMoN6pXw8ZoTeZCSEfSaYo+/s1w==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.29.1.tgz", + "integrity": "sha512-Py5vFd5HWYN9zxBv3WMrLAXY3yYJ6Q/aVERoeUFwiDGiMOWsMs7FokXihSOaT/PMWUty/Pj60XDQndK3eAfE6A==", "cpu": [ "arm" ], @@ -1334,9 +1344,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.27.4.tgz", - "integrity": "sha512-Vgdo4fpuphS9V24WOV+KwkCVJ72u7idTgQaBoLRD0UxBAWTF9GWurJO9YD9yh00BzbkhpeXtm6na+MvJU7Z73A==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.29.1.tgz", + "integrity": "sha512-RiWpGgbayf7LUcuSNIbahr0ys2YnEERD4gYdISA06wa0i8RALrnzflh9Wxii7zQJEB2/Eh74dX4y/sHKLWp5uQ==", "cpu": [ "arm" ], @@ -1348,9 +1358,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.27.4.tgz", - "integrity": "sha512-pleyNgyd1kkBkw2kOqlBx+0atfIIkkExOTiifoODo6qKDSpnc6WzUY5RhHdmTdIJXBdSnh6JknnYTtmQyobrVg==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.29.1.tgz", + "integrity": "sha512-Z80O+taYxTQITWMjm/YqNoe9d10OX6kDh8X5/rFCMuPqsKsSyDilvfg+vd3iXIqtfmp+cnfL1UrYirkaF8SBZA==", "cpu": [ "arm64" ], @@ -1362,9 +1372,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.27.4.tgz", - "integrity": "sha512-caluiUXvUuVyCHr5DxL8ohaaFFzPGmgmMvwmqAITMpV/Q+tPoaHZ/PWa3t8B2WyoRcIIuu1hkaW5KkeTDNSnMA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.29.1.tgz", + "integrity": "sha512-fOHRtF9gahwJk3QVp01a/GqS4hBEZCV1oKglVVq13kcK3NeVlS4BwIFzOHDbmKzt3i0OuHG4zfRP0YoG5OF/rA==", "cpu": [ "arm64" ], @@ -1375,10 +1385,24 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.29.1.tgz", + "integrity": "sha512-5a7q3tnlbcg0OodyxcAdrrCxFi0DgXJSoOuidFUzHZ2GixZXQs6Tc3CHmlvqKAmOs5eRde+JJxeIf9DonkmYkw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.27.4.tgz", - "integrity": "sha512-FScrpHrO60hARyHh7s1zHE97u0KlT/RECzCKAdmI+LEoC1eDh/RDji9JgFqyO+wPDb86Oa/sXkily1+oi4FzJQ==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.29.1.tgz", + "integrity": "sha512-9b4Mg5Yfz6mRnlSPIdROcfw1BU22FQxmfjlp/CShWwO3LilKQuMISMTtAu/bxmmrE6A902W2cZJuzx8+gJ8e9w==", "cpu": [ "ppc64" ], @@ -1390,9 +1414,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.27.4.tgz", - "integrity": "sha512-qyyprhyGb7+RBfMPeww9FlHwKkCXdKHeGgSqmIXw9VSUtvyFZ6WZRtnxgbuz76FK7LyoN8t/eINRbPUcvXB5fw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.29.1.tgz", + "integrity": "sha512-G5pn0NChlbRM8OJWpJFMX4/i8OEU538uiSv0P6roZcbpe/WfhEO+AT8SHVKfp8qhDQzaz7Q+1/ixMy7hBRidnQ==", "cpu": [ "riscv64" ], @@ -1404,9 +1428,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.27.4.tgz", - "integrity": "sha512-PFz+y2kb6tbh7m3A7nA9++eInGcDVZUACulf/KzDtovvdTizHpZaJty7Gp0lFwSQcrnebHOqxF1MaKZd7psVRg==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.29.1.tgz", + "integrity": "sha512-WM9lIkNdkhVwiArmLxFXpWndFGuOka4oJOZh8EP3Vb8q5lzdSCBuhjavJsw68Q9AKDGeOOIHYzYm4ZFvmWez5g==", "cpu": [ "s390x" ], @@ -1418,9 +1442,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.4.tgz", - "integrity": "sha512-Ni8mMtfo+o/G7DVtweXXV/Ol2TFf63KYjTtoZ5f078AUgJTmaIJnj4JFU7TK/9SVWTaSJGxPi5zMDgK4w+Ez7Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.29.1.tgz", + "integrity": "sha512-87xYCwb0cPGZFoGiErT1eDcssByaLX4fc0z2nRM6eMtV9njAfEE6OW3UniAoDhX4Iq5xQVpE6qO9aJbCFumKYQ==", "cpu": [ "x64" ], @@ -1432,9 +1456,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.4.tgz", - "integrity": "sha512-5AeeAF1PB9TUzD+3cROzFTnAJAcVUGLuR8ng0E0WXGkYhp6RD6L+6szYVX+64Rs0r72019KHZS1ka1q+zU/wUw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.29.1.tgz", + "integrity": "sha512-xufkSNppNOdVRCEC4WKvlR1FBDyqCSCpQeMMgv9ZyXqqtKBfkw1yfGMTUTs9Qsl6WQbJnsGboWCp7pJGkeMhKA==", "cpu": [ "x64" ], @@ -1446,9 +1470,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.27.4.tgz", - "integrity": "sha512-yOpVsA4K5qVwu2CaS3hHxluWIK5HQTjNV4tWjQXluMiiiu4pJj4BN98CvxohNCpcjMeTXk/ZMJBRbgRg8HBB6A==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.29.1.tgz", + "integrity": "sha512-F2OiJ42m77lSkizZQLuC+jiZ2cgueWQL5YC9tjo3AgaEw+KJmVxHGSyQfDUoYR9cci0lAywv2Clmckzulcq6ig==", "cpu": [ "arm64" ], @@ -1460,9 +1484,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.27.4.tgz", - "integrity": "sha512-KtwEJOaHAVJlxV92rNYiG9JQwQAdhBlrjNRp7P9L8Cb4Rer3in+0A+IPhJC9y68WAi9H0sX4AiG2NTsVlmqJeQ==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.29.1.tgz", + "integrity": "sha512-rYRe5S0FcjlOBZQHgbTKNrqxCBUmgDJem/VQTCcTnA2KCabYSWQDrytOzX7avb79cAAweNmMUb/Zw18RNd4mng==", "cpu": [ "ia32" ], @@ -1474,9 +1498,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.4.tgz", - "integrity": "sha512-3j4jx1TppORdTAoBJRd+/wJRGCPC0ETWkXOecJ6PPZLj6SptXkrXcNqdj0oclbKML6FkQltdz7bBA3rUSirZug==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.29.1.tgz", + "integrity": "sha512-+10CMg9vt1MoHj6x1pxyjPSMjHTIlqs8/tBztXvPAx24SKs9jwVnKqHJumlH/IzhaPUaj3T6T6wfZr8okdXaIg==", "cpu": [ "x64" ], @@ -1541,7 +1565,8 @@ "node_modules/@types/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==" + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", + "license": "MIT" }, "node_modules/@types/estree": { "version": "1.0.6", @@ -1577,6 +1602,7 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.2.tgz", "integrity": "sha512-USU8ZI/xyKJwFTpjSVIrSeHBVAGagkHQKPNbxeWwql/vDmnTIBgx+TJnhFnj1NXgz8XfprU0egV2dROLGpsBEg==", "dev": true, + "license": "MIT", "dependencies": { "csstype": "^3.0.2" } @@ -1586,6 +1612,7 @@ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.0.2.tgz", "integrity": "sha512-c1s+7TKFaDRRxr1TxccIX2u7sfCnc3RxkVyBIUA2lCpyqCF+QoAwQ/CBg7bsMdVwP120HEH143VQezKtef5nCg==", "dev": true, + "license": "MIT", "peerDependencies": { "@types/react": "^19.0.0" } @@ -1595,6 +1622,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.2.tgz", "integrity": "sha512-adig4SzPLjeQ0Tm+jvsozSGiCliI2ajeURDGHjZ2llnA+A67HihCQ+a3amtPhUakd1GlwHxSRvzOZktbEvhPPg==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.18.2", @@ -1624,6 +1652,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.2.tgz", "integrity": "sha512-y7tcq4StgxQD4mDr9+Jb26dZ+HTZ/SkfqpXSiqeUXZHxOUyjWDKsmwKhJ0/tApR08DgOhrFAoAhyB80/p3ViuA==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/scope-manager": "8.18.2", "@typescript-eslint/types": "8.18.2", @@ -1648,6 +1677,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.2.tgz", "integrity": "sha512-YJFSfbd0CJjy14r/EvWapYgV4R5CHzptssoag2M7y3Ra7XNta6GPAJPPP5KGB9j14viYXyrzRO5GkX7CRfo8/g==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "8.18.2", "@typescript-eslint/visitor-keys": "8.18.2" @@ -1665,6 +1695,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.2.tgz", "integrity": "sha512-AB/Wr1Lz31bzHfGm/jgbFR0VB0SML/hd2P1yxzKDM48YmP7vbyJNHRExUE/wZsQj2wUCvbWH8poNHFuxLqCTnA==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/typescript-estree": "8.18.2", "@typescript-eslint/utils": "8.18.2", @@ -1688,6 +1719,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.2.tgz", "integrity": "sha512-Z/zblEPp8cIvmEn6+tPDIHUbRu/0z5lqZ+NvolL5SvXWT5rQy7+Nch83M0++XzO0XrWRFWECgOAyE8bsJTl1GQ==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -1701,6 +1733,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.2.tgz", "integrity": "sha512-WXAVt595HjpmlfH4crSdM/1bcsqh+1weFRWIa9XMTx/XHZ9TCKMcr725tLYqWOgzKdeDrqVHxFotrvWcEsk2Tg==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "8.18.2", "@typescript-eslint/visitor-keys": "8.18.2", @@ -1727,6 +1760,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -1736,6 +1770,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -1751,6 +1786,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1763,6 +1799,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.2.tgz", "integrity": "sha512-Cr4A0H7DtVIPkauj4sTSXVl+VBWewE9/o40KcF3TV9aqDEOWoXF3/+oRXNby3DYzZeCATvbdksYsGZzplwnK/Q==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@typescript-eslint/scope-manager": "8.18.2", @@ -1786,6 +1823,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.2.tgz", "integrity": "sha512-zORcwn4C3trOWiCqFQP1x6G3xTRyZ1LYydnj51cRnJ6hxBlr/cKPckk+PKPUw/fXmvfKTcw7bwY3w9izgx5jZw==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/types": "8.18.2", "eslint-visitor-keys": "^4.2.0" @@ -1802,6 +1840,7 @@ "version": "4.23.7", "resolved": "https://registry.npmjs.org/@uiw/codemirror-extensions-basic-setup/-/codemirror-extensions-basic-setup-4.23.7.tgz", "integrity": "sha512-9/2EUa1Lck4kFKkR2BkxlZPpgD/EWuKHnOlysf1yHKZGraaZmZEaUw+utDK4QcuJc8Iz097vsLz4f4th5EU27g==", + "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/commands": "^6.0.0", @@ -1828,6 +1867,7 @@ "version": "4.23.7", "resolved": "https://registry.npmjs.org/@uiw/codemirror-theme-abcdef/-/codemirror-theme-abcdef-4.23.7.tgz", "integrity": "sha512-KXTtbIJX00lyKs1ukVo73cHItgoufKbVYqgv3SSHxw1Z5bjcAnBQc7RUGE8eMy5uDBjasKYGYFlJeRCVu8L2wg==", + "license": "MIT", "dependencies": { "@uiw/codemirror-themes": "4.23.7" }, @@ -1839,6 +1879,7 @@ "version": "4.23.7", "resolved": "https://registry.npmjs.org/@uiw/codemirror-themes/-/codemirror-themes-4.23.7.tgz", "integrity": "sha512-UNf1XOx1hG9OmJnrtT86PxKcdcwhaNhbrcD+nsk8WxRJ3n5c8nH6euDvgVPdVLPwbizsaQcZTILACgA/FjRpVg==", + "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", @@ -1857,6 +1898,7 @@ "version": "4.23.7", "resolved": "https://registry.npmjs.org/@uiw/react-codemirror/-/react-codemirror-4.23.7.tgz", "integrity": "sha512-Nh/0P6W+kWta+ARp9YpnKPD9ick5teEnwmtNoPQnyd6NPv0EQP3Ui4YmRVNj1nkUEo+QjrAUaEfcejJ2up/HZA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.18.6", "@codemirror/commands": "^6.1.0", @@ -2126,6 +2168,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -2134,9 +2177,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", - "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.3.tgz", + "integrity": "sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA==", "dev": true, "funding": [ { @@ -2154,9 +2197,9 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001669", - "electron-to-chromium": "^1.5.41", - "node-releases": "^2.0.18", + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.1" }, "bin": { @@ -2180,6 +2223,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", @@ -2197,6 +2241,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" @@ -2209,6 +2254,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", "get-intrinsic": "^1.2.6" @@ -2231,9 +2277,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001684", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001684.tgz", - "integrity": "sha512-G1LRwLIQjBQoyq0ZJGqGIJUXzJ8irpbjHLpVRXDvBEScFJ9b17sgK6vlx0GAJFE21okD7zXl08rRRUfq6HdoEQ==", + "version": "1.0.30001690", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz", + "integrity": "sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w==", "dev": true, "funding": [ { @@ -2348,6 +2394,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", + "license": "MIT", "engines": { "node": ">=18" } @@ -2381,9 +2428,9 @@ "license": "MIT" }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -2419,6 +2466,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -2435,6 +2483,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", @@ -2452,9 +2501,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.64", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.64.tgz", - "integrity": "sha512-IXEuxU+5ClW2IGEYFC2T7szbyVgehupCWQe5GNh+H065CD6U6IFN0s4KeAMFGNmQolRU4IV7zGBWSYMmZ8uuqQ==", + "version": "1.5.76", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.76.tgz", + "integrity": "sha512-CjVQyG7n7Sr+eBXE86HIulnL5N8xZY1sgmOPGuq/F0Rr0FJq63lg0kEtOIDfZBk44FnDLf6FUJ+dsJcuiUDdDQ==", "dev": true, "license": "ISC" }, @@ -2469,6 +2518,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -2477,6 +2527,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -2492,6 +2543,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, @@ -2567,6 +2619,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.17.0.tgz", "integrity": "sha512-evtlNcpJg+cZLcnVKwsai8fExnqjGPicK7gnUtlNuzu+Fv9bI0aLpND5T44VLQtoMEnI57LoXO9XAkIXwohKrA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", @@ -2770,6 +2823,7 @@ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -2786,6 +2840,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -2812,6 +2867,7 @@ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -2834,6 +2890,7 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -2915,6 +2972,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2933,6 +2991,7 @@ "version": "1.2.6", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", "dunder-proto": "^1.0.0", @@ -3017,6 +3076,7 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-15.14.0.tgz", "integrity": "sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -3028,6 +3088,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -3039,7 +3100,8 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/has-flag": { "version": "4.0.0", @@ -3055,6 +3117,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -3066,6 +3129,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -3077,6 +3141,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -3178,6 +3243,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -3285,9 +3351,9 @@ } }, "node_modules/jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, "license": "MIT", "bin": { @@ -3315,6 +3381,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.1.tgz", "integrity": "sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -3429,9 +3496,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.13", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.13.tgz", - "integrity": "sha512-8rYBO+MsWkgjDSOvLomYnzhdwEG51olQ4zL5KXnNJWV5MNmrb4rTZdrtkhxjnD/QyZUqR/Z/XDsUs/4ej2nx0g==", + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", "dev": true, "license": "MIT", "dependencies": { @@ -3483,6 +3550,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -3492,6 +3560,7 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -3501,6 +3570,7 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -3566,9 +3636,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "dev": true, "license": "MIT" }, @@ -3723,6 +3793,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -3812,7 +3883,8 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/react": { "version": "19.0.0", @@ -3849,6 +3921,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.1.tgz", "integrity": "sha512-39sXJkftkKWRZ2oJtHhCxmoCrBCULr/HAH4IT5DHlgu/Q0FCPV0S4Lx+abjDTx/74xoZzNYDYbOZWlJjruyuDQ==", + "license": "MIT", "dependencies": { "@types/cookie": "^0.6.0", "cookie": "^1.0.1", @@ -3872,6 +3945,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.1.1.tgz", "integrity": "sha512-vSrQHWlJ5DCfyrhgo0k6zViOe9ToK8uT5XGSmnuC2R3/g261IdIMpZVqfjD6vWSXdnf5Czs4VA/V60oVR6/jnA==", + "license": "MIT", "dependencies": { "react-router": "7.1.1" }, @@ -3904,15 +3978,16 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, "node_modules/rollup": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.27.4.tgz", - "integrity": "sha512-RLKxqHEMjh/RGLsDxAEsaLO3mWgyoU6x9w6n1ikAzet4B3gI2/3yP6PWY2p9QzRTh6MfEIXB3MwsOY0Iv3vNrw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.29.1.tgz", + "integrity": "sha512-RaJ45M/kmJUzSWDs1Nnd5DdV4eerC98idtUOVr6FfKcgxqvjwHmxc5upLF9qZU9EpsVzzhleFahrT3shLuJzIw==", "dev": true, "license": "MIT", "dependencies": { @@ -3926,24 +4001,25 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.27.4", - "@rollup/rollup-android-arm64": "4.27.4", - "@rollup/rollup-darwin-arm64": "4.27.4", - "@rollup/rollup-darwin-x64": "4.27.4", - "@rollup/rollup-freebsd-arm64": "4.27.4", - "@rollup/rollup-freebsd-x64": "4.27.4", - "@rollup/rollup-linux-arm-gnueabihf": "4.27.4", - "@rollup/rollup-linux-arm-musleabihf": "4.27.4", - "@rollup/rollup-linux-arm64-gnu": "4.27.4", - "@rollup/rollup-linux-arm64-musl": "4.27.4", - "@rollup/rollup-linux-powerpc64le-gnu": "4.27.4", - "@rollup/rollup-linux-riscv64-gnu": "4.27.4", - "@rollup/rollup-linux-s390x-gnu": "4.27.4", - "@rollup/rollup-linux-x64-gnu": "4.27.4", - "@rollup/rollup-linux-x64-musl": "4.27.4", - "@rollup/rollup-win32-arm64-msvc": "4.27.4", - "@rollup/rollup-win32-ia32-msvc": "4.27.4", - "@rollup/rollup-win32-x64-msvc": "4.27.4", + "@rollup/rollup-android-arm-eabi": "4.29.1", + "@rollup/rollup-android-arm64": "4.29.1", + "@rollup/rollup-darwin-arm64": "4.29.1", + "@rollup/rollup-darwin-x64": "4.29.1", + "@rollup/rollup-freebsd-arm64": "4.29.1", + "@rollup/rollup-freebsd-x64": "4.29.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.29.1", + "@rollup/rollup-linux-arm-musleabihf": "4.29.1", + "@rollup/rollup-linux-arm64-gnu": "4.29.1", + "@rollup/rollup-linux-arm64-musl": "4.29.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.29.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.29.1", + "@rollup/rollup-linux-riscv64-gnu": "4.29.1", + "@rollup/rollup-linux-s390x-gnu": "4.29.1", + "@rollup/rollup-linux-x64-gnu": "4.29.1", + "@rollup/rollup-linux-x64-musl": "4.29.1", + "@rollup/rollup-win32-arm64-msvc": "4.29.1", + "@rollup/rollup-win32-ia32-msvc": "4.29.1", + "@rollup/rollup-win32-x64-msvc": "4.29.1", "fsevents": "~2.3.2" } }, @@ -3966,6 +4042,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -3989,12 +4066,14 @@ "node_modules/set-cookie-parser": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz", - "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==" + "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==", + "license": "MIT" }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -4300,6 +4379,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -4312,6 +4392,7 @@ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, + "license": "MIT", "engines": { "node": ">=16" }, @@ -4322,7 +4403,8 @@ "node_modules/turbo-stream": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.0.tgz", - "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==" + "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==", + "license": "ISC" }, "node_modules/type-check": { "version": "0.4.0", @@ -4355,6 +4437,7 @@ "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.2.tgz", "integrity": "sha512-KuXezG6jHkvC3MvizeXgupZzaG5wjhU3yE8E7e6viOvAvD9xAWYp8/vy0WULTGe9DYDWcQu7aW03YIV3mSitrQ==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/eslint-plugin": "8.18.2", "@typescript-eslint/parser": "8.18.2", @@ -4424,6 +4507,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.5.tgz", "integrity": "sha512-akD5IAH/ID5imgue2DYhzsEwCi0/4VKY31uhMLEYJwPP4TiUp8pL5PIK+Wo7H8qT8JY9i+pVfPydcFPYD1EL7g==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "0.24.0", "postcss": "^8.4.49",