@ryanatkn/gro 0.160.0 → 0.161.1

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 (136) hide show
  1. package/README.md +2 -2
  2. package/dist/args.d.ts +1 -1
  3. package/dist/args.d.ts.map +1 -1
  4. package/dist/build.task.d.ts +1 -11
  5. package/dist/build.task.d.ts.map +1 -1
  6. package/dist/build.task.js +7 -8
  7. package/dist/changeset.task.d.ts +6 -25
  8. package/dist/changeset.task.d.ts.map +1 -1
  9. package/dist/changeset.task.js +13 -12
  10. package/dist/changeset_helpers.d.ts +10 -2
  11. package/dist/changeset_helpers.d.ts.map +1 -1
  12. package/dist/check.task.d.ts +1 -37
  13. package/dist/check.task.d.ts.map +1 -1
  14. package/dist/check.task.js +24 -21
  15. package/dist/clean.task.d.ts +1 -15
  16. package/dist/clean.task.d.ts.map +1 -1
  17. package/dist/clean.task.js +9 -9
  18. package/dist/commit.task.d.ts +2 -8
  19. package/dist/commit.task.d.ts.map +1 -1
  20. package/dist/commit.task.js +4 -5
  21. package/dist/deploy.task.d.ts +1 -25
  22. package/dist/deploy.task.d.ts.map +1 -1
  23. package/dist/deploy.task.js +15 -12
  24. package/dist/dev.task.d.ts +1 -15
  25. package/dist/dev.task.d.ts.map +1 -1
  26. package/dist/dev.task.js +10 -10
  27. package/dist/filer.d.ts +1 -1
  28. package/dist/filer.d.ts.map +1 -1
  29. package/dist/format.task.d.ts +1 -5
  30. package/dist/format.task.d.ts.map +1 -1
  31. package/dist/format.task.js +4 -5
  32. package/dist/gen.d.ts +0 -9
  33. package/dist/gen.d.ts.map +1 -1
  34. package/dist/gen.js +0 -4
  35. package/dist/gen.task.d.ts +3 -11
  36. package/dist/gen.task.d.ts.map +1 -1
  37. package/dist/gen.task.js +10 -7
  38. package/dist/github.d.ts +2 -22
  39. package/dist/github.d.ts.map +1 -1
  40. package/dist/github.js +2 -2
  41. package/dist/lint.task.d.ts +2 -8
  42. package/dist/lint.task.d.ts.map +1 -1
  43. package/dist/lint.task.js +4 -6
  44. package/dist/package.d.ts +4 -1212
  45. package/dist/package.d.ts.map +1 -1
  46. package/dist/package.gen.d.ts.map +1 -1
  47. package/dist/package.gen.js +5 -5
  48. package/dist/package.js +19 -44
  49. package/dist/package_json.d.ts +1 -361
  50. package/dist/package_json.d.ts.map +1 -1
  51. package/dist/package_json.js +2 -114
  52. package/dist/parse_exports.d.ts +2 -2
  53. package/dist/parse_exports.d.ts.map +1 -1
  54. package/dist/parse_exports_context.d.ts.map +1 -1
  55. package/dist/publish.task.d.ts +1 -29
  56. package/dist/publish.task.d.ts.map +1 -1
  57. package/dist/publish.task.js +22 -15
  58. package/dist/reinstall.task.d.ts +1 -1
  59. package/dist/reinstall.task.d.ts.map +1 -1
  60. package/dist/reinstall.task.js +2 -1
  61. package/dist/release.task.d.ts +1 -1
  62. package/dist/release.task.d.ts.map +1 -1
  63. package/dist/release.task.js +1 -1
  64. package/dist/resolve.task.d.ts +2 -8
  65. package/dist/resolve.task.d.ts.map +1 -1
  66. package/dist/resolve.task.js +4 -6
  67. package/dist/run.task.d.ts +2 -6
  68. package/dist/run.task.d.ts.map +1 -1
  69. package/dist/run.task.js +7 -5
  70. package/dist/run_task.d.ts.map +1 -1
  71. package/dist/run_task.js +2 -2
  72. package/dist/src_json.d.ts +2 -288
  73. package/dist/src_json.d.ts.map +1 -1
  74. package/dist/src_json.js +2 -45
  75. package/dist/sveltekit_helpers.d.ts +1 -1
  76. package/dist/sveltekit_helpers.d.ts.map +1 -1
  77. package/dist/sveltekit_helpers.js +1 -1
  78. package/dist/sveltekit_shim_app_paths.d.ts +4 -1
  79. package/dist/sveltekit_shim_app_paths.d.ts.map +1 -1
  80. package/dist/sveltekit_shim_app_paths.js +4 -1
  81. package/dist/sync.task.d.ts +1 -19
  82. package/dist/sync.task.d.ts.map +1 -1
  83. package/dist/sync.task.js +10 -12
  84. package/dist/task.d.ts +2 -2
  85. package/dist/task.d.ts.map +1 -1
  86. package/dist/task_logging.js +114 -47
  87. package/dist/test.task.d.ts +3 -13
  88. package/dist/test.task.d.ts.map +1 -1
  89. package/dist/test.task.js +8 -8
  90. package/dist/typecheck.task.d.ts +1 -11
  91. package/dist/typecheck.task.d.ts.map +1 -1
  92. package/dist/typecheck.task.js +10 -9
  93. package/dist/upgrade.task.d.ts +3 -27
  94. package/dist/upgrade.task.d.ts.map +1 -1
  95. package/dist/upgrade.task.js +20 -14
  96. package/package.json +19 -23
  97. package/src/lib/args.ts +5 -5
  98. package/src/lib/build.task.ts +9 -10
  99. package/src/lib/changeset.task.ts +27 -26
  100. package/src/lib/changeset_helpers.ts +1 -0
  101. package/src/lib/check.task.ts +28 -25
  102. package/src/lib/clean.task.ts +17 -17
  103. package/src/lib/commit.task.ts +9 -10
  104. package/src/lib/deploy.task.ts +32 -31
  105. package/src/lib/dev.task.ts +16 -17
  106. package/src/lib/filer.ts +1 -1
  107. package/src/lib/format.task.ts +6 -7
  108. package/src/lib/gen.task.ts +14 -11
  109. package/src/lib/gen.ts +0 -6
  110. package/src/lib/github.ts +2 -2
  111. package/src/lib/lint.task.ts +4 -6
  112. package/src/lib/package.gen.ts +7 -6
  113. package/src/lib/package.ts +25 -50
  114. package/src/lib/package_json.ts +3 -140
  115. package/src/lib/parse_exports.ts +2 -10
  116. package/src/lib/parse_exports_context.ts +9 -5
  117. package/src/lib/publish.task.ts +33 -26
  118. package/src/lib/reinstall.task.ts +2 -1
  119. package/src/lib/release.task.ts +1 -1
  120. package/src/lib/resolve.task.ts +4 -6
  121. package/src/lib/run.task.ts +10 -7
  122. package/src/lib/run_task.ts +4 -2
  123. package/src/lib/src_json.ts +3 -59
  124. package/src/lib/sveltekit_helpers.ts +2 -1
  125. package/src/lib/sveltekit_shim_app_paths.ts +5 -2
  126. package/src/lib/sveltekit_shim_app_state.ts +1 -1
  127. package/src/lib/sync.task.ts +10 -12
  128. package/src/lib/task.ts +2 -2
  129. package/src/lib/task_logging.ts +127 -49
  130. package/src/lib/test.task.ts +12 -12
  131. package/src/lib/typecheck.task.ts +16 -15
  132. package/src/lib/upgrade.task.ts +34 -28
  133. package/dist/package_meta.d.ts +0 -23
  134. package/dist/package_meta.d.ts.map +0 -1
  135. package/dist/package_meta.js +0 -56
  136. package/src/lib/package_meta.ts +0 -97
