@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/invoke_task.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Timings } from '@ryanatkn/belt/timings.js';
|
|
2
2
|
import { Logger } from '@ryanatkn/belt/log.js';
|
|
3
3
|
import { type Args } from './args.ts';
|
|
4
|
-
import {
|
|
5
|
-
import type {
|
|
4
|
+
import { RawInputPath } from './input_path.ts';
|
|
5
|
+
import type { GroConfig } from './gro_config.ts';
|
|
6
6
|
import { Filer } from './filer.ts';
|
|
7
7
|
/**
|
|
8
8
|
* Invokes Gro tasks by name using the filesystem as the source.
|
|
@@ -26,5 +26,5 @@ import { Filer } from './filer.ts';
|
|
|
26
26
|
* @param config - The Gro configuration.
|
|
27
27
|
* @param initial_timings - The timings to use for the top-level task, `null` for composed tasks.
|
|
28
28
|
*/
|
|
29
|
-
export declare const invoke_task: (task_name:
|
|
29
|
+
export declare const invoke_task: (task_name: RawInputPath, args: Args | undefined, config: GroConfig, initial_filer?: Filer, initial_timings?: Timings | null, parent_log?: Logger) => Promise<void>;
|
|
30
30
|
//# sourceMappingURL=invoke_task.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke_task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/invoke_task.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,OAAO,EAAC,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAoB,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAgB,
|
|
1
|
+
{"version":3,"file":"invoke_task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/invoke_task.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,OAAO,EAAC,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAoB,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAgB,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAI5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW,GACvB,WAAW,YAAY,EACvB,MAAM,IAAI,GAAG,SAAS,EACtB,QAAQ,SAAS,EACjB,gBAAgB,KAAK,EACrB,kBAAkB,OAAO,GAAG,IAAI,EAChC,aAAa,MAAM,KACjB,OAAO,CAAC,IAAI,CA8Fd,CAAC"}
|
package/dist/invoke_task.js
CHANGED
|
@@ -4,8 +4,8 @@ import { print_ms, print_timings } from '@ryanatkn/belt/print.js';
|
|
|
4
4
|
import { Logger } from '@ryanatkn/belt/log.js';
|
|
5
5
|
import { to_forwarded_args } from "./args.js";
|
|
6
6
|
import { run_task } from "./run_task.js";
|
|
7
|
-
import { to_input_path,
|
|
8
|
-
import { find_tasks, load_tasks,
|
|
7
|
+
import { to_input_path, RawInputPath } from "./input_path.js";
|
|
8
|
+
import { find_tasks, load_tasks, SilentError } from "./task.js";
|
|
9
9
|
import { load_gro_package_json } from "./package_json.js";
|
|
10
10
|
import { log_tasks, log_error_reasons } from "./task_logging.js";
|
|
11
11
|
import { Filer } from "./filer.js";
|
|
@@ -67,7 +67,7 @@ export const invoke_task = async (task_name, args, config, initial_filer, initia
|
|
|
67
67
|
const found = find_tasks([input_path], task_root_dirs, config);
|
|
68
68
|
if (!found.ok) {
|
|
69
69
|
log_error_reasons(log, found.reasons);
|
|
70
|
-
throw new
|
|
70
|
+
throw new SilentError();
|
|
71
71
|
}
|
|
72
72
|
// Found a match either in the current working directory or Gro's directory.
|
|
73
73
|
const found_tasks = found.value;
|
|
@@ -76,7 +76,7 @@ export const invoke_task = async (task_name, args, config, initial_filer, initia
|
|
|
76
76
|
const loaded = await load_tasks(found_tasks);
|
|
77
77
|
if (!loaded.ok) {
|
|
78
78
|
log_error_reasons(log, loaded.reasons);
|
|
79
|
-
throw new
|
|
79
|
+
throw new SilentError();
|
|
80
80
|
}
|
|
81
81
|
const loaded_tasks = loaded.value;
|
|
82
82
|
if (resolved_input_files.length > 1 ||
|
package/dist/lint.task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/lint.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,
|
|
1
|
+
{"version":3,"file":"lint.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/lint.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAM/C,cAAc;AACd,eAAO,MAAM,IAAI;;;kBAGf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAoB3B,CAAC"}
|
package/dist/lint.task.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { print_spawn_result } from '@ryanatkn/belt/process.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
3
|
+
import { TaskError } from "./task.js";
|
|
4
4
|
import { serialize_args, to_forwarded_args } from "./args.js";
|
|
5
5
|
import { find_cli, spawn_cli } from "./cli.js";
|
|
6
6
|
const ESLINT_CLI = 'eslint';
|
|
@@ -25,7 +25,7 @@ export const task = {
|
|
|
25
25
|
const serialized_args = serialize_args(forwarded_args);
|
|
26
26
|
const eslintResult = await spawn_cli(found_eslint_cli, serialized_args, log);
|
|
27
27
|
if (!eslintResult?.ok) {
|
|
28
|
-
throw new
|
|
28
|
+
throw new TaskError(`ESLint found some problems. ${print_spawn_result(eslintResult)}`);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
};
|
package/dist/modules.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import type { Timings } from '@ryanatkn/belt/timings.js';
|
|
2
2
|
import type { Result } from '@ryanatkn/belt/result.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
export interface
|
|
6
|
-
id:
|
|
7
|
-
mod:
|
|
3
|
+
import type { PathId } from '@ryanatkn/belt/path.js';
|
|
4
|
+
import type { ResolvedInputFile } from './input_path.ts';
|
|
5
|
+
export interface ModuleMeta<TModule extends Record<string, any> = Record<string, any>> {
|
|
6
|
+
id: PathId;
|
|
7
|
+
mod: TModule;
|
|
8
8
|
}
|
|
9
|
-
export type
|
|
10
|
-
id:
|
|
11
|
-
mod:
|
|
12
|
-
},
|
|
13
|
-
export type
|
|
9
|
+
export type LoadModuleResult<TModule> = Result<{
|
|
10
|
+
id: PathId;
|
|
11
|
+
mod: TModule;
|
|
12
|
+
}, LoadModuleFailure>;
|
|
13
|
+
export type LoadModuleFailure = {
|
|
14
14
|
ok: false;
|
|
15
15
|
type: 'failed_import';
|
|
16
|
-
id:
|
|
16
|
+
id: PathId;
|
|
17
17
|
error: Error;
|
|
18
18
|
} | {
|
|
19
19
|
ok: false;
|
|
20
20
|
type: 'failed_validation';
|
|
21
|
-
id:
|
|
21
|
+
id: PathId;
|
|
22
22
|
mod: Record<string, any>;
|
|
23
23
|
validation: string;
|
|
24
24
|
};
|
|
25
|
-
export declare const load_module: <
|
|
26
|
-
export interface
|
|
25
|
+
export declare const load_module: <TModule extends Record<string, any>>(id: PathId, validate?: (mod: Record<string, any>) => mod is TModule, bust_cache?: boolean) => Promise<LoadModuleResult<TModule>>;
|
|
26
|
+
export interface LoadModulesFailure<TModuleMeta extends ModuleMeta> {
|
|
27
27
|
type: 'load_module_failures';
|
|
28
|
-
load_module_failures: Array<
|
|
28
|
+
load_module_failures: Array<LoadModuleFailure>;
|
|
29
29
|
reasons: Array<string>;
|
|
30
|
-
modules: Array<
|
|
30
|
+
modules: Array<TModuleMeta>;
|
|
31
31
|
}
|
|
32
|
-
export type
|
|
33
|
-
modules: Array<
|
|
34
|
-
},
|
|
35
|
-
export declare const load_modules: <
|
|
32
|
+
export type LoadModulesResult<TModuleMeta extends ModuleMeta> = Result<{
|
|
33
|
+
modules: Array<TModuleMeta>;
|
|
34
|
+
}, LoadModulesFailure<TModuleMeta>>;
|
|
35
|
+
export declare const load_modules: <TModule extends Record<string, any>, TModuleMeta extends ModuleMeta<TModule>>(resolved_input_files: Array<ResolvedInputFile>, validate: (mod: any) => mod is TModule, map_module_meta: (resolved_input_file: ResolvedInputFile, mod: TModule) => TModuleMeta, timings?: Timings) => Promise<LoadModulesResult<TModuleMeta>>;
|
|
36
36
|
//# sourceMappingURL=modules.d.ts.map
|
package/dist/modules.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAC;AAEvD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAGrD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAC;AAEvD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAGrD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAEnD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAGvD,MAAM,WAAW,UAAU,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACpF,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,OAAO,CAAC;CACb;AAED,MAAM,MAAM,gBAAgB,CAAC,OAAO,IAAI,MAAM,CAC7C;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAC,EAC1B,iBAAiB,CACjB,CAAC;AACF,MAAM,MAAM,iBAAiB,GAC1B;IAAC,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,eAAe,CAAC;IAAC,EAAE,E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,UAAU,OAAO,KACf,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CA2CxC,CAAC"}
|
package/dist/modules.js
CHANGED
|
@@ -6,7 +6,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
6
6
|
}
|
|
7
7
|
return path;
|
|
8
8
|
};
|
|
9
|
-
import {
|
|
9
|
+
import { UnreachableError } from '@ryanatkn/belt/error.js';
|
|
10
10
|
import { print_error } from '@ryanatkn/belt/print.js';
|
|
11
11
|
import { pathToFileURL } from 'node:url';
|
|
12
12
|
import { print_path } from "./paths.js";
|
|
@@ -53,7 +53,7 @@ export const load_modules = async (resolved_input_files, validate, map_module_me
|
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
55
|
default:
|
|
56
|
-
throw new
|
|
56
|
+
throw new UnreachableError(result);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
package/dist/package_json.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
2
|
-
import {
|
|
3
|
-
export type
|
|
4
|
-
export declare const EMPTY_PACKAGE_JSON:
|
|
5
|
-
export declare const load_package_json: (dir?: string, cache?: Record<string,
|
|
6
|
-
log?: Logger) =>
|
|
7
|
-
export declare const sync_package_json: (map_package_json:
|
|
8
|
-
package_json:
|
|
2
|
+
import { PackageJson, PackageJsonExports } from '@ryanatkn/belt/package_json.js';
|
|
3
|
+
export type PackageJsonMapper = (package_json: PackageJson) => PackageJson | null | Promise<PackageJson | null>;
|
|
4
|
+
export declare const EMPTY_PACKAGE_JSON: PackageJson;
|
|
5
|
+
export declare const load_package_json: (dir?: string, cache?: Record<string, PackageJson>, parse?: boolean, // TODO pass `false` here in more places, especially anything perf-sensitive like work on startup
|
|
6
|
+
log?: Logger) => PackageJson;
|
|
7
|
+
export declare const sync_package_json: (map_package_json: PackageJsonMapper, log: Logger, write?: boolean, dir?: string, exports_dir?: string) => Promise<{
|
|
8
|
+
package_json: PackageJson | null;
|
|
9
9
|
changed: boolean;
|
|
10
10
|
}>;
|
|
11
|
-
export declare const load_gro_package_json: () =>
|
|
11
|
+
export declare const load_gro_package_json: () => PackageJson;
|
|
12
12
|
export declare const write_package_json: (serialized_package_json: string) => void;
|
|
13
|
-
export declare const serialize_package_json: (package_json:
|
|
13
|
+
export declare const serialize_package_json: (package_json: PackageJson) => string;
|
|
14
14
|
/**
|
|
15
15
|
* Updates package.json. Writes to the filesystem only when contents change.
|
|
16
16
|
*/
|
|
17
|
-
export declare const update_package_json: (update: (package_json:
|
|
18
|
-
package_json:
|
|
17
|
+
export declare const update_package_json: (update: (package_json: PackageJson) => PackageJson | null | Promise<PackageJson | null>, dir?: string, write?: boolean) => Promise<{
|
|
18
|
+
package_json: PackageJson | null;
|
|
19
19
|
changed: boolean;
|
|
20
20
|
}>;
|
|
21
|
-
export declare const to_package_exports: (paths: Array<string>) =>
|
|
22
|
-
export declare const parse_repo_url: (package_json:
|
|
21
|
+
export declare const to_package_exports: (paths: Array<string>) => PackageJsonExports;
|
|
22
|
+
export declare const parse_repo_url: (package_json: PackageJson) => {
|
|
23
23
|
owner: string;
|
|
24
24
|
repo: string;
|
|
25
25
|
} | undefined;
|
|
26
|
-
export declare const has_dep: (dep_name: string, package_json?:
|
|
27
|
-
export interface
|
|
26
|
+
export declare const has_dep: (dep_name: string, package_json?: PackageJson) => boolean;
|
|
27
|
+
export interface PackageJsonDep {
|
|
28
28
|
name: string;
|
|
29
29
|
version: string;
|
|
30
30
|
}
|
|
31
|
-
export declare const extract_deps: (package_json:
|
|
31
|
+
export declare const extract_deps: (package_json: PackageJson) => Array<PackageJsonDep>;
|
|
32
32
|
//# sourceMappingURL=package_json.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/package_json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM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AAC,CAa9D,CAAC;AAIF,eAAO,MAAM,kBAAkB,GAAI,OAAO,KAAK,CAAC,MAAM,CAAC,KAAG,kBAmDzD,CAAC;AAIF,eAAO,MAAM,cAAc,GAC1B,cAAc,WAAW,KACvB;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,SAgBlC,CAAC;AA8BF,eAAO,MAAM,OAAO,GACnB,UAAU,MAAM,EAChB,eAAc,WAAiC,KAC7C,OAGyC,CAAC;AAE7C,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,YAAY,GAAI,cAAc,WAAW,KAAG,KAAK,CAAC,cAAc,CAe5E,CAAC"}
|
package/dist/package_json.js
CHANGED
|
@@ -3,7 +3,7 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { plural, strip_end } from '@ryanatkn/belt/string.js';
|
|
5
5
|
import { styleText as st } from 'node:util';
|
|
6
|
-
import {
|
|
6
|
+
import { PackageJson, PackageJsonExports } from '@ryanatkn/belt/package_json.js';
|
|
7
7
|
import { paths, gro_paths, IS_THIS_GRO } from "./paths.js";
|
|
8
8
|
import { PACKAGE_JSON_FILENAME, SVELTEKIT_DIST_DIRNAME, TS_MATCHER, JS_MATCHER, SVELTE_MATCHER, JSON_MATCHER, CSS_MATCHER, } from "./constants.js";
|
|
9
9
|
import { search_fs } from "./search_fs.js";
|
|
@@ -24,7 +24,7 @@ log) => {
|
|
|
24
24
|
return EMPTY_PACKAGE_JSON;
|
|
25
25
|
}
|
|
26
26
|
if (parse) {
|
|
27
|
-
package_json = parse_package_json(
|
|
27
|
+
package_json = parse_package_json(PackageJson, package_json);
|
|
28
28
|
}
|
|
29
29
|
if (cache) {
|
|
30
30
|
cache[dir] = package_json;
|
|
@@ -39,7 +39,7 @@ export const sync_package_json = async (map_package_json, log, write = true, dir
|
|
|
39
39
|
package_json.exports = to_package_exports(exported_paths);
|
|
40
40
|
}
|
|
41
41
|
const mapped = await map_package_json(package_json);
|
|
42
|
-
return mapped ? parse_package_json(
|
|
42
|
+
return mapped ? parse_package_json(PackageJson, mapped) : mapped;
|
|
43
43
|
}, dir, write);
|
|
44
44
|
const exports_count = updated.changed && updated.package_json?.exports
|
|
45
45
|
? Object.keys(updated.package_json.exports).length
|
|
@@ -55,7 +55,7 @@ const load_package_json_contents = (dir) => readFileSync(join(dir, PACKAGE_JSON_
|
|
|
55
55
|
export const write_package_json = (serialized_package_json) => {
|
|
56
56
|
writeFileSync(join(paths.root, PACKAGE_JSON_FILENAME), serialized_package_json);
|
|
57
57
|
};
|
|
58
|
-
export const serialize_package_json = (package_json) => JSON.stringify(parse_package_json(
|
|
58
|
+
export const serialize_package_json = (package_json) => JSON.stringify(parse_package_json(PackageJson, package_json), null, 2) + '\n';
|
|
59
59
|
/**
|
|
60
60
|
* Updates package.json. Writes to the filesystem only when contents change.
|
|
61
61
|
*/
|
|
@@ -118,7 +118,7 @@ export const to_package_exports = (paths) => {
|
|
|
118
118
|
default: IMPORT_PREFIX + '*.css',
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
return parse_or_throw_formatted_error('package.json#exports',
|
|
121
|
+
return parse_or_throw_formatted_error('package.json#exports', PackageJsonExports, exports);
|
|
122
122
|
};
|
|
123
123
|
const IMPORT_PREFIX = './' + SVELTEKIT_DIST_DIRNAME + '/';
|
|
124
124
|
export const parse_repo_url = (package_json) => {
|
|
@@ -139,7 +139,7 @@ export const parse_repo_url = (package_json) => {
|
|
|
139
139
|
return { owner: owner, repo: repo };
|
|
140
140
|
};
|
|
141
141
|
/**
|
|
142
|
-
* Parses a `
|
|
142
|
+
* Parses a `PackageJson` object but preserves the order of the original keys.
|
|
143
143
|
*/
|
|
144
144
|
const parse_package_json = (schema, value) => {
|
|
145
145
|
const parsed = parse_or_throw_formatted_error(PACKAGE_JSON_FILENAME, schema, value);
|
package/dist/parse_exports.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import type { Flavored } from '@ryanatkn/belt/types.js';
|
|
3
3
|
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
4
|
+
import type { IdentifierKind } from '@ryanatkn/belt/src_json.js';
|
|
5
|
+
import type { PathId } from '@ryanatkn/belt/path.js';
|
|
6
6
|
export interface Declaration {
|
|
7
7
|
name: string;
|
|
8
|
-
kind:
|
|
8
|
+
kind: IdentifierKind | null;
|
|
9
9
|
}
|
|
10
|
-
export type
|
|
10
|
+
export type ExportDeclaration = Flavored<Declaration, 'ExportDeclaration'>;
|
|
11
11
|
/**
|
|
12
12
|
* Parse exports from a file based on its file type and content.
|
|
13
13
|
*/
|
|
14
|
-
export declare const parse_exports: (id:
|
|
15
|
-
export declare const infer_declarations_from_file_type: (file_path:
|
|
14
|
+
export declare const parse_exports: (id: PathId, program?: ts.Program, declarations?: Array<ExportDeclaration>, log?: Logger) => Array<ExportDeclaration>;
|
|
15
|
+
export declare const infer_declarations_from_file_type: (file_path: PathId, declarations?: Array<ExportDeclaration>) => Array<ExportDeclaration>;
|
|
16
16
|
/**
|
|
17
17
|
* Process TypeScript exports, identifying their kinds.
|
|
18
18
|
*/
|
|
19
|
-
export declare const process_ts_exports: (source_file: ts.SourceFile, program: ts.Program, exports: Array<ts.Symbol>, declarations?: Array<
|
|
19
|
+
export declare const process_ts_exports: (source_file: ts.SourceFile, program: ts.Program, exports: Array<ts.Symbol>, declarations?: Array<ExportDeclaration>, log?: Logger) => Array<ExportDeclaration>;
|
|
20
20
|
//# sourceMappingURL=parse_exports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse_exports.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/parse_exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAA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zB,CAAC"}
|
package/dist/parse_exports.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import { extname } from 'node:path';
|
|
3
3
|
import { TS_MATCHER } from "./constants.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ParseExportsContext } from "./parse_exports_context.js";
|
|
5
5
|
/**
|
|
6
6
|
* Parse exports from a file based on its file type and content.
|
|
7
7
|
*/
|
|
@@ -21,7 +21,7 @@ export const parse_exports = (id, program, declarations = [], log) => {
|
|
|
21
21
|
// Get the module exports
|
|
22
22
|
const exports = checker.getExportsOfModule(symbol);
|
|
23
23
|
// Process TypeScript declarations
|
|
24
|
-
const export_context = new
|
|
24
|
+
const export_context = new ParseExportsContext(program, log);
|
|
25
25
|
export_context.analyze_source_file(source_file);
|
|
26
26
|
export_context.process_exports(source_file, exports, declarations);
|
|
27
27
|
}
|
|
@@ -59,7 +59,7 @@ export const infer_declarations_from_file_type = (file_path, declarations = [])
|
|
|
59
59
|
* Process TypeScript exports, identifying their kinds.
|
|
60
60
|
*/
|
|
61
61
|
export const process_ts_exports = (source_file, program, exports, declarations = [], log) => {
|
|
62
|
-
const export_context = new
|
|
62
|
+
const export_context = new ParseExportsContext(program, log);
|
|
63
63
|
export_context.analyze_source_file(source_file);
|
|
64
64
|
return export_context.process_exports(source_file, exports, declarations);
|
|
65
65
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ExportDeclaration } from './parse_exports.ts';
|
|
4
4
|
/**
|
|
5
5
|
* A class to track export context and determine export kinds.
|
|
6
6
|
*/
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class ParseExportsContext {
|
|
8
8
|
#private;
|
|
9
9
|
readonly log: Logger | undefined;
|
|
10
10
|
debug: boolean;
|
|
@@ -16,6 +16,6 @@ export declare class Parse_Exports_Context {
|
|
|
16
16
|
/**
|
|
17
17
|
* Process a list of exported symbols and identify their kinds.
|
|
18
18
|
*/
|
|
19
|
-
process_exports(source_file: ts.SourceFile, exports: Array<ts.Symbol>, declarations?: Array<
|
|
19
|
+
process_exports(source_file: ts.SourceFile, exports: Array<ts.Symbol>, declarations?: Array<ExportDeclaration>): Array<ExportDeclaration>;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=parse_exports_context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse_exports_context.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/parse_exports_context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAGlD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"parse_exports_context.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/parse_exports_context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAGlD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAE1D;;GAEG;AACH,qBAAa,mBAAmB;;IAQ/B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,KAAK,UAAwC;gBAEjC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM;IAc7C;;OAEG;IACH,mBAAmB,CAAC,WAAW,EAAE,EAAE,CAAC,UAAU,GAAG,IAAI;IAerD;;OAEG;IACH,eAAe,CACd,WAAW,EAAE,EAAE,CAAC,UAAU,EAC1B,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,EACzB,YAAY,GAAE,KAAK,CAAC,iBAAiB,CAAM,GACzC,KAAK,CAAC,iBAAiB,CAAC;CA+U3B"}
|
package/dist/parse_imports.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Flavored } from '@ryanatkn/belt/types.js';
|
|
2
|
-
import type {
|
|
3
|
-
export type
|
|
4
|
-
export declare const parse_imports: (id:
|
|
2
|
+
import type { PathId } from '@ryanatkn/belt/path.js';
|
|
3
|
+
export type ImportSpecifier = Flavored<string, 'ImportSpecifier'>;
|
|
4
|
+
export declare const parse_imports: (id: PathId, contents: string, ignore_types?: boolean) => Array<ImportSpecifier>;
|
|
5
5
|
//# sourceMappingURL=parse_imports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse_imports.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/parse_imports.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"parse_imports.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/parse_imports.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAInD,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAyBlE,eAAO,MAAM,aAAa,GACzB,IAAI,MAAM,EACV,UAAU,MAAM,EAChB,sBAAmB,KACjB,KAAK,CAAC,eAAe,CA+IvB,CAAC"}
|
package/dist/parse_imports.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseSync } from 'oxc-parser';
|
|
2
|
-
import {
|
|
2
|
+
import { UnreachableError } from '@ryanatkn/belt/error.js';
|
|
3
3
|
import { JS_MATCHER, TS_MATCHER, SVELTE_MATCHER, SVELTE_SCRIPT_MATCHER } from "./constants.js";
|
|
4
4
|
// TODO this is probably way more complicated that it should be, maybe report the issues upstream unless I made a mistake here
|
|
5
5
|
/**
|
|
@@ -96,7 +96,7 @@ export const parse_imports = (id, contents, ignore_types = true) => {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
|
-
throw new
|
|
99
|
+
throw new UnreachableError(node.source.type);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
}
|
package/dist/paths.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PathId } from '@ryanatkn/belt/path.js';
|
|
2
2
|
export declare const LIB_DIRNAME: string;
|
|
3
3
|
export declare const LIB_PATH: string;
|
|
4
4
|
/** @trailing_slash */
|
|
@@ -18,11 +18,11 @@ export interface Paths {
|
|
|
18
18
|
config: string;
|
|
19
19
|
}
|
|
20
20
|
export declare const create_paths: (root_dir: string) => Paths;
|
|
21
|
-
export declare const infer_paths: (id:
|
|
22
|
-
export declare const is_gro_id: (id:
|
|
23
|
-
export declare const to_root_path: (id:
|
|
24
|
-
export declare const path_id_to_base_path: (path_id:
|
|
25
|
-
export declare const base_path_to_path_id: (base_path: string, p?: Paths) =>
|
|
21
|
+
export declare const infer_paths: (id: PathId) => Paths;
|
|
22
|
+
export declare const is_gro_id: (id: PathId) => boolean;
|
|
23
|
+
export declare const to_root_path: (id: PathId, p?: Paths) => string;
|
|
24
|
+
export declare const path_id_to_base_path: (path_id: PathId, p?: Paths) => string;
|
|
25
|
+
export declare const base_path_to_path_id: (base_path: string, p?: Paths) => PathId;
|
|
26
26
|
export declare const print_path: (path: string, p?: Paths) => string;
|
|
27
27
|
export declare const replace_extension: (path: string, new_extension: string) => string;
|
|
28
28
|
/**
|
package/dist/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/paths.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"../src/l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AAW,SAAsC,CAAC;AAC/D;;GAEG;AACH,eAAO,MAAM,SAAS,OAA2D,CAAC;AAClF,sBAAsB;AACtB,eAAO,MAAM,YAAY,QAAgD,CAAC"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TaskContext } from './task.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Gro `Plugin`s enable custom behavior during `gro dev` and `gro build`.
|
|
4
4
|
* In contrast, `Adapter`s use the results of `gro build` to produce final artifacts.
|
|
5
5
|
*/
|
|
6
|
-
export interface Plugin<
|
|
6
|
+
export interface Plugin<TPluginContext extends PluginContext = PluginContext> {
|
|
7
7
|
name: string;
|
|
8
|
-
setup?: (ctx:
|
|
9
|
-
adapt?: (ctx:
|
|
10
|
-
teardown?: (ctx:
|
|
8
|
+
setup?: (ctx: TPluginContext) => void | Promise<void>;
|
|
9
|
+
adapt?: (ctx: TPluginContext) => void | Promise<void>;
|
|
10
|
+
teardown?: (ctx: TPluginContext) => void | Promise<void>;
|
|
11
11
|
}
|
|
12
|
-
export type
|
|
13
|
-
export interface
|
|
12
|
+
export type CreateConfigPlugins<TPluginContext extends PluginContext = PluginContext> = (ctx: TPluginContext) => Array<Plugin<TPluginContext>> | Promise<Array<Plugin<TPluginContext>>>;
|
|
13
|
+
export interface PluginContext<TArgs = object> extends TaskContext<TArgs> {
|
|
14
14
|
dev: boolean;
|
|
15
15
|
watch: boolean;
|
|
16
16
|
}
|
|
17
17
|
/** See `Plugins.create` for a usage example. */
|
|
18
|
-
export declare class Plugins<
|
|
19
|
-
readonly ctx:
|
|
20
|
-
readonly instances: Array<Plugin<
|
|
21
|
-
constructor(ctx:
|
|
22
|
-
static create<
|
|
18
|
+
export declare class Plugins<TPluginContext extends PluginContext> {
|
|
19
|
+
readonly ctx: TPluginContext;
|
|
20
|
+
readonly instances: Array<Plugin<TPluginContext>>;
|
|
21
|
+
constructor(ctx: TPluginContext, instances: Array<Plugin>);
|
|
22
|
+
static create<TPluginContext extends PluginContext>(ctx: TPluginContext): Promise<Plugins<TPluginContext>>;
|
|
23
23
|
setup(): Promise<void>;
|
|
24
24
|
adapt(): Promise<void>;
|
|
25
25
|
teardown(): Promise<void>;
|
|
@@ -27,7 +27,7 @@ export declare class Plugins<T_Plugin_Context extends Plugin_Context> {
|
|
|
27
27
|
/**
|
|
28
28
|
* Replaces a plugin by name in `plugins` without mutating the param.
|
|
29
29
|
* Throws if the plugin name cannot be found.
|
|
30
|
-
* @param plugins - accepts the same types as the return value of `
|
|
30
|
+
* @param plugins - accepts the same types as the return value of `CreateConfigPlugins`
|
|
31
31
|
* @param new_plugin
|
|
32
32
|
* @param name - @default new_plugin.name
|
|
33
33
|
* @returns `plugins` with `new_plugin` at the index of the plugin with `name`
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,MAAM,CAAC,cAAc,SAAS,aAAa,GAAG,aAAa;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD;AAED,MAAM,MAAM,mBAAmB,CAAC,cAAc,SAAS,aAAa,GAAG,aAAa,IAAI,CACvF,GAAG,EAAE,cAAc,KACf,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;AAE5E,MAAM,WAAW,aAAa,CAAC,KAAK,GAAG,MAAM,CAAE,SAAQ,WAAW,CAAC,KAAK,CAAC;IACxE,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CACf;AAED,gDAAgD;AAChD,qBAAa,OAAO,CAAC,cAAc,SAAS,aAAa;IACxD,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;gBAEtC,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC;WAK5C,MAAM,CAAC,cAAc,SAAS,aAAa,EACvD,GAAG,EAAE,cAAc,GACjB,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAS7B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAetB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAatB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAc/B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAC1B,SAAS,KAAK,CAAC,MAAM,CAAC,EACtB,YAAY,MAAM,EAClB,aAAsB,KACpB,KAAK,CAAC,MAAM,CAMd,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -63,7 +63,7 @@ export class Plugins {
|
|
|
63
63
|
/**
|
|
64
64
|
* Replaces a plugin by name in `plugins` without mutating the param.
|
|
65
65
|
* Throws if the plugin name cannot be found.
|
|
66
|
-
* @param plugins - accepts the same types as the return value of `
|
|
66
|
+
* @param plugins - accepts the same types as the return value of `CreateConfigPlugins`
|
|
67
67
|
* @param new_plugin
|
|
68
68
|
* @param name - @default new_plugin.name
|
|
69
69
|
* @returns `plugins` with `new_plugin` at the index of the plugin with `name`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publish.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAYtB,OAAO,
|
|
1
|
+
{"version":3,"file":"publish.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publish.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAYtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAQ/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;kBAuCf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAkK3B,CAAC"}
|