@ryanatkn/gro 0.154.0 → 0.155.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 (192) 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/deploy.task.d.ts +1 -1
  16. package/dist/deploy.task.js +5 -5
  17. package/dist/dev.task.d.ts +2 -2
  18. package/dist/dev.task.js +2 -2
  19. package/dist/esbuild_helpers.d.ts +1 -1
  20. package/dist/esbuild_helpers.d.ts.map +1 -1
  21. package/dist/esbuild_helpers.js +1 -2
  22. package/dist/esbuild_plugin_external_worker.d.ts +1 -1
  23. package/dist/esbuild_plugin_external_worker.js +7 -7
  24. package/dist/esbuild_plugin_svelte.d.ts +1 -1
  25. package/dist/esbuild_plugin_svelte.js +4 -4
  26. package/dist/esbuild_plugin_sveltekit_local_imports.js +2 -2
  27. package/dist/esbuild_plugin_sveltekit_shim_app.d.ts +1 -1
  28. package/dist/esbuild_plugin_sveltekit_shim_app.js +2 -2
  29. package/dist/esbuild_plugin_sveltekit_shim_env.js +3 -3
  30. package/dist/filer.d.ts +3 -3
  31. package/dist/filer.js +6 -6
  32. package/dist/format.task.d.ts +1 -1
  33. package/dist/format.task.js +3 -3
  34. package/dist/format_directory.d.ts +1 -1
  35. package/dist/format_directory.js +5 -5
  36. package/dist/format_file.js +1 -1
  37. package/dist/gen.d.ts +5 -5
  38. package/dist/gen.js +4 -4
  39. package/dist/gen.task.d.ts +1 -1
  40. package/dist/gen.task.js +8 -8
  41. package/dist/git.js +1 -1
  42. package/dist/gro.config.default.d.ts +1 -1
  43. package/dist/gro.config.default.js +16 -8
  44. package/dist/gro.d.ts +1 -1
  45. package/dist/gro.js +3 -2
  46. package/dist/gro_config.d.ts +4 -4
  47. package/dist/gro_config.js +12 -4
  48. package/dist/gro_helpers.d.ts.map +1 -1
  49. package/dist/gro_helpers.js +5 -2
  50. package/dist/gro_plugin_gen.d.ts +2 -2
  51. package/dist/gro_plugin_gen.js +4 -4
  52. package/dist/gro_plugin_server.d.ts +1 -1
  53. package/dist/gro_plugin_server.js +11 -11
  54. package/dist/gro_plugin_sveltekit_app.d.ts +3 -3
  55. package/dist/gro_plugin_sveltekit_app.js +10 -10
  56. package/dist/gro_plugin_sveltekit_library.d.ts +2 -2
  57. package/dist/gro_plugin_sveltekit_library.js +3 -3
  58. package/dist/index.d.ts +4 -4
  59. package/dist/index.js +2 -2
  60. package/dist/input_path.d.ts +1 -1
  61. package/dist/input_path.js +3 -3
  62. package/dist/invoke.js +4 -4
  63. package/dist/invoke_task.d.ts +4 -4
  64. package/dist/invoke_task.js +7 -7
  65. package/dist/lint.task.d.ts +1 -1
  66. package/dist/lint.task.js +3 -3
  67. package/dist/loader.d.ts.map +1 -1
  68. package/dist/loader.js +62 -46
  69. package/dist/module.js +2 -2
  70. package/dist/modules.d.ts +2 -2
  71. package/dist/modules.js +10 -2
  72. package/dist/package.d.ts +1 -0
  73. package/dist/package.d.ts.map +1 -1
  74. package/dist/package.gen.d.ts +1 -1
  75. package/dist/package.gen.js +5 -5
  76. package/dist/package.js +6 -5
  77. package/dist/package_json.js +5 -5
  78. package/dist/package_meta.d.ts +2 -2
  79. package/dist/package_meta.js +1 -1
  80. package/dist/parse_imports.d.ts +1 -1
  81. package/dist/parse_imports.js +2 -2
  82. package/dist/paths.d.ts +1 -1
  83. package/dist/paths.js +2 -2
  84. package/dist/plugin.d.ts +3 -3
  85. package/dist/plugin.d.ts.map +1 -1
  86. package/dist/publish.task.d.ts +1 -1
  87. package/dist/publish.task.js +8 -8
  88. package/dist/reinstall.task.d.ts +1 -1
  89. package/dist/reinstall.task.js +2 -2
  90. package/dist/release.task.d.ts +1 -1
  91. package/dist/release.task.js +2 -2
  92. package/dist/resolve.task.d.ts +1 -1
  93. package/dist/resolve.task.js +2 -2
  94. package/dist/resolve_specifier.d.ts +1 -1
  95. package/dist/resolve_specifier.js +1 -1
  96. package/dist/run.task.d.ts +1 -1
  97. package/dist/run.task.js +2 -2
  98. package/dist/run_gen.d.ts +3 -3
  99. package/dist/run_gen.js +3 -3
  100. package/dist/run_task.d.ts +5 -5
  101. package/dist/run_task.js +4 -4
  102. package/dist/search_fs.d.ts +1 -1
  103. package/dist/src_json.d.ts +1 -1
  104. package/dist/src_json.js +2 -2
  105. package/dist/svelte_config.js +10 -2
  106. package/dist/sveltekit_helpers.d.ts +3 -3
  107. package/dist/sveltekit_helpers.js +6 -6
  108. package/dist/sveltekit_shim_app.d.ts +1 -1
  109. package/dist/sveltekit_shim_app_state.js +1 -1
  110. package/dist/sveltekit_shim_env.js +1 -1
  111. package/dist/sync.task.d.ts +1 -1
  112. package/dist/sync.task.js +3 -3
  113. package/dist/task.d.ts +7 -7
  114. package/dist/task.js +4 -4
  115. package/dist/task_logging.d.ts +1 -1
  116. package/dist/task_logging.js +1 -1
  117. package/dist/test.task.d.ts +1 -1
  118. package/dist/test.task.js +3 -3
  119. package/dist/typecheck.task.d.ts +1 -1
  120. package/dist/typecheck.task.js +6 -6
  121. package/dist/upgrade.task.d.ts +1 -1
  122. package/dist/upgrade.task.js +6 -6
  123. package/dist/watch_dir.d.ts +1 -1
  124. package/package.json +5 -4
  125. package/src/lib/build.task.ts +3 -3
  126. package/src/lib/changelog.ts +1 -1
  127. package/src/lib/changeset.task.ts +6 -6
  128. package/src/lib/check.task.ts +3 -3
  129. package/src/lib/clean.task.ts +3 -3
  130. package/src/lib/clean_fs.ts +2 -2
  131. package/src/lib/cli.ts +3 -3
  132. package/src/lib/commit.task.ts +2 -2
  133. package/src/lib/deploy.task.ts +5 -5
  134. package/src/lib/dev.task.ts +3 -3
  135. package/src/lib/esbuild_helpers.ts +2 -3
  136. package/src/lib/esbuild_plugin_external_worker.ts +9 -9
  137. package/src/lib/esbuild_plugin_svelte.ts +4 -4
  138. package/src/lib/esbuild_plugin_sveltekit_local_imports.ts +2 -2
  139. package/src/lib/esbuild_plugin_sveltekit_shim_app.ts +3 -3
  140. package/src/lib/esbuild_plugin_sveltekit_shim_env.ts +3 -3
  141. package/src/lib/filer.ts +8 -8
  142. package/src/lib/format.task.ts +3 -3
  143. package/src/lib/format_directory.ts +5 -5
  144. package/src/lib/format_file.ts +1 -1
  145. package/src/lib/gen.task.ts +8 -8
  146. package/src/lib/gen.ts +7 -7
  147. package/src/lib/git.ts +1 -1
  148. package/src/lib/gro.config.default.ts +8 -8
  149. package/src/lib/gro.ts +4 -2
  150. package/src/lib/gro_config.ts +7 -7
  151. package/src/lib/gro_helpers.ts +5 -2
  152. package/src/lib/gro_plugin_gen.ts +6 -6
  153. package/src/lib/gro_plugin_server.ts +13 -13
  154. package/src/lib/gro_plugin_sveltekit_app.ts +11 -11
  155. package/src/lib/gro_plugin_sveltekit_library.ts +4 -4
  156. package/src/lib/index.ts +4 -4
  157. package/src/lib/input_path.ts +4 -4
  158. package/src/lib/invoke.ts +4 -4
  159. package/src/lib/invoke_task.ts +8 -8
  160. package/src/lib/lint.task.ts +3 -3
  161. package/src/lib/loader.ts +63 -63
  162. package/src/lib/module.ts +2 -2
  163. package/src/lib/modules.ts +3 -3
  164. package/src/lib/package.gen.ts +6 -6
  165. package/src/lib/package.ts +8 -7
  166. package/src/lib/package_json.ts +5 -5
  167. package/src/lib/package_meta.ts +3 -3
  168. package/src/lib/parse_imports.ts +3 -3
  169. package/src/lib/paths.ts +3 -3
  170. package/src/lib/plugin.ts +8 -5
  171. package/src/lib/publish.task.ts +8 -8
  172. package/src/lib/reinstall.task.ts +2 -2
  173. package/src/lib/release.task.ts +3 -3
  174. package/src/lib/resolve.task.ts +2 -2
  175. package/src/lib/resolve_specifier.ts +2 -2
  176. package/src/lib/run.task.ts +2 -2
  177. package/src/lib/run_gen.ts +5 -5
  178. package/src/lib/run_task.ts +7 -7
  179. package/src/lib/search_fs.ts +1 -1
  180. package/src/lib/src_json.ts +2 -2
  181. package/src/lib/svelte_config.ts +1 -1
  182. package/src/lib/sveltekit_helpers.ts +6 -6
  183. package/src/lib/sveltekit_shim_app.ts +1 -1
  184. package/src/lib/sveltekit_shim_app_state.ts +1 -1
  185. package/src/lib/sveltekit_shim_env.ts +1 -1
  186. package/src/lib/sync.task.ts +3 -3
  187. package/src/lib/task.ts +9 -9
  188. package/src/lib/task_logging.ts +3 -3
  189. package/src/lib/test.task.ts +3 -3
  190. package/src/lib/typecheck.task.ts +6 -6
  191. package/src/lib/upgrade.task.ts +6 -6
  192. package/src/lib/watch_dir.ts +1 -1
