@ryanatkn/gro 0.154.0 → 0.156.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/build.task.d.ts +1 -1
  2. package/dist/build.task.js +2 -2
  3. package/dist/changelog.js +1 -1
  4. package/dist/changeset.task.d.ts +1 -1
  5. package/dist/changeset.task.js +6 -6
  6. package/dist/check.task.d.ts +1 -1
  7. package/dist/check.task.js +3 -3
  8. package/dist/clean.task.d.ts +1 -1
  9. package/dist/clean.task.js +2 -2
  10. package/dist/clean_fs.js +2 -2
  11. package/dist/cli.d.ts +1 -1
  12. package/dist/cli.js +2 -2
  13. package/dist/commit.task.d.ts +1 -1
  14. package/dist/commit.task.js +1 -1
  15. package/dist/constants.d.ts +0 -1
  16. package/dist/constants.d.ts.map +1 -1
  17. package/dist/constants.js +0 -1
  18. package/dist/deploy.task.d.ts +1 -1
  19. package/dist/deploy.task.js +5 -5
  20. package/dist/dev.task.d.ts +2 -2
  21. package/dist/dev.task.js +2 -2
  22. package/dist/esbuild_helpers.d.ts +1 -1
  23. package/dist/esbuild_helpers.d.ts.map +1 -1
  24. package/dist/esbuild_helpers.js +1 -2
  25. package/dist/esbuild_plugin_external_worker.d.ts +1 -1
  26. package/dist/esbuild_plugin_external_worker.js +7 -7
  27. package/dist/esbuild_plugin_svelte.d.ts +1 -1
  28. package/dist/esbuild_plugin_svelte.js +4 -4
  29. package/dist/esbuild_plugin_sveltekit_local_imports.js +2 -2
  30. package/dist/esbuild_plugin_sveltekit_shim_app.d.ts +1 -1
  31. package/dist/esbuild_plugin_sveltekit_shim_app.js +2 -2
  32. package/dist/esbuild_plugin_sveltekit_shim_env.js +3 -3
  33. package/dist/filer.d.ts +3 -3
  34. package/dist/filer.js +6 -6
  35. package/dist/format.task.d.ts +1 -1
  36. package/dist/format.task.js +3 -3
  37. package/dist/format_directory.d.ts +1 -1
  38. package/dist/format_directory.js +5 -5
  39. package/dist/format_file.js +1 -1
  40. package/dist/gen.d.ts +5 -5
  41. package/dist/gen.js +4 -4
  42. package/dist/gen.task.d.ts +1 -1
  43. package/dist/gen.task.js +8 -8
  44. package/dist/git.js +1 -1
  45. package/dist/gro.config.default.d.ts +1 -1
  46. package/dist/gro.config.default.js +16 -8
  47. package/dist/gro.d.ts +1 -1
  48. package/dist/gro.js +3 -2
  49. package/dist/gro_config.d.ts +4 -4
  50. package/dist/gro_config.js +12 -4
  51. package/dist/gro_helpers.d.ts.map +1 -1
  52. package/dist/gro_helpers.js +5 -2
  53. package/dist/gro_plugin_gen.d.ts +2 -2
  54. package/dist/gro_plugin_gen.js +4 -4
  55. package/dist/gro_plugin_server.d.ts +1 -1
  56. package/dist/gro_plugin_server.js +11 -11
  57. package/dist/gro_plugin_sveltekit_app.d.ts +3 -3
  58. package/dist/gro_plugin_sveltekit_app.js +10 -10
  59. package/dist/gro_plugin_sveltekit_library.d.ts +2 -2
  60. package/dist/gro_plugin_sveltekit_library.js +3 -3
  61. package/dist/index.d.ts +4 -4
  62. package/dist/index.js +2 -2
  63. package/dist/input_path.d.ts +1 -1
  64. package/dist/input_path.js +3 -3
  65. package/dist/invoke.js +4 -4
  66. package/dist/invoke_task.d.ts +4 -4
  67. package/dist/invoke_task.js +7 -7
  68. package/dist/lint.task.d.ts +1 -1
  69. package/dist/lint.task.js +3 -3
  70. package/dist/loader.d.ts.map +1 -1
  71. package/dist/loader.js +70 -47
  72. package/dist/module.js +2 -2
  73. package/dist/modules.d.ts +2 -2
  74. package/dist/modules.js +10 -2
  75. package/dist/package.d.ts +1 -0
  76. package/dist/package.d.ts.map +1 -1
  77. package/dist/package.gen.d.ts +1 -1
  78. package/dist/package.gen.js +5 -5
  79. package/dist/package.js +6 -6
  80. package/dist/package_json.js +5 -5
  81. package/dist/package_meta.d.ts +2 -2
  82. package/dist/package_meta.js +1 -1
  83. package/dist/parse_imports.d.ts +1 -1
  84. package/dist/parse_imports.js +2 -2
  85. package/dist/paths.d.ts +1 -1
  86. package/dist/paths.js +2 -2
  87. package/dist/plugin.d.ts +3 -3
  88. package/dist/plugin.d.ts.map +1 -1
  89. package/dist/publish.task.d.ts +1 -1
  90. package/dist/publish.task.js +8 -8
  91. package/dist/reinstall.task.d.ts +1 -1
  92. package/dist/reinstall.task.js +2 -2
  93. package/dist/release.task.d.ts +1 -1
  94. package/dist/release.task.js +2 -2
  95. package/dist/resolve.task.d.ts +1 -1
  96. package/dist/resolve.task.js +2 -2
  97. package/dist/resolve_specifier.d.ts +1 -1
  98. package/dist/resolve_specifier.js +1 -1
  99. package/dist/run.task.d.ts +1 -1
  100. package/dist/run.task.js +2 -2
  101. package/dist/run_gen.d.ts +3 -3
  102. package/dist/run_gen.js +3 -3
  103. package/dist/run_task.d.ts +5 -5
  104. package/dist/run_task.js +4 -4
  105. package/dist/search_fs.d.ts +1 -1
  106. package/dist/src_json.d.ts +1 -1
  107. package/dist/src_json.js +2 -2
  108. package/dist/svelte_config.js +10 -2
  109. package/dist/sveltekit_helpers.d.ts +3 -3
  110. package/dist/sveltekit_helpers.js +6 -6
  111. package/dist/sveltekit_shim_app.d.ts +1 -1
  112. package/dist/sveltekit_shim_app_state.js +1 -1
  113. package/dist/sveltekit_shim_env.js +1 -1
  114. package/dist/sync.task.d.ts +1 -1
  115. package/dist/sync.task.js +3 -3
  116. package/dist/task.d.ts +7 -7
  117. package/dist/task.js +4 -4
  118. package/dist/task_logging.d.ts +1 -1
  119. package/dist/task_logging.js +1 -1
  120. package/dist/test.task.d.ts +1 -1
  121. package/dist/test.task.js +3 -3
  122. package/dist/typecheck.task.d.ts +1 -1
  123. package/dist/typecheck.task.js +6 -6
  124. package/dist/upgrade.task.d.ts +1 -1
  125. package/dist/upgrade.task.js +6 -6
  126. package/dist/watch_dir.d.ts +1 -1
  127. package/package.json +5 -4
  128. package/src/lib/build.task.ts +3 -3
  129. package/src/lib/changelog.ts +1 -1
  130. package/src/lib/changeset.task.ts +6 -6
  131. package/src/lib/check.task.ts +3 -3
  132. package/src/lib/clean.task.ts +3 -3
  133. package/src/lib/clean_fs.ts +2 -2
  134. package/src/lib/cli.ts +3 -3
  135. package/src/lib/commit.task.ts +2 -2
  136. package/src/lib/constants.ts +0 -1
  137. package/src/lib/deploy.task.ts +5 -5
  138. package/src/lib/dev.task.ts +3 -3
  139. package/src/lib/esbuild_helpers.ts +2 -3
  140. package/src/lib/esbuild_plugin_external_worker.ts +9 -9
  141. package/src/lib/esbuild_plugin_svelte.ts +4 -4
  142. package/src/lib/esbuild_plugin_sveltekit_local_imports.ts +2 -2
  143. package/src/lib/esbuild_plugin_sveltekit_shim_app.ts +3 -3
  144. package/src/lib/esbuild_plugin_sveltekit_shim_env.ts +3 -3
  145. package/src/lib/filer.ts +8 -8
  146. package/src/lib/format.task.ts +3 -3
  147. package/src/lib/format_directory.ts +5 -5
  148. package/src/lib/format_file.ts +1 -1
  149. package/src/lib/gen.task.ts +8 -8
  150. package/src/lib/gen.ts +7 -7
  151. package/src/lib/git.ts +1 -1
  152. package/src/lib/gro.config.default.ts +8 -8
  153. package/src/lib/gro.ts +4 -2
  154. package/src/lib/gro_config.ts +7 -7
  155. package/src/lib/gro_helpers.ts +5 -2
  156. package/src/lib/gro_plugin_gen.ts +6 -6
  157. package/src/lib/gro_plugin_server.ts +13 -13
  158. package/src/lib/gro_plugin_sveltekit_app.ts +11 -11
  159. package/src/lib/gro_plugin_sveltekit_library.ts +4 -4
  160. package/src/lib/index.ts +4 -4
  161. package/src/lib/input_path.ts +4 -4
  162. package/src/lib/invoke.ts +4 -4
  163. package/src/lib/invoke_task.ts +8 -8
  164. package/src/lib/lint.task.ts +3 -3
  165. package/src/lib/loader.ts +75 -64
  166. package/src/lib/module.ts +2 -2
  167. package/src/lib/modules.ts +3 -3
  168. package/src/lib/package.gen.ts +6 -6
  169. package/src/lib/package.ts +8 -8
  170. package/src/lib/package_json.ts +5 -5
  171. package/src/lib/package_meta.ts +3 -3
  172. package/src/lib/parse_imports.ts +3 -3
  173. package/src/lib/paths.ts +3 -3
  174. package/src/lib/plugin.ts +8 -5
  175. package/src/lib/publish.task.ts +8 -8
  176. package/src/lib/reinstall.task.ts +2 -2
  177. package/src/lib/release.task.ts +3 -3
  178. package/src/lib/resolve.task.ts +2 -2
  179. package/src/lib/resolve_specifier.ts +2 -2
  180. package/src/lib/run.task.ts +2 -2
  181. package/src/lib/run_gen.ts +5 -5
  182. package/src/lib/run_task.ts +7 -7
  183. package/src/lib/search_fs.ts +1 -1
  184. package/src/lib/src_json.ts +2 -2
  185. package/src/lib/svelte_config.ts +1 -1
  186. package/src/lib/sveltekit_helpers.ts +6 -6
  187. package/src/lib/sveltekit_shim_app.ts +1 -1
  188. package/src/lib/sveltekit_shim_app_state.ts +1 -1
  189. package/src/lib/sveltekit_shim_env.ts +1 -1
  190. package/src/lib/sync.task.ts +3 -3
  191. package/src/lib/task.ts +9 -9
  192. package/src/lib/task_logging.ts +3 -3
  193. package/src/lib/test.task.ts +3 -3
  194. package/src/lib/typecheck.task.ts +6 -6
  195. package/src/lib/upgrade.task.ts +6 -6
  196. package/src/lib/watch_dir.ts +1 -1
