@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,12 +1,12 @@
1
1
  import { spawn } from '@ryanatkn/belt/process.js';
2
2
  import { z } from 'zod';
3
3
  import { rmSync } from 'node:fs';
4
- import { Task_Error } from './task.js';
5
- import { extract_deps, load_package_json } from './package_json.js';
6
- import { Git_Origin, git_pull } from './git.js';
7
- import { spawn_cli } from './cli.js';
8
- import { serialize_args, to_forwarded_args } from './args.js';
9
- import { NODE_MODULES_DIRNAME } from './constants.js';
4
+ import { Task_Error } from "./task.js";
5
+ import { extract_deps, load_package_json } from "./package_json.js";
6
+ import { Git_Origin, git_pull } from "./git.js";
7
+ import { spawn_cli } from "./cli.js";
8
+ import { serialize_args, to_forwarded_args } from "./args.js";
9
+ import { NODE_MODULES_DIRNAME } from "./constants.js";
10
10
  export const Args = z
11
11
  .object({
12
12
  _: z.array(z.string(), { description: 'names of deps to exclude from the upgrade' }).default([]),
@@ -1,5 +1,5 @@
1
1
  import { type ChokidarOptions } from 'chokidar';
2
- import type { Path_Filter } from './path.js';
2
+ import type { Path_Filter } from './path.ts';
3
3
  export interface Watch_Node_Fs {
4
4
  init: () => Promise<void>;
5
5
  close: () => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanatkn/gro",
3
- "version": "0.154.0",
3
+ "version": "0.156.0",
4
4
  "description": "task runner and toolkit extending SvelteKit",
5
5
  "motto": "generate, run, optimize",
6
6
  "glyph": "🌰",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "type": "module",
34
34
  "engines": {
35
- "node": ">=22.11"
35
+ "node": ">=22.15"
36
36
  },
37
37
  "bin": {
38
38
  "gro": "dist/gro.js"
@@ -57,6 +57,7 @@
57
57
  "oxc-parser": "^0.67.0",
58
58
  "prettier": "^3.5.3",
59
59
  "prettier-plugin-svelte": "^3.3.3",
60
+ "ts-blank-space": "^0.6.1",
60
61
  "ts-morph": "^25.0.1",
61
62
  "tslib": "^2.8.1",
62
63
  "zod": "^3.24.3"
@@ -69,7 +70,7 @@
69
70
  "@changesets/changelog-git": "^0.2.1",
70
71
  "@changesets/types": "^6.1.0",
71
72
  "@ryanatkn/eslint-config": "^0.8.0",
72
- "@ryanatkn/fuz": "^0.140.0",
73
+ "@ryanatkn/fuz": "^0.141.1",
73
74
  "@ryanatkn/moss": "^0.28.0",
74
75
  "@sveltejs/adapter-static": "^3.0.8",
75
76
  "@sveltejs/kit": "^2.20.8",
@@ -86,7 +87,7 @@
86
87
  "uvu": "^0.5.6"
87
88
  },
88
89
  "optionalDependencies": {
89
- "@ryanatkn/moss": "^0.28.0"
90
+ "@ryanatkn/moss": ">=0.27.0 <0.29.0"
90
91
  },
91
92
  "prettier": {
92
93
  "plugins": [
@@ -1,8 +1,8 @@
1
1
  import {z} from 'zod';
2
2
 
3
- import type {Task} from './task.js';
4
- import {Plugins} from './plugin.js';
5
- import {clean_fs} from './clean_fs.js';
3
+ import type {Task} from './task.ts';
4
+ import {Plugins} from './plugin.ts';
5
+ import {clean_fs} from './clean_fs.ts';
6
6
 
7
7
  export const Args = z
8
8
  .object({
@@ -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({
@@ -31,7 +31,6 @@ export const TSCONFIG_FILENAME = 'tsconfig.json';
31
31
 
32
32
  export const TS_MATCHER = /\.(ts|tsx|mts|cts)$/;
33
33
  export const JS_MATCHER = /\.(js|jsx|mjs|cjs)$/;
34
- export const JSON_MATCHER = /\.json$/;
35
34
  /** Extracts the script content from Svelte files. */
36
35
  export const SVELTE_SCRIPT_MATCHER = /<script(?:\s+[^>]*)?>([\s\S]*?)<\/script>/gim; // TODO maybe this shouldnt be global? or make a getter?
37
36
  export const EVERYTHING_MATCHER = /.*/;
@@ -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