@ryanatkn/gro 0.117.0 → 0.119.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 (94) hide show
  1. package/README.md +37 -19
  2. package/dist/build.task.d.ts +3 -0
  3. package/dist/build.task.js +5 -1
  4. package/dist/changeset.task.d.ts +2 -2
  5. package/dist/changeset.task.js +10 -6
  6. package/dist/check.task.js +1 -1
  7. package/dist/clean_fs.js +2 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/config.js +3 -2
  10. package/dist/deploy.task.d.ts +0 -6
  11. package/dist/deploy.task.js +7 -11
  12. package/dist/dev.task.d.ts +2 -2
  13. package/dist/docs/gen.md +27 -0
  14. package/dist/docs/publish.md +1 -8
  15. package/dist/docs/task.md +7 -0
  16. package/dist/docs/tasks.gen.md.js +2 -3
  17. package/dist/docs/tasks.md +1 -0
  18. package/dist/esbuild_plugin_external_worker.js +1 -2
  19. package/dist/esbuild_plugin_svelte.js +1 -2
  20. package/dist/esbuild_plugin_sveltekit_shim_alias.js +1 -2
  21. package/dist/format_directory.d.ts +8 -2
  22. package/dist/format_directory.js +18 -12
  23. package/dist/gen.d.ts +19 -0
  24. package/dist/gen.js +45 -0
  25. package/dist/gen.task.js +19 -19
  26. package/dist/gen_module.d.ts +1 -14
  27. package/dist/gen_module.js +0 -22
  28. package/dist/git.d.ts +5 -0
  29. package/dist/git.js +15 -0
  30. package/dist/git.test.js +4 -1
  31. package/dist/gro.config.default.js +8 -11
  32. package/dist/gro_helpers.js +18 -17
  33. package/dist/gro_plugin_gen.js +1 -1
  34. package/dist/gro_plugin_server.d.ts +4 -1
  35. package/dist/gro_plugin_server.js +15 -6
  36. package/dist/gro_plugin_sveltekit_app.d.ts +0 -1
  37. package/dist/gro_plugin_sveltekit_app.js +2 -4
  38. package/dist/gro_plugin_sveltekit_library.d.ts +0 -2
  39. package/dist/gro_plugin_sveltekit_library.js +10 -11
  40. package/dist/index.d.ts +1 -1
  41. package/dist/index.js +0 -1
  42. package/dist/input_path.d.ts +1 -1
  43. package/dist/input_path.js +1 -1
  44. package/dist/input_path.test.js +3 -3
  45. package/dist/invoke.js +2 -0
  46. package/dist/invoke_task.d.ts +1 -1
  47. package/dist/invoke_task.js +10 -11
  48. package/dist/lint.task.js +1 -1
  49. package/dist/loader.js +11 -4
  50. package/dist/module.d.ts +1 -1
  51. package/dist/module.js +2 -2
  52. package/dist/modules.test.js +2 -2
  53. package/dist/package.d.ts +52 -0
  54. package/dist/package.js +80 -36
  55. package/dist/package_json.d.ts +5 -0
  56. package/dist/package_json.js +8 -3
  57. package/dist/package_meta.d.ts +1 -2
  58. package/dist/path_constants.d.ts +21 -0
  59. package/dist/path_constants.js +28 -0
  60. package/dist/paths.d.ts +2 -26
  61. package/dist/paths.js +10 -33
  62. package/dist/publish.task.d.ts +9 -6
  63. package/dist/publish.task.js +26 -14
  64. package/dist/register.d.ts +1 -0
  65. package/dist/register.js +2 -0
  66. package/dist/reinstall.task.d.ts +5 -0
  67. package/dist/reinstall.task.js +32 -0
  68. package/dist/release.task.js +5 -7
  69. package/dist/resolve_node_specifier.js +2 -1
  70. package/dist/run.task.js +1 -1
  71. package/dist/run_gen.d.ts +2 -1
  72. package/dist/run_gen.js +2 -2
  73. package/dist/run_gen.test.js +3 -2
  74. package/dist/run_task.js +1 -1
  75. package/dist/sveltekit_config.d.ts +1 -1
  76. package/dist/sveltekit_config.js +9 -5
  77. package/dist/sveltekit_config_global.d.ts +4 -0
  78. package/dist/sveltekit_config_global.js +5 -0
  79. package/dist/sveltekit_helpers.d.ts +17 -0
  80. package/dist/sveltekit_helpers.js +54 -0
  81. package/dist/sync.task.d.ts +0 -1
  82. package/dist/sync.task.js +5 -11
  83. package/dist/task.d.ts +1 -1
  84. package/dist/task.js +11 -7
  85. package/dist/task.test.js +9 -13
  86. package/dist/task_logging.d.ts +2 -2
  87. package/dist/task_logging.js +29 -15
  88. package/dist/task_module.d.ts +3 -3
  89. package/dist/task_module.js +6 -6
  90. package/dist/task_module.test.js +4 -7
  91. package/dist/typecheck.task.js +1 -1
  92. package/dist/upgrade.task.d.ts +4 -1
  93. package/dist/upgrade.task.js +30 -5
  94. package/package.json +23 -3
