@ryanatkn/gro 0.179.0 → 0.181.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/README.md +1 -1
- package/dist/build.task.d.ts +2 -0
- package/dist/build.task.d.ts.map +1 -1
- package/dist/build.task.js +15 -11
- package/dist/build_cache.d.ts +4 -4
- package/dist/build_cache.d.ts.map +1 -1
- package/dist/build_cache.js +54 -44
- package/dist/changelog.d.ts +2 -2
- package/dist/changelog.d.ts.map +1 -1
- package/dist/changeset.task.js +11 -11
- package/dist/check.task.js +2 -2
- package/dist/child_process_logging.js +1 -1
- package/dist/clean.task.js +2 -2
- package/dist/clean_fs.d.ts +1 -1
- package/dist/clean_fs.d.ts.map +1 -1
- package/dist/clean_fs.js +3 -4
- package/dist/cli.d.ts +7 -7
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +11 -12
- package/dist/commit.task.js +2 -2
- package/dist/deploy.task.d.ts +7 -0
- package/dist/deploy.task.d.ts.map +1 -1
- package/dist/deploy.task.js +30 -17
- package/dist/disknode.d.ts +1 -1
- package/dist/disknode.d.ts.map +1 -1
- package/dist/esbuild_helpers.d.ts +1 -1
- package/dist/esbuild_helpers.d.ts.map +1 -1
- package/dist/esbuild_plugin_external_worker.d.ts +1 -1
- package/dist/esbuild_plugin_external_worker.d.ts.map +1 -1
- package/dist/esbuild_plugin_external_worker.js +1 -1
- package/dist/esbuild_plugin_svelte.js +4 -4
- package/dist/esbuild_plugin_sveltekit_local_imports.js +2 -2
- package/dist/esbuild_plugin_sveltekit_shim_alias.js +1 -1
- package/dist/filer.d.ts +4 -4
- package/dist/filer.d.ts.map +1 -1
- package/dist/filer.js +105 -54
- package/dist/format.task.js +1 -1
- package/dist/format_directory.d.ts +2 -2
- package/dist/format_directory.d.ts.map +1 -1
- package/dist/format_file.js +1 -1
- package/dist/gen.d.ts +5 -5
- package/dist/gen.d.ts.map +1 -1
- package/dist/gen.js +28 -22
- package/dist/gen.task.js +3 -3
- package/dist/gen_helpers.d.ts +3 -3
- package/dist/gen_helpers.d.ts.map +1 -1
- package/dist/github.d.ts +2 -2
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +1 -1
- package/dist/gro.config.default.js +1 -1
- package/dist/gro_config.d.ts +1 -1
- package/dist/gro_config.d.ts.map +1 -1
- package/dist/gro_config.js +4 -4
- package/dist/gro_helpers.d.ts +1 -1
- package/dist/gro_helpers.d.ts.map +1 -1
- package/dist/gro_helpers.js +1 -1
- package/dist/gro_plugin_gen.js +4 -4
- package/dist/gro_plugin_server.d.ts +2 -2
- package/dist/gro_plugin_server.d.ts.map +1 -1
- package/dist/gro_plugin_server.js +7 -7
- package/dist/gro_plugin_sveltekit_app.d.ts.map +1 -1
- package/dist/gro_plugin_sveltekit_app.js +40 -36
- package/dist/gro_plugin_sveltekit_library.js +3 -2
- package/dist/input_path.d.ts +5 -5
- package/dist/input_path.d.ts.map +1 -1
- package/dist/input_path.js +17 -15
- package/dist/invoke.js +2 -2
- package/dist/invoke_task.d.ts +2 -2
- package/dist/invoke_task.d.ts.map +1 -1
- package/dist/invoke_task.js +5 -5
- package/dist/lint.task.js +2 -2
- package/dist/loader.js +2 -2
- package/dist/modules.d.ts +3 -3
- package/dist/modules.d.ts.map +1 -1
- package/dist/modules.js +4 -4
- package/dist/package_json.d.ts +6 -6
- package/dist/package_json.d.ts.map +1 -1
- package/dist/package_json.js +14 -16
- package/dist/parse_exports.d.ts +4 -4
- package/dist/parse_exports.d.ts.map +1 -1
- package/dist/parse_exports_context.d.ts +1 -1
- package/dist/parse_exports_context.d.ts.map +1 -1
- package/dist/parse_imports.d.ts +2 -2
- package/dist/parse_imports.d.ts.map +1 -1
- package/dist/parse_imports.js +1 -1
- package/dist/paths.d.ts +1 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +1 -1
- package/dist/publish.task.js +8 -8
- package/dist/reinstall.task.js +1 -1
- package/dist/release.task.js +1 -1
- package/dist/resolve.task.js +2 -2
- package/dist/resolve_specifier.d.ts +2 -2
- package/dist/resolve_specifier.d.ts.map +1 -1
- package/dist/resolve_specifier.js +5 -4
- package/dist/run.task.js +2 -2
- package/dist/run_gen.d.ts +2 -2
- package/dist/run_gen.d.ts.map +1 -1
- package/dist/run_gen.js +10 -9
- package/dist/run_task.d.ts +2 -2
- package/dist/run_task.d.ts.map +1 -1
- package/dist/run_task.js +4 -4
- package/dist/source_json.d.ts +5 -5
- package/dist/source_json.d.ts.map +1 -1
- package/dist/source_json.js +18 -17
- package/dist/svelte_config.js +1 -1
- package/dist/sveltekit_helpers.d.ts +3 -3
- package/dist/sveltekit_helpers.d.ts.map +1 -1
- package/dist/sveltekit_helpers.js +4 -4
- package/dist/sveltekit_shim_app_forms.js +1 -1
- package/dist/sveltekit_shim_app_navigation.js +1 -1
- package/dist/sveltekit_shim_app_paths.js +1 -1
- package/dist/sveltekit_shim_env.js +1 -1
- package/dist/sync.task.js +1 -1
- package/dist/task.d.ts +5 -5
- package/dist/task.d.ts.map +1 -1
- package/dist/task.js +5 -5
- package/dist/task_logging.d.ts +1 -1
- 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 +5 -4
- package/dist/typecheck.task.js +4 -4
- package/dist/upgrade.task.js +6 -6
- package/dist/watch_dir.d.ts +1 -1
- package/dist/watch_dir.d.ts.map +1 -1
- package/dist/watch_dir.js +2 -2
- package/package.json +8 -8
- package/src/lib/build.task.ts +16 -11
- package/src/lib/build_cache.ts +81 -65
- package/src/lib/changelog.ts +2 -2
- package/src/lib/changeset.task.ts +12 -12
- package/src/lib/check.task.ts +2 -2
- package/src/lib/child_process_logging.ts +1 -1
- package/src/lib/clean.task.ts +2 -2
- package/src/lib/clean_fs.ts +4 -4
- package/src/lib/cli.ts +18 -17
- package/src/lib/commit.task.ts +2 -2
- package/src/lib/deploy.task.ts +33 -16
- package/src/lib/disknode.ts +1 -1
- package/src/lib/esbuild_helpers.ts +1 -1
- package/src/lib/esbuild_plugin_external_worker.ts +3 -3
- package/src/lib/esbuild_plugin_svelte.ts +4 -4
- package/src/lib/esbuild_plugin_sveltekit_local_imports.ts +2 -2
- package/src/lib/esbuild_plugin_sveltekit_shim_alias.ts +1 -1
- package/src/lib/filer.ts +117 -58
- package/src/lib/format.task.ts +1 -1
- package/src/lib/format_directory.ts +2 -2
- package/src/lib/format_file.ts +1 -1
- package/src/lib/gen.task.ts +3 -3
- package/src/lib/gen.ts +56 -50
- package/src/lib/gen_helpers.ts +3 -3
- package/src/lib/github.ts +2 -2
- package/src/lib/gro.config.default.ts +1 -1
- package/src/lib/gro_config.ts +5 -5
- package/src/lib/gro_helpers.ts +1 -1
- package/src/lib/gro_plugin_gen.ts +4 -4
- package/src/lib/gro_plugin_server.ts +9 -9
- package/src/lib/gro_plugin_sveltekit_app.ts +44 -40
- package/src/lib/gro_plugin_sveltekit_library.ts +3 -3
- package/src/lib/input_path.ts +23 -24
- package/src/lib/invoke.ts +2 -2
- package/src/lib/invoke_task.ts +5 -5
- package/src/lib/lint.task.ts +2 -2
- package/src/lib/loader.ts +2 -2
- package/src/lib/modules.ts +7 -7
- package/src/lib/package_json.ts +19 -23
- package/src/lib/parse_exports.ts +4 -4
- package/src/lib/parse_exports_context.ts +2 -2
- package/src/lib/parse_imports.ts +3 -3
- package/src/lib/paths.ts +2 -2
- package/src/lib/publish.task.ts +8 -8
- package/src/lib/reinstall.task.ts +1 -1
- package/src/lib/release.task.ts +1 -1
- package/src/lib/resolve.task.ts +2 -2
- package/src/lib/resolve_specifier.ts +9 -5
- package/src/lib/run.task.ts +2 -2
- package/src/lib/run_gen.ts +18 -13
- package/src/lib/run_task.ts +6 -6
- package/src/lib/source_json.ts +26 -22
- package/src/lib/svelte_config.ts +1 -1
- package/src/lib/sveltekit_helpers.ts +7 -7
- package/src/lib/sveltekit_shim_app_forms.ts +1 -1
- package/src/lib/sveltekit_shim_app_navigation.ts +1 -1
- package/src/lib/sveltekit_shim_app_paths.ts +1 -1
- package/src/lib/sync.task.ts +1 -1
- package/src/lib/task.ts +16 -14
- package/src/lib/task_logging.ts +3 -3
- package/src/lib/test.task.ts +4 -3
- package/src/lib/typecheck.task.ts +4 -4
- package/src/lib/upgrade.task.ts +6 -6
- package/src/lib/watch_dir.ts +3 -3
- package/dist/search_fs.d.ts +0 -26
- package/dist/search_fs.d.ts.map +0 -1
- package/dist/search_fs.js +0 -52
- package/src/lib/search_fs.ts +0 -100
package/dist/run_gen.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { styleText as st } from 'node:util';
|
|
2
|
-
import { print_error } from '@
|
|
2
|
+
import { print_error } from '@fuzdev/fuz_util/print.js';
|
|
3
|
+
import { map_concurrent } from '@fuzdev/fuz_util/async.js';
|
|
3
4
|
import { to_gen_result, normalize_gen_config, } from "./gen.js";
|
|
4
5
|
import { print_path, to_root_path } from "./paths.js";
|
|
5
6
|
import { default_svelte_config } from "./svelte_config.js";
|
|
@@ -8,7 +9,7 @@ export const run_gen = async (gen_modules, config, filer, log, timings, invoke_t
|
|
|
8
9
|
let input_count = 0;
|
|
9
10
|
let output_count = 0;
|
|
10
11
|
const timing_for_run_gen = timings.start('run_gen');
|
|
11
|
-
const results = await
|
|
12
|
+
const results = await map_concurrent(gen_modules, async (module_meta) => {
|
|
12
13
|
input_count++;
|
|
13
14
|
const { id } = module_meta;
|
|
14
15
|
const timing_for_module = timings.start(id);
|
|
@@ -28,11 +29,11 @@ export const run_gen = async (gen_modules, config, filer, log, timings, invoke_t
|
|
|
28
29
|
try {
|
|
29
30
|
raw_gen_result = await gen_config.generate(gen_ctx);
|
|
30
31
|
}
|
|
31
|
-
catch (
|
|
32
|
+
catch (error) {
|
|
32
33
|
return {
|
|
33
34
|
ok: false,
|
|
34
35
|
id,
|
|
35
|
-
error
|
|
36
|
+
error,
|
|
36
37
|
reason: st('red', `Error generating ${print_path(id)}`),
|
|
37
38
|
elapsed: timing_for_module(),
|
|
38
39
|
};
|
|
@@ -41,17 +42,17 @@ export const run_gen = async (gen_modules, config, filer, log, timings, invoke_t
|
|
|
41
42
|
const gen_result = to_gen_result(id, raw_gen_result);
|
|
42
43
|
// Format the files if needed.
|
|
43
44
|
const files = format_file
|
|
44
|
-
? await
|
|
45
|
+
? await map_concurrent(gen_result.files, async (file) => {
|
|
45
46
|
if (!file.format)
|
|
46
47
|
return file;
|
|
47
48
|
try {
|
|
48
49
|
return { ...file, content: await format_file(file.content, { filepath: file.id }) };
|
|
49
50
|
}
|
|
50
|
-
catch (
|
|
51
|
-
log.error(st('red', `Error formatting ${print_path(file.id)} via ${print_path(id)}`), print_error(
|
|
51
|
+
catch (error) {
|
|
52
|
+
log.error(st('red', `Error formatting ${print_path(file.id)} via ${print_path(id)}`), print_error(error));
|
|
52
53
|
return file;
|
|
53
54
|
}
|
|
54
|
-
})
|
|
55
|
+
}, 10)
|
|
55
56
|
: gen_result.files;
|
|
56
57
|
output_count += files.length;
|
|
57
58
|
return {
|
|
@@ -60,7 +61,7 @@ export const run_gen = async (gen_modules, config, filer, log, timings, invoke_t
|
|
|
60
61
|
files,
|
|
61
62
|
elapsed: timing_for_module(),
|
|
62
63
|
};
|
|
63
|
-
})
|
|
64
|
+
}, 10);
|
|
64
65
|
return {
|
|
65
66
|
results,
|
|
66
67
|
successes: results.filter((r) => r.ok),
|
package/dist/run_task.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Timings } from '@
|
|
2
|
-
import type { Logger } from '@
|
|
1
|
+
import type { Timings } from '@fuzdev/fuz_util/timings.js';
|
|
2
|
+
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
3
3
|
import { type Args } from './args.ts';
|
|
4
4
|
import type { invoke_task as base_invoke_task } from './invoke_task.ts';
|
|
5
5
|
import type { GroConfig } from './gro_config.ts';
|
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":"AACA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"run_task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/run_task.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAC,WAAW,IAAI,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAEtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAY,KAAK,cAAc,EAAC,MAAM,WAAW,CAAC;AAEzD,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEtC,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
|
@@ -32,13 +32,13 @@ export const run_task = async (task_meta, unparsed_args, invoke_task, config, fi
|
|
|
32
32
|
invoke_task: (invoked_task_name, invoked_args, invoked_config) => invoke_task(invoked_task_name, invoked_args, invoked_config ?? config, filer, timings, log),
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
catch (
|
|
35
|
+
catch (error) {
|
|
36
36
|
return {
|
|
37
37
|
ok: false,
|
|
38
|
-
reason: st('red',
|
|
39
|
-
?
|
|
38
|
+
reason: st('red', error?.constructor?.name === 'TaskError'
|
|
39
|
+
? error.message
|
|
40
40
|
: `Unexpected error running task ${st('cyan', task_meta.name)}. If this is unexpected try running \`${config.pm_cli} install\` and \`gro clean\`.`),
|
|
41
|
-
error
|
|
41
|
+
error,
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
return { ok: true, output };
|
package/dist/source_json.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { PackageJson, PackageJsonExports } from '@
|
|
2
|
-
import { SourceJson, type ModuleJson } from '@
|
|
3
|
-
import type { Logger } from '@
|
|
1
|
+
import type { PackageJson, PackageJsonExports } from '@fuzdev/fuz_util/package_json.js';
|
|
2
|
+
import { SourceJson, type ModuleJson } from '@fuzdev/fuz_util/source_json.js';
|
|
3
|
+
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
4
4
|
export type SourceJsonMapper = (source_json: SourceJson) => SourceJson | null | Promise<SourceJson | null>;
|
|
5
|
-
export declare const source_json_create: (package_json: PackageJson, lib_path?: string, log?: Logger) => SourceJson
|
|
5
|
+
export declare const source_json_create: (package_json: PackageJson, lib_path?: string, log?: Logger) => Promise<SourceJson>;
|
|
6
6
|
export declare const source_json_serialize: (source_json: SourceJson) => string;
|
|
7
|
-
export declare const source_modules_create: (exports: PackageJsonExports | undefined, lib_path?: string, log?: Logger) => Array<ModuleJson> | undefined
|
|
7
|
+
export declare const source_modules_create: (exports: PackageJsonExports | undefined, lib_path?: string, log?: Logger) => Promise<Array<ModuleJson> | undefined>;
|
|
8
8
|
//# sourceMappingURL=source_json.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/source_json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"source_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/source_json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AACtF,OAAO,EAAC,UAAU,EAAE,KAAK,UAAU,EAAuB,MAAM,iCAAiC,CAAC;AAClG,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAMpD,MAAM,MAAM,gBAAgB,GAAG,CAC9B,WAAW,EAAE,UAAU,KACnB,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;AAEpD,eAAO,MAAM,kBAAkB,GAC9B,cAAc,WAAW,EACzB,WAAW,MAAM,EACjB,MAAM,MAAM,KACV,OAAO,CAAC,UAAU,CAKlB,CAAC;AAEJ,eAAO,MAAM,qBAAqB,GAAI,aAAa,UAAU,KAAG,MAG/D,CAAC;AAEF,eAAO,MAAM,qBAAqB,GACjC,SAAS,kBAAkB,GAAG,SAAS,EACvC,iBAAoB,EACpB,MAAM,MAAM,KACV,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,SAAS,CAgDvC,CAAC"}
|
package/dist/source_json.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
|
-
import { ensure_end, strip_start } from '@
|
|
3
|
-
import {
|
|
2
|
+
import { ensure_end, strip_start } from '@fuzdev/fuz_util/string.js';
|
|
3
|
+
import { fs_exists, fs_search } from '@fuzdev/fuz_util/fs.js';
|
|
4
4
|
import ts from 'typescript';
|
|
5
|
-
import { SourceJson } from '@
|
|
5
|
+
import { SourceJson } from '@fuzdev/fuz_util/source_json.js';
|
|
6
6
|
import { paths, replace_extension } from "./paths.js";
|
|
7
7
|
import { parse_exports } from "./parse_exports.js";
|
|
8
8
|
import { TS_MATCHER, SVELTE_MATCHER, JSON_MATCHER, CSS_MATCHER } from "./constants.js";
|
|
9
|
-
|
|
10
|
-
export const source_json_create = (package_json, lib_path, log) => SourceJson.parse({
|
|
9
|
+
export const source_json_create = async (package_json, lib_path, log) => SourceJson.parse({
|
|
11
10
|
name: package_json.name,
|
|
12
11
|
version: package_json.version,
|
|
13
|
-
modules: source_modules_create(package_json.exports, lib_path, log),
|
|
12
|
+
modules: await source_modules_create(package_json.exports, lib_path, log),
|
|
14
13
|
});
|
|
15
14
|
export const source_json_serialize = (source_json) => {
|
|
16
15
|
const parsed = SourceJson.parse(source_json);
|
|
17
16
|
return JSON.stringify(parsed, null, 2) + '\n';
|
|
18
17
|
};
|
|
19
|
-
export const source_modules_create = (exports, lib_path = paths.lib, log) => {
|
|
18
|
+
export const source_modules_create = async (exports, lib_path = paths.lib, log) => {
|
|
20
19
|
if (!exports)
|
|
21
20
|
return;
|
|
22
|
-
const file_paths = collect_file_paths(exports, lib_path);
|
|
21
|
+
const file_paths = await collect_file_paths(exports, lib_path);
|
|
23
22
|
// Create a TypeScript program for all TypeScript files
|
|
24
23
|
const ts_files = file_paths
|
|
25
24
|
.filter(({ file_path }) => TS_MATCHER.test(file_path))
|
|
@@ -54,11 +53,11 @@ export const source_modules_create = (exports, lib_path = paths.lib, log) => {
|
|
|
54
53
|
}
|
|
55
54
|
return result;
|
|
56
55
|
};
|
|
57
|
-
const collect_file_paths = (exports, lib_path) => {
|
|
56
|
+
const collect_file_paths = async (exports, lib_path) => {
|
|
58
57
|
const file_paths = [];
|
|
59
58
|
// Handle string exports (single default export)
|
|
60
59
|
if (typeof exports === 'string') {
|
|
61
|
-
const source_file = infer_source_from_export(exports, lib_path);
|
|
60
|
+
const source_file = await infer_source_from_export(exports, lib_path);
|
|
62
61
|
if (source_file) {
|
|
63
62
|
file_paths.push({ export_key: '.', file_path: source_file });
|
|
64
63
|
}
|
|
@@ -75,7 +74,8 @@ const collect_file_paths = (exports, lib_path) => {
|
|
|
75
74
|
// Check if this is a pattern export
|
|
76
75
|
if (k.includes('*')) {
|
|
77
76
|
// Handle pattern exports by finding matching files in lib
|
|
78
|
-
|
|
77
|
+
// eslint-disable-next-line no-await-in-loop
|
|
78
|
+
const matching_files = await fs_search(lib_path, {
|
|
79
79
|
file_filter: (path) => {
|
|
80
80
|
const p = path.replace(ensure_end(lib_path, '/'), '');
|
|
81
81
|
// Only match files in the root directory (no subdirectories)
|
|
@@ -111,7 +111,8 @@ const collect_file_paths = (exports, lib_path) => {
|
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
113
|
// Handle explicit exports (non-patterns)
|
|
114
|
-
|
|
114
|
+
// eslint-disable-next-line no-await-in-loop
|
|
115
|
+
const source_file = await infer_source_from_export(k, lib_path);
|
|
115
116
|
if (source_file) {
|
|
116
117
|
file_paths.push({ export_key: k, file_path: source_file });
|
|
117
118
|
}
|
|
@@ -122,14 +123,14 @@ const collect_file_paths = (exports, lib_path) => {
|
|
|
122
123
|
}
|
|
123
124
|
return file_paths;
|
|
124
125
|
};
|
|
125
|
-
const infer_source_from_export = (export_path, lib_path) => {
|
|
126
|
+
const infer_source_from_export = async (export_path, lib_path) => {
|
|
126
127
|
// Handle index specially
|
|
127
128
|
if (export_path === '.' || export_path === './') {
|
|
128
129
|
const index_ts = join(lib_path, 'index.ts');
|
|
129
|
-
if (
|
|
130
|
+
if (await fs_exists(index_ts))
|
|
130
131
|
return index_ts;
|
|
131
132
|
const index_js = join(lib_path, 'index.js');
|
|
132
|
-
if (
|
|
133
|
+
if (await fs_exists(index_js))
|
|
133
134
|
return index_js;
|
|
134
135
|
return null;
|
|
135
136
|
}
|
|
@@ -137,12 +138,12 @@ const infer_source_from_export = (export_path, lib_path) => {
|
|
|
137
138
|
// For .js exports, try .ts first
|
|
138
139
|
if (clean_path.endsWith('.js')) {
|
|
139
140
|
const ts_path = join(lib_path, replace_extension(clean_path, '.ts'));
|
|
140
|
-
if (
|
|
141
|
+
if (await fs_exists(ts_path))
|
|
141
142
|
return ts_path;
|
|
142
143
|
}
|
|
143
144
|
// Try the exact path
|
|
144
145
|
const exact_path = join(lib_path, clean_path);
|
|
145
|
-
if (
|
|
146
|
+
if (await fs_exists(exact_path))
|
|
146
147
|
return exact_path;
|
|
147
148
|
return null;
|
|
148
149
|
};
|
package/dist/svelte_config.js
CHANGED
|
@@ -7,7 +7,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
7
7
|
return path;
|
|
8
8
|
};
|
|
9
9
|
import { join } from 'node:path';
|
|
10
|
-
import { EMPTY_OBJECT } from '@
|
|
10
|
+
import { EMPTY_OBJECT } from '@fuzdev/fuz_util/object.js';
|
|
11
11
|
import { SVELTE_CONFIG_FILENAME } from "./constants.js";
|
|
12
12
|
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
13
13
|
// see https://github.com/sveltejs/kit/discussions/14240
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Result } from '@
|
|
2
|
-
import type { Logger } from '@
|
|
3
|
-
import type { PackageJson } from '@
|
|
1
|
+
import type { Result } from '@fuzdev/fuz_util/result.js';
|
|
2
|
+
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
3
|
+
import type { PackageJson } from '@fuzdev/fuz_util/package_json.js';
|
|
4
4
|
import { type ParsedSvelteConfig } from './svelte_config.ts';
|
|
5
5
|
import { type Cli } from './cli.ts';
|
|
6
6
|
export declare const has_sveltekit_app: (svelte_config_path?: string) => Promise<Result<object, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sveltekit_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/sveltekit_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"sveltekit_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/sveltekit_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAC,MAAM,EAAC,M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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,5 +1,5 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
|
-
import { fs_exists } from '@
|
|
2
|
+
import { fs_exists } from '@fuzdev/fuz_util/fs.js';
|
|
3
3
|
import { has_dep } from "./package_json.js";
|
|
4
4
|
import { default_svelte_config } from "./svelte_config.js";
|
|
5
5
|
import { SVELTE_CONFIG_FILENAME, SVELTEKIT_DEV_DIRNAME, PM_CLI_DEFAULT, SVELTE_PACKAGE_DEP_NAME, SVELTEKIT_CLI, } from "./constants.js";
|
|
@@ -43,7 +43,7 @@ export const sveltekit_sync = async (sveltekit_cli = SVELTEKIT_CLI, pm_cli = PM_
|
|
|
43
43
|
* If the SvelteKit CLI is found and its `.svelte-kit` directory is not, run `svelte-kit sync`.
|
|
44
44
|
*/
|
|
45
45
|
export const sveltekit_sync_if_available = async (sveltekit_cli = SVELTEKIT_CLI) => {
|
|
46
|
-
const found_sveltekit_cli = typeof sveltekit_cli === 'string' ? find_cli(sveltekit_cli) : sveltekit_cli;
|
|
46
|
+
const found_sveltekit_cli = typeof sveltekit_cli === 'string' ? await find_cli(sveltekit_cli) : sveltekit_cli;
|
|
47
47
|
if (found_sveltekit_cli) {
|
|
48
48
|
return sveltekit_sync(found_sveltekit_cli);
|
|
49
49
|
}
|
|
@@ -55,7 +55,7 @@ export const sveltekit_sync_if_obviously_needed = async (sveltekit_cli = SVELTEK
|
|
|
55
55
|
if (await fs_exists(SVELTEKIT_DEV_DIRNAME)) {
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
const found_sveltekit_cli = typeof sveltekit_cli === 'string' ? find_cli(sveltekit_cli) : sveltekit_cli;
|
|
58
|
+
const found_sveltekit_cli = typeof sveltekit_cli === 'string' ? await find_cli(sveltekit_cli) : sveltekit_cli;
|
|
59
59
|
if (!found_sveltekit_cli) {
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
@@ -67,7 +67,7 @@ export const run_svelte_package = async (package_json, options, cli, log, pm_cli
|
|
|
67
67
|
throw new TaskError('Failed to find SvelteKit library: ' + has_sveltekit_library_result.message);
|
|
68
68
|
}
|
|
69
69
|
const cli_name = typeof cli === 'string' ? cli : cli.name;
|
|
70
|
-
const found_svelte_package_cli = cli === cli_name ? find_cli(cli) : cli;
|
|
70
|
+
const found_svelte_package_cli = cli === cli_name ? await find_cli(cli) : cli;
|
|
71
71
|
if (found_svelte_package_cli?.kind !== 'local') {
|
|
72
72
|
throw new TaskError(`Failed to find SvelteKit packaging CLI \`${cli_name}\`, do you need to run \`${pm_cli} install\`?`);
|
|
73
73
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// shim for $app/forms
|
|
2
2
|
// @see https://github.com/sveltejs/kit/issues/1485
|
|
3
|
-
import { noop, noop_async } from '@
|
|
3
|
+
import { noop, noop_async } from '@fuzdev/fuz_util/function.js';
|
|
4
4
|
export const applyAction = noop_async;
|
|
5
5
|
export const deserialize = () => ({});
|
|
6
6
|
export const enhance = () => ({ destroy: noop });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// shim for $app/navigation
|
|
2
2
|
// @see https://github.com/sveltejs/kit/issues/1485
|
|
3
|
-
import { noop, noop_async } from '@
|
|
3
|
+
import { noop, noop_async } from '@fuzdev/fuz_util/function.js';
|
|
4
4
|
export const afterNavigate = noop;
|
|
5
5
|
export const beforeNavigate = noop;
|
|
6
6
|
export const disableScrollHandling = noop;
|
|
@@ -16,7 +16,7 @@ ${Object.entries(env)
|
|
|
16
16
|
else {
|
|
17
17
|
return `// shim for $env/dynamic/${visibility}
|
|
18
18
|
// @see https://github.com/sveltejs/kit/issues/1485
|
|
19
|
-
import {load_env} from '
|
|
19
|
+
import {load_env} from './env.js';
|
|
20
20
|
export const env = load_env(${dev}, ${JSON.stringify(visibility)}, ${JSON.stringify(public_prefix)}, ${JSON.stringify(private_prefix)}, ${JSON.stringify(env_dir)}, ${JSON.stringify(env_files)}, ${JSON.stringify(ambient_env)});
|
|
21
21
|
`;
|
|
22
22
|
}
|
package/dist/sync.task.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { spawn } from '@
|
|
2
|
+
import { spawn } from '@fuzdev/fuz_util/process.js';
|
|
3
3
|
import { TaskError } from "./task.js";
|
|
4
4
|
import { sync_package_json } from "./package_json.js";
|
|
5
5
|
import { sveltekit_sync } from "./sveltekit_helpers.js";
|
package/dist/task.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Logger } from '@
|
|
1
|
+
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
|
-
import type { Timings } from '@
|
|
4
|
-
import type { Result } from '@
|
|
5
|
-
import type { PathId } from '@
|
|
3
|
+
import type { Timings } from '@fuzdev/fuz_util/timings.js';
|
|
4
|
+
import type { Result } from '@fuzdev/fuz_util/result.js';
|
|
5
|
+
import type { PathId } from '@fuzdev/fuz_util/path.js';
|
|
6
6
|
import type { Args } from './args.ts';
|
|
7
7
|
import type { GroConfig } from './gro_config.ts';
|
|
8
8
|
import type { ParsedSvelteConfig } from './svelte_config.ts';
|
|
@@ -78,7 +78,7 @@ export type FindModulesFailure = {
|
|
|
78
78
|
/**
|
|
79
79
|
* Finds modules from input paths. (see `src/lib/input_path.ts` for more)
|
|
80
80
|
*/
|
|
81
|
-
export declare const find_tasks: (input_paths: Array<InputPath>, task_root_dirs: Array<PathId>, config: GroConfig, timings?: Timings) => FindTasksResult
|
|
81
|
+
export declare const find_tasks: (input_paths: Array<InputPath>, task_root_dirs: Array<PathId>, config: GroConfig, timings?: Timings) => Promise<FindTasksResult>;
|
|
82
82
|
export interface LoadedTasks {
|
|
83
83
|
modules: Array<TaskModuleMeta>;
|
|
84
84
|
found_tasks: FoundTasks;
|
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,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,6BAA6B,CAAC;AAEzD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAEvD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAGrD,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAGN,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAe,KAAK,kBAAkB,EAAE,KAAK,UAAU,EAAC,MAAM,cAAc,CAAC;AACpF,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,YAAY,C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;IAC9B,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,UAAU,GACtB,aAAa,KAAK,CAAC,SAAS,CAAC,EAC7B,gBAAgB,KAAK,CAAC,MAAM,CAAC,EAC7B,QAAQ,SAAS,EACjB,UAAU,OAAO,KACf,OAAO,CAAC,eAAe,CAiEzB,CAAC;AAEF,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC/B,WAAW,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,IAAI,CAAC;CACX;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU,CAAC,UAAU,CAAC;IAC7D,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAC,EAAE,gBAAgB,CAAC,CAAC;AAC7E,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAElE,eAAO,MAAM,UAAU,GACtB,aAAa,UAAU,EACvB,YAAW,MAAsB,KAC/B,OAAO,CAAC,eAAe,CAuBzB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,GAAG,IAAI,UACtB,CAAC"}
|
package/dist/task.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ensure_end, strip_end, strip_start } from '@
|
|
1
|
+
import { ensure_end, strip_end, strip_start } from '@fuzdev/fuz_util/string.js';
|
|
2
2
|
import { styleText as st } from 'node:util';
|
|
3
3
|
import { isAbsolute, join, relative } from 'node:path';
|
|
4
|
+
import { fs_search } from '@fuzdev/fuz_util/fs.js';
|
|
4
5
|
import { resolve_input_files, resolve_input_paths, } from "./input_path.js";
|
|
5
6
|
import { GRO_DIST_DIR, print_path } from "./paths.js";
|
|
6
|
-
import { search_fs } from "./search_fs.js";
|
|
7
7
|
import { load_modules } from "./modules.js";
|
|
8
8
|
export const TASK_FILE_SUFFIX_TS = '.task.ts';
|
|
9
9
|
export const TASK_FILE_SUFFIX_JS = '.task.js';
|
|
@@ -43,10 +43,10 @@ export class SilentError extends Error {
|
|
|
43
43
|
/**
|
|
44
44
|
* Finds modules from input paths. (see `src/lib/input_path.ts` for more)
|
|
45
45
|
*/
|
|
46
|
-
export const find_tasks = (input_paths, task_root_dirs, config, timings) => {
|
|
46
|
+
export const find_tasks = async (input_paths, task_root_dirs, config, timings) => {
|
|
47
47
|
// Check which extension variation works - if it's a directory, prefer others first!
|
|
48
48
|
const timing_to_resolve_input_paths = timings?.start('resolve input paths');
|
|
49
|
-
const { resolved_input_paths, unmapped_input_paths } = resolve_input_paths(input_paths, task_root_dirs, TASK_FILE_SUFFIXES);
|
|
49
|
+
const { resolved_input_paths, unmapped_input_paths } = await resolve_input_paths(input_paths, task_root_dirs, TASK_FILE_SUFFIXES);
|
|
50
50
|
timing_to_resolve_input_paths?.();
|
|
51
51
|
// Error if any input path could not be mapped.
|
|
52
52
|
if (unmapped_input_paths.length) {
|
|
@@ -62,7 +62,7 @@ export const find_tasks = (input_paths, task_root_dirs, config, timings) => {
|
|
|
62
62
|
}
|
|
63
63
|
// Find all of the files for any directories.
|
|
64
64
|
const timing_to_resolve_input_files = timings?.start('resolve input files');
|
|
65
|
-
const { resolved_input_files, resolved_input_files_by_root_dir, input_directories_with_no_files } = resolve_input_files(resolved_input_paths, (id) =>
|
|
65
|
+
const { resolved_input_files, resolved_input_files_by_root_dir, input_directories_with_no_files } = await resolve_input_files(resolved_input_paths, async (id) => await fs_search(id, {
|
|
66
66
|
filter: config.search_filters,
|
|
67
67
|
file_filter: (p) => TASK_FILE_SUFFIXES.some((s) => p.endsWith(s)),
|
|
68
68
|
}));
|
package/dist/task_logging.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Logger } from '@
|
|
1
|
+
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
2
2
|
import type { LoadedTasks, TaskModuleMeta } from './task.ts';
|
|
3
3
|
export declare const log_tasks: (log: Logger, loaded_tasks: LoadedTasks, log_intro?: boolean) => void;
|
|
4
4
|
export declare const log_error_reasons: (log: Logger, reasons: Array<string>) => void;
|
|
@@ -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,
|
|
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;AAMpD,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
1
|
import { styleText as st } from 'node:util';
|
|
2
|
-
import { plural } from '@
|
|
3
|
-
import { print_value } from '@
|
|
2
|
+
import { plural } from '@fuzdev/fuz_util/string.js';
|
|
3
|
+
import { print_value } from '@fuzdev/fuz_util/print.js';
|
|
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":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,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,
|
|
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;AAGtB,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,CAgC3B,CAAC"}
|
package/dist/test.task.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { spawn_cli } from '
|
|
2
|
+
import { spawn_cli } from './cli.js';
|
|
3
3
|
import { TaskError } from "./task.js";
|
|
4
4
|
import { find_cli } from "./cli.js";
|
|
5
|
-
import { has_dep } from "./package_json.js";
|
|
5
|
+
import { has_dep, load_package_json } from "./package_json.js";
|
|
6
6
|
import { serialize_args, to_implicit_forwarded_args } from "./args.js";
|
|
7
7
|
import { VITEST_CLI } from "./constants.js";
|
|
8
8
|
import { paths } from "./paths.js";
|
|
@@ -25,10 +25,11 @@ export const task = {
|
|
|
25
25
|
Args,
|
|
26
26
|
run: async ({ args }) => {
|
|
27
27
|
const { _: patterns, dir, fail_without_tests, t } = args;
|
|
28
|
-
|
|
28
|
+
const package_json = await load_package_json();
|
|
29
|
+
if (!has_dep(VITEST_CLI, package_json)) {
|
|
29
30
|
throw new TaskError('no test runner found, install vitest');
|
|
30
31
|
}
|
|
31
|
-
if (!find_cli(VITEST_CLI)) {
|
|
32
|
+
if (!(await find_cli(VITEST_CLI))) {
|
|
32
33
|
throw new TaskError('vitest is a dependency but not installed; run `npm i`?');
|
|
33
34
|
}
|
|
34
35
|
const vitest_args = ['run', ...patterns];
|
package/dist/typecheck.task.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { print_spawn_result } from '@
|
|
1
|
+
import { print_spawn_result } from '@fuzdev/fuz_util/process.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { TaskError } from "./task.js";
|
|
4
4
|
import { serialize_args, to_forwarded_args } from "./args.js";
|
|
@@ -31,10 +31,10 @@ export const task = {
|
|
|
31
31
|
const { svelte_check_cli, typescript_cli, path_replacement, cwd } = args;
|
|
32
32
|
await sveltekit_sync_if_available();
|
|
33
33
|
// Prefer svelte-check if available.
|
|
34
|
-
const found_svelte_check_cli = find_cli(svelte_check_cli);
|
|
34
|
+
const found_svelte_check_cli = await find_cli(svelte_check_cli);
|
|
35
35
|
if (found_svelte_check_cli) {
|
|
36
36
|
const serialized = serialize_args(to_forwarded_args(svelte_check_cli));
|
|
37
|
-
const spawned = spawn_cli_process(found_svelte_check_cli, serialized, undefined, {
|
|
37
|
+
const spawned = await spawn_cli_process(found_svelte_check_cli, serialized, undefined, {
|
|
38
38
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
39
39
|
env: { ...process.env, FORCE_COLOR: '1' }, // Needed for colors (maybe make an option)
|
|
40
40
|
});
|
|
@@ -50,7 +50,7 @@ export const task = {
|
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
// Fall back to tsc.
|
|
53
|
-
const found_typescript_cli = find_cli(typescript_cli);
|
|
53
|
+
const found_typescript_cli = await find_cli(typescript_cli);
|
|
54
54
|
if (found_typescript_cli) {
|
|
55
55
|
const forwarded = to_forwarded_args(typescript_cli);
|
|
56
56
|
if (!forwarded.noEmit)
|
package/dist/upgrade.task.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { spawn } from '@
|
|
1
|
+
import { spawn } from '@fuzdev/fuz_util/process.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import { GitOrigin, git_pull } from '@
|
|
3
|
+
import { rm } from 'node:fs/promises';
|
|
4
|
+
import { GitOrigin, git_pull } from '@fuzdev/fuz_util/git.js';
|
|
5
5
|
import { TaskError } from "./task.js";
|
|
6
6
|
import { extract_deps, load_package_json } from "./package_json.js";
|
|
7
7
|
import { spawn_cli } from "./cli.js";
|
|
@@ -57,13 +57,13 @@ export const task = {
|
|
|
57
57
|
}
|
|
58
58
|
if (delete_node_modules) {
|
|
59
59
|
log.info(`deleting node_modules at `, node_modules_path);
|
|
60
|
-
|
|
60
|
+
await rm(node_modules_path, { recursive: true, force: true });
|
|
61
61
|
}
|
|
62
62
|
if (delete_lockfile) {
|
|
63
63
|
log.info(`deleting lockfile at`, lockfile_path);
|
|
64
|
-
|
|
64
|
+
await rm(lockfile_path, { force: true });
|
|
65
65
|
}
|
|
66
|
-
const package_json = load_package_json();
|
|
66
|
+
const package_json = await load_package_json();
|
|
67
67
|
const all_deps = extract_deps(package_json);
|
|
68
68
|
const deps = only.length
|
|
69
69
|
? all_deps.filter((d) => only.includes(d.name))
|
package/dist/watch_dir.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChokidarOptions, type Matcher } from 'chokidar';
|
|
2
|
-
import type { PathFilter } from '@
|
|
2
|
+
import type { PathFilter } from '@fuzdev/fuz_util/path.js';
|
|
3
3
|
export interface WatchNodeFs {
|
|
4
4
|
init: () => Promise<void>;
|
|
5
5
|
close: () => Promise<void>;
|
package/dist/watch_dir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch_dir.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/watch_dir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,eAAe,EAAkB,KAAK,OAAO,EAAC,MAAM,UAAU,CAAC;AAInF,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"watch_dir.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/watch_dir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,eAAe,EAAkB,KAAK,OAAO,EAAC,MAAM,UAAU,CAAC;AAInF,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAOzD,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC5D,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;AAEpE,MAAM,WAAW,eAAe;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,qBAAqB,CAAC;IACjC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,0DAOvB,eAAe,KAAG,WA+CpB,CAAC"}
|
package/dist/watch_dir.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { watch } from 'chokidar';
|
|
2
2
|
import { relative } from 'node:path';
|
|
3
3
|
import { statSync } from 'node:fs';
|
|
4
|
-
import { create_deferred } from '@
|
|
5
|
-
import { EMPTY_OBJECT } from '@
|
|
4
|
+
import { create_deferred } from '@fuzdev/fuz_util/async.js';
|
|
5
|
+
import { EMPTY_OBJECT } from '@fuzdev/fuz_util/object.js';
|
|
6
6
|
const TMP_FILE_PATTERN = /\.tmp\./;
|
|
7
7
|
/**
|
|
8
8
|
* Watch for changes on the filesystem using chokidar.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryanatkn/gro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.181.0",
|
|
4
4
|
"description": "task runner and toolkit extending SvelteKit",
|
|
5
5
|
"motto": "generate, run, optimize",
|
|
6
6
|
"glyph": "🌰",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"zod": "^4.1.13"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@
|
|
64
|
+
"@fuzdev/fuz_util": ">=0.42.0",
|
|
65
65
|
"@sveltejs/kit": "^2",
|
|
66
66
|
"esbuild": "^0.27.0",
|
|
67
67
|
"svelte": "^5",
|
|
@@ -82,20 +82,20 @@
|
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@changesets/changelog-git": "^0.2.1",
|
|
84
84
|
"@changesets/types": "^6.1.0",
|
|
85
|
-
"@
|
|
85
|
+
"@fuzdev/fuz_code": "^0.37.0",
|
|
86
|
+
"@fuzdev/fuz_css": "^0.40.0",
|
|
87
|
+
"@fuzdev/fuz_ui": "^0.169.0",
|
|
88
|
+
"@fuzdev/fuz_util": "^0.42.0",
|
|
86
89
|
"@ryanatkn/eslint-config": "^0.9.0",
|
|
87
|
-
"@ryanatkn/fuz": "^0.165.0",
|
|
88
|
-
"@ryanatkn/fuz_code": "^0.36.0",
|
|
89
|
-
"@ryanatkn/moss": "^0.39.0",
|
|
90
90
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
91
91
|
"@sveltejs/kit": "^2.49.0",
|
|
92
|
-
"@sveltejs/package": "^2.5.
|
|
92
|
+
"@sveltejs/package": "^2.5.7",
|
|
93
93
|
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
94
94
|
"@types/node": "^24.10.1",
|
|
95
95
|
"esbuild": "^0.27.0",
|
|
96
96
|
"eslint": "^9.39.1",
|
|
97
97
|
"eslint-plugin-svelte": "^3.13.0",
|
|
98
|
-
"svelte": "^5.
|
|
98
|
+
"svelte": "^5.45.2",
|
|
99
99
|
"svelte-check": "^4.3.4",
|
|
100
100
|
"typescript": "^5.9.3",
|
|
101
101
|
"typescript-eslint": "^8.48.0",
|