@ryanatkn/gro 0.176.0 → 0.177.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/args.d.ts +5 -5
- package/dist/args.d.ts.map +1 -1
- package/dist/build.task.d.ts.map +1 -1
- package/dist/build.task.js +2 -2
- package/dist/build_cache.d.ts +12 -12
- package/dist/build_cache.d.ts.map +1 -1
- package/dist/build_cache.js +4 -4
- package/dist/changelog.d.ts +2 -2
- package/dist/changelog.d.ts.map +1 -1
- package/dist/changelog.js +1 -1
- package/dist/changeset.task.d.ts.map +1 -1
- package/dist/changeset.task.js +9 -9
- package/dist/changeset_helpers.d.ts +4 -4
- package/dist/changeset_helpers.d.ts.map +1 -1
- package/dist/changeset_helpers.js +2 -2
- package/dist/check.task.d.ts.map +1 -1
- package/dist/check.task.js +3 -3
- package/dist/clean.task.js +2 -2
- package/dist/cli.d.ts +6 -6
- package/dist/cli.d.ts.map +1 -1
- package/dist/commit.task.js +2 -2
- package/dist/deploy.task.d.ts.map +1 -1
- package/dist/deploy.task.js +13 -13
- package/dist/dev.task.d.ts +2 -2
- package/dist/dev.task.d.ts.map +1 -1
- package/dist/disknode.d.ts +4 -4
- package/dist/disknode.d.ts.map +1 -1
- package/dist/esbuild_helpers.d.ts +2 -2
- package/dist/esbuild_helpers.d.ts.map +1 -1
- package/dist/esbuild_plugin_external_worker.d.ts +5 -5
- package/dist/esbuild_plugin_external_worker.d.ts.map +1 -1
- package/dist/esbuild_plugin_svelte.d.ts +4 -4
- package/dist/esbuild_plugin_svelte.d.ts.map +1 -1
- package/dist/esbuild_plugin_sveltekit_shim_alias.d.ts +2 -2
- package/dist/esbuild_plugin_sveltekit_shim_alias.d.ts.map +1 -1
- package/dist/esbuild_plugin_sveltekit_shim_app.d.ts +5 -5
- package/dist/esbuild_plugin_sveltekit_shim_app.d.ts.map +1 -1
- package/dist/esbuild_plugin_sveltekit_shim_env.d.ts +2 -2
- package/dist/esbuild_plugin_sveltekit_shim_env.d.ts.map +1 -1
- package/dist/filer.d.ts +15 -15
- package/dist/filer.d.ts.map +1 -1
- package/dist/filer.js +2 -2
- package/dist/format.task.d.ts.map +1 -1
- package/dist/format.task.js +2 -2
- package/dist/format_directory.d.ts +2 -2
- package/dist/format_directory.d.ts.map +1 -1
- package/dist/gen.d.ts +73 -73
- package/dist/gen.d.ts.map +1 -1
- package/dist/gen.js +1 -1
- package/dist/gen.task.d.ts.map +1 -1
- package/dist/gen.task.js +8 -8
- package/dist/gen_helpers.d.ts +4 -4
- package/dist/gen_helpers.d.ts.map +1 -1
- package/dist/gen_helpers.js +1 -1
- package/dist/github.d.ts +4 -4
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +3 -3
- package/dist/gro.config.default.d.ts +2 -2
- package/dist/gro.config.default.d.ts.map +1 -1
- package/dist/gro_config.d.ts +25 -25
- package/dist/gro_config.d.ts.map +1 -1
- package/dist/gro_config.js +2 -2
- package/dist/gro_helpers.d.ts +2 -2
- package/dist/gro_helpers.d.ts.map +1 -1
- package/dist/gro_plugin_gen.d.ts +3 -3
- package/dist/gro_plugin_gen.d.ts.map +1 -1
- package/dist/gro_plugin_gen.js +2 -2
- package/dist/gro_plugin_server.d.ts +7 -7
- package/dist/gro_plugin_server.d.ts.map +1 -1
- package/dist/gro_plugin_sveltekit_app.d.ts +10 -10
- package/dist/gro_plugin_sveltekit_app.d.ts.map +1 -1
- package/dist/gro_plugin_sveltekit_app.js +2 -2
- package/dist/gro_plugin_sveltekit_library.d.ts +4 -4
- package/dist/gro_plugin_sveltekit_library.d.ts.map +1 -1
- package/dist/gro_plugin_sveltekit_library.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/input_path.d.ts +30 -30
- package/dist/input_path.d.ts.map +1 -1
- package/dist/input_path.js +2 -2
- package/dist/invoke.js +1 -1
- package/dist/invoke_task.d.ts +3 -3
- package/dist/invoke_task.d.ts.map +1 -1
- package/dist/invoke_task.js +4 -4
- package/dist/lint.task.d.ts.map +1 -1
- package/dist/lint.task.js +2 -2
- package/dist/modules.d.ts +20 -20
- package/dist/modules.d.ts.map +1 -1
- package/dist/modules.js +2 -2
- package/dist/package_json.d.ts +16 -16
- package/dist/package_json.d.ts.map +1 -1
- package/dist/package_json.js +6 -6
- package/dist/parse_exports.d.ts +7 -7
- package/dist/parse_exports.d.ts.map +1 -1
- package/dist/parse_exports.js +3 -3
- package/dist/parse_exports_context.d.ts +3 -3
- package/dist/parse_exports_context.d.ts.map +1 -1
- package/dist/parse_exports_context.js +1 -1
- package/dist/parse_imports.d.ts +3 -3
- package/dist/parse_imports.d.ts.map +1 -1
- package/dist/parse_imports.js +2 -2
- package/dist/paths.d.ts +6 -6
- package/dist/paths.d.ts.map +1 -1
- package/dist/plugin.d.ts +13 -13
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/publish.task.d.ts.map +1 -1
- package/dist/publish.task.js +12 -12
- package/dist/reinstall.task.d.ts.map +1 -1
- package/dist/reinstall.task.js +4 -4
- package/dist/resolve_specifier.d.ts +4 -4
- package/dist/resolve_specifier.d.ts.map +1 -1
- package/dist/run.task.d.ts.map +1 -1
- package/dist/run.task.js +9 -6
- package/dist/run_gen.d.ts +4 -4
- package/dist/run_gen.d.ts.map +1 -1
- package/dist/run_task.d.ts +4 -4
- package/dist/run_task.d.ts.map +1 -1
- package/dist/run_task.js +3 -3
- package/dist/search_fs.d.ts +6 -6
- package/dist/search_fs.d.ts.map +1 -1
- package/dist/src_json.d.ts +6 -6
- package/dist/src_json.d.ts.map +1 -1
- package/dist/src_json.js +3 -3
- package/dist/svelte_config.d.ts +3 -3
- package/dist/svelte_config.d.ts.map +1 -1
- package/dist/sveltekit_helpers.d.ts +5 -5
- package/dist/sveltekit_helpers.d.ts.map +1 -1
- package/dist/sveltekit_helpers.js +5 -5
- package/dist/sveltekit_shim_app.d.ts +2 -2
- package/dist/sveltekit_shim_app.d.ts.map +1 -1
- package/dist/sync.task.d.ts.map +1 -1
- package/dist/sync.task.js +2 -2
- package/dist/task.d.ts +54 -54
- package/dist/task.d.ts.map +1 -1
- package/dist/task.js +3 -3
- package/dist/task_logging.d.ts +3 -3
- package/dist/task_logging.d.ts.map +1 -1
- package/dist/test.task.d.ts.map +1 -1
- package/dist/test.task.js +4 -4
- package/dist/typecheck.task.d.ts.map +1 -1
- package/dist/typecheck.task.js +4 -4
- package/dist/upgrade.task.d.ts.map +1 -1
- package/dist/upgrade.task.js +5 -5
- package/dist/watch_dir.d.ts +10 -10
- package/dist/watch_dir.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/lib/args.ts +9 -9
- package/src/lib/build.task.ts +2 -2
- package/src/lib/build_cache.ts +18 -18
- package/src/lib/changelog.ts +10 -10
- package/src/lib/changeset.task.ts +16 -16
- package/src/lib/changeset_helpers.ts +4 -4
- package/src/lib/check.task.ts +3 -3
- package/src/lib/clean.task.ts +2 -2
- package/src/lib/cli.ts +7 -7
- package/src/lib/commit.task.ts +2 -2
- package/src/lib/deploy.task.ts +15 -15
- package/src/lib/dev.task.ts +2 -2
- package/src/lib/disknode.ts +4 -4
- package/src/lib/esbuild_helpers.ts +2 -2
- package/src/lib/esbuild_plugin_external_worker.ts +7 -7
- package/src/lib/esbuild_plugin_svelte.ts +4 -4
- package/src/lib/esbuild_plugin_sveltekit_shim_alias.ts +2 -2
- package/src/lib/esbuild_plugin_sveltekit_shim_app.ts +5 -5
- package/src/lib/esbuild_plugin_sveltekit_shim_env.ts +2 -2
- package/src/lib/filer.ts +35 -35
- package/src/lib/format.task.ts +2 -2
- package/src/lib/format_directory.ts +2 -2
- package/src/lib/gen.task.ts +19 -19
- package/src/lib/gen.ts +85 -85
- package/src/lib/gen_helpers.ts +17 -17
- package/src/lib/github.ts +6 -6
- package/src/lib/gro.config.default.ts +2 -2
- package/src/lib/gro_config.ts +28 -28
- package/src/lib/gro_helpers.ts +2 -2
- package/src/lib/gro_plugin_gen.ts +5 -5
- package/src/lib/gro_plugin_server.ts +8 -8
- package/src/lib/gro_plugin_sveltekit_app.ts +15 -15
- package/src/lib/gro_plugin_sveltekit_library.ts +6 -6
- package/src/lib/index.ts +3 -3
- package/src/lib/input_path.ts +56 -56
- package/src/lib/invoke.ts +2 -2
- package/src/lib/invoke_task.ts +7 -7
- package/src/lib/lint.task.ts +2 -2
- package/src/lib/modules.ts +31 -31
- package/src/lib/package_json.ts +27 -27
- package/src/lib/parse_exports.ts +15 -15
- package/src/lib/parse_exports_context.ts +9 -9
- package/src/lib/parse_imports.ts +6 -6
- package/src/lib/paths.ts +6 -6
- package/src/lib/plugin.ts +17 -17
- package/src/lib/publish.task.ts +13 -13
- package/src/lib/reinstall.task.ts +4 -4
- package/src/lib/resolve_specifier.ts +5 -5
- package/src/lib/run.task.ts +10 -6
- package/src/lib/run_gen.ts +14 -14
- package/src/lib/run_task.ts +8 -8
- package/src/lib/search_fs.ts +13 -13
- package/src/lib/src_json.ts +13 -13
- package/src/lib/svelte_config.ts +2 -2
- package/src/lib/sveltekit_helpers.ts +12 -12
- package/src/lib/sveltekit_shim_app.ts +3 -3
- package/src/lib/sync.task.ts +2 -2
- package/src/lib/task.ts +63 -63
- package/src/lib/task_logging.ts +11 -11
- package/src/lib/test.task.ts +4 -4
- package/src/lib/typecheck.task.ts +4 -4
- package/src/lib/upgrade.task.ts +7 -7
- package/src/lib/watch_dir.ts +10 -10
package/dist/args.d.ts
CHANGED
|
@@ -11,12 +11,12 @@ import type { z } from 'zod';
|
|
|
11
11
|
export interface Args {
|
|
12
12
|
_?: Array<string>;
|
|
13
13
|
help?: boolean;
|
|
14
|
-
[key: string]:
|
|
14
|
+
[key: string]: ArgValue;
|
|
15
15
|
}
|
|
16
|
-
export type
|
|
17
|
-
export interface
|
|
16
|
+
export type ArgValue = string | number | boolean | undefined | Array<string | number | boolean>;
|
|
17
|
+
export interface ArgSchema {
|
|
18
18
|
type: string;
|
|
19
|
-
default:
|
|
19
|
+
default: ArgValue;
|
|
20
20
|
description: string;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -31,7 +31,7 @@ export interface Arg_Schema {
|
|
|
31
31
|
* Parsing like this also ensures data consistency for both versions because `mri` only creates one.
|
|
32
32
|
* A simpler implementation could replace `mri`, but it handles some finicky details well.
|
|
33
33
|
*/
|
|
34
|
-
export declare const parse_args: <
|
|
34
|
+
export declare const parse_args: <TOutput extends Record<string, ArgValue> = Args, TInput extends Record<string, ArgValue> = Args>(unparsed_args: TInput, schema: z.ZodType<TOutput, TInput>) => z.ZodSafeParseResult<TOutput>;
|
|
35
35
|
/**
|
|
36
36
|
* Serializes parsed `Args` for CLI commands.
|
|
37
37
|
*/
|
package/dist/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/args.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAE3B;;;;;;;;GAQG;AACH,MAAM,WAAW,IAAI;IACpB,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/args.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAE3B;;;;;;;;GAQG;AACH,MAAM,WAAW,IAAI;IACpB,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC;CACxB;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAEhG,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GACtB,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,EAC/C,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,EAE9C,eAAe,MAAM,EACrB,QAAQ,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,KAChC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAiB9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,IAAI,KAAG,KAAK,CAAC,MAAM,CAuBvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,eAAmB,KAAG;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAMhF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,eAAmB,KAAG,KAAK,CAAC,MAAM,CAGlE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC7B,SAAS,MAAM,EACf,gBAAgB,KAAK,CAAC,MAAM,CAAC,EAC7B,wCAAmD,KACjD,IAA4B,CAAC;AAEhC,eAAO,MAAM,4BAA4B,GACxC,wBAAkC,KAChC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,CAuCjC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,GACtC,mBAAmB,MAAM,EACzB,wBAAkC,KAChC,IAaF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,iBAAiB,KAAK,CAAC,MAAM,CAAC,KAAG,MAK1C,CAAC"}
|
package/dist/build.task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/build.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAMtB,OAAO,
|
|
1
|
+
{"version":3,"file":"build.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/build.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAMtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAW/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;kBAYf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AASvC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAmG3B,CAAC"}
|
package/dist/build.task.js
CHANGED
|
@@ -3,7 +3,7 @@ import { styleText as st } from 'node:util';
|
|
|
3
3
|
import { git_check_clean_workspace, git_current_commit_hash } from '@ryanatkn/belt/git.js';
|
|
4
4
|
import { rmSync, existsSync } from 'node:fs';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
|
-
import {
|
|
6
|
+
import { TaskError } from "./task.js";
|
|
7
7
|
import { Plugins } from "./plugin.js";
|
|
8
8
|
import { clean_fs } from "./clean_fs.js";
|
|
9
9
|
import { is_build_cache_valid, create_build_cache_metadata, save_build_cache_metadata, discover_build_output_dirs, } from "./build_cache.js";
|
|
@@ -90,7 +90,7 @@ export const task = {
|
|
|
90
90
|
const final_workspace_status = await git_check_clean_workspace();
|
|
91
91
|
if (final_workspace_status !== workspace_status) {
|
|
92
92
|
// Workspace state changed during build - this indicates a problem
|
|
93
|
-
throw new
|
|
93
|
+
throw new TaskError('Build process modified tracked files or created untracked files.\n\n' +
|
|
94
94
|
'Git status after build:\n' +
|
|
95
95
|
final_workspace_status +
|
|
96
96
|
'\n\n' +
|
package/dist/build_cache.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type {
|
|
3
|
+
import type { GroConfig } from './gro_config.ts';
|
|
4
4
|
export declare const BUILD_CACHE_METADATA_FILENAME = "build.json";
|
|
5
5
|
export declare const BUILD_CACHE_VERSION = "1";
|
|
6
6
|
/**
|
|
7
7
|
* Metadata about a single build output file.
|
|
8
8
|
* Includes cryptographic hash for validation plus filesystem stats for debugging and optimization.
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const BuildOutputEntry: z.ZodObject<{
|
|
11
11
|
path: z.ZodString;
|
|
12
12
|
hash: z.ZodString;
|
|
13
13
|
size: z.ZodNumber;
|
|
@@ -15,12 +15,12 @@ export declare const Build_Output_Entry: z.ZodObject<{
|
|
|
15
15
|
ctime: z.ZodNumber;
|
|
16
16
|
mode: z.ZodNumber;
|
|
17
17
|
}, z.core.$strict>;
|
|
18
|
-
export type
|
|
18
|
+
export type BuildOutputEntry = z.infer<typeof BuildOutputEntry>;
|
|
19
19
|
/**
|
|
20
20
|
* Metadata stored in .gro/ directory to track build cache validity.
|
|
21
21
|
* Schema validates structure at load time to catch corrupted cache files.
|
|
22
22
|
*/
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const BuildCacheMetadata: z.ZodObject<{
|
|
24
24
|
version: z.ZodString;
|
|
25
25
|
git_commit: z.ZodNullable<z.ZodString>;
|
|
26
26
|
build_cache_config_hash: z.ZodString;
|
|
@@ -34,7 +34,7 @@ export declare const Build_Cache_Metadata: z.ZodObject<{
|
|
|
34
34
|
mode: z.ZodNumber;
|
|
35
35
|
}, z.core.$strict>>;
|
|
36
36
|
}, z.core.$strict>;
|
|
37
|
-
export type
|
|
37
|
+
export type BuildCacheMetadata = z.infer<typeof BuildCacheMetadata>;
|
|
38
38
|
/**
|
|
39
39
|
* Computes the cache key components for a build.
|
|
40
40
|
* This determines whether a cached build can be reused.
|
|
@@ -43,7 +43,7 @@ export type Build_Cache_Metadata = z.infer<typeof Build_Cache_Metadata>;
|
|
|
43
43
|
* @param log Logger
|
|
44
44
|
* @param git_commit Optional pre-computed git commit hash (optimization to avoid re-reading)
|
|
45
45
|
*/
|
|
46
|
-
export declare const compute_build_cache_key: (config:
|
|
46
|
+
export declare const compute_build_cache_key: (config: GroConfig, log: Logger, git_commit?: string | null) => Promise<{
|
|
47
47
|
git_commit: string | null;
|
|
48
48
|
build_cache_config_hash: string;
|
|
49
49
|
}>;
|
|
@@ -51,18 +51,18 @@ export declare const compute_build_cache_key: (config: Gro_Config, log: Logger,
|
|
|
51
51
|
* Loads build cache metadata from .gro/ directory.
|
|
52
52
|
* Invalid or corrupted cache files are automatically deleted.
|
|
53
53
|
*/
|
|
54
|
-
export declare const load_build_cache_metadata: () =>
|
|
54
|
+
export declare const load_build_cache_metadata: () => BuildCacheMetadata | null;
|
|
55
55
|
/**
|
|
56
56
|
* Saves build cache metadata to .gro/ directory.
|
|
57
57
|
* Errors are logged but don't fail the build (cache is optional).
|
|
58
58
|
*/
|
|
59
|
-
export declare const save_build_cache_metadata: (metadata:
|
|
59
|
+
export declare const save_build_cache_metadata: (metadata: BuildCacheMetadata, log?: Logger) => void;
|
|
60
60
|
/**
|
|
61
61
|
* Validates that a cached build is still valid by checking stats and hashing outputs.
|
|
62
62
|
* Uses size as a fast negative check before expensive hashing.
|
|
63
63
|
* This is comprehensive validation to catch manual tampering or corruption.
|
|
64
64
|
*/
|
|
65
|
-
export declare const validate_build_cache: (metadata:
|
|
65
|
+
export declare const validate_build_cache: (metadata: BuildCacheMetadata) => Promise<boolean>;
|
|
66
66
|
/**
|
|
67
67
|
* Main function to check if the build cache is valid.
|
|
68
68
|
* Returns true if the cached build can be used, false if a fresh build is needed.
|
|
@@ -71,7 +71,7 @@ export declare const validate_build_cache: (metadata: Build_Cache_Metadata) => P
|
|
|
71
71
|
* @param log Logger
|
|
72
72
|
* @param git_commit Optional pre-computed git commit hash (optimization)
|
|
73
73
|
*/
|
|
74
|
-
export declare const is_build_cache_valid: (config:
|
|
74
|
+
export declare const is_build_cache_valid: (config: GroConfig, log: Logger, git_commit?: string | null) => Promise<boolean>;
|
|
75
75
|
/**
|
|
76
76
|
* Collects information about all files in build output directories.
|
|
77
77
|
* Returns an array of entries with path, hash, size, mtime, ctime, and mode.
|
|
@@ -81,7 +81,7 @@ export declare const is_build_cache_valid: (config: Gro_Config, log: Logger, git
|
|
|
81
81
|
*
|
|
82
82
|
* @param build_dirs Array of output directories to scan (e.g., ['build', 'dist', 'dist_server'])
|
|
83
83
|
*/
|
|
84
|
-
export declare const collect_build_outputs: (build_dirs: Array<string>) => Promise<Array<
|
|
84
|
+
export declare const collect_build_outputs: (build_dirs: Array<string>) => Promise<Array<BuildOutputEntry>>;
|
|
85
85
|
/**
|
|
86
86
|
* Discovers all build output directories in the current working directory.
|
|
87
87
|
* Returns an array of directory names that exist: build/, dist/, dist_*
|
|
@@ -96,5 +96,5 @@ export declare const discover_build_output_dirs: () => Array<string>;
|
|
|
96
96
|
* @param git_commit Optional pre-computed git commit hash (optimization)
|
|
97
97
|
* @param build_dirs Optional pre-discovered build directories (optimization to avoid redundant filesystem scans)
|
|
98
98
|
*/
|
|
99
|
-
export declare const create_build_cache_metadata: (config:
|
|
99
|
+
export declare const create_build_cache_metadata: (config: GroConfig, log: Logger, git_commit?: string | null, build_dirs?: Array<string>) => Promise<BuildCacheMetadata>;
|
|
100
100
|
//# sourceMappingURL=build_cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_cache.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/build_cache.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAGlD,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"build_cache.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/build_cache.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAGlD,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAI/C,eAAO,MAAM,6BAA6B,eAAe,CAAC;AAC1D,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;kBAW3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;kBAU7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GACnC,QAAQ,SAAS,EACjB,KAAK,MAAM,EACX,aAAa,MAAM,GAAG,IAAI,KACxB,OAAO,CAAC;IACV,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC;CAChC,CAYA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAO,kBAAkB,GAAG,IAoCjE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GAAI,UAAU,kBAAkB,EAAE,MAAM,MAAM,KAAG,IActF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAU,UAAU,kBAAkB,KAAG,OAAO,CAAC,OAAO,CA8BxF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAChC,QAAQ,SAAS,EACjB,KAAK,MAAM,EACX,aAAa,MAAM,GAAG,IAAI,KACxB,OAAO,CAAC,OAAO,CA+BjB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GACjC,YAAY,KAAK,CAAC,MAAM,CAAC,KACvB,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CA2DjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,QAAO,KAAK,CAAC,MAAM,CA2BzD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GACvC,QAAQ,SAAS,EACjB,KAAK,MAAM,EACX,aAAa,MAAM,GAAG,IAAI,EAC1B,aAAa,KAAK,CAAC,MAAM,CAAC,KACxB,OAAO,CAAC,kBAAkB,CAW5B,CAAC"}
|
package/dist/build_cache.js
CHANGED
|
@@ -12,7 +12,7 @@ export const BUILD_CACHE_VERSION = '1';
|
|
|
12
12
|
* Metadata about a single build output file.
|
|
13
13
|
* Includes cryptographic hash for validation plus filesystem stats for debugging and optimization.
|
|
14
14
|
*/
|
|
15
|
-
export const
|
|
15
|
+
export const BuildOutputEntry = z.strictObject({
|
|
16
16
|
path: z
|
|
17
17
|
.string()
|
|
18
18
|
.meta({ description: "relative path from project root (e.g., 'build/index.html')." }),
|
|
@@ -28,7 +28,7 @@ export const Build_Output_Entry = z.strictObject({
|
|
|
28
28
|
* Metadata stored in .gro/ directory to track build cache validity.
|
|
29
29
|
* Schema validates structure at load time to catch corrupted cache files.
|
|
30
30
|
*/
|
|
31
|
-
export const
|
|
31
|
+
export const BuildCacheMetadata = z.strictObject({
|
|
32
32
|
version: z.string().meta({ description: 'schema version for future compatibility' }),
|
|
33
33
|
git_commit: z.string().nullable().meta({ description: 'git commit hash at time of build' }),
|
|
34
34
|
build_cache_config_hash: z
|
|
@@ -36,7 +36,7 @@ export const Build_Cache_Metadata = z.strictObject({
|
|
|
36
36
|
.meta({ description: "hash of user's custom build_cache_config from gro.config.ts." }),
|
|
37
37
|
timestamp: z.string().meta({ description: 'timestamp when build completed' }),
|
|
38
38
|
outputs: z
|
|
39
|
-
.array(
|
|
39
|
+
.array(BuildOutputEntry)
|
|
40
40
|
.meta({ description: 'build output files with hashes and filesystem stats' }),
|
|
41
41
|
});
|
|
42
42
|
/**
|
|
@@ -72,7 +72,7 @@ export const load_build_cache_metadata = () => {
|
|
|
72
72
|
const contents = readFileSync(metadata_path, 'utf-8');
|
|
73
73
|
const parsed = JSON.parse(contents);
|
|
74
74
|
// Validate structure with Zod
|
|
75
|
-
const metadata =
|
|
75
|
+
const metadata = BuildCacheMetadata.parse(parsed);
|
|
76
76
|
// Validate version
|
|
77
77
|
if (metadata.version !== BUILD_CACHE_VERSION) {
|
|
78
78
|
// Clean up stale cache with old schema version
|
package/dist/changelog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FetchValueCache } from '@ryanatkn/belt/fetch.js';
|
|
3
3
|
/**
|
|
4
4
|
* Updates a changelog produced by `@changesets/changelog-git` with better links and formatting.
|
|
5
5
|
* It's similar to `@changesets/changelog-github` but doesn't require a token for light usage.
|
|
@@ -7,5 +7,5 @@ import type { Fetch_Value_Cache } from '@ryanatkn/belt/fetch.js';
|
|
|
7
7
|
* as an alternative to `@changesets/changelog-git`.
|
|
8
8
|
* @returns boolean indicating if the changelog changed
|
|
9
9
|
*/
|
|
10
|
-
export declare const update_changelog: (owner: string, repo: string, path?: string, token?: string, log?: Logger, cache?:
|
|
10
|
+
export declare const update_changelog: (owner: string, repo: string, path?: string, token?: string, log?: Logger, cache?: FetchValueCache) => Promise<boolean>;
|
|
11
11
|
//# sourceMappingURL=changelog.d.ts.map
|
package/dist/changelog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changelog.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/changelog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"changelog.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/changelog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAI7D;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC5B,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,aAAqB,EACrB,QAAQ,MAAM,EACd,MAAM,MAAM,EACZ,QAAO,eAA2B,KAChC,OAAO,CAAC,OAAO,CAUjB,CAAC"}
|
package/dist/changelog.js
CHANGED
|
@@ -20,7 +20,7 @@ export const update_changelog = async (owner, repo, path = 'CHANGELOG.md', token
|
|
|
20
20
|
return true;
|
|
21
21
|
};
|
|
22
22
|
// keeping this really simple for now, no need to parse further for our current usecases
|
|
23
|
-
const
|
|
23
|
+
const ParsedChangelog = z.array(z.string());
|
|
24
24
|
const parse_changelog = (contents) => contents.split('\n');
|
|
25
25
|
const serialize_changelog = (parsed) => parsed.join('\n');
|
|
26
26
|
const LINE_WITH_SHA_MATCHER = /^- ([a-z0-9]{7,8}): /;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeset.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/changeset.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAatB,OAAO,
|
|
1
|
+
{"version":3,"file":"changeset.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/changeset.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAatB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAa/C,cAAc;AACd,eAAO,MAAM,IAAI;IAChB;;OAEG;;;;;;;;;;;;;;kBAuBF,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA0F3B,CAAC"}
|
package/dist/changeset.task.js
CHANGED
|
@@ -4,11 +4,11 @@ import { styleText as st } from 'node:util';
|
|
|
4
4
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { existsSync, readdirSync } from 'node:fs';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { GitOrigin, git_check_fully_staged_workspace, git_push_to_create, } from '@ryanatkn/belt/git.js';
|
|
8
|
+
import { TaskError } from "./task.js";
|
|
9
9
|
import { find_cli, spawn_cli } from "./cli.js";
|
|
10
10
|
import { has_sveltekit_library } from "./sveltekit_helpers.js";
|
|
11
|
-
import { CHANGESET_CLI, CHANGESET_DIR,
|
|
11
|
+
import { CHANGESET_CLI, CHANGESET_DIR, ChangesetAccess, ChangesetBump, CHANGESET_PUBLIC_ACCESS, CHANGESET_RESTRICTED_ACCESS, } from "./changeset_helpers.js";
|
|
12
12
|
import { load_package_json } from "./package_json.js";
|
|
13
13
|
/** @nodocs */
|
|
14
14
|
export const Args = z.strictObject({
|
|
@@ -23,7 +23,7 @@ export const Args = z.strictObject({
|
|
|
23
23
|
minor: z.boolean().meta({ description: 'bump the minor version' }).default(false),
|
|
24
24
|
major: z.boolean().meta({ description: 'bump the major version' }).default(false),
|
|
25
25
|
dir: z.string().meta({ description: 'changeset dir' }).default(CHANGESET_DIR),
|
|
26
|
-
access:
|
|
26
|
+
access: ChangesetAccess.describe("changeset 'access' config value, the default depends on package.json#private").optional(),
|
|
27
27
|
changelog: z
|
|
28
28
|
.string()
|
|
29
29
|
.meta({ description: 'changelog dep package name, used as changeset\'s "changelog" config' })
|
|
@@ -33,7 +33,7 @@ export const Args = z.strictObject({
|
|
|
33
33
|
.boolean()
|
|
34
34
|
.meta({ description: 'opt out of installing the changelog package' })
|
|
35
35
|
.default(false),
|
|
36
|
-
origin:
|
|
36
|
+
origin: GitOrigin.describe('git origin to deploy to').default('origin'),
|
|
37
37
|
changeset_cli: z.string().meta({ description: 'the changeset CLI to use' }).default(CHANGESET_CLI),
|
|
38
38
|
});
|
|
39
39
|
/**
|
|
@@ -53,18 +53,18 @@ export const task = {
|
|
|
53
53
|
run: async (ctx) => {
|
|
54
54
|
const { invoke_task, args: { _: [message], minor, major, dir, access: access_arg, changelog, dep, origin, changeset_cli, }, log, svelte_config, config, } = ctx;
|
|
55
55
|
if (!message && (minor || major))
|
|
56
|
-
throw new
|
|
56
|
+
throw new TaskError('cannot bump version without a message');
|
|
57
57
|
if (minor && major)
|
|
58
|
-
throw new
|
|
58
|
+
throw new TaskError('cannot bump both minor and major');
|
|
59
59
|
const bump = minor ? 'minor' : major ? 'major' : 'patch';
|
|
60
60
|
const found_changeset_cli = find_cli(changeset_cli);
|
|
61
61
|
if (!found_changeset_cli) {
|
|
62
|
-
throw new
|
|
62
|
+
throw new TaskError('changeset command not found: install @changesets/cli locally or globally');
|
|
63
63
|
}
|
|
64
64
|
const package_json = load_package_json();
|
|
65
65
|
const has_sveltekit_library_result = await has_sveltekit_library(package_json, svelte_config);
|
|
66
66
|
if (!has_sveltekit_library_result.ok) {
|
|
67
|
-
throw new
|
|
67
|
+
throw new TaskError('Failed to find SvelteKit library: ' + has_sveltekit_library_result.message);
|
|
68
68
|
}
|
|
69
69
|
const path = join(dir, 'config.json');
|
|
70
70
|
const inited = existsSync(path);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const CHANGESET_RESTRICTED_ACCESS = "restricted";
|
|
3
3
|
export declare const CHANGESET_PUBLIC_ACCESS = "public";
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const ChangesetAccess: z.ZodEnum<{
|
|
5
5
|
public: "public";
|
|
6
6
|
restricted: "restricted";
|
|
7
7
|
}>;
|
|
8
|
-
export type
|
|
8
|
+
export type ChangesetAccess = z.infer<typeof ChangesetAccess>;
|
|
9
9
|
export declare const CHANGESET_CLI = "changeset";
|
|
10
10
|
export declare const CHANGESET_DIR = ".changeset";
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const ChangesetBump: z.ZodEnum<{
|
|
12
12
|
patch: "patch";
|
|
13
13
|
minor: "minor";
|
|
14
14
|
major: "major";
|
|
15
15
|
}>;
|
|
16
|
-
export type
|
|
16
|
+
export type ChangesetBump = z.infer<typeof ChangesetBump>;
|
|
17
17
|
//# sourceMappingURL=changeset_helpers.d.ts.map
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const CHANGESET_RESTRICTED_ACCESS = 'restricted';
|
|
3
3
|
export const CHANGESET_PUBLIC_ACCESS = 'public';
|
|
4
|
-
export const
|
|
4
|
+
export const ChangesetAccess = z.enum([CHANGESET_RESTRICTED_ACCESS, CHANGESET_PUBLIC_ACCESS]);
|
|
5
5
|
export const CHANGESET_CLI = 'changeset';
|
|
6
6
|
export const CHANGESET_DIR = '.changeset';
|
|
7
|
-
export const
|
|
7
|
+
export const ChangesetBump = z.enum(['patch', 'minor', 'major']);
|
package/dist/check.task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/check.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB,OAAO,
|
|
1
|
+
{"version":3,"file":"check.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/check.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAG/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;kBAuBf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA4D3B,CAAC"}
|
package/dist/check.task.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { spawn } from '@ryanatkn/belt/process.js';
|
|
3
3
|
import { styleText as st } from 'node:util';
|
|
4
4
|
import { git_check_clean_workspace } from '@ryanatkn/belt/git.js';
|
|
5
|
-
import {
|
|
5
|
+
import { TaskError } from "./task.js";
|
|
6
6
|
import { sync_package_json } from "./package_json.js";
|
|
7
7
|
/** @nodocs */
|
|
8
8
|
export const Args = z.strictObject({
|
|
@@ -56,7 +56,7 @@ export const task = {
|
|
|
56
56
|
if (package_json && config.map_package_json) {
|
|
57
57
|
const { changed } = await sync_package_json(config.map_package_json, log, false);
|
|
58
58
|
if (changed) {
|
|
59
|
-
throw new
|
|
59
|
+
throw new TaskError('package.json is out of date, run `gro sync` to update it');
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
62
|
log.info('check passed for package.json');
|
|
@@ -76,7 +76,7 @@ export const task = {
|
|
|
76
76
|
if (error_message) {
|
|
77
77
|
log.error(st('red', 'git status'));
|
|
78
78
|
await spawn('git', ['status']);
|
|
79
|
-
throw new
|
|
79
|
+
throw new TaskError('Failed check for git_check_clean_workspace:' +
|
|
80
80
|
error_message +
|
|
81
81
|
' - do you need to run `gro sync` or commit some files?');
|
|
82
82
|
}
|
package/dist/clean.task.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from '@ryanatkn/belt/process.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
3
|
+
import { GitOrigin } from '@ryanatkn/belt/git.js';
|
|
4
4
|
import { clean_fs } from "./clean_fs.js";
|
|
5
5
|
/** @nodocs */
|
|
6
6
|
export const Args = z.strictObject({
|
|
@@ -17,7 +17,7 @@ export const Args = z.strictObject({
|
|
|
17
17
|
description: 'run "git remote prune" to delete local branches referencing nonexistent remote branches',
|
|
18
18
|
})
|
|
19
19
|
.default(false),
|
|
20
|
-
git_origin:
|
|
20
|
+
git_origin: GitOrigin.describe('the origin to "git remote prune"').default('origin'),
|
|
21
21
|
});
|
|
22
22
|
/** @nodocs */
|
|
23
23
|
export const task = {
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type SpawnOptions } from 'node:child_process';
|
|
2
|
-
import { type
|
|
2
|
+
import { type SpawnResult, type SpawnedProcess } from '@ryanatkn/belt/process.js';
|
|
3
3
|
import { type URL } from 'node:url';
|
|
4
4
|
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { PathId } from '@ryanatkn/belt/path.js';
|
|
6
6
|
export type Cli = {
|
|
7
7
|
kind: 'local';
|
|
8
8
|
name: string;
|
|
9
|
-
id:
|
|
9
|
+
id: PathId;
|
|
10
10
|
} | {
|
|
11
11
|
kind: 'global';
|
|
12
12
|
name: string;
|
|
13
|
-
id:
|
|
13
|
+
id: PathId;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Searches the filesystem for the CLI `name`, first local to the cwd and then globally.
|
|
@@ -22,13 +22,13 @@ export declare const find_cli: (name: string, cwd?: string | URL, options?: Spaw
|
|
|
22
22
|
* If a string is provided for `name_or_cli`, it checks first local to the cwd and then globally.
|
|
23
23
|
* @returns `undefined` if no CLI is found, or the spawn result
|
|
24
24
|
*/
|
|
25
|
-
export declare const spawn_cli: (name_or_cli: string | Cli, args?: Array<string>, log?: Logger, options?: SpawnOptions) => Promise<
|
|
25
|
+
export declare const spawn_cli: (name_or_cli: string | Cli, args?: Array<string>, log?: Logger, options?: SpawnOptions) => Promise<SpawnResult | undefined>;
|
|
26
26
|
/**
|
|
27
27
|
* Spawns a CLI if available using Belt's `spawn_process`.
|
|
28
28
|
* If a string is provided for `name_or_cli`, it checks first local to the cwd and then globally.
|
|
29
29
|
* @returns `undefined` if no CLI is found, or the spawn result
|
|
30
30
|
*/
|
|
31
|
-
export declare const spawn_cli_process: (name_or_cli: string | Cli, args?: Array<string>, log?: Logger, options?: SpawnOptions) =>
|
|
31
|
+
export declare const spawn_cli_process: (name_or_cli: string | Cli, args?: Array<string>, log?: Logger, options?: SpawnOptions) => SpawnedProcess | undefined;
|
|
32
32
|
export declare const resolve_cli: (name_or_cli: string | Cli, args: Array<string> | undefined, cwd: string | URL | undefined, log?: Logger, options?: SpawnOptions) => Cli | undefined;
|
|
33
33
|
export declare const to_cli_name: (cli: string | Cli) => string;
|
|
34
34
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAGN,KAAK,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAGN,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAgB,KAAK,GAAG,EAAC,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAOnD,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,GAAG,GAAG,IAUR,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,cAAc,GAAG,SAInB,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,GAAG,GAAG,SAaR,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,GAAG,GAAG,KAAG,MACP,CAAC"}
|
package/dist/commit.task.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from '@ryanatkn/belt/process.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
3
|
+
import { GitOrigin, git_current_branch_name, git_push } from '@ryanatkn/belt/git.js';
|
|
4
4
|
/** @nodocs */
|
|
5
5
|
export const Args = z.strictObject({
|
|
6
6
|
_: z
|
|
@@ -9,7 +9,7 @@ export const Args = z.strictObject({
|
|
|
9
9
|
description: 'the git commit message, the same as git commit -m or --message',
|
|
10
10
|
})
|
|
11
11
|
.default([]),
|
|
12
|
-
origin:
|
|
12
|
+
origin: GitOrigin.describe('git origin to commit to').default('origin'),
|
|
13
13
|
});
|
|
14
14
|
/** @nodocs */
|
|
15
15
|
export const task = {
|
|
@@ -1 +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;AAsBtB,OAAO,
|
|
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;AAsBtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAiB/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;;;;;;kBAiCf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA6L3B,CAAC"}
|
package/dist/deploy.task.js
CHANGED
|
@@ -5,9 +5,9 @@ import { z } from 'zod';
|
|
|
5
5
|
import { cp, mkdir, rm } from 'node:fs/promises';
|
|
6
6
|
import { join, resolve } from 'node:path';
|
|
7
7
|
import { existsSync, readdirSync } from 'node:fs';
|
|
8
|
-
import { git_check_clean_workspace, git_checkout, git_local_branch_exists, git_remote_branch_exists,
|
|
8
|
+
import { git_check_clean_workspace, git_checkout, git_local_branch_exists, git_remote_branch_exists, GitOrigin, GitBranch, git_delete_local_branch, git_push_to_create, git_reset_branch_to_first_commit, git_pull, git_fetch, git_check_setting_pull_rebase, git_clone_locally, git_current_branch_name, } from '@ryanatkn/belt/git.js';
|
|
9
9
|
import { fs_empty_dir } from '@ryanatkn/belt/fs.js';
|
|
10
|
-
import {
|
|
10
|
+
import { TaskError } from "./task.js";
|
|
11
11
|
import { print_path } from "./paths.js";
|
|
12
12
|
import { GRO_DIRNAME, GIT_DIRNAME, SVELTEKIT_BUILD_DIRNAME } from "./constants.js";
|
|
13
13
|
// docs at ../docs/deploy.md
|
|
@@ -22,9 +22,9 @@ const TARGET_BRANCH = 'deploy';
|
|
|
22
22
|
const DANGEROUS_BRANCHES = [SOURCE_BRANCH, 'master'];
|
|
23
23
|
/** @nodocs */
|
|
24
24
|
export const Args = z.strictObject({
|
|
25
|
-
source:
|
|
26
|
-
target:
|
|
27
|
-
origin:
|
|
25
|
+
source: GitBranch.describe('git source branch to build and deploy from').default(SOURCE_BRANCH),
|
|
26
|
+
target: GitBranch.describe('git target branch to deploy to').default(TARGET_BRANCH),
|
|
27
|
+
origin: GitOrigin.describe('git origin to deploy to').default('origin'),
|
|
28
28
|
deploy_dir: z.string().meta({ description: 'the deploy output directory' }).default(DEPLOY_DIR),
|
|
29
29
|
build_dir: z
|
|
30
30
|
.string()
|
|
@@ -63,24 +63,24 @@ export const task = {
|
|
|
63
63
|
const { source, target, origin, build_dir, deploy_dir, dry, force, dangerous, reset, build, pull, } = args;
|
|
64
64
|
// Checks
|
|
65
65
|
if (!force && target !== TARGET_BRANCH) {
|
|
66
|
-
throw new
|
|
66
|
+
throw new TaskError(`Warning! You are deploying to a custom target branch '${target}',` +
|
|
67
67
|
` instead of the default '${TARGET_BRANCH}' branch.` +
|
|
68
68
|
` This is destructive to your '${target}' branch!` +
|
|
69
69
|
` If you understand and are OK with deleting your branch '${target}',` +
|
|
70
70
|
` both locally and remotely, pass --force to suppress this error.`);
|
|
71
71
|
}
|
|
72
72
|
if (!dangerous && DANGEROUS_BRANCHES.includes(target)) {
|
|
73
|
-
throw new
|
|
73
|
+
throw new TaskError(`Warning! You are deploying to a custom target branch '${target}'` +
|
|
74
74
|
` and that appears very dangerous: it is destructive to your '${target}' branch!` +
|
|
75
75
|
` If you understand and are OK with deleting your branch '${target}',` +
|
|
76
76
|
` both locally and remotely, pass --dangerous to suppress this error.`);
|
|
77
77
|
}
|
|
78
78
|
const clean_error_message = await git_check_clean_workspace();
|
|
79
79
|
if (clean_error_message) {
|
|
80
|
-
throw new
|
|
80
|
+
throw new TaskError('Deploy failed because the git workspace has uncommitted changes: ' + clean_error_message);
|
|
81
81
|
}
|
|
82
82
|
if (!(await git_check_setting_pull_rebase())) {
|
|
83
|
-
throw new
|
|
83
|
+
throw new TaskError('Deploying currently requires `git config --global pull.rebase true`,' +
|
|
84
84
|
' but this restriction could be lifted with more work');
|
|
85
85
|
}
|
|
86
86
|
// Fetch the source branch in the cwd if it's not there
|
|
@@ -93,7 +93,7 @@ export const task = {
|
|
|
93
93
|
await git_pull(origin, source);
|
|
94
94
|
}
|
|
95
95
|
if (await git_check_clean_workspace()) {
|
|
96
|
-
throw new
|
|
96
|
+
throw new TaskError('Deploy failed because the local source branch is out of sync with the remote one,' +
|
|
97
97
|
' finish rebasing manually or reset with `git rebase --abort`');
|
|
98
98
|
}
|
|
99
99
|
// Prepare the target branch remotely and locally
|
|
@@ -176,11 +176,11 @@ export const task = {
|
|
|
176
176
|
if (dry) {
|
|
177
177
|
log.info(st('red', 'dry deploy failed'));
|
|
178
178
|
}
|
|
179
|
-
throw new
|
|
179
|
+
throw new TaskError(`Deploy safely canceled due to build failure. See the error above.`);
|
|
180
180
|
}
|
|
181
181
|
// Verify build output exists
|
|
182
182
|
if (!existsSync(build_dir)) {
|
|
183
|
-
throw new
|
|
183
|
+
throw new TaskError(`Directory to deploy does not exist after building: ${build_dir}`);
|
|
184
184
|
}
|
|
185
185
|
// Copy the build
|
|
186
186
|
await Promise.all(readdirSync(build_dir).map((path) => cp(join(build_dir, path), join(resolved_deploy_dir, path), { recursive: true })));
|
|
@@ -197,7 +197,7 @@ export const task = {
|
|
|
197
197
|
}
|
|
198
198
|
catch (err) {
|
|
199
199
|
log.error(st('red', 'updating git failed:'), print_error(err));
|
|
200
|
-
throw new
|
|
200
|
+
throw new TaskError(`Deploy failed in a bad state: built but not pushed, see error above.`);
|
|
201
201
|
}
|
|
202
202
|
log.info(st('green', 'deployed')); // TODO log a different message if "Everything up-to-date"
|
|
203
203
|
},
|
package/dist/dev.task.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { Task } from './task.ts';
|
|
3
|
-
import { type
|
|
3
|
+
import { type PluginContext } from './plugin.ts';
|
|
4
4
|
/** @nodocs */
|
|
5
5
|
export declare const Args: z.ZodObject<{
|
|
6
6
|
watch: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -10,7 +10,7 @@ export declare const Args: z.ZodObject<{
|
|
|
10
10
|
install: z.ZodDefault<z.ZodBoolean>;
|
|
11
11
|
}, z.core.$strict>;
|
|
12
12
|
export type Args = z.infer<typeof Args>;
|
|
13
|
-
export type DevTask_Context =
|
|
13
|
+
export type DevTask_Context = PluginContext<Args>;
|
|
14
14
|
/** @nodocs */
|
|
15
15
|
export declare const task: Task<Args>;
|
|
16
16
|
//# sourceMappingURL=dev.task.d.ts.map
|
package/dist/dev.task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/dev.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AACpC,OAAO,EAAU,KAAK,
|
|
1
|
+
{"version":3,"file":"dev.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/dev.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AACpC,OAAO,EAAU,KAAK,aAAa,EAAC,MAAM,aAAa,CAAC;AAGxD,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;kBAWf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;AAElD,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA2B3B,CAAC"}
|
package/dist/disknode.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PathId } from '@ryanatkn/belt/path.js';
|
|
2
2
|
export interface Disknode {
|
|
3
|
-
id:
|
|
3
|
+
id: PathId;
|
|
4
4
|
/**
|
|
5
5
|
* `null` contents means it doesn't exist.
|
|
6
6
|
* We create the file in memory to track its dependents regardless of its existence on disk.
|
|
@@ -12,7 +12,7 @@ export interface Disknode {
|
|
|
12
12
|
external: boolean;
|
|
13
13
|
ctime: number | null;
|
|
14
14
|
mtime: number | null;
|
|
15
|
-
dependents: Map<
|
|
16
|
-
dependencies: Map<
|
|
15
|
+
dependents: Map<PathId, Disknode>;
|
|
16
|
+
dependencies: Map<PathId, Disknode>;
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=disknode.d.ts.map
|
package/dist/disknode.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disknode.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/disknode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"disknode.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/disknode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAInD,MAAM,WAAW,QAAQ;IACxB,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACpC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
2
2
|
import type * as esbuild from 'esbuild';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ParsedSvelteConfig } from './svelte_config.ts';
|
|
4
4
|
export declare const print_build_result: (log: Logger, build_result: esbuild.BuildResult) => void;
|
|
5
5
|
/**
|
|
6
6
|
* Creates an esbuild `define` shim for Vite's `import.meta\.env`.
|
|
@@ -11,6 +11,6 @@ export declare const print_build_result: (log: Logger, build_result: esbuild.Bui
|
|
|
11
11
|
* @param mode
|
|
12
12
|
* @returns
|
|
13
13
|
*/
|
|
14
|
-
export declare const to_define_import_meta_env: (dev: boolean, base_url:
|
|
14
|
+
export declare const to_define_import_meta_env: (dev: boolean, base_url: ParsedSvelteConfig["base_url"], ssr?: boolean, mode?: string) => Record<string, string>;
|
|
15
15
|
export declare const default_ts_transform_options: esbuild.TransformOptions;
|
|
16
16
|
//# sourceMappingURL=esbuild_helpers.d.ts.map
|