@@ -36,17 +36,18 @@ export const invoke_task = async (task_name, args, config, timings = new Timings
36
36
  log.info(`🕒 ${print_ms(total_timing())}`);
37
37
  };
38
38
  // Check if the caller just wants to see the version.
39
- if (!task_name && (args.version || args.v)) {
39
+ if (!task_name && (args?.version || args?.v)) {
40
40
  const gro_package_json = await load_gro_package_json();
41
41
  log.info(`${gray('v')}${cyan(gro_package_json.version)}`);
42
- log.info(`🕒 ${print_ms(total_timing())}`);
42
+ finish();
43
43
  return;
44
44
  }
45
45
  // Resolve the input path for the provided task name.
46
46
  const input_path = to_input_path(task_name);
47
+ const { task_root_paths } = config;
47
48
  // Find the task or directory specified by the `input_path`.
48
49
  // Fall back to searching the Gro directory as well.
49
- const find_modules_result = await find_task_modules([input_path], config.task_root_paths);
50
+ const find_modules_result = await find_task_modules([input_path], task_root_paths);
50
51
  if (!find_modules_result.ok) {
51
52
  if (find_modules_result.type === 'input_directories_with_no_files') {
52
53
  // The input path matched a directory, but it contains no matching files.
@@ -60,8 +61,7 @@ export const invoke_task = async (task_name, args, config, timings = new Timings
60
61
  else {
61
62
  // If there's a matching directory in the current working directory,
62
63
  // but it has no matching files, we still want to search Gro's directory.
63
- const gro_dir_find_modules_result = await log_gro_package_tasks(input_path, log);
64
- // TODO this doesn't seem to be working as commented, test this condition in another repo (maybe like "gro sync" when there's a "src/lib/sync" folder)
64
+ const gro_dir_find_modules_result = await log_gro_package_tasks(input_path, task_root_paths, log);
65
65
  if (!gro_dir_find_modules_result.ok) {
66
66
  // Log the original errors, not the Gro-specific ones.
67
67
  log_error_reasons(log, find_modules_result.reasons);
@@ -83,7 +83,7 @@ export const invoke_task = async (task_name, args, config, timings = new Timings
83
83
  if (!path_data.isDirectory) {
84
84
  // The input path matches a file, so load and run it.
85
85
  // Try to load the task module.
86
- const load_modules_result = await load_modules(find_modules_result.source_ids_by_input_path, load_task_module);
86
+ const load_modules_result = await load_modules(find_modules_result.source_ids_by_input_path, (id) => load_task_module(id, task_root_paths));
87
87
  if (load_modules_result.ok) {
88
88
  // We found a task module. Run it!
89
89
  // `path_data` is not a directory, so there's a single task module here.
@@ -110,21 +110,20 @@ export const invoke_task = async (task_name, args, config, timings = new Timings
110
110
  // The input path matches a directory. Log the tasks but don't run them.
111
111
  if (IS_THIS_GRO) {
112
112
  // Is the Gro directory the same as the cwd? Log the matching files.
113
- await log_tasks(log, print_path(path_data.id), find_modules_result.source_ids_by_input_path);
113
+ await log_tasks(log, print_path(path_data.id), find_modules_result.source_ids_by_input_path, task_root_paths);
114
114
  }
115
115
  else if (is_gro_id(path_data.id)) {
116
- // TODO delete this? merge behavior with the block above/below?
117
116
  // Does the Gro directory contain the matching files? Log them.
118
- await log_tasks(log, print_path_or_gro_path(path_data.id), find_modules_result.source_ids_by_input_path);
117
+ await log_tasks(log, print_path_or_gro_path(path_data.id), find_modules_result.source_ids_by_input_path, task_root_paths);
119
118
  }
120
119
  else {
121
120
  // The Gro directory is not the same as the cwd and it doesn't contain the matching files.
122
121
  // Find all of the possible matches in both the current project and the Gro directory,
123
122
  // and log everything out.
124
123
  // Ignore any errors - the directory may not exist or have any files!
125
- const gro_dir_find_modules_result = await log_gro_package_tasks(input_path, log);
124
+ const gro_dir_find_modules_result = await log_gro_package_tasks(input_path, task_root_paths, log);
126
125
  // Then log the current working directory matches.
127
- await log_tasks(log, print_path(path_data.id), find_modules_result.source_ids_by_input_path, !gro_dir_find_modules_result.ok);
126
+ await log_tasks(log, print_path(path_data.id), find_modules_result.source_ids_by_input_path, task_root_paths, !gro_dir_find_modules_result.ok);
128
127
  }
129
128
  }
130
129
  finish();
package/dist/lint.task.js CHANGED
@@ -2,7 +2,7 @@ import { print_spawn_result } from '@ryanatkn/belt/process.js';
2
2
  import { z } from 'zod';
3
3
  import { Task_Error } from './task.js';
4
4
  import { print_command_args, serialize_args, to_forwarded_args } from './args.js';
5
- import { SOURCE_DIRNAME } from './paths.js';
5
+ import { SOURCE_DIRNAME } from './path_constants.js';
6
6
  import { find_cli, spawn_cli } from './cli.js';
7
7
  export const Args = z
8
8
  .object({
package/dist/loader.js CHANGED
@@ -5,21 +5,28 @@ import { dirname, join } from 'node:path';
5
5
  import { escape_regexp } from '@ryanatkn/belt/regexp.js';
6
6
  import { render_env_shim_module } from './sveltekit_shim_env.js';
7
7
  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';
8
- import { init_sveltekit_config } from './sveltekit_config.js';
8
+ import { sveltekit_config_global } from './sveltekit_config_global.js';
9
9
  import { SVELTE_MATCHER, SVELTE_RUNES_MATCHER } from './svelte_helpers.js';
10
- import { paths, NODE_MODULES_DIRNAME } from './paths.js';
10
+ import { paths } from './paths.js';
11
+ import { NODE_MODULES_DIRNAME } from './path_constants.js';
11
12
  import { to_define_import_meta_env, ts_transform_options } from './esbuild_helpers.js';
12
13
  import { resolve_specifier } from './resolve_specifier.js';
13
14
  import { resolve_node_specifier } from './resolve_node_specifier.js';
14
15
  /*
15
16
 
17
+ Usage via `$lib/register.ts`:
18
+
19
+ ```bash
20
+ node --import @ryanatkn/gro/register.js foo.ts
21
+ ```
22
+
16
23
  Usage via `$lib/run.task.ts`:
17
24
 
18
25
  ```bash
19
26
  gro run foo.ts
20
27
  ```
21
28
 
22
- Direct usage (see also `$lib/gro.ts`):
29
+ Direct usage without register (see also `$lib/gro.ts`):
23
30
 
24
31
  ```bash
25
32
  node --import 'data:text/javascript,import {register} from "node:module"; import {pathToFileURL} from "node:url"; register("@ryanatkn/gro/loader.js", pathToFileURL("./"));' --enable-source-maps' foo.ts
@@ -34,7 +41,7 @@ TODO how to improve that gnarly import line? was originally designed for the now
34
41
  // dev is always true in the loader
35
42
  const dev = true;
36
43
  const dir = paths.root;
37
- const { alias, base_url, assets_url, env_dir, private_prefix, public_prefix, svelte_compile_options, svelte_compile_module_options, svelte_preprocessors, } = await init_sveltekit_config(dir); // always load it to keep things simple ahead
44
+ const { alias, base_url, assets_url, env_dir, private_prefix, public_prefix, svelte_compile_options, svelte_compile_module_options, svelte_preprocessors, } = sveltekit_config_global;
38
45
  const final_ts_transform_options = {
39
46
  ...ts_transform_options,
40
47
  define: to_define_import_meta_env(dev, base_url),
package/dist/module.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const MODULE_PATH_SRC_PREFIX: string;
2
- export declare const MODULE_PATH_LIB_PREFIX = "$lib/";
2
+ export declare const MODULE_PATH_LIB_PREFIX: string;
3
3
  export declare const is_external_module: (module_name: string) => boolean;
package/dist/module.js CHANGED
@@ -1,5 +1,5 @@
1
- // TODO refactor to be configurable, probably following Rollup's patterns
2
- import { SOURCE_DIR, SOURCE_DIRNAME, LIB_DIRNAME } from './paths.js';
1
+ import { LIB_DIRNAME } from './paths.js';
2
+ import { SOURCE_DIR, SOURCE_DIRNAME } from './path_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');
@@ -69,7 +69,7 @@ test__find_modules('with and without extension', async () => {
69
69
  const path1 = resolve('src/fixtures/test1');
70
70
  const id1 = resolve('src/fixtures/test1.foo.ts');
71
71
  const id2 = resolve('src/fixtures/test2.foo.ts');
72
- const result = await find_modules([path1, id2], (id) => search_fs(id, { files_only: false }), (input_path) => get_possible_source_ids(input_path, ['.foo.ts']));
72
+ const result = await find_modules([path1, id2], (id) => search_fs(id, { files_only: false }), (input_path) => get_possible_source_ids(input_path, ['.foo.ts'], []));
73
73
  assert.ok(result.ok);
74
74
  assert.equal(result.source_ids_by_input_path, new Map([
75
75
  [path1, [id1]],
@@ -93,7 +93,7 @@ test__find_modules('fail with unmapped_input_paths', async () => {
93
93
  resolve('src/fixtures/failme1'),
94
94
  resolve('src/fixtures/bar2'),
95
95
  resolve('src/fixtures/failme2'),
96
- ], (id) => search_fs(id, { files_only: false }), (input_path) => get_possible_source_ids(input_path, ['.foo.ts']));
96
+ ], (id) => search_fs(id, { files_only: false }), (input_path) => get_possible_source_ids(input_path, ['.foo.ts'], []));
97
97
  assert.ok(!result.ok);
98
98
  assert.ok(result.reasons.length);
99
99
  if (result.type === 'unmapped_input_paths') {
package/dist/package.d.ts CHANGED
@@ -290,6 +290,10 @@ export declare const package_json: {
290
290
  default: string;
291
291
  types: string;
292
292
  };
293
+ './path_constants.js': {
294
+ default: string;
295
+ types: string;
296
+ };
293
297
  './path.js': {
294
298
  default: string;
295
299
  types: string;
@@ -306,6 +310,14 @@ export declare const package_json: {
306
310
  default: string;
307
311
  types: string;
308
312
  };
313
+ './register.js': {
314
+ default: string;
315
+ types: string;
316
+ };
317
+ './reinstall.task.js': {
318
+ default: string;
319
+ types: string;
320
+ };
309
321
  './release.task.js': {
310
322
  default: string;
311
323
  types: string;
@@ -342,10 +354,18 @@ export declare const package_json: {
342
354
  default: string;
343
355
  types: string;
344
356
  };
357
+ './sveltekit_config_global.js': {
358
+ default: string;
359
+ types: string;
360
+ };
345
361
  './sveltekit_config.js': {
346
362
  default: string;
347
363
  types: string;
348
364
  };
365
+ './sveltekit_helpers.js': {
366
+ default: string;
367
+ types: string;
368
+ };
349
369
  './sveltekit_shim_app_environment.js': {
350
370
  default: string;
351
371
  types: string;
@@ -754,6 +774,13 @@ export declare const src_json: {
754
774
  kind: string;
755
775
  }[];
756
776
  };
777
+ './path_constants.js': {
778
+ path: string;
779
+ declarations: {
780
+ name: string;
781
+ kind: string;
782
+ }[];
783
+ };
757
784
  './path.js': {
758
785
  path: string;
759
786
  declarations: {
@@ -782,6 +809,17 @@ export declare const src_json: {
782
809
  kind: string;
783
810
  }[];
784
811
  };
812
+ './register.js': {
813
+ path: string;
814
+ declarations: never[];
815
+ };
816
+ './reinstall.task.js': {
817
+ path: string;
818
+ declarations: {
819
+ name: string;
820
+ kind: string;
821
+ }[];
822
+ };
785
823
  './release.task.js': {
786
824
  path: string;
787
825
  declarations: {
@@ -845,6 +883,13 @@ export declare const src_json: {
845
883
  kind: string;
846
884
  }[];
847
885
  };
886
+ './sveltekit_config_global.js': {
887
+ path: string;
888
+ declarations: {
889
+ name: string;
890
+ kind: string;
891
+ }[];
892
+ };
848
893
  './sveltekit_config.js': {
849
894
  path: string;
850
895
  declarations: {
@@ -852,6 +897,13 @@ export declare const src_json: {
852
897
  kind: string;
853
898
  }[];
854
899
  };
900
+ './sveltekit_helpers.js': {
901
+ path: string;
902
+ declarations: {
903
+ name: string;
904
+ kind: string;
905
+ }[];
906
+ };
855
907
  './sveltekit_shim_app_environment.js': {
856
908
  path: string;
857
909
  declarations: {
package/dist/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // generated by src/lib/package.gen.ts
2
2
  export const package_json = {
3
3
  name: '@ryanatkn/gro',
4
- version: '0.117.0',
4
+ version: '0.119.0',
5
5
  description: 'task runner and toolkit extending SvelteKit',
6
6
  motto: 'generate, run, optimize',
7
7
  icon: '🌰',
@@ -54,7 +54,7 @@ export const package_json = {
54
54
  '@ryanatkn/fuz': '^0.102.1',
55
55
  '@ryanatkn/moss': '^0.4.0',
56
56
  '@sveltejs/adapter-static': '^3.0.2',
57
- '@sveltejs/kit': '^2.5.13',
57
+ '@sveltejs/kit': '^2.5.16',
58
58
  '@sveltejs/package': '^2.3.2',
59
59
  '@sveltejs/vite-plugin-svelte': '^3.1.1',
60
60
  '@types/fs-extra': '^11.0.4',
@@ -63,7 +63,7 @@ export const package_json = {
63
63
  '@typescript-eslint/parser': '^7.13.0',
64
64
  esbuild: '^0.20.2',
65
65
  eslint: '^8.57.0',
66
- 'eslint-plugin-svelte': '^2.39.3',
66
+ 'eslint-plugin-svelte': '^2.39.4',
67
67
  svelte: '^5.0.0-next.155',
68
68
  'svelte-check': '^3.8.0',
69
69
  typescript: '^5.4.5',
@@ -171,10 +171,19 @@ export const package_json = {
171
171
  './package_meta.js': { default: './dist/package_meta.js', types: './dist/package_meta.d.ts' },
172
172
  './package.gen.js': { default: './dist/package.gen.js', types: './dist/package.gen.d.ts' },
173
173
  './package.js': { default: './dist/package.js', types: './dist/package.d.ts' },
174
+ './path_constants.js': {
175
+ default: './dist/path_constants.js',
176
+ types: './dist/path_constants.d.ts',
177
+ },
174
178
  './path.js': { default: './dist/path.js', types: './dist/path.d.ts' },
175
179
  './paths.js': { default: './dist/paths.js', types: './dist/paths.d.ts' },
176
180
  './plugin.js': { default: './dist/plugin.js', types: './dist/plugin.d.ts' },
177
181
  './publish.task.js': { default: './dist/publish.task.js', types: './dist/publish.task.d.ts' },
182
+ './register.js': { default: './dist/register.js', types: './dist/register.d.ts' },
183
+ './reinstall.task.js': {
184
+ default: './dist/reinstall.task.js',
185
+ types: './dist/reinstall.task.d.ts',
186
+ },
178
187
  './release.task.js': { default: './dist/release.task.js', types: './dist/release.task.d.ts' },
179
188
  './resolve_node_specifier.js': {
180
189
  default: './dist/resolve_node_specifier.js',
@@ -193,10 +202,18 @@ export const package_json = {
193
202
  default: './dist/svelte_helpers.js',
194
203
  types: './dist/svelte_helpers.d.ts',
195
204
  },
205
+ './sveltekit_config_global.js': {
206
+ default: './dist/sveltekit_config_global.js',
207
+ types: './dist/sveltekit_config_global.d.ts',
208
+ },
196
209
  './sveltekit_config.js': {
197
210
  default: './dist/sveltekit_config.js',
198
211
  types: './dist/sveltekit_config.d.ts',
199
212
  },
213
+ './sveltekit_helpers.js': {
214
+ default: './dist/sveltekit_helpers.js',
215
+ types: './dist/sveltekit_helpers.d.ts',
216
+ },
200
217
  './sveltekit_shim_app_environment.js': {
201
218
  default: './dist/sveltekit_shim_app_environment.js',
202
219
  types: './dist/sveltekit_shim_app_environment.d.ts',
@@ -241,7 +258,7 @@ export const package_json = {
241
258
  };
242
259
  export const src_json = {
243
260
  name: '@ryanatkn/gro',
244
- version: '0.117.0',
261
+ version: '0.119.0',
245
262
  modules: {
246
263
  '.': {
247
264
  path: 'index.ts',
@@ -441,9 +458,6 @@ export const src_json = {
441
458
  { name: 'Gen_Module_Meta', kind: 'type' },
442
459
  { name: 'Basic_Gen_Module_Meta', kind: 'type' },
443
460
  { name: 'load_gen_module', kind: 'function' },
444
- { name: 'Check_Gen_Module_Result', kind: 'type' },
445
- { name: 'check_gen_modules', kind: 'function' },
446
- { name: 'check_gen_module', kind: 'function' },
447
461
  { name: 'find_gen_modules', kind: 'function' },
448
462
  ],
449
463
  },
@@ -470,6 +484,10 @@ export const src_json = {
470
484
  { name: 'Gen_Module_Result_Failure', kind: 'type' },
471
485
  { name: 'to_gen_result', kind: 'function' },
472
486
  { name: 'to_output_file_name', kind: 'function' },
487
+ { name: 'Analyzed_Gen_Result', kind: 'type' },
488
+ { name: 'analyze_gen_results', kind: 'function' },
489
+ { name: 'analyze_gen_result', kind: 'function' },
490
+ { name: 'write_gen_results', kind: 'function' },
473
491
  ],
474
492
  },
475
493
  './git.js': {
@@ -481,6 +499,7 @@ export const src_json = {
481
499
  { name: 'git_remote_branch_exists', kind: 'function' },
482
500
  { name: 'git_local_branch_exists', kind: 'function' },
483
501
  { name: 'git_check_clean_workspace', kind: 'function' },
502
+ { name: 'git_check_fully_staged_workspace', kind: 'function' },
484
503
  { name: 'git_fetch', kind: 'function' },
485
504
  { name: 'git_checkout', kind: 'function' },
486
505
  { name: 'git_pull', kind: 'function' },
@@ -530,7 +549,6 @@ export const src_json = {
530
549
  './gro_plugin_sveltekit_app.js': {
531
550
  path: 'gro_plugin_sveltekit_app.ts',
532
551
  declarations: [
533
- { name: 'has_sveltekit_app', kind: 'function' },
534
552
  { name: 'Options', kind: 'type' },
535
553
  { name: 'Host_Target', kind: 'type' },
536
554
  { name: 'Copy_File_Filter', kind: 'type' },
@@ -539,10 +557,7 @@ export const src_json = {
539
557
  },
540
558
  './gro_plugin_sveltekit_library.js': {
541
559
  path: 'gro_plugin_sveltekit_library.ts',
542
- declarations: [
543
- { name: 'has_sveltekit_library', kind: 'function' },
544
- { name: 'gro_plugin_sveltekit_library', kind: 'function' },
545
- ],
560
+ declarations: [{ name: 'gro_plugin_sveltekit_library', kind: 'function' }],
546
561
  },
547
562
  './gro.config.default.js': {
548
563
  path: 'gro.config.default.ts',
@@ -600,6 +615,8 @@ export const src_json = {
600
615
  './package_json.js': {
601
616
  path: 'package_json.ts',
602
617
  declarations: [
618
+ { name: 'Url', kind: 'variable' },
619
+ { name: 'Email', kind: 'variable' },
603
620
  { name: 'transform_empty_object_to_undefined', kind: 'function' },
604
621
  { name: 'Package_Json_Repository', kind: 'variable' },
605
622
  { name: 'Package_Json_Author', kind: 'variable' },
@@ -635,50 +652,54 @@ export const src_json = {
635
652
  { name: 'src_json', kind: 'variable' },
636
653
  ],
637
654
  },
638
- './path.js': {
639
- path: 'path.ts',
640
- declarations: [
641
- { name: 'Input_Path', kind: 'variable' },
642
- { name: 'Raw_Input_Path', kind: 'variable' },
643
- { name: 'to_input_path', kind: 'function' },
644
- { name: 'to_input_paths', kind: 'function' },
645
- { name: 'get_possible_source_ids', kind: 'function' },
646
- { name: 'load_source_path_data_by_input_path', kind: 'function' },
647
- { name: 'load_source_ids_by_input_path', kind: 'function' },
648
- { name: 'to_gro_input_path', kind: 'function' },
649
- ],
650
- },
651
- './paths.js': {
652
- path: 'paths.ts',
655
+ './path_constants.js': {
656
+ path: 'path_constants.ts',
653
657
  declarations: [
654
658
  { name: 'SOURCE_DIRNAME', kind: 'variable' },
655
659
  { name: 'GRO_DIRNAME', kind: 'variable' },
656
660
  { name: 'GRO_DIST_PREFIX', kind: 'variable' },
657
661
  { name: 'SERVER_DIST_PATH', kind: 'variable' },
658
- { name: 'LIB_DIRNAME', kind: 'variable' },
659
- { name: 'ROUTES_DIRNAME', kind: 'variable' },
660
662
  { name: 'GRO_DEV_DIRNAME', kind: 'variable' },
661
663
  { name: 'SOURCE_DIR', kind: 'variable' },
662
664
  { name: 'GRO_DIR', kind: 'variable' },
663
665
  { name: 'GRO_DEV_DIR', kind: 'variable' },
664
- { name: 'LIB_PATH', kind: 'variable' },
665
- { name: 'LIB_DIR', kind: 'variable' },
666
- { name: 'CONFIG_PATH', kind: 'variable' },
666
+ { name: 'GRO_CONFIG_PATH', kind: 'variable' },
667
667
  { name: 'README_FILENAME', kind: 'variable' },
668
668
  { name: 'SVELTEKIT_CONFIG_FILENAME', kind: 'variable' },
669
669
  { name: 'VITE_CONFIG_FILENAME', kind: 'variable' },
670
+ { name: 'NODE_MODULES_DIRNAME', kind: 'variable' },
671
+ { name: 'LOCKFILE_FILENAME', kind: 'variable' },
670
672
  { name: 'SVELTEKIT_DEV_DIRNAME', kind: 'variable' },
671
673
  { name: 'SVELTEKIT_BUILD_DIRNAME', kind: 'variable' },
672
674
  { name: 'SVELTEKIT_DIST_DIRNAME', kind: 'variable' },
673
- { name: 'NODE_MODULES_DIRNAME', kind: 'variable' },
674
675
  { name: 'SVELTEKIT_VITE_CACHE_PATH', kind: 'variable' },
675
676
  { name: 'GITHUB_DIRNAME', kind: 'variable' },
676
677
  { name: 'GIT_DIRNAME', kind: 'variable' },
677
678
  { name: 'TSCONFIG_FILENAME', kind: 'variable' },
679
+ ],
680
+ },
681
+ './path.js': {
682
+ path: 'path.ts',
683
+ declarations: [
684
+ { name: 'Input_Path', kind: 'variable' },
685
+ { name: 'Raw_Input_Path', kind: 'variable' },
686
+ { name: 'to_input_path', kind: 'function' },
687
+ { name: 'to_input_paths', kind: 'function' },
688
+ { name: 'get_possible_source_ids', kind: 'function' },
689
+ { name: 'load_source_path_data_by_input_path', kind: 'function' },
690
+ { name: 'load_source_ids_by_input_path', kind: 'function' },
691
+ { name: 'to_gro_input_path', kind: 'function' },
692
+ ],
693
+ },
694
+ './paths.js': {
695
+ path: 'paths.ts',
696
+ declarations: [
697
+ { name: 'LIB_DIRNAME', kind: 'variable' },
698
+ { name: 'LIB_PATH', kind: 'variable' },
699
+ { name: 'LIB_DIR', kind: 'variable' },
700
+ { name: 'ROUTES_DIRNAME', kind: 'variable' },
678
701
  { name: 'Paths', kind: 'type' },
679
702
  { name: 'Source_Id', kind: 'variable' },
680
- { name: 'Url', kind: 'variable' },
681
- { name: 'Email', kind: 'variable' },
682
703
  { name: 'create_paths', kind: 'function' },
683
704
  { name: 'paths_from_id', kind: 'function' },
684
705
  { name: 'is_gro_id', kind: 'function' },
@@ -713,6 +734,14 @@ export const src_json = {
713
734
  { name: 'task', kind: 'variable' },
714
735
  ],
715
736
  },
737
+ './register.js': { path: 'register.ts', declarations: [] },
738
+ './reinstall.task.js': {
739
+ path: 'reinstall.task.ts',
740
+ declarations: [
741
+ { name: 'Args', kind: 'variable' },
742
+ { name: 'task', kind: 'variable' },
743
+ ],
744
+ },
716
745
  './release.task.js': {
717
746
  path: 'release.task.ts',
718
747
  declarations: [
@@ -784,6 +813,10 @@ export const src_json = {
784
813
  { name: 'SVELTE_RUNES_MATCHER', kind: 'variable' },
785
814
  ],
786
815
  },
816
+ './sveltekit_config_global.js': {
817
+ path: 'sveltekit_config_global.ts',
818
+ declarations: [{ name: 'sveltekit_config_global', kind: 'variable' }],
819
+ },
787
820
  './sveltekit_config.js': {
788
821
  path: 'sveltekit_config.ts',
789
822
  declarations: [
@@ -792,6 +825,18 @@ export const src_json = {
792
825
  { name: 'init_sveltekit_config', kind: 'function' },
793
826
  ],
794
827
  },
828
+ './sveltekit_helpers.js': {
829
+ path: 'sveltekit_helpers.ts',
830
+ declarations: [
831
+ { name: 'SVELTEKIT_CLI', kind: 'variable' },
832
+ { name: 'SVELTE_PACKAGE_CLI', kind: 'variable' },
833
+ { name: 'SVELTE_PACKAGE_DEP_NAME', kind: 'variable' },
834
+ { name: 'has_sveltekit_app', kind: 'function' },
835
+ { name: 'has_sveltekit_library', kind: 'function' },
836
+ { name: 'sveltekit_sync', kind: 'function' },
837
+ { name: 'sveltekit_sync_if_obviously_needed', kind: 'function' },
838
+ ],
839
+ },
795
840
  './sveltekit_shim_app_environment.js': {
796
841
  path: 'sveltekit_shim_app_environment.ts',
797
842
  declarations: [
@@ -858,7 +903,6 @@ export const src_json = {
858
903
  declarations: [
859
904
  { name: 'Args', kind: 'variable' },
860
905
  { name: 'task', kind: 'variable' },
861
- { name: 'sveltekit_sync', kind: 'function' },
862
906
  ],
863
907
  },
864
908
  './task_logging.js': {
@@ -1,4 +1,9 @@
1
1
  import { z } from 'zod';
2
+ import type { Flavored } from '@ryanatkn/belt/types.js';
3
+ export declare const Url: z.ZodString;
4
+ export type Url = Flavored<z.infer<typeof Url>, 'Url'>;
5
+ export declare const Email: z.ZodString;
6
+ export type Email = Flavored<z.infer<typeof Email>, 'Email'>;
2
7
  export declare const transform_empty_object_to_undefined: (val: any) => any;
3
8
  export declare const Package_Json_Repository: z.ZodUnion<[z.ZodString, z.ZodObject<{
4
9
  type: z.ZodString;
@@ -3,9 +3,14 @@ import { join } from 'node:path';
3
3
  import { readFile, writeFile } from 'node:fs/promises';
4
4
  import { plural } from '@ryanatkn/belt/string.js';
5
5
  import { strip_end } from '@ryanatkn/belt/string.js';
6
- import { paths, gro_paths, IS_THIS_GRO, replace_extension, SVELTEKIT_DIST_DIRNAME, Url, Email, } from './paths.js';
6
+ import { paths, gro_paths, IS_THIS_GRO, replace_extension } from './paths.js';
7
+ import { SVELTEKIT_DIST_DIRNAME } from './path_constants.js';
7
8
  import { search_fs } from './search_fs.js';
8
- import { has_sveltekit_library } from './gro_plugin_sveltekit_library.js';
9
+ import { has_sveltekit_library } from './sveltekit_helpers.js';
10
+ // TODO @multiple belongs elsewhere
11
+ export const Url = z.string();
12
+ // TODO @multiple belongs elsewhere
13
+ export const Email = z.string();
9
14
  // TODO move this where?
10
15
  export const transform_empty_object_to_undefined = (val) => {
11
16
  if (val && Object.keys(val).length === 0) {
@@ -107,7 +112,7 @@ export const sync_package_json = async (map_package_json, log, check = false, di
107
112
  const exported_files = await search_fs(exports_dir);
108
113
  const exported_paths = Array.from(exported_files.keys());
109
114
  const updated = await update_package_json(dir, async (package_json) => {
110
- if (await has_sveltekit_library(package_json)) {
115
+ if ((await has_sveltekit_library(package_json)).ok) {
111
116
  const exports = to_package_exports(exported_paths);
112
117
  package_json.exports = exports;
113
118
  }
@@ -1,6 +1,5 @@
1
- import type { Package_Json } from './package_json.js';
1
+ import type { Package_Json, Url } from './package_json.js';
2
2
  import type { Src_Json } from './src_json.js';
3
- import type { Url } from './paths.js';
4
3
  export interface Package_Meta {
5
4
  url: Url;
6
5
  package_json: Package_Json;
@@ -0,0 +1,21 @@
1
+ export declare const SOURCE_DIRNAME = "src";
2
+ export declare const GRO_DIRNAME = ".gro";
3
+ export declare const GRO_DIST_PREFIX = "dist_";
4
+ export declare const SERVER_DIST_PATH = "dist_server";
5
+ export declare const GRO_DEV_DIRNAME: string;
6
+ export declare const SOURCE_DIR: string;
7
+ export declare const GRO_DIR: string;
8
+ export declare const GRO_DEV_DIR: string;
9
+ export declare const GRO_CONFIG_PATH = "gro.config.ts";
10
+ export declare const README_FILENAME = "README.md";
11
+ export declare const SVELTEKIT_CONFIG_FILENAME = "svelte.config.js";
12
+ export declare const VITE_CONFIG_FILENAME = "vite.config.ts";
13
+ export declare const NODE_MODULES_DIRNAME = "node_modules";
14
+ export declare const LOCKFILE_FILENAME = "package-lock.json";
15
+ export declare const SVELTEKIT_DEV_DIRNAME = ".svelte-kit";
16
+ export declare const SVELTEKIT_BUILD_DIRNAME = "build";
17
+ export declare const SVELTEKIT_DIST_DIRNAME = "dist";
18
+ export declare const SVELTEKIT_VITE_CACHE_PATH: string;
19
+ export declare const GITHUB_DIRNAME = ".github";
20
+ export declare const GIT_DIRNAME = ".git";
21
+ export declare const TSCONFIG_FILENAME = "tsconfig.json";
@@ -0,0 +1,28 @@
1
+ /*
2
+
3
+ This module is intended to have no dependencies to avoid over-imports in the CLI and loader.
4
+ If any of these become customizable from SvelteKit or Gro's configs, move them to `./paths.ts`.
5
+
6
+ */
7
+ // TODO the slashes here are kinda gross - do we want to maintain the convention to have the trailing slash in most usage?
8
+ export const SOURCE_DIRNAME = 'src';
9
+ export const GRO_DIRNAME = '.gro';
10
+ export const GRO_DIST_PREFIX = 'dist_'; //
11
+ export const SERVER_DIST_PATH = 'dist_server'; // TODO should all of these be `_PATH` or should this be `DIRNAME`?
12
+ export const GRO_DEV_DIRNAME = GRO_DIRNAME + '/dev';
13
+ export const SOURCE_DIR = SOURCE_DIRNAME + '/';
14
+ export const GRO_DIR = GRO_DIRNAME + '/';
15
+ export const GRO_DEV_DIR = GRO_DEV_DIRNAME + '/';
16
+ export const GRO_CONFIG_PATH = 'gro.config.ts';
17
+ export const README_FILENAME = 'README.md';
18
+ export const SVELTEKIT_CONFIG_FILENAME = 'svelte.config.js';
19
+ export const VITE_CONFIG_FILENAME = 'vite.config.ts';
20
+ export const NODE_MODULES_DIRNAME = 'node_modules';
21
+ export const LOCKFILE_FILENAME = 'package-lock.json';
22
+ export const SVELTEKIT_DEV_DIRNAME = '.svelte-kit'; // TODO use Svelte config value `outDir`
23
+ export const SVELTEKIT_BUILD_DIRNAME = 'build';
24
+ export const SVELTEKIT_DIST_DIRNAME = 'dist';
25
+ export const SVELTEKIT_VITE_CACHE_PATH = NODE_MODULES_DIRNAME + '/.vite';
26
+ export const GITHUB_DIRNAME = '.github';
27
+ export const GIT_DIRNAME = '.git';
28
+ export const TSCONFIG_FILENAME = 'tsconfig.json';