@fuzdev/gro 0.192.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +283 -0
- package/dist/args.d.ts +37 -0
- package/dist/args.d.ts.map +1 -0
- package/dist/args.js +102 -0
- package/dist/build.task.d.ts +20 -0
- package/dist/build.task.d.ts.map +1 -0
- package/dist/build.task.js +119 -0
- package/dist/build_cache.d.ts +100 -0
- package/dist/build_cache.d.ts.map +1 -0
- package/dist/build_cache.js +299 -0
- package/dist/changelog.d.ts +11 -0
- package/dist/changelog.d.ts.map +1 -0
- package/dist/changelog.js +47 -0
- package/dist/changeset.task.d.ts +35 -0
- package/dist/changeset.task.d.ts.map +1 -0
- package/dist/changeset.task.js +151 -0
- package/dist/changeset_helpers.d.ts +17 -0
- package/dist/changeset_helpers.d.ts.map +1 -0
- package/dist/changeset_helpers.js +7 -0
- package/dist/check.task.d.ts +28 -0
- package/dist/check.task.d.ts.map +1 -0
- package/dist/check.task.js +104 -0
- package/dist/child_process_logging.d.ts +10 -0
- package/dist/child_process_logging.d.ts.map +1 -0
- package/dist/child_process_logging.js +26 -0
- package/dist/clean.task.d.ts +15 -0
- package/dist/clean.task.d.ts.map +1 -0
- package/dist/clean.task.js +40 -0
- package/dist/clean_fs.d.ts +9 -0
- package/dist/clean_fs.d.ts.map +1 -0
- package/dist/clean_fs.js +28 -0
- package/dist/cli.d.ts +34 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +61 -0
- package/dist/commit.task.d.ts +11 -0
- package/dist/commit.task.d.ts.map +1 -0
- package/dist/commit.task.js +24 -0
- package/dist/constants.d.ts +46 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +52 -0
- package/dist/deploy.task.d.ts +29 -0
- package/dist/deploy.task.d.ts.map +1 -0
- package/dist/deploy.task.js +217 -0
- package/dist/dev.task.d.ts +16 -0
- package/dist/dev.task.d.ts.map +1 -0
- package/dist/dev.task.js +44 -0
- package/dist/disknode.d.ts +23 -0
- package/dist/disknode.d.ts.map +1 -0
- package/dist/disknode.js +1 -0
- package/dist/env.d.ts +11 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +49 -0
- package/dist/esbuild_helpers.d.ts +16 -0
- package/dist/esbuild_helpers.d.ts.map +1 -0
- package/dist/esbuild_helpers.js +36 -0
- package/dist/esbuild_plugin_external_worker.d.ts +23 -0
- package/dist/esbuild_plugin_external_worker.d.ts.map +1 -0
- package/dist/esbuild_plugin_external_worker.js +55 -0
- package/dist/esbuild_plugin_svelte.d.ts +15 -0
- package/dist/esbuild_plugin_svelte.d.ts.map +1 -0
- package/dist/esbuild_plugin_svelte.js +83 -0
- package/dist/esbuild_plugin_sveltekit_local_imports.d.ts +8 -0
- package/dist/esbuild_plugin_sveltekit_local_imports.d.ts.map +1 -0
- package/dist/esbuild_plugin_sveltekit_local_imports.js +30 -0
- package/dist/esbuild_plugin_sveltekit_shim_alias.d.ts +7 -0
- package/dist/esbuild_plugin_sveltekit_shim_alias.d.ts.map +1 -0
- package/dist/esbuild_plugin_sveltekit_shim_alias.js +18 -0
- package/dist/esbuild_plugin_sveltekit_shim_app.d.ts +9 -0
- package/dist/esbuild_plugin_sveltekit_shim_app.d.ts.map +1 -0
- package/dist/esbuild_plugin_sveltekit_shim_app.js +22 -0
- package/dist/esbuild_plugin_sveltekit_shim_env.d.ts +11 -0
- package/dist/esbuild_plugin_sveltekit_shim_env.d.ts.map +1 -0
- package/dist/esbuild_plugin_sveltekit_shim_env.js +18 -0
- package/dist/filer.d.ts +33 -0
- package/dist/filer.d.ts.map +1 -0
- package/dist/filer.js +385 -0
- package/dist/format.task.d.ts +11 -0
- package/dist/format.task.d.ts.map +1 -0
- package/dist/format.task.js +27 -0
- package/dist/format_directory.d.ts +13 -0
- package/dist/format_directory.d.ts.map +1 -0
- package/dist/format_directory.js +40 -0
- package/dist/format_file.d.ts +9 -0
- package/dist/format_file.d.ts.map +1 -0
- package/dist/format_file.js +42 -0
- package/dist/gen.d.ts +142 -0
- package/dist/gen.d.ts.map +1 -0
- package/dist/gen.js +199 -0
- package/dist/gen.task.d.ts +12 -0
- package/dist/gen.task.d.ts.map +1 -0
- package/dist/gen.task.js +149 -0
- package/dist/gen_helpers.d.ts +11 -0
- package/dist/gen_helpers.d.ts.map +1 -0
- package/dist/gen_helpers.js +76 -0
- package/dist/github.d.ts +19 -0
- package/dist/github.d.ts.map +1 -0
- package/dist/github.js +33 -0
- package/dist/gro.config.default.d.ts +13 -0
- package/dist/gro.config.default.d.ts.map +1 -0
- package/dist/gro.config.default.js +33 -0
- package/dist/gro.d.ts +3 -0
- package/dist/gro.d.ts.map +1 -0
- package/dist/gro.js +21 -0
- package/dist/gro_config.d.ts +115 -0
- package/dist/gro_config.d.ts.map +1 -0
- package/dist/gro_config.js +114 -0
- package/dist/gro_helpers.d.ts +49 -0
- package/dist/gro_helpers.d.ts.map +1 -0
- package/dist/gro_helpers.js +97 -0
- package/dist/gro_plugin_gen.d.ts +12 -0
- package/dist/gro_plugin_gen.d.ts.map +1 -0
- package/dist/gro_plugin_gen.js +101 -0
- package/dist/gro_plugin_server.d.ts +80 -0
- package/dist/gro_plugin_server.d.ts.map +1 -0
- package/dist/gro_plugin_server.js +167 -0
- package/dist/gro_plugin_sveltekit_app.d.ts +9 -0
- package/dist/gro_plugin_sveltekit_app.d.ts.map +1 -0
- package/dist/gro_plugin_sveltekit_app.js +42 -0
- package/dist/gro_plugin_sveltekit_library.d.ts +16 -0
- package/dist/gro_plugin_sveltekit_library.d.ts.map +1 -0
- package/dist/gro_plugin_sveltekit_library.js +34 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/input_path.d.ts +64 -0
- package/dist/input_path.d.ts.map +1 -0
- package/dist/input_path.js +199 -0
- package/dist/invoke.d.ts +2 -0
- package/dist/invoke.d.ts.map +1 -0
- package/dist/invoke.js +28 -0
- package/dist/invoke_task.d.ts +30 -0
- package/dist/invoke_task.d.ts.map +1 -0
- package/dist/invoke_task.js +104 -0
- package/dist/lint.task.d.ts +11 -0
- package/dist/lint.task.d.ts.map +1 -0
- package/dist/lint.task.js +32 -0
- package/dist/loader.d.ts +6 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +192 -0
- package/dist/module.d.ts +4 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +6 -0
- package/dist/modules.d.ts +36 -0
- package/dist/modules.d.ts.map +1 -0
- package/dist/modules.js +71 -0
- package/dist/package_json.d.ts +32 -0
- package/dist/package_json.d.ts.map +1 -0
- package/dist/package_json.js +178 -0
- package/dist/parse_exports.d.ts +20 -0
- package/dist/parse_exports.d.ts.map +1 -0
- package/dist/parse_exports.js +65 -0
- package/dist/parse_exports_context.d.ts +21 -0
- package/dist/parse_exports_context.d.ts.map +1 -0
- package/dist/parse_exports_context.js +332 -0
- package/dist/parse_imports.d.ts +5 -0
- package/dist/parse_imports.d.ts.map +1 -0
- package/dist/parse_imports.js +140 -0
- package/dist/paths.d.ts +41 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +69 -0
- package/dist/plugin.d.ts +36 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +78 -0
- package/dist/publish.task.d.ts +26 -0
- package/dist/publish.task.d.ts.map +1 -0
- package/dist/publish.task.js +176 -0
- package/dist/register.d.ts +2 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +2 -0
- package/dist/reinstall.task.d.ts +8 -0
- package/dist/reinstall.task.d.ts.map +1 -0
- package/dist/reinstall.task.js +35 -0
- package/dist/release.task.d.ts +8 -0
- package/dist/release.task.d.ts.map +1 -0
- package/dist/release.task.js +20 -0
- package/dist/resolve.task.d.ts +11 -0
- package/dist/resolve.task.d.ts.map +1 -0
- package/dist/resolve.task.js +38 -0
- package/dist/resolve_specifier.d.ts +22 -0
- package/dist/resolve_specifier.d.ts.map +1 -0
- package/dist/resolve_specifier.js +57 -0
- package/dist/run.task.d.ts +16 -0
- package/dist/run.task.d.ts.map +1 -0
- package/dist/run.task.js +52 -0
- package/dist/run_gen.d.ts +10 -0
- package/dist/run_gen.d.ts.map +1 -0
- package/dist/run_gen.js +73 -0
- package/dist/run_task.d.ts +17 -0
- package/dist/run_task.d.ts.map +1 -0
- package/dist/run_task.js +45 -0
- package/dist/source_json.d.ts +7 -0
- package/dist/source_json.d.ts.map +1 -0
- package/dist/source_json.js +145 -0
- package/dist/svelte_config.d.ts +57 -0
- package/dist/svelte_config.d.ts.map +1 -0
- package/dist/svelte_config.js +81 -0
- package/dist/sveltekit_helpers.d.ts +75 -0
- package/dist/sveltekit_helpers.d.ts.map +1 -0
- package/dist/sveltekit_helpers.js +94 -0
- package/dist/sveltekit_shim_app.d.ts +11 -0
- package/dist/sveltekit_shim_app.d.ts.map +1 -0
- package/dist/sveltekit_shim_app.js +31 -0
- package/dist/sveltekit_shim_app_environment.d.ts +13 -0
- package/dist/sveltekit_shim_app_environment.d.ts.map +1 -0
- package/dist/sveltekit_shim_app_environment.js +14 -0
- package/dist/sveltekit_shim_app_forms.d.ts +5 -0
- package/dist/sveltekit_shim_app_forms.d.ts.map +1 -0
- package/dist/sveltekit_shim_app_forms.js +6 -0
- package/dist/sveltekit_shim_app_navigation.d.ts +10 -0
- package/dist/sveltekit_shim_app_navigation.d.ts.map +1 -0
- package/dist/sveltekit_shim_app_navigation.js +11 -0
- package/dist/sveltekit_shim_app_paths.d.ts +17 -0
- package/dist/sveltekit_shim_app_paths.d.ts.map +1 -0
- package/dist/sveltekit_shim_app_paths.js +10 -0
- package/dist/sveltekit_shim_app_state.d.ts +5 -0
- package/dist/sveltekit_shim_app_state.d.ts.map +1 -0
- package/dist/sveltekit_shim_app_state.js +26 -0
- package/dist/sveltekit_shim_env.d.ts +5 -0
- package/dist/sveltekit_shim_env.d.ts.map +1 -0
- package/dist/sveltekit_shim_env.js +23 -0
- package/dist/sync.task.d.ts +16 -0
- package/dist/sync.task.d.ts.map +1 -0
- package/dist/sync.task.js +39 -0
- package/dist/task.d.ts +98 -0
- package/dist/task.d.ts.map +1 -0
- package/dist/task.js +109 -0
- package/dist/task_logging.d.ts +6 -0
- package/dist/task_logging.d.ts.map +1 -0
- package/dist/task_logging.js +201 -0
- package/dist/test.task.d.ts +13 -0
- package/dist/test.task.d.ts.map +1 -0
- package/dist/test.task.js +53 -0
- package/dist/typecheck.task.d.ts +13 -0
- package/dist/typecheck.task.d.ts.map +1 -0
- package/dist/typecheck.task.js +68 -0
- package/dist/upgrade.task.d.ts +20 -0
- package/dist/upgrade.task.d.ts.map +1 -0
- package/dist/upgrade.task.js +111 -0
- package/dist/watch_dir.d.ts +36 -0
- package/dist/watch_dir.d.ts.map +1 -0
- package/dist/watch_dir.js +69 -0
- package/package.json +149 -0
- package/src/lib/args.ts +115 -0
- package/src/lib/build.task.ts +151 -0
- package/src/lib/build_cache.ts +378 -0
- package/src/lib/changelog.ts +69 -0
- package/src/lib/changeset.task.ts +228 -0
- package/src/lib/changeset_helpers.ts +14 -0
- package/src/lib/check.task.ts +132 -0
- package/src/lib/child_process_logging.ts +38 -0
- package/src/lib/clean.task.ts +48 -0
- package/src/lib/clean_fs.ts +54 -0
- package/src/lib/cli.ts +98 -0
- package/src/lib/commit.task.ts +34 -0
- package/src/lib/constants.ts +56 -0
- package/src/lib/deploy.task.ts +287 -0
- package/src/lib/dev.task.ts +52 -0
- package/src/lib/disknode.ts +26 -0
- package/src/lib/env.ts +78 -0
- package/src/lib/esbuild_helpers.ts +49 -0
- package/src/lib/esbuild_plugin_external_worker.ts +94 -0
- package/src/lib/esbuild_plugin_svelte.ts +134 -0
- package/src/lib/esbuild_plugin_sveltekit_local_imports.ts +38 -0
- package/src/lib/esbuild_plugin_sveltekit_shim_alias.ts +27 -0
- package/src/lib/esbuild_plugin_sveltekit_shim_app.ts +42 -0
- package/src/lib/esbuild_plugin_sveltekit_shim_env.ts +47 -0
- package/src/lib/filer.ts +458 -0
- package/src/lib/format.task.ts +44 -0
- package/src/lib/format_directory.ts +65 -0
- package/src/lib/format_file.ts +49 -0
- package/src/lib/gen.task.ts +206 -0
- package/src/lib/gen.ts +406 -0
- package/src/lib/gen_helpers.ts +131 -0
- package/src/lib/github.ts +46 -0
- package/src/lib/gro.config.default.ts +42 -0
- package/src/lib/gro.ts +29 -0
- package/src/lib/gro_config.ts +254 -0
- package/src/lib/gro_helpers.ts +108 -0
- package/src/lib/gro_plugin_gen.ts +149 -0
- package/src/lib/gro_plugin_server.ts +288 -0
- package/src/lib/gro_plugin_sveltekit_app.ts +58 -0
- package/src/lib/gro_plugin_sveltekit_library.ts +63 -0
- package/src/lib/index.ts +8 -0
- package/src/lib/input_path.ts +254 -0
- package/src/lib/invoke.ts +34 -0
- package/src/lib/invoke_task.ts +139 -0
- package/src/lib/lint.task.ts +39 -0
- package/src/lib/loader.ts +229 -0
- package/src/lib/module.ts +13 -0
- package/src/lib/modules.ts +117 -0
- package/src/lib/package_json.ts +255 -0
- package/src/lib/parse_exports.ts +100 -0
- package/src/lib/parse_exports_context.ts +395 -0
- package/src/lib/parse_imports.ts +180 -0
- package/src/lib/paths.ts +111 -0
- package/src/lib/plugin.ts +106 -0
- package/src/lib/publish.task.ts +228 -0
- package/src/lib/register.ts +3 -0
- package/src/lib/reinstall.task.ts +45 -0
- package/src/lib/release.task.ts +26 -0
- package/src/lib/resolve.task.ts +43 -0
- package/src/lib/resolve_specifier.ts +81 -0
- package/src/lib/run.task.ts +65 -0
- package/src/lib/run_gen.ts +110 -0
- package/src/lib/run_task.ts +82 -0
- package/src/lib/source_json.ts +183 -0
- package/src/lib/svelte_config.ts +140 -0
- package/src/lib/sveltekit_helpers.ts +193 -0
- package/src/lib/sveltekit_shim_app.ts +41 -0
- package/src/lib/sveltekit_shim_app_environment.ts +16 -0
- package/src/lib/sveltekit_shim_app_forms.ts +13 -0
- package/src/lib/sveltekit_shim_app_navigation.ts +23 -0
- package/src/lib/sveltekit_shim_app_paths.ts +26 -0
- package/src/lib/sveltekit_shim_app_state.ts +35 -0
- package/src/lib/sveltekit_shim_env.ts +45 -0
- package/src/lib/sync.task.ts +47 -0
- package/src/lib/task.ts +245 -0
- package/src/lib/task_logging.ts +255 -0
- package/src/lib/test.task.ts +63 -0
- package/src/lib/typecheck.task.ts +81 -0
- package/src/lib/upgrade.task.ts +148 -0
- package/src/lib/watch_dir.ts +115 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeset_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/changeset_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,2BAA2B,eAAe,CAAC;AACxD,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAEhD,eAAO,MAAM,eAAe;;;EAAiE,CAAC;AAC9F,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C,eAAO,MAAM,aAAa;;;;EAAsC,CAAC;AACjE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const CHANGESET_RESTRICTED_ACCESS = 'restricted';
|
|
3
|
+
export const CHANGESET_PUBLIC_ACCESS = 'public';
|
|
4
|
+
export const ChangesetAccess = z.enum([CHANGESET_RESTRICTED_ACCESS, CHANGESET_PUBLIC_ACCESS]);
|
|
5
|
+
export const CHANGESET_CLI = 'changeset';
|
|
6
|
+
export const CHANGESET_DIR = '.changeset';
|
|
7
|
+
export const ChangesetBump = z.enum(['patch', 'minor', 'major']);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Task } from './task.ts';
|
|
3
|
+
/** @nodocs */
|
|
4
|
+
export declare const Args: z.ZodObject<{
|
|
5
|
+
typecheck: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
'no-typecheck': z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
test: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
'no-test': z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
gen: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
'no-gen': z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
format: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
+
'no-format': z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
package_json: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
+
'no-package_json': z.ZodDefault<z.ZodBoolean>;
|
|
15
|
+
lint: z.ZodDefault<z.ZodBoolean>;
|
|
16
|
+
'no-lint': z.ZodDefault<z.ZodBoolean>;
|
|
17
|
+
build: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
'no-build': z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
force_build: z.ZodDefault<z.ZodBoolean>;
|
|
20
|
+
sync: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
'no-sync': z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
install: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
workspace: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
export type Args = z.infer<typeof Args>;
|
|
26
|
+
/** @nodocs */
|
|
27
|
+
export declare const task: Task<Args>;
|
|
28
|
+
//# sourceMappingURL=check.task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/check.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAG/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;kBA6Bf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAwF3B,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { readdir } from 'node:fs/promises';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { spawn } from '@fuzdev/fuz_util/process.js';
|
|
4
|
+
import { styleText as st } from 'node:util';
|
|
5
|
+
import { git_check_clean_workspace } from '@fuzdev/fuz_util/git.js';
|
|
6
|
+
import { TaskError } from "./task.js";
|
|
7
|
+
import { package_json_sync } from "./package_json.js";
|
|
8
|
+
/** @nodocs */
|
|
9
|
+
export const Args = z.strictObject({
|
|
10
|
+
typecheck: z.boolean().meta({ description: 'dual of no-typecheck' }).default(true),
|
|
11
|
+
'no-typecheck': z.boolean().meta({ description: 'opt out of typechecking' }).default(false),
|
|
12
|
+
test: z.boolean().meta({ description: 'dual of no-test' }).default(true),
|
|
13
|
+
'no-test': z.boolean().meta({ description: 'opt out of running tests' }).default(false),
|
|
14
|
+
gen: z.boolean().meta({ description: 'dual of no-gen' }).default(true),
|
|
15
|
+
'no-gen': z.boolean().meta({ description: 'opt out of gen check' }).default(false),
|
|
16
|
+
format: z.boolean().meta({ description: 'dual of no-format' }).default(true),
|
|
17
|
+
'no-format': z.boolean().meta({ description: 'opt out of format check' }).default(false),
|
|
18
|
+
package_json: z.boolean().meta({ description: 'dual of no-package_json' }).default(true),
|
|
19
|
+
'no-package_json': z
|
|
20
|
+
.boolean()
|
|
21
|
+
.meta({ description: 'opt out of package.json check' })
|
|
22
|
+
.default(false),
|
|
23
|
+
lint: z.boolean().meta({ description: 'dual of no-lint' }).default(true),
|
|
24
|
+
'no-lint': z.boolean().meta({ description: 'opt out of linting' }).default(false),
|
|
25
|
+
build: z.boolean().meta({ description: 'dual of no-build' }).default(false),
|
|
26
|
+
'no-build': z.boolean().meta({ description: 'opt out of building' }).default(true),
|
|
27
|
+
force_build: z
|
|
28
|
+
.boolean()
|
|
29
|
+
.meta({ description: 'force a fresh build, ignoring the cache' })
|
|
30
|
+
.default(false),
|
|
31
|
+
sync: z.boolean().meta({ description: 'dual of no-sync' }).default(true),
|
|
32
|
+
'no-sync': z.boolean().meta({ description: 'opt out of syncing' }).default(false),
|
|
33
|
+
install: z.boolean().meta({ description: 'opt into installing packages' }).default(false),
|
|
34
|
+
workspace: z
|
|
35
|
+
.boolean()
|
|
36
|
+
.meta({ description: 'ensure a clean git workspace, useful for CI, also implies --no-sync' })
|
|
37
|
+
.default(false),
|
|
38
|
+
});
|
|
39
|
+
/** @nodocs */
|
|
40
|
+
export const task = {
|
|
41
|
+
summary: 'check that everything is ready to commit',
|
|
42
|
+
Args,
|
|
43
|
+
run: async ({ args, invoke_task, log, config }) => {
|
|
44
|
+
const { typecheck, test, gen, format, package_json, lint, build, force_build, sync, install, workspace, } = args;
|
|
45
|
+
// When checking the workspace, which was added for CI, never sync.
|
|
46
|
+
// Setup like installing packages and `sveltekit-sync` should be done in the CI setup.
|
|
47
|
+
if (!workspace) {
|
|
48
|
+
if (sync || install) {
|
|
49
|
+
if (!sync)
|
|
50
|
+
log.warn('sync is false but install is true, so ignoring the sync option');
|
|
51
|
+
await invoke_task('sync', { install, gen: false }); // never generate because `gro gen --check` runs below
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (typecheck) {
|
|
55
|
+
await invoke_task('typecheck');
|
|
56
|
+
}
|
|
57
|
+
if (test) {
|
|
58
|
+
await invoke_task('test');
|
|
59
|
+
}
|
|
60
|
+
if (gen) {
|
|
61
|
+
await invoke_task('gen', { check: true });
|
|
62
|
+
}
|
|
63
|
+
if (package_json && config.map_package_json) {
|
|
64
|
+
const { changed } = await package_json_sync(config.map_package_json, log, false);
|
|
65
|
+
if (changed) {
|
|
66
|
+
throw new TaskError('package.json is out of date, run `gro sync` to update it');
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
log.info('check passed for package.json');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (format) {
|
|
73
|
+
await invoke_task('format', { check: true });
|
|
74
|
+
}
|
|
75
|
+
// Run the linter last to surface every other kind of problem first.
|
|
76
|
+
// It's not the ideal order when the linter would catch errors that cause failing tests,
|
|
77
|
+
// but it's better for most usage.
|
|
78
|
+
if (lint) {
|
|
79
|
+
await invoke_task('lint');
|
|
80
|
+
}
|
|
81
|
+
if (build) {
|
|
82
|
+
// Skip sync/gen/install since check handles those separately
|
|
83
|
+
await invoke_task('build', { sync: false, gen: false, install: false, force_build });
|
|
84
|
+
}
|
|
85
|
+
// Disallow TODO*.md files in the project root on CI.
|
|
86
|
+
if (process.env.CI === 'true') {
|
|
87
|
+
const root_files = await readdir('.');
|
|
88
|
+
const todo_files = root_files.filter((f) => f.startsWith('TODO') && f.endsWith('.md'));
|
|
89
|
+
if (todo_files.length > 0) {
|
|
90
|
+
throw new TaskError('Found disallowed TODO*.md files in project root: ' + todo_files.join(', '));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (workspace) {
|
|
94
|
+
const error_message = await git_check_clean_workspace();
|
|
95
|
+
if (error_message) {
|
|
96
|
+
log.error(st('red', 'git status'));
|
|
97
|
+
await spawn('git', ['status']);
|
|
98
|
+
throw new TaskError('Failed check for git_check_clean_workspace:' +
|
|
99
|
+
error_message +
|
|
100
|
+
' - do you need to run `gro sync` or commit some files?');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChildProcess } from 'node:child_process';
|
|
2
|
+
/**
|
|
3
|
+
* Maps child process output through a transform function.
|
|
4
|
+
*/
|
|
5
|
+
export declare const map_child_process_output: (child_process: ChildProcess, transform: (data: string) => string) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Configures process output handling with path replacements while preserving ANSI colors.
|
|
8
|
+
*/
|
|
9
|
+
export declare const configure_colored_output_with_path_replacement: (child_process: ChildProcess, replacement?: string, cwd?: string) => void;
|
|
10
|
+
//# sourceMappingURL=child_process_logging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child_process_logging.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/child_process_logging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAGrD;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACpC,eAAe,YAAY,EAC3B,WAAW,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,KACjC,IAYF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8CAA8C,GAC1D,eAAe,YAAY,EAC3B,cAAa,MAAY,EACzB,MAAK,MAAsB,KACzB,IAOF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { strip_end } from '@fuzdev/fuz_util/string.js';
|
|
2
|
+
/**
|
|
3
|
+
* Maps child process output through a transform function.
|
|
4
|
+
*/
|
|
5
|
+
export const map_child_process_output = (child_process, transform) => {
|
|
6
|
+
if (child_process.stdout) {
|
|
7
|
+
child_process.stdout.on('data', (data) => {
|
|
8
|
+
process.stdout.write(transform(data.toString()));
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (child_process.stderr) {
|
|
12
|
+
child_process.stderr.on('data', (data) => {
|
|
13
|
+
process.stderr.write(transform(data.toString()));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Configures process output handling with path replacements while preserving ANSI colors.
|
|
19
|
+
*/
|
|
20
|
+
export const configure_colored_output_with_path_replacement = (child_process, replacement = '.', cwd = process.cwd()) => {
|
|
21
|
+
// Escape special characters in the cwd for regexp safety
|
|
22
|
+
const cwd_escaped = strip_end(cwd, '/').replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
23
|
+
const cwd_reg_exp = new RegExp(cwd_escaped, 'g');
|
|
24
|
+
// Use the generic mapper with a path replacement transform
|
|
25
|
+
map_child_process_output(child_process, (data) => data.replace(cwd_reg_exp, replacement));
|
|
26
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Task } from './task.ts';
|
|
3
|
+
/** @nodocs */
|
|
4
|
+
export declare const Args: z.ZodObject<{
|
|
5
|
+
build_dev: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
build_dist: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
sveltekit: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
nodemodules: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
git: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
git_origin: z.ZodDefault<z.ZodString>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type Args = z.infer<typeof Args>;
|
|
13
|
+
/** @nodocs */
|
|
14
|
+
export declare const task: Task<Args>;
|
|
15
|
+
//# sourceMappingURL=clean.task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/clean.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAGpC,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;kBAgBf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAmB3B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { spawn } from '@fuzdev/fuz_util/process.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { GitOrigin } from '@fuzdev/fuz_util/git.js';
|
|
4
|
+
import { clean_fs } from "./clean_fs.js";
|
|
5
|
+
/** @nodocs */
|
|
6
|
+
export const Args = z.strictObject({
|
|
7
|
+
build_dev: z.boolean().meta({ description: 'delete the Gro build dev directory' }).default(false),
|
|
8
|
+
build_dist: z.boolean().meta({ description: 'delete the Gro build dist directory' }).default(false),
|
|
9
|
+
sveltekit: z
|
|
10
|
+
.boolean()
|
|
11
|
+
.meta({ description: 'delete the SvelteKit directory and Vite cache' })
|
|
12
|
+
.default(false),
|
|
13
|
+
nodemodules: z.boolean().meta({ description: 'delete the node_modules directory' }).default(false),
|
|
14
|
+
git: z
|
|
15
|
+
.boolean()
|
|
16
|
+
.meta({
|
|
17
|
+
description: 'run "git remote prune" to delete local branches referencing nonexistent remote branches',
|
|
18
|
+
})
|
|
19
|
+
.default(false),
|
|
20
|
+
git_origin: GitOrigin.describe('the origin to "git remote prune"').default('origin'),
|
|
21
|
+
});
|
|
22
|
+
/** @nodocs */
|
|
23
|
+
export const task = {
|
|
24
|
+
summary: 'remove temporary dev and build files, and optionally prune git branches',
|
|
25
|
+
Args,
|
|
26
|
+
run: async ({ args }) => {
|
|
27
|
+
const { build_dev, build_dist, sveltekit, nodemodules, git, git_origin } = args;
|
|
28
|
+
await clean_fs({
|
|
29
|
+
build: !build_dev && !build_dist,
|
|
30
|
+
build_dev,
|
|
31
|
+
build_dist,
|
|
32
|
+
sveltekit,
|
|
33
|
+
nodemodules,
|
|
34
|
+
});
|
|
35
|
+
// lop off stale git branches
|
|
36
|
+
if (git) {
|
|
37
|
+
await spawn('git', ['remote', 'prune', git_origin]);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RmOptions } from 'node:fs';
|
|
2
|
+
export declare const clean_fs: ({ build, build_dev, build_dist, sveltekit, nodemodules, }: {
|
|
3
|
+
build?: boolean;
|
|
4
|
+
build_dev?: boolean;
|
|
5
|
+
build_dist?: boolean;
|
|
6
|
+
sveltekit?: boolean;
|
|
7
|
+
nodemodules?: boolean;
|
|
8
|
+
}, rm_options?: RmOptions) => Promise<void>;
|
|
9
|
+
//# sourceMappingURL=clean_fs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean_fs.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/clean_fs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAYvC,eAAO,MAAM,QAAQ,GACpB,2DAMG;IACF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,EACD,aAAY,SAA0C,KACpD,OAAO,CAAC,IAAI,CAyBd,CAAC"}
|
package/dist/clean_fs.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { readdir, rm } from 'node:fs/promises';
|
|
2
|
+
import { paths } from "./paths.js";
|
|
3
|
+
import { NODE_MODULES_DIRNAME, GRO_DIST_PREFIX, SVELTEKIT_DEV_DIRNAME, SVELTEKIT_BUILD_DIRNAME, SVELTEKIT_VITE_CACHE_PATH, SVELTEKIT_DIST_DIRNAME, } from "./constants.js";
|
|
4
|
+
export const clean_fs = async ({ build = false, build_dev = false, build_dist = false, sveltekit = false, nodemodules = false, }, rm_options = { force: true, recursive: true }) => {
|
|
5
|
+
const promises = [];
|
|
6
|
+
if (build) {
|
|
7
|
+
promises.push(rm(paths.build, rm_options));
|
|
8
|
+
}
|
|
9
|
+
else if (build_dev) {
|
|
10
|
+
promises.push(rm(paths.build_dev, rm_options));
|
|
11
|
+
}
|
|
12
|
+
if (build || build_dist) {
|
|
13
|
+
const dir_paths = (await readdir('.')).filter((p) => p.startsWith(GRO_DIST_PREFIX));
|
|
14
|
+
for (const path of dir_paths) {
|
|
15
|
+
promises.push(rm(path, rm_options));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (sveltekit) {
|
|
19
|
+
promises.push(rm(SVELTEKIT_DEV_DIRNAME, rm_options));
|
|
20
|
+
promises.push(rm(SVELTEKIT_BUILD_DIRNAME, rm_options));
|
|
21
|
+
promises.push(rm(SVELTEKIT_DIST_DIRNAME, rm_options));
|
|
22
|
+
promises.push(rm(SVELTEKIT_VITE_CACHE_PATH, rm_options));
|
|
23
|
+
}
|
|
24
|
+
if (nodemodules) {
|
|
25
|
+
promises.push(rm(NODE_MODULES_DIRNAME, rm_options));
|
|
26
|
+
}
|
|
27
|
+
await Promise.all(promises);
|
|
28
|
+
};
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SpawnOptions } from 'node:child_process';
|
|
2
|
+
import { type SpawnResult, type SpawnedProcess } from '@fuzdev/fuz_util/process.js';
|
|
3
|
+
import { type URL } from 'node:url';
|
|
4
|
+
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
5
|
+
import type { PathId } from '@fuzdev/fuz_util/path.js';
|
|
6
|
+
export type Cli = {
|
|
7
|
+
kind: 'local';
|
|
8
|
+
name: string;
|
|
9
|
+
id: PathId;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'global';
|
|
12
|
+
name: string;
|
|
13
|
+
id: PathId;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Searches the filesystem for the CLI `name`, first local to the cwd and then globally.
|
|
17
|
+
* @returns `null` if not found locally or globally
|
|
18
|
+
*/
|
|
19
|
+
export declare const find_cli: (name: string, cwd?: string | URL, options?: SpawnOptions) => Promise<Cli | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Spawns a CLI if available using fuz_util's `spawn`.
|
|
22
|
+
* If a string is provided for `name_or_cli`, it checks first local to the cwd and then globally.
|
|
23
|
+
* @returns `undefined` if no CLI is found, or the spawn result
|
|
24
|
+
*/
|
|
25
|
+
export declare const spawn_cli: (name_or_cli: string | Cli, args?: Array<string>, log?: Logger, options?: SpawnOptions) => Promise<SpawnResult | undefined>;
|
|
26
|
+
/**
|
|
27
|
+
* Spawns a CLI if available using fuz_util's `spawn_process`.
|
|
28
|
+
* If a string is provided for `name_or_cli`, it checks first local to the cwd and then globally.
|
|
29
|
+
* @returns `undefined` if no CLI is found, or the spawn result
|
|
30
|
+
*/
|
|
31
|
+
export declare const spawn_cli_process: (name_or_cli: string | Cli, args?: Array<string>, log?: Logger, options?: SpawnOptions) => Promise<SpawnedProcess | undefined>;
|
|
32
|
+
export declare const resolve_cli: (name_or_cli: string | Cli, args: Array<string> | undefined, cwd: string | URL | undefined, log?: Logger, options?: SpawnOptions) => Promise<Cli | undefined>;
|
|
33
|
+
export declare const to_cli_name: (cli: string | Cli) => string;
|
|
34
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAIN,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAgB,KAAK,GAAG,EAAC,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAOrD,MAAM,MAAM,GAAG,GACZ;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,GACzC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,QAAQ,GACpB,MAAM,MAAM,EACZ,MAAK,MAAM,GAAG,GAAmB,EACjC,UAAU,YAAY,KACpB,OAAO,CAAC,GAAG,GAAG,IAAI,CAUpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,GACrB,aAAa,MAAM,GAAG,GAAG,EACzB,OAAM,KAAK,CAAC,MAAM,CAAM,EACxB,MAAM,MAAM,EACZ,UAAU,YAAY,KACpB,OAAO,CAAC,WAAW,GAAG,SAAS,CAIjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC7B,aAAa,MAAM,GAAG,GAAG,EACzB,OAAM,KAAK,CAAC,MAAM,CAAM,EACxB,MAAM,MAAM,EACZ,UAAU,YAAY,KACpB,OAAO,CAAC,cAAc,GAAG,SAAS,CAIpC,CAAC;AAEF,eAAO,MAAM,WAAW,GACvB,aAAa,MAAM,GAAG,GAAG,EACzB,MAAM,KAAK,CAAC,MAAM,CAAC,YAAK,EACxB,KAAK,MAAM,GAAG,GAAG,GAAG,SAAS,EAC7B,MAAM,MAAM,EACZ,UAAU,YAAY,KACpB,OAAO,CAAC,GAAG,GAAG,SAAS,CAazB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,GAAG,GAAG,KAAG,MACP,CAAC"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { spawn, spawn_out, spawn_process, } from '@fuzdev/fuz_util/process.js';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { fs_exists } from '@fuzdev/fuz_util/fs.js';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { NODE_MODULES_DIRNAME } from "./constants.js";
|
|
6
|
+
import { print_command_args } from "./args.js";
|
|
7
|
+
/**
|
|
8
|
+
* Searches the filesystem for the CLI `name`, first local to the cwd and then globally.
|
|
9
|
+
* @returns `null` if not found locally or globally
|
|
10
|
+
*/
|
|
11
|
+
export const find_cli = async (name, cwd = process.cwd(), options) => {
|
|
12
|
+
const final_cwd = typeof cwd === 'string' ? cwd : fileURLToPath(cwd);
|
|
13
|
+
const local_id = join(final_cwd, NODE_MODULES_DIRNAME, `.bin/${name}`);
|
|
14
|
+
if (await fs_exists(local_id)) {
|
|
15
|
+
return { name, id: local_id, kind: 'local' };
|
|
16
|
+
}
|
|
17
|
+
const { stdout } = await spawn_out('which', [name], options);
|
|
18
|
+
const global_id = stdout?.trim();
|
|
19
|
+
if (!global_id)
|
|
20
|
+
return null;
|
|
21
|
+
return { name, id: global_id, kind: 'global' };
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Spawns a CLI if available using fuz_util's `spawn`.
|
|
25
|
+
* If a string is provided for `name_or_cli`, it checks first local to the cwd and then globally.
|
|
26
|
+
* @returns `undefined` if no CLI is found, or the spawn result
|
|
27
|
+
*/
|
|
28
|
+
export const spawn_cli = async (name_or_cli, args = [], log, options) => {
|
|
29
|
+
const cli = await resolve_cli(name_or_cli, args, options?.cwd, log, options);
|
|
30
|
+
if (!cli)
|
|
31
|
+
return;
|
|
32
|
+
return spawn(cli.id, args, options);
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Spawns a CLI if available using fuz_util's `spawn_process`.
|
|
36
|
+
* If a string is provided for `name_or_cli`, it checks first local to the cwd and then globally.
|
|
37
|
+
* @returns `undefined` if no CLI is found, or the spawn result
|
|
38
|
+
*/
|
|
39
|
+
export const spawn_cli_process = async (name_or_cli, args = [], log, options) => {
|
|
40
|
+
const cli = await resolve_cli(name_or_cli, args, options?.cwd, log, options);
|
|
41
|
+
if (!cli)
|
|
42
|
+
return;
|
|
43
|
+
return spawn_process(cli.id, args, options);
|
|
44
|
+
};
|
|
45
|
+
export const resolve_cli = async (name_or_cli, args = [], cwd, log, options) => {
|
|
46
|
+
let final_cli;
|
|
47
|
+
if (typeof name_or_cli === 'string') {
|
|
48
|
+
const found = await find_cli(name_or_cli, cwd, options);
|
|
49
|
+
if (!found)
|
|
50
|
+
return;
|
|
51
|
+
final_cli = found;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
final_cli = name_or_cli;
|
|
55
|
+
}
|
|
56
|
+
if (log) {
|
|
57
|
+
log.info(print_command_args([final_cli.name].concat(args)));
|
|
58
|
+
}
|
|
59
|
+
return final_cli;
|
|
60
|
+
};
|
|
61
|
+
export const to_cli_name = (cli) => typeof cli === 'string' ? cli : cli.name;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Task } from './task.ts';
|
|
3
|
+
/** @nodocs */
|
|
4
|
+
export declare const Args: z.ZodObject<{
|
|
5
|
+
_: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
6
|
+
origin: z.ZodDefault<z.ZodString>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type Args = z.infer<typeof Args>;
|
|
9
|
+
/** @nodocs */
|
|
10
|
+
export declare const task: Task<Args>;
|
|
11
|
+
//# sourceMappingURL=commit.task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/commit.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAEpC,cAAc;AACd,eAAO,MAAM,IAAI;;;kBAQf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAc3B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { spawn } from '@fuzdev/fuz_util/process.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { GitOrigin, git_current_branch_name, git_push } from '@fuzdev/fuz_util/git.js';
|
|
4
|
+
/** @nodocs */
|
|
5
|
+
export const Args = z.strictObject({
|
|
6
|
+
_: z
|
|
7
|
+
.array(z.string())
|
|
8
|
+
.meta({
|
|
9
|
+
description: 'the git commit message, the same as git commit -m or --message',
|
|
10
|
+
})
|
|
11
|
+
.default([]),
|
|
12
|
+
origin: GitOrigin.describe('git origin to commit to').default('origin'),
|
|
13
|
+
});
|
|
14
|
+
/** @nodocs */
|
|
15
|
+
export const task = {
|
|
16
|
+
summary: 'commit and push to a new branch',
|
|
17
|
+
Args,
|
|
18
|
+
run: async ({ args }) => {
|
|
19
|
+
const { _: [message], origin, } = args;
|
|
20
|
+
const branch = await git_current_branch_name();
|
|
21
|
+
await spawn('git', ['commit', '-a', '-m', message]);
|
|
22
|
+
await git_push(origin, branch, undefined, true);
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const SOURCE_DIRNAME = "src";
|
|
2
|
+
export declare const GRO_DIRNAME = ".gro";
|
|
3
|
+
export declare const GRO_DIST_PREFIX = "dist_";
|
|
4
|
+
export declare const SERVER_DIST_PATH = "dist_server";
|
|
5
|
+
export declare const GRO_DEV_DIRNAME: string;
|
|
6
|
+
/** @trailing_slash */
|
|
7
|
+
export declare const SOURCE_DIR: string;
|
|
8
|
+
/** @trailing_slash */
|
|
9
|
+
export declare const GRO_DIR: string;
|
|
10
|
+
/** @trailing_slash */
|
|
11
|
+
export declare const GRO_DEV_DIR: string;
|
|
12
|
+
export declare const GRO_CONFIG_FILENAME = "gro.config.ts";
|
|
13
|
+
export declare const README_FILENAME = "README.md";
|
|
14
|
+
export declare const SVELTE_CONFIG_FILENAME = "svelte.config.js";
|
|
15
|
+
export declare const VITE_CONFIG_FILENAME = "vite.config.ts";
|
|
16
|
+
export declare const NODE_MODULES_DIRNAME = "node_modules";
|
|
17
|
+
export declare const PACKAGE_JSON_FILENAME = "package.json";
|
|
18
|
+
export declare const LOCKFILE_FILENAME = "package-lock.json";
|
|
19
|
+
export declare const SVELTEKIT_DEV_DIRNAME = ".svelte-kit";
|
|
20
|
+
export declare const SVELTEKIT_BUILD_DIRNAME = "build";
|
|
21
|
+
export declare const SVELTEKIT_DIST_DIRNAME = "dist";
|
|
22
|
+
export declare const SVELTEKIT_VITE_CACHE_PATH: string;
|
|
23
|
+
export declare const GITHUB_DIRNAME = ".github";
|
|
24
|
+
export declare const GIT_DIRNAME = ".git";
|
|
25
|
+
export declare const TSCONFIG_FILENAME = "tsconfig.json";
|
|
26
|
+
export declare const TS_MATCHER: RegExp;
|
|
27
|
+
export declare const JS_MATCHER: RegExp;
|
|
28
|
+
export declare const JSON_MATCHER: RegExp;
|
|
29
|
+
export declare const SVELTE_MATCHER: RegExp;
|
|
30
|
+
export declare const SVELTE_RUNES_MATCHER: RegExp;
|
|
31
|
+
export declare const CSS_MATCHER: RegExp;
|
|
32
|
+
/** Extracts the script content from Svelte files. */
|
|
33
|
+
export declare const SVELTE_SCRIPT_MATCHER: RegExp;
|
|
34
|
+
export declare const SVELTEKIT_ENV_MATCHER: RegExp;
|
|
35
|
+
export declare const SVELTEKIT_GLOBAL_SPECIFIER: RegExp;
|
|
36
|
+
export declare const EVERYTHING_MATCHER: RegExp;
|
|
37
|
+
export declare const JS_CLI_DEFAULT = "node";
|
|
38
|
+
export declare const PM_CLI_DEFAULT = "npm";
|
|
39
|
+
export declare const PRETTIER_CLI_DEFAULT = "prettier";
|
|
40
|
+
export declare const SVELTEKIT_CLI = "svelte-kit";
|
|
41
|
+
export declare const SVELTE_CHECK_CLI = "svelte-check";
|
|
42
|
+
export declare const SVELTE_PACKAGE_CLI = "svelte-package";
|
|
43
|
+
export declare const SVELTE_PACKAGE_DEP_NAME = "@sveltejs/package";
|
|
44
|
+
export declare const VITE_CLI = "vite";
|
|
45
|
+
export declare const VITEST_CLI = "vitest";
|
|
46
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/constants.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,cAAc,QAAQ,CAAC;AACpC,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAC9C,eAAO,MAAM,eAAe,QAAuB,CAAC;AACpD,sBAAsB;AACtB,eAAO,MAAM,UAAU,QAAuB,CAAC;AAC/C,sBAAsB;AACtB,eAAO,MAAM,OAAO,QAAoB,CAAC;AACzC,sBAAsB;AACtB,eAAO,MAAM,WAAW,QAAwB,CAAC;AACjD,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AACzD,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AACnD,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AACpD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AACnD,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAC/C,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAC7C,eAAO,MAAM,yBAAyB,QAAkC,CAAC;AACzE,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,eAAO,MAAM,UAAU,QAAoB,CAAC;AAC5C,eAAO,MAAM,UAAU,QAAoB,CAAC;AAC5C,eAAO,MAAM,YAAY,QAAY,CAAC;AACtC,eAAO,MAAM,cAAc,QAAc,CAAC;AAC1C,eAAO,MAAM,oBAAoB,QAAuB,CAAC;AACzD,eAAO,MAAM,WAAW,QAAW,CAAC;AACpC,qDAAqD;AACrD,eAAO,MAAM,qBAAqB,QAAiD,CAAC;AACpF,eAAO,MAAM,qBAAqB,QAAgD,CAAC;AACnF,eAAO,MAAM,0BAA0B,QAAmB,CAAC;AAC3D,eAAO,MAAM,kBAAkB,QAAO,CAAC;AAEvC,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,cAAc,QAAQ,CAAC;AACpC,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAC/C,eAAO,MAAM,aAAa,eAAe,CAAC;AAC1C,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAC/C,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AACnD,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,eAAO,MAAM,QAAQ,SAAS,CAAC;AAC/B,eAAO,MAAM,UAAU,WAAW,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
This module is intended to have no dependencies to avoid over-imports in the CLI and loader.
|
|
4
|
+
If any of these become customizable from SvelteKit or Gro's configs, move them to `./paths.ts`.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
// TODO the slashes here are kinda gross - do we want to maintain the convention to have the trailing slash in most usage?
|
|
8
|
+
export const SOURCE_DIRNAME = 'src';
|
|
9
|
+
export const GRO_DIRNAME = '.gro';
|
|
10
|
+
export const GRO_DIST_PREFIX = 'dist_'; //
|
|
11
|
+
export const SERVER_DIST_PATH = 'dist_server'; // TODO should all of these be `_PATH` or should this be `DIRNAME`? also, add `_PLUGIN` to this name?
|
|
12
|
+
export const GRO_DEV_DIRNAME = GRO_DIRNAME + '/dev';
|
|
13
|
+
/** @trailing_slash */
|
|
14
|
+
export const SOURCE_DIR = SOURCE_DIRNAME + '/';
|
|
15
|
+
/** @trailing_slash */
|
|
16
|
+
export const GRO_DIR = GRO_DIRNAME + '/';
|
|
17
|
+
/** @trailing_slash */
|
|
18
|
+
export const GRO_DEV_DIR = GRO_DEV_DIRNAME + '/';
|
|
19
|
+
export const GRO_CONFIG_FILENAME = 'gro.config.ts';
|
|
20
|
+
export const README_FILENAME = 'README.md';
|
|
21
|
+
export const SVELTE_CONFIG_FILENAME = 'svelte.config.js';
|
|
22
|
+
export const VITE_CONFIG_FILENAME = 'vite.config.ts';
|
|
23
|
+
export const NODE_MODULES_DIRNAME = 'node_modules';
|
|
24
|
+
export const PACKAGE_JSON_FILENAME = 'package.json';
|
|
25
|
+
export const LOCKFILE_FILENAME = 'package-lock.json';
|
|
26
|
+
export const SVELTEKIT_DEV_DIRNAME = '.svelte-kit'; // TODO use Svelte config value `outDir`
|
|
27
|
+
export const SVELTEKIT_BUILD_DIRNAME = 'build';
|
|
28
|
+
export const SVELTEKIT_DIST_DIRNAME = 'dist';
|
|
29
|
+
export const SVELTEKIT_VITE_CACHE_PATH = NODE_MODULES_DIRNAME + '/.vite';
|
|
30
|
+
export const GITHUB_DIRNAME = '.github';
|
|
31
|
+
export const GIT_DIRNAME = '.git';
|
|
32
|
+
export const TSCONFIG_FILENAME = 'tsconfig.json';
|
|
33
|
+
export const TS_MATCHER = /\.(ts|mts|cts)$/;
|
|
34
|
+
export const JS_MATCHER = /\.(js|mjs|cjs)$/;
|
|
35
|
+
export const JSON_MATCHER = /\.json$/;
|
|
36
|
+
export const SVELTE_MATCHER = /\.svelte$/;
|
|
37
|
+
export const SVELTE_RUNES_MATCHER = /\.svelte\.(js|ts)$/; // TODO probably let `.svelte.` appear anywhere - https://github.com/sveltejs/svelte/issues/11536
|
|
38
|
+
export const CSS_MATCHER = /\.css$/;
|
|
39
|
+
/** Extracts the script content from Svelte files. */
|
|
40
|
+
export const SVELTE_SCRIPT_MATCHER = /<script(?:\s+[^>]*)?>([\s\S]*?)<\/script>/gim; // TODO maybe this shouldnt be global? or make a getter?
|
|
41
|
+
export const SVELTEKIT_ENV_MATCHER = /^\$env\/(static|dynamic)\/(public|private)$/;
|
|
42
|
+
export const SVELTEKIT_GLOBAL_SPECIFIER = /^\$(env|app)\//;
|
|
43
|
+
export const EVERYTHING_MATCHER = /.*/;
|
|
44
|
+
export const JS_CLI_DEFAULT = 'node';
|
|
45
|
+
export const PM_CLI_DEFAULT = 'npm';
|
|
46
|
+
export const PRETTIER_CLI_DEFAULT = 'prettier';
|
|
47
|
+
export const SVELTEKIT_CLI = 'svelte-kit';
|
|
48
|
+
export const SVELTE_CHECK_CLI = 'svelte-check';
|
|
49
|
+
export const SVELTE_PACKAGE_CLI = 'svelte-package';
|
|
50
|
+
export const SVELTE_PACKAGE_DEP_NAME = '@sveltejs/package';
|
|
51
|
+
export const VITE_CLI = 'vite';
|
|
52
|
+
export const VITEST_CLI = 'vitest';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Task } from './task.ts';
|
|
3
|
+
/** @nodocs */
|
|
4
|
+
export declare const Args: z.ZodObject<{
|
|
5
|
+
source: z.ZodDefault<z.ZodString>;
|
|
6
|
+
target: z.ZodDefault<z.ZodString>;
|
|
7
|
+
origin: z.ZodDefault<z.ZodString>;
|
|
8
|
+
deploy_dir: z.ZodDefault<z.ZodString>;
|
|
9
|
+
build_dir: z.ZodDefault<z.ZodString>;
|
|
10
|
+
dry: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
force: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
+
dangerous: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
reset: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
+
build: z.ZodDefault<z.ZodBoolean>;
|
|
15
|
+
'no-build': z.ZodDefault<z.ZodBoolean>;
|
|
16
|
+
sync: z.ZodDefault<z.ZodBoolean>;
|
|
17
|
+
'no-sync': z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
gen: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
'no-gen': z.ZodDefault<z.ZodBoolean>;
|
|
20
|
+
install: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
'no-install': z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
force_build: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
pull: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
'no-pull': z.ZodDefault<z.ZodBoolean>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export type Args = z.infer<typeof Args>;
|
|
27
|
+
/** @nodocs */
|
|
28
|
+
export declare const task: Task<Args>;
|
|
29
|
+
//# sourceMappingURL=deploy.task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/deploy.task.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAqBtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAiB/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;kBA8Cf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAkM3B,CAAC"}
|