@ryanatkn/gro 0.177.0 → 0.178.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gen.d.ts.map +1 -1
- package/dist/gen.task.d.ts.map +1 -1
- package/dist/gen.task.js +1 -4
- package/dist/gro_plugin_sveltekit_app.d.ts +4 -4
- package/dist/gro_plugin_sveltekit_app.d.ts.map +1 -1
- package/dist/gro_plugin_sveltekit_app.js +15 -15
- package/dist/modules.d.ts.map +1 -1
- package/dist/parse_exports.d.ts +2 -2
- package/dist/parse_exports.d.ts.map +1 -1
- package/dist/run.task.d.ts.map +1 -1
- package/dist/run.task.js +6 -3
- package/dist/source_json.d.ts +8 -0
- package/dist/source_json.d.ts.map +1 -0
- package/dist/{src_json.js → source_json.js} +9 -9
- package/package.json +9 -9
- package/src/lib/gen.task.ts +1 -4
- package/src/lib/gen.ts +1 -3
- package/src/lib/gro_plugin_sveltekit_app.ts +17 -21
- package/src/lib/modules.ts +1 -4
- package/src/lib/parse_exports.ts +2 -2
- package/src/lib/parse_exports_context.ts +5 -5
- package/src/lib/run.task.ts +7 -3
- package/src/lib/{src_json.ts → source_json.ts} +13 -13
- package/dist/src_json.d.ts +0 -8
- package/dist/src_json.d.ts.map +0 -1
package/dist/gen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gen.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAGlD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAC;AAGvD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAGnD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EA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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gen.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gen.task.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAgB/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;
|
|
1
|
+
{"version":3,"file":"gen.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gen.task.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAgB/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;kBAUf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAqG3B,CAAC"}
|
package/dist/gen.task.js
CHANGED
|
@@ -12,10 +12,7 @@ import { write_gen_results, analyze_gen_results, find_genfiles, load_genfiles, }
|
|
|
12
12
|
import { SOURCE_DIRNAME } from "./constants.js";
|
|
13
13
|
/** @nodocs */
|
|
14
14
|
export const Args = z.strictObject({
|
|
15
|
-
_: z
|
|
16
|
-
.array(RawInputPath)
|
|
17
|
-
.meta({ description: 'input paths to generate' })
|
|
18
|
-
.default([SOURCE_DIRNAME]),
|
|
15
|
+
_: z.array(RawInputPath).meta({ description: 'input paths to generate' }).default([SOURCE_DIRNAME]),
|
|
19
16
|
root_dirs: z
|
|
20
17
|
.array(z.string())
|
|
21
18
|
.meta({ description: 'root directories to resolve input paths against' }) // TODO `PathId` schema
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Plugin } from './plugin.ts';
|
|
2
2
|
import { type PackageJsonMapper } from './package_json.ts';
|
|
3
|
-
import { type
|
|
3
|
+
import { type SourceJsonMapper } from './source_json.ts';
|
|
4
4
|
export interface GroPluginSveltekitAppOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Used for finalizing a SvelteKit build like adding a `.nojekyll` file for GitHub Pages.
|
|
@@ -13,10 +13,10 @@ export interface GroPluginSveltekitAppOptions {
|
|
|
13
13
|
*/
|
|
14
14
|
well_known_package_json?: boolean | PackageJsonMapper;
|
|
15
15
|
/**
|
|
16
|
-
* If truthy, adds `/.well-known/
|
|
16
|
+
* If truthy, adds `/.well-known/source.json` and `/.well-known/src/` to the static output.
|
|
17
17
|
* If a function, maps the value.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
well_known_source_json?: boolean | SourceJsonMapper;
|
|
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.
|
|
@@ -29,5 +29,5 @@ export interface GroPluginSveltekitAppOptions {
|
|
|
29
29
|
}
|
|
30
30
|
export type HostTarget = 'github_pages' | 'static' | 'node';
|
|
31
31
|
export type CopyFileFilter = (file_path: string) => boolean;
|
|
32
|
-
export declare const gro_plugin_sveltekit_app: ({ host_target, well_known_package_json,
|
|
32
|
+
export declare const gro_plugin_sveltekit_app: ({ host_target, well_known_package_json, well_known_source_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,
|
|
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,EAAyB,KAAK,iBAAiB,EAAoB,MAAM,mBAAmB,CAAC;AAGpG,OAAO,EAAC,KAAK,gBAAgB,EAA4C,MAAM,kBAAkB,CAAC;AAKlG,MAAM,WAAW,4BAA4B;IAC5C;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IAEzB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IAEtD;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAAC;IAEpD;;;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,oGAMtC,4BAAiC,KAAG,MA6GtC,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
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
|
-
import { serialize_package_json, load_package_json
|
|
4
|
+
import { serialize_package_json, load_package_json } from "./package_json.js";
|
|
5
5
|
import { TaskError } from "./task.js";
|
|
6
6
|
import { find_cli, spawn_cli, spawn_cli_process } from "./cli.js";
|
|
7
|
-
import {
|
|
7
|
+
import { source_json_serialize, source_json_create } from "./source_json.js";
|
|
8
8
|
import { EXPORTS_EXCLUDER_DEFAULT } from "./gro_config.js";
|
|
9
9
|
import { default_svelte_config } from "./svelte_config.js";
|
|
10
10
|
import { SOURCE_DIRNAME, VITE_CLI } from "./constants.js";
|
|
11
|
-
export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_known_package_json,
|
|
11
|
+
export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_known_package_json, well_known_source_json, well_known_src_files, vite_cli = VITE_CLI, } = {}) => {
|
|
12
12
|
let sveltekit_process = undefined;
|
|
13
13
|
return {
|
|
14
14
|
name: 'gro_plugin_sveltekit_app',
|
|
@@ -40,18 +40,18 @@ export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_kn
|
|
|
40
40
|
? package_json
|
|
41
41
|
: await well_known_package_json(package_json);
|
|
42
42
|
const serialized_package_json = mapped_package_json && serialize_package_json(mapped_package_json);
|
|
43
|
-
// `.well-known/
|
|
43
|
+
// `.well-known/source.json` and `.well-known/src/`
|
|
44
44
|
const final_package_json = mapped_package_json ?? package_json;
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
|
|
45
|
+
const source_json = source_json_create(final_package_json, undefined, log);
|
|
46
|
+
if (well_known_source_json === undefined) {
|
|
47
|
+
well_known_source_json = final_package_json.public; // eslint-disable-line no-param-reassign
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const mapped_source_json = !well_known_source_json
|
|
50
50
|
? null
|
|
51
|
-
:
|
|
52
|
-
?
|
|
53
|
-
: await
|
|
54
|
-
const
|
|
51
|
+
: well_known_source_json === true
|
|
52
|
+
? source_json
|
|
53
|
+
: await well_known_source_json(source_json);
|
|
54
|
+
const serialized_source_json = mapped_source_json && source_json_serialize(mapped_source_json);
|
|
55
55
|
// TODO this strategy means the files aren't available during development --
|
|
56
56
|
// maybe a Vite middleware is best? what if this plugin added its plugin to your `vite.config.ts`?
|
|
57
57
|
// copy files to `static` before building, in such a way
|
|
@@ -61,10 +61,10 @@ export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_kn
|
|
|
61
61
|
serialized_package_json
|
|
62
62
|
? create_temporarily(join(assets_path, '.well-known/package.json'), serialized_package_json)
|
|
63
63
|
: null,
|
|
64
|
-
|
|
65
|
-
? create_temporarily(join(assets_path, '.well-known/
|
|
64
|
+
serialized_source_json
|
|
65
|
+
? create_temporarily(join(assets_path, '.well-known/source.json'), serialized_source_json)
|
|
66
66
|
: null,
|
|
67
|
-
|
|
67
|
+
serialized_source_json && well_known_src_files
|
|
68
68
|
? copy_temporarily(SOURCE_DIRNAME, assets_path, '.well-known', well_known_src_files === true
|
|
69
69
|
? (file_path) => !EXPORTS_EXCLUDER_DEFAULT.test(file_path)
|
|
70
70
|
: well_known_src_files)
|
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,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,
|
|
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,MAA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,iBAAiB,CAAC,WAAW,SAAS,UAAU,IAAI,MAAM,CACrE;IACC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAC5B,EACD,kBAAkB,CAAC,WAAW,CAAC,CAC/B,CAAC;AAGF,eAAO,MAAM,YAAY,GACxB,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnC,WAAW,SAAS,UAAU,CAAC,OAAO,CAAC,EAEvC,sBAAsB,KAAK,CAAC,iBAAiB,CAAC,EAC9C,UAAU,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,IAAI,OAAO,EACtC,iBAAiB,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,GAAG,EAAE,OAAO,KAAK,WAAW,EACtF,UAAU,OAAO,KACf,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CA2CxC,CAAC"}
|
package/dist/parse_exports.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 {
|
|
4
|
+
import type { DeclarationKind } from '@ryanatkn/belt/source_json.js';
|
|
5
5
|
import type { PathId } from '@ryanatkn/belt/path.js';
|
|
6
6
|
export interface Declaration {
|
|
7
7
|
name: string;
|
|
8
|
-
kind:
|
|
8
|
+
kind: DeclarationKind | null;
|
|
9
9
|
}
|
|
10
10
|
export type ExportDeclaration = Flavored<Declaration, 'ExportDeclaration'>;
|
|
11
11
|
/**
|
|
@@ -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,YAAY,CAAC;AAE5B,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"parse_exports.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/parse_exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAKnD,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,aAAa,GACzB,IAAI,MAAM,EACV,UAAU,EAAE,CAAC,OAAO,EACpB,eAAc,KAAK,CAAC,iBAAiB,CAAM,EAC3C,MAAM,MAAM,KACV,KAAK,CAAC,iBAAiB,CAyBzB,CAAC;AAGF,eAAO,MAAM,iCAAiC,GAC7C,WAAW,MAAM,EACjB,eAAc,KAAK,CAAC,iBAAiB,CAAM,KACzC,KAAK,CAAC,iBAAiB,CA4BzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC9B,aAAa,EAAE,CAAC,UAAU,EAC1B,SAAS,EAAE,CAAC,OAAO,EACnB,SAAS,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,EACzB,eAAc,KAAK,CAAC,iBAAiB,CAAM,EAC3C,MAAM,MAAM,KACV,KAAK,CAAC,iBAAiB,CAIzB,CAAC"}
|
package/dist/run.task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/run.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAI/C;;;GAGG;AAEH,cAAc;AACd,eAAO,MAAM,IAAI;;8JAWf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"run.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/run.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAI/C;;;GAGG;AAEH,cAAc;AACd,eAAO,MAAM,IAAI;;8JAWf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA+B3B,CAAC"}
|
package/dist/run.task.js
CHANGED
|
@@ -3,7 +3,7 @@ import { styleText as st } from 'node:util';
|
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
4
|
import { TaskError } from "./task.js";
|
|
5
5
|
import { resolve_gro_module_path, spawn_with_loader } from "./gro_helpers.js";
|
|
6
|
-
import { serialize_args } from "./args.js";
|
|
6
|
+
import { serialize_args, to_implicit_forwarded_args } from "./args.js";
|
|
7
7
|
/**
|
|
8
8
|
* Runs a TypeScript file with Gro's loader, forwarding all args to the script.
|
|
9
9
|
* Useful for scripts that need SvelteKit shims ($lib, $env, etc).
|
|
@@ -33,8 +33,11 @@ export const task = {
|
|
|
33
33
|
if (!existsSync(path)) {
|
|
34
34
|
throw new TaskError('Cannot find file to run at path: ' + path);
|
|
35
35
|
}
|
|
36
|
-
//
|
|
37
|
-
|
|
36
|
+
// Get args after `--` without requiring a command name.
|
|
37
|
+
// This allows `gro run script.ts -- --help` to pass --help to the script.
|
|
38
|
+
const implicit_args = to_implicit_forwarded_args();
|
|
39
|
+
// Reconstruct argv: positional args + explicit named args + implicit args after --
|
|
40
|
+
const named_argv = serialize_args({ ...forwarded_args, ...implicit_args });
|
|
38
41
|
const full_argv = [...positional_argv, ...named_argv];
|
|
39
42
|
const loader_path = resolve_gro_module_path('loader.js');
|
|
40
43
|
const spawned = await spawn_with_loader(loader_path, path, full_argv);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PackageJson, PackageJsonExports } from '@ryanatkn/belt/package_json.js';
|
|
2
|
+
import { SourceJson, type ModuleJson } from '@ryanatkn/belt/source_json.js';
|
|
3
|
+
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
4
|
+
export type SourceJsonMapper = (source_json: SourceJson) => SourceJson | null | Promise<SourceJson | null>;
|
|
5
|
+
export declare const source_json_create: (package_json: PackageJson, lib_path?: string, log?: Logger) => SourceJson;
|
|
6
|
+
export declare const source_json_serialize: (source_json: SourceJson) => string;
|
|
7
|
+
export declare const source_modules_create: (exports: PackageJsonExports | undefined, lib_path?: string, log?: Logger) => Array<ModuleJson> | undefined;
|
|
8
|
+
//# sourceMappingURL=source_json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/source_json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAC,UAAU,EAAE,KAAK,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAChG,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAOlD,MAAM,MAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,UAAU,KAAK,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;AAE3G,eAAO,MAAM,kBAAkB,GAC9B,cAAc,WAAW,EACzB,WAAW,MAAM,EACjB,MAAM,MAAM,KACV,UAKA,CAAC;AAEJ,eAAO,MAAM,qBAAqB,GAAI,aAAa,UAAU,KAAG,MAG/D,CAAC;AAEF,eAAO,MAAM,qBAAqB,GACjC,SAAS,kBAAkB,GAAG,SAAS,EACvC,iBAAoB,EACpB,MAAM,MAAM,KACV,KAAK,CAAC,UAAU,CAAC,GAAG,SAgDtB,CAAC"}
|
|
@@ -2,21 +2,21 @@ import { join } from 'node:path';
|
|
|
2
2
|
import { ensure_end, strip_start } from '@ryanatkn/belt/string.js';
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
4
|
import ts from 'typescript';
|
|
5
|
-
import {
|
|
5
|
+
import { SourceJson } from '@ryanatkn/belt/source_json.js';
|
|
6
6
|
import { paths, replace_extension } from "./paths.js";
|
|
7
7
|
import { parse_exports } from "./parse_exports.js";
|
|
8
8
|
import { TS_MATCHER, SVELTE_MATCHER, JSON_MATCHER, CSS_MATCHER } from "./constants.js";
|
|
9
9
|
import { search_fs } from "./search_fs.js";
|
|
10
|
-
export const
|
|
10
|
+
export const source_json_create = (package_json, lib_path, log) => SourceJson.parse({
|
|
11
11
|
name: package_json.name,
|
|
12
12
|
version: package_json.version,
|
|
13
|
-
modules:
|
|
13
|
+
modules: source_modules_create(package_json.exports, lib_path, log),
|
|
14
14
|
});
|
|
15
|
-
export const
|
|
16
|
-
const parsed =
|
|
15
|
+
export const source_json_serialize = (source_json) => {
|
|
16
|
+
const parsed = SourceJson.parse(source_json);
|
|
17
17
|
return JSON.stringify(parsed, null, 2) + '\n';
|
|
18
18
|
};
|
|
19
|
-
export const
|
|
19
|
+
export const source_modules_create = (exports, lib_path = paths.lib, log) => {
|
|
20
20
|
if (!exports)
|
|
21
21
|
return;
|
|
22
22
|
const file_paths = collect_file_paths(exports, lib_path);
|
|
@@ -40,13 +40,13 @@ export const src_modules_create = (exports, lib_path = paths.lib, log) => {
|
|
|
40
40
|
// Process each file
|
|
41
41
|
for (const { file_path } of file_paths) {
|
|
42
42
|
const relative_path = file_path.replace(ensure_end(lib_path, '/'), '');
|
|
43
|
-
const
|
|
43
|
+
const declarations = parse_exports(file_path, program, undefined, log)
|
|
44
44
|
.filter((d) => d.kind !== null) // TODO maybe dont filter out?
|
|
45
45
|
.map(({ name, kind }) => ({ name, kind }));
|
|
46
|
-
result.push(
|
|
46
|
+
result.push(declarations.length
|
|
47
47
|
? {
|
|
48
48
|
path: relative_path,
|
|
49
|
-
|
|
49
|
+
declarations,
|
|
50
50
|
}
|
|
51
51
|
: {
|
|
52
52
|
path: relative_path,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryanatkn/gro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.178.0",
|
|
4
4
|
"description": "task runner and toolkit extending SvelteKit",
|
|
5
5
|
"motto": "generate, run, optimize",
|
|
6
6
|
"glyph": "🌰",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"dotenv": "^17.2.3",
|
|
54
54
|
"esm-env": "^1.2.2",
|
|
55
55
|
"mri": "^1.2.0",
|
|
56
|
-
"oxc-parser": "^0.
|
|
56
|
+
"oxc-parser": "^0.99.0",
|
|
57
57
|
"prettier": "^3.6.2",
|
|
58
58
|
"prettier-plugin-svelte": "^3.4.0",
|
|
59
59
|
"ts-blank-space": "^0.6.2",
|
|
60
60
|
"tslib": "^2.8.1",
|
|
61
|
-
"zod": "^4.1.
|
|
61
|
+
"zod": "^4.1.13"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@ryanatkn/belt": ">=0.39.0",
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@changesets/changelog-git": "^0.2.1",
|
|
84
84
|
"@changesets/types": "^6.1.0",
|
|
85
|
-
"@ryanatkn/belt": "^0.
|
|
85
|
+
"@ryanatkn/belt": "^0.40.0",
|
|
86
86
|
"@ryanatkn/eslint-config": "^0.9.0",
|
|
87
|
-
"@ryanatkn/fuz": "^0.
|
|
88
|
-
"@ryanatkn/fuz_code": "^0.
|
|
89
|
-
"@ryanatkn/moss": "^0.
|
|
87
|
+
"@ryanatkn/fuz": "^0.162.0",
|
|
88
|
+
"@ryanatkn/fuz_code": "^0.36.0",
|
|
89
|
+
"@ryanatkn/moss": "^0.39.0",
|
|
90
90
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
91
91
|
"@sveltejs/kit": "^2.49.0",
|
|
92
92
|
"@sveltejs/package": "^2.5.6",
|
|
@@ -95,10 +95,10 @@
|
|
|
95
95
|
"esbuild": "^0.27.0",
|
|
96
96
|
"eslint": "^9.39.1",
|
|
97
97
|
"eslint-plugin-svelte": "^3.13.0",
|
|
98
|
-
"svelte": "^5.
|
|
98
|
+
"svelte": "^5.44.0",
|
|
99
99
|
"svelte-check": "^4.3.4",
|
|
100
100
|
"typescript": "^5.9.3",
|
|
101
|
-
"typescript-eslint": "^8.
|
|
101
|
+
"typescript-eslint": "^8.48.0",
|
|
102
102
|
"vitest": "^4.0.13"
|
|
103
103
|
},
|
|
104
104
|
"prettier": {
|
package/src/lib/gen.task.ts
CHANGED
|
@@ -21,10 +21,7 @@ import {SOURCE_DIRNAME} from './constants.ts';
|
|
|
21
21
|
|
|
22
22
|
/** @nodocs */
|
|
23
23
|
export const Args = z.strictObject({
|
|
24
|
-
_: z
|
|
25
|
-
.array(RawInputPath)
|
|
26
|
-
.meta({description: 'input paths to generate'})
|
|
27
|
-
.default([SOURCE_DIRNAME]),
|
|
24
|
+
_: z.array(RawInputPath).meta({description: 'input paths to generate'}).default([SOURCE_DIRNAME]),
|
|
28
25
|
root_dirs: z
|
|
29
26
|
.array(z.string())
|
|
30
27
|
.meta({description: 'root directories to resolve input paths against'}) // TODO `PathId` schema
|
package/src/lib/gen.ts
CHANGED
|
@@ -210,9 +210,7 @@ export type AnalyzedGenResult =
|
|
|
210
210
|
has_changed: true;
|
|
211
211
|
};
|
|
212
212
|
|
|
213
|
-
export const analyze_gen_results = (
|
|
214
|
-
gen_results: GenResults,
|
|
215
|
-
): Promise<Array<AnalyzedGenResult>> =>
|
|
213
|
+
export const analyze_gen_results = (gen_results: GenResults): Promise<Array<AnalyzedGenResult>> =>
|
|
216
214
|
Promise.all(
|
|
217
215
|
gen_results.successes
|
|
218
216
|
.map((result) => result.files.map((file) => analyze_gen_result(file)))
|
|
@@ -4,14 +4,10 @@ import {dirname, join} from 'node:path';
|
|
|
4
4
|
|
|
5
5
|
import type {Plugin} from './plugin.ts';
|
|
6
6
|
import {serialize_args, to_forwarded_args} from './args.ts';
|
|
7
|
-
import {
|
|
8
|
-
serialize_package_json,
|
|
9
|
-
type PackageJsonMapper,
|
|
10
|
-
load_package_json,
|
|
11
|
-
} from './package_json.ts';
|
|
7
|
+
import {serialize_package_json, type PackageJsonMapper, load_package_json} from './package_json.ts';
|
|
12
8
|
import {TaskError} from './task.ts';
|
|
13
9
|
import {find_cli, spawn_cli, spawn_cli_process} from './cli.ts';
|
|
14
|
-
import {type
|
|
10
|
+
import {type SourceJsonMapper, source_json_serialize, source_json_create} from './source_json.ts';
|
|
15
11
|
import {EXPORTS_EXCLUDER_DEFAULT} from './gro_config.ts';
|
|
16
12
|
import {default_svelte_config} from './svelte_config.ts';
|
|
17
13
|
import {SOURCE_DIRNAME, VITE_CLI} from './constants.ts';
|
|
@@ -30,10 +26,10 @@ export interface GroPluginSveltekitAppOptions {
|
|
|
30
26
|
well_known_package_json?: boolean | PackageJsonMapper;
|
|
31
27
|
|
|
32
28
|
/**
|
|
33
|
-
* If truthy, adds `/.well-known/
|
|
29
|
+
* If truthy, adds `/.well-known/source.json` and `/.well-known/src/` to the static output.
|
|
34
30
|
* If a function, maps the value.
|
|
35
31
|
*/
|
|
36
|
-
|
|
32
|
+
well_known_source_json?: boolean | SourceJsonMapper;
|
|
37
33
|
|
|
38
34
|
/**
|
|
39
35
|
* If truthy, copies `src/` to `/.well-known/src/` to the static output.
|
|
@@ -53,7 +49,7 @@ export type CopyFileFilter = (file_path: string) => boolean;
|
|
|
53
49
|
export const gro_plugin_sveltekit_app = ({
|
|
54
50
|
host_target = 'github_pages',
|
|
55
51
|
well_known_package_json,
|
|
56
|
-
|
|
52
|
+
well_known_source_json,
|
|
57
53
|
well_known_src_files,
|
|
58
54
|
vite_cli = VITE_CLI,
|
|
59
55
|
}: GroPluginSveltekitAppOptions = {}): Plugin => {
|
|
@@ -93,18 +89,18 @@ export const gro_plugin_sveltekit_app = ({
|
|
|
93
89
|
const serialized_package_json =
|
|
94
90
|
mapped_package_json && serialize_package_json(mapped_package_json);
|
|
95
91
|
|
|
96
|
-
// `.well-known/
|
|
92
|
+
// `.well-known/source.json` and `.well-known/src/`
|
|
97
93
|
const final_package_json = mapped_package_json ?? package_json;
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
|
|
94
|
+
const source_json = source_json_create(final_package_json, undefined, log);
|
|
95
|
+
if (well_known_source_json === undefined) {
|
|
96
|
+
well_known_source_json = final_package_json.public; // eslint-disable-line no-param-reassign
|
|
101
97
|
}
|
|
102
|
-
const
|
|
98
|
+
const mapped_source_json = !well_known_source_json
|
|
103
99
|
? null
|
|
104
|
-
:
|
|
105
|
-
?
|
|
106
|
-
: await
|
|
107
|
-
const
|
|
100
|
+
: well_known_source_json === true
|
|
101
|
+
? source_json
|
|
102
|
+
: await well_known_source_json(source_json);
|
|
103
|
+
const serialized_source_json = mapped_source_json && source_json_serialize(mapped_source_json);
|
|
108
104
|
|
|
109
105
|
// TODO this strategy means the files aren't available during development --
|
|
110
106
|
// maybe a Vite middleware is best? what if this plugin added its plugin to your `vite.config.ts`?
|
|
@@ -119,10 +115,10 @@ export const gro_plugin_sveltekit_app = ({
|
|
|
119
115
|
serialized_package_json,
|
|
120
116
|
)
|
|
121
117
|
: null,
|
|
122
|
-
|
|
123
|
-
? create_temporarily(join(assets_path, '.well-known/
|
|
118
|
+
serialized_source_json
|
|
119
|
+
? create_temporarily(join(assets_path, '.well-known/source.json'), serialized_source_json)
|
|
124
120
|
: null,
|
|
125
|
-
|
|
121
|
+
serialized_source_json && well_known_src_files
|
|
126
122
|
? copy_temporarily(
|
|
127
123
|
SOURCE_DIRNAME,
|
|
128
124
|
assets_path,
|
package/src/lib/modules.ts
CHANGED
|
@@ -13,10 +13,7 @@ export interface ModuleMeta<TModule extends Record<string, any> = Record<string,
|
|
|
13
13
|
mod: TModule;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export type LoadModuleResult<TModule> = Result<
|
|
17
|
-
{id: PathId; mod: TModule},
|
|
18
|
-
LoadModuleFailure
|
|
19
|
-
>;
|
|
16
|
+
export type LoadModuleResult<TModule> = Result<{id: PathId; mod: TModule}, LoadModuleFailure>;
|
|
20
17
|
export type LoadModuleFailure =
|
|
21
18
|
| {ok: false; type: 'failed_import'; id: PathId; error: Error}
|
|
22
19
|
| {
|
package/src/lib/parse_exports.ts
CHANGED
|
@@ -2,7 +2,7 @@ import ts from 'typescript';
|
|
|
2
2
|
import {extname} from 'node:path';
|
|
3
3
|
import type {Flavored} from '@ryanatkn/belt/types.js';
|
|
4
4
|
import type {Logger} from '@ryanatkn/belt/log.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type {DeclarationKind} from '@ryanatkn/belt/source_json.js';
|
|
6
6
|
import type {PathId} from '@ryanatkn/belt/path.js';
|
|
7
7
|
|
|
8
8
|
import {TS_MATCHER} from './constants.ts';
|
|
@@ -10,7 +10,7 @@ import {ParseExportsContext} from './parse_exports_context.ts';
|
|
|
10
10
|
|
|
11
11
|
export interface Declaration {
|
|
12
12
|
name: string;
|
|
13
|
-
kind:
|
|
13
|
+
kind: DeclarationKind | null;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export type ExportDeclaration = Flavored<Declaration, 'ExportDeclaration'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import type {Logger} from '@ryanatkn/belt/log.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type {DeclarationKind} from '@ryanatkn/belt/source_json.js';
|
|
4
4
|
|
|
5
5
|
import type {ExportDeclaration} from './parse_exports.ts';
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ export class ParseExportsContext {
|
|
|
13
13
|
// Map of source file paths to their symbols
|
|
14
14
|
readonly #file_symbols: Map<string, ts.Symbol> = new Map();
|
|
15
15
|
// Cache for resolved symbols to avoid repeated resolution
|
|
16
|
-
readonly #symbol_kind_cache: Map<ts.Symbol,
|
|
16
|
+
readonly #symbol_kind_cache: Map<ts.Symbol, DeclarationKind> = new Map();
|
|
17
17
|
|
|
18
18
|
readonly log: Logger | undefined;
|
|
19
19
|
debug = process.env.DEBUG_EXPORTS === 'true';
|
|
@@ -75,7 +75,7 @@ export class ParseExportsContext {
|
|
|
75
75
|
/**
|
|
76
76
|
* Determine the kind of an export based on its symbol.
|
|
77
77
|
*/
|
|
78
|
-
#determine_export_kind(source_file: ts.SourceFile, symbol: ts.Symbol):
|
|
78
|
+
#determine_export_kind(source_file: ts.SourceFile, symbol: ts.Symbol): DeclarationKind {
|
|
79
79
|
// Check if this is a type-only export (no value export)
|
|
80
80
|
if (this.#is_type_only_export(source_file, symbol)) {
|
|
81
81
|
return 'type';
|
|
@@ -115,7 +115,7 @@ export class ParseExportsContext {
|
|
|
115
115
|
/**
|
|
116
116
|
* Infer the declaration kind from a symbol's declaration and type information.
|
|
117
117
|
*/
|
|
118
|
-
#infer_declaration_kind(symbol: ts.Symbol):
|
|
118
|
+
#infer_declaration_kind(symbol: ts.Symbol): DeclarationKind {
|
|
119
119
|
// Check symbol flags first for direct type matching
|
|
120
120
|
if (this.#is_class_symbol(symbol)) {
|
|
121
121
|
return 'class';
|
|
@@ -182,7 +182,7 @@ export class ParseExportsContext {
|
|
|
182
182
|
/**
|
|
183
183
|
* Infer the declaration kind from a specific declaration node.
|
|
184
184
|
*/
|
|
185
|
-
#infer_kind_from_declaration(decl: ts.Declaration):
|
|
185
|
+
#infer_kind_from_declaration(decl: ts.Declaration): DeclarationKind | null {
|
|
186
186
|
if (ts.isFunctionDeclaration(decl)) {
|
|
187
187
|
return 'function';
|
|
188
188
|
}
|
package/src/lib/run.task.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {existsSync} from 'node:fs';
|
|
|
4
4
|
|
|
5
5
|
import {TaskError, type Task} from './task.ts';
|
|
6
6
|
import {resolve_gro_module_path, spawn_with_loader} from './gro_helpers.ts';
|
|
7
|
-
import {serialize_args} from './args.ts';
|
|
7
|
+
import {serialize_args, to_implicit_forwarded_args} from './args.ts';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Runs a TypeScript file with Gro's loader, forwarding all args to the script.
|
|
@@ -43,8 +43,12 @@ export const task: Task<Args> = {
|
|
|
43
43
|
throw new TaskError('Cannot find file to run at path: ' + path);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
//
|
|
47
|
-
|
|
46
|
+
// Get args after `--` without requiring a command name.
|
|
47
|
+
// This allows `gro run script.ts -- --help` to pass --help to the script.
|
|
48
|
+
const implicit_args = to_implicit_forwarded_args();
|
|
49
|
+
|
|
50
|
+
// Reconstruct argv: positional args + explicit named args + implicit args after --
|
|
51
|
+
const named_argv = serialize_args({...forwarded_args, ...implicit_args});
|
|
48
52
|
const full_argv = [...positional_argv, ...named_argv];
|
|
49
53
|
|
|
50
54
|
const loader_path = resolve_gro_module_path('loader.js');
|
|
@@ -3,7 +3,7 @@ import {ensure_end, strip_start} from '@ryanatkn/belt/string.js';
|
|
|
3
3
|
import {existsSync} from 'node:fs';
|
|
4
4
|
import ts from 'typescript';
|
|
5
5
|
import type {PackageJson, PackageJsonExports} from '@ryanatkn/belt/package_json.js';
|
|
6
|
-
import {
|
|
6
|
+
import {SourceJson, type ModuleJson, type DeclarationKind} from '@ryanatkn/belt/source_json.js';
|
|
7
7
|
import type {Logger} from '@ryanatkn/belt/log.js';
|
|
8
8
|
|
|
9
9
|
import {paths, replace_extension} from './paths.ts';
|
|
@@ -11,25 +11,25 @@ import {parse_exports} from './parse_exports.ts';
|
|
|
11
11
|
import {TS_MATCHER, SVELTE_MATCHER, JSON_MATCHER, CSS_MATCHER} from './constants.ts';
|
|
12
12
|
import {search_fs} from './search_fs.ts';
|
|
13
13
|
|
|
14
|
-
export type
|
|
14
|
+
export type SourceJsonMapper = (source_json: SourceJson) => SourceJson | null | Promise<SourceJson | null>;
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const source_json_create = (
|
|
17
17
|
package_json: PackageJson,
|
|
18
18
|
lib_path?: string,
|
|
19
19
|
log?: Logger,
|
|
20
|
-
):
|
|
21
|
-
|
|
20
|
+
): SourceJson =>
|
|
21
|
+
SourceJson.parse({
|
|
22
22
|
name: package_json.name,
|
|
23
23
|
version: package_json.version,
|
|
24
|
-
modules:
|
|
24
|
+
modules: source_modules_create(package_json.exports, lib_path, log),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
export const
|
|
28
|
-
const parsed =
|
|
27
|
+
export const source_json_serialize = (source_json: SourceJson): string => {
|
|
28
|
+
const parsed = SourceJson.parse(source_json);
|
|
29
29
|
return JSON.stringify(parsed, null, 2) + '\n';
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
export const
|
|
32
|
+
export const source_modules_create = (
|
|
33
33
|
exports: PackageJsonExports | undefined,
|
|
34
34
|
lib_path = paths.lib,
|
|
35
35
|
log?: Logger,
|
|
@@ -64,15 +64,15 @@ export const src_modules_create = (
|
|
|
64
64
|
for (const {file_path} of file_paths) {
|
|
65
65
|
const relative_path = file_path.replace(ensure_end(lib_path, '/'), '');
|
|
66
66
|
|
|
67
|
-
const
|
|
68
|
-
.filter((d): d is {name: string; kind:
|
|
67
|
+
const declarations = parse_exports(file_path, program, undefined, log)
|
|
68
|
+
.filter((d): d is {name: string; kind: DeclarationKind} => d.kind !== null) // TODO maybe dont filter out?
|
|
69
69
|
.map(({name, kind}) => ({name, kind}));
|
|
70
70
|
|
|
71
71
|
result.push(
|
|
72
|
-
|
|
72
|
+
declarations.length
|
|
73
73
|
? {
|
|
74
74
|
path: relative_path,
|
|
75
|
-
|
|
75
|
+
declarations,
|
|
76
76
|
}
|
|
77
77
|
: {
|
|
78
78
|
path: relative_path,
|
package/dist/src_json.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { PackageJson, PackageJsonExports } from '@ryanatkn/belt/package_json.js';
|
|
2
|
-
import { SrcJson, type ModuleJson } from '@ryanatkn/belt/src_json.js';
|
|
3
|
-
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
4
|
-
export type SrcJsonMapper = (src_json: SrcJson) => SrcJson | null | Promise<SrcJson | null>;
|
|
5
|
-
export declare const src_json_create: (package_json: PackageJson, lib_path?: string, log?: Logger) => SrcJson;
|
|
6
|
-
export declare const src_json_serialize: (src_json: SrcJson) => string;
|
|
7
|
-
export declare const src_modules_create: (exports: PackageJsonExports | undefined, lib_path?: string, log?: Logger) => Array<ModuleJson> | undefined;
|
|
8
|
-
//# sourceMappingURL=src_json.d.ts.map
|
package/dist/src_json.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/src_json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAC,OAAO,EAAE,KAAK,UAAU,EAAsB,MAAM,4BAA4B,CAAC;AACzF,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAOlD,MAAM,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AAE5F,eAAO,MAAM,eAAe,GAC3B,cAAc,WAAW,EACzB,WAAW,MAAM,EACjB,MAAM,MAAM,KACV,OAKA,CAAC;AAEJ,eAAO,MAAM,kBAAkB,GAAI,UAAU,OAAO,KAAG,MAGtD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC9B,SAAS,kBAAkB,GAAG,SAAS,EACvC,iBAAoB,EACpB,MAAM,MAAM,KACV,KAAK,CAAC,UAAU,CAAC,GAAG,SAgDtB,CAAC"}
|