From ce71fbd5582f85ed12e487d6ed893929bee0e38f Mon Sep 17 00:00:00 2001 From: Ryan Atkinson Date: Thu, 3 Oct 2024 16:05:53 -0600 Subject: [PATCH 1/4] wip --- src/lib/gro_plugin_gen.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/lib/gro_plugin_gen.ts b/src/lib/gro_plugin_gen.ts index 2c582a7c19..72506e8c3f 100644 --- a/src/lib/gro_plugin_gen.ts +++ b/src/lib/gro_plugin_gen.ts @@ -10,7 +10,7 @@ import type {File_Filter, Path_Id} from './path.js'; import type {Cleanup_Watch, Source_File} from './filer.js'; import {Unreachable_Error} from '@ryanatkn/belt/error.js'; -const FLUSH_DEBOUNCE_DELAY = 500; +const FLUSH_DEBOUNCE_DELAY = 3000; // TODO BLOCK test this export interface Task_Args extends Args { watch?: boolean; @@ -27,8 +27,6 @@ export const gro_plugin_gen = ({ root_dirs = [paths.source], flush_debounce_delay = FLUSH_DEBOUNCE_DELAY, }: Options = EMPTY_OBJECT): Plugin => { - let generating = false; - let regen = false; let flushing_timeout: NodeJS.Timeout | undefined; const queued_files: Set = new Set(); const queue_gen = (gen_file_id: string) => { @@ -41,20 +39,9 @@ export const gro_plugin_gen = ({ } }; const flush_gen_queue = throttle(async () => { - // hacky way to avoid concurrent `gro gen` calls - if (generating) { - regen = true; - return; - } - generating = true; const files = Array.from(queued_files); queued_files.clear(); await gen(files); - generating = false; - if (regen) { - regen = false; - void flush_gen_queue(); - } }, flush_debounce_delay); const gen = (files: string[] = []) => spawn_cli('gro', ['gen', ...files]); From 07c872523be8d652b8b0a349ad50e730d18bc8ca Mon Sep 17 00:00:00 2001 From: Ryan Atkinson Date: Thu, 3 Oct 2024 16:06:08 -0600 Subject: [PATCH 2/4] wip --- .changeset/empty-phones-exist.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/empty-phones-exist.md diff --git a/.changeset/empty-phones-exist.md b/.changeset/empty-phones-exist.md new file mode 100644 index 0000000000..2e5a3f69f9 --- /dev/null +++ b/.changeset/empty-phones-exist.md @@ -0,0 +1,5 @@ +--- +'@ryanatkn/gro': patch +--- + +cleanup `gro_plugin_gen` From fd789b71ec733340c486045b3e158e8c08b335e8 Mon Sep 17 00:00:00 2001 From: Ryan Atkinson Date: Fri, 4 Oct 2024 02:37:25 -0600 Subject: [PATCH 3/4] wip --- svelte.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svelte.config.js b/svelte.config.js index 66ba1c052b..53540bb1b8 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -11,6 +11,6 @@ export default { kit: { adapter: adapter(), paths: {relative: false}, // use root-absolute paths: https://kit.svelte.dev/docs/configuration#paths - alias: {$routes: 'src/routes', $fixtures: 'src/fixtures'}, + alias: {$routes: 'src/routes'}, }, }; From 68f2dc446fd55e14bbb5c7c87d561024248c1982 Mon Sep 17 00:00:00 2001 From: Ryan Atkinson Date: Fri, 4 Oct 2024 02:40:43 -0600 Subject: [PATCH 4/4] wip --- src/lib/gro_plugin_gen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/gro_plugin_gen.ts b/src/lib/gro_plugin_gen.ts index 72506e8c3f..8fe1cb3f3b 100644 --- a/src/lib/gro_plugin_gen.ts +++ b/src/lib/gro_plugin_gen.ts @@ -10,7 +10,7 @@ import type {File_Filter, Path_Id} from './path.js'; import type {Cleanup_Watch, Source_File} from './filer.js'; import {Unreachable_Error} from '@ryanatkn/belt/error.js'; -const FLUSH_DEBOUNCE_DELAY = 3000; // TODO BLOCK test this +const FLUSH_DEBOUNCE_DELAY = 500; export interface Task_Args extends Args { watch?: boolean;