@@ -2,7 +2,7 @@ import type {Task} from '@ryanatkn/gro';
22import { z } from 'zod' ;
33import { readFile , writeFile } from 'node:fs/promises' ;
44import { format_file } from '@ryanatkn/gro/format_file.js' ;
5- import { join } from 'node:path' ;
5+ import { basename , resolve } from 'node:path' ;
66import { paths , print_path } from '@ryanatkn/gro/paths.js' ;
77import { load_from_env } from '@ryanatkn/gro/env.js' ;
88import { load_fuz_config } from '@ryanatkn/fuz/config.js' ;
@@ -46,7 +46,7 @@ export const task: Task<Args> = {
4646 run : async ( { args, log, sveltekit_config} ) => {
4747 const { path, dir, outdir = sveltekit_config . routes_path } = args ;
4848
49- const outfile = join ( outdir , 'repos.ts' ) ;
49+ const outfile = resolve ( outdir , 'repos.ts' ) ;
5050
5151 const fuz_config = await load_fuz_config ( path , dir , log ) ;
5252
@@ -73,8 +73,14 @@ export const task: Task<Args> = {
7373 : '@ryanatkn/fuz_gitops/fetch_deployments.js' ;
7474
7575 // JSON is faster to parse than JS so we optimize it by embedding the data as a string.
76+ // TODO the `basename` is used here because we don't have an `origin_id` like with gen,
77+ // and this file gets re-exported,
78+ // and we don't want the file to change based on where it's being generated,
79+ // because for example linking to a local package would change the contents
7680 const contents = `
81+ // generated by ${ basename ( import . meta. filename ) }
7782 import type {Deployment} from '${ specifier } ';
83+
7884 export const deployments: Deployment[] = ${ embed_json ( fetched_deployments ) }
7985 ` ;
8086 // TODO think about possibly using the `gen` functionality in this task, not sure what the API design could look like
0 commit comments