diff --git a/.changeset/tasty-horses-flash.md b/.changeset/tasty-horses-flash.md new file mode 100644 index 000000000..b96fd4f39 --- /dev/null +++ b/.changeset/tasty-horses-flash.md @@ -0,0 +1,5 @@ +--- +'vite-plugin-kit-routes': patch +--- + +Doesn't generate when +page.svelte is saved (only create or delete) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index c3bbec507..ffdbec69e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -22,7 +22,7 @@ body: - annoyance - serious, but I can work around it - blocking an upgrade - - blocking all usage of Houdini + - blocking all usage of KitQL validations: required: true diff --git a/packages/vite-plugin-kit-routes/src/lib/plugin.ts b/packages/vite-plugin-kit-routes/src/lib/plugin.ts index 0d676f335..f519437b4 100644 --- a/packages/vite-plugin-kit-routes/src/lib/plugin.ts +++ b/packages/vite-plugin-kit-routes/src/lib/plugin.ts @@ -997,7 +997,7 @@ ${objTypes // report things if (shouldLog('post_update_run', options)) { - child.stdout.on('data', (data) => { + child.stderr.on('data', (data) => { if (data.toString()) { log.info(data.toString()) } @@ -1006,7 +1006,7 @@ ${objTypes // report errors if (shouldLog('errors', options)) { - child.stderr.on('data', (data) => { + child.stderr.on('error', (data) => { const msg = data.toString().replace(/\n$/, '') if (msg.includes('DEP0040') && msg.includes('punycode')) { // silent error @@ -1046,7 +1046,6 @@ function theEnd( log.success(`${yellow(options.generated_file_path)} updated`) } } - if (atStart && shouldLog('stats', options)) { let version = '' try { @@ -1127,9 +1126,19 @@ export function kitRoutes( // Run the thing when any change in a +page.svelte (add, remove, ...) watchAndRun([ { - name: 'kit-routes-watch', + name: 'kit-routes-watch-svelte-files', + logs: [], + watchKind: ['add', 'unlink'], + watch: ['**/+page.svelte'], + run: async () => { + await run(false, options) + }, + }, + + { + name: 'kit-routes-watch-server-files', logs: [], - watch: ['**/+page.svelte', '**/+page.server.ts', '**/+server.ts'], + watch: ['**/+page.server.ts', '**/+server.ts'], run: async () => { await run(false, options) },