@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/gen_helpers.js
CHANGED
|
@@ -63,7 +63,7 @@ const resolve_gen_dependencies = async (gen_file_id, changed_file_id, bust_cache
|
|
|
63
63
|
if (dependencies === null || dependencies === 'all') {
|
|
64
64
|
return dependencies;
|
|
65
65
|
}
|
|
66
|
-
// At this point, dependencies is either 'all' or
|
|
66
|
+
// At this point, dependencies is either 'all' or GenDependenciesConfig
|
|
67
67
|
// For static dependencies, also normalize empty objects
|
|
68
68
|
if (!dependencies.patterns?.length && !dependencies.files?.length) {
|
|
69
69
|
return null;
|
package/dist/github.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FetchValueCache } from '@ryanatkn/belt/fetch.js';
|
|
2
2
|
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
export declare const GITHUB_REPO_MATCHER: RegExp;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const GithubPullRequest: z.ZodObject<{
|
|
6
6
|
url: z.ZodString;
|
|
7
7
|
id: z.ZodNumber;
|
|
8
8
|
html_url: z.ZodString;
|
|
@@ -11,9 +11,9 @@ export declare const Github_Pull_Request: z.ZodObject<{
|
|
|
11
11
|
login: z.ZodString;
|
|
12
12
|
}, z.core.$loose>;
|
|
13
13
|
}, z.core.$loose>;
|
|
14
|
-
export type
|
|
14
|
+
export type GithubPullRequest = z.infer<typeof GithubPullRequest>;
|
|
15
15
|
/**
|
|
16
16
|
* @see https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-pull-requests-associated-with-a-commit
|
|
17
17
|
*/
|
|
18
|
-
export declare const github_fetch_commit_prs: (owner: string, repo: string, commit_sha: string, token?: string, log?: Logger, cache?:
|
|
18
|
+
export declare const github_fetch_commit_prs: (owner: string, repo: string, commit_sha: string, token?: string, log?: Logger, cache?: FetchValueCache, api_version?: string) => Promise<Array<GithubPullRequest> | null>;
|
|
19
19
|
//# sourceMappingURL=github.d.ts.map
|
package/dist/github.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/github.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/github.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAc,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,mBAAmB,QAA6B,CAAC;AAE9D,eAAO,MAAM,iBAAiB;;;;;;;;iBAQ5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,uBAAuB,GACnC,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,YAAY,MAAM,EAClB,QAAQ,MAAM,EACd,MAAM,MAAM,EACZ,QAAQ,eAAe,EACvB,cAAc,MAAM,KAClB,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAazC,CAAC"}
|
package/dist/github.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// TODO if this grows at all, use `@octokit/request`,
|
|
2
2
|
// for now it's just calling a single endpoint so we do it manually
|
|
3
3
|
// and we specify just the types we need
|
|
4
|
-
import {
|
|
4
|
+
import { FetchValueCache, fetch_value } from '@ryanatkn/belt/fetch.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
export const GITHUB_REPO_MATCHER = /.+github.com\/(.+)\/(.+)/;
|
|
7
|
-
export const
|
|
7
|
+
export const GithubPullRequest = z.looseObject({
|
|
8
8
|
url: z.string(),
|
|
9
9
|
id: z.number(),
|
|
10
10
|
html_url: z.string(),
|
|
@@ -21,7 +21,7 @@ export const github_fetch_commit_prs = async (owner, repo, commit_sha, token, lo
|
|
|
21
21
|
const url = `https://api.github.com/repos/${owner}/${repo}/commits/${commit_sha}/pulls`;
|
|
22
22
|
const fetched = await fetch_value(url, {
|
|
23
23
|
request: { headers },
|
|
24
|
-
parse: (v) => v.map((p) =>
|
|
24
|
+
parse: (v) => v.map((p) => GithubPullRequest.parse(p)),
|
|
25
25
|
token,
|
|
26
26
|
cache,
|
|
27
27
|
return_early_from_cache: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CreateGroConfig } from './gro_config.ts';
|
|
2
2
|
/**
|
|
3
3
|
* This is the default config that's passed to `gro.config.ts`
|
|
4
4
|
* if it exists in the current project, and if not, this is the final config.
|
|
@@ -8,6 +8,6 @@ import type { Create_Gro_Config } from './gro_config.ts';
|
|
|
8
8
|
* - if `src/lib`, assumes a Node library - respects `KitConfig.kit.files.lib`
|
|
9
9
|
* - if `src/lib/server/server.ts`, assumes a Node server - needs config
|
|
10
10
|
*/
|
|
11
|
-
declare const config:
|
|
11
|
+
declare const config: CreateGroConfig;
|
|
12
12
|
export default config;
|
|
13
13
|
//# sourceMappingURL=gro.config.default.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro.config.default.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro.config.default.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"gro.config.default.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro.config.default.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAUrD;;;;;;;;GAQG;AACH,QAAA,MAAM,MAAM,EAAE,eAsBb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/gro_config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { PathFilter, PathId } from '@ryanatkn/belt/path.js';
|
|
2
|
+
import type { CreateConfigPlugins } from './plugin.ts';
|
|
3
|
+
import type { PackageJsonMapper } from './package_json.ts';
|
|
4
|
+
import type { ParsedSvelteConfig } from './svelte_config.ts';
|
|
5
5
|
/**
|
|
6
6
|
* SHA-256 hash of empty string, used for configs without build_cache_config.
|
|
7
7
|
* This ensures consistent cache behavior when no custom config is provided.
|
|
@@ -12,27 +12,27 @@ export declare const EMPTY_BUILD_CACHE_CONFIG_HASH = "e3b0c44298fc1c149afbf4c899
|
|
|
12
12
|
* This is exposed to users in places like tasks and genfiles.
|
|
13
13
|
* @see https://github.com/ryanatkn/gro/blob/main/src/docs/config.md
|
|
14
14
|
*/
|
|
15
|
-
export interface
|
|
15
|
+
export interface GroConfig extends RawGroConfig {
|
|
16
16
|
/**
|
|
17
17
|
* @see https://github.com/ryanatkn/gro/blob/main/src/docs/plugin.md
|
|
18
18
|
*/
|
|
19
|
-
plugins:
|
|
19
|
+
plugins: CreateConfigPlugins;
|
|
20
20
|
/**
|
|
21
21
|
* Maps the project's `package.json` before writing it to the filesystem.
|
|
22
22
|
* The `package_json` argument may be mutated, but the return value is what's used by the caller.
|
|
23
23
|
* Returning `null` is a no-op for the caller.
|
|
24
24
|
*/
|
|
25
|
-
map_package_json:
|
|
25
|
+
map_package_json: PackageJsonMapper | null;
|
|
26
26
|
/**
|
|
27
27
|
* The root directories to search for tasks given implicit relative input paths.
|
|
28
28
|
* Defaults to `./src/lib`, then the cwd, then the Gro package dist.
|
|
29
29
|
*/
|
|
30
|
-
task_root_dirs: Array<
|
|
30
|
+
task_root_dirs: Array<PathId>;
|
|
31
31
|
/**
|
|
32
32
|
* When searching the filsystem for tasks and genfiles,
|
|
33
33
|
* directories and files are included if they pass all of these filters.
|
|
34
34
|
*/
|
|
35
|
-
search_filters: Array<
|
|
35
|
+
search_filters: Array<PathFilter>;
|
|
36
36
|
/**
|
|
37
37
|
* The CLI to use that's compatible with `node`.
|
|
38
38
|
*/
|
|
@@ -47,20 +47,20 @@ export interface Gro_Config extends Raw_Gro_Config {
|
|
|
47
47
|
* SHA-256 hash of the user's `build_cache_config` from `gro.config.ts`.
|
|
48
48
|
* This is computed during config normalization and the raw value is immediately deleted.
|
|
49
49
|
* If no `build_cache_config` was provided, this is the hash of an empty string.
|
|
50
|
-
* @see
|
|
50
|
+
* @see RawGroConfig.build_cache_config
|
|
51
51
|
*/
|
|
52
52
|
build_cache_config_hash: string;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* The relaxed variant of `
|
|
56
|
-
* Superset of `
|
|
55
|
+
* The relaxed variant of `GroConfig` that users can provide via `gro.config.ts`.
|
|
56
|
+
* Superset of `GroConfig`.
|
|
57
57
|
* @see https://github.com/ryanatkn/gro/blob/main/src/docs/config.md
|
|
58
58
|
*/
|
|
59
|
-
export interface
|
|
60
|
-
plugins?:
|
|
61
|
-
map_package_json?:
|
|
59
|
+
export interface RawGroConfig {
|
|
60
|
+
plugins?: CreateConfigPlugins;
|
|
61
|
+
map_package_json?: PackageJsonMapper | null;
|
|
62
62
|
task_root_dirs?: Array<string>;
|
|
63
|
-
search_filters?:
|
|
63
|
+
search_filters?: PathFilter | Array<PathFilter> | null;
|
|
64
64
|
js_cli?: string;
|
|
65
65
|
pm_cli?: string;
|
|
66
66
|
/**
|
|
@@ -80,25 +80,25 @@ export interface Raw_Gro_Config {
|
|
|
80
80
|
*/
|
|
81
81
|
build_cache_config?: Record<string, unknown> | (() => Record<string, unknown> | Promise<Record<string, unknown>>);
|
|
82
82
|
}
|
|
83
|
-
export type
|
|
84
|
-
export declare const create_empty_gro_config: () =>
|
|
83
|
+
export type CreateGroConfig = (base_config: GroConfig, svelte_config?: ParsedSvelteConfig) => RawGroConfig | Promise<RawGroConfig>;
|
|
84
|
+
export declare const create_empty_gro_config: () => GroConfig;
|
|
85
85
|
/**
|
|
86
86
|
* The regexp used by default to exclude directories and files
|
|
87
87
|
* when searching the filesystem for tasks and genfiles.
|
|
88
|
-
* Customize via `search_filters` in the `
|
|
88
|
+
* Customize via `search_filters` in the `GroConfig`.
|
|
89
89
|
* See the test cases for the exact behavior.
|
|
90
90
|
*/
|
|
91
91
|
export declare const SEARCH_EXCLUDER_DEFAULT: RegExp;
|
|
92
92
|
export declare const EXPORTS_EXCLUDER_DEFAULT: RegExp;
|
|
93
93
|
/**
|
|
94
|
-
* Transforms a `
|
|
94
|
+
* Transforms a `RawGroConfig` to the more strict `GroConfig`.
|
|
95
95
|
* This allows users to provide a more relaxed config.
|
|
96
96
|
* Hashes the `build_cache_config` and deletes the raw value for security.
|
|
97
97
|
*/
|
|
98
|
-
export declare const cook_gro_config: (raw_config:
|
|
99
|
-
export interface
|
|
100
|
-
readonly default:
|
|
98
|
+
export declare const cook_gro_config: (raw_config: RawGroConfig) => Promise<GroConfig>;
|
|
99
|
+
export interface GroConfigModule {
|
|
100
|
+
readonly default: RawGroConfig | CreateGroConfig;
|
|
101
101
|
}
|
|
102
|
-
export declare const load_gro_config: (dir?: string) => Promise<
|
|
103
|
-
export declare const validate_gro_config_module: (config_module: any, config_path: string) => asserts config_module is
|
|
102
|
+
export declare const load_gro_config: (dir?: string) => Promise<GroConfig>;
|
|
103
|
+
export declare const validate_gro_config_module: (config_module: any, config_path: string) => asserts config_module is GroConfigModule;
|
|
104
104
|
//# sourceMappingURL=gro_config.d.ts.map
|
package/dist/gro_config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_config.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"gro_config.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,UAAU,EAAE,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAc/D,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAG3D;;;GAGG;AACH,eAAO,MAAM,6BAA6B,qEACyB,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC9C;;OAEG;IACH,OAAO,EAAE,mBAAmB,CAAC;IAC7B;;;;OAIG;IACH,gBAAgB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC3C;;;OAGG;IACH,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B;;;OAGG;IACH,cAAc,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;OAKG;IACH,uBAAuB,EAAE,MAAM,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,cAAc,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;;;;;OAcG;IACH,kBAAkB,CAAC,EAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACtE;AAED,MAAM,MAAM,eAAe,GAAG,CAC7B,WAAW,EAAE,SAAS,EACtB,aAAa,CAAC,EAAE,kBAAkB,KAC9B,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAE1C,eAAO,MAAM,uBAAuB,QAAO,SAazC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,QAUnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAA+C,CAAC;AAErF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAU,YAAY,YAAY,KAAG,OAAO,CAAC,SAAS,CA+CjF,CAAC;AAEF,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,eAAe,CAAC;CACjD;AAED,eAAO,MAAM,eAAe,GAAU,YAAgB,KAAG,OAAO,CAAC,SAAS,CAqBzE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,CACxC,aAAa,EAAE,GAAG,EAClB,WAAW,EAAE,MAAM,KACf,OAAO,CAAC,aAAa,IAAI,eAS7B,CAAC"}
|
package/dist/gro_config.js
CHANGED
|
@@ -36,7 +36,7 @@ export const create_empty_gro_config = () => ({
|
|
|
36
36
|
/**
|
|
37
37
|
* The regexp used by default to exclude directories and files
|
|
38
38
|
* when searching the filesystem for tasks and genfiles.
|
|
39
|
-
* Customize via `search_filters` in the `
|
|
39
|
+
* Customize via `search_filters` in the `GroConfig`.
|
|
40
40
|
* See the test cases for the exact behavior.
|
|
41
41
|
*/
|
|
42
42
|
export const SEARCH_EXCLUDER_DEFAULT = new RegExp(`(${'(^|/)\\.[^/]+' + // exclude all `.`-prefixed directories
|
|
@@ -48,7 +48,7 @@ export const SEARCH_EXCLUDER_DEFAULT = new RegExp(`(${'(^|/)\\.[^/]+' + // exclu
|
|
|
48
48
|
})($|/)`, 'u');
|
|
49
49
|
export const EXPORTS_EXCLUDER_DEFAULT = /(\.md|\.(test|ignore)\.|\/(test|ignore)\/)/;
|
|
50
50
|
/**
|
|
51
|
-
* Transforms a `
|
|
51
|
+
* Transforms a `RawGroConfig` to the more strict `GroConfig`.
|
|
52
52
|
* This allows users to provide a more relaxed config.
|
|
53
53
|
* Hashes the `build_cache_config` and deletes the raw value for security.
|
|
54
54
|
*/
|
package/dist/gro_helpers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SpawnResult } from '@ryanatkn/belt/process.js';
|
|
2
2
|
/**
|
|
3
3
|
* Resolves a path to an internal Gro file.
|
|
4
4
|
* Prefers any local installation of Gro and falls back to the current CLI context.
|
|
@@ -45,5 +45,5 @@ export declare const resolve_gro_module_path: (path?: string) => string;
|
|
|
45
45
|
* @param loader_path path to loader
|
|
46
46
|
* @param invoke_path path to file to spawn with `node`
|
|
47
47
|
*/
|
|
48
|
-
export declare const spawn_with_loader: (loader_path: string, invoke_path: string, argv: Array<string>, js_cli?: string) => Promise<
|
|
48
|
+
export declare const spawn_with_loader: (loader_path: string, invoke_path: string, argv: Array<string>, js_cli?: string) => Promise<SpawnResult>;
|
|
49
49
|
//# sourceMappingURL=gro_helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,
|
|
1
|
+
{"version":3,"file":"gro_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAUlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,uBAAuB,GAAI,aAAS,KAAG,MAsBnD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC7B,aAAa,MAAM,EACnB,aAAa,MAAM,EACnB,MAAM,KAAK,CAAC,MAAM,CAAC,EACnB,eAAuB,KACrB,OAAO,CAAC,WAAW,CAoBrB,CAAC"}
|
package/dist/gro_plugin_gen.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Plugin } from './plugin.ts';
|
|
2
2
|
import type { Args } from './args.ts';
|
|
3
|
-
export interface
|
|
3
|
+
export interface TaskArgs extends Args {
|
|
4
4
|
watch?: boolean;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface GroPluginGenOptions {
|
|
7
7
|
input_paths?: Array<string>;
|
|
8
8
|
root_dirs?: Array<string>;
|
|
9
9
|
flush_debounce_delay?: number;
|
|
10
10
|
}
|
|
11
|
-
export declare const gro_plugin_gen: ({ input_paths, root_dirs, flush_debounce_delay, }?:
|
|
11
|
+
export declare const gro_plugin_gen: ({ input_paths, root_dirs, flush_debounce_delay, }?: GroPluginGenOptions) => Plugin;
|
|
12
12
|
//# sourceMappingURL=gro_plugin_gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_plugin_gen.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_gen.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAapC,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"gro_plugin_gen.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_gen.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAapC,MAAM,WAAW,QAAS,SAAQ,IAAI;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IACnC,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,cAAc,GAAI,oDAI5B,mBAAkC,KAAG,MAoHvC,CAAC"}
|
package/dist/gro_plugin_gen.js
CHANGED
|
@@ -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
|
import { paths } from "./paths.js";
|
|
5
5
|
import { find_genfiles, is_gen_path } from "./gen.js";
|
|
6
6
|
import { filter_dependents } from "./filer.js";
|
|
@@ -87,7 +87,7 @@ export const gro_plugin_gen = ({ input_paths = [paths.source], root_dirs = [path
|
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
89
|
default:
|
|
90
|
-
throw new
|
|
90
|
+
throw new UnreachableError(change.type);
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
},
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as esbuild from 'esbuild';
|
|
2
2
|
import type { Config as SvelteConfig } from '@sveltejs/kit';
|
|
3
3
|
import type { Result } from '@ryanatkn/belt/result.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { PathId } from '@ryanatkn/belt/path.js';
|
|
5
5
|
import type { Plugin } from './plugin.ts';
|
|
6
|
-
export declare const SERVER_SOURCE_ID:
|
|
7
|
-
export declare const has_server: (path?:
|
|
6
|
+
export declare const SERVER_SOURCE_ID: PathId;
|
|
7
|
+
export declare const has_server: (path?: PathId) => Promise<Result<object, {
|
|
8
8
|
message: string;
|
|
9
9
|
}>>;
|
|
10
|
-
export interface
|
|
10
|
+
export interface GroPluginServerOptions {
|
|
11
11
|
/**
|
|
12
12
|
* same as esbuild's `entryPoints`
|
|
13
13
|
*/
|
|
@@ -21,7 +21,7 @@ export interface Gro_Plugin_Server_Options {
|
|
|
21
21
|
* Decoupling this from plugin creation allows it to be created generically,
|
|
22
22
|
* so the build and dev tasks can be the source of truth for `dev`.
|
|
23
23
|
*/
|
|
24
|
-
outpaths?:
|
|
24
|
+
outpaths?: CreateOutpaths;
|
|
25
25
|
/**
|
|
26
26
|
* @default ```SvelteKit's `.env`, `.env.development`, and `.env.production````
|
|
27
27
|
*/
|
|
@@ -75,6 +75,6 @@ export interface Outpaths {
|
|
|
75
75
|
*/
|
|
76
76
|
outname: string;
|
|
77
77
|
}
|
|
78
|
-
export type
|
|
79
|
-
export declare const gro_plugin_server: ({ entry_points, dir, outpaths, env_files, ambient_env, svelte_config, target, esbuild_build_options, rebuild_throttle_delay, cli_command, run, }?:
|
|
78
|
+
export type CreateOutpaths = (dev: boolean) => Outpaths;
|
|
79
|
+
export declare const gro_plugin_server: ({ entry_points, dir, outpaths, env_files, ambient_env, svelte_config, target, esbuild_build_options, rebuild_throttle_delay, cli_command, run, }?: GroPluginServerOptions) => Plugin;
|
|
80
80
|
//# sourceMappingURL=gro_plugin_server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_plugin_server.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,eAAe,CAAC;AAI1D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAGrD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"gro_plugin_server.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,eAAe,CAAC;AAI1D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAGrD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAEnD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAcxC,eAAO,MAAM,gBAAgB,QAA0D,CAAC;AAExF,eAAO,MAAM,UAAU,GACtB,aAAuB,KACrB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CAK3C,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC;;OAEG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC;IACrF;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACxB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,QAAQ,CAAC;AAExD,eAAO,MAAM,iBAAiB,GAAI,mJAgB/B,sBAA2B,KAAG,MAsJhC,CAAC"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import type { Plugin } from './plugin.ts';
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
export interface
|
|
2
|
+
import { type PackageJsonMapper } from './package_json.ts';
|
|
3
|
+
import { type SrcJsonMapper } from './src_json.ts';
|
|
4
|
+
export interface GroPluginSveltekitAppOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Used for finalizing a SvelteKit build like adding a `.nojekyll` file for GitHub Pages.
|
|
7
7
|
* @default 'github_pages'
|
|
8
8
|
*/
|
|
9
|
-
host_target?:
|
|
9
|
+
host_target?: HostTarget;
|
|
10
10
|
/**
|
|
11
11
|
* If truthy, adds `/.well-known/package.json` to the static output.
|
|
12
12
|
* If a function, maps the value.
|
|
13
13
|
*/
|
|
14
|
-
well_known_package_json?: boolean |
|
|
14
|
+
well_known_package_json?: boolean | PackageJsonMapper;
|
|
15
15
|
/**
|
|
16
16
|
* If truthy, adds `/.well-known/src.json` and `/.well-known/src/` to the static output.
|
|
17
17
|
* If a function, maps the value.
|
|
18
18
|
*/
|
|
19
|
-
well_known_src_json?: boolean |
|
|
19
|
+
well_known_src_json?: boolean | SrcJsonMapper;
|
|
20
20
|
/**
|
|
21
21
|
* If truthy, copies `src/` to `/.well-known/src/` to the static output.
|
|
22
22
|
* Pass a function to customize which files get copied.
|
|
23
23
|
*/
|
|
24
|
-
well_known_src_files?: boolean |
|
|
24
|
+
well_known_src_files?: boolean | CopyFileFilter;
|
|
25
25
|
/**
|
|
26
26
|
* The Vite CLI to use.
|
|
27
27
|
*/
|
|
28
28
|
vite_cli?: string;
|
|
29
29
|
}
|
|
30
|
-
export type
|
|
31
|
-
export type
|
|
32
|
-
export declare const gro_plugin_sveltekit_app: ({ host_target, well_known_package_json, well_known_src_json, well_known_src_files, vite_cli, }?:
|
|
30
|
+
export type HostTarget = 'github_pages' | 'static' | 'node';
|
|
31
|
+
export type CopyFileFilter = (file_path: string) => boolean;
|
|
32
|
+
export declare const gro_plugin_sveltekit_app: ({ host_target, well_known_package_json, well_known_src_json, well_known_src_files, vite_cli, }?: GroPluginSveltekitAppOptions) => Plugin;
|
|
33
33
|
//# sourceMappingURL=gro_plugin_sveltekit_app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_plugin_sveltekit_app.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_sveltekit_app.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAExC,OAAO,EAEN,KAAK,
|
|
1
|
+
{"version":3,"file":"gro_plugin_sveltekit_app.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_sveltekit_app.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAExC,OAAO,EAEN,KAAK,iBAAiB,EAEtB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAC,KAAK,aAAa,EAAsC,MAAM,eAAe,CAAC;AAKtF,MAAM,WAAW,4BAA4B;IAC5C;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IAEzB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IAEtD;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IAE9C;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;IAChD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;AAE5D,eAAO,MAAM,wBAAwB,GAAI,iGAMtC,4BAAiC,KAAG,MA6GtC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { cpSync, mkdirSync, rmSync, writeFileSync, existsSync } from 'node:fs';
|
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
3
|
import { serialize_args, to_forwarded_args } from "./args.js";
|
|
4
4
|
import { serialize_package_json, load_package_json, } from "./package_json.js";
|
|
5
|
-
import {
|
|
5
|
+
import { TaskError } from "./task.js";
|
|
6
6
|
import { find_cli, spawn_cli, spawn_cli_process } from "./cli.js";
|
|
7
7
|
import { src_json_serialize, src_json_create } from "./src_json.js";
|
|
8
8
|
import { EXPORTS_EXCLUDER_DEFAULT } from "./gro_config.js";
|
|
@@ -87,7 +87,7 @@ export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_kn
|
|
|
87
87
|
const serialized_args = ['build', ...serialize_args(to_forwarded_args(vite_cli))];
|
|
88
88
|
const spawned = await spawn_cli(found_vite_cli, serialized_args, log);
|
|
89
89
|
if (!spawned?.ok) {
|
|
90
|
-
throw new
|
|
90
|
+
throw new TaskError(`${vite_cli} build failed with exit code ${spawned?.code}`);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
catch (err) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { Plugin } from './plugin.ts';
|
|
2
|
-
import { type
|
|
3
|
-
export interface
|
|
2
|
+
import { type SveltePackageOptions } from './sveltekit_helpers.ts';
|
|
3
|
+
export interface GroPluginSveltekitLibraryOptions {
|
|
4
4
|
/**
|
|
5
5
|
* The options passed to the SvelteKit packaging CLI.
|
|
6
6
|
* @see https://kit.svelte.dev/docs/packaging#options
|
|
7
7
|
*/
|
|
8
|
-
svelte_package_options?:
|
|
8
|
+
svelte_package_options?: SveltePackageOptions;
|
|
9
9
|
/**
|
|
10
10
|
* The SvelteKit packaging CLI to use. Defaults to `svelte-package`.
|
|
11
11
|
* @see https://kit.svelte.dev/docs/packaging
|
|
12
12
|
*/
|
|
13
13
|
svelte_package_cli?: string;
|
|
14
14
|
}
|
|
15
|
-
export declare const gro_plugin_sveltekit_library: ({ svelte_package_options, svelte_package_cli, }?:
|
|
15
|
+
export declare const gro_plugin_sveltekit_library: ({ svelte_package_options, svelte_package_cli, }?: GroPluginSveltekitLibraryOptions) => Plugin;
|
|
16
16
|
//# sourceMappingURL=gro_plugin_sveltekit_library.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_plugin_sveltekit_library.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_sveltekit_library.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAqB,KAAK,
|
|
1
|
+
{"version":3,"file":"gro_plugin_sveltekit_library.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_sveltekit_library.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAqB,KAAK,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAGrF,MAAM,WAAW,gCAAgC;IAChD;;;OAGG;IACH,sBAAsB,CAAC,EAAE,oBAAoB,CAAC;IAC9C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,4BAA4B,GAAI,kDAG1C,gCAAqC,KAAG,MAoC1C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { print_spawn_result, spawn } from '@ryanatkn/belt/process.js';
|
|
2
|
-
import {
|
|
2
|
+
import { TaskError } from "./task.js";
|
|
3
3
|
import { load_package_json } from "./package_json.js";
|
|
4
4
|
import { run_svelte_package } from "./sveltekit_helpers.js";
|
|
5
5
|
import { SVELTE_PACKAGE_CLI } from "./constants.js";
|
|
@@ -24,7 +24,7 @@ export const gro_plugin_sveltekit_library = ({ svelte_package_options, svelte_pa
|
|
|
24
24
|
log.info(`linking`);
|
|
25
25
|
const link_result = await spawn(config.pm_cli, ['link', '-f']); // TODO don't use `-f` unless necessary or at all?
|
|
26
26
|
if (!link_result.ok) {
|
|
27
|
-
throw new
|
|
27
|
+
throw new TaskError(`Failed to link. ${print_spawn_result(link_result)}`);
|
|
28
28
|
}
|
|
29
29
|
timing_to_link();
|
|
30
30
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,YAAY,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,YAAY,EAAC,SAAS,EAAE,eAAe,EAAE,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC9E,cAAc;AACd,OAAO,EAAC,KAAK,MAAM,EAAE,cAAc,EAAC,MAAM,aAAa,CAAC;AACxD,cAAc;AACd,YAAY,EAAC,GAAG,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC9C,cAAc;AACd,OAAO,EAAC,KAAK,IAAI,EAAE,KAAK,WAAW,EAAE,SAAS,EAAC,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/input_path.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { Flavored } from '@ryanatkn/belt/types.js';
|
|
3
|
-
import type {
|
|
4
|
-
export declare const
|
|
5
|
-
export type
|
|
6
|
-
export declare const
|
|
7
|
-
export type
|
|
3
|
+
import type { PathId, ResolvedPath } from '@ryanatkn/belt/path.js';
|
|
4
|
+
export declare const InputPath: z.ZodString;
|
|
5
|
+
export type InputPath = Flavored<z.infer<typeof InputPath>, 'InputPath'>;
|
|
6
|
+
export declare const RawInputPath: z.ZodString;
|
|
7
|
+
export type RawInputPath = Flavored<z.infer<typeof RawInputPath>, 'RawInputPath'>;
|
|
8
8
|
/**
|
|
9
9
|
* Raw input paths are paths that users provide to Gro to reference files for tasks and gen.
|
|
10
10
|
*
|
|
@@ -17,48 +17,48 @@ export type Raw_Input_Path = Flavored<z.infer<typeof Raw_Input_Path>, 'Raw_Input
|
|
|
17
17
|
*
|
|
18
18
|
* Thus, input paths are either absolute or implicitly relative.
|
|
19
19
|
*/
|
|
20
|
-
export declare const to_input_path: (raw_input_path:
|
|
21
|
-
export declare const to_input_paths: (raw_input_paths: Array<
|
|
22
|
-
export interface
|
|
23
|
-
id:
|
|
24
|
-
input_path:
|
|
25
|
-
root_dir:
|
|
20
|
+
export declare const to_input_path: (raw_input_path: RawInputPath, root_path?: string) => InputPath;
|
|
21
|
+
export declare const to_input_paths: (raw_input_paths: Array<RawInputPath>, root_path?: string) => Array<InputPath>;
|
|
22
|
+
export interface PossiblePath {
|
|
23
|
+
id: PathId;
|
|
24
|
+
input_path: InputPath;
|
|
25
|
+
root_dir: PathId;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Gets a list of possible source ids for each input path with `extensions`,
|
|
29
29
|
* duplicating each under `root_dirs`, without checking the filesystem.
|
|
30
30
|
*/
|
|
31
|
-
export declare const get_possible_paths: (input_path:
|
|
32
|
-
export interface
|
|
33
|
-
input_path:
|
|
34
|
-
id:
|
|
31
|
+
export declare const get_possible_paths: (input_path: InputPath, root_dirs: Array<PathId>, extensions: Array<string>) => Array<PossiblePath>;
|
|
32
|
+
export interface ResolvedInputPath {
|
|
33
|
+
input_path: InputPath;
|
|
34
|
+
id: PathId;
|
|
35
35
|
is_directory: boolean;
|
|
36
|
-
root_dir:
|
|
36
|
+
root_dir: PathId;
|
|
37
37
|
}
|
|
38
|
-
export interface
|
|
39
|
-
id:
|
|
40
|
-
input_path:
|
|
41
|
-
resolved_input_path:
|
|
38
|
+
export interface ResolvedInputFile {
|
|
39
|
+
id: PathId;
|
|
40
|
+
input_path: InputPath;
|
|
41
|
+
resolved_input_path: ResolvedInputPath;
|
|
42
42
|
}
|
|
43
|
-
export interface
|
|
44
|
-
resolved_input_paths: Array<
|
|
45
|
-
possible_paths_by_input_path: Map<
|
|
46
|
-
unmapped_input_paths: Array<
|
|
43
|
+
export interface ResolvedInputPaths {
|
|
44
|
+
resolved_input_paths: Array<ResolvedInputPath>;
|
|
45
|
+
possible_paths_by_input_path: Map<InputPath, Array<PossiblePath>>;
|
|
46
|
+
unmapped_input_paths: Array<InputPath>;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Gets the path data for each input path, checking the filesystem for the possibilities
|
|
50
50
|
* and stopping at the first existing file or falling back to the first existing directory.
|
|
51
51
|
* If none is found for an input path, it's added to `unmapped_input_paths`.
|
|
52
52
|
*/
|
|
53
|
-
export declare const resolve_input_paths: (input_paths: Array<
|
|
54
|
-
export interface
|
|
55
|
-
resolved_input_files: Array<
|
|
56
|
-
resolved_input_files_by_root_dir: Map<
|
|
57
|
-
input_directories_with_no_files: Array<
|
|
53
|
+
export declare const resolve_input_paths: (input_paths: Array<InputPath>, root_dirs: Array<PathId>, extensions: Array<string>) => ResolvedInputPaths;
|
|
54
|
+
export interface ResolvedInputFiles {
|
|
55
|
+
resolved_input_files: Array<ResolvedInputFile>;
|
|
56
|
+
resolved_input_files_by_root_dir: Map<PathId, Array<ResolvedInputFile>>;
|
|
57
|
+
input_directories_with_no_files: Array<InputPath>;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Finds all of the matching files for the given input paths.
|
|
61
61
|
* De-dupes source ids.
|
|
62
62
|
*/
|
|
63
|
-
export declare const resolve_input_files: (resolved_input_paths: Array<
|
|
63
|
+
export declare const resolve_input_files: (resolved_input_paths: Array<ResolvedInputPath>, search?: (dir: string) => Array<ResolvedPath>) => ResolvedInputFiles;
|
|
64
64
|
//# sourceMappingURL=input_path.d.ts.map
|
package/dist/input_path.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input_path.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/input_path.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"input_path.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/input_path.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAW,MAAM,EAAE,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAO3E,eAAO,MAAM,SAAS,aAAa,CAAC;AACpC,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC;AAEzE,eAAO,MAAM,YAAY,aAAa,CAAC;AACvC,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,EAAE,cAAc,CAAC,CAAC;AAElF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GACzB,gBAAgB,YAAY,EAC5B,kBAAyB,KACvB,SAOF,CAAC;AAEF,eAAO,MAAM,cAAc,GAC1B,iBAAiB,KAAK,CAAC,YAAY,CAAC,EACpC,YAAY,MAAM,KAChB,KAAK,CAAC,SAAS,CAA4D,CAAC;AAE/E,MAAM,WAAW,YAAY;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,SAAS,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAC9B,YAAY,SAAS,EACrB,WAAW,KAAK,CAAC,MAAM,CAAC,EACxB,YAAY,KAAK,CAAC,MAAM,CAAC,KACvB,KAAK,CAAC,YAAY,CAsCpB,CAAC;AAEF,MAAM,WAAW,iBAAiB;IACjC,UAAU,EAAE,SAAS,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,SAAS,CAAC;IACtB,mBAAmB,EAAE,iBAAiB,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IAClC,oBAAoB,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC/C,4BAA4B,EAAE,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAClE,oBAAoB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CACvC;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC/B,aAAa,KAAK,CAAC,SAAS,CAAC,EAC7B,WAAW,KAAK,CAAC,MAAM,CAAC,EACxB,YAAY,KAAK,CAAC,MAAM,CAAC,KACvB,kBA+CF,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAClC,oBAAoB,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC/C,gCAAgC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACxE,+BAA+B,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAClD;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC/B,sBAAsB,KAAK,CAAC,iBAAiB,CAAC,EAC9C,SAAQ,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC,YAAY,CAAa,KACtD,kBA+DF,CAAC"}
|
package/dist/input_path.js
CHANGED
|
@@ -6,8 +6,8 @@ import { GRO_PACKAGE_DIR, GRO_DIST_DIR } from "./paths.js";
|
|
|
6
6
|
import { search_fs } from "./search_fs.js";
|
|
7
7
|
import { TASK_FILE_SUFFIX_JS } from "./task.js";
|
|
8
8
|
// TODO Flavored doesn't work when used in schemas, use Zod brand instead? problem is ergonomics
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
9
|
+
export const InputPath = z.string();
|
|
10
|
+
export const RawInputPath = z.string();
|
|
11
11
|
/**
|
|
12
12
|
* Raw input paths are paths that users provide to Gro to reference files for tasks and gen.
|
|
13
13
|
*
|
package/dist/invoke.js
CHANGED
|
@@ -15,7 +15,7 @@ and the rest of the args are forwarded to the task's `run` function.
|
|
|
15
15
|
|
|
16
16
|
*/
|
|
17
17
|
// handle uncaught errors
|
|
18
|
-
attach_process_error_handlers((err) => (err.constructor.name === '
|
|
18
|
+
attach_process_error_handlers((err) => (err.constructor.name === 'TaskError' ? 'TaskError' : null), (err) => (err.constructor.name === 'SilentError' ? '' : null));
|
|
19
19
|
if (!process.env.NO_COLOR) {
|
|
20
20
|
const { styleText } = await import('node:util');
|
|
21
21
|
configure_print_colors(styleText);
|