@ryanatkn/gro 0.186.0 → 0.188.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gro.js +2 -1
- package/dist/gro_plugin_server.js +1 -1
- package/dist/gro_plugin_sveltekit_app.d.ts.map +1 -1
- package/dist/gro_plugin_sveltekit_app.js +2 -1
- package/dist/gro_plugin_sveltekit_library.d.ts.map +1 -1
- package/dist/gro_plugin_sveltekit_library.js +2 -2
- package/dist/invoke.js +5 -2
- package/dist/run.task.d.ts.map +1 -1
- package/dist/run.task.js +2 -1
- package/dist/test.task.d.ts.map +1 -1
- package/dist/test.task.js +2 -1
- package/package.json +5 -5
- package/src/lib/gro.ts +3 -1
- package/src/lib/gro_plugin_server.ts +1 -1
- package/src/lib/gro_plugin_sveltekit_app.ts +4 -2
- package/src/lib/gro_plugin_sveltekit_library.ts +4 -2
- package/src/lib/invoke.ts +5 -5
- package/src/lib/run.task.ts +2 -1
- package/src/lib/test.task.ts +4 -1
package/dist/gro.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --experimental-import-meta-resolve --experimental-strip-types --disable-warning=ExperimentalWarning
|
|
2
2
|
// @sync Node options to `$lib/gro_helpers.ts`
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
+
import { spawn_result_is_exited } from '@fuzdev/fuz_util/process.js';
|
|
4
5
|
import { resolve_gro_module_path, spawn_with_loader } from "./gro_helpers.js";
|
|
5
6
|
/*
|
|
6
7
|
|
|
@@ -16,5 +17,5 @@ const invoke_path = resolve_gro_module_path('invoke.js');
|
|
|
16
17
|
const loader_path = join(invoke_path, '../loader.js');
|
|
17
18
|
const spawned = await spawn_with_loader(loader_path, invoke_path, process.argv.slice(2));
|
|
18
19
|
if (!spawned.ok) {
|
|
19
|
-
process.exitCode = spawned.code
|
|
20
|
+
process.exitCode = spawn_result_is_exited(spawned) ? spawned.code : 1;
|
|
20
21
|
}
|
|
@@ -113,7 +113,7 @@ export const gro_plugin_server = ({ entry_points = [SERVER_SOURCE_ID], dir = pro
|
|
|
113
113
|
return;
|
|
114
114
|
print_build_result(log, build_result);
|
|
115
115
|
deps = parse_deps(metafile.inputs, dir);
|
|
116
|
-
server_process?.restart();
|
|
116
|
+
void server_process?.restart();
|
|
117
117
|
}, { delay: rebuild_throttle_delay });
|
|
118
118
|
await rebuild();
|
|
119
119
|
if (watch) {
|
|
@@ -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":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAMxC,MAAM,WAAW,4BAA4B;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,wBAAwB,GAAI,gBAEtC,4BAAiC,KAAG,
|
|
1
|
+
{"version":3,"file":"gro_plugin_sveltekit_app.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_sveltekit_app.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAMxC,MAAM,WAAW,4BAA4B;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,wBAAwB,GAAI,gBAEtC,4BAAiC,KAAG,MAuCtC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn_result_to_message } from '@fuzdev/fuz_util/process.js';
|
|
1
2
|
import { serialize_args, to_forwarded_args } from "./args.js";
|
|
2
3
|
import { TaskError } from "./task.js";
|
|
3
4
|
import { find_cli, spawn_cli, spawn_cli_process } from "./cli.js";
|
|
@@ -26,7 +27,7 @@ export const gro_plugin_sveltekit_app = ({ vite_cli = VITE_CLI, } = {}) => {
|
|
|
26
27
|
const serialized_args = ['build', ...serialize_args(to_forwarded_args(vite_cli))];
|
|
27
28
|
const spawned = await spawn_cli(found_vite_cli, serialized_args, log);
|
|
28
29
|
if (!spawned?.ok) {
|
|
29
|
-
throw new TaskError(`${vite_cli} build failed
|
|
30
|
+
throw new TaskError(`${vite_cli} build failed: ${spawned ? spawn_result_to_message(spawned) : 'unknown error'}`);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_plugin_sveltekit_library.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_sveltekit_library.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAqB,KAAK,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAGrF,MAAM,WAAW,gCAAgC;IAChD;;;OAGG;IACH,sBAAsB,CAAC,EAAE,oBAAoB,CAAC;IAC9C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,4BAA4B,GAAI,kDAG1C,gCAAqC,KAAG,
|
|
1
|
+
{"version":3,"file":"gro_plugin_sveltekit_library.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_sveltekit_library.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAqB,KAAK,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAGrF,MAAM,WAAW,gCAAgC;IAChD;;;OAGG;IACH,sBAAsB,CAAC,EAAE,oBAAoB,CAAC;IAC9C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,4BAA4B,GAAI,kDAG1C,gCAAqC,KAAG,MAsC1C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { print_spawn_result, spawn } from '@fuzdev/fuz_util/process.js';
|
|
1
|
+
import { print_spawn_result, spawn, spawn_result_to_message } from '@fuzdev/fuz_util/process.js';
|
|
2
2
|
import { TaskError } from "./task.js";
|
|
3
3
|
import { package_json_load } from "./package_json.js";
|
|
4
4
|
import { run_svelte_package } from "./sveltekit_helpers.js";
|
|
@@ -20,7 +20,7 @@ export const gro_plugin_sveltekit_library = ({ svelte_package_options, svelte_pa
|
|
|
20
20
|
await Promise.all(Object.values(package_json.bin).map(async (bin_path) => {
|
|
21
21
|
const chmod_result = await spawn('chmod', ['+x', bin_path]);
|
|
22
22
|
if (!chmod_result.ok)
|
|
23
|
-
log.error(`chmod on bin path ${bin_path} failed
|
|
23
|
+
log.error(`chmod on bin path ${bin_path} failed: ${spawn_result_to_message(chmod_result)}`);
|
|
24
24
|
}));
|
|
25
25
|
log.info(`linking`);
|
|
26
26
|
const link_result = await spawn(config.pm_cli, ['link', '-f']); // TODO don't use `-f` unless necessary or at all?
|
package/dist/invoke.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attach_process_error_handler } from '@fuzdev/fuz_util/process.js';
|
|
2
2
|
import { configure_print_colors } from '@fuzdev/fuz_util/print.js';
|
|
3
3
|
import { invoke_task } from "./invoke_task.js";
|
|
4
4
|
import { to_task_args } from "./args.js";
|
|
@@ -15,7 +15,10 @@ and the rest of the args are forwarded to the task's `run` function.
|
|
|
15
15
|
|
|
16
16
|
*/
|
|
17
17
|
// handle uncaught errors
|
|
18
|
-
|
|
18
|
+
attach_process_error_handler({
|
|
19
|
+
to_error_label: (err) => (err.constructor.name === 'TaskError' ? 'TaskError' : null),
|
|
20
|
+
map_error_text: (err) => (err.constructor.name === 'SilentError' ? '' : null),
|
|
21
|
+
});
|
|
19
22
|
if (!process.env.NO_COLOR) {
|
|
20
23
|
const { styleText } = await import('node:util');
|
|
21
24
|
configure_print_colors(styleText);
|
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":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"run.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/run.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAK/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
|
@@ -3,6 +3,7 @@ import { styleText as st } from 'node:util';
|
|
|
3
3
|
import { fs_exists } from '@fuzdev/fuz_util/fs.js';
|
|
4
4
|
import { TaskError } from "./task.js";
|
|
5
5
|
import { resolve_gro_module_path, spawn_with_loader } from "./gro_helpers.js";
|
|
6
|
+
import { spawn_result_to_message } from '@fuzdev/fuz_util/process.js';
|
|
6
7
|
import { serialize_args, to_implicit_forwarded_args } from "./args.js";
|
|
7
8
|
/**
|
|
8
9
|
* Runs a TypeScript file with Gro's loader, forwarding all args to the script.
|
|
@@ -44,7 +45,7 @@ export const task = {
|
|
|
44
45
|
const loader_path = resolve_gro_module_path('loader.js');
|
|
45
46
|
const spawned = await spawn_with_loader(loader_path, path, full_argv);
|
|
46
47
|
if (!spawned.ok) {
|
|
47
|
-
throw new TaskError(`\`gro run ${path}\` failed
|
|
48
|
+
throw new TaskError(`\`gro run ${path}\` failed: ${spawn_result_to_message(spawned)}`);
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
51
|
};
|
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":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"test.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/test.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAO/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,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { spawn_cli } from './cli.js';
|
|
3
|
+
import { spawn_result_to_message } from '@fuzdev/fuz_util/process.js';
|
|
3
4
|
import { TaskError } from "./task.js";
|
|
4
5
|
import { find_cli } from "./cli.js";
|
|
5
6
|
import { package_json_has_dependency, package_json_load } from "./package_json.js";
|
|
@@ -45,7 +46,7 @@ export const task = {
|
|
|
45
46
|
vitest_args.push(...serialize_args(to_implicit_forwarded_args(VITEST_CLI)));
|
|
46
47
|
const spawned = await spawn_cli(VITEST_CLI, vitest_args);
|
|
47
48
|
if (!spawned?.ok) {
|
|
48
|
-
throw new TaskError(`vitest failed
|
|
49
|
+
throw new TaskError(`vitest failed: ${spawned ? spawn_result_to_message(spawned) : 'unknown error'}`);
|
|
49
50
|
}
|
|
50
51
|
},
|
|
51
52
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryanatkn/gro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.188.0",
|
|
4
4
|
"description": "task runner and toolkit extending SvelteKit",
|
|
5
5
|
"motto": "generate, run, optimize",
|
|
6
6
|
"glyph": "🌰",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"zod": "^4.1.13"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@fuzdev/fuz_util": ">=0.
|
|
63
|
+
"@fuzdev/fuz_util": ">=0.47.0",
|
|
64
64
|
"@sveltejs/kit": "^2",
|
|
65
65
|
"esbuild": "^0.27.0",
|
|
66
66
|
"svelte": "^5",
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@changesets/changelog-git": "^0.2.1",
|
|
83
83
|
"@changesets/types": "^6.1.0",
|
|
84
|
-
"@fuzdev/fuz_code": "^0.
|
|
84
|
+
"@fuzdev/fuz_code": "^0.40.0",
|
|
85
85
|
"@fuzdev/fuz_css": "^0.44.1",
|
|
86
|
-
"@fuzdev/fuz_ui": "^0.
|
|
87
|
-
"@fuzdev/fuz_util": "^0.
|
|
86
|
+
"@fuzdev/fuz_ui": "^0.179.0",
|
|
87
|
+
"@fuzdev/fuz_util": "^0.47.0",
|
|
88
88
|
"@ryanatkn/eslint-config": "^0.9.0",
|
|
89
89
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
90
90
|
"@sveltejs/kit": "^2.49.1",
|
package/src/lib/gro.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import {join} from 'node:path';
|
|
6
6
|
|
|
7
|
+
import {spawn_result_is_exited} from '@fuzdev/fuz_util/process.js';
|
|
8
|
+
|
|
7
9
|
import {resolve_gro_module_path, spawn_with_loader} from './gro_helpers.ts';
|
|
8
10
|
|
|
9
11
|
/*
|
|
@@ -23,5 +25,5 @@ const loader_path = join(invoke_path, '../loader.js');
|
|
|
23
25
|
|
|
24
26
|
const spawned = await spawn_with_loader(loader_path, invoke_path, process.argv.slice(2));
|
|
25
27
|
if (!spawned.ok) {
|
|
26
|
-
process.exitCode = spawned.code
|
|
28
|
+
process.exitCode = spawn_result_is_exited(spawned) ? spawned.code : 1;
|
|
27
29
|
}
|
|
@@ -225,7 +225,7 @@ export const gro_plugin_server = ({
|
|
|
225
225
|
if (!metafile) return;
|
|
226
226
|
print_build_result(log, build_result);
|
|
227
227
|
deps = parse_deps(metafile.inputs, dir);
|
|
228
|
-
server_process?.restart();
|
|
228
|
+
void server_process?.restart();
|
|
229
229
|
},
|
|
230
230
|
{delay: rebuild_throttle_delay},
|
|
231
231
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import {spawn_result_to_message, type SpawnedProcess} from '@fuzdev/fuz_util/process.js';
|
|
2
2
|
|
|
3
3
|
import type {Plugin} from './plugin.ts';
|
|
4
4
|
import {serialize_args, to_forwarded_args} from './args.ts';
|
|
@@ -41,7 +41,9 @@ export const gro_plugin_sveltekit_app = ({
|
|
|
41
41
|
const serialized_args = ['build', ...serialize_args(to_forwarded_args(vite_cli))];
|
|
42
42
|
const spawned = await spawn_cli(found_vite_cli, serialized_args, log);
|
|
43
43
|
if (!spawned?.ok) {
|
|
44
|
-
throw new TaskError(
|
|
44
|
+
throw new TaskError(
|
|
45
|
+
`${vite_cli} build failed: ${spawned ? spawn_result_to_message(spawned) : 'unknown error'}`,
|
|
46
|
+
);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {print_spawn_result, spawn} from '@fuzdev/fuz_util/process.js';
|
|
1
|
+
import {print_spawn_result, spawn, spawn_result_to_message} from '@fuzdev/fuz_util/process.js';
|
|
2
2
|
|
|
3
3
|
import type {Plugin} from './plugin.ts';
|
|
4
4
|
import {TaskError} from './task.ts';
|
|
@@ -46,7 +46,9 @@ export const gro_plugin_sveltekit_library = ({
|
|
|
46
46
|
Object.values(package_json.bin).map(async (bin_path) => {
|
|
47
47
|
const chmod_result = await spawn('chmod', ['+x', bin_path]);
|
|
48
48
|
if (!chmod_result.ok)
|
|
49
|
-
log.error(
|
|
49
|
+
log.error(
|
|
50
|
+
`chmod on bin path ${bin_path} failed: ${spawn_result_to_message(chmod_result)}`,
|
|
51
|
+
);
|
|
50
52
|
}),
|
|
51
53
|
);
|
|
52
54
|
log.info(`linking`);
|
package/src/lib/invoke.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {attach_process_error_handler} from '@fuzdev/fuz_util/process.js';
|
|
2
2
|
import {configure_print_colors} from '@fuzdev/fuz_util/print.js';
|
|
3
3
|
|
|
4
4
|
import {invoke_task} from './invoke_task.ts';
|
|
@@ -18,10 +18,10 @@ and the rest of the args are forwarded to the task's `run` function.
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
// handle uncaught errors
|
|
21
|
-
|
|
22
|
-
(err) => (err.constructor.name === 'TaskError' ? 'TaskError' : null),
|
|
23
|
-
(err) => (err.constructor.name === 'SilentError' ? '' : null),
|
|
24
|
-
);
|
|
21
|
+
attach_process_error_handler({
|
|
22
|
+
to_error_label: (err) => (err.constructor.name === 'TaskError' ? 'TaskError' : null),
|
|
23
|
+
map_error_text: (err) => (err.constructor.name === 'SilentError' ? '' : null),
|
|
24
|
+
});
|
|
25
25
|
|
|
26
26
|
if (!process.env.NO_COLOR) {
|
|
27
27
|
const {styleText} = await import('node:util');
|
package/src/lib/run.task.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {fs_exists} from '@fuzdev/fuz_util/fs.js';
|
|
|
4
4
|
|
|
5
5
|
import {TaskError, type Task} from './task.ts';
|
|
6
6
|
import {resolve_gro_module_path, spawn_with_loader} from './gro_helpers.ts';
|
|
7
|
+
import {spawn_result_to_message} from '@fuzdev/fuz_util/process.js';
|
|
7
8
|
import {serialize_args, to_implicit_forwarded_args} from './args.ts';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -57,7 +58,7 @@ export const task: Task<Args> = {
|
|
|
57
58
|
|
|
58
59
|
const spawned = await spawn_with_loader(loader_path, path, full_argv);
|
|
59
60
|
if (!spawned.ok) {
|
|
60
|
-
throw new TaskError(`\`gro run ${path}\` failed
|
|
61
|
+
throw new TaskError(`\`gro run ${path}\` failed: ${spawn_result_to_message(spawned)}`);
|
|
61
62
|
}
|
|
62
63
|
},
|
|
63
64
|
};
|
package/src/lib/test.task.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {z} from 'zod';
|
|
2
2
|
import {spawn_cli} from '@ryanatkn/gro/cli.js';
|
|
3
|
+
import {spawn_result_to_message} from '@fuzdev/fuz_util/process.js';
|
|
3
4
|
|
|
4
5
|
import {TaskError, type Task} from './task.ts';
|
|
5
6
|
import {find_cli} from './cli.ts';
|
|
@@ -53,7 +54,9 @@ export const task: Task<Args> = {
|
|
|
53
54
|
|
|
54
55
|
const spawned = await spawn_cli(VITEST_CLI, vitest_args);
|
|
55
56
|
if (!spawned?.ok) {
|
|
56
|
-
throw new TaskError(
|
|
57
|
+
throw new TaskError(
|
|
58
|
+
`vitest failed: ${spawned ? spawn_result_to_message(spawned) : 'unknown error'}`,
|
|
59
|
+
);
|
|
57
60
|
}
|
|
58
61
|
},
|
|
59
62
|
};
|