@ryanatkn/gro 0.190.1 → 0.192.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 (323) hide show
  1. package/README.md +4 -278
  2. package/package.json +5 -142
  3. package/LICENSE +0 -21
  4. package/dist/args.d.ts +0 -37
  5. package/dist/args.d.ts.map +0 -1
  6. package/dist/args.js +0 -102
  7. package/dist/build.task.d.ts +0 -20
  8. package/dist/build.task.d.ts.map +0 -1
  9. package/dist/build.task.js +0 -119
  10. package/dist/build_cache.d.ts +0 -100
  11. package/dist/build_cache.d.ts.map +0 -1
  12. package/dist/build_cache.js +0 -299
  13. package/dist/changelog.d.ts +0 -11
  14. package/dist/changelog.d.ts.map +0 -1
  15. package/dist/changelog.js +0 -47
  16. package/dist/changeset.task.d.ts +0 -35
  17. package/dist/changeset.task.d.ts.map +0 -1
  18. package/dist/changeset.task.js +0 -151
  19. package/dist/changeset_helpers.d.ts +0 -17
  20. package/dist/changeset_helpers.d.ts.map +0 -1
  21. package/dist/changeset_helpers.js +0 -7
  22. package/dist/check.task.d.ts +0 -28
  23. package/dist/check.task.d.ts.map +0 -1
  24. package/dist/check.task.js +0 -95
  25. package/dist/child_process_logging.d.ts +0 -10
  26. package/dist/child_process_logging.d.ts.map +0 -1
  27. package/dist/child_process_logging.js +0 -26
  28. package/dist/clean.task.d.ts +0 -15
  29. package/dist/clean.task.d.ts.map +0 -1
  30. package/dist/clean.task.js +0 -40
  31. package/dist/clean_fs.d.ts +0 -9
  32. package/dist/clean_fs.d.ts.map +0 -1
  33. package/dist/clean_fs.js +0 -28
  34. package/dist/cli.d.ts +0 -34
  35. package/dist/cli.d.ts.map +0 -1
  36. package/dist/cli.js +0 -61
  37. package/dist/commit.task.d.ts +0 -11
  38. package/dist/commit.task.d.ts.map +0 -1
  39. package/dist/commit.task.js +0 -24
  40. package/dist/constants.d.ts +0 -46
  41. package/dist/constants.d.ts.map +0 -1
  42. package/dist/constants.js +0 -52
  43. package/dist/deploy.task.d.ts +0 -29
  44. package/dist/deploy.task.d.ts.map +0 -1
  45. package/dist/deploy.task.js +0 -217
  46. package/dist/dev.task.d.ts +0 -16
  47. package/dist/dev.task.d.ts.map +0 -1
  48. package/dist/dev.task.js +0 -44
  49. package/dist/disknode.d.ts +0 -23
  50. package/dist/disknode.d.ts.map +0 -1
  51. package/dist/disknode.js +0 -1
  52. package/dist/env.d.ts +0 -11
  53. package/dist/env.d.ts.map +0 -1
  54. package/dist/env.js +0 -49
  55. package/dist/esbuild_helpers.d.ts +0 -16
  56. package/dist/esbuild_helpers.d.ts.map +0 -1
  57. package/dist/esbuild_helpers.js +0 -36
  58. package/dist/esbuild_plugin_external_worker.d.ts +0 -23
  59. package/dist/esbuild_plugin_external_worker.d.ts.map +0 -1
  60. package/dist/esbuild_plugin_external_worker.js +0 -55
  61. package/dist/esbuild_plugin_svelte.d.ts +0 -15
  62. package/dist/esbuild_plugin_svelte.d.ts.map +0 -1
  63. package/dist/esbuild_plugin_svelte.js +0 -83
  64. package/dist/esbuild_plugin_sveltekit_local_imports.d.ts +0 -8
  65. package/dist/esbuild_plugin_sveltekit_local_imports.d.ts.map +0 -1
  66. package/dist/esbuild_plugin_sveltekit_local_imports.js +0 -30
  67. package/dist/esbuild_plugin_sveltekit_shim_alias.d.ts +0 -7
  68. package/dist/esbuild_plugin_sveltekit_shim_alias.d.ts.map +0 -1
  69. package/dist/esbuild_plugin_sveltekit_shim_alias.js +0 -18
  70. package/dist/esbuild_plugin_sveltekit_shim_app.d.ts +0 -9
  71. package/dist/esbuild_plugin_sveltekit_shim_app.d.ts.map +0 -1
  72. package/dist/esbuild_plugin_sveltekit_shim_app.js +0 -22
  73. package/dist/esbuild_plugin_sveltekit_shim_env.d.ts +0 -11
  74. package/dist/esbuild_plugin_sveltekit_shim_env.d.ts.map +0 -1
  75. package/dist/esbuild_plugin_sveltekit_shim_env.js +0 -18
  76. package/dist/filer.d.ts +0 -33
  77. package/dist/filer.d.ts.map +0 -1
  78. package/dist/filer.js +0 -385
  79. package/dist/format.task.d.ts +0 -11
  80. package/dist/format.task.d.ts.map +0 -1
  81. package/dist/format.task.js +0 -27
  82. package/dist/format_directory.d.ts +0 -13
  83. package/dist/format_directory.d.ts.map +0 -1
  84. package/dist/format_directory.js +0 -40
  85. package/dist/format_file.d.ts +0 -9
  86. package/dist/format_file.d.ts.map +0 -1
  87. package/dist/format_file.js +0 -42
  88. package/dist/gen.d.ts +0 -142
  89. package/dist/gen.d.ts.map +0 -1
  90. package/dist/gen.js +0 -199
  91. package/dist/gen.task.d.ts +0 -12
  92. package/dist/gen.task.d.ts.map +0 -1
  93. package/dist/gen.task.js +0 -149
  94. package/dist/gen_helpers.d.ts +0 -11
  95. package/dist/gen_helpers.d.ts.map +0 -1
  96. package/dist/gen_helpers.js +0 -76
  97. package/dist/github.d.ts +0 -19
  98. package/dist/github.d.ts.map +0 -1
  99. package/dist/github.js +0 -33
  100. package/dist/gro.config.default.d.ts +0 -13
  101. package/dist/gro.config.default.d.ts.map +0 -1
  102. package/dist/gro.config.default.js +0 -33
  103. package/dist/gro.d.ts +0 -3
  104. package/dist/gro.d.ts.map +0 -1
  105. package/dist/gro.js +0 -21
  106. package/dist/gro_config.d.ts +0 -115
  107. package/dist/gro_config.d.ts.map +0 -1
  108. package/dist/gro_config.js +0 -114
  109. package/dist/gro_helpers.d.ts +0 -49
  110. package/dist/gro_helpers.d.ts.map +0 -1
  111. package/dist/gro_helpers.js +0 -97
  112. package/dist/gro_plugin_gen.d.ts +0 -12
  113. package/dist/gro_plugin_gen.d.ts.map +0 -1
  114. package/dist/gro_plugin_gen.js +0 -101
  115. package/dist/gro_plugin_server.d.ts +0 -80
  116. package/dist/gro_plugin_server.d.ts.map +0 -1
  117. package/dist/gro_plugin_server.js +0 -167
  118. package/dist/gro_plugin_sveltekit_app.d.ts +0 -9
  119. package/dist/gro_plugin_sveltekit_app.d.ts.map +0 -1
  120. package/dist/gro_plugin_sveltekit_app.js +0 -42
  121. package/dist/gro_plugin_sveltekit_library.d.ts +0 -16
  122. package/dist/gro_plugin_sveltekit_library.d.ts.map +0 -1
  123. package/dist/gro_plugin_sveltekit_library.js +0 -34
  124. package/dist/index.d.ts +0 -9
  125. package/dist/index.d.ts.map +0 -1
  126. package/dist/index.js +0 -4
  127. package/dist/input_path.d.ts +0 -64
  128. package/dist/input_path.d.ts.map +0 -1
  129. package/dist/input_path.js +0 -199
  130. package/dist/invoke.d.ts +0 -2
  131. package/dist/invoke.d.ts.map +0 -1
  132. package/dist/invoke.js +0 -28
  133. package/dist/invoke_task.d.ts +0 -30
  134. package/dist/invoke_task.d.ts.map +0 -1
  135. package/dist/invoke_task.js +0 -104
  136. package/dist/lint.task.d.ts +0 -11
  137. package/dist/lint.task.d.ts.map +0 -1
  138. package/dist/lint.task.js +0 -32
  139. package/dist/loader.d.ts +0 -6
  140. package/dist/loader.d.ts.map +0 -1
  141. package/dist/loader.js +0 -192
  142. package/dist/module.d.ts +0 -4
  143. package/dist/module.d.ts.map +0 -1
  144. package/dist/module.js +0 -6
  145. package/dist/modules.d.ts +0 -36
  146. package/dist/modules.d.ts.map +0 -1
  147. package/dist/modules.js +0 -71
  148. package/dist/package_json.d.ts +0 -32
  149. package/dist/package_json.d.ts.map +0 -1
  150. package/dist/package_json.js +0 -178
  151. package/dist/parse_exports.d.ts +0 -20
  152. package/dist/parse_exports.d.ts.map +0 -1
  153. package/dist/parse_exports.js +0 -65
  154. package/dist/parse_exports_context.d.ts +0 -21
  155. package/dist/parse_exports_context.d.ts.map +0 -1
  156. package/dist/parse_exports_context.js +0 -332
  157. package/dist/parse_imports.d.ts +0 -5
  158. package/dist/parse_imports.d.ts.map +0 -1
  159. package/dist/parse_imports.js +0 -140
  160. package/dist/paths.d.ts +0 -41
  161. package/dist/paths.d.ts.map +0 -1
  162. package/dist/paths.js +0 -69
  163. package/dist/plugin.d.ts +0 -36
  164. package/dist/plugin.d.ts.map +0 -1
  165. package/dist/plugin.js +0 -78
  166. package/dist/publish.task.d.ts +0 -26
  167. package/dist/publish.task.d.ts.map +0 -1
  168. package/dist/publish.task.js +0 -176
  169. package/dist/register.d.ts +0 -2
  170. package/dist/register.d.ts.map +0 -1
  171. package/dist/register.js +0 -2
  172. package/dist/reinstall.task.d.ts +0 -8
  173. package/dist/reinstall.task.d.ts.map +0 -1
  174. package/dist/reinstall.task.js +0 -35
  175. package/dist/release.task.d.ts +0 -8
  176. package/dist/release.task.d.ts.map +0 -1
  177. package/dist/release.task.js +0 -20
  178. package/dist/resolve.task.d.ts +0 -11
  179. package/dist/resolve.task.d.ts.map +0 -1
  180. package/dist/resolve.task.js +0 -38
  181. package/dist/resolve_specifier.d.ts +0 -22
  182. package/dist/resolve_specifier.d.ts.map +0 -1
  183. package/dist/resolve_specifier.js +0 -57
  184. package/dist/run.task.d.ts +0 -16
  185. package/dist/run.task.d.ts.map +0 -1
  186. package/dist/run.task.js +0 -52
  187. package/dist/run_gen.d.ts +0 -10
  188. package/dist/run_gen.d.ts.map +0 -1
  189. package/dist/run_gen.js +0 -73
  190. package/dist/run_task.d.ts +0 -17
  191. package/dist/run_task.d.ts.map +0 -1
  192. package/dist/run_task.js +0 -45
  193. package/dist/source_json.d.ts +0 -7
  194. package/dist/source_json.d.ts.map +0 -1
  195. package/dist/source_json.js +0 -145
  196. package/dist/svelte_config.d.ts +0 -57
  197. package/dist/svelte_config.d.ts.map +0 -1
  198. package/dist/svelte_config.js +0 -81
  199. package/dist/sveltekit_helpers.d.ts +0 -75
  200. package/dist/sveltekit_helpers.d.ts.map +0 -1
  201. package/dist/sveltekit_helpers.js +0 -94
  202. package/dist/sveltekit_shim_app.d.ts +0 -11
  203. package/dist/sveltekit_shim_app.d.ts.map +0 -1
  204. package/dist/sveltekit_shim_app.js +0 -31
  205. package/dist/sveltekit_shim_app_environment.d.ts +0 -13
  206. package/dist/sveltekit_shim_app_environment.d.ts.map +0 -1
  207. package/dist/sveltekit_shim_app_environment.js +0 -14
  208. package/dist/sveltekit_shim_app_forms.d.ts +0 -5
  209. package/dist/sveltekit_shim_app_forms.d.ts.map +0 -1
  210. package/dist/sveltekit_shim_app_forms.js +0 -6
  211. package/dist/sveltekit_shim_app_navigation.d.ts +0 -10
  212. package/dist/sveltekit_shim_app_navigation.d.ts.map +0 -1
  213. package/dist/sveltekit_shim_app_navigation.js +0 -11
  214. package/dist/sveltekit_shim_app_paths.d.ts +0 -17
  215. package/dist/sveltekit_shim_app_paths.d.ts.map +0 -1
  216. package/dist/sveltekit_shim_app_paths.js +0 -10
  217. package/dist/sveltekit_shim_app_state.d.ts +0 -5
  218. package/dist/sveltekit_shim_app_state.d.ts.map +0 -1
  219. package/dist/sveltekit_shim_app_state.js +0 -26
  220. package/dist/sveltekit_shim_env.d.ts +0 -5
  221. package/dist/sveltekit_shim_env.d.ts.map +0 -1
  222. package/dist/sveltekit_shim_env.js +0 -23
  223. package/dist/sync.task.d.ts +0 -16
  224. package/dist/sync.task.d.ts.map +0 -1
  225. package/dist/sync.task.js +0 -39
  226. package/dist/task.d.ts +0 -98
  227. package/dist/task.d.ts.map +0 -1
  228. package/dist/task.js +0 -109
  229. package/dist/task_logging.d.ts +0 -6
  230. package/dist/task_logging.d.ts.map +0 -1
  231. package/dist/task_logging.js +0 -201
  232. package/dist/test.task.d.ts +0 -13
  233. package/dist/test.task.d.ts.map +0 -1
  234. package/dist/test.task.js +0 -53
  235. package/dist/typecheck.task.d.ts +0 -13
  236. package/dist/typecheck.task.d.ts.map +0 -1
  237. package/dist/typecheck.task.js +0 -68
  238. package/dist/upgrade.task.d.ts +0 -20
  239. package/dist/upgrade.task.d.ts.map +0 -1
  240. package/dist/upgrade.task.js +0 -111
  241. package/dist/watch_dir.d.ts +0 -36
  242. package/dist/watch_dir.d.ts.map +0 -1
  243. package/dist/watch_dir.js +0 -69
  244. package/src/lib/args.ts +0 -115
  245. package/src/lib/build.task.ts +0 -151
  246. package/src/lib/build_cache.ts +0 -378
  247. package/src/lib/changelog.ts +0 -69
  248. package/src/lib/changeset.task.ts +0 -228
  249. package/src/lib/changeset_helpers.ts +0 -14
  250. package/src/lib/check.task.ts +0 -120
  251. package/src/lib/child_process_logging.ts +0 -38
  252. package/src/lib/clean.task.ts +0 -48
  253. package/src/lib/clean_fs.ts +0 -54
  254. package/src/lib/cli.ts +0 -98
  255. package/src/lib/commit.task.ts +0 -34
  256. package/src/lib/constants.ts +0 -56
  257. package/src/lib/deploy.task.ts +0 -287
  258. package/src/lib/dev.task.ts +0 -52
  259. package/src/lib/disknode.ts +0 -26
  260. package/src/lib/env.ts +0 -78
  261. package/src/lib/esbuild_helpers.ts +0 -49
  262. package/src/lib/esbuild_plugin_external_worker.ts +0 -94
  263. package/src/lib/esbuild_plugin_svelte.ts +0 -134
  264. package/src/lib/esbuild_plugin_sveltekit_local_imports.ts +0 -38
  265. package/src/lib/esbuild_plugin_sveltekit_shim_alias.ts +0 -27
  266. package/src/lib/esbuild_plugin_sveltekit_shim_app.ts +0 -42
  267. package/src/lib/esbuild_plugin_sveltekit_shim_env.ts +0 -47
  268. package/src/lib/filer.ts +0 -458
  269. package/src/lib/format.task.ts +0 -44
  270. package/src/lib/format_directory.ts +0 -65
  271. package/src/lib/format_file.ts +0 -49
  272. package/src/lib/gen.task.ts +0 -206
  273. package/src/lib/gen.ts +0 -406
  274. package/src/lib/gen_helpers.ts +0 -131
  275. package/src/lib/github.ts +0 -46
  276. package/src/lib/gro.config.default.ts +0 -42
  277. package/src/lib/gro.ts +0 -29
  278. package/src/lib/gro_config.ts +0 -254
  279. package/src/lib/gro_helpers.ts +0 -108
  280. package/src/lib/gro_plugin_gen.ts +0 -149
  281. package/src/lib/gro_plugin_server.ts +0 -288
  282. package/src/lib/gro_plugin_sveltekit_app.ts +0 -58
  283. package/src/lib/gro_plugin_sveltekit_library.ts +0 -63
  284. package/src/lib/index.ts +0 -8
  285. package/src/lib/input_path.ts +0 -254
  286. package/src/lib/invoke.ts +0 -34
  287. package/src/lib/invoke_task.ts +0 -139
  288. package/src/lib/lint.task.ts +0 -39
  289. package/src/lib/loader.ts +0 -229
  290. package/src/lib/module.ts +0 -13
  291. package/src/lib/modules.ts +0 -117
  292. package/src/lib/package_json.ts +0 -255
  293. package/src/lib/parse_exports.ts +0 -100
  294. package/src/lib/parse_exports_context.ts +0 -395
  295. package/src/lib/parse_imports.ts +0 -180
  296. package/src/lib/paths.ts +0 -111
  297. package/src/lib/plugin.ts +0 -106
  298. package/src/lib/publish.task.ts +0 -228
  299. package/src/lib/register.ts +0 -3
  300. package/src/lib/reinstall.task.ts +0 -45
  301. package/src/lib/release.task.ts +0 -26
  302. package/src/lib/resolve.task.ts +0 -43
  303. package/src/lib/resolve_specifier.ts +0 -81
  304. package/src/lib/run.task.ts +0 -65
  305. package/src/lib/run_gen.ts +0 -110
  306. package/src/lib/run_task.ts +0 -82
  307. package/src/lib/source_json.ts +0 -183
  308. package/src/lib/svelte_config.ts +0 -140
  309. package/src/lib/sveltekit_helpers.ts +0 -193
  310. package/src/lib/sveltekit_shim_app.ts +0 -41
  311. package/src/lib/sveltekit_shim_app_environment.ts +0 -16
  312. package/src/lib/sveltekit_shim_app_forms.ts +0 -13
  313. package/src/lib/sveltekit_shim_app_navigation.ts +0 -23
  314. package/src/lib/sveltekit_shim_app_paths.ts +0 -26
  315. package/src/lib/sveltekit_shim_app_state.ts +0 -35
  316. package/src/lib/sveltekit_shim_env.ts +0 -45
  317. package/src/lib/sync.task.ts +0 -47
  318. package/src/lib/task.ts +0 -245
  319. package/src/lib/task_logging.ts +0 -255
  320. package/src/lib/test.task.ts +0 -63
  321. package/src/lib/typecheck.task.ts +0 -81
  322. package/src/lib/upgrade.task.ts +0 -148
  323. package/src/lib/watch_dir.ts +0 -115
package/dist/plugin.js DELETED
@@ -1,78 +0,0 @@
1
- /** See `Plugins.create` for a usage example. */
2
- export class Plugins {
3
- ctx;
4
- instances;
5
- constructor(ctx, instances) {
6
- this.ctx = ctx;
7
- this.instances = instances;
8
- }
9
- static async create(ctx) {
10
- const { timings } = ctx;
11
- const timing_to_create = timings.start('plugins.create');
12
- const instances = await ctx.config.plugins(ctx);
13
- const plugins = new Plugins(ctx, instances);
14
- timing_to_create();
15
- return plugins;
16
- }
17
- async setup() {
18
- const { ctx, instances } = this;
19
- if (!instances.length)
20
- return;
21
- const { timings, log } = ctx;
22
- const timing_to_setup = timings.start('plugins.setup');
23
- for (const plugin of instances) {
24
- if (!plugin.setup)
25
- continue;
26
- log.debug('setup plugin', plugin.name);
27
- const timing = timings.start(`setup:${plugin.name}`);
28
- await plugin.setup(ctx); // eslint-disable-line no-await-in-loop
29
- timing();
30
- }
31
- timing_to_setup();
32
- }
33
- async adapt() {
34
- const { ctx, instances } = this;
35
- const { timings } = ctx;
36
- const timing_to_run_adapters = timings.start('plugins.adapt');
37
- for (const plugin of instances) {
38
- if (!plugin.adapt)
39
- continue;
40
- const timing = timings.start(`adapt:${plugin.name}`);
41
- await plugin.adapt(ctx); // eslint-disable-line no-await-in-loop
42
- timing();
43
- }
44
- timing_to_run_adapters();
45
- }
46
- async teardown() {
47
- const { ctx, instances } = this;
48
- if (!instances.length)
49
- return;
50
- const { timings, log } = ctx;
51
- const timing_to_teardown = timings.start('plugins.teardown');
52
- for (const plugin of instances) {
53
- if (!plugin.teardown)
54
- continue;
55
- log.debug('teardown plugin', plugin.name);
56
- const timing = timings.start(`teardown:${plugin.name}`);
57
- await plugin.teardown(ctx); // eslint-disable-line no-await-in-loop
58
- timing();
59
- }
60
- timing_to_teardown();
61
- }
62
- }
63
- /**
64
- * Replaces a plugin by name in `plugins` without mutating the param.
65
- * Throws if the plugin name cannot be found.
66
- * @param plugins - accepts the same types as the return value of `PluginsCreateConfig`
67
- * @param new_plugin
68
- * @param name - @default new_plugin.name
69
- * @returns `plugins` with `new_plugin` at the index of the plugin with `name`
70
- */
71
- export const plugin_replace = (plugins, new_plugin, name = new_plugin.name) => {
72
- const index = plugins.findIndex((p) => p.name === name);
73
- if (index === -1)
74
- throw Error('Failed to find plugin to replace: ' + name);
75
- const replaced = plugins.slice();
76
- replaced[index] = new_plugin;
77
- return replaced;
78
- };
@@ -1,26 +0,0 @@
1
- import { z } from 'zod';
2
- import { type Task } from './task.ts';
3
- /** @nodocs */
4
- export declare const Args: z.ZodObject<{
5
- branch: z.ZodDefault<z.ZodString>;
6
- origin: z.ZodDefault<z.ZodString>;
7
- changelog: z.ZodDefault<z.ZodString>;
8
- preserve_changelog: z.ZodDefault<z.ZodBoolean>;
9
- optional: z.ZodDefault<z.ZodBoolean>;
10
- dry: z.ZodDefault<z.ZodBoolean>;
11
- check: z.ZodDefault<z.ZodBoolean>;
12
- 'no-check': z.ZodDefault<z.ZodBoolean>;
13
- build: z.ZodDefault<z.ZodBoolean>;
14
- 'no-build': z.ZodDefault<z.ZodBoolean>;
15
- pull: z.ZodDefault<z.ZodBoolean>;
16
- 'no-pull': z.ZodDefault<z.ZodBoolean>;
17
- sync: z.ZodDefault<z.ZodBoolean>;
18
- 'no-sync': z.ZodDefault<z.ZodBoolean>;
19
- install: z.ZodDefault<z.ZodBoolean>;
20
- 'no-install': z.ZodDefault<z.ZodBoolean>;
21
- changeset_cli: z.ZodDefault<z.ZodString>;
22
- }, z.core.$strict>;
23
- export type Args = z.infer<typeof Args>;
24
- /** @nodocs */
25
- export declare const task: Task<Args>;
26
- //# sourceMappingURL=publish.task.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publish.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publish.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAYtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAQ/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;kBAuCf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAkK3B,CAAC"}
@@ -1,176 +0,0 @@
1
- import { spawn } from '@fuzdev/fuz_util/process.js';
2
- import { z } from 'zod';
3
- import { styleText as st } from 'node:util';
4
- import { fs_exists } from '@fuzdev/fuz_util/fs.js';
5
- import { GitBranch, GitOrigin, git_check_clean_workspace, git_checkout, git_fetch, git_pull, } from '@fuzdev/fuz_util/git.js';
6
- import { TaskError } from "./task.js";
7
- import { package_json_load, package_json_parse_repo_url } from "./package_json.js";
8
- import { find_cli, spawn_cli } from "./cli.js";
9
- import { has_sveltekit_library } from "./sveltekit_helpers.js";
10
- import { update_changelog } from "./changelog.js";
11
- import { load_from_env } from "./env.js";
12
- import { CHANGESET_CLI } from "./changeset_helpers.js";
13
- /** @nodocs */
14
- export const Args = z.strictObject({
15
- branch: GitBranch.describe('branch to publish from').default('main'),
16
- origin: GitOrigin.describe('git origin to publish from').default('origin'),
17
- changelog: z
18
- .string()
19
- .meta({ description: 'file name and path of the changelog' })
20
- .default('CHANGELOG.md'),
21
- preserve_changelog: z
22
- .boolean()
23
- .meta({
24
- description: 'opt out of linkifying and formatting the changelog from @changesets/changelog-git',
25
- })
26
- .default(false),
27
- optional: z
28
- .boolean()
29
- .meta({ description: 'exit gracefully if there are no changesets' })
30
- .default(false),
31
- dry: z
32
- .boolean()
33
- .meta({ description: 'build and prepare to publish without actually publishing' })
34
- .default(false),
35
- check: z.boolean().meta({ description: 'dual of no-check' }).default(true),
36
- 'no-check': z
37
- .boolean()
38
- .meta({ description: 'opt out of checking before publishing' })
39
- .default(false),
40
- build: z.boolean().meta({ description: 'dual of no-build' }).default(true),
41
- 'no-build': z.boolean().meta({ description: 'opt out of building' }).default(false),
42
- pull: z.boolean().meta({ description: 'dual of no-pull' }).default(true),
43
- 'no-pull': z.boolean().meta({ description: 'opt out of git pull' }).default(false),
44
- sync: z.boolean().meta({ description: 'dual of no-sync' }).default(true),
45
- 'no-sync': z.boolean().meta({ description: 'opt out of gro sync' }).default(false),
46
- install: z.boolean().meta({ description: 'dual of no-install' }).default(true),
47
- 'no-install': z
48
- .boolean()
49
- .meta({ description: 'opt out of installing packages before publishing' })
50
- .default(false),
51
- changeset_cli: z.string().meta({ description: 'the changeset CLI to use' }).default(CHANGESET_CLI),
52
- });
53
- /** @nodocs */
54
- export const task = {
55
- summary: 'bump version, publish to the configured registry, and git push',
56
- Args,
57
- run: async ({ args, log, invoke_task, config }) => {
58
- const { branch, origin, changelog, preserve_changelog, dry, check, build, pull, sync, install, optional, changeset_cli, } = args;
59
- if (dry) {
60
- log.info(st('green', 'dry run!'));
61
- }
62
- const package_json = await package_json_load();
63
- const has_sveltekit_library_result = await has_sveltekit_library(package_json);
64
- if (!has_sveltekit_library_result.ok) {
65
- throw new TaskError('Failed to find SvelteKit library: ' + has_sveltekit_library_result.message);
66
- }
67
- const changelog_exists = await fs_exists(changelog);
68
- const found_changeset_cli = await find_cli(changeset_cli);
69
- if (!found_changeset_cli) {
70
- throw new TaskError('changeset command not found, install @changesets/cli locally or globally');
71
- }
72
- // Make sure we're on the right branch:
73
- await git_fetch(origin, branch);
74
- await git_checkout(branch);
75
- if (pull) {
76
- if (await git_check_clean_workspace()) {
77
- throw new TaskError('The git workspace is not clean, pass --no-pull to bypass git pull');
78
- }
79
- await git_pull(origin, branch);
80
- }
81
- // Install packages to ensure deps are current.
82
- // Handles cases like branch switches where package.json changed.
83
- // Skip gen because it will run after version bump.
84
- if (sync || install) {
85
- if (!sync)
86
- log.warn('sync is false but install is true, so running sync for install only');
87
- await invoke_task('sync', { install, gen: false });
88
- }
89
- // Check before proceeding, defaults to true.
90
- if (check) {
91
- await invoke_task('check', { workspace: true, sync: false });
92
- }
93
- let version;
94
- let optional_and_version_unchanged = false;
95
- // Bump the version so the package.json is updated before building:
96
- // TODO problem here is build may fail and put us in a bad state,
97
- // but I don't see how we could do this to robustly
98
- // have the new version in the build without building twice -
99
- // maybe the code should catch the error and revert the version and delete the tag?
100
- if (dry) {
101
- log.info('dry run, skipping changeset version');
102
- }
103
- else {
104
- if (typeof package_json.version !== 'string') {
105
- throw new TaskError('Failed to find package.json version');
106
- }
107
- const parsed_repo_url = package_json_parse_repo_url(package_json);
108
- if (!parsed_repo_url) {
109
- throw new TaskError('package.json `repository` must contain a repo url (and GitHub only for now, sorry),' +
110
- ' like `git+https://github.com/ryanatkn/gro.git` or `https://github.com/ryanatkn/gro`' +
111
- ' or an object with the `url` key');
112
- }
113
- // This is the first line that alters the repo.
114
- const changeset_version_result = await spawn_cli(found_changeset_cli, ['version'], log);
115
- if (!changeset_version_result?.ok) {
116
- throw Error('changeset version failed: no commits were made: see the error above');
117
- }
118
- if (!preserve_changelog) {
119
- const token = load_from_env('SECRET_GITHUB_API_TOKEN');
120
- if (!token) {
121
- log.warn('the env var SECRET_GITHUB_API_TOKEN was not found, so API calls with be unauthorized');
122
- }
123
- await update_changelog(parsed_repo_url.owner, parsed_repo_url.repo, changelog, token, log);
124
- }
125
- // Update package-lock.json to reflect the new version.
126
- if (install) {
127
- const install_result = await spawn(config.pm_cli, ['install']);
128
- if (!install_result.ok) {
129
- throw new TaskError(`Failed \`${config.pm_cli} install\` after version bump`);
130
- }
131
- }
132
- // Regenerate files that depend on package.json version.
133
- // The check above ensures gen is updated.
134
- await invoke_task('gen');
135
- const package_json_after_versioning = await package_json_load();
136
- version = package_json_after_versioning.version;
137
- if (package_json.version === version) {
138
- // The version didn't change.
139
- // For now this is the best detection we have for a no-op `changeset version`.
140
- if (optional) {
141
- optional_and_version_unchanged = true;
142
- }
143
- else {
144
- // Doesn't build if the version didn't change and publishing isn't optional.
145
- throw new TaskError(`\`${changeset_cli} version\` failed: are there any changes?`);
146
- }
147
- }
148
- }
149
- // Build after the version is bumped so the new version is in the build as needed.
150
- // Skip sync and install because we already handled both above.
151
- if (build) {
152
- await invoke_task('build', { sync: false, install: false });
153
- }
154
- // Return early if there are no changes and publishing is optional, but after building,
155
- // so if callers want to optimize away building
156
- // they need to do so manually like in `gro release`.
157
- // TODO this could be cleaned up if tasks had a return value to callers, it could specifiy that it didn't build
158
- if (optional_and_version_unchanged)
159
- return;
160
- if (dry) {
161
- log.info('publishing branch ' + branch);
162
- log.info(st('green', 'dry run complete!'));
163
- return;
164
- }
165
- const changeset_publish_result = await spawn_cli(found_changeset_cli, ['publish'], log);
166
- if (!changeset_publish_result?.ok) {
167
- throw new TaskError(`\`${changeset_cli} publish\` failed - continue manually or try again after running \`git reset --hard\``);
168
- }
169
- if (!changelog_exists && (await fs_exists(changelog))) {
170
- await spawn('git', ['add', changelog]);
171
- }
172
- await spawn('git', ['commit', '-a', '-m', `publish v${version}`]);
173
- await spawn('git', ['push', '--follow-tags']);
174
- log.info(st('green', `published to branch ${st('cyan', branch)}!`));
175
- },
176
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=register.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/register.ts"],"names":[],"mappings":""}
package/dist/register.js DELETED
@@ -1,2 +0,0 @@
1
- import { register } from 'node:module';
2
- register('./loader.js', import.meta.url);
@@ -1,8 +0,0 @@
1
- import { z } from 'zod';
2
- import { type Task } from './task.ts';
3
- /** @nodocs */
4
- export declare const Args: z.ZodObject<{}, z.core.$strict>;
5
- export type Args = z.infer<typeof Args>;
6
- /** @nodocs */
7
- export declare const task: Task<Args>;
8
- //# sourceMappingURL=reinstall.task.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reinstall.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/reinstall.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAG/C,cAAc;AACd,eAAO,MAAM,IAAI,iCAAqB,CAAC;AACvC,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAgC3B,CAAC"}
@@ -1,35 +0,0 @@
1
- import { z } from 'zod';
2
- import { spawn } from '@fuzdev/fuz_util/process.js';
3
- import { rm } from 'node:fs/promises';
4
- import { TaskError } from "./task.js";
5
- import { LOCKFILE_FILENAME, NODE_MODULES_DIRNAME } from "./constants.js";
6
- /** @nodocs */
7
- export const Args = z.strictObject({});
8
- /** @nodocs */
9
- export const task = {
10
- summary: `refreshes ${LOCKFILE_FILENAME} with the latest and cleanest deps`,
11
- Args,
12
- run: async ({ log, config }) => {
13
- log.info(`running the initial \`${config.pm_cli} install\``);
14
- const initial_install_result = await spawn(config.pm_cli, ['install']);
15
- if (!initial_install_result.ok) {
16
- throw new TaskError(`Failed initial \`${config.pm_cli} install\``);
17
- }
18
- // Deleting both the lockfile and node_modules upgrades to the latest minor/patch versions.
19
- await Promise.all([rm(LOCKFILE_FILENAME), rm(NODE_MODULES_DIRNAME, { recursive: true })]);
20
- log.info(`running \`${config.pm_cli} install\` after deleting ${LOCKFILE_FILENAME} and ${NODE_MODULES_DIRNAME}, this can take a while...`);
21
- const second_install_result = await spawn(config.pm_cli, ['install']);
22
- if (!second_install_result.ok) {
23
- throw new TaskError(`Failed \`${config.pm_cli} install\` after deleting ${LOCKFILE_FILENAME} and ${NODE_MODULES_DIRNAME}`);
24
- }
25
- // TODO @many this relies on npm behavior that changed in v11
26
- // Deleting the lockfile and reinstalling cleans the lockfile of unnecessary dep noise,
27
- // like esbuild's many packages for each platform.
28
- await rm(LOCKFILE_FILENAME);
29
- log.info(`running \`${config.pm_cli} install\` one last time to clean ${LOCKFILE_FILENAME}`);
30
- const final_install_result = await spawn(config.pm_cli, ['install']);
31
- if (!final_install_result.ok) {
32
- throw new TaskError(`Failed \`${config.pm_cli} install\``);
33
- }
34
- },
35
- };
@@ -1,8 +0,0 @@
1
- import { z } from 'zod';
2
- import type { Task } from './task.ts';
3
- /** @nodocs */
4
- export declare const Args: z.ZodObject<{}, z.core.$strict>;
5
- export type Args = z.infer<typeof Args>;
6
- /** @nodocs */
7
- export declare const task: Task<Args>;
8
- //# sourceMappingURL=release.task.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"release.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/release.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAIpC,cAAc;AACd,eAAO,MAAM,IAAI,iCAAqB,CAAC;AACvC,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAc3B,CAAC"}
@@ -1,20 +0,0 @@
1
- import { z } from 'zod';
2
- import { has_sveltekit_library, has_sveltekit_app } from "./sveltekit_helpers.js";
3
- import { package_json_load } from "./package_json.js";
4
- /** @nodocs */
5
- export const Args = z.strictObject({});
6
- /** @nodocs */
7
- export const task = {
8
- summary: 'publish and deploy',
9
- Args,
10
- run: async ({ invoke_task }) => {
11
- const package_json = await package_json_load();
12
- const publish = (await has_sveltekit_library(package_json)).ok;
13
- if (publish) {
14
- await invoke_task('publish', { optional: true });
15
- }
16
- if ((await has_sveltekit_app()).ok) {
17
- await invoke_task('deploy', { build: !publish });
18
- }
19
- },
20
- };
@@ -1,11 +0,0 @@
1
- import { z } from 'zod';
2
- import { type Task } from './task.ts';
3
- /** @nodocs */
4
- export declare const Args: z.ZodObject<{
5
- _: z.ZodDefault<z.ZodArray<z.ZodString>>;
6
- verbose: z.ZodDefault<z.ZodBoolean>;
7
- }, z.core.$strict>;
8
- export type Args = z.infer<typeof Args>;
9
- /** @nodocs */
10
- export declare const task: Task<Args>;
11
- //# sourceMappingURL=resolve.task.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/resolve.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAqB,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAGxD,cAAc;AACd,eAAO,MAAM,IAAI;;;kBAGf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA4B3B,CAAC"}
@@ -1,38 +0,0 @@
1
- import { z } from 'zod';
2
- import { styleText as st } from 'node:util';
3
- import { TASK_FILE_SUFFIXES } from "./task.js";
4
- import { resolve_input_paths, to_input_paths } from "./input_path.js";
5
- /** @nodocs */
6
- export const Args = z.strictObject({
7
- _: z.array(z.string()).meta({ description: 'the input paths to resolve' }).default(['']),
8
- verbose: z.boolean().meta({ description: 'log diagnostics' }).default(false),
9
- });
10
- /** @nodocs */
11
- export const task = {
12
- summary: 'diagnostic that logs resolved filesystem info for the given input paths',
13
- Args,
14
- run: async ({ args, config, log }) => {
15
- const { _, verbose } = args;
16
- if (verbose)
17
- log.info('raw input paths:', _);
18
- const input_paths = to_input_paths(_);
19
- if (verbose)
20
- log.info('input paths:', input_paths);
21
- const { task_root_dirs } = config;
22
- if (verbose)
23
- log.info('task root paths:', task_root_dirs);
24
- const { resolved_input_paths, possible_paths_by_input_path, unmapped_input_paths } = await resolve_input_paths(input_paths, task_root_dirs, TASK_FILE_SUFFIXES);
25
- if (verbose)
26
- log.info('resolved_input_paths:', resolved_input_paths);
27
- if (verbose)
28
- log.info('possible_paths_by_input_path:', possible_paths_by_input_path);
29
- if (verbose)
30
- log.info('unmapped_input_paths:', unmapped_input_paths);
31
- for (const p of resolved_input_paths) {
32
- log.info('resolved:', st('green', p.id));
33
- }
34
- if (!resolved_input_paths.length) {
35
- log.warn(st('yellow', 'no input paths were resolved'));
36
- }
37
- },
38
- };
@@ -1,22 +0,0 @@
1
- import type { PathId } from '@fuzdev/fuz_util/path.js';
2
- export interface ResolvedSpecifier {
3
- /**
4
- * The resolved filesystem path for the specifier.
5
- */
6
- path_id: PathId;
7
- /**
8
- * Same as `path_id` but includes `?raw` and other querystrings. (currently none)
9
- */
10
- path_id_with_querystring: string;
11
- specifier: string;
12
- mapped_specifier: string;
13
- namespace: undefined | 'sveltekit_local_imports_ts' | 'sveltekit_local_imports_js';
14
- raw: boolean;
15
- }
16
- /**
17
- * Maps an import `specifier` relative to `dir`,
18
- * and infer the correct extension following Vite conventions.
19
- * If no `.js` file is found for the specifier on the filesystem, it assumes `.ts`.
20
- */
21
- export declare const resolve_specifier: (specifier: string, dir: string) => Promise<ResolvedSpecifier>;
22
- //# sourceMappingURL=resolve_specifier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve_specifier.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/resolve_specifier.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAMrD,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,SAAS,GAAG,4BAA4B,GAAG,4BAA4B,CAAC;IACnF,GAAG,EAAE,OAAO,CAAC;CACb;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC7B,WAAW,MAAM,EACjB,KAAK,MAAM,KACT,OAAO,CAAC,iBAAiB,CAiD3B,CAAC"}
@@ -1,57 +0,0 @@
1
- import { extname, isAbsolute, join, relative } from 'node:path';
2
- import { fs_exists } from '@fuzdev/fuz_util/fs.js';
3
- import { replace_extension } from "./paths.js";
4
- /**
5
- * Maps an import `specifier` relative to `dir`,
6
- * and infer the correct extension following Vite conventions.
7
- * If no `.js` file is found for the specifier on the filesystem, it assumes `.ts`.
8
- */
9
- export const resolve_specifier = async (specifier, dir) => {
10
- const raw = specifier.endsWith('?raw'); // TODO more robust detection? other values?
11
- const final_specifier = raw ? specifier.substring(0, specifier.length - 4) : specifier;
12
- const absolute_path = isAbsolute(final_specifier) ? final_specifier : join(dir, final_specifier);
13
- let mapped_path;
14
- let path_id;
15
- let namespace;
16
- const ext = extname(absolute_path);
17
- const is_js = ext === '.js';
18
- const is_ts = ext === '.ts';
19
- if (!is_js && !is_ts && (await fs_exists(absolute_path))) {
20
- // unrecognized extension and the file exists
21
- mapped_path = absolute_path;
22
- path_id = absolute_path;
23
- }
24
- else if (is_ts) {
25
- // explicitly ts
26
- mapped_path = replace_extension(absolute_path, '.js');
27
- path_id = absolute_path;
28
- namespace = 'sveltekit_local_imports_ts';
29
- }
30
- else {
31
- // extensionless, or js that points to ts, or just js
32
- const js_id = is_js ? absolute_path : absolute_path + '.js';
33
- const ts_id = is_js ? replace_extension(absolute_path, '.ts') : absolute_path + '.ts';
34
- const [ts_exists, js_exists] = await Promise.all([fs_exists(ts_id), fs_exists(js_id)]);
35
- if (!ts_exists && js_exists) {
36
- mapped_path = js_id;
37
- path_id = js_id;
38
- namespace = 'sveltekit_local_imports_js';
39
- }
40
- else {
41
- mapped_path = js_id;
42
- path_id = ts_id;
43
- namespace = 'sveltekit_local_imports_ts';
44
- }
45
- }
46
- let mapped_specifier = relative(dir, mapped_path);
47
- if (mapped_specifier[0] !== '.')
48
- mapped_specifier = './' + mapped_specifier;
49
- return {
50
- path_id,
51
- path_id_with_querystring: raw ? path_id + '?raw' : path_id,
52
- raw,
53
- specifier,
54
- mapped_specifier,
55
- namespace,
56
- };
57
- };
@@ -1,16 +0,0 @@
1
- import { z } from 'zod';
2
- import { type Task } from './task.ts';
3
- /**
4
- * Runs a TypeScript file with Gro's loader, forwarding all args to the script.
5
- * Useful for scripts that need SvelteKit shims ($lib, $env, etc).
6
- *
7
- * @module
8
- */
9
- /** @nodocs */
10
- export declare const Args: z.ZodObject<{
11
- _: z.ZodDefault<z.ZodArray<z.ZodString>>;
12
- }, z.core.$catchall<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
13
- export type Args = z.infer<typeof Args>;
14
- /** @nodocs */
15
- export declare const task: Task<Args>;
16
- //# sourceMappingURL=run.task.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/run.task.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/C;;;;;GAKG;AAEH,cAAc;AACd,eAAO,MAAM,IAAI;;8JAWf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA+B3B,CAAC"}
package/dist/run.task.js DELETED
@@ -1,52 +0,0 @@
1
- import { args_serialize } from '@fuzdev/fuz_util/args.js';
2
- import { fs_exists } from '@fuzdev/fuz_util/fs.js';
3
- import { spawn_result_to_message } from '@fuzdev/fuz_util/process.js';
4
- import { styleText as st } from 'node:util';
5
- import { z } from 'zod';
6
- import { to_implicit_forwarded_args } from "./args.js";
7
- import { resolve_gro_module_path, spawn_with_loader } from "./gro_helpers.js";
8
- import { TaskError } from "./task.js";
9
- /**
10
- * Runs a TypeScript file with Gro's loader, forwarding all args to the script.
11
- * Useful for scripts that need SvelteKit shims ($lib, $env, etc).
12
- *
13
- * @module
14
- */
15
- /** @nodocs */
16
- export const Args = z
17
- .object({
18
- _: z.array(z.string()).meta({ description: 'the file path to run' }).default([]),
19
- })
20
- .catchall(z.union([
21
- z.string(),
22
- z.number(),
23
- z.boolean(),
24
- z.array(z.union([z.string(), z.number(), z.boolean()])),
25
- ]));
26
- /** @nodocs */
27
- export const task = {
28
- summary: 'execute a file with the loader, like `node` but works for TypeScript',
29
- Args,
30
- run: async ({ args, log }) => {
31
- const { _, ...forwarded_args } = args;
32
- const [path, ...positional_argv] = _;
33
- if (!path) {
34
- log.info(st('green', '\n\nUsage: ') + st('cyan', 'gro run path/to/file.ts [...args]\n'));
35
- return;
36
- }
37
- if (!(await fs_exists(path))) {
38
- throw new TaskError('Cannot find file to run at path: ' + path);
39
- }
40
- // Get args after `--` without requiring a command name.
41
- // This allows `gro run script.ts -- --help` to pass --help to the script.
42
- const implicit_args = to_implicit_forwarded_args();
43
- // Reconstruct argv: positional args + explicit named args + implicit args after --
44
- const named_argv = args_serialize({ ...forwarded_args, ...implicit_args });
45
- const full_argv = [...positional_argv, ...named_argv];
46
- const loader_path = resolve_gro_module_path('loader.js');
47
- const spawned = await spawn_with_loader(loader_path, path, full_argv);
48
- if (!spawned.ok) {
49
- throw new TaskError(`\`gro run ${path}\` failed: ${spawn_result_to_message(spawned)}`);
50
- }
51
- },
52
- };
package/dist/run_gen.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { Timings } from '@fuzdev/fuz_util/timings.js';
2
- import type { Logger } from '@fuzdev/fuz_util/log.js';
3
- import { type GenResults, type GenfileModuleMeta } from './gen.ts';
4
- import type { format_file as base_format_file } from './format_file.ts';
5
- import type { GroConfig } from './gro_config.ts';
6
- import type { Filer } from './filer.ts';
7
- import type { InvokeTask } from './task.ts';
8
- export declare const GEN_NO_PROD_MESSAGE = "gen runs only during development";
9
- export declare const run_gen: (gen_modules: Array<GenfileModuleMeta>, config: GroConfig, filer: Filer, log: Logger, timings: Timings, invoke_task: InvokeTask, format_file?: typeof base_format_file) => Promise<GenResults>;
10
- //# sourceMappingURL=run_gen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run_gen.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/run_gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EACN,KAAK,UAAU,EAGf,KAAK,iBAAiB,EAItB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAC,WAAW,IAAI,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAE1C,eAAO,MAAM,mBAAmB,qCAAqC,CAAC;AAEtE,eAAO,MAAM,OAAO,GACnB,aAAa,KAAK,CAAC,iBAAiB,CAAC,EACrC,QAAQ,SAAS,EACjB,OAAO,KAAK,EACZ,KAAK,MAAM,EACX,SAAS,OAAO,EAChB,aAAa,UAAU,EACvB,cAAc,OAAO,gBAAgB,KACnC,OAAO,CAAC,UAAU,CA6EpB,CAAC"}