@@ -3,7 +3,7 @@ import {z} from 'zod';
3
3
  import type {Logger} from '@ryanatkn/belt/log.js';
4
4
  import type {Fetch_Value_Cache} from '@ryanatkn/belt/fetch.js';
5
5
 
6
- import {github_fetch_commit_prs} from './github.js';
6
+ import {github_fetch_commit_prs} from './github.ts';
7
7
 
8
8
  /**
9
9
  * Updates a changelog produced by `@changesets/changelog-git` with better links and formatting.
@@ -6,10 +6,10 @@ import {readFile, writeFile} from 'node:fs/promises';
6
6
  import {join} from 'node:path';
7
7
  import {existsSync, readdirSync} from 'node:fs';
8
8
 
9
- import {Task_Error, type Task} from './task.js';
10
- import {find_cli, spawn_cli} from './cli.js';
11
- import {Git_Origin, git_check_fully_staged_workspace, git_push_to_create} from './git.js';
12
- import {has_sveltekit_library} from './sveltekit_helpers.js';
9
+ import {Task_Error, type Task} from './task.ts';
10
+ import {find_cli, spawn_cli} from './cli.ts';
11
+ import {Git_Origin, git_check_fully_staged_workspace, git_push_to_create} from './git.ts';
12
+ import {has_sveltekit_library} from './sveltekit_helpers.ts';
13
13
  import {
14
14
  CHANGESET_CLI,
15
15
  CHANGESET_DIR,
@@ -17,8 +17,8 @@ import {
17
17
  Changeset_Bump,
18
18
  CHANGESET_PUBLIC_ACCESS,
19
19
  CHANGESET_RESTRICTED_ACCESS,
20
- } from './changeset_helpers.js';
21
- import {load_package_json} from './package_json.js';
20
+ } from './changeset_helpers.ts';
21
+ import {load_package_json} from './package_json.ts';
22
22
 
23
23
  export const Args = z
24
24
  .object({
@@ -2,9 +2,9 @@ import {z} from 'zod';
2
2
  import {spawn} from '@ryanatkn/belt/process.js';
3
3
  import {styleText as st} from 'node:util';
4
4
 
5
- import {Task_Error, type Task} from './task.js';
6
- import {git_check_clean_workspace} from './git.js';
7
- import {sync_package_json} from './package_json.js';
5
+ import {Task_Error, type Task} from './task.ts';
6
+ import {git_check_clean_workspace} from './git.ts';
7
+ import {sync_package_json} from './package_json.ts';
8
8
 
9
9
  export const Args = z
10
10
  .object({
@@ -1,9 +1,9 @@
1
1
  import {spawn} from '@ryanatkn/belt/process.js';
2
2
  import {z} from 'zod';
3
3
 
4
- import type {Task} from './task.js';
5
- import {clean_fs} from './clean_fs.js';
6
- import {Git_Origin} from './git.js';
4
+ import type {Task} from './task.ts';
5
+ import {clean_fs} from './clean_fs.ts';
6
+ import {Git_Origin} from './git.ts';
7
7
 
8
8
  export const Args = z
9
9
  .object({
@@ -1,7 +1,7 @@
1
1
  import {rm} from 'node:fs/promises';
2
2
  import {readdirSync, type RmOptions} from 'node:fs';
3
3
 
4
- import {paths} from './paths.js';
4
+ import {paths} from './paths.ts';
5
5
  import {
6
6
  NODE_MODULES_DIRNAME,
7
7
  GRO_DIST_PREFIX,
@@ -9,7 +9,7 @@ import {
9
9
  SVELTEKIT_BUILD_DIRNAME,
10
10
  SVELTEKIT_VITE_CACHE_PATH,
11
11
  SVELTEKIT_DIST_DIRNAME,
12
- } from './constants.js';
12
+ } from './constants.ts';
13
13
 
14
14
  export const clean_fs = async (
15
15
  {
package/src/lib/cli.ts CHANGED
@@ -10,9 +10,9 @@ import {existsSync} from 'node:fs';
10
10
  import {fileURLToPath, type URL} from 'node:url';
11
11
  import type {Logger} from '@ryanatkn/belt/log.js';
12
12
 
13
- import {NODE_MODULES_DIRNAME} from './constants.js';
14
- import type {Path_Id} from './path.js';
15
- import {print_command_args} from './args.js';
13
+ import {NODE_MODULES_DIRNAME} from './constants.ts';
14
+ import type {Path_Id} from './path.ts';
15
+ import {print_command_args} from './args.ts';
16
16
 
17
17
  // TODO maybe upstream to Belt?
18
18
 
@@ -1,8 +1,8 @@
1
1
  import {spawn} from '@ryanatkn/belt/process.js';
2
2
  import {z} from 'zod';
3
3
 
4
- import type {Task} from './task.js';
5
- import {Git_Origin, git_current_branch_name, git_push} from './git.js';
4
+ import type {Task} from './task.ts';
5
+ import {Git_Origin, git_current_branch_name, git_push} from './git.ts';
6
6
 
7
7
  export const Args = z
8
8
  .object({
@@ -6,10 +6,10 @@ import {cp, mkdir, rm} from 'node:fs/promises';
6
6
  import {join, resolve} from 'node:path';
7
7
  import {existsSync, readdirSync} from 'node:fs';
8
8
 
9
- import {Task_Error, type Task} from './task.js';
10
- import {print_path} from './paths.js';
11
- import {GRO_DIRNAME, GIT_DIRNAME, SVELTEKIT_BUILD_DIRNAME} from './constants.js';
12
- import {empty_dir} from './fs.js';
9
+ import {Task_Error, type Task} from './task.ts';
10
+ import {print_path} from './paths.ts';
11
+ import {GRO_DIRNAME, GIT_DIRNAME, SVELTEKIT_BUILD_DIRNAME} from './constants.ts';
12
+ import {empty_dir} from './fs.ts';
13
13
  import {
14
14
  git_check_clean_workspace,
15
15
  git_checkout,
@@ -25,7 +25,7 @@ import {
25
25
  git_check_setting_pull_rebase,
26
26
  git_clone_locally,
27
27
  git_current_branch_name,
28
- } from './git.js';
28
+ } from './git.ts';
29
29
 
30
30
  // docs at ./docs/deploy.md
31
31
 
@@ -1,8 +1,8 @@
1
1
  import {z} from 'zod';
2
2
 
3
- import type {Task} from './task.js';
4
- import {Plugins, type Plugin_Context} from './plugin.js';
5
- import {clean_fs} from './clean_fs.js';
3
+ import type {Task} from './task.ts';
4
+ import {Plugins, type Plugin_Context} from './plugin.ts';
5
+ import {clean_fs} from './clean_fs.ts';
6
6
 
7
7
  export const Args = z
8
8
  .object({
@@ -2,7 +2,7 @@ import {styleText as st} from 'node:util';
2
2
  import type {Logger} from '@ryanatkn/belt/log.js';
3
3
  import type * as esbuild from 'esbuild';
4
4
 
5
- import type {Parsed_Svelte_Config} from './svelte_config.js';
5
+ import type {Parsed_Svelte_Config} from './svelte_config.ts';
6
6
 
7
7
  export const print_build_result = (log: Logger, build_result: esbuild.BuildResult): void => {
8
8
  for (const error of build_result.errors) {
@@ -42,9 +42,8 @@ export const to_define_import_meta_env = (
42
42
  });
43
43
 
44
44
  export const default_ts_transform_options: esbuild.TransformOptions = {
45
- target: 'esnext',
45
+ target: 'esnext', // TODO load local tsconfig
46
46
  format: 'esm',
47
47
  loader: 'ts',
48
48
  charset: 'utf8',
49
- // TODO load local tsconfig
50
49
  };
@@ -3,15 +3,15 @@ import type {Logger} from '@ryanatkn/belt/log.js';
3
3
  import {basename} from 'node:path';
4
4
  import type {CompileOptions, ModuleCompileOptions, PreprocessorGroup} from 'svelte/compiler';
5
5
 
6
- import {print_build_result, to_define_import_meta_env} from './esbuild_helpers.js';
7
- import {resolve_specifier} from './resolve_specifier.js';
8
- import {esbuild_plugin_sveltekit_shim_alias} from './esbuild_plugin_sveltekit_shim_alias.js';
9
- import {esbuild_plugin_sveltekit_shim_env} from './esbuild_plugin_sveltekit_shim_env.js';
10
- import {esbuild_plugin_sveltekit_shim_app} from './esbuild_plugin_sveltekit_shim_app.js';
11
- import {esbuild_plugin_sveltekit_local_imports} from './esbuild_plugin_sveltekit_local_imports.js';
12
- import {esbuild_plugin_svelte} from './esbuild_plugin_svelte.js';
13
- import type {Parsed_Svelte_Config} from './svelte_config.js';
14
- import type {Path_Id} from './path.js';
6
+ import {print_build_result, to_define_import_meta_env} from './esbuild_helpers.ts';
7
+ import {resolve_specifier} from './resolve_specifier.ts';
8
+ import {esbuild_plugin_sveltekit_shim_alias} from './esbuild_plugin_sveltekit_shim_alias.ts';
9
+ import {esbuild_plugin_sveltekit_shim_env} from './esbuild_plugin_sveltekit_shim_env.ts';
10
+ import {esbuild_plugin_sveltekit_shim_app} from './esbuild_plugin_sveltekit_shim_app.ts';
11
+ import {esbuild_plugin_sveltekit_local_imports} from './esbuild_plugin_sveltekit_local_imports.ts';
12
+ import {esbuild_plugin_svelte} from './esbuild_plugin_svelte.ts';
13
+ import type {Parsed_Svelte_Config} from './svelte_config.ts';
14
+ import type {Path_Id} from './path.ts';
15
15
 
16
16
  export interface Esbuild_Plugin_External_Worker_Options {
17
17
  dev: boolean;
@@ -10,14 +10,14 @@ import {
10
10
  import {readFile} from 'node:fs/promises';
11
11
  import {relative} from 'node:path';
12
12
 
13
- import {SVELTE_MATCHER, SVELTE_RUNES_MATCHER} from './svelte_helpers.js';
14
- import {to_define_import_meta_env, default_ts_transform_options} from './esbuild_helpers.js';
13
+ import {SVELTE_MATCHER, SVELTE_RUNES_MATCHER} from './svelte_helpers.ts';
14
+ import {to_define_import_meta_env, default_ts_transform_options} from './esbuild_helpers.ts';
15
15
  import {
16
16
  default_svelte_config,
17
17
  to_default_compile_module_options,
18
18
  type Parsed_Svelte_Config,
19
- } from './svelte_config.js';
20
- import {TS_MATCHER} from './constants.js';
19
+ } from './svelte_config.ts';
20
+ import {TS_MATCHER} from './constants.ts';
21
21
 
22
22
  export interface Esbuild_Plugin_Svelte_Options {
23
23
  dev: boolean;
@@ -2,8 +2,8 @@ import type * as esbuild from 'esbuild';
2
2
  import {readFile} from 'node:fs/promises';
3
3
  import {dirname} from 'node:path';
4
4
 
5
- import {resolve_specifier} from './resolve_specifier.js';
6
- import {EVERYTHING_MATCHER} from './constants.js';
5
+ import {resolve_specifier} from './resolve_specifier.ts';
6
+ import {EVERYTHING_MATCHER} from './constants.ts';
7
7
 
8
8
  /**
9
9
  * Adds support for imports to both `.ts` and `.js`,
@@ -4,9 +4,9 @@ import {
4
4
  render_sveltekit_shim_app_environment,
5
5
  render_sveltekit_shim_app_paths,
6
6
  sveltekit_shim_app_specifiers,
7
- } from './sveltekit_shim_app.js';
8
- import type {Parsed_Svelte_Config} from './svelte_config.js';
9
- import {EVERYTHING_MATCHER} from './constants.js';
7
+ } from './sveltekit_shim_app.ts';
8
+ import type {Parsed_Svelte_Config} from './svelte_config.ts';
9
+ import {EVERYTHING_MATCHER} from './constants.ts';
10
10
 
11
11
  export interface Esbuild_Plugin_Sveltekit_Shim_App_Options {
12
12
  dev: boolean;
@@ -1,8 +1,8 @@
1
1
  import type * as esbuild from 'esbuild';
2
2
 
3
- import {render_env_shim_module} from './sveltekit_shim_env.js';
4
- import {EVERYTHING_MATCHER} from './constants.js';
5
- import {SVELTEKIT_ENV_MATCHER} from './sveltekit_helpers.js';
3
+ import {render_env_shim_module} from './sveltekit_shim_env.ts';
4
+ import {EVERYTHING_MATCHER} from './constants.ts';
5
+ import {SVELTEKIT_ENV_MATCHER} from './sveltekit_helpers.ts';
6
6
 
7
7
  export interface Esbuild_Plugin_Sveltekit_Shim_Env_Options {
8
8
  dev: boolean;
package/src/lib/filer.ts CHANGED
@@ -8,20 +8,20 @@ import {fileURLToPath, pathToFileURL} from 'node:url';
8
8
  import {Unreachable_Error} from '@ryanatkn/belt/error.js';
9
9
  import type {Logger} from '@ryanatkn/belt/log.js';
10
10
 
11
- import type {File_Filter, Path_Id} from './path.js';
11
+ import type {File_Filter, Path_Id} from './path.ts';
12
12
  import {
13
13
  watch_dir,
14
14
  type Watch_Node_Fs,
15
15
  type Watcher_Change,
16
16
  type Watch_Dir_Options,
17
17
  type Watcher_Change_Callback,
18
- } from './watch_dir.js';
19
- import {paths} from './paths.js';
20
- import {parse_imports} from './parse_imports.js';
21
- import {resolve_specifier} from './resolve_specifier.js';
22
- import {default_svelte_config} from './svelte_config.js';
23
- import {map_sveltekit_aliases, SVELTEKIT_GLOBAL_SPECIFIER} from './sveltekit_helpers.js';
24
- import type {Package_Json} from './package_json.js';
18
+ } from './watch_dir.ts';
19
+ import {paths} from './paths.ts';
20
+ import {parse_imports} from './parse_imports.ts';
21
+ import {resolve_specifier} from './resolve_specifier.ts';
22
+ import {default_svelte_config} from './svelte_config.ts';
23
+ import {map_sveltekit_aliases, SVELTEKIT_GLOBAL_SPECIFIER} from './sveltekit_helpers.ts';
24
+ import type {Package_Json} from './package_json.ts';
25
25
 
26
26
  const aliases = Object.entries(default_svelte_config.alias);
27
27
 
@@ -1,9 +1,9 @@
1
1
  import {print_spawn_result} from '@ryanatkn/belt/process.js';
2
2
  import {z} from 'zod';
3
3
 
4
- import {Task_Error, type Task} from './task.js';
5
- import {format_directory} from './format_directory.js';
6
- import {paths} from './paths.js';
4
+ import {Task_Error, type Task} from './task.ts';
5
+ import {format_directory} from './format_directory.ts';
6
+ import {paths} from './paths.ts';
7
7
 
8
8
  export const Args = z
9
9
  .object({
@@ -1,7 +1,7 @@
1
1
  import type {Spawn_Result} from '@ryanatkn/belt/process.js';
2
2
  import type {Logger} from '@ryanatkn/belt/log.js';
3
3
 
4
- import {paths} from './paths.js';
4
+ import {paths} from './paths.ts';
5
5
  import {
6
6
  GITHUB_DIRNAME,
7
7
  README_FILENAME,
@@ -11,9 +11,9 @@ import {
11
11
  GRO_CONFIG_PATH,
12
12
  PM_CLI_DEFAULT,
13
13
  PRETTIER_CLI_DEFAULT,
14
- } from './constants.js';
15
- import {serialize_args, to_forwarded_args} from './args.js';
16
- import {spawn_cli, to_cli_name, type Cli} from './cli.js';
14
+ } from './constants.ts';
15
+ import {serialize_args, to_forwarded_args} from './args.ts';
16
+ import {spawn_cli, to_cli_name, type Cli} from './cli.ts';
17
17
 
18
18
  const EXTENSIONS_DEFAULT = 'ts,js,json,svelte,html,css,md,yml';
19
19
  const ROOT_PATHS_DEFAULT = `${[
@@ -49,7 +49,7 @@ export const format_directory = async (
49
49
  }
50
50
  const spawned = await spawn_cli(prettier_cli, serialized_args, log);
51
51
  if (!spawned)
52
- throw new Error(
52
+ throw Error(
53
53
  `failed to find \`${to_cli_name(prettier_cli)}\` CLI locally or globally, do you need to run \`${pm_cli} install\`?`,
54
54
  );
55
55
  return spawned;
@@ -1,7 +1,7 @@
1
1
  import prettier from 'prettier';
2
2
  import {extname} from 'node:path';
3
3
 
4
- import {load_package_json} from './package_json.js';
4
+ import {load_package_json} from './package_json.ts';
5
5
 
6
6
  let cached_base_options: prettier.Options | undefined;
7
7
 
@@ -3,14 +3,14 @@ import {print_ms, print_error} from '@ryanatkn/belt/print.js';
3
3
  import {plural} from '@ryanatkn/belt/string.js';
4
4
  import {z} from 'zod';
5
5
 
6
- import {Task_Error, type Task} from './task.js';
7
- import {run_gen} from './run_gen.js';
8
- import {Raw_Input_Path, to_input_paths} from './input_path.js';
9
- import {format_file} from './format_file.js';
10
- import {print_path} from './paths.js';
11
- import {log_error_reasons} from './task_logging.js';
12
- import {write_gen_results, analyze_gen_results, find_genfiles, load_genfiles} from './gen.js';
13
- import {SOURCE_DIRNAME} from './constants.js';
6
+ import {Task_Error, type Task} from './task.ts';
7
+ import {run_gen} from './run_gen.ts';
8
+ import {Raw_Input_Path, to_input_paths} from './input_path.ts';
9
+ import {format_file} from './format_file.ts';
10
+ import {print_path} from './paths.ts';
11
+ import {log_error_reasons} from './task_logging.ts';
12
+ import {write_gen_results, analyze_gen_results, find_genfiles, load_genfiles} from './gen.ts';
13
+ import {SOURCE_DIRNAME} from './constants.ts';
14
14
 
15
15
  export const Args = z
16
16
  .object({
package/src/lib/gen.ts CHANGED
@@ -7,19 +7,19 @@ import type {Timings} from '@ryanatkn/belt/timings.js';
7
7
  import {styleText as st} from 'node:util';
8
8
  import {existsSync} from 'node:fs';
9
9
 
10
- import {print_path} from './paths.js';
11
- import type {Path_Id} from './path.js';
12
- import type {Gro_Config} from './gro_config.js';
13
- import type {Parsed_Svelte_Config} from './svelte_config.js';
14
- import {load_modules, type Load_Modules_Failure, type Module_Meta} from './modules.js';
10
+ import {print_path} from './paths.ts';
11
+ import type {Path_Id} from './path.ts';
12
+ import type {Gro_Config} from './gro_config.ts';
13
+ import type {Parsed_Svelte_Config} from './svelte_config.ts';
14
+ import {load_modules, type Load_Modules_Failure, type Module_Meta} from './modules.ts';
15
15
  import {
16
16
  Input_Path,
17
17
  resolve_input_files,
18
18
  resolve_input_paths,
19
19
  type Resolved_Input_File,
20
20
  type Resolved_Input_Path,
21
- } from './input_path.js';
22
- import {search_fs} from './search_fs.js';
21
+ } from './input_path.ts';
22
+ import {search_fs} from './search_fs.ts';
23
23
 
24
24
  export const GEN_FILE_PATTERN_TEXT = 'gen';
25
25
  export const GEN_FILE_PATTERN = '.' + GEN_FILE_PATTERN_TEXT + '.';
package/src/lib/git.ts CHANGED
@@ -4,7 +4,7 @@ import {z} from 'zod';
4
4
  import {existsSync} from 'node:fs';
5
5
  import type {Flavored} from '@ryanatkn/belt/types.js';
6
6
 
7
- import {to_file_path} from './path.js';
7
+ import {to_file_path} from './path.ts';
8
8
 
9
9
  // TODO maybe extract to `util-git`
10
10
 
@@ -1,13 +1,13 @@
1
1
  import {resolve} from 'node:path';
2
2
 
3
- import type {Create_Gro_Config} from './gro_config.js';
4
- import {gro_plugin_sveltekit_library} from './gro_plugin_sveltekit_library.js';
5
- import {has_server, gro_plugin_server} from './gro_plugin_server.js';
6
- import {gro_plugin_sveltekit_app} from './gro_plugin_sveltekit_app.js';
7
- import {has_sveltekit_app, has_sveltekit_library} from './sveltekit_helpers.js';
8
- import {gro_plugin_gen} from './gro_plugin_gen.js';
9
- import {has_dep, load_package_json} from './package_json.js';
10
- import {find_first_existing_file} from './search_fs.js';
3
+ import type {Create_Gro_Config} from './gro_config.ts';
4
+ import {gro_plugin_sveltekit_library} from './gro_plugin_sveltekit_library.ts';
5
+ import {has_server, gro_plugin_server} from './gro_plugin_server.ts';
6
+ import {gro_plugin_sveltekit_app} from './gro_plugin_sveltekit_app.ts';
7
+ import {has_sveltekit_app, has_sveltekit_library} from './sveltekit_helpers.ts';
8
+ import {gro_plugin_gen} from './gro_plugin_gen.ts';
9
+ import {has_dep, load_package_json} from './package_json.ts';
10
+ import {find_first_existing_file} from './search_fs.ts';
11
11
 
12
12
  // TODO hacky, maybe extract utils?
13
13
 
package/src/lib/gro.ts CHANGED
@@ -1,8 +1,10 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env -S node --experimental-import-meta-resolve --experimental-strip-types --disable-warning=ExperimentalWarning
2
+
3
+ // @sync Node options to `$lib/gro_helpers.ts`
2
4
 
3
5
  import {join} from 'node:path';
4
6
 
5
- import {resolve_gro_module_path, spawn_with_loader} from './gro_helpers.js';
7
+ import {resolve_gro_module_path, spawn_with_loader} from './gro_helpers.ts';
6
8
 
7
9
  /*
8
10
 
@@ -1,7 +1,7 @@
1
1
  import {join, resolve} from 'node:path';
2
2
  import {existsSync} from 'node:fs';
3
3
 
4
- import {GRO_DIST_DIR, IS_THIS_GRO, paths} from './paths.js';
4
+ import {GRO_DIST_DIR, IS_THIS_GRO, paths} from './paths.ts';
5
5
  import {
6
6
  GRO_CONFIG_PATH,
7
7
  JS_CLI_DEFAULT,
@@ -10,12 +10,12 @@ import {
10
10
  SERVER_DIST_PATH,
11
11
  SVELTEKIT_BUILD_DIRNAME,
12
12
  SVELTEKIT_DIST_DIRNAME,
13
- } from './constants.js';
14
- import create_default_config from './gro.config.default.js';
15
- import type {Create_Config_Plugins} from './plugin.js';
16
- import type {Map_Package_Json} from './package_json.js';
17
- import type {Path_Filter, Path_Id} from './path.js';
18
- import type {Parsed_Svelte_Config} from './svelte_config.js';
13
+ } from './constants.ts';
14
+ import create_default_config from './gro.config.default.ts';
15
+ import type {Create_Config_Plugins} from './plugin.ts';
16
+ import type {Map_Package_Json} from './package_json.ts';
17
+ import type {Path_Filter, Path_Id} from './path.ts';
18
+ import type {Parsed_Svelte_Config} from './svelte_config.ts';
19
19
 
20
20
  /**
21
21
  * The config that users can extend via `gro.config.ts`.
@@ -3,7 +3,7 @@ import {join, resolve} from 'node:path';
3
3
  import {fileURLToPath} from 'node:url';
4
4
  import {spawn, type Spawn_Result} from '@ryanatkn/belt/process.js';
5
5
 
6
- import {JS_CLI_DEFAULT, NODE_MODULES_DIRNAME, SVELTEKIT_DIST_DIRNAME} from './constants.js';
6
+ import {JS_CLI_DEFAULT, NODE_MODULES_DIRNAME, SVELTEKIT_DIST_DIRNAME} from './constants.ts';
7
7
 
8
8
  /*
9
9
 
@@ -93,8 +93,11 @@ export const spawn_with_loader = (
93
93
  import {register} from "node:module";
94
94
  import {pathToFileURL} from "node:url";
95
95
  register("${loader_path}", pathToFileURL("./"));`,
96
+ // @sync Node options to `$lib/gro.ts`
96
97
  '--experimental-import-meta-resolve', // for `import.meta.resolve`
97
- '--enable-source-maps', // because TypeScript
98
+ '--experimental-strip-types',
99
+ '--disable-warning',
100
+ 'ExperimentalWarning',
98
101
  ];
99
102
  // In almost all cases we want the exports condition to be `"development"`. Needed for `esm-env`.
100
103
  if (process.env.NODE_ENV !== 'production') {
@@ -2,12 +2,12 @@ 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
4
 
5
- import type {Plugin} from './plugin.js';
6
- import type {Args} from './args.js';
7
- import {paths} from './paths.js';
8
- import {find_genfiles, is_gen_path} from './gen.js';
9
- import {spawn_cli} from './cli.js';
10
- import {filter_dependents, type Cleanup_Watch} from './filer.js';
5
+ import type {Plugin} from './plugin.ts';
6
+ import type {Args} from './args.ts';
7
+ import {paths} from './paths.ts';
8
+ import {find_genfiles, is_gen_path} from './gen.ts';
9
+ import {spawn_cli} from './cli.ts';
10
+ import {filter_dependents, type Cleanup_Watch} from './filer.ts';
11
11
 
12
12
  const FLUSH_DEBOUNCE_DELAY = 500;
13
13
 
@@ -8,19 +8,19 @@ import type {Result} from '@ryanatkn/belt/result.js';
8
8
  import {existsSync} from 'node:fs';
9
9
  import {throttle} from '@ryanatkn/belt/throttle.js';
10
10
 
11
- import type {Plugin} from './plugin.js';
12
- import {base_path_to_path_id, LIB_DIRNAME, paths} from './paths.js';
13
- import type {Path_Id} from './path.js';
14
- import {GRO_DEV_DIRNAME, SERVER_DIST_PATH} from './constants.js';
15
- import {watch_dir, type Watch_Node_Fs} from './watch_dir.js';
16
- import {parse_svelte_config, default_svelte_config} from './svelte_config.js';
17
- import {esbuild_plugin_sveltekit_shim_app} from './esbuild_plugin_sveltekit_shim_app.js';
18
- import {esbuild_plugin_sveltekit_shim_env} from './esbuild_plugin_sveltekit_shim_env.js';
19
- import {print_build_result, to_define_import_meta_env} from './esbuild_helpers.js';
20
- import {esbuild_plugin_sveltekit_shim_alias} from './esbuild_plugin_sveltekit_shim_alias.js';
21
- import {esbuild_plugin_external_worker} from './esbuild_plugin_external_worker.js';
22
- import {esbuild_plugin_sveltekit_local_imports} from './esbuild_plugin_sveltekit_local_imports.js';
23
- import {esbuild_plugin_svelte} from './esbuild_plugin_svelte.js';
11
+ import type {Plugin} from './plugin.ts';
12
+ import {base_path_to_path_id, LIB_DIRNAME, paths} from './paths.ts';
13
+ import type {Path_Id} from './path.ts';
14
+ import {GRO_DEV_DIRNAME, SERVER_DIST_PATH} from './constants.ts';
15
+ import {watch_dir, type Watch_Node_Fs} from './watch_dir.ts';
16
+ import {parse_svelte_config, default_svelte_config} from './svelte_config.ts';
17
+ import {esbuild_plugin_sveltekit_shim_app} from './esbuild_plugin_sveltekit_shim_app.ts';
18
+ import {esbuild_plugin_sveltekit_shim_env} from './esbuild_plugin_sveltekit_shim_env.ts';
19
+ import {print_build_result, to_define_import_meta_env} from './esbuild_helpers.ts';
20
+ import {esbuild_plugin_sveltekit_shim_alias} from './esbuild_plugin_sveltekit_shim_alias.ts';
21
+ import {esbuild_plugin_external_worker} from './esbuild_plugin_external_worker.ts';
22
+ import {esbuild_plugin_sveltekit_local_imports} from './esbuild_plugin_sveltekit_local_imports.ts';
23
+ import {esbuild_plugin_svelte} from './esbuild_plugin_svelte.ts';
24
24
 
25
25
  // TODO sourcemap as a hoisted option? disable for production by default - or like `outpaths`, passed a `dev` param
26
26
 
@@ -2,16 +2,16 @@ import type {Spawned_Process} from '@ryanatkn/belt/process.js';
2
2
  import {cpSync, mkdirSync, rmSync, writeFileSync, existsSync} from 'node:fs';
3
3
  import {dirname, join} from 'node:path';
4
4
 
5
- import type {Plugin} from './plugin.js';
6
- import {serialize_args, to_forwarded_args} from './args.js';
7
- import {serialize_package_json, type Map_Package_Json, load_package_json} from './package_json.js';
8
- import {Task_Error} from './task.js';
9
- import {find_cli, spawn_cli, spawn_cli_process} from './cli.js';
10
- import {type Map_Src_Json, serialize_src_json, create_src_json} from './src_json.js';
11
- import {EXPORTS_EXCLUDER_DEFAULT} from './gro_config.js';
12
- import {default_svelte_config} from './svelte_config.js';
13
- import {SOURCE_DIRNAME} from './constants.js';
14
- import {VITE_CLI} from './sveltekit_helpers.js';
5
+ import type {Plugin} from './plugin.ts';
6
+ import {serialize_args, to_forwarded_args} from './args.ts';
7
+ import {serialize_package_json, type Map_Package_Json, load_package_json} from './package_json.ts';
8
+ import {Task_Error} from './task.ts';
9
+ import {find_cli, spawn_cli, spawn_cli_process} from './cli.ts';
10
+ import {type Map_Src_Json, serialize_src_json, create_src_json} from './src_json.ts';
11
+ import {EXPORTS_EXCLUDER_DEFAULT} from './gro_config.ts';
12
+ import {default_svelte_config} from './svelte_config.ts';
13
+ import {SOURCE_DIRNAME} from './constants.ts';
14
+ import {VITE_CLI} from './sveltekit_helpers.ts';
15
15
 
16
16
  export interface Gro_Plugin_Sveltekit_App_Options {
17
17
  /**
@@ -60,7 +60,7 @@ export const gro_plugin_sveltekit_app = ({
60
60
  setup: async ({dev, watch, log, config}) => {
61
61
  const found_vite_cli = find_cli(vite_cli);
62
62
  if (!found_vite_cli)
63
- throw new Error(
63
+ throw Error(
64
64
  `Failed to find Vite CLI \`${vite_cli}\`, do you need to run \`${config.pm_cli} i\`?`,
65
65
  );
66
66
  if (dev) {
@@ -1,13 +1,13 @@
1
1
  import {print_spawn_result, spawn} from '@ryanatkn/belt/process.js';
2
2
 
3
- import type {Plugin} from './plugin.js';
4
- import {Task_Error} from './task.js';
5
- import {load_package_json} from './package_json.js';
3
+ import type {Plugin} from './plugin.ts';
4
+ import {Task_Error} from './task.ts';
5
+ import {load_package_json} from './package_json.ts';
6
6
  import {
7
7
  SVELTE_PACKAGE_CLI,
8
8
  run_svelte_package,
9
9
  type Svelte_Package_Options,
10
- } from './sveltekit_helpers.js';
10
+ } from './sveltekit_helpers.ts';
11
11
 
12
12
  export interface Gro_Plugin_Sveltekit_Library_Options {
13
13
  /**
package/src/lib/index.ts CHANGED
@@ -1,4 +1,4 @@
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';
@@ -4,10 +4,10 @@ import {strip_start} from '@ryanatkn/belt/string.js';
4
4
  import {z} from 'zod';
5
5
  import type {Flavored} from '@ryanatkn/belt/types.js';
6
6
 
7
- import {GRO_PACKAGE_DIR, GRO_DIST_DIR} from './paths.js';
8
- import type {Path_Info, Path_Id, Resolved_Path} from './path.js';
9
- import {search_fs} from './search_fs.js';
10
- import {TASK_FILE_SUFFIX_JS} from './task.js';
7
+ import {GRO_PACKAGE_DIR, GRO_DIST_DIR} from './paths.ts';
8
+ import type {Path_Info, Path_Id, Resolved_Path} from './path.ts';
9
+ import {search_fs} from './search_fs.ts';
10
+ import {TASK_FILE_SUFFIX_JS} from './task.ts';
11
11
 
12
12
  // TODO Flavored doesn't work when used in schemas, use Zod brand instead? problem is ergonomics
13
13
  export const Input_Path = z.string();