@@ -1,8 +1,16 @@
1
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
+ });
6
+ }
7
+ return path;
8
+ };
1
9
  import { join, resolve } from 'node:path';
2
10
  import { existsSync } from 'node:fs';
3
- import { GRO_DIST_DIR, IS_THIS_GRO, paths } from './paths.js';
4
- import { GRO_CONFIG_PATH, JS_CLI_DEFAULT, NODE_MODULES_DIRNAME, PM_CLI_DEFAULT, SERVER_DIST_PATH, SVELTEKIT_BUILD_DIRNAME, SVELTEKIT_DIST_DIRNAME, } from './constants.js';
5
- import create_default_config from './gro.config.default.js';
11
+ import { GRO_DIST_DIR, IS_THIS_GRO, paths } from "./paths.js";
12
+ import { GRO_CONFIG_PATH, JS_CLI_DEFAULT, NODE_MODULES_DIRNAME, PM_CLI_DEFAULT, SERVER_DIST_PATH, SVELTEKIT_BUILD_DIRNAME, SVELTEKIT_DIST_DIRNAME, } from "./constants.js";
13
+ import create_default_config from "./gro.config.default.js";
6
14
  export const create_empty_gro_config = () => ({
7
15
  plugins: () => [],
8
16
  map_package_json: default_map_package_json,
@@ -66,7 +74,7 @@ export const load_gro_config = async (dir = paths.root) => {
66
74
  return default_config;
67
75
  }
68
76
  // Import the user's `gro.config.ts`.
69
- const config_module = await import(config_path);
77
+ const config_module = await import(__rewriteRelativeImportExtension(config_path, true));
70
78
  validate_gro_config_module(config_module, config_path);
71
79
  return normalize_gro_config(typeof config_module.default === 'function'
72
80
  ? await config_module.default(default_config)
@@ -1 +1 @@
1
- {"version":3,"file":"gro_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,uBAAuB,GAAI,aAAS,KAAG,MAsBnD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC7B,aAAa,MAAM,EACnB,aAAa,MAAM,EACnB,MAAM,KAAK,CAAC,MAAM,CAAC,EACnB,eAAuB,KACrB,OAAO,CAAC,YAAY,CAiBtB,CAAC"}
1
+ {"version":3,"file":"gro_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,uBAAuB,GAAI,aAAS,KAAG,MAsBnD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC7B,aAAa,MAAM,EACnB,aAAa,MAAM,EACnB,MAAM,KAAK,CAAC,MAAM,CAAC,EACnB,eAAuB,KACrB,OAAO,CAAC,YAAY,CAoBtB,CAAC"}
@@ -2,7 +2,7 @@ import { realpathSync, existsSync } from 'node:fs';
2
2
  import { join, resolve } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { spawn } from '@ryanatkn/belt/process.js';
5
- import { JS_CLI_DEFAULT, NODE_MODULES_DIRNAME, SVELTEKIT_DIST_DIRNAME } from './constants.js';
5
+ import { JS_CLI_DEFAULT, NODE_MODULES_DIRNAME, SVELTEKIT_DIST_DIRNAME } from "./constants.js";
6
6
  /*
7
7
 
8
8
  This module is intended to have minimal dependencies to avoid over-imports in the CLI.
@@ -82,8 +82,11 @@ export const spawn_with_loader = (loader_path, invoke_path, argv, js_cli = JS_CL
82
82
  import {register} from "node:module";
83
83
  import {pathToFileURL} from "node:url";
84
84
  register("${loader_path}", pathToFileURL("./"));`,
85
+ // @sync Node options to `$lib/gro.ts`
85
86
  '--experimental-import-meta-resolve', // for `import.meta.resolve`
86
- '--enable-source-maps', // because TypeScript
87
+ '--experimental-strip-types',
88
+ '--disable-warning',
89
+ 'ExperimentalWarning',
87
90
  ];
88
91
  // In almost all cases we want the exports condition to be `"development"`. Needed for `esm-env`.
89
92
  if (process.env.NODE_ENV !== 'production') {
@@ -1,5 +1,5 @@
1
- import type { Plugin } from './plugin.js';
2
- import type { Args } from './args.js';
1
+ import type { Plugin } from './plugin.ts';
2
+ import type { Args } from './args.ts';
3
3
  export interface Task_Args extends Args {
4
4
  watch?: boolean;
5
5
  }
@@ -1,10 +1,10 @@
1
1
  import { EMPTY_OBJECT } from '@ryanatkn/belt/object.js';
2
2
  import { throttle } from '@ryanatkn/belt/throttle.js';
3
3
  import { Unreachable_Error } from '@ryanatkn/belt/error.js';
4
- import { paths } from './paths.js';
5
- import { find_genfiles, is_gen_path } from './gen.js';
6
- import { spawn_cli } from './cli.js';
7
- import { filter_dependents } from './filer.js';
4
+ import { paths } from "./paths.js";
5
+ import { find_genfiles, is_gen_path } from "./gen.js";
6
+ import { spawn_cli } from "./cli.js";
7
+ import { filter_dependents } from "./filer.js";
8
8
  const FLUSH_DEBOUNCE_DELAY = 500;
9
9
  export const gro_plugin_gen = ({ input_paths = [paths.source], root_dirs = [paths.source], flush_debounce_delay = FLUSH_DEBOUNCE_DELAY, } = EMPTY_OBJECT) => {
10
10
  let flushing_timeout;
@@ -1,7 +1,7 @@
1
1
  import * as esbuild from 'esbuild';
2
2
  import type { Config as SvelteConfig } from '@sveltejs/kit';
3
3
  import type { Result } from '@ryanatkn/belt/result.js';
4
- import type { Plugin } from './plugin.js';
4
+ import type { Plugin } from './plugin.ts';
5
5
  export declare const SERVER_SOURCE_ID: Flavored<string, "Path_Id">;
6
6
  export declare const has_server: (path?: Flavored<string, "Path_Id">) => Result<object, {
7
7
  message: string;
@@ -5,17 +5,17 @@ import { identity } from '@ryanatkn/belt/function.js';
5
5
  import { strip_before, strip_end } from '@ryanatkn/belt/string.js';
6
6
  import { existsSync } from 'node:fs';
7
7
  import { throttle } from '@ryanatkn/belt/throttle.js';
8
- import { base_path_to_path_id, LIB_DIRNAME, paths } from './paths.js';
9
- import { GRO_DEV_DIRNAME, SERVER_DIST_PATH } from './constants.js';
10
- import { watch_dir } from './watch_dir.js';
11
- import { parse_svelte_config, default_svelte_config } from './svelte_config.js';
12
- import { esbuild_plugin_sveltekit_shim_app } from './esbuild_plugin_sveltekit_shim_app.js';
13
- import { esbuild_plugin_sveltekit_shim_env } from './esbuild_plugin_sveltekit_shim_env.js';
14
- import { print_build_result, to_define_import_meta_env } from './esbuild_helpers.js';
15
- import { esbuild_plugin_sveltekit_shim_alias } from './esbuild_plugin_sveltekit_shim_alias.js';
16
- import { esbuild_plugin_external_worker } from './esbuild_plugin_external_worker.js';
17
- import { esbuild_plugin_sveltekit_local_imports } from './esbuild_plugin_sveltekit_local_imports.js';
18
- import { esbuild_plugin_svelte } from './esbuild_plugin_svelte.js';
8
+ import { base_path_to_path_id, LIB_DIRNAME, paths } from "./paths.js";
9
+ import { GRO_DEV_DIRNAME, SERVER_DIST_PATH } from "./constants.js";
10
+ import { watch_dir } from "./watch_dir.js";
11
+ import { parse_svelte_config, default_svelte_config } from "./svelte_config.js";
12
+ import { esbuild_plugin_sveltekit_shim_app } from "./esbuild_plugin_sveltekit_shim_app.js";
13
+ import { esbuild_plugin_sveltekit_shim_env } from "./esbuild_plugin_sveltekit_shim_env.js";
14
+ import { print_build_result, to_define_import_meta_env } from "./esbuild_helpers.js";
15
+ import { esbuild_plugin_sveltekit_shim_alias } from "./esbuild_plugin_sveltekit_shim_alias.js";
16
+ import { esbuild_plugin_external_worker } from "./esbuild_plugin_external_worker.js";
17
+ import { esbuild_plugin_sveltekit_local_imports } from "./esbuild_plugin_sveltekit_local_imports.js";
18
+ import { esbuild_plugin_svelte } from "./esbuild_plugin_svelte.js";
19
19
  // TODO sourcemap as a hoisted option? disable for production by default - or like `outpaths`, passed a `dev` param
20
20
  export const SERVER_SOURCE_ID = base_path_to_path_id(LIB_DIRNAME + '/server/server.ts');
21
21
  export const has_server = (path = SERVER_SOURCE_ID) => {
@@ -1,6 +1,6 @@
1
- import type { Plugin } from './plugin.js';
2
- import { type Map_Package_Json } from './package_json.js';
3
- import { type Map_Src_Json } from './src_json.js';
1
+ import type { Plugin } from './plugin.ts';
2
+ import { type Map_Package_Json } from './package_json.ts';
3
+ import { type Map_Src_Json } from './src_json.ts';
4
4
  export interface Gro_Plugin_Sveltekit_App_Options {
5
5
  /**
6
6
  * Used for finalizing a SvelteKit build like adding a `.nojekyll` file for GitHub Pages.
@@ -1,14 +1,14 @@
1
1
  import { cpSync, mkdirSync, rmSync, writeFileSync, existsSync } from 'node:fs';
2
2
  import { dirname, join } from 'node:path';
3
- import { serialize_args, to_forwarded_args } from './args.js';
4
- import { serialize_package_json, load_package_json } from './package_json.js';
5
- import { Task_Error } from './task.js';
6
- import { find_cli, spawn_cli, spawn_cli_process } from './cli.js';
7
- import { serialize_src_json, create_src_json } from './src_json.js';
8
- import { EXPORTS_EXCLUDER_DEFAULT } from './gro_config.js';
9
- import { default_svelte_config } from './svelte_config.js';
10
- import { SOURCE_DIRNAME } from './constants.js';
11
- import { VITE_CLI } from './sveltekit_helpers.js';
3
+ import { serialize_args, to_forwarded_args } from "./args.js";
4
+ import { serialize_package_json, load_package_json } from "./package_json.js";
5
+ import { Task_Error } from "./task.js";
6
+ import { find_cli, spawn_cli, spawn_cli_process } from "./cli.js";
7
+ import { serialize_src_json, create_src_json } from "./src_json.js";
8
+ import { EXPORTS_EXCLUDER_DEFAULT } from "./gro_config.js";
9
+ import { default_svelte_config } from "./svelte_config.js";
10
+ import { SOURCE_DIRNAME } from "./constants.js";
11
+ import { VITE_CLI } from "./sveltekit_helpers.js";
12
12
  export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_known_package_json, well_known_src_json, well_known_src_files, vite_cli = VITE_CLI, } = {}) => {
13
13
  let sveltekit_process = undefined;
14
14
  return {
@@ -16,7 +16,7 @@ export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_kn
16
16
  setup: async ({ dev, watch, log, config }) => {
17
17
  const found_vite_cli = find_cli(vite_cli);
18
18
  if (!found_vite_cli)
19
- throw new Error(`Failed to find Vite CLI \`${vite_cli}\`, do you need to run \`${config.pm_cli} i\`?`);
19
+ throw Error(`Failed to find Vite CLI \`${vite_cli}\`, do you need to run \`${config.pm_cli} i\`?`);
20
20
  if (dev) {
21
21
  // `vite dev` in development mode
22
22
  if (watch) {
@@ -1,5 +1,5 @@
1
- import type { Plugin } from './plugin.js';
2
- import { type Svelte_Package_Options } from './sveltekit_helpers.js';
1
+ import type { Plugin } from './plugin.ts';
2
+ import { type Svelte_Package_Options } from './sveltekit_helpers.ts';
3
3
  export interface Gro_Plugin_Sveltekit_Library_Options {
4
4
  /**
5
5
  * The options passed to the SvelteKit packaging CLI.
@@ -1,7 +1,7 @@
1
1
  import { print_spawn_result, spawn } from '@ryanatkn/belt/process.js';
2
- import { Task_Error } from './task.js';
3
- import { load_package_json } from './package_json.js';
4
- import { SVELTE_PACKAGE_CLI, run_svelte_package, } from './sveltekit_helpers.js';
2
+ import { Task_Error } from "./task.js";
3
+ import { load_package_json } from "./package_json.js";
4
+ import { SVELTE_PACKAGE_CLI, run_svelte_package, } from "./sveltekit_helpers.js";
5
5
  export const gro_plugin_sveltekit_library = ({ svelte_package_options, svelte_package_cli = SVELTE_PACKAGE_CLI, } = {}) => {
6
6
  const package_json = load_package_json();
7
7
  return {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export type { Gro_Config, Create_Gro_Config, Raw_Gro_Config } from './gro_config.js';
2
- export { type Plugin, replace_plugin } from './plugin.js';
3
- export type { Gen, Gen_Context } from './gen.js';
4
- export { type Task, type Task_Context, Task_Error } from './task.js';
1
+ export type { Gro_Config, Create_Gro_Config, Raw_Gro_Config } from './gro_config.ts';
2
+ export { type Plugin, replace_plugin } from './plugin.ts';
3
+ export type { Gen, Gen_Context } from './gen.ts';
4
+ export { type Task, type Task_Context, Task_Error } from './task.ts';
5
5
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { replace_plugin } from './plugin.js';
2
- export { Task_Error } from './task.js';
1
+ export { replace_plugin } from "./plugin.js";
2
+ export { Task_Error } from "./task.js";
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { Flavored } from '@ryanatkn/belt/types.js';
3
- import type { Path_Id, Resolved_Path } from './path.js';
3
+ import type { Path_Id, Resolved_Path } from './path.ts';
4
4
  export declare const Input_Path: z.ZodString;
5
5
  export type Input_Path = Flavored<z.infer<typeof Input_Path>, 'Input_Path'>;
6
6
  export declare const Raw_Input_Path: z.ZodString;
@@ -2,9 +2,9 @@ import { dirname, isAbsolute, join, resolve } from 'node:path';
2
2
  import { existsSync, statSync } from 'node:fs';
3
3
  import { strip_start } from '@ryanatkn/belt/string.js';
4
4
  import { z } from 'zod';
5
- import { GRO_PACKAGE_DIR, GRO_DIST_DIR } from './paths.js';
6
- import { search_fs } from './search_fs.js';
7
- import { TASK_FILE_SUFFIX_JS } from './task.js';
5
+ import { GRO_PACKAGE_DIR, GRO_DIST_DIR } from "./paths.js";
6
+ import { search_fs } from "./search_fs.js";
7
+ import { TASK_FILE_SUFFIX_JS } from "./task.js";
8
8
  // TODO Flavored doesn't work when used in schemas, use Zod brand instead? problem is ergonomics
9
9
  export const Input_Path = z.string();
10
10
  export const Raw_Input_Path = z.string();
package/dist/invoke.js CHANGED
@@ -2,10 +2,10 @@ import { attach_process_error_handlers } from '@ryanatkn/belt/process.js';
2
2
  import { configure_log_colors } from '@ryanatkn/belt/log.js';
3
3
  import { set_colors } from '@ryanatkn/belt/print.js';
4
4
  import { styleText } from 'node:util';
5
- import { invoke_task } from './invoke_task.js';
6
- import { to_task_args } from './args.js';
7
- import { load_gro_config } from './gro_config.js';
8
- import { sveltekit_sync_if_obviously_needed } from './sveltekit_helpers.js';
5
+ import { invoke_task } from "./invoke_task.js";
6
+ import { to_task_args } from "./args.js";
7
+ import { load_gro_config } from "./gro_config.js";
8
+ import { sveltekit_sync_if_obviously_needed } from "./sveltekit_helpers.js";
9
9
  /*
10
10
 
11
11
  This module invokes the Gro CLI which in turn invokes tasks.
@@ -1,8 +1,8 @@
1
1
  import { Timings } from '@ryanatkn/belt/timings.js';
2
- import { type Args } from './args.js';
3
- import { Raw_Input_Path } from './input_path.js';
4
- import type { Gro_Config } from './gro_config.js';
5
- import { Filer } from './filer.js';
2
+ import { type Args } from './args.ts';
3
+ import { Raw_Input_Path } from './input_path.ts';
4
+ import type { Gro_Config } from './gro_config.ts';
5
+ import { Filer } from './filer.ts';
6
6
  /**
7
7
  * Invokes Gro tasks by name using the filesystem as the source.
8
8
  *
@@ -2,13 +2,13 @@ import { styleText as st } from 'node:util';
2
2
  import { System_Logger } from '@ryanatkn/belt/log.js';
3
3
  import { create_stopwatch, Timings } from '@ryanatkn/belt/timings.js';
4
4
  import { print_ms, print_timings, print_log_label } from '@ryanatkn/belt/print.js';
5
- import { to_forwarded_args } from './args.js';
6
- import { run_task } from './run_task.js';
7
- import { to_input_path, Raw_Input_Path } from './input_path.js';
8
- import { find_tasks, load_tasks, Silent_Error } from './task.js';
9
- import { load_gro_package_json } from './package_json.js';
10
- import { log_tasks, log_error_reasons } from './task_logging.js';
11
- import { Filer } from './filer.js';
5
+ import { to_forwarded_args } from "./args.js";
6
+ import { run_task } from "./run_task.js";
7
+ import { to_input_path, Raw_Input_Path } from "./input_path.js";
8
+ import { find_tasks, load_tasks, Silent_Error } from "./task.js";
9
+ import { load_gro_package_json } from "./package_json.js";
10
+ import { log_tasks, log_error_reasons } from "./task_logging.js";
11
+ import { Filer } from "./filer.js";
12
12
  /**
13
13
  * Invokes Gro tasks by name using the filesystem as the source.
14
14
  *
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { type Task } from './task.js';
2
+ import { type Task } from './task.ts';
3
3
  export declare const Args: z.ZodObject<{
4
4
  _: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5
5
  eslint_cli: z.ZodDefault<z.ZodString>;
package/dist/lint.task.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { print_spawn_result } from '@ryanatkn/belt/process.js';
2
2
  import { z } from 'zod';
3
- import { Task_Error } from './task.js';
4
- import { serialize_args, to_forwarded_args } from './args.js';
5
- import { find_cli, spawn_cli } from './cli.js';
3
+ import { Task_Error } from "./task.js";
4
+ import { serialize_args, to_forwarded_args } from "./args.js";
5
+ import { find_cli, spawn_cli } from "./cli.js";
6
6
  const ESLINT_CLI = 'eslint';
7
7
  export const Args = z
8
8
  .object({
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AA8EvD,eAAO,MAAM,IAAI,EAAE,QAwFlB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAoDrB,CAAC"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAuEvD,eAAO,MAAM,IAAI,EAAE,QA0GlB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAqDrB,CAAC"}
package/dist/loader.js CHANGED
@@ -1,18 +1,17 @@
1
- import * as esbuild from 'esbuild';
2
1
  import { compile, compileModule, preprocess } from 'svelte/compiler';
3
2
  import { fileURLToPath, pathToFileURL } from 'node:url';
4
3
  import { dirname, join } from 'node:path';
5
4
  import { escape_regexp } from '@ryanatkn/belt/regexp.js';
6
5
  import { readFileSync } from 'node:fs';
7
- import { render_env_shim_module } from './sveltekit_shim_env.js';
8
- import { render_sveltekit_shim_app_environment, render_sveltekit_shim_app_paths, SVELTEKIT_SHIM_APP_ENVIRONMENT_MATCHER, SVELTEKIT_SHIM_APP_PATHS_MATCHER, sveltekit_shim_app_specifiers, } from './sveltekit_shim_app.js';
9
- import { default_svelte_config } from './svelte_config.js';
10
- import { SVELTE_MATCHER, SVELTE_RUNES_MATCHER } from './svelte_helpers.js';
11
- import { IS_THIS_GRO, paths } from './paths.js';
12
- import { JSON_MATCHER, NODE_MODULES_DIRNAME, TS_MATCHER } from './constants.js';
13
- import { to_define_import_meta_env, default_ts_transform_options } from './esbuild_helpers.js';
14
- import { resolve_specifier } from './resolve_specifier.js';
15
- import { map_sveltekit_aliases } from './sveltekit_helpers.js';
6
+ import ts_blank_space from 'ts-blank-space';
7
+ import { render_env_shim_module } from "./sveltekit_shim_env.js";
8
+ import { render_sveltekit_shim_app_environment, render_sveltekit_shim_app_paths, SVELTEKIT_SHIM_APP_ENVIRONMENT_MATCHER, SVELTEKIT_SHIM_APP_PATHS_MATCHER, sveltekit_shim_app_specifiers, } from "./sveltekit_shim_app.js";
9
+ import { default_svelte_config } from "./svelte_config.js";
10
+ import { SVELTE_MATCHER, SVELTE_RUNES_MATCHER } from "./svelte_helpers.js";
11
+ import { IS_THIS_GRO, paths } from "./paths.js";
12
+ import { NODE_MODULES_DIRNAME, TS_MATCHER } from "./constants.js";
13
+ import { resolve_specifier } from "./resolve_specifier.js";
14
+ import { map_sveltekit_aliases } from "./sveltekit_helpers.js";
16
15
  // TODO get out of the loader business, starting with https://nodejs.org/api/typescript.html#type-stripping
17
16
  /*
18
17
 
@@ -31,7 +30,7 @@ gro run foo.ts
31
30
  Direct usage without register (see also `$lib/gro.ts`):
32
31
 
33
32
  ```bash
34
- node --import 'data:text/javascript,import {register} from "node:module"; import {pathToFileURL} from "node:url"; register("@ryanatkn/gro/loader.js", pathToFileURL("./"));' --experimental-import-meta-resolve --enable-source-maps' foo.ts
33
+ node --import 'data:text/javascript,import {register} from "node:module"; import {pathToFileURL} from "node:url"; register("@ryanatkn/gro/loader.js", pathToFileURL("./"));' --experimental-import-meta-resolve --experimental-strip-types' foo.ts
35
34
  ```
36
35
 
37
36
  TODO how to improve that gnarly import line? was originally designed for the now-deprecated `--loader`
@@ -43,16 +42,11 @@ TODO how to improve that gnarly import line? was originally designed for the now
43
42
  const dev = true;
44
43
  const dir = paths.root;
45
44
  const { alias, base_url, assets_url, env_dir, private_prefix, public_prefix, svelte_compile_options, svelte_compile_module_options, svelte_preprocessors, } = default_svelte_config;
46
- const ts_transform_options = {
47
- ...default_ts_transform_options,
48
- define: to_define_import_meta_env(dev, base_url),
49
- sourcemap: 'inline',
50
- };
51
45
  const aliases = Object.entries(alias);
52
46
  const RAW_MATCHER = /(%3Fraw|\.css|\.svg)$/; // TODO others? configurable?
53
- const ENV_MATCHER = /src\/lib\/\$env\/(static|dynamic)\/(public|private)$/;
54
47
  const NODE_MODULES_MATCHER = new RegExp(escape_regexp('/' + NODE_MODULES_DIRNAME + '/'), 'u');
55
48
  export const load = async (url, context, nextLoad) => {
49
+ // console.log(`url`, url);
56
50
  if (SVELTEKIT_SHIM_APP_PATHS_MATCHER.test(url)) {
57
51
  // SvelteKit `$app/paths` shim
58
52
  return {
@@ -70,26 +64,28 @@ export const load = async (url, context, nextLoad) => {
70
64
  };
71
65
  }
72
66
  else if (SVELTE_RUNES_MATCHER.test(url)) {
73
- // Svelte runes in js/ts
74
- const loaded = await nextLoad(url, context.format === 'module' ? context : { ...context, format: 'module' });
67
+ // Svelte runes in js/ts, `.svelte.ts`
75
68
  const filename = fileURLToPath(url);
76
- const source = loaded.source.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string
77
- const js_source = TS_MATCHER.test(url)
78
- ? (await esbuild.transform(source, { ...ts_transform_options, sourcefile: url })).code // TODO @many use warnings? handle not-inline sourcemaps?
79
- : source;
80
- const transformed = compileModule(js_source, { ...svelte_compile_module_options, dev, filename });
69
+ const loaded = await nextLoad(url, { ...context, format: 'module-typescript' });
70
+ const raw_source = loaded.source?.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string
71
+ if (raw_source == null)
72
+ throw Error(`Failed to load ${url}`);
73
+ // TODO should be nice if we could use Node's builtin amaro transform, but I couldn't find a way after digging into the source, AFAICT it's internal and not exposed
74
+ const source = ts_blank_space(raw_source); // TODO was using oxc-transform and probably should, but this doesn't require sourcemaps, and it's still alpha as of May 2025
75
+ const transformed = compileModule(source, {
76
+ ...svelte_compile_module_options,
77
+ dev,
78
+ filename,
79
+ });
81
80
  return { format: 'module', shortCircuit: true, source: transformed.js.code };
82
81
  }
83
82
  else if (TS_MATCHER.test(url)) {
84
- // ts
85
- const loaded = await nextLoad(url, context.format === 'module' ? context : { ...context, format: 'module' });
86
- const source = loaded.source.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string
87
- const transformed = await esbuild.transform(source, { ...ts_transform_options, sourcefile: url }); // TODO @many use warnings? handle not-inline sourcemaps?
88
- return { format: 'module', shortCircuit: true, source: transformed.code };
83
+ // ts but not `.svelte.ts`
84
+ return nextLoad(url, { ...context, format: 'module-typescript' });
89
85
  }
90
86
  else if (SVELTE_MATCHER.test(url)) {
91
- // Svelte
92
- const loaded = await nextLoad(url, context.format === 'module' ? context : { ...context, format: 'module' });
87
+ // Svelte, `.svelte`
88
+ const loaded = await nextLoad(url, { ...context, format: 'module' });
93
89
  const raw_source = loaded.source.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string
94
90
  const filename = fileURLToPath(url);
95
91
  const preprocessed = svelte_preprocessors // TODO @many use sourcemaps (and diagnostics?)
@@ -99,11 +95,15 @@ export const load = async (url, context, nextLoad) => {
99
95
  const transformed = compile(source, { ...svelte_compile_options, dev, filename });
100
96
  return { format: 'module', shortCircuit: true, source: transformed.js.code };
101
97
  }
102
- else if (JSON_MATCHER.test(url)) {
103
- // json
104
- // TODO probably follow esbuild and also export every top-level property for objects from the module - https://esbuild.github.io/content-types/#json (type generation?)
105
- const loaded = await nextLoad(url);
106
- const raw_source = loaded.source.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string
98
+ else if (context.importAttributes.type === 'json') {
99
+ // json - any file extension
100
+ // TODO probably follow esbuild and also export every top-level property for objects from the module for good treeshaking - https://esbuild.github.io/content-types/#json (type generation?)
101
+ // TODO why is removing the importAttributes needed? can't pass no context either -
102
+ // error: `Module "file:///home/user/dev/repo/foo.json" is not of type "json"`
103
+ const loaded = await nextLoad(url, { ...context, importAttributes: undefined });
104
+ const raw_source = loaded.source?.toString(); // eslint-disable-line @typescript-eslint/no-base-to-string
105
+ if (raw_source == null)
106
+ throw Error(`Failed to load ${url}`);
107
107
  const source = `export default ` + raw_source;
108
108
  return { format: 'module', shortCircuit: true, source };
109
109
  }
@@ -115,16 +115,38 @@ export const load = async (url, context, nextLoad) => {
115
115
  return { format: 'module', shortCircuit: true, source };
116
116
  }
117
117
  else {
118
- const matched_env = ENV_MATCHER.exec(url);
119
- if (matched_env) {
120
- // SvelteKit `$env`
121
- const mode = matched_env[1];
122
- const visibility = matched_env[2];
123
- return {
124
- format: 'module',
125
- shortCircuit: true,
126
- source: render_env_shim_module(dev, mode, visibility, public_prefix, private_prefix, env_dir),
127
- };
118
+ // SvelteKit `$env`
119
+ // TODO use `format` from the resolve hook to speed this up and make it simpler
120
+ if (context.format === 'sveltekit-env') {
121
+ let mode;
122
+ let visibility;
123
+ switch (context.importAttributes.virtual) {
124
+ case '$env/static/public': {
125
+ mode = 'static';
126
+ visibility = 'public';
127
+ break;
128
+ }
129
+ case '$env/static/private': {
130
+ mode = 'static';
131
+ visibility = 'private';
132
+ break;
133
+ }
134
+ case '$env/dynamic/public': {
135
+ mode = 'dynamic';
136
+ visibility = 'public';
137
+ break;
138
+ }
139
+ case '$env/dynamic/private': {
140
+ mode = 'dynamic';
141
+ visibility = 'private';
142
+ break;
143
+ }
144
+ default: {
145
+ throw Error(`Unknown $env import: ${context.importAttributes.virtual}`);
146
+ }
147
+ }
148
+ const source = render_env_shim_module(dev, mode, visibility, public_prefix, private_prefix, env_dir);
149
+ return { format: 'module', shortCircuit: true, source };
128
150
  }
129
151
  }
130
152
  // fallback to default behavior
@@ -141,7 +163,8 @@ export const resolve = async (specifier, context, nextResolve) => {
141
163
  // so we need a slightly roundabout strategy to pass through the specifier for virtual files.
142
164
  return {
143
165
  url: pathToFileURL(join(dir, 'src/lib', s)).href,
144
- format: 'module',
166
+ format: 'sveltekit-env',
167
+ importAttributes: { virtual: s }, // TODO idk I'm just making this up
145
168
  shortCircuit: true,
146
169
  };
147
170
  }
package/dist/module.js CHANGED
@@ -1,5 +1,5 @@
1
- import { LIB_DIRNAME } from './paths.js';
2
- import { SOURCE_DIR, SOURCE_DIRNAME } from './constants.js';
1
+ import { LIB_DIRNAME } from "./paths.js";
2
+ import { SOURCE_DIR, SOURCE_DIRNAME } from "./constants.js";
3
3
  export const MODULE_PATH_SRC_PREFIX = SOURCE_DIR;
4
4
  export const MODULE_PATH_LIB_PREFIX = `$${LIB_DIRNAME}/`;
5
5
  const INTERNAL_MODULE_MATCHER = new RegExp(`^(\\.?\\.?|${SOURCE_DIRNAME}|\\$${LIB_DIRNAME})\\/`, 'u');
package/dist/modules.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Timings } from '@ryanatkn/belt/timings.js';
2
2
  import type { Result } from '@ryanatkn/belt/result.js';
3
- import type { Resolved_Input_File } from './input_path.js';
4
- import type { Path_Id } from './path.js';
3
+ import type { Resolved_Input_File } from './input_path.ts';
4
+ import type { Path_Id } from './path.ts';
5
5
  export interface Module_Meta<T_Module extends Record<string, any> = Record<string, any>> {
6
6
  id: Path_Id;
7
7
  mod: T_Module;
package/dist/modules.js CHANGED
@@ -1,10 +1,18 @@
1
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
+ });
6
+ }
7
+ return path;
8
+ };
1
9
  import { Unreachable_Error } from '@ryanatkn/belt/error.js';
2
10
  import { print_error } from '@ryanatkn/belt/print.js';
3
- import { print_path } from './paths.js';
11
+ import { print_path } from "./paths.js";
4
12
  export const load_module = async (id, validate) => {
5
13
  let mod;
6
14
  try {
7
- mod = await import(id);
15
+ mod = await import(__rewriteRelativeImportExtension(id, true));
8
16
  }
9
17
  catch (err) {
10
18
  return { ok: false, type: 'failed_import', id, error: err };
package/dist/package.d.ts CHANGED
@@ -47,6 +47,7 @@ export declare const package_json: {
47
47
  'oxc-parser': string;
48
48
  prettier: string;
49
49
  'prettier-plugin-svelte': string;
50
+ 'ts-blank-space': string;
50
51
  'ts-morph': string;
51
52
  tslib: string;
52
53
  zod: string;
@@ -1 +1 @@
1
- {"version":3,"file":"package.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/package.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgQD,CAAC;AAEzB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuwBD,CAAC"}
1
+ {"version":3,"file":"package.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/package.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiQD,CAAC;AAEzB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAswBD,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Gen } from './gen.js';
1
+ import type { Gen } from './gen.ts';
2
2
  /**
3
3
  * A convenience `gen` file that outputs `$lib/package.ts`,
4
4
  * which mirrors `package.json` but in TypeScript,
@@ -1,6 +1,6 @@
1
- import { load_package_json } from './package_json.js';
2
- import { IS_THIS_GRO } from './paths.js';
3
- import { create_src_json } from './src_json.js';
1
+ import { load_package_json } from "./package_json.js";
2
+ import { IS_THIS_GRO } from "./paths.js";
3
+ import { create_src_json } from "./src_json.js";
4
4
  // TODO rename? `Package_Json + Src_Json = package.ts` currently, idk
5
5
  // TODO consider an api that uses magic imports like SvelteKit's `$app`, like `$repo/package.json`
6
6
  /**
@@ -14,8 +14,8 @@ export const gen = ({ origin_path }) => {
14
14
  return `
15
15
  // generated by ${origin_path}
16
16
 
17
- import type {Package_Json} from '${IS_THIS_GRO ? './package_json.js' : '@ryanatkn/gro/package_json.js'}';
18
- import type {Src_Json} from '${IS_THIS_GRO ? './src_json.js' : '@ryanatkn/gro/src_json.js'}';
17
+ import type {Package_Json} from '${IS_THIS_GRO ? './package_json.ts' : '@ryanatkn/gro/package_json.js'}';
18
+ import type {Src_Json} from '${IS_THIS_GRO ? './src_json.ts' : '@ryanatkn/gro/src_json.js'}';
19
19
 
20
20
  export const package_json = ${JSON.stringify(package_json)} satisfies Package_Json;
21
21