@ryanatkn/gro 0.188.0 → 0.189.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.
- package/README.md +0 -1
- package/dist/args.d.ts +2 -39
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +8 -68
- package/dist/format_directory.d.ts +1 -1
- package/dist/format_directory.d.ts.map +1 -1
- package/dist/format_directory.js +5 -4
- package/dist/gro_plugin_gen.d.ts +1 -1
- package/dist/gro_plugin_gen.d.ts.map +1 -1
- package/dist/gro_plugin_gen.js +1 -1
- package/dist/gro_plugin_sveltekit_app.d.ts.map +1 -1
- package/dist/gro_plugin_sveltekit_app.js +5 -4
- package/dist/invoke_task.d.ts +2 -2
- package/dist/invoke_task.d.ts.map +1 -1
- package/dist/invoke_task.js +3 -3
- package/dist/lint.task.d.ts.map +1 -1
- package/dist/lint.task.js +4 -3
- package/dist/run.task.d.ts.map +1 -1
- package/dist/run.task.js +7 -6
- package/dist/run_task.d.ts +4 -4
- package/dist/run_task.d.ts.map +1 -1
- package/dist/run_task.js +4 -4
- package/dist/sveltekit_helpers.d.ts +2 -2
- package/dist/sveltekit_helpers.d.ts.map +1 -1
- package/dist/sveltekit_helpers.js +6 -5
- package/dist/task.d.ts +4 -4
- package/dist/task.d.ts.map +1 -1
- package/dist/task.js +2 -2
- package/dist/task_logging.d.ts.map +1 -1
- package/dist/task_logging.js +2 -2
- package/dist/test.task.d.ts.map +1 -1
- package/dist/test.task.js +7 -6
- package/dist/typecheck.task.d.ts.map +1 -1
- package/dist/typecheck.task.js +8 -7
- package/dist/upgrade.task.d.ts.map +1 -1
- package/dist/upgrade.task.js +7 -6
- package/package.json +7 -8
- package/src/lib/args.ts +8 -97
- package/src/lib/format_directory.ts +6 -5
- package/src/lib/gro_plugin_gen.ts +2 -2
- package/src/lib/gro_plugin_sveltekit_app.ts +6 -5
- package/src/lib/invoke_task.ts +5 -4
- package/src/lib/lint.task.ts +4 -3
- package/src/lib/run.task.ts +7 -6
- package/src/lib/run_task.ts +8 -8
- package/src/lib/sveltekit_helpers.ts +11 -10
- package/src/lib/task.ts +6 -7
- package/src/lib/task_logging.ts +3 -4
- package/src/lib/test.task.ts +7 -6
- package/src/lib/typecheck.task.ts +8 -7
- package/src/lib/upgrade.task.ts +8 -7
package/README.md
CHANGED
|
@@ -270,7 +270,6 @@ Gro builds on
|
|
|
270
270
|
[Vite](https://github.com/vitejs/vite) ∙
|
|
271
271
|
[esbuild](https://github.com/evanw/esbuild) ∙
|
|
272
272
|
[Vitest](https://github.com/vitest-dev/vitest) ∙
|
|
273
|
-
[mri](https://github.com/lukeed/mri) ∙
|
|
274
273
|
[chokidar](https://github.com/paulmillr/chokidar) ∙
|
|
275
274
|
[zod](https://github.com/colinhacks/zod) ∙
|
|
276
275
|
[@fuzdev/fuz_util](https://github.com/fuzdev/fuz_util) ∙
|
package/dist/args.d.ts
CHANGED
|
@@ -1,43 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Args } from '@fuzdev/fuz_util/args.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Anything can be assigned to a task's `args`. It's just a mutable POJO dictionary.
|
|
5
|
-
* Downstream tasks will see args that upstream events mutate,
|
|
6
|
-
* unless `invoke_task` is called with modified args.
|
|
7
|
-
* Upstream tasks can use listeners to respond to downstream events and values.
|
|
8
|
-
* It's a beautiful mutable spaghetti mess. cant get enough
|
|
9
|
-
* The raw CLI args are handled by `mri` - https://github.com/lukeed/mri
|
|
10
|
-
*/
|
|
11
|
-
export interface Args {
|
|
12
|
-
_?: Array<string>;
|
|
13
|
-
help?: boolean;
|
|
14
|
-
[key: string]: ArgValue;
|
|
15
|
-
}
|
|
16
|
-
export type ArgValue = string | number | boolean | undefined | Array<string | number | boolean>;
|
|
17
|
-
export interface ArgSchema {
|
|
18
|
-
type: string;
|
|
19
|
-
default: ArgValue;
|
|
20
|
-
description: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Parses user input args with a Zod schema.
|
|
24
|
-
* Sets the correct source of truth for `no-` versions of args,
|
|
25
|
-
* to the opposite of the unprefixed versions when not included in `unparsed_args`.
|
|
26
|
-
* This is needed because CLI args don't have a normal way of setting falsy values,
|
|
27
|
-
* so instead the args parser `mri` will pass through the truthy versions of args
|
|
28
|
-
* without the `no-` prefix.
|
|
29
|
-
* When we declare task args schemas,
|
|
30
|
-
* we need include both versions with their defaults to get correct `--help` output.
|
|
31
|
-
* Parsing like this also ensures data consistency for both versions because `mri` only creates one.
|
|
32
|
-
* A simpler implementation could replace `mri`, but it handles some finicky details well.
|
|
33
|
-
*/
|
|
34
|
-
export declare const parse_args: <TOutput extends Record<string, ArgValue> = Args, TInput extends Record<string, ArgValue> = Args>(unparsed_args: TInput, schema: z.ZodType<TOutput, TInput>) => z.ZodSafeParseResult<TOutput>;
|
|
35
|
-
/**
|
|
36
|
-
* Serializes parsed `Args` for CLI commands.
|
|
37
|
-
*/
|
|
38
|
-
export declare const serialize_args: (args: Args) => Array<string>;
|
|
39
|
-
/**
|
|
40
|
-
* Parses `task_name` and `args` from `process.argv` using `mri`,
|
|
3
|
+
* Parses `task_name` and `args` from `process.argv`,
|
|
41
4
|
* ignoring anything after any `--`.
|
|
42
5
|
*/
|
|
43
6
|
export declare const to_task_args: (argv?: string[]) => {
|
package/dist/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/args.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/args.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,eAAmB,KAAG;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAMhF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,eAAmB,KAAG,KAAK,CAAC,MAAM,CAGlE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC7B,SAAS,MAAM,EACf,gBAAgB,KAAK,CAAC,MAAM,CAAC,EAC7B,wCAAmD,KACjD,IAA4B,CAAC;AAEhC,eAAO,MAAM,4BAA4B,GACxC,wBAAkC,KAChC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,CAuCjC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,GACtC,mBAAmB,MAAM,EACzB,wBAAkC,KAChC,IAaF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,iBAAiB,KAAK,CAAC,MAAM,CAAC,KAAG,MAK1C,CAAC"}
|
package/dist/args.js
CHANGED
|
@@ -1,74 +1,12 @@
|
|
|
1
1
|
import { styleText as st } from 'node:util';
|
|
2
|
-
import
|
|
2
|
+
import { argv_parse } from '@fuzdev/fuz_util/args.js';
|
|
3
3
|
/**
|
|
4
|
-
* Parses
|
|
5
|
-
* Sets the correct source of truth for `no-` versions of args,
|
|
6
|
-
* to the opposite of the unprefixed versions when not included in `unparsed_args`.
|
|
7
|
-
* This is needed because CLI args don't have a normal way of setting falsy values,
|
|
8
|
-
* so instead the args parser `mri` will pass through the truthy versions of args
|
|
9
|
-
* without the `no-` prefix.
|
|
10
|
-
* When we declare task args schemas,
|
|
11
|
-
* we need include both versions with their defaults to get correct `--help` output.
|
|
12
|
-
* Parsing like this also ensures data consistency for both versions because `mri` only creates one.
|
|
13
|
-
* A simpler implementation could replace `mri`, but it handles some finicky details well.
|
|
14
|
-
*/
|
|
15
|
-
export const parse_args = (unparsed_args, schema) => {
|
|
16
|
-
const parsed = schema.safeParse(unparsed_args);
|
|
17
|
-
if (parsed.success) {
|
|
18
|
-
// mutate `data` with the correct source of truth for `no-` prefixed args
|
|
19
|
-
const { data } = parsed;
|
|
20
|
-
for (const key in parsed.data) {
|
|
21
|
-
if (key.startsWith('no-')) {
|
|
22
|
-
const base_key = key.substring(3);
|
|
23
|
-
if (!(key in unparsed_args)) {
|
|
24
|
-
data[key] = !data[base_key];
|
|
25
|
-
}
|
|
26
|
-
else if (!(base_key in unparsed_args)) {
|
|
27
|
-
data[base_key] = !data[key];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return parsed;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Serializes parsed `Args` for CLI commands.
|
|
36
|
-
*/
|
|
37
|
-
export const serialize_args = (args) => {
|
|
38
|
-
const result = [];
|
|
39
|
-
const add_value = (name, value) => {
|
|
40
|
-
if (value === undefined)
|
|
41
|
-
return;
|
|
42
|
-
result.push(name);
|
|
43
|
-
if (typeof value !== 'boolean') {
|
|
44
|
-
result.push(value + '');
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
let _ = null;
|
|
48
|
-
for (const [key, value] of Object.entries(args)) {
|
|
49
|
-
if (key === '_') {
|
|
50
|
-
_ = value ? value.map((v) => (v === undefined ? '' : v + '')) : [];
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
const name = `${key.length === 1 ? '-' : '--'}${key}`;
|
|
54
|
-
if (Array.isArray(value)) {
|
|
55
|
-
for (const v of value)
|
|
56
|
-
add_value(name, v);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
add_value(name, value);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return _ ? [..._, ...result] : result;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Parses `task_name` and `args` from `process.argv` using `mri`,
|
|
4
|
+
* Parses `task_name` and `args` from `process.argv`,
|
|
67
5
|
* ignoring anything after any `--`.
|
|
68
6
|
*/
|
|
69
7
|
export const to_task_args = (argv = process.argv) => {
|
|
70
8
|
const forwarded_index = argv.indexOf('--');
|
|
71
|
-
const args =
|
|
9
|
+
const args = argv_parse(forwarded_index === -1 ? argv.slice(2) : argv.slice(2, forwarded_index));
|
|
72
10
|
const task_name = args._.shift() ?? '';
|
|
73
11
|
if (!args._.length)
|
|
74
12
|
delete args._; // enable schema defaults
|
|
@@ -111,10 +49,12 @@ export const to_forwarded_args_by_command = (raw_rest_args = to_raw_rest_args())
|
|
|
111
49
|
// which is assumed to be the CLI command that gets forwarded the args.
|
|
112
50
|
const forwarded_args_by_command = {};
|
|
113
51
|
for (const argv of argvs) {
|
|
114
|
-
const args =
|
|
52
|
+
const args = argv_parse(argv);
|
|
115
53
|
let command = args._.shift();
|
|
116
54
|
if (!command) {
|
|
117
|
-
|
|
55
|
+
// Skip sections without a command name - these are handled by `to_implicit_forwarded_args`.
|
|
56
|
+
// This allows `gro run script.ts -- --help` to pass `--help` to the script.
|
|
57
|
+
continue;
|
|
118
58
|
}
|
|
119
59
|
// Gro commands get combined with their task name.
|
|
120
60
|
if (command === 'gro') {
|
|
@@ -150,7 +90,7 @@ export const to_implicit_forwarded_args = (command_to_strip, raw_rest_args = to_
|
|
|
150
90
|
if (command_to_strip && argv[0] === command_to_strip) {
|
|
151
91
|
argv = argv.slice(1);
|
|
152
92
|
}
|
|
153
|
-
const args =
|
|
93
|
+
const args = argv_parse(argv);
|
|
154
94
|
if (!args._.length)
|
|
155
95
|
delete args._;
|
|
156
96
|
return args;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SpawnResult } from '@fuzdev/fuz_util/process.js';
|
|
2
1
|
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
2
|
+
import type { SpawnResult } from '@fuzdev/fuz_util/process.js';
|
|
3
3
|
import { type Cli } from './cli.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Formats a directory on the filesystem.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format_directory.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/format_directory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format_directory.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/format_directory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AAG7D,OAAO,EAAyB,KAAK,GAAG,EAAC,MAAM,UAAU,CAAC;AAuB1D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC5B,KAAK,MAAM,EACX,KAAK,MAAM,EACX,eAAa,EACb,mBAA+B,EAC/B,mBAA+B,EAC/B,eAAc,MAAM,GAAG,GAA0B,EACjD,SAAQ,MAAuB,KAC7B,OAAO,CAAC,WAAW,CAcrB,CAAC"}
|
package/dist/format_directory.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { serialize_args, to_forwarded_args } from "./args.js";
|
|
1
|
+
import { args_serialize } from '@fuzdev/fuz_util/args.js';
|
|
2
|
+
import { to_forwarded_args } from "./args.js";
|
|
4
3
|
import { spawn_cli, to_cli_name } from "./cli.js";
|
|
4
|
+
import { GITHUB_DIRNAME, README_FILENAME, SVELTE_CONFIG_FILENAME, VITE_CONFIG_FILENAME, TSCONFIG_FILENAME, GRO_CONFIG_FILENAME, PM_CLI_DEFAULT, PRETTIER_CLI_DEFAULT, } from "./constants.js";
|
|
5
|
+
import { paths } from "./paths.js";
|
|
5
6
|
const EXTENSIONS_DEFAULT = 'ts,js,json,svelte,html,css,md,yml';
|
|
6
7
|
const ROOT_PATHS_DEFAULT = `${[
|
|
7
8
|
README_FILENAME,
|
|
@@ -20,7 +21,7 @@ const ROOT_PATHS_DEFAULT = `${[
|
|
|
20
21
|
export const format_directory = async (log, dir, check = false, extensions = EXTENSIONS_DEFAULT, root_paths = ROOT_PATHS_DEFAULT, prettier_cli = PRETTIER_CLI_DEFAULT, pm_cli = PM_CLI_DEFAULT) => {
|
|
21
22
|
const forwarded_args = to_forwarded_args(to_cli_name(prettier_cli));
|
|
22
23
|
forwarded_args[check ? 'check' : 'write'] = true;
|
|
23
|
-
const serialized_args =
|
|
24
|
+
const serialized_args = args_serialize(forwarded_args);
|
|
24
25
|
serialized_args.push(`${dir}**/*.{${extensions}}`);
|
|
25
26
|
if (dir === paths.source) {
|
|
26
27
|
serialized_args.push(`${paths.root}{${root_paths}}`);
|
package/dist/gro_plugin_gen.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_plugin_gen.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_gen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gro_plugin_gen.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAKnD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAaxC,MAAM,WAAW,QAAS,SAAQ,IAAI;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IACnC,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,cAAc,GAAI,oDAI5B,mBAAkC,KAAG,MAoHvC,CAAC"}
|
package/dist/gro_plugin_gen.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { UnreachableError } from '@fuzdev/fuz_util/error.js';
|
|
1
2
|
import { EMPTY_OBJECT } from '@fuzdev/fuz_util/object.js';
|
|
2
3
|
import { throttle } from '@fuzdev/fuz_util/throttle.js';
|
|
3
|
-
import { UnreachableError } from '@fuzdev/fuz_util/error.js';
|
|
4
4
|
import { paths } from "./paths.js";
|
|
5
5
|
import { find_genfiles, is_gen_path } from "./gen.js";
|
|
6
6
|
import { filter_dependents } from "./filer.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_plugin_sveltekit_app.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_sveltekit_app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gro_plugin_sveltekit_app.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_sveltekit_app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,4BAA4B;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,wBAAwB,GAAI,gBAEtC,4BAAiC,KAAG,MAuCtC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { args_serialize } from '@fuzdev/fuz_util/args.js';
|
|
1
2
|
import { spawn_result_to_message } from '@fuzdev/fuz_util/process.js';
|
|
2
|
-
import {
|
|
3
|
-
import { TaskError } from "./task.js";
|
|
3
|
+
import { to_forwarded_args } from "./args.js";
|
|
4
4
|
import { find_cli, spawn_cli, spawn_cli_process } from "./cli.js";
|
|
5
5
|
import { VITE_CLI } from "./constants.js";
|
|
6
|
+
import { TaskError } from "./task.js";
|
|
6
7
|
export const gro_plugin_sveltekit_app = ({ vite_cli = VITE_CLI, } = {}) => {
|
|
7
8
|
let sveltekit_process = undefined;
|
|
8
9
|
return {
|
|
@@ -14,7 +15,7 @@ export const gro_plugin_sveltekit_app = ({ vite_cli = VITE_CLI, } = {}) => {
|
|
|
14
15
|
if (dev) {
|
|
15
16
|
// `vite dev` in development mode
|
|
16
17
|
if (watch) {
|
|
17
|
-
const serialized_args = ['dev', ...
|
|
18
|
+
const serialized_args = ['dev', ...args_serialize(to_forwarded_args(vite_cli))];
|
|
18
19
|
sveltekit_process = await spawn_cli_process(found_vite_cli, serialized_args, log);
|
|
19
20
|
}
|
|
20
21
|
else {
|
|
@@ -24,7 +25,7 @@ export const gro_plugin_sveltekit_app = ({ vite_cli = VITE_CLI, } = {}) => {
|
|
|
24
25
|
}
|
|
25
26
|
else {
|
|
26
27
|
// `vite build` in production mode
|
|
27
|
-
const serialized_args = ['build', ...
|
|
28
|
+
const serialized_args = ['build', ...args_serialize(to_forwarded_args(vite_cli))];
|
|
28
29
|
const spawned = await spawn_cli(found_vite_cli, serialized_args, log);
|
|
29
30
|
if (!spawned?.ok) {
|
|
30
31
|
throw new TaskError(`${vite_cli} build failed: ${spawned ? spawn_result_to_message(spawned) : 'unknown error'}`);
|
package/dist/invoke_task.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Args } from '@fuzdev/fuz_util/args.js';
|
|
2
2
|
import { Logger } from '@fuzdev/fuz_util/log.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Timings } from '@fuzdev/fuz_util/timings.js';
|
|
4
4
|
import { RawInputPath } from './input_path.ts';
|
|
5
5
|
import type { GroConfig } from './gro_config.ts';
|
|
6
6
|
import { Filer } from './filer.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke_task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/invoke_task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invoke_task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/invoke_task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAE/C,OAAO,EAAmB,OAAO,EAAC,MAAM,6BAA6B,CAAC;AAKtE,OAAO,EAAgB,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAI5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW,GACvB,WAAW,YAAY,EACvB,MAAM,IAAI,GAAG,SAAS,EACtB,QAAQ,SAAS,EACjB,gBAAgB,KAAK,EACrB,kBAAkB,OAAO,GAAG,IAAI,EAChC,aAAa,MAAM,KACjB,OAAO,CAAC,IAAI,CA8Fd,CAAC"}
|
package/dist/invoke_task.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { styleText as st } from 'node:util';
|
|
2
|
-
import { create_stopwatch, Timings } from '@fuzdev/fuz_util/timings.js';
|
|
3
|
-
import { print_ms, print_timings } from '@fuzdev/fuz_util/print.js';
|
|
4
1
|
import { Logger } from '@fuzdev/fuz_util/log.js';
|
|
2
|
+
import { print_ms, print_timings } from '@fuzdev/fuz_util/print.js';
|
|
3
|
+
import { create_stopwatch, Timings } from '@fuzdev/fuz_util/timings.js';
|
|
4
|
+
import { styleText as st } from 'node:util';
|
|
5
5
|
import { to_forwarded_args } from "./args.js";
|
|
6
6
|
import { run_task } from "./run_task.js";
|
|
7
7
|
import { to_input_path, RawInputPath } from "./input_path.js";
|
package/dist/lint.task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/lint.task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lint.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/lint.task.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAI/C,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,CAoB3B,CAAC"}
|
package/dist/lint.task.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { args_serialize } from '@fuzdev/fuz_util/args.js';
|
|
1
2
|
import { print_spawn_result } from '@fuzdev/fuz_util/process.js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import { serialize_args, to_forwarded_args } from "./args.js";
|
|
4
|
+
import { to_forwarded_args } from "./args.js";
|
|
5
5
|
import { find_cli, spawn_cli } from "./cli.js";
|
|
6
|
+
import { TaskError } from "./task.js";
|
|
6
7
|
const ESLINT_CLI = 'eslint';
|
|
7
8
|
/** @nodocs */
|
|
8
9
|
export const Args = z.strictObject({
|
|
@@ -22,7 +23,7 @@ export const task = {
|
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
25
|
const forwarded_args = { _, 'max-warnings': 0, ...to_forwarded_args(eslint_cli) };
|
|
25
|
-
const serialized_args =
|
|
26
|
+
const serialized_args = args_serialize(forwarded_args);
|
|
26
27
|
const eslintResult = await spawn_cli(found_eslint_cli, serialized_args, log);
|
|
27
28
|
if (!eslintResult?.ok) {
|
|
28
29
|
throw new TaskError(`ESLint found some problems. ${print_spawn_result(eslintResult)}`);
|
package/dist/run.task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/run.task.ts"],"names":[],"mappings":"
|
|
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
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { styleText as st } from 'node:util';
|
|
1
|
+
import { args_serialize } from '@fuzdev/fuz_util/args.js';
|
|
3
2
|
import { fs_exists } from '@fuzdev/fuz_util/fs.js';
|
|
4
|
-
import { TaskError } from "./task.js";
|
|
5
|
-
import { resolve_gro_module_path, spawn_with_loader } from "./gro_helpers.js";
|
|
6
3
|
import { spawn_result_to_message } from '@fuzdev/fuz_util/process.js';
|
|
7
|
-
import {
|
|
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";
|
|
8
9
|
/**
|
|
9
10
|
* Runs a TypeScript file with Gro's loader, forwarding all args to the script.
|
|
10
11
|
* Useful for scripts that need SvelteKit shims ($lib, $env, etc).
|
|
@@ -40,7 +41,7 @@ export const task = {
|
|
|
40
41
|
// This allows `gro run script.ts -- --help` to pass --help to the script.
|
|
41
42
|
const implicit_args = to_implicit_forwarded_args();
|
|
42
43
|
// Reconstruct argv: positional args + explicit named args + implicit args after --
|
|
43
|
-
const named_argv =
|
|
44
|
+
const named_argv = args_serialize({ ...forwarded_args, ...implicit_args });
|
|
44
45
|
const full_argv = [...positional_argv, ...named_argv];
|
|
45
46
|
const loader_path = resolve_gro_module_path('loader.js');
|
|
46
47
|
const spawned = await spawn_with_loader(loader_path, path, full_argv);
|
package/dist/run_task.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Args } from '@fuzdev/fuz_util/args.js';
|
|
2
2
|
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
3
|
+
import type { Timings } from '@fuzdev/fuz_util/timings.js';
|
|
4
|
+
import type { Filer } from './filer.ts';
|
|
5
5
|
import type { GroConfig } from './gro_config.ts';
|
|
6
|
+
import type { invoke_task as base_invoke_task } from './invoke_task.ts';
|
|
6
7
|
import { type TaskModuleMeta } from './task.ts';
|
|
7
|
-
import type { Filer } from './filer.ts';
|
|
8
8
|
export type RunTaskResult = {
|
|
9
9
|
ok: true;
|
|
10
10
|
output: unknown;
|
package/dist/run_task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run_task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/run_task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run_task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/run_task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,6BAA6B,CAAC;AAIzD,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAC,WAAW,IAAI,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAY,KAAK,cAAc,EAAC,MAAM,WAAW,CAAC;AAGzD,MAAM,MAAM,aAAa,GACtB;IACA,EAAE,EAAE,IAAI,CAAC;IACT,MAAM,EAAE,OAAO,CAAC;CACf,GACD;IACA,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;CACZ,CAAC;AAEL,eAAO,MAAM,QAAQ,GACpB,WAAW,cAAc,EACzB,eAAe,IAAI,EACnB,aAAa,OAAO,gBAAgB,EACpC,QAAQ,SAAS,EACjB,OAAO,KAAK,EACZ,KAAK,MAAM,EACX,SAAS,OAAO,KACd,OAAO,CAAC,aAAa,CAiDvB,CAAC"}
|
package/dist/run_task.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { args_parse } from '@fuzdev/fuz_util/args.js';
|
|
1
2
|
import { styleText as st } from 'node:util';
|
|
2
3
|
import { z } from 'zod';
|
|
3
|
-
import { parse_args } from "./args.js";
|
|
4
|
-
import { log_task_help } from "./task_logging.js";
|
|
5
|
-
import { TaskError } from "./task.js";
|
|
6
4
|
import { default_svelte_config } from "./svelte_config.js";
|
|
5
|
+
import { TaskError } from "./task.js";
|
|
6
|
+
import { log_task_help } from "./task_logging.js";
|
|
7
7
|
export const run_task = async (task_meta, unparsed_args, invoke_task, config, filer, log, timings) => {
|
|
8
8
|
const { task } = task_meta.mod;
|
|
9
9
|
if (unparsed_args.help) {
|
|
@@ -13,7 +13,7 @@ export const run_task = async (task_meta, unparsed_args, invoke_task, config, fi
|
|
|
13
13
|
// Parse and validate args.
|
|
14
14
|
let args = unparsed_args;
|
|
15
15
|
if (task.Args) {
|
|
16
|
-
const parsed =
|
|
16
|
+
const parsed = args_parse(unparsed_args, task.Args);
|
|
17
17
|
if (!parsed.success) {
|
|
18
18
|
throw new TaskError(`Failed task args validation for task '${task_meta.name}':\n${z.prettifyError(parsed.error)}`);
|
|
19
19
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Result } from '@fuzdev/fuz_util/result.js';
|
|
2
1
|
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
3
2
|
import type { PackageJson } from '@fuzdev/fuz_util/package_json.js';
|
|
4
|
-
import {
|
|
3
|
+
import type { Result } from '@fuzdev/fuz_util/result.js';
|
|
5
4
|
import { type Cli } from './cli.ts';
|
|
5
|
+
import { type ParsedSvelteConfig } from './svelte_config.ts';
|
|
6
6
|
export declare const has_sveltekit_app: (svelte_config_path?: string) => Promise<Result<object, {
|
|
7
7
|
message: string;
|
|
8
8
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sveltekit_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/sveltekit_helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sveltekit_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/sveltekit_helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAIvD,OAAO,EAAmC,KAAK,GAAG,EAAC,MAAM,UAAU,CAAC;AASpE,OAAO,EAAwB,KAAK,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAGlF,eAAO,MAAM,iBAAiB,GAC7B,qBAAoB,MAA+B,KACjD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CAM3C,CAAC;AAEF,eAAO,MAAM,qBAAqB,GACjC,cAAc,WAAW,EACzB,gBAAe,kBAA0C,EACzD,iBAAkC,KAChC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CAkB3C,CAAC;AAEF,eAAO,MAAM,cAAc,GAC1B,gBAAe,MAAM,GAAG,GAAmB,EAC3C,eAAuB,KACrB,OAAO,CAAC,IAAI,CASd,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,2BAA2B,GACvC,gBAAe,MAAM,GAAG,GAAmB,KACzC,OAAO,CAAC,IAAI,CAMd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC,GAC9C,gBAAe,MAAM,GAAG,GAAmB,KACzC,OAAO,CAAC,IAAI,CAUd,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,kBAAkB,GAC9B,cAAc,WAAW,EACzB,SAAS,oBAAoB,GAAG,SAAS,EACzC,KAAK,MAAM,GAAG,GAAG,EACjB,KAAK,MAAM,EACX,QAAQ,MAAM,KACZ,OAAO,CAAC,IAAI,CAmBd,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GACjC,WAAW,MAAM,EACjB,SAAS,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAC9B,MASF,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { args_serialize } from '@fuzdev/fuz_util/args.js';
|
|
2
2
|
import { fs_exists } from '@fuzdev/fuz_util/fs.js';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { to_forwarded_args } from "./args.js";
|
|
5
|
+
import { find_cli, spawn_cli, to_cli_name } from "./cli.js";
|
|
6
|
+
import { PM_CLI_DEFAULT, SVELTE_CONFIG_FILENAME, SVELTE_PACKAGE_DEP_NAME, SVELTEKIT_CLI, SVELTEKIT_DEV_DIRNAME, } from "./constants.js";
|
|
3
7
|
import { package_json_has_dependency } from "./package_json.js";
|
|
4
8
|
import { default_svelte_config } from "./svelte_config.js";
|
|
5
|
-
import { SVELTE_CONFIG_FILENAME, SVELTEKIT_DEV_DIRNAME, PM_CLI_DEFAULT, SVELTE_PACKAGE_DEP_NAME, SVELTEKIT_CLI, } from "./constants.js";
|
|
6
|
-
import { find_cli, spawn_cli, to_cli_name } from "./cli.js";
|
|
7
9
|
import { TaskError } from "./task.js";
|
|
8
|
-
import { serialize_args, to_forwarded_args } from "./args.js";
|
|
9
10
|
export const has_sveltekit_app = async (svelte_config_path = SVELTE_CONFIG_FILENAME) => {
|
|
10
11
|
if (!(await fs_exists(svelte_config_path))) {
|
|
11
12
|
return { ok: false, message: `no SvelteKit config found at ${SVELTE_CONFIG_FILENAME}` };
|
|
@@ -71,7 +72,7 @@ export const run_svelte_package = async (package_json, options, cli, log, pm_cli
|
|
|
71
72
|
if (found_svelte_package_cli?.kind !== 'local') {
|
|
72
73
|
throw new TaskError(`Failed to find SvelteKit packaging CLI \`${cli_name}\`, do you need to run \`${pm_cli} install\`?`);
|
|
73
74
|
}
|
|
74
|
-
const serialized_args =
|
|
75
|
+
const serialized_args = args_serialize({
|
|
75
76
|
...options,
|
|
76
77
|
...to_forwarded_args(cli_name),
|
|
77
78
|
});
|
package/dist/task.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { Args } from '@fuzdev/fuz_util/args.js';
|
|
1
2
|
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
2
|
-
import type { z } from 'zod';
|
|
3
|
-
import type { Timings } from '@fuzdev/fuz_util/timings.js';
|
|
4
|
-
import type { Result } from '@fuzdev/fuz_util/result.js';
|
|
5
3
|
import type { PathId } from '@fuzdev/fuz_util/path.js';
|
|
6
|
-
import type {
|
|
4
|
+
import type { Result } from '@fuzdev/fuz_util/result.js';
|
|
5
|
+
import type { Timings } from '@fuzdev/fuz_util/timings.js';
|
|
6
|
+
import type { z } from 'zod';
|
|
7
7
|
import type { GroConfig } from './gro_config.ts';
|
|
8
8
|
import type { ParsedSvelteConfig } from './svelte_config.ts';
|
|
9
9
|
import { type InputPath, type ResolvedInputFile, type ResolvedInputPath } from './input_path.ts';
|
package/dist/task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/task.ts"],"names":[],"mappings":"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"}
|
package/dist/task.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { fs_search } from '@fuzdev/fuz_util/fs.js';
|
|
1
2
|
import { ensure_end, strip_end, strip_start } from '@fuzdev/fuz_util/string.js';
|
|
2
|
-
import { styleText as st } from 'node:util';
|
|
3
3
|
import { isAbsolute, join, relative } from 'node:path';
|
|
4
|
-
import {
|
|
4
|
+
import { styleText as st } from 'node:util';
|
|
5
5
|
import { resolve_input_files, resolve_input_paths, } from "./input_path.js";
|
|
6
6
|
import { GRO_DIST_DIR, print_path } from "./paths.js";
|
|
7
7
|
import { load_modules } from "./modules.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task_logging.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/task_logging.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"task_logging.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/task_logging.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAKpD,OAAO,KAAK,EAAC,WAAW,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC;AAG3D,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,cAAc,WAAW,EAAE,mBAAgB,KAAG,IAkCpF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,EAAE,SAAS,KAAK,CAAC,MAAM,CAAC,KAAG,IAIvE,CAAC;AAIF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,MAAM,cAAc,KAAG,IAkCjE,CAAC"}
|
package/dist/task_logging.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { styleText as st } from 'node:util';
|
|
2
|
-
import { plural } from '@fuzdev/fuz_util/string.js';
|
|
3
1
|
import { print_value } from '@fuzdev/fuz_util/print.js';
|
|
2
|
+
import { plural } from '@fuzdev/fuz_util/string.js';
|
|
3
|
+
import { styleText as st } from 'node:util';
|
|
4
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) => {
|
package/dist/test.task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/test.task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/test.task.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAOtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;kBAWf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAkC3B,CAAC"}
|
package/dist/test.task.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { spawn_cli } from './cli.js';
|
|
1
|
+
import { args_serialize } from '@fuzdev/fuz_util/args.js';
|
|
3
2
|
import { spawn_result_to_message } from '@fuzdev/fuz_util/process.js';
|
|
4
|
-
import {
|
|
3
|
+
import { spawn_cli } from './cli.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { to_implicit_forwarded_args } from "./args.js";
|
|
5
6
|
import { find_cli } from "./cli.js";
|
|
6
|
-
import { package_json_has_dependency, package_json_load } from "./package_json.js";
|
|
7
|
-
import { serialize_args, to_implicit_forwarded_args } from "./args.js";
|
|
8
7
|
import { VITEST_CLI } from "./constants.js";
|
|
8
|
+
import { package_json_has_dependency, package_json_load } from "./package_json.js";
|
|
9
9
|
import { paths } from "./paths.js";
|
|
10
|
+
import { TaskError } from "./task.js";
|
|
10
11
|
/** @nodocs */
|
|
11
12
|
export const Args = z.strictObject({
|
|
12
13
|
_: z.array(z.string()).meta({ description: 'file patterns to filter tests' }).default(['.test.']),
|
|
@@ -43,7 +44,7 @@ export const task = {
|
|
|
43
44
|
if (t) {
|
|
44
45
|
vitest_args.push('-t', t);
|
|
45
46
|
}
|
|
46
|
-
vitest_args.push(...
|
|
47
|
+
vitest_args.push(...args_serialize(to_implicit_forwarded_args(VITEST_CLI)));
|
|
47
48
|
const spawned = await spawn_cli(VITEST_CLI, vitest_args);
|
|
48
49
|
if (!spawned?.ok) {
|
|
49
50
|
throw new TaskError(`vitest failed: ${spawned ? spawn_result_to_message(spawned) : 'unknown error'}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typecheck.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typecheck.task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typecheck.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/typecheck.task.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAQtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;kBAcf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAiD3B,CAAC"}
|
package/dist/typecheck.task.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { args_serialize } from '@fuzdev/fuz_util/args.js';
|
|
1
2
|
import { print_spawn_result } from '@fuzdev/fuz_util/process.js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import { serialize_args, to_forwarded_args } from "./args.js";
|
|
5
|
-
import { find_cli, spawn_cli, spawn_cli_process } from "./cli.js";
|
|
6
|
-
import { sveltekit_sync_if_available } from "./sveltekit_helpers.js";
|
|
4
|
+
import { to_forwarded_args } from "./args.js";
|
|
7
5
|
import { configure_colored_output_with_path_replacement } from "./child_process_logging.js";
|
|
8
|
-
import {
|
|
6
|
+
import { find_cli, spawn_cli, spawn_cli_process } from "./cli.js";
|
|
9
7
|
import { SVELTE_CHECK_CLI } from "./constants.js";
|
|
8
|
+
import { paths } from "./paths.js";
|
|
9
|
+
import { sveltekit_sync_if_available } from "./sveltekit_helpers.js";
|
|
10
|
+
import { TaskError } from "./task.js";
|
|
10
11
|
/** @nodocs */
|
|
11
12
|
export const Args = z.strictObject({
|
|
12
13
|
svelte_check_cli: z
|
|
@@ -33,7 +34,7 @@ export const task = {
|
|
|
33
34
|
// Prefer svelte-check if available.
|
|
34
35
|
const found_svelte_check_cli = await find_cli(svelte_check_cli);
|
|
35
36
|
if (found_svelte_check_cli) {
|
|
36
|
-
const serialized =
|
|
37
|
+
const serialized = args_serialize(to_forwarded_args(svelte_check_cli));
|
|
37
38
|
const spawned = await spawn_cli_process(found_svelte_check_cli, serialized, undefined, {
|
|
38
39
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
39
40
|
env: { ...process.env, FORCE_COLOR: '1' }, // Needed for colors (maybe make an option)
|
|
@@ -55,7 +56,7 @@ export const task = {
|
|
|
55
56
|
const forwarded = to_forwarded_args(typescript_cli);
|
|
56
57
|
if (!forwarded.noEmit)
|
|
57
58
|
forwarded.noEmit = true;
|
|
58
|
-
const serialized =
|
|
59
|
+
const serialized = args_serialize(forwarded);
|
|
59
60
|
const svelte_check_result = await spawn_cli(found_typescript_cli, serialized, log);
|
|
60
61
|
if (!svelte_check_result?.ok) {
|
|
61
62
|
throw new TaskError(`Failed to typecheck. ${print_spawn_result(svelte_check_result)}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/upgrade.task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgrade.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/upgrade.task.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAUtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;;;;kBAiCf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA4E3B,CAAC"}
|
package/dist/upgrade.task.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { args_serialize } from '@fuzdev/fuz_util/args.js';
|
|
2
|
+
import { GitOrigin, git_pull } from '@fuzdev/fuz_util/git.js';
|
|
1
3
|
import { spawn } from '@fuzdev/fuz_util/process.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
4
|
import { rm } from 'node:fs/promises';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { package_json_extract_dependencies, package_json_load, } from "./package_json.js";
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { to_forwarded_args } from "./args.js";
|
|
7
7
|
import { spawn_cli } from "./cli.js";
|
|
8
|
-
import { serialize_args, to_forwarded_args } from "./args.js";
|
|
9
8
|
import { NODE_MODULES_DIRNAME } from "./constants.js";
|
|
9
|
+
import { package_json_extract_dependencies, package_json_load, } from "./package_json.js";
|
|
10
|
+
import { TaskError } from "./task.js";
|
|
10
11
|
/** @nodocs */
|
|
11
12
|
export const Args = z.strictObject({
|
|
12
13
|
_: z
|
|
@@ -81,7 +82,7 @@ export const task = {
|
|
|
81
82
|
if (force) {
|
|
82
83
|
install_args.push('--force');
|
|
83
84
|
}
|
|
84
|
-
install_args.push(...
|
|
85
|
+
install_args.push(...args_serialize(to_forwarded_args(config.pm_cli)));
|
|
85
86
|
await spawn(config.pm_cli, install_args);
|
|
86
87
|
// TODO @many this relies on npm behavior that changed in v11
|
|
87
88
|
// If we deleted the lockfile or node modules, `npm install` again
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryanatkn/gro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.189.1",
|
|
4
4
|
"description": "task runner and toolkit extending SvelteKit",
|
|
5
5
|
"motto": "generate, run, optimize",
|
|
6
6
|
"glyph": "🌰",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"chokidar": "^5.0.0",
|
|
52
52
|
"dotenv": "^17.2.3",
|
|
53
53
|
"esm-env": "^1.2.2",
|
|
54
|
-
"mri": "^1.2.0",
|
|
55
54
|
"oxc-parser": "^0.99.0",
|
|
56
55
|
"prettier": "^3.7.4",
|
|
57
56
|
"prettier-plugin-svelte": "^3.4.1",
|
|
@@ -60,7 +59,7 @@
|
|
|
60
59
|
"zod": "^4.1.13"
|
|
61
60
|
},
|
|
62
61
|
"peerDependencies": {
|
|
63
|
-
"@fuzdev/fuz_util": ">=0.
|
|
62
|
+
"@fuzdev/fuz_util": ">=0.48.0",
|
|
64
63
|
"@sveltejs/kit": "^2",
|
|
65
64
|
"esbuild": "^0.27.0",
|
|
66
65
|
"svelte": "^5",
|
|
@@ -84,19 +83,19 @@
|
|
|
84
83
|
"@fuzdev/fuz_code": "^0.40.0",
|
|
85
84
|
"@fuzdev/fuz_css": "^0.44.1",
|
|
86
85
|
"@fuzdev/fuz_ui": "^0.179.0",
|
|
87
|
-
"@fuzdev/fuz_util": "^0.
|
|
86
|
+
"@fuzdev/fuz_util": "^0.48.0",
|
|
88
87
|
"@ryanatkn/eslint-config": "^0.9.0",
|
|
89
88
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
90
|
-
"@sveltejs/kit": "^2.
|
|
89
|
+
"@sveltejs/kit": "^2.50.1",
|
|
91
90
|
"@sveltejs/package": "^2.5.7",
|
|
92
|
-
"@sveltejs/vite-plugin-svelte": "^6.2.
|
|
91
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
93
92
|
"@types/node": "^24.10.1",
|
|
94
93
|
"@webref/css": "^8.2.0",
|
|
95
94
|
"esbuild": "^0.27.1",
|
|
96
95
|
"eslint": "^9.39.1",
|
|
97
96
|
"eslint-plugin-svelte": "^3.13.1",
|
|
98
|
-
"svelte": "^5.
|
|
99
|
-
"svelte-check": "^4.3.
|
|
97
|
+
"svelte": "^5.48.2",
|
|
98
|
+
"svelte-check": "^4.3.5",
|
|
100
99
|
"typescript": "^5.9.3",
|
|
101
100
|
"typescript-eslint": "^8.48.1",
|
|
102
101
|
"vitest": "^4.0.15"
|
package/src/lib/args.ts
CHANGED
|
@@ -1,102 +1,13 @@
|
|
|
1
1
|
import {styleText as st} from 'node:util';
|
|
2
|
-
import
|
|
3
|
-
import type {z} from 'zod';
|
|
2
|
+
import {argv_parse, type Args} from '@fuzdev/fuz_util/args.js';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
* Anything can be assigned to a task's `args`. It's just a mutable POJO dictionary.
|
|
8
|
-
* Downstream tasks will see args that upstream events mutate,
|
|
9
|
-
* unless `invoke_task` is called with modified args.
|
|
10
|
-
* Upstream tasks can use listeners to respond to downstream events and values.
|
|
11
|
-
* It's a beautiful mutable spaghetti mess. cant get enough
|
|
12
|
-
* The raw CLI args are handled by `mri` - https://github.com/lukeed/mri
|
|
13
|
-
*/
|
|
14
|
-
export interface Args {
|
|
15
|
-
_?: Array<string>;
|
|
16
|
-
help?: boolean;
|
|
17
|
-
[key: string]: ArgValue;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type ArgValue = string | number | boolean | undefined | Array<string | number | boolean>;
|
|
21
|
-
|
|
22
|
-
export interface ArgSchema {
|
|
23
|
-
type: string;
|
|
24
|
-
default: ArgValue;
|
|
25
|
-
description: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Parses user input args with a Zod schema.
|
|
30
|
-
* Sets the correct source of truth for `no-` versions of args,
|
|
31
|
-
* to the opposite of the unprefixed versions when not included in `unparsed_args`.
|
|
32
|
-
* This is needed because CLI args don't have a normal way of setting falsy values,
|
|
33
|
-
* so instead the args parser `mri` will pass through the truthy versions of args
|
|
34
|
-
* without the `no-` prefix.
|
|
35
|
-
* When we declare task args schemas,
|
|
36
|
-
* we need include both versions with their defaults to get correct `--help` output.
|
|
37
|
-
* Parsing like this also ensures data consistency for both versions because `mri` only creates one.
|
|
38
|
-
* A simpler implementation could replace `mri`, but it handles some finicky details well.
|
|
39
|
-
*/
|
|
40
|
-
export const parse_args = <
|
|
41
|
-
TOutput extends Record<string, ArgValue> = Args,
|
|
42
|
-
TInput extends Record<string, ArgValue> = Args,
|
|
43
|
-
>(
|
|
44
|
-
unparsed_args: TInput,
|
|
45
|
-
schema: z.ZodType<TOutput, TInput>,
|
|
46
|
-
): z.ZodSafeParseResult<TOutput> => {
|
|
47
|
-
const parsed = schema.safeParse(unparsed_args);
|
|
48
|
-
if (parsed.success) {
|
|
49
|
-
// mutate `data` with the correct source of truth for `no-` prefixed args
|
|
50
|
-
const {data} = parsed;
|
|
51
|
-
for (const key in parsed.data) {
|
|
52
|
-
if (key.startsWith('no-')) {
|
|
53
|
-
const base_key = key.substring(3);
|
|
54
|
-
if (!(key in unparsed_args)) {
|
|
55
|
-
(data as any)[key] = !data[base_key];
|
|
56
|
-
} else if (!(base_key in unparsed_args)) {
|
|
57
|
-
(data as any)[base_key] = !data[key];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return parsed;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Serializes parsed `Args` for CLI commands.
|
|
67
|
-
*/
|
|
68
|
-
export const serialize_args = (args: Args): Array<string> => {
|
|
69
|
-
const result: Array<string> = [];
|
|
70
|
-
const add_value = (name: string, value: string | number | boolean | undefined): void => {
|
|
71
|
-
if (value === undefined) return;
|
|
72
|
-
result.push(name);
|
|
73
|
-
if (typeof value !== 'boolean') {
|
|
74
|
-
result.push(value + '');
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
let _: Array<string> | null = null;
|
|
78
|
-
for (const [key, value] of Object.entries(args)) {
|
|
79
|
-
if (key === '_') {
|
|
80
|
-
_ = value ? (value as Array<any>).map((v) => (v === undefined ? '' : v + '')) : [];
|
|
81
|
-
} else {
|
|
82
|
-
const name = `${key.length === 1 ? '-' : '--'}${key}`;
|
|
83
|
-
if (Array.isArray(value)) {
|
|
84
|
-
for (const v of value) add_value(name, v);
|
|
85
|
-
} else {
|
|
86
|
-
add_value(name, value);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return _ ? [..._, ...result] : result;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Parses `task_name` and `args` from `process.argv` using `mri`,
|
|
5
|
+
* Parses `task_name` and `args` from `process.argv`,
|
|
95
6
|
* ignoring anything after any `--`.
|
|
96
7
|
*/
|
|
97
8
|
export const to_task_args = (argv = process.argv): {task_name: string; args: Args} => {
|
|
98
9
|
const forwarded_index = argv.indexOf('--');
|
|
99
|
-
const args =
|
|
10
|
+
const args = argv_parse(forwarded_index === -1 ? argv.slice(2) : argv.slice(2, forwarded_index));
|
|
100
11
|
const task_name = args._.shift() ?? '';
|
|
101
12
|
if (!args._.length) delete (args as Args)._; // enable schema defaults
|
|
102
13
|
return {task_name, args};
|
|
@@ -143,12 +54,12 @@ export const to_forwarded_args_by_command = (
|
|
|
143
54
|
// which is assumed to be the CLI command that gets forwarded the args.
|
|
144
55
|
const forwarded_args_by_command: Record<string, Args> = {};
|
|
145
56
|
for (const argv of argvs) {
|
|
146
|
-
const args =
|
|
57
|
+
const args = argv_parse(argv);
|
|
147
58
|
let command = args._.shift();
|
|
148
59
|
if (!command) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
60
|
+
// Skip sections without a command name - these are handled by `to_implicit_forwarded_args`.
|
|
61
|
+
// This allows `gro run script.ts -- --help` to pass `--help` to the script.
|
|
62
|
+
continue;
|
|
152
63
|
}
|
|
153
64
|
// Gro commands get combined with their task name.
|
|
154
65
|
if (command === 'gro') {
|
|
@@ -191,7 +102,7 @@ export const to_implicit_forwarded_args = (
|
|
|
191
102
|
argv = argv.slice(1);
|
|
192
103
|
}
|
|
193
104
|
|
|
194
|
-
const args =
|
|
105
|
+
const args = argv_parse(argv);
|
|
195
106
|
if (!args._.length) delete (args as Args)._;
|
|
196
107
|
return args;
|
|
197
108
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {args_serialize} from '@fuzdev/fuz_util/args.js';
|
|
2
2
|
import type {Logger} from '@fuzdev/fuz_util/log.js';
|
|
3
|
+
import type {SpawnResult} from '@fuzdev/fuz_util/process.js';
|
|
3
4
|
|
|
4
|
-
import {
|
|
5
|
+
import {to_forwarded_args} from './args.ts';
|
|
6
|
+
import {spawn_cli, to_cli_name, type Cli} from './cli.ts';
|
|
5
7
|
import {
|
|
6
8
|
GITHUB_DIRNAME,
|
|
7
9
|
README_FILENAME,
|
|
@@ -12,8 +14,7 @@ import {
|
|
|
12
14
|
PM_CLI_DEFAULT,
|
|
13
15
|
PRETTIER_CLI_DEFAULT,
|
|
14
16
|
} from './constants.ts';
|
|
15
|
-
import {
|
|
16
|
-
import {spawn_cli, to_cli_name, type Cli} from './cli.ts';
|
|
17
|
+
import {paths} from './paths.ts';
|
|
17
18
|
|
|
18
19
|
const EXTENSIONS_DEFAULT = 'ts,js,json,svelte,html,css,md,yml';
|
|
19
20
|
const ROOT_PATHS_DEFAULT = `${[
|
|
@@ -42,7 +43,7 @@ export const format_directory = async (
|
|
|
42
43
|
): Promise<SpawnResult> => {
|
|
43
44
|
const forwarded_args = to_forwarded_args(to_cli_name(prettier_cli));
|
|
44
45
|
forwarded_args[check ? 'check' : 'write'] = true;
|
|
45
|
-
const serialized_args =
|
|
46
|
+
const serialized_args = args_serialize(forwarded_args);
|
|
46
47
|
serialized_args.push(`${dir}**/*.{${extensions}}`);
|
|
47
48
|
if (dir === paths.source) {
|
|
48
49
|
serialized_args.push(`${paths.root}{${root_paths}}`);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type {Args} from '@fuzdev/fuz_util/args.js';
|
|
2
|
+
import {UnreachableError} from '@fuzdev/fuz_util/error.js';
|
|
1
3
|
import {EMPTY_OBJECT} from '@fuzdev/fuz_util/object.js';
|
|
2
4
|
import {throttle} from '@fuzdev/fuz_util/throttle.js';
|
|
3
|
-
import {UnreachableError} from '@fuzdev/fuz_util/error.js';
|
|
4
5
|
|
|
5
6
|
import type {Plugin} from './plugin.ts';
|
|
6
|
-
import type {Args} from './args.ts';
|
|
7
7
|
import {paths} from './paths.ts';
|
|
8
8
|
import {find_genfiles, is_gen_path} from './gen.ts';
|
|
9
9
|
import {filter_dependents} from './filer.ts';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import {args_serialize} from '@fuzdev/fuz_util/args.js';
|
|
1
2
|
import {spawn_result_to_message, type SpawnedProcess} from '@fuzdev/fuz_util/process.js';
|
|
2
3
|
|
|
3
|
-
import
|
|
4
|
-
import {serialize_args, to_forwarded_args} from './args.ts';
|
|
5
|
-
import {TaskError} from './task.ts';
|
|
4
|
+
import {to_forwarded_args} from './args.ts';
|
|
6
5
|
import {find_cli, spawn_cli, spawn_cli_process} from './cli.ts';
|
|
7
6
|
import {VITE_CLI} from './constants.ts';
|
|
7
|
+
import type {Plugin} from './plugin.ts';
|
|
8
|
+
import {TaskError} from './task.ts';
|
|
8
9
|
|
|
9
10
|
export interface GroPluginSveltekitAppOptions {
|
|
10
11
|
/**
|
|
@@ -28,7 +29,7 @@ export const gro_plugin_sveltekit_app = ({
|
|
|
28
29
|
if (dev) {
|
|
29
30
|
// `vite dev` in development mode
|
|
30
31
|
if (watch) {
|
|
31
|
-
const serialized_args = ['dev', ...
|
|
32
|
+
const serialized_args = ['dev', ...args_serialize(to_forwarded_args(vite_cli))];
|
|
32
33
|
sveltekit_process = await spawn_cli_process(found_vite_cli, serialized_args, log);
|
|
33
34
|
} else {
|
|
34
35
|
log.debug(
|
|
@@ -38,7 +39,7 @@ export const gro_plugin_sveltekit_app = ({
|
|
|
38
39
|
}
|
|
39
40
|
} else {
|
|
40
41
|
// `vite build` in production mode
|
|
41
|
-
const serialized_args = ['build', ...
|
|
42
|
+
const serialized_args = ['build', ...args_serialize(to_forwarded_args(vite_cli))];
|
|
42
43
|
const spawned = await spawn_cli(found_vite_cli, serialized_args, log);
|
|
43
44
|
if (!spawned?.ok) {
|
|
44
45
|
throw new TaskError(
|
package/src/lib/invoke_task.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {create_stopwatch, Timings} from '@fuzdev/fuz_util/timings.js';
|
|
3
|
-
import {print_ms, print_timings} from '@fuzdev/fuz_util/print.js';
|
|
1
|
+
import type {Args} from '@fuzdev/fuz_util/args.js';
|
|
4
2
|
import {Logger} from '@fuzdev/fuz_util/log.js';
|
|
3
|
+
import {print_ms, print_timings} from '@fuzdev/fuz_util/print.js';
|
|
4
|
+
import {create_stopwatch, Timings} from '@fuzdev/fuz_util/timings.js';
|
|
5
|
+
import {styleText as st} from 'node:util';
|
|
5
6
|
|
|
6
|
-
import {to_forwarded_args
|
|
7
|
+
import {to_forwarded_args} from './args.ts';
|
|
7
8
|
import {run_task} from './run_task.ts';
|
|
8
9
|
import {to_input_path, RawInputPath} from './input_path.ts';
|
|
9
10
|
import {find_tasks, load_tasks, SilentError} from './task.ts';
|
package/src/lib/lint.task.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import {args_serialize} from '@fuzdev/fuz_util/args.js';
|
|
1
2
|
import {print_spawn_result} from '@fuzdev/fuz_util/process.js';
|
|
2
3
|
import {z} from 'zod';
|
|
3
4
|
|
|
4
|
-
import {
|
|
5
|
-
import {serialize_args, to_forwarded_args} from './args.ts';
|
|
5
|
+
import {to_forwarded_args} from './args.ts';
|
|
6
6
|
import {find_cli, spawn_cli} from './cli.ts';
|
|
7
|
+
import {TaskError, type Task} from './task.ts';
|
|
7
8
|
|
|
8
9
|
const ESLINT_CLI = 'eslint';
|
|
9
10
|
|
|
@@ -29,7 +30,7 @@ export const task: Task<Args> = {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
const forwarded_args = {_, 'max-warnings': 0, ...to_forwarded_args(eslint_cli)};
|
|
32
|
-
const serialized_args =
|
|
33
|
+
const serialized_args = args_serialize(forwarded_args);
|
|
33
34
|
const eslintResult = await spawn_cli(found_eslint_cli, serialized_args, log);
|
|
34
35
|
if (!eslintResult?.ok) {
|
|
35
36
|
throw new TaskError(`ESLint found some problems. ${print_spawn_result(eslintResult!)}`);
|
package/src/lib/run.task.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {styleText as st} from 'node:util';
|
|
1
|
+
import {args_serialize} from '@fuzdev/fuz_util/args.js';
|
|
3
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';
|
|
4
6
|
|
|
5
|
-
import {
|
|
7
|
+
import {to_implicit_forwarded_args} from './args.ts';
|
|
6
8
|
import {resolve_gro_module_path, spawn_with_loader} from './gro_helpers.ts';
|
|
7
|
-
import {
|
|
8
|
-
import {serialize_args, to_implicit_forwarded_args} from './args.ts';
|
|
9
|
+
import {TaskError, type Task} from './task.ts';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Runs a TypeScript file with Gro's loader, forwarding all args to the script.
|
|
@@ -51,7 +52,7 @@ export const task: Task<Args> = {
|
|
|
51
52
|
const implicit_args = to_implicit_forwarded_args();
|
|
52
53
|
|
|
53
54
|
// Reconstruct argv: positional args + explicit named args + implicit args after --
|
|
54
|
-
const named_argv =
|
|
55
|
+
const named_argv = args_serialize({...forwarded_args, ...implicit_args});
|
|
55
56
|
const full_argv = [...positional_argv, ...named_argv];
|
|
56
57
|
|
|
57
58
|
const loader_path = resolve_gro_module_path('loader.js');
|
package/src/lib/run_task.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {Timings} from '@fuzdev/fuz_util/timings.js';
|
|
1
|
+
import {args_parse, type Args} from '@fuzdev/fuz_util/args.js';
|
|
3
2
|
import type {Logger} from '@fuzdev/fuz_util/log.js';
|
|
3
|
+
import type {Timings} from '@fuzdev/fuz_util/timings.js';
|
|
4
|
+
import {styleText as st} from 'node:util';
|
|
4
5
|
import {z} from 'zod';
|
|
5
6
|
|
|
6
|
-
import
|
|
7
|
-
import type {invoke_task as base_invoke_task} from './invoke_task.ts';
|
|
8
|
-
import {log_task_help} from './task_logging.ts';
|
|
7
|
+
import type {Filer} from './filer.ts';
|
|
9
8
|
import type {GroConfig} from './gro_config.ts';
|
|
10
|
-
import {
|
|
9
|
+
import type {invoke_task as base_invoke_task} from './invoke_task.ts';
|
|
11
10
|
import {default_svelte_config} from './svelte_config.ts';
|
|
12
|
-
import type
|
|
11
|
+
import {TaskError, type TaskModuleMeta} from './task.ts';
|
|
12
|
+
import {log_task_help} from './task_logging.ts';
|
|
13
13
|
|
|
14
14
|
export type RunTaskResult =
|
|
15
15
|
| {
|
|
@@ -41,7 +41,7 @@ export const run_task = async (
|
|
|
41
41
|
// Parse and validate args.
|
|
42
42
|
let args = unparsed_args;
|
|
43
43
|
if (task.Args) {
|
|
44
|
-
const parsed =
|
|
44
|
+
const parsed = args_parse(unparsed_args, task.Args);
|
|
45
45
|
if (!parsed.success) {
|
|
46
46
|
throw new TaskError(
|
|
47
47
|
`Failed task args validation for task '${task_meta.name}':\n${z.prettifyError(parsed.error)}`,
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {args_serialize} from '@fuzdev/fuz_util/args.js';
|
|
2
|
+
import {fs_exists} from '@fuzdev/fuz_util/fs.js';
|
|
2
3
|
import type {Logger} from '@fuzdev/fuz_util/log.js';
|
|
3
|
-
import {join} from 'node:path';
|
|
4
4
|
import type {PackageJson} from '@fuzdev/fuz_util/package_json.js';
|
|
5
|
-
import {
|
|
5
|
+
import type {Result} from '@fuzdev/fuz_util/result.js';
|
|
6
|
+
import {join} from 'node:path';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import {to_forwarded_args} from './args.ts';
|
|
9
|
+
import {find_cli, spawn_cli, to_cli_name, type Cli} from './cli.ts';
|
|
9
10
|
import {
|
|
10
|
-
SVELTE_CONFIG_FILENAME,
|
|
11
|
-
SVELTEKIT_DEV_DIRNAME,
|
|
12
11
|
PM_CLI_DEFAULT,
|
|
12
|
+
SVELTE_CONFIG_FILENAME,
|
|
13
13
|
SVELTE_PACKAGE_DEP_NAME,
|
|
14
14
|
SVELTEKIT_CLI,
|
|
15
|
+
SVELTEKIT_DEV_DIRNAME,
|
|
15
16
|
} from './constants.ts';
|
|
16
|
-
import {
|
|
17
|
+
import {package_json_has_dependency} from './package_json.ts';
|
|
18
|
+
import {default_svelte_config, type ParsedSvelteConfig} from './svelte_config.ts';
|
|
17
19
|
import {TaskError} from './task.ts';
|
|
18
|
-
import {serialize_args, to_forwarded_args} from './args.ts';
|
|
19
20
|
|
|
20
21
|
export const has_sveltekit_app = async (
|
|
21
22
|
svelte_config_path: string = SVELTE_CONFIG_FILENAME,
|
|
@@ -166,7 +167,7 @@ export const run_svelte_package = async (
|
|
|
166
167
|
`Failed to find SvelteKit packaging CLI \`${cli_name}\`, do you need to run \`${pm_cli} install\`?`,
|
|
167
168
|
);
|
|
168
169
|
}
|
|
169
|
-
const serialized_args =
|
|
170
|
+
const serialized_args = args_serialize({
|
|
170
171
|
...options,
|
|
171
172
|
...to_forwarded_args(cli_name),
|
|
172
173
|
});
|
package/src/lib/task.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
import type {Args} from '@fuzdev/fuz_util/args.js';
|
|
2
|
+
import {fs_search} from '@fuzdev/fuz_util/fs.js';
|
|
1
3
|
import type {Logger} from '@fuzdev/fuz_util/log.js';
|
|
4
|
+
import type {PathId} from '@fuzdev/fuz_util/path.js';
|
|
5
|
+
import type {Result} from '@fuzdev/fuz_util/result.js';
|
|
2
6
|
import {ensure_end, strip_end, strip_start} from '@fuzdev/fuz_util/string.js';
|
|
3
|
-
import type {z} from 'zod';
|
|
4
7
|
import type {Timings} from '@fuzdev/fuz_util/timings.js';
|
|
5
|
-
import {styleText as st} from 'node:util';
|
|
6
|
-
import type {Result} from '@fuzdev/fuz_util/result.js';
|
|
7
8
|
import {isAbsolute, join, relative} from 'node:path';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import type {Args} from './args.ts';
|
|
9
|
+
import {styleText as st} from 'node:util';
|
|
10
|
+
import type {z} from 'zod';
|
|
12
11
|
import type {GroConfig} from './gro_config.ts';
|
|
13
12
|
import type {ParsedSvelteConfig} from './svelte_config.ts';
|
|
14
13
|
import {
|
package/src/lib/task_logging.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {ArgSchema} from '@fuzdev/fuz_util/args.js';
|
|
2
2
|
import type {Logger} from '@fuzdev/fuz_util/log.js';
|
|
3
|
-
import {plural} from '@fuzdev/fuz_util/string.js';
|
|
4
3
|
import {print_value} from '@fuzdev/fuz_util/print.js';
|
|
4
|
+
import {plural} from '@fuzdev/fuz_util/string.js';
|
|
5
|
+
import {styleText as st} from 'node:util';
|
|
5
6
|
import {z} from 'zod';
|
|
6
|
-
|
|
7
|
-
import type {ArgSchema} from './args.ts';
|
|
8
7
|
import type {LoadedTasks, TaskModuleMeta} from './task.ts';
|
|
9
8
|
import {print_path} from './paths.ts';
|
|
10
9
|
|
package/src/lib/test.task.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {spawn_cli} from '@ryanatkn/gro/cli.js';
|
|
1
|
+
import {args_serialize} from '@fuzdev/fuz_util/args.js';
|
|
3
2
|
import {spawn_result_to_message} from '@fuzdev/fuz_util/process.js';
|
|
3
|
+
import {spawn_cli} from '@ryanatkn/gro/cli.js';
|
|
4
|
+
import {z} from 'zod';
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
+
import {to_implicit_forwarded_args} from './args.ts';
|
|
6
7
|
import {find_cli} from './cli.ts';
|
|
7
|
-
import {package_json_has_dependency, package_json_load} from './package_json.ts';
|
|
8
|
-
import {serialize_args, to_implicit_forwarded_args} from './args.ts';
|
|
9
8
|
import {VITEST_CLI} from './constants.ts';
|
|
9
|
+
import {package_json_has_dependency, package_json_load} from './package_json.ts';
|
|
10
10
|
import {paths} from './paths.ts';
|
|
11
|
+
import {TaskError, type Task} from './task.ts';
|
|
11
12
|
|
|
12
13
|
/** @nodocs */
|
|
13
14
|
export const Args = z.strictObject({
|
|
@@ -50,7 +51,7 @@ export const task: Task<Args> = {
|
|
|
50
51
|
if (t) {
|
|
51
52
|
vitest_args.push('-t', t);
|
|
52
53
|
}
|
|
53
|
-
vitest_args.push(...
|
|
54
|
+
vitest_args.push(...args_serialize(to_implicit_forwarded_args(VITEST_CLI)));
|
|
54
55
|
|
|
55
56
|
const spawned = await spawn_cli(VITEST_CLI, vitest_args);
|
|
56
57
|
if (!spawned?.ok) {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import {args_serialize} from '@fuzdev/fuz_util/args.js';
|
|
1
2
|
import {print_spawn_result} from '@fuzdev/fuz_util/process.js';
|
|
2
3
|
import {z} from 'zod';
|
|
3
4
|
|
|
4
|
-
import {
|
|
5
|
-
import {serialize_args, to_forwarded_args} from './args.ts';
|
|
6
|
-
import {find_cli, spawn_cli, spawn_cli_process} from './cli.ts';
|
|
7
|
-
import {sveltekit_sync_if_available} from './sveltekit_helpers.ts';
|
|
5
|
+
import {to_forwarded_args} from './args.ts';
|
|
8
6
|
import {configure_colored_output_with_path_replacement} from './child_process_logging.ts';
|
|
9
|
-
import {
|
|
7
|
+
import {find_cli, spawn_cli, spawn_cli_process} from './cli.ts';
|
|
10
8
|
import {SVELTE_CHECK_CLI} from './constants.ts';
|
|
9
|
+
import {paths} from './paths.ts';
|
|
10
|
+
import {sveltekit_sync_if_available} from './sveltekit_helpers.ts';
|
|
11
|
+
import {TaskError, type Task} from './task.ts';
|
|
11
12
|
|
|
12
13
|
/** @nodocs */
|
|
13
14
|
export const Args = z.strictObject({
|
|
@@ -39,7 +40,7 @@ export const task: Task<Args> = {
|
|
|
39
40
|
// Prefer svelte-check if available.
|
|
40
41
|
const found_svelte_check_cli = await find_cli(svelte_check_cli);
|
|
41
42
|
if (found_svelte_check_cli) {
|
|
42
|
-
const serialized =
|
|
43
|
+
const serialized = args_serialize(to_forwarded_args(svelte_check_cli));
|
|
43
44
|
const spawned = await spawn_cli_process(found_svelte_check_cli, serialized, undefined, {
|
|
44
45
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
45
46
|
env: {...process.env, FORCE_COLOR: '1'}, // Needed for colors (maybe make an option)
|
|
@@ -65,7 +66,7 @@ export const task: Task<Args> = {
|
|
|
65
66
|
if (found_typescript_cli) {
|
|
66
67
|
const forwarded = to_forwarded_args(typescript_cli);
|
|
67
68
|
if (!forwarded.noEmit) forwarded.noEmit = true;
|
|
68
|
-
const serialized =
|
|
69
|
+
const serialized = args_serialize(forwarded);
|
|
69
70
|
const svelte_check_result = await spawn_cli(found_typescript_cli, serialized, log);
|
|
70
71
|
if (!svelte_check_result?.ok) {
|
|
71
72
|
throw new TaskError(`Failed to typecheck. ${print_spawn_result(svelte_check_result!)}`);
|
package/src/lib/upgrade.task.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import {args_serialize} from '@fuzdev/fuz_util/args.js';
|
|
2
|
+
import {GitOrigin, git_pull} from '@fuzdev/fuz_util/git.js';
|
|
1
3
|
import {spawn} from '@fuzdev/fuz_util/process.js';
|
|
2
|
-
import {z} from 'zod';
|
|
3
4
|
import {rm} from 'node:fs/promises';
|
|
4
|
-
import {
|
|
5
|
+
import {z} from 'zod';
|
|
5
6
|
|
|
6
|
-
import {
|
|
7
|
+
import {to_forwarded_args} from './args.ts';
|
|
8
|
+
import {spawn_cli} from './cli.ts';
|
|
9
|
+
import {NODE_MODULES_DIRNAME} from './constants.ts';
|
|
7
10
|
import {
|
|
8
11
|
package_json_extract_dependencies,
|
|
9
12
|
package_json_load,
|
|
10
13
|
type PackageJsonDep,
|
|
11
14
|
} from './package_json.ts';
|
|
12
|
-
import {
|
|
13
|
-
import {serialize_args, to_forwarded_args} from './args.ts';
|
|
14
|
-
import {NODE_MODULES_DIRNAME} from './constants.ts';
|
|
15
|
+
import {TaskError, type Task} from './task.ts';
|
|
15
16
|
|
|
16
17
|
/** @nodocs */
|
|
17
18
|
export const Args = z.strictObject({
|
|
@@ -113,7 +114,7 @@ export const task: Task<Args> = {
|
|
|
113
114
|
if (force) {
|
|
114
115
|
install_args.push('--force');
|
|
115
116
|
}
|
|
116
|
-
install_args.push(...
|
|
117
|
+
install_args.push(...args_serialize(to_forwarded_args(config.pm_cli)));
|
|
117
118
|
await spawn(config.pm_cli, install_args);
|
|
118
119
|
|
|
119
120
|
// TODO @many this relies on npm behavior that changed in v11
|