@@ -1,7 +1,7 @@
1
1
  import { styleText as st } from 'node:util';
2
2
  import { plural } from '@ryanatkn/belt/string.js';
3
3
  import { print_value } from '@ryanatkn/belt/print.js';
4
- import { ZodFirstPartyTypeKind } from 'zod';
4
+ import { z } from 'zod';
5
5
  import { print_path } from "./paths.js";
6
6
  export const log_tasks = (log, loaded_tasks, log_intro = true) => {
7
7
  const { modules, found_tasks } = loaded_tasks;
@@ -36,7 +36,7 @@ export const log_task_help = (log, meta) => {
36
36
  const logged = [];
37
37
  logged.push(st('cyan', name), 'help', st('cyan', `\n\ngro ${name}`) + `: ${task.summary ?? '(no summary available)'}\n`);
38
38
  if (task.Args) {
39
- const properties = to_arg_properties(task.Args._def, meta);
39
+ const properties = to_arg_properties(task.Args, meta, log);
40
40
  // TODO hacky padding for some quick and dirty tables
41
41
  const longest_task_name = Math.max(ARGS_PROPERTY_NAME.length, to_max_length(properties, (p) => p.name));
42
42
  const longest_type = to_max_length(properties, (p) => p.schema.type);
@@ -51,12 +51,15 @@ export const log_task_help = (log, meta) => {
51
51
  }
52
52
  log.info(...logged, '\n');
53
53
  };
54
- const to_arg_properties = (def, meta) => {
55
- const type_name = to_type_name(def);
56
- if (type_name !== ZodFirstPartyTypeKind.ZodObject) {
57
- throw Error(`Expected Args for task "${meta.name}" to be a ZodObject schema but got ${type_name}`);
54
+ // TODO this blocks many usecases like unions, and it's only implemented for CLI arg types, need better support for arbitrary schemas
55
+ const to_arg_properties = (schema, meta, log) => {
56
+ const { def } = schema;
57
+ // TODO overly restrictive, support optional objects and/or unions?
58
+ if (!('shape' in def)) {
59
+ log.error(`Expected Args for task "${meta.name}" to be an object schema but got ${def.type}`);
60
+ return [];
58
61
  }
59
- const shape = def.shape();
62
+ const shape = def.shape;
60
63
  const properties = [];
61
64
  for (const name in shape) {
62
65
  if ('no-' + name in shape)
@@ -64,7 +67,7 @@ const to_arg_properties = (def, meta) => {
64
67
  const s = shape[name];
65
68
  const schema = {
66
69
  type: to_args_schema_type(s),
67
- description: to_args_schema_description(s),
70
+ description: to_args_schema_description(s) || '',
68
71
  default: to_args_schema_default(s),
69
72
  };
70
73
  properties.push({ name, schema });
@@ -72,63 +75,127 @@ const to_arg_properties = (def, meta) => {
72
75
  return properties;
73
76
  };
74
77
  const to_max_length = (items, toString) => items.reduce((max, m) => Math.max(toString(m).length, max), 0);
75
- // The following Zod helpers only need to support single-depth schemas for CLI args,
76
- // but there's generic recursion to handle things like `ZodOptional` and `ZodDefault`.
77
- const to_type_name = (def) => def.typeName;
78
- const to_args_schema_type = ({ _def }) => {
79
- const t = to_type_name(_def);
80
- switch (t) {
81
- case ZodFirstPartyTypeKind.ZodBoolean:
82
- return 'boolean';
83
- case ZodFirstPartyTypeKind.ZodString:
78
+ const to_args_schema_type = (schema) => {
79
+ const { def } = schema._zod;
80
+ switch (def.type) {
81
+ case 'string':
84
82
  return 'string';
85
- case ZodFirstPartyTypeKind.ZodNumber:
83
+ case 'number':
86
84
  return 'number';
87
- case ZodFirstPartyTypeKind.ZodArray:
88
- return 'Array<string>'; // TODO support arrays of arbitrary types, or more hardcoded ones as needed
89
- case ZodFirstPartyTypeKind.ZodEnum:
90
- return _def.values.map((v) => `'${v}'`).join(' | ');
91
- case ZodFirstPartyTypeKind.ZodUnion:
92
- return 'string | Array<string>'; // TODO support unions of arbitrary types, or more hardcoded ones as needed
85
+ case 'int':
86
+ return 'int';
87
+ case 'boolean':
88
+ return 'boolean';
89
+ case 'bigint':
90
+ return 'bigint';
91
+ case 'symbol':
92
+ return 'symbol';
93
+ case 'null':
94
+ return 'null';
95
+ case 'undefined':
96
+ return 'undefined';
97
+ case 'void':
98
+ return 'void';
99
+ case 'never':
100
+ return 'never';
101
+ case 'any':
102
+ return 'any';
103
+ case 'unknown':
104
+ return 'unknown';
105
+ case 'date':
106
+ return 'date';
107
+ case 'object':
108
+ return 'object';
109
+ case 'record':
110
+ return 'record';
111
+ case 'file':
112
+ return 'file';
113
+ case 'array':
114
+ // TODO other types, only handling a subset of CLI arg cases
115
+ return 'Array<string>';
116
+ case 'tuple':
117
+ return 'tuple';
118
+ case 'union':
119
+ // TODO fix, this is a hacky way to handle unions for CLI args
120
+ return 'string | Array<string>';
121
+ case 'intersection':
122
+ return 'intersection';
123
+ case 'map':
124
+ return 'map';
125
+ case 'set':
126
+ return 'set';
127
+ case 'enum':
128
+ return schema.options
129
+ .map((v) => `'${v}'`)
130
+ .join(' | ');
131
+ case 'literal':
132
+ return def.values.map((v) => print_value(v)).join(' | ');
133
+ case 'nullable': {
134
+ const subschema = to_subschema(def);
135
+ return subschema ? to_args_schema_type(subschema) + ' | null' : 'nullable';
136
+ }
137
+ case 'optional': {
138
+ const subschema = to_subschema(def);
139
+ return subschema ? to_args_schema_type(subschema) + ' | undefined' : 'optional';
140
+ }
141
+ case 'success':
142
+ return 'success';
143
+ case 'catch':
144
+ return 'catch';
145
+ case 'nan':
146
+ return 'NaN';
147
+ case 'readonly':
148
+ return 'readonly';
149
+ case 'template_literal':
150
+ return 'template_literal';
151
+ case 'promise':
152
+ return 'promise';
153
+ case 'lazy':
154
+ return 'lazy';
155
+ case 'custom':
156
+ return 'custom';
157
+ // Unwrap these:
158
+ // case 'nonoptional':
159
+ // case 'transform':
160
+ // case 'default':
161
+ // case 'prefault':
162
+ // case 'pipe':
93
163
  default: {
94
- const subschema = to_subschema(_def);
95
- if (subschema) {
96
- return to_args_schema_type(subschema);
97
- }
98
- else {
99
- throw Error('Unknown zod type ' + t);
100
- }
164
+ const subschema = to_subschema(def);
165
+ return subschema ? to_args_schema_type(subschema) : def.type;
101
166
  }
102
167
  }
103
168
  };
104
- const to_args_schema_description = ({ _def }) => {
105
- if (_def.description) {
106
- return _def.description;
169
+ const to_args_schema_description = (schema) => {
170
+ const meta = schema.meta();
171
+ if (meta?.description) {
172
+ return meta.description;
107
173
  }
108
- const subschema = to_subschema(_def);
174
+ const subschema = to_subschema(schema.def);
109
175
  if (subschema) {
110
176
  return to_args_schema_description(subschema);
111
177
  }
112
- return '';
178
+ return null;
113
179
  };
114
- const to_args_schema_default = ({ _def }) => {
115
- if (_def.defaultValue) {
116
- return _def.defaultValue();
180
+ const to_args_schema_default = (schema) => {
181
+ const { def } = schema._zod;
182
+ if ('defaultValue' in def) {
183
+ return def.defaultValue;
117
184
  }
118
- const subschema = to_subschema(_def);
185
+ const subschema = to_subschema(def);
119
186
  if (subschema) {
120
187
  return to_args_schema_default(subschema);
121
188
  }
122
189
  };
123
- const to_subschema = (_def) => {
124
- if ('type' in _def) {
125
- return _def.type;
190
+ const to_subschema = (def) => {
191
+ if ('innerType' in def) {
192
+ return def.innerType;
126
193
  }
127
- else if ('innerType' in _def) {
128
- return _def.innerType;
194
+ else if ('in' in def) {
195
+ return def.in;
129
196
  }
130
- else if ('schema' in _def) {
131
- return _def.schema;
197
+ else if ('schema' in def) {
198
+ return def.schema;
132
199
  }
133
200
  return undefined;
134
201
  };
@@ -1,21 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { type Task } from './task.ts';
3
3
  export declare const Args: z.ZodObject<{
4
- _: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4
+ _: z.ZodDefault<z.ZodArray<z.ZodString>>;
5
5
  bail: z.ZodDefault<z.ZodBoolean>;
6
6
  cwd: z.ZodOptional<z.ZodString>;
7
- ignore: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
8
- }, "strict", z.ZodTypeAny, {
9
- _: string[];
10
- bail: boolean;
11
- cwd?: string | undefined;
12
- ignore?: string | string[] | undefined;
13
- }, {
14
- _?: string[] | undefined;
15
- cwd?: string | undefined;
16
- ignore?: string | string[] | undefined;
17
- bail?: boolean | undefined;
18
- }>;
7
+ ignore: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
8
+ }, z.core.$strict>;
19
9
  export type Args = z.infer<typeof Args>;
20
10
  export declare const task: Task<Args>;
21
11
  //# sourceMappingURL=test.task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/test.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;EAWP,CAAC;AACX,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA4B3B,CAAC"}
1
+ {"version":3,"file":"test.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/test.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,IAAI;;;;;kBAWf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA4B3B,CAAC"}
package/dist/test.task.js CHANGED
@@ -3,18 +3,18 @@ import { z } from 'zod';
3
3
  import { Task_Error } from "./task.js";
4
4
  import { paths } from "./paths.js";
5
5
  import { find_cli } from "./cli.js";
6
- export const Args = z
7
- .object({
8
- _: z.array(z.string(), { description: 'file patterns to test' }).default([`\\.test\\.ts$`]), // TODO maybe use uvu's default instead of being restrictive?
6
+ export const Args = z.strictObject({
7
+ _: z.array(z.string()).meta({ description: 'file patterns to test' }).default([`\\.test\\.ts$`]), // TODO maybe use uvu's default instead of being restrictive?
9
8
  bail: z
10
- .boolean({ description: 'the bail option to uvu run, exit immediately on failure' })
9
+ .boolean()
10
+ .meta({ description: 'the bail option to uvu run, exit immediately on failure' })
11
11
  .default(false),
12
- cwd: z.string({ description: 'the cwd option to uvu parse' }).optional(),
12
+ cwd: z.string().meta({ description: 'the cwd option to uvu parse' }).optional(),
13
13
  ignore: z
14
- .union([z.string(), z.array(z.string())], { description: 'the ignore option to uvu parse' })
14
+ .union([z.string(), z.array(z.string())])
15
+ .meta({ description: 'the ignore option to uvu parse' })
15
16
  .optional(),
16
- })
17
- .strict();
17
+ });
18
18
  export const task = {
19
19
  summary: 'run tests with uvu',
20
20
  Args,
@@ -5,17 +5,7 @@ export declare const Args: z.ZodObject<{
5
5
  typescript_cli: z.ZodDefault<z.ZodString>;
6
6
  path_replacement: z.ZodDefault<z.ZodString>;
7
7
  cwd: z.ZodDefault<z.ZodString>;
8
- }, "strict", z.ZodTypeAny, {
9
- cwd: string;
10
- svelte_check_cli: string;
11
- typescript_cli: string;
12
- path_replacement: string;
13
- }, {
14
- cwd?: string | undefined;
15
- svelte_check_cli?: string | undefined;
16
- typescript_cli?: string | undefined;
17
- path_replacement?: string | undefined;
18
- }>;
8
+ }, z.core.$strict>;
19
9
  export type Args = z.infer<typeof Args>;
20
10
  export declare const task: Task<Args>;
21
11
  //# sourceMappingURL=typecheck.task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typecheck.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typecheck.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAOhD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;EAaP,CAAC;AACX,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAiD3B,CAAC"}
1
+ {"version":3,"file":"typecheck.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typecheck.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAOhD,eAAO,MAAM,IAAI;;;;;kBAcf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAiD3B,CAAC"}
@@ -6,22 +6,23 @@ import { find_cli, spawn_cli, spawn_cli_process } from "./cli.js";
6
6
  import { SVELTE_CHECK_CLI, sveltekit_sync_if_available } from "./sveltekit_helpers.js";
7
7
  import { configure_colored_output_with_path_replacement } from "./child_process_logging.js";
8
8
  import { paths } from "./paths.js";
9
- export const Args = z
10
- .object({
9
+ export const Args = z.strictObject({
11
10
  svelte_check_cli: z
12
- .string({ description: 'the svelte-check CLI to use' })
11
+ .string()
12
+ .meta({ description: 'the svelte-check CLI to use' })
13
13
  .default(SVELTE_CHECK_CLI),
14
14
  typescript_cli: z
15
- .string({ description: 'the TypeScript CLI to use as a fallback to svelte-check' })
15
+ .string()
16
+ .meta({ description: 'the TypeScript CLI to use as a fallback to svelte-check' })
16
17
  .default('tsc'),
17
18
  path_replacement: z
18
- .string({ description: 'replacement string for current working directory in output' })
19
+ .string()
20
+ .meta({ description: 'replacement string for current working directory in output' })
19
21
  .default('.'),
20
- cwd: z.string({ description: 'current working directory' }).default(paths.root),
21
- })
22
- .strict();
22
+ cwd: z.string().meta({ description: 'current working directory' }).default(paths.root),
23
+ });
23
24
  export const task = {
24
- summary: 'run tsc on the project without emitting any files',
25
+ summary: 'run svelte-check or tsc on the project without emitting any files',
25
26
  Args,
26
27
  run: async ({ args, log }) => {
27
28
  const { svelte_check_cli, typescript_cli, path_replacement, cwd } = args;
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { type Task } from './task.ts';
3
3
  export declare const Args: z.ZodObject<{
4
- _: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5
- only: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>, string[], string | string[] | undefined>;
4
+ _: z.ZodDefault<z.ZodArray<z.ZodString>>;
5
+ only: z.ZodPipe<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>, z.ZodTransform<string[], string | string[]>>;
6
6
  origin: z.ZodDefault<z.ZodString>;
7
7
  force: z.ZodDefault<z.ZodBoolean>;
8
8
  pull: z.ZodDefault<z.ZodBoolean>;
@@ -12,31 +12,7 @@ export declare const Args: z.ZodObject<{
12
12
  delete_lockfile: z.ZodDefault<z.ZodBoolean>;
13
13
  lockfile_path: z.ZodDefault<z.ZodString>;
14
14
  dry: z.ZodDefault<z.ZodBoolean>;
15
- }, "strict", z.ZodTypeAny, {
16
- _: string[];
17
- origin: string;
18
- pull: boolean;
19
- dry: boolean;
20
- force: boolean;
21
- 'no-pull': boolean;
22
- only: string[];
23
- delete_node_modules: boolean;
24
- node_modules_path: string;
25
- delete_lockfile: boolean;
26
- lockfile_path: string;
27
- }, {
28
- _?: string[] | undefined;
29
- origin?: string | undefined;
30
- pull?: boolean | undefined;
31
- dry?: boolean | undefined;
32
- force?: boolean | undefined;
33
- 'no-pull'?: boolean | undefined;
34
- only?: string | string[] | undefined;
35
- delete_node_modules?: boolean | undefined;
36
- node_modules_path?: string | undefined;
37
- delete_lockfile?: boolean | undefined;
38
- lockfile_path?: string | undefined;
39
- }>;
15
+ }, z.core.$strict>;
40
16
  export type Args = z.infer<typeof Args>;
41
17
  export declare const task: Task<Args>;
42
18
  //# sourceMappingURL=upgrade.task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/upgrade.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAOhD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BP,CAAC;AACX,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA2E3B,CAAC"}
1
+ {"version":3,"file":"upgrade.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/upgrade.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAOhD,eAAO,MAAM,IAAI;;;;;;;;;;;;kBAiCf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA2E3B,CAAC"}
@@ -7,34 +7,40 @@ import { Git_Origin, git_pull } from "./git.js";
7
7
  import { spawn_cli } from "./cli.js";
8
8
  import { serialize_args, to_forwarded_args } from "./args.js";
9
9
  import { NODE_MODULES_DIRNAME } from "./constants.js";
10
- export const Args = z
11
- .object({
12
- _: z.array(z.string(), { description: 'names of deps to exclude from the upgrade' }).default([]),
10
+ export const Args = z.strictObject({
11
+ _: z
12
+ .array(z.string())
13
+ .meta({ description: 'names of deps to exclude from the upgrade' })
14
+ .default([]),
13
15
  only: z
14
- .union([z.string(), z.array(z.string())], {
16
+ .union([z.string(), z.array(z.string())])
17
+ .meta({
15
18
  description: 'names of deps to include in the upgrade',
16
19
  })
17
20
  .default([])
18
21
  .transform((v) => (Array.isArray(v) ? v : [v])),
19
22
  origin: Git_Origin.describe('git origin to deploy to').default('origin'),
20
- force: z.boolean({ description: 'if true, print out the planned upgrades' }).default(false),
21
- pull: z.boolean({ description: 'dual of no-pull' }).default(true),
22
- 'no-pull': z.boolean({ description: 'opt out of git pull' }).default(false),
23
+ force: z.boolean().meta({ description: 'if true, print out the planned upgrades' }).default(false),
24
+ pull: z.boolean().meta({ description: 'dual of no-pull' }).default(true),
25
+ 'no-pull': z.boolean().meta({ description: 'opt out of git pull' }).default(false),
23
26
  delete_node_modules: z
24
- .boolean({ description: 'if true, deletes node_modules before upgrading' })
27
+ .boolean()
28
+ .meta({ description: 'if true, deletes node_modules before upgrading' })
25
29
  .default(false),
26
30
  node_modules_path: z // TODO maybe configured globally instead
27
- .string({ description: 'path to modules directory to delete' })
31
+ .string()
32
+ .meta({ description: 'path to modules directory to delete' })
28
33
  .default(NODE_MODULES_DIRNAME),
29
34
  delete_lockfile: z
30
- .boolean({ description: 'if true, deletes the lockfile before upgrading' })
35
+ .boolean()
36
+ .meta({ description: 'if true, deletes the lockfile before upgrading' })
31
37
  .default(false),
32
38
  lockfile_path: z
33
- .string({ description: 'path to the lockfile to delete' })
39
+ .string()
40
+ .meta({ description: 'path to the lockfile to delete' })
34
41
  .default('package-lock.json'),
35
- dry: z.boolean({ description: 'if true, print out the planned upgrades' }).default(false),
36
- })
37
- .strict();
42
+ dry: z.boolean().meta({ description: 'if true, print out the planned upgrades' }).default(false),
43
+ });
38
44
  export const task = {
39
45
  summary: 'upgrade deps',
40
46
  Args,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanatkn/gro",
3
- "version": "0.160.0",
3
+ "version": "0.161.1",
4
4
  "description": "task runner and toolkit extending SvelteKit",
5
5
  "motto": "generate, run, optimize",
6
6
  "glyph": "🌰",
@@ -49,46 +49,46 @@
49
49
  "typescript"
50
50
  ],
51
51
  "dependencies": {
52
- "@ryanatkn/belt": "^0.31.0",
52
+ "@ryanatkn/belt": "^0.33.0",
53
53
  "chokidar": "^4.0.3",
54
- "dotenv": "^17.0.1",
54
+ "dotenv": "^17.2.1",
55
55
  "esm-env": "^1.2.2",
56
56
  "mri": "^1.2.0",
57
- "oxc-parser": "^0.75.1",
57
+ "oxc-parser": "^0.79.1",
58
58
  "prettier": "^3.6.2",
59
59
  "prettier-plugin-svelte": "^3.4.0",
60
60
  "ts-blank-space": "^0.6.1",
61
61
  "tslib": "^2.8.1",
62
- "zod": "^3.25.74"
62
+ "zod": "^4.0.14"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "esbuild": "^0.25",
66
66
  "svelte": "^5",
67
67
  "typescript": "^5"
68
68
  },
69
+ "optionalDependencies": {
70
+ "@ryanatkn/moss": ">=0.31.0"
71
+ },
69
72
  "devDependencies": {
70
73
  "@changesets/changelog-git": "^0.2.1",
71
74
  "@changesets/types": "^6.1.0",
72
75
  "@ryanatkn/eslint-config": "^0.8.0",
73
- "@ryanatkn/fuz": "^0.144.3",
74
- "@ryanatkn/moss": "^0.31.0",
76
+ "@ryanatkn/fuz": "^0.145.0",
77
+ "@ryanatkn/moss": "^0.32.0",
75
78
  "@sveltejs/adapter-static": "^3.0.8",
76
- "@sveltejs/kit": "^2.22.2",
77
- "@sveltejs/package": "^2.3.12",
78
- "@sveltejs/vite-plugin-svelte": "^5.1.0",
79
- "@types/node": "^24.0.10",
79
+ "@sveltejs/kit": "^2.27.0",
80
+ "@sveltejs/package": "^2.4.0",
81
+ "@sveltejs/vite-plugin-svelte": "^6.1.0",
82
+ "@types/node": "^24.1.0",
80
83
  "esbuild": "^0.25.5",
81
- "eslint": "^9.30.1",
82
- "eslint-plugin-svelte": "^3.10.1",
83
- "svelte": "^5.35.2",
84
- "svelte-check": "^4.2.2",
84
+ "eslint": "^9.32.0",
85
+ "eslint-plugin-svelte": "^3.11.0",
86
+ "svelte": "^5.37.2",
87
+ "svelte-check": "^4.3.0",
85
88
  "typescript": "^5.8.3",
86
- "typescript-eslint": "^8.35.1",
89
+ "typescript-eslint": "^8.38.0",
87
90
  "uvu": "^0.5.6"
88
91
  },
89
- "optionalDependencies": {
90
- "@ryanatkn/moss": ">=0.27.0"
91
- },
92
92
  "prettier": {
93
93
  "plugins": [
94
94
  "prettier-plugin-svelte"
@@ -313,10 +313,6 @@
313
313
  "types": "./dist/package_json.d.ts",
314
314
  "default": "./dist/package_json.js"
315
315
  },
316
- "./package_meta.js": {
317
- "types": "./dist/package_meta.d.ts",
318
- "default": "./dist/package_meta.js"
319
- },
320
316
  "./package.gen.js": {
321
317
  "types": "./dist/package.gen.d.ts",
322
318
  "default": "./dist/package.gen.js"
package/src/lib/args.ts CHANGED
@@ -38,12 +38,12 @@ export interface Arg_Schema {
38
38
  * A simpler implementation could replace `mri`, but it handles some finicky details well.
39
39
  */
40
40
  export const parse_args = <
41
- TOutput extends Record<string, Arg_Value> = Args,
42
- TInput extends Record<string, Arg_Value> = Args,
41
+ T_Output extends Record<string, Arg_Value> = Args,
42
+ T_Input extends Record<string, Arg_Value> = Args,
43
43
  >(
44
- unparsed_args: TInput,
45
- schema: z.ZodType<TOutput, z.ZodTypeDef, TInput>,
46
- ): z.SafeParseReturnType<TInput, TOutput> => {
44
+ unparsed_args: T_Input,
45
+ schema: z.ZodType<T_Output, T_Input>,
46
+ ): z.ZodSafeParseResult<T_Output> => {
47
47
  const parsed = schema.safeParse(unparsed_args);
48
48
  if (parsed.success) {
49
49
  // mutate `data` with the correct source of truth for `no-` prefixed args
@@ -4,16 +4,15 @@ import type {Task} from './task.ts';
4
4
  import {Plugins} from './plugin.ts';
5
5
  import {clean_fs} from './clean_fs.ts';
6
6
 
7
- export const Args = z
8
- .object({
9
- sync: z.boolean({description: 'dual of no-sync'}).default(true),
10
- 'no-sync': z.boolean({description: 'opt out of gro sync'}).default(false),
11
- install: z.boolean({description: 'dual of no-install'}).default(true),
12
- 'no-install': z // convenience, same as `gro build -- gro sync --no-install` but the latter takes precedence
13
- .boolean({description: 'opt out of installing packages before building'})
14
- .default(false),
15
- })
16
- .strict();
7
+ export const Args = z.strictObject({
8
+ sync: z.boolean().meta({description: 'dual of no-sync'}).default(true),
9
+ 'no-sync': z.boolean().meta({description: 'opt out of gro sync'}).default(false),
10
+ install: z.boolean().meta({description: 'dual of no-install'}).default(true),
11
+ 'no-install': z // convenience, same as `gro build -- gro sync --no-install` but the latter takes precedence
12
+ .boolean()
13
+ .meta({description: 'opt out of installing packages before building'})
14
+ .default(false),
15
+ });
17
16
  export type Args = z.infer<typeof Args>;
18
17
 
19
18
  export const task: Task<Args> = {
@@ -20,32 +20,33 @@ import {
20
20
  } from './changeset_helpers.ts';
21
21
  import {load_package_json} from './package_json.ts';
22
22
 
23
- export const Args = z
24
- .object({
25
- /**
26
- * The optional rest args get joined with a space to form the `message`.
27
- */
28
- _: z
29
- .array(z.string(), {description: 'the message for the changeset and commit'})
30
- .max(1)
31
- .default([]),
32
- minor: z.boolean({description: 'bump the minor version'}).default(false),
33
- major: z.boolean({description: 'bump the major version'}).default(false),
34
- dir: z.string({description: 'changeset dir'}).default(CHANGESET_DIR),
35
- access: Changeset_Access.describe(
36
- "changeset 'access' config value, the default depends on package.json#private",
37
- ).optional(),
38
- changelog: z
39
- .string({description: 'changelog dep package name, used as changeset\'s "changelog" config'})
40
- .default('@changesets/changelog-git'),
41
- dep: z.boolean({description: 'dual of no-dep'}).default(true),
42
- 'no-dep': z
43
- .boolean({description: 'opt out of installing the changelog package'})
44
- .default(false),
45
- origin: Git_Origin.describe('git origin to deploy to').default('origin'),
46
- changeset_cli: z.string({description: 'the changeset CLI to use'}).default(CHANGESET_CLI),
47
- })
48
- .strict();
23
+ export const Args = z.strictObject({
24
+ /**
25
+ * The optional rest args get joined with a space to form the `message`.
26
+ */
27
+ _: z
28
+ .array(z.string())
29
+ .meta({description: 'the message for the changeset and commit'})
30
+ .max(1)
31
+ .default([]),
32
+ minor: z.boolean().meta({description: 'bump the minor version'}).default(false),
33
+ major: z.boolean().meta({description: 'bump the major version'}).default(false),
34
+ dir: z.string().meta({description: 'changeset dir'}).default(CHANGESET_DIR),
35
+ access: Changeset_Access.describe(
36
+ "changeset 'access' config value, the default depends on package.json#private",
37
+ ).optional(),
38
+ changelog: z
39
+ .string()
40
+ .meta({description: 'changelog dep package name, used as changeset\'s "changelog" config'})
41
+ .default('@changesets/changelog-git'),
42
+ dep: z.boolean().meta({description: 'dual of no-dep'}).default(true),
43
+ 'no-dep': z
44
+ .boolean()
45
+ .meta({description: 'opt out of installing the changelog package'})
46
+ .default(false),
47
+ origin: Git_Origin.describe('git origin to deploy to').default('origin'),
48
+ changeset_cli: z.string().meta({description: 'the changeset CLI to use'}).default(CHANGESET_CLI),
49
+ });
49
50
  export type Args = z.infer<typeof Args>;
50
51
 
51
52
  /**
@@ -4,6 +4,7 @@ export const CHANGESET_RESTRICTED_ACCESS = 'restricted';
4
4
  export const CHANGESET_PUBLIC_ACCESS = 'public';
5
5
 
6
6
  export const Changeset_Access = z.enum([CHANGESET_RESTRICTED_ACCESS, CHANGESET_PUBLIC_ACCESS]);
7
+ export type Changeset_Access = z.infer<typeof Changeset_Access>;
7
8
 
8
9
  export const CHANGESET_CLI = 'changeset';
9
10