@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {EMPTY_OBJECT} from '@ryanatkn/belt/object.js';
|
|
2
2
|
import {throttle} from '@ryanatkn/belt/throttle.js';
|
|
3
|
-
import {
|
|
3
|
+
import {UnreachableError} from '@ryanatkn/belt/error.js';
|
|
4
4
|
|
|
5
5
|
import type {Plugin} from './plugin.ts';
|
|
6
6
|
import type {Args} from './args.ts';
|
|
@@ -16,11 +16,11 @@ const FLUSH_DEBOUNCE_DELAY = 500;
|
|
|
16
16
|
// await invoke_task('gen', {_: files, bust_cache: true});
|
|
17
17
|
const gen = (files: Array<string> = []) => spawn_cli('gro', ['gen', ...files]);
|
|
18
18
|
|
|
19
|
-
export interface
|
|
19
|
+
export interface TaskArgs extends Args {
|
|
20
20
|
watch?: boolean;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export interface
|
|
23
|
+
export interface GroPluginGenOptions {
|
|
24
24
|
input_paths?: Array<string>;
|
|
25
25
|
root_dirs?: Array<string>;
|
|
26
26
|
flush_debounce_delay?: number;
|
|
@@ -30,7 +30,7 @@ export const gro_plugin_gen = ({
|
|
|
30
30
|
input_paths = [paths.source],
|
|
31
31
|
root_dirs = [paths.source],
|
|
32
32
|
flush_debounce_delay = FLUSH_DEBOUNCE_DELAY,
|
|
33
|
-
}:
|
|
33
|
+
}: GroPluginGenOptions = EMPTY_OBJECT): Plugin => {
|
|
34
34
|
const queued_files: Set<string> = new Set();
|
|
35
35
|
|
|
36
36
|
let cleanup_watch: (() => void) | undefined;
|
|
@@ -135,7 +135,7 @@ export const gro_plugin_gen = ({
|
|
|
135
135
|
break;
|
|
136
136
|
}
|
|
137
137
|
default:
|
|
138
|
-
throw new
|
|
138
|
+
throw new UnreachableError(change.type);
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {spawn_restartable_process, type
|
|
1
|
+
import {spawn_restartable_process, type RestartableProcess} from '@ryanatkn/belt/process.js';
|
|
2
2
|
import * as esbuild from 'esbuild';
|
|
3
3
|
import type {Config as SvelteConfig} from '@sveltejs/kit';
|
|
4
4
|
import {join, resolve} from 'node:path';
|
|
@@ -7,7 +7,7 @@ import {strip_before, strip_end} from '@ryanatkn/belt/string.js';
|
|
|
7
7
|
import type {Result} from '@ryanatkn/belt/result.js';
|
|
8
8
|
import {fs_exists} from '@ryanatkn/belt/fs.js';
|
|
9
9
|
import {throttle} from '@ryanatkn/belt/throttle.js';
|
|
10
|
-
import type {
|
|
10
|
+
import type {PathId} from '@ryanatkn/belt/path.js';
|
|
11
11
|
|
|
12
12
|
import type {Plugin} from './plugin.ts';
|
|
13
13
|
import {base_path_to_path_id, LIB_DIRNAME, paths} from './paths.ts';
|
|
@@ -34,7 +34,7 @@ export const has_server = async (
|
|
|
34
34
|
return {ok: true};
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
export interface
|
|
37
|
+
export interface GroPluginServerOptions {
|
|
38
38
|
/**
|
|
39
39
|
* same as esbuild's `entryPoints`
|
|
40
40
|
*/
|
|
@@ -48,7 +48,7 @@ export interface Gro_Plugin_Server_Options {
|
|
|
48
48
|
* Decoupling this from plugin creation allows it to be created generically,
|
|
49
49
|
* so the build and dev tasks can be the source of truth for `dev`.
|
|
50
50
|
*/
|
|
51
|
-
outpaths?:
|
|
51
|
+
outpaths?: CreateOutpaths;
|
|
52
52
|
/**
|
|
53
53
|
* @default ```SvelteKit's `.env`, `.env.development`, and `.env.production````
|
|
54
54
|
*/
|
|
@@ -104,7 +104,7 @@ export interface Outpaths {
|
|
|
104
104
|
outname: string;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
export type
|
|
107
|
+
export type CreateOutpaths = (dev: boolean) => Outpaths;
|
|
108
108
|
|
|
109
109
|
export const gro_plugin_server = ({
|
|
110
110
|
entry_points = [SERVER_SOURCE_ID],
|
|
@@ -122,11 +122,11 @@ export const gro_plugin_server = ({
|
|
|
122
122
|
rebuild_throttle_delay = 1000,
|
|
123
123
|
cli_command,
|
|
124
124
|
run, // `dev` default is not available in this scope
|
|
125
|
-
}:
|
|
125
|
+
}: GroPluginServerOptions = {}): Plugin => {
|
|
126
126
|
let build_ctx: esbuild.BuildContext | undefined;
|
|
127
127
|
let cleanup_watch: (() => void) | undefined;
|
|
128
|
-
let server_process:
|
|
129
|
-
let deps: Set<
|
|
128
|
+
let server_process: RestartableProcess | undefined;
|
|
129
|
+
let deps: Set<PathId> | undefined;
|
|
130
130
|
|
|
131
131
|
return {
|
|
132
132
|
name: 'gro_plugin_server',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {SpawnedProcess} from '@ryanatkn/belt/process.js';
|
|
2
2
|
import {cpSync, mkdirSync, rmSync, writeFileSync, existsSync} from 'node:fs';
|
|
3
3
|
import {dirname, join} from 'node:path';
|
|
4
4
|
|
|
@@ -6,49 +6,49 @@ import type {Plugin} from './plugin.ts';
|
|
|
6
6
|
import {serialize_args, to_forwarded_args} from './args.ts';
|
|
7
7
|
import {
|
|
8
8
|
serialize_package_json,
|
|
9
|
-
type
|
|
9
|
+
type PackageJsonMapper,
|
|
10
10
|
load_package_json,
|
|
11
11
|
} from './package_json.ts';
|
|
12
|
-
import {
|
|
12
|
+
import {TaskError} from './task.ts';
|
|
13
13
|
import {find_cli, spawn_cli, spawn_cli_process} from './cli.ts';
|
|
14
|
-
import {type
|
|
14
|
+
import {type SrcJsonMapper, src_json_serialize, src_json_create} from './src_json.ts';
|
|
15
15
|
import {EXPORTS_EXCLUDER_DEFAULT} from './gro_config.ts';
|
|
16
16
|
import {default_svelte_config} from './svelte_config.ts';
|
|
17
17
|
import {SOURCE_DIRNAME, VITE_CLI} from './constants.ts';
|
|
18
18
|
|
|
19
|
-
export interface
|
|
19
|
+
export interface GroPluginSveltekitAppOptions {
|
|
20
20
|
/**
|
|
21
21
|
* Used for finalizing a SvelteKit build like adding a `.nojekyll` file for GitHub Pages.
|
|
22
22
|
* @default 'github_pages'
|
|
23
23
|
*/
|
|
24
|
-
host_target?:
|
|
24
|
+
host_target?: HostTarget;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* If truthy, adds `/.well-known/package.json` to the static output.
|
|
28
28
|
* If a function, maps the value.
|
|
29
29
|
*/
|
|
30
|
-
well_known_package_json?: boolean |
|
|
30
|
+
well_known_package_json?: boolean | PackageJsonMapper;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* If truthy, adds `/.well-known/src.json` and `/.well-known/src/` to the static output.
|
|
34
34
|
* If a function, maps the value.
|
|
35
35
|
*/
|
|
36
|
-
well_known_src_json?: boolean |
|
|
36
|
+
well_known_src_json?: boolean | SrcJsonMapper;
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* If truthy, copies `src/` to `/.well-known/src/` to the static output.
|
|
40
40
|
* Pass a function to customize which files get copied.
|
|
41
41
|
*/
|
|
42
|
-
well_known_src_files?: boolean |
|
|
42
|
+
well_known_src_files?: boolean | CopyFileFilter;
|
|
43
43
|
/**
|
|
44
44
|
* The Vite CLI to use.
|
|
45
45
|
*/
|
|
46
46
|
vite_cli?: string;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export type
|
|
49
|
+
export type HostTarget = 'github_pages' | 'static' | 'node';
|
|
50
50
|
|
|
51
|
-
export type
|
|
51
|
+
export type CopyFileFilter = (file_path: string) => boolean;
|
|
52
52
|
|
|
53
53
|
export const gro_plugin_sveltekit_app = ({
|
|
54
54
|
host_target = 'github_pages',
|
|
@@ -56,8 +56,8 @@ export const gro_plugin_sveltekit_app = ({
|
|
|
56
56
|
well_known_src_json,
|
|
57
57
|
well_known_src_files,
|
|
58
58
|
vite_cli = VITE_CLI,
|
|
59
|
-
}:
|
|
60
|
-
let sveltekit_process:
|
|
59
|
+
}: GroPluginSveltekitAppOptions = {}): Plugin => {
|
|
60
|
+
let sveltekit_process: SpawnedProcess | undefined = undefined;
|
|
61
61
|
return {
|
|
62
62
|
name: 'gro_plugin_sveltekit_app',
|
|
63
63
|
setup: async ({dev, watch, log, config}) => {
|
|
@@ -149,7 +149,7 @@ export const gro_plugin_sveltekit_app = ({
|
|
|
149
149
|
const serialized_args = ['build', ...serialize_args(to_forwarded_args(vite_cli))];
|
|
150
150
|
const spawned = await spawn_cli(found_vite_cli, serialized_args, log);
|
|
151
151
|
if (!spawned?.ok) {
|
|
152
|
-
throw new
|
|
152
|
+
throw new TaskError(`${vite_cli} build failed with exit code ${spawned?.code}`);
|
|
153
153
|
}
|
|
154
154
|
} catch (err) {
|
|
155
155
|
cleanup();
|
|
@@ -175,7 +175,7 @@ const copy_temporarily = (
|
|
|
175
175
|
source_path: string,
|
|
176
176
|
dest_dir: string,
|
|
177
177
|
dest_base_dir = '',
|
|
178
|
-
filter?:
|
|
178
|
+
filter?: CopyFileFilter,
|
|
179
179
|
): Cleanup => {
|
|
180
180
|
const path = join(dest_dir, dest_base_dir, source_path);
|
|
181
181
|
const dir = dirname(path);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {print_spawn_result, spawn} from '@ryanatkn/belt/process.js';
|
|
2
2
|
|
|
3
3
|
import type {Plugin} from './plugin.ts';
|
|
4
|
-
import {
|
|
4
|
+
import {TaskError} from './task.ts';
|
|
5
5
|
import {load_package_json} from './package_json.ts';
|
|
6
|
-
import {run_svelte_package, type
|
|
6
|
+
import {run_svelte_package, type SveltePackageOptions} from './sveltekit_helpers.ts';
|
|
7
7
|
import {SVELTE_PACKAGE_CLI} from './constants.ts';
|
|
8
8
|
|
|
9
|
-
export interface
|
|
9
|
+
export interface GroPluginSveltekitLibraryOptions {
|
|
10
10
|
/**
|
|
11
11
|
* The options passed to the SvelteKit packaging CLI.
|
|
12
12
|
* @see https://kit.svelte.dev/docs/packaging#options
|
|
13
13
|
*/
|
|
14
|
-
svelte_package_options?:
|
|
14
|
+
svelte_package_options?: SveltePackageOptions;
|
|
15
15
|
/**
|
|
16
16
|
* The SvelteKit packaging CLI to use. Defaults to `svelte-package`.
|
|
17
17
|
* @see https://kit.svelte.dev/docs/packaging
|
|
@@ -22,7 +22,7 @@ export interface Gro_Plugin_Sveltekit_Library_Options {
|
|
|
22
22
|
export const gro_plugin_sveltekit_library = ({
|
|
23
23
|
svelte_package_options,
|
|
24
24
|
svelte_package_cli = SVELTE_PACKAGE_CLI,
|
|
25
|
-
}:
|
|
25
|
+
}: GroPluginSveltekitLibraryOptions = {}): Plugin => {
|
|
26
26
|
const package_json = load_package_json();
|
|
27
27
|
|
|
28
28
|
return {
|
|
@@ -52,7 +52,7 @@ export const gro_plugin_sveltekit_library = ({
|
|
|
52
52
|
log.info(`linking`);
|
|
53
53
|
const link_result = await spawn(config.pm_cli, ['link', '-f']); // TODO don't use `-f` unless necessary or at all?
|
|
54
54
|
if (!link_result.ok) {
|
|
55
|
-
throw new
|
|
55
|
+
throw new TaskError(`Failed to link. ${print_spawn_result(link_result)}`);
|
|
56
56
|
}
|
|
57
57
|
timing_to_link();
|
|
58
58
|
}
|
package/src/lib/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @nodocs */
|
|
2
|
-
export type {
|
|
2
|
+
export type {GroConfig, CreateGroConfig, RawGroConfig} from './gro_config.ts';
|
|
3
3
|
/** @nodocs */
|
|
4
4
|
export {type Plugin, replace_plugin} from './plugin.ts';
|
|
5
5
|
/** @nodocs */
|
|
6
|
-
export type {Gen,
|
|
6
|
+
export type {Gen, GenContext} from './gen.ts';
|
|
7
7
|
/** @nodocs */
|
|
8
|
-
export {type Task, type
|
|
8
|
+
export {type Task, type TaskContext, TaskError} from './task.ts';
|
package/src/lib/input_path.ts
CHANGED
|
@@ -3,18 +3,18 @@ import {existsSync, statSync} from 'node:fs';
|
|
|
3
3
|
import {strip_start} from '@ryanatkn/belt/string.js';
|
|
4
4
|
import {z} from 'zod';
|
|
5
5
|
import type {Flavored} from '@ryanatkn/belt/types.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type {PathInfo, PathId, ResolvedPath} from '@ryanatkn/belt/path.js';
|
|
7
7
|
|
|
8
8
|
import {GRO_PACKAGE_DIR, GRO_DIST_DIR} from './paths.ts';
|
|
9
9
|
import {search_fs} from './search_fs.ts';
|
|
10
10
|
import {TASK_FILE_SUFFIX_JS} from './task.ts';
|
|
11
11
|
|
|
12
12
|
// TODO Flavored doesn't work when used in schemas, use Zod brand instead? problem is ergonomics
|
|
13
|
-
export const
|
|
14
|
-
export type
|
|
13
|
+
export const InputPath = z.string();
|
|
14
|
+
export type InputPath = Flavored<z.infer<typeof InputPath>, 'InputPath'>;
|
|
15
15
|
|
|
16
|
-
export const
|
|
17
|
-
export type
|
|
16
|
+
export const RawInputPath = z.string();
|
|
17
|
+
export type RawInputPath = Flavored<z.infer<typeof RawInputPath>, 'RawInputPath'>;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Raw input paths are paths that users provide to Gro to reference files for tasks and gen.
|
|
@@ -29,26 +29,26 @@ export type Raw_Input_Path = Flavored<z.infer<typeof Raw_Input_Path>, 'Raw_Input
|
|
|
29
29
|
* Thus, input paths are either absolute or implicitly relative.
|
|
30
30
|
*/
|
|
31
31
|
export const to_input_path = (
|
|
32
|
-
raw_input_path:
|
|
32
|
+
raw_input_path: RawInputPath,
|
|
33
33
|
root_path = process.cwd(), // TODO @many isn't passed in anywhere, maybe hoist to `invoke_task` and others
|
|
34
|
-
):
|
|
34
|
+
): InputPath => {
|
|
35
35
|
if (raw_input_path.startsWith(GRO_PACKAGE_DIR)) {
|
|
36
36
|
return GRO_DIST_DIR + strip_start(raw_input_path, GRO_PACKAGE_DIR);
|
|
37
37
|
} else if (raw_input_path[0] === '.') {
|
|
38
38
|
return resolve(root_path, raw_input_path);
|
|
39
39
|
}
|
|
40
|
-
return raw_input_path as
|
|
40
|
+
return raw_input_path as InputPath;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
export const to_input_paths = (
|
|
44
|
-
raw_input_paths: Array<
|
|
44
|
+
raw_input_paths: Array<RawInputPath>,
|
|
45
45
|
root_path?: string, // TODO @many isn't passed in anywhere, maybe hoist to `invoke_task` and others
|
|
46
|
-
): Array<
|
|
46
|
+
): Array<InputPath> => raw_input_paths.map((p) => to_input_path(p, root_path));
|
|
47
47
|
|
|
48
|
-
export interface
|
|
49
|
-
id:
|
|
50
|
-
input_path:
|
|
51
|
-
root_dir:
|
|
48
|
+
export interface PossiblePath {
|
|
49
|
+
id: PathId;
|
|
50
|
+
input_path: InputPath;
|
|
51
|
+
root_dir: PathId;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
@@ -56,24 +56,24 @@ export interface Possible_Path {
|
|
|
56
56
|
* duplicating each under `root_dirs`, without checking the filesystem.
|
|
57
57
|
*/
|
|
58
58
|
export const get_possible_paths = (
|
|
59
|
-
input_path:
|
|
60
|
-
root_dirs: Array<
|
|
59
|
+
input_path: InputPath,
|
|
60
|
+
root_dirs: Array<PathId>,
|
|
61
61
|
extensions: Array<string>,
|
|
62
|
-
): Array<
|
|
63
|
-
const possible_paths: Set<
|
|
62
|
+
): Array<PossiblePath> => {
|
|
63
|
+
const possible_paths: Set<PossiblePath> = new Set();
|
|
64
64
|
|
|
65
|
-
const add_possible_paths = (path: string, root_dir:
|
|
65
|
+
const add_possible_paths = (path: string, root_dir: PathId) => {
|
|
66
66
|
// Specifically for paths to the Gro package dist, optimize by only looking for `.task.js`.
|
|
67
67
|
if (path.startsWith(GRO_DIST_DIR)) {
|
|
68
68
|
possible_paths.add({
|
|
69
69
|
id: (path.endsWith('/') || path.endsWith(TASK_FILE_SUFFIX_JS)
|
|
70
70
|
? path
|
|
71
|
-
: path + TASK_FILE_SUFFIX_JS) as
|
|
71
|
+
: path + TASK_FILE_SUFFIX_JS) as PathId,
|
|
72
72
|
input_path,
|
|
73
73
|
root_dir,
|
|
74
74
|
});
|
|
75
75
|
} else {
|
|
76
|
-
possible_paths.add({id: path as
|
|
76
|
+
possible_paths.add({id: path as PathId, input_path, root_dir});
|
|
77
77
|
if (!path.endsWith('/') && !extensions.some((e) => path.endsWith(e))) {
|
|
78
78
|
for (const extension of extensions) {
|
|
79
79
|
possible_paths.add({id: path + extension, input_path, root_dir});
|
|
@@ -99,23 +99,23 @@ export const get_possible_paths = (
|
|
|
99
99
|
return Array.from(possible_paths);
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
export interface
|
|
103
|
-
input_path:
|
|
104
|
-
id:
|
|
102
|
+
export interface ResolvedInputPath {
|
|
103
|
+
input_path: InputPath;
|
|
104
|
+
id: PathId;
|
|
105
105
|
is_directory: boolean;
|
|
106
|
-
root_dir:
|
|
106
|
+
root_dir: PathId;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
export interface
|
|
110
|
-
id:
|
|
111
|
-
input_path:
|
|
112
|
-
resolved_input_path:
|
|
109
|
+
export interface ResolvedInputFile {
|
|
110
|
+
id: PathId;
|
|
111
|
+
input_path: InputPath;
|
|
112
|
+
resolved_input_path: ResolvedInputPath;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
export interface
|
|
116
|
-
resolved_input_paths: Array<
|
|
117
|
-
possible_paths_by_input_path: Map<
|
|
118
|
-
unmapped_input_paths: Array<
|
|
115
|
+
export interface ResolvedInputPaths {
|
|
116
|
+
resolved_input_paths: Array<ResolvedInputPath>;
|
|
117
|
+
possible_paths_by_input_path: Map<InputPath, Array<PossiblePath>>;
|
|
118
|
+
unmapped_input_paths: Array<InputPath>;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/**
|
|
@@ -124,16 +124,16 @@ export interface Resolved_Input_Paths {
|
|
|
124
124
|
* If none is found for an input path, it's added to `unmapped_input_paths`.
|
|
125
125
|
*/
|
|
126
126
|
export const resolve_input_paths = (
|
|
127
|
-
input_paths: Array<
|
|
128
|
-
root_dirs: Array<
|
|
127
|
+
input_paths: Array<InputPath>,
|
|
128
|
+
root_dirs: Array<PathId>,
|
|
129
129
|
extensions: Array<string>,
|
|
130
|
-
):
|
|
131
|
-
const resolved_input_paths: Array<
|
|
132
|
-
const possible_paths_by_input_path: Map<
|
|
133
|
-
const unmapped_input_paths: Array<
|
|
130
|
+
): ResolvedInputPaths => {
|
|
131
|
+
const resolved_input_paths: Array<ResolvedInputPath> = [];
|
|
132
|
+
const possible_paths_by_input_path: Map<InputPath, Array<PossiblePath>> = new Map();
|
|
133
|
+
const unmapped_input_paths: Array<InputPath> = [];
|
|
134
134
|
for (const input_path of input_paths) {
|
|
135
|
-
let found_file: [
|
|
136
|
-
let found_dirs: Array<[
|
|
135
|
+
let found_file: [PathInfo, PossiblePath] | null = null;
|
|
136
|
+
let found_dirs: Array<[PathInfo, PossiblePath]> | null = null;
|
|
137
137
|
const possible_paths = get_possible_paths(input_path, root_dirs, extensions);
|
|
138
138
|
possible_paths_by_input_path.set(input_path, possible_paths);
|
|
139
139
|
|
|
@@ -176,10 +176,10 @@ export const resolve_input_paths = (
|
|
|
176
176
|
};
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
-
export interface
|
|
180
|
-
resolved_input_files: Array<
|
|
181
|
-
resolved_input_files_by_root_dir: Map<
|
|
182
|
-
input_directories_with_no_files: Array<
|
|
179
|
+
export interface ResolvedInputFiles {
|
|
180
|
+
resolved_input_files: Array<ResolvedInputFile>;
|
|
181
|
+
resolved_input_files_by_root_dir: Map<PathId, Array<ResolvedInputFile>>;
|
|
182
|
+
input_directories_with_no_files: Array<InputPath>;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
/**
|
|
@@ -187,15 +187,15 @@ export interface Resolved_Input_Files {
|
|
|
187
187
|
* De-dupes source ids.
|
|
188
188
|
*/
|
|
189
189
|
export const resolve_input_files = (
|
|
190
|
-
resolved_input_paths: Array<
|
|
191
|
-
search: (dir: string) => Array<
|
|
192
|
-
):
|
|
193
|
-
const resolved_input_files: Array<
|
|
190
|
+
resolved_input_paths: Array<ResolvedInputPath>,
|
|
191
|
+
search: (dir: string) => Array<ResolvedPath> = search_fs,
|
|
192
|
+
): ResolvedInputFiles => {
|
|
193
|
+
const resolved_input_files: Array<ResolvedInputFile> = [];
|
|
194
194
|
// Add all input paths initially, and remove each when resolved to a file.
|
|
195
|
-
const existing_path_ids: Set<
|
|
195
|
+
const existing_path_ids: Set<PathId> = new Set();
|
|
196
196
|
|
|
197
197
|
let remaining = resolved_input_paths.slice();
|
|
198
|
-
const handle_found = (input_path:
|
|
198
|
+
const handle_found = (input_path: InputPath, id: PathId) => {
|
|
199
199
|
remaining = remaining.filter(
|
|
200
200
|
(r) => !(r.id === id || r.input_path === input_path || r.input_path === id), // `r.input_path === id` may be unnecessary
|
|
201
201
|
);
|
|
@@ -208,7 +208,7 @@ export const resolve_input_files = (
|
|
|
208
208
|
// Handle input paths that resolve to directories.
|
|
209
209
|
const files = search(id);
|
|
210
210
|
if (!files.length) continue;
|
|
211
|
-
const path_ids: Array<
|
|
211
|
+
const path_ids: Array<PathId> = [];
|
|
212
212
|
for (const {path, is_directory} of files) {
|
|
213
213
|
if (is_directory) continue;
|
|
214
214
|
const path_id = join(id, path);
|
|
@@ -219,9 +219,9 @@ export const resolve_input_files = (
|
|
|
219
219
|
handle_found(input_path, path_id);
|
|
220
220
|
}
|
|
221
221
|
if (!path_ids.length) continue;
|
|
222
|
-
const resolved_input_files_for_input_path: Array<
|
|
222
|
+
const resolved_input_files_for_input_path: Array<ResolvedInputFile> = [];
|
|
223
223
|
for (const path_id of path_ids) {
|
|
224
|
-
const resolved_input_file:
|
|
224
|
+
const resolved_input_file: ResolvedInputFile = {
|
|
225
225
|
id: path_id,
|
|
226
226
|
input_path,
|
|
227
227
|
resolved_input_path,
|
|
@@ -233,7 +233,7 @@ export const resolve_input_files = (
|
|
|
233
233
|
if (!existing_path_ids.has(id)) {
|
|
234
234
|
// Handle input paths that resolve to files.
|
|
235
235
|
existing_path_ids.add(id);
|
|
236
|
-
const resolved_input_file:
|
|
236
|
+
const resolved_input_file: ResolvedInputFile = {id, input_path, resolved_input_path};
|
|
237
237
|
resolved_input_files.push(resolved_input_file);
|
|
238
238
|
}
|
|
239
239
|
handle_found(input_path, id);
|
|
@@ -249,7 +249,7 @@ export const resolve_input_files = (
|
|
|
249
249
|
map.set(root_dir, [resolved_input_file]);
|
|
250
250
|
}
|
|
251
251
|
return map;
|
|
252
|
-
}, new Map<
|
|
252
|
+
}, new Map<PathId, Array<ResolvedInputFile>>()),
|
|
253
253
|
input_directories_with_no_files: remaining.map((r) => r.input_path),
|
|
254
254
|
};
|
|
255
255
|
};
|
package/src/lib/invoke.ts
CHANGED
|
@@ -19,8 +19,8 @@ and the rest of the args are forwarded to the task's `run` function.
|
|
|
19
19
|
|
|
20
20
|
// handle uncaught errors
|
|
21
21
|
attach_process_error_handlers(
|
|
22
|
-
(err) => (err.constructor.name === '
|
|
23
|
-
(err) => (err.constructor.name === '
|
|
22
|
+
(err) => (err.constructor.name === 'TaskError' ? 'TaskError' : null),
|
|
23
|
+
(err) => (err.constructor.name === 'SilentError' ? '' : null),
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
if (!process.env.NO_COLOR) {
|
package/src/lib/invoke_task.ts
CHANGED
|
@@ -5,11 +5,11 @@ import {Logger} from '@ryanatkn/belt/log.js';
|
|
|
5
5
|
|
|
6
6
|
import {to_forwarded_args, type Args} from './args.ts';
|
|
7
7
|
import {run_task} from './run_task.ts';
|
|
8
|
-
import {to_input_path,
|
|
9
|
-
import {find_tasks, load_tasks,
|
|
8
|
+
import {to_input_path, RawInputPath} from './input_path.ts';
|
|
9
|
+
import {find_tasks, load_tasks, SilentError} from './task.ts';
|
|
10
10
|
import {load_gro_package_json} from './package_json.ts';
|
|
11
11
|
import {log_tasks, log_error_reasons} from './task_logging.ts';
|
|
12
|
-
import type {
|
|
12
|
+
import type {GroConfig} from './gro_config.ts';
|
|
13
13
|
import {Filer} from './filer.ts';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -35,9 +35,9 @@ import {Filer} from './filer.ts';
|
|
|
35
35
|
* @param initial_timings - The timings to use for the top-level task, `null` for composed tasks.
|
|
36
36
|
*/
|
|
37
37
|
export const invoke_task = async (
|
|
38
|
-
task_name:
|
|
38
|
+
task_name: RawInputPath,
|
|
39
39
|
args: Args | undefined,
|
|
40
|
-
config:
|
|
40
|
+
config: GroConfig,
|
|
41
41
|
initial_filer?: Filer,
|
|
42
42
|
initial_timings?: Timings | null,
|
|
43
43
|
parent_log?: Logger,
|
|
@@ -84,7 +84,7 @@ export const invoke_task = async (
|
|
|
84
84
|
const found = find_tasks([input_path], task_root_dirs, config);
|
|
85
85
|
if (!found.ok) {
|
|
86
86
|
log_error_reasons(log, found.reasons);
|
|
87
|
-
throw new
|
|
87
|
+
throw new SilentError();
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// Found a match either in the current working directory or Gro's directory.
|
|
@@ -95,7 +95,7 @@ export const invoke_task = async (
|
|
|
95
95
|
const loaded = await load_tasks(found_tasks);
|
|
96
96
|
if (!loaded.ok) {
|
|
97
97
|
log_error_reasons(log, loaded.reasons);
|
|
98
|
-
throw new
|
|
98
|
+
throw new SilentError();
|
|
99
99
|
}
|
|
100
100
|
const loaded_tasks = loaded.value;
|
|
101
101
|
|
package/src/lib/lint.task.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {print_spawn_result} from '@ryanatkn/belt/process.js';
|
|
2
2
|
import {z} from 'zod';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {TaskError, type Task} from './task.ts';
|
|
5
5
|
import {serialize_args, to_forwarded_args} from './args.ts';
|
|
6
6
|
import {find_cli, spawn_cli} from './cli.ts';
|
|
7
7
|
|
|
@@ -32,7 +32,7 @@ export const task: Task<Args> = {
|
|
|
32
32
|
const serialized_args = serialize_args(forwarded_args);
|
|
33
33
|
const eslintResult = await spawn_cli(found_eslint_cli, serialized_args, log);
|
|
34
34
|
if (!eslintResult?.ok) {
|
|
35
|
-
throw new
|
|
35
|
+
throw new TaskError(`ESLint found some problems. ${print_spawn_result(eslintResult!)}`);
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
};
|
package/src/lib/modules.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import type {Timings} from '@ryanatkn/belt/timings.js';
|
|
2
|
-
import {
|
|
2
|
+
import {UnreachableError} from '@ryanatkn/belt/error.js';
|
|
3
3
|
import type {Result} from '@ryanatkn/belt/result.js';
|
|
4
4
|
import {print_error} from '@ryanatkn/belt/print.js';
|
|
5
5
|
import {pathToFileURL} from 'node:url';
|
|
6
|
-
import type {
|
|
6
|
+
import type {PathId} from '@ryanatkn/belt/path.js';
|
|
7
7
|
|
|
8
|
-
import type {
|
|
8
|
+
import type {ResolvedInputFile} from './input_path.ts';
|
|
9
9
|
import {print_path} from './paths.ts';
|
|
10
10
|
|
|
11
|
-
export interface
|
|
12
|
-
id:
|
|
13
|
-
mod:
|
|
11
|
+
export interface ModuleMeta<TModule extends Record<string, any> = Record<string, any>> {
|
|
12
|
+
id: PathId;
|
|
13
|
+
mod: TModule;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export type
|
|
17
|
-
{id:
|
|
18
|
-
|
|
16
|
+
export type LoadModuleResult<TModule> = Result<
|
|
17
|
+
{id: PathId; mod: TModule},
|
|
18
|
+
LoadModuleFailure
|
|
19
19
|
>;
|
|
20
|
-
export type
|
|
21
|
-
| {ok: false; type: 'failed_import'; id:
|
|
20
|
+
export type LoadModuleFailure =
|
|
21
|
+
| {ok: false; type: 'failed_import'; id: PathId; error: Error}
|
|
22
22
|
| {
|
|
23
23
|
ok: false;
|
|
24
24
|
type: 'failed_validation';
|
|
25
|
-
id:
|
|
25
|
+
id: PathId;
|
|
26
26
|
mod: Record<string, any>;
|
|
27
27
|
validation: string;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
export const load_module = async <
|
|
31
|
-
id:
|
|
32
|
-
validate?: (mod: Record<string, any>) => mod is
|
|
30
|
+
export const load_module = async <TModule extends Record<string, any>>(
|
|
31
|
+
id: PathId,
|
|
32
|
+
validate?: (mod: Record<string, any>) => mod is TModule,
|
|
33
33
|
bust_cache?: boolean,
|
|
34
|
-
): Promise<
|
|
34
|
+
): Promise<LoadModuleResult<TModule>> => {
|
|
35
35
|
let mod;
|
|
36
36
|
try {
|
|
37
37
|
let import_path = id;
|
|
@@ -50,34 +50,34 @@ export const load_module = async <T_Module extends Record<string, any>>(
|
|
|
50
50
|
return {ok: true, id, mod};
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
export interface
|
|
53
|
+
export interface LoadModulesFailure<TModuleMeta extends ModuleMeta> {
|
|
54
54
|
type: 'load_module_failures';
|
|
55
|
-
load_module_failures: Array<
|
|
55
|
+
load_module_failures: Array<LoadModuleFailure>;
|
|
56
56
|
reasons: Array<string>;
|
|
57
57
|
// still return the modules and timings, deferring to the caller
|
|
58
|
-
modules: Array<
|
|
58
|
+
modules: Array<TModuleMeta>;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export type
|
|
61
|
+
export type LoadModulesResult<TModuleMeta extends ModuleMeta> = Result<
|
|
62
62
|
{
|
|
63
|
-
modules: Array<
|
|
63
|
+
modules: Array<TModuleMeta>;
|
|
64
64
|
},
|
|
65
|
-
|
|
65
|
+
LoadModulesFailure<TModuleMeta>
|
|
66
66
|
>;
|
|
67
67
|
|
|
68
68
|
// TODO parallelize and sort afterwards
|
|
69
69
|
export const load_modules = async <
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
TModule extends Record<string, any>,
|
|
71
|
+
TModuleMeta extends ModuleMeta<TModule>,
|
|
72
72
|
>(
|
|
73
|
-
resolved_input_files: Array<
|
|
74
|
-
validate: (mod: any) => mod is
|
|
75
|
-
map_module_meta: (resolved_input_file:
|
|
73
|
+
resolved_input_files: Array<ResolvedInputFile>,
|
|
74
|
+
validate: (mod: any) => mod is TModule,
|
|
75
|
+
map_module_meta: (resolved_input_file: ResolvedInputFile, mod: TModule) => TModuleMeta,
|
|
76
76
|
timings?: Timings,
|
|
77
|
-
): Promise<
|
|
77
|
+
): Promise<LoadModulesResult<TModuleMeta>> => {
|
|
78
78
|
const timing_to_load_modules = timings?.start('load modules');
|
|
79
|
-
const modules: Array<
|
|
80
|
-
const load_module_failures: Array<
|
|
79
|
+
const modules: Array<TModuleMeta> = [];
|
|
80
|
+
const load_module_failures: Array<LoadModuleFailure> = [];
|
|
81
81
|
const reasons: Array<string> = [];
|
|
82
82
|
for (const resolved_input_file of resolved_input_files.values()) {
|
|
83
83
|
const {id, input_path} = resolved_input_file;
|
|
@@ -100,7 +100,7 @@ export const load_modules = async <
|
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
102
|
default:
|
|
103
|
-
throw new
|
|
103
|
+
throw new UnreachableError(result);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|