@ryanatkn/gro 0.167.1 → 0.169.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/changeset.task.d.ts +1 -1
- package/dist/changeset.task.d.ts.map +1 -1
- package/dist/changeset.task.js +1 -1
- package/dist/check.task.d.ts.map +1 -1
- package/dist/check.task.js +1 -1
- package/dist/clean.task.d.ts +1 -1
- package/dist/clean.task.d.ts.map +1 -1
- package/dist/clean.task.js +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/commit.task.d.ts +1 -1
- package/dist/commit.task.d.ts.map +1 -1
- package/dist/commit.task.js +1 -1
- package/dist/deploy.task.d.ts +3 -3
- package/dist/deploy.task.d.ts.map +1 -1
- package/dist/deploy.task.js +1 -1
- package/dist/disknode.d.ts +1 -1
- package/dist/disknode.d.ts.map +1 -1
- package/dist/env.d.ts +4 -3
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +17 -14
- package/dist/esbuild_plugin_external_worker.d.ts.map +1 -1
- package/dist/filer.d.ts +1 -1
- package/dist/filer.d.ts.map +1 -1
- package/dist/gen.d.ts +1 -1
- package/dist/gen.d.ts.map +1 -1
- package/dist/gen_helpers.d.ts +1 -1
- package/dist/gen_helpers.d.ts.map +1 -1
- package/dist/gro_config.d.ts +1 -1
- package/dist/gro_config.d.ts.map +1 -1
- package/dist/gro_plugin_server.d.ts +2 -2
- package/dist/gro_plugin_server.d.ts.map +1 -1
- package/dist/gro_plugin_sveltekit_app.js +1 -1
- package/dist/input_path.d.ts +1 -1
- package/dist/input_path.d.ts.map +1 -1
- package/dist/modules.d.ts +1 -1
- package/dist/modules.d.ts.map +1 -1
- package/dist/package.d.ts.map +1 -1
- package/dist/package.gen.js +2 -2
- package/dist/package.js +7 -41
- package/dist/package_json.d.ts.map +1 -1
- package/dist/package_json.js +4 -0
- package/dist/parse_exports.d.ts +1 -1
- package/dist/parse_exports.d.ts.map +1 -1
- package/dist/parse_imports.d.ts +1 -1
- package/dist/parse_imports.d.ts.map +1 -1
- package/dist/paths.d.ts +1 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/publish.task.d.ts +2 -2
- package/dist/publish.task.d.ts.map +1 -1
- package/dist/publish.task.js +1 -1
- package/dist/resolve_specifier.d.ts +1 -1
- package/dist/resolve_specifier.d.ts.map +1 -1
- package/dist/run_task.js +1 -1
- package/dist/search_fs.d.ts +1 -1
- package/dist/search_fs.d.ts.map +1 -1
- package/dist/src_json.d.ts +3 -2
- package/dist/src_json.d.ts.map +1 -1
- package/dist/src_json.js +7 -4
- package/dist/task.d.ts +1 -1
- package/dist/task.d.ts.map +1 -1
- package/dist/upgrade.task.d.ts +1 -1
- package/dist/upgrade.task.d.ts.map +1 -1
- package/dist/upgrade.task.js +1 -1
- package/dist/watch_dir.d.ts +10 -3
- package/dist/watch_dir.d.ts.map +1 -1
- package/dist/watch_dir.js +11 -2
- package/package.json +8 -4
- package/src/lib/changeset.task.ts +5 -1
- package/src/lib/check.task.ts +1 -1
- package/src/lib/clean.task.ts +1 -1
- package/src/lib/cli.ts +1 -1
- package/src/lib/commit.task.ts +1 -1
- package/src/lib/deploy.task.ts +6 -6
- package/src/lib/disknode.ts +1 -1
- package/src/lib/env.ts +16 -13
- package/src/lib/esbuild_plugin_external_worker.ts +1 -1
- package/src/lib/filer.ts +1 -1
- package/src/lib/gen.ts +1 -1
- package/src/lib/gen_helpers.ts +1 -1
- package/src/lib/gro_config.ts +1 -1
- package/src/lib/gro_plugin_server.ts +1 -1
- package/src/lib/gro_plugin_sveltekit_app.ts +1 -1
- package/src/lib/input_path.ts +1 -1
- package/src/lib/modules.ts +1 -1
- package/src/lib/package.gen.ts +2 -2
- package/src/lib/package.ts +7 -41
- package/src/lib/package_json.ts +4 -0
- package/src/lib/parse_exports.ts +1 -1
- package/src/lib/parse_imports.ts +1 -1
- package/src/lib/paths.ts +1 -1
- package/src/lib/publish.task.ts +8 -8
- package/src/lib/resolve_specifier.ts +1 -1
- package/src/lib/run_task.ts +1 -1
- package/src/lib/search_fs.ts +1 -2
- package/src/lib/src_json.ts +12 -3
- package/src/lib/task.ts +1 -1
- package/src/lib/upgrade.task.ts +1 -1
- package/src/lib/watch_dir.ts +27 -3
- package/dist/git.d.ts +0 -81
- package/dist/git.d.ts.map +0 -1
- package/dist/git.js +0 -218
- package/dist/path.d.ts +0 -17
- package/dist/path.d.ts.map +0 -1
- package/dist/path.js +0 -2
- package/src/lib/git.ts +0 -298
- package/src/lib/path.ts +0 -23
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":"
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/paths.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,wBAAwB,CAAC;AAkBpD,eAAO,MAAM,WAAW,QAA2C,CAAC;AACpE,eAAO,MAAM,QAAQ,QAA2B,CAAC;AACjD,sBAAsB;AACtB,eAAO,MAAM,OAAO,QAAiB,CAAC;AACtC,eAAO,MAAM,cAAc,QAA8C,CAAC;AAE1E,MAAM,WAAW,KAAK;IACrB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,YAAY,GAAI,UAAU,MAAM,KAAG,KAW/C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,IAAI,OAAO,KAAG,KAA4C,CAAC;AAEvF,eAAO,MAAM,SAAS,GAAI,IAAI,OAAO,KAAG,OACgC,CAAC;AAGzE,eAAO,MAAM,YAAY,GAAI,IAAI,OAAO,EAAE,SAAmB,KAAG,MACnC,CAAC;AAG9B,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,EAAE,SAAwB,KAAG,MACtD,CAAC;AAI7B,eAAO,MAAM,oBAAoB,GAAI,WAAW,MAAM,EAAE,SAA0B,KAAG,OAC3D,CAAC;AAE3B,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,SAAqB,KAAG,MAMhE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,EAAE,eAAe,MAAM,KAAG,MAGvE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,OAA8B,CAAC;AAEjD,sBAAsB;AACtB,eAAO,MAAM,eAAe,SAAS,CAAC;AAYtC,eAAO,MAAM,WAAW,SAAsC,CAAC;AAC/D;;GAEG;AACH,eAAO,MAAM,SAAS,OAA2D,CAAC;AAClF,sBAAsB;AACtB,eAAO,MAAM,YAAY,QAAgD,CAAC"}
|
package/dist/publish.task.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type Task } from './task.ts';
|
|
3
3
|
export declare const Args: z.ZodObject<{
|
|
4
|
-
branch:
|
|
5
|
-
origin:
|
|
4
|
+
branch: any;
|
|
5
|
+
origin: any;
|
|
6
6
|
changelog: z.ZodDefault<z.ZodString>;
|
|
7
7
|
preserve_changelog: z.ZodDefault<z.ZodBoolean>;
|
|
8
8
|
optional: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -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;
|
|
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,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAQhD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;kBAgCf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA2I3B,CAAC"}
|
package/dist/publish.task.js
CHANGED
|
@@ -2,13 +2,13 @@ import { spawn } from '@ryanatkn/belt/process.js';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { styleText as st } from 'node:util';
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
|
+
import { Git_Branch, Git_Origin, git_check_clean_workspace, git_checkout, git_fetch, git_pull, } from '@ryanatkn/belt/git.js';
|
|
5
6
|
import { Task_Error } from "./task.js";
|
|
6
7
|
import { load_package_json, parse_repo_url } from "./package_json.js";
|
|
7
8
|
import { find_cli, spawn_cli } from "./cli.js";
|
|
8
9
|
import { has_sveltekit_library } from "./sveltekit_helpers.js";
|
|
9
10
|
import { update_changelog } from "./changelog.js";
|
|
10
11
|
import { load_from_env } from "./env.js";
|
|
11
|
-
import { Git_Branch, Git_Origin, git_check_clean_workspace, git_checkout, git_fetch, git_pull, } from "./git.js";
|
|
12
12
|
import { CHANGESET_CLI } from "./changeset_helpers.js";
|
|
13
13
|
export const Args = z.strictObject({
|
|
14
14
|
branch: Git_Branch.describe('branch to publish from').default('main'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve_specifier.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/resolve_specifier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve_specifier.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/resolve_specifier.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,wBAAwB,CAAC;AAMpD,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,SAAS,GAAG,4BAA4B,GAAG,4BAA4B,CAAC;IACnF,GAAG,EAAE,OAAO,CAAC;CACb;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,MAAM,EAAE,KAAK,MAAM,KAAG,kBAgDlE,CAAC"}
|
package/dist/run_task.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styleText as st } from 'node:util';
|
|
2
2
|
import { print_log_label } from '@ryanatkn/belt/print.js';
|
|
3
3
|
import { System_Logger } from '@ryanatkn/belt/log.js';
|
|
4
|
-
import z from 'zod';
|
|
4
|
+
import { z } from 'zod';
|
|
5
5
|
import { parse_args } from "./args.js";
|
|
6
6
|
import { log_task_help } from "./task_logging.js";
|
|
7
7
|
import { Task_Error } from "./task.js";
|
package/dist/search_fs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { File_Filter, Resolved_Path, Path_Filter } from '
|
|
1
|
+
import type { File_Filter, Resolved_Path, Path_Filter } from '@ryanatkn/belt/path.js';
|
|
2
2
|
export interface Search_Fs_Options {
|
|
3
3
|
/**
|
|
4
4
|
* One or more filter functions, any of which can short-circuit the search by returning `false`.
|
package/dist/search_fs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search_fs.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/search_fs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search_fs.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/search_fs.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,WAAW,EAAE,aAAa,EAAE,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAEpF,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;IAC1C;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;IAC/C;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,KAAK,MAAM,CAAC,CAAC;IACzE;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,GACrB,KAAK,MAAM,EACX,UAAS,iBAAgC,KACvC,KAAK,CAAC,aAAa,CAwBrB,CAAC;AAmCF,eAAO,MAAM,wBAAwB,GAAI,OAAO,KAAK,CAAC,MAAM,CAAC,KAAG,MAAM,GAAG,IAOxE,CAAC"}
|
package/dist/src_json.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Package_Json, Package_Json_Exports } from '@ryanatkn/belt/package_json.js';
|
|
2
2
|
import { Src_Json, Src_Modules } from '@ryanatkn/belt/src_json.js';
|
|
3
|
+
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
3
4
|
export type Map_Src_Json = (src_json: Src_Json) => Src_Json | null | Promise<Src_Json | null>;
|
|
4
|
-
export declare const create_src_json: (package_json: Package_Json, lib_path?: string) => Src_Json;
|
|
5
|
+
export declare const create_src_json: (package_json: Package_Json, lib_path?: string, log?: Logger) => Src_Json;
|
|
5
6
|
export declare const serialize_src_json: (src_json: Src_Json) => string;
|
|
6
|
-
export declare const to_src_modules: (exports: Package_Json_Exports | undefined, lib_path?: string) => Src_Modules | undefined;
|
|
7
|
+
export declare const to_src_modules: (exports: Package_Json_Exports | undefined, lib_path?: string, log?: Logger) => Src_Modules | undefined;
|
|
7
8
|
//# sourceMappingURL=src_json.d.ts.map
|
package/dist/src_json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"src_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/src_json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAE,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"src_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/src_json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAE,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAOlD,MAAM,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;AAE9F,eAAO,MAAM,eAAe,GAC3B,cAAc,YAAY,EAC1B,WAAW,MAAM,EACjB,MAAM,MAAM,KACV,QAKA,CAAC;AAEJ,eAAO,MAAM,kBAAkB,GAAI,UAAU,QAAQ,KAAG,MAGvD,CAAC;AAEF,eAAO,MAAM,cAAc,GAC1B,SAAS,oBAAoB,GAAG,SAAS,EACzC,iBAAoB,EACpB,MAAM,MAAM,KACV,WAAW,GAAG,SA+ChB,CAAC"}
|
package/dist/src_json.js
CHANGED
|
@@ -7,16 +7,16 @@ 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 create_src_json = (package_json, lib_path) => Src_Json.parse({
|
|
10
|
+
export const create_src_json = (package_json, lib_path, log) => Src_Json.parse({
|
|
11
11
|
name: package_json.name,
|
|
12
12
|
version: package_json.version,
|
|
13
|
-
modules: to_src_modules(package_json.exports, lib_path),
|
|
13
|
+
modules: to_src_modules(package_json.exports, lib_path, log),
|
|
14
14
|
});
|
|
15
15
|
export const serialize_src_json = (src_json) => {
|
|
16
16
|
const parsed = Src_Json.parse(src_json); // TODO can parse do the logic that normalize does? see `.transform`
|
|
17
17
|
return JSON.stringify(parsed, null, 2) + '\n';
|
|
18
18
|
};
|
|
19
|
-
export const to_src_modules = (exports, lib_path = paths.lib) => {
|
|
19
|
+
export const to_src_modules = (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,7 +40,10 @@ export const to_src_modules = (exports, lib_path = paths.lib) => {
|
|
|
40
40
|
// Process each file
|
|
41
41
|
for (const { export_key, file_path } of file_paths) {
|
|
42
42
|
const relative_path = file_path.replace(ensure_end(lib_path, '/'), '');
|
|
43
|
-
const declarations = parse_exports(file_path, program).map(({ name, kind }) => ({
|
|
43
|
+
const declarations = parse_exports(file_path, program, undefined, log).map(({ name, kind }) => ({
|
|
44
|
+
name,
|
|
45
|
+
kind,
|
|
46
|
+
}));
|
|
44
47
|
result[export_key] = declarations.length
|
|
45
48
|
? {
|
|
46
49
|
path: relative_path,
|
package/dist/task.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { Logger } from '@ryanatkn/belt/log.js';
|
|
|
2
2
|
import type { z } from 'zod';
|
|
3
3
|
import type { Timings } from '@ryanatkn/belt/timings.js';
|
|
4
4
|
import type { Result } from '@ryanatkn/belt/result.js';
|
|
5
|
+
import type { Path_Id } from '@ryanatkn/belt/path.js';
|
|
5
6
|
import type { Args } from './args.ts';
|
|
6
|
-
import type { Path_Id } from './path.ts';
|
|
7
7
|
import type { Gro_Config } from './gro_config.ts';
|
|
8
8
|
import type { Parsed_Svelte_Config } from './svelte_config.ts';
|
|
9
9
|
import { type Input_Path, type Resolved_Input_File, type Resolved_Input_Path } from './input_path.ts';
|
package/dist/task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAC;AAEvD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/task.ts"],"names":[],"mappings":"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"}
|
package/dist/upgrade.task.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type Task } from './task.ts';
|
|
|
3
3
|
export declare const Args: z.ZodObject<{
|
|
4
4
|
_: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
5
5
|
only: z.ZodPipe<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>, z.ZodTransform<string[], string | string[]>>;
|
|
6
|
-
origin:
|
|
6
|
+
origin: any;
|
|
7
7
|
force: z.ZodDefault<z.ZodBoolean>;
|
|
8
8
|
pull: z.ZodDefault<z.ZodBoolean>;
|
|
9
9
|
'no-pull': z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/upgrade.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"upgrade.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/upgrade.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAMhD,eAAO,MAAM,IAAI;;;;;;;;;;;;kBAiCf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA4E3B,CAAC"}
|
package/dist/upgrade.task.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { spawn } from '@ryanatkn/belt/process.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { rmSync } from 'node:fs';
|
|
4
|
+
import { Git_Origin, git_pull } from '@ryanatkn/belt/git.js';
|
|
4
5
|
import { Task_Error } from "./task.js";
|
|
5
6
|
import { extract_deps, load_package_json } from "./package_json.js";
|
|
6
|
-
import { Git_Origin, git_pull } from "./git.js";
|
|
7
7
|
import { spawn_cli } from "./cli.js";
|
|
8
8
|
import { serialize_args, to_forwarded_args } from "./args.js";
|
|
9
9
|
import { NODE_MODULES_DIRNAME } from "./constants.js";
|
package/dist/watch_dir.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ChokidarOptions } from 'chokidar';
|
|
2
|
-
import type { Path_Filter } from '
|
|
1
|
+
import { type ChokidarOptions, type Matcher } from 'chokidar';
|
|
2
|
+
import type { Path_Filter } from '@ryanatkn/belt/path.js';
|
|
3
3
|
export interface Watch_Node_Fs {
|
|
4
4
|
init: () => Promise<void>;
|
|
5
5
|
close: () => Promise<void>;
|
|
@@ -21,9 +21,16 @@ export interface Watch_Dir_Options {
|
|
|
21
21
|
* @default true
|
|
22
22
|
*/
|
|
23
23
|
absolute?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Pattern to ignore files, merged into `chokidar.ignored` if also provided.
|
|
26
|
+
* - `undefined` (default) ignores files matching `.tmp.` pattern
|
|
27
|
+
* - `null` sets no default ignore pattern
|
|
28
|
+
* - or some custom pattern
|
|
29
|
+
*/
|
|
30
|
+
ignored?: Matcher | null;
|
|
24
31
|
}
|
|
25
32
|
/**
|
|
26
33
|
* Watch for changes on the filesystem using chokidar.
|
|
27
34
|
*/
|
|
28
|
-
export declare const watch_dir: ({ dir, on_change, filter, absolute, chokidar, }: Watch_Dir_Options) => Watch_Node_Fs;
|
|
35
|
+
export declare const watch_dir: ({ dir, on_change, filter, absolute, chokidar, ignored, }: Watch_Dir_Options) => Watch_Node_Fs;
|
|
29
36
|
//# sourceMappingURL=watch_dir.d.ts.map
|
package/dist/watch_dir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch_dir.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/watch_dir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"watch_dir.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/watch_dir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,eAAe,EAAkB,KAAK,OAAO,EAAC,MAAM,UAAU,CAAC;AAInF,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAOxD,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC9D,MAAM,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,uBAAuB,CAAC;IACnC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,0DAOvB,iBAAiB,KAAG,aA+CtB,CAAC"}
|
package/dist/watch_dir.js
CHANGED
|
@@ -2,10 +2,12 @@ import { watch } from 'chokidar';
|
|
|
2
2
|
import { relative } from 'node:path';
|
|
3
3
|
import { statSync } from 'node:fs';
|
|
4
4
|
import { create_deferred } from '@ryanatkn/belt/async.js';
|
|
5
|
+
import { EMPTY_OBJECT } from '@ryanatkn/belt/object.js';
|
|
6
|
+
const TMP_FILE_PATTERN = /\.tmp\./;
|
|
5
7
|
/**
|
|
6
8
|
* Watch for changes on the filesystem using chokidar.
|
|
7
9
|
*/
|
|
8
|
-
export const watch_dir = ({ dir, on_change, filter, absolute = true, chokidar, }) => {
|
|
10
|
+
export const watch_dir = ({ dir, on_change, filter, absolute = true, chokidar, ignored = TMP_FILE_PATTERN, }) => {
|
|
9
11
|
let watcher;
|
|
10
12
|
let initing;
|
|
11
13
|
return {
|
|
@@ -13,7 +15,7 @@ export const watch_dir = ({ dir, on_change, filter, absolute = true, chokidar, }
|
|
|
13
15
|
if (initing)
|
|
14
16
|
return initing.promise;
|
|
15
17
|
initing = create_deferred();
|
|
16
|
-
watcher = watch(dir,
|
|
18
|
+
watcher = watch(dir, resolve_chokidar_options(chokidar, ignored));
|
|
17
19
|
watcher.on('add', (path) => {
|
|
18
20
|
const final_path = absolute ? path : relative(dir, path);
|
|
19
21
|
if (filter && !filter(final_path, false))
|
|
@@ -58,3 +60,10 @@ export const watch_dir = ({ dir, on_change, filter, absolute = true, chokidar, }
|
|
|
58
60
|
},
|
|
59
61
|
};
|
|
60
62
|
};
|
|
63
|
+
const resolve_chokidar_options = (options, ignored) => {
|
|
64
|
+
if (ignored === null)
|
|
65
|
+
return options;
|
|
66
|
+
const { ignored: i, ...rest } = options ?? EMPTY_OBJECT;
|
|
67
|
+
const resolved_ignored = i === undefined ? ignored : Array.isArray(i) ? [...i, ignored] : [i, ignored];
|
|
68
|
+
return { ...rest, ignored: resolved_ignored };
|
|
69
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryanatkn/gro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.169.0",
|
|
4
4
|
"description": "task runner and toolkit extending SvelteKit",
|
|
5
5
|
"motto": "generate, run, optimize",
|
|
6
6
|
"glyph": "🌰",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"typescript"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@ryanatkn/belt": "^0.
|
|
52
|
+
"@ryanatkn/belt": "^0.35.1",
|
|
53
53
|
"chokidar": "^4.0.3",
|
|
54
54
|
"dotenv": "^17.2.2",
|
|
55
55
|
"esm-env": "^1.2.2",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"@changesets/changelog-git": "^0.2.1",
|
|
84
84
|
"@changesets/types": "^6.1.0",
|
|
85
85
|
"@ryanatkn/eslint-config": "^0.8.0",
|
|
86
|
-
"@ryanatkn/fuz": "^0.
|
|
87
|
-
"@ryanatkn/moss": "^0.
|
|
86
|
+
"@ryanatkn/fuz": "^0.147.0",
|
|
87
|
+
"@ryanatkn/moss": "^0.36.0",
|
|
88
88
|
"@sveltejs/adapter-static": "^3.0.9",
|
|
89
89
|
"@sveltejs/kit": "^2.37.1",
|
|
90
90
|
"@sveltejs/package": "^2.5.0",
|
|
@@ -134,6 +134,10 @@
|
|
|
134
134
|
"./*.js": {
|
|
135
135
|
"types": "./dist/*.d.ts",
|
|
136
136
|
"default": "./dist/*.js"
|
|
137
|
+
},
|
|
138
|
+
"./*.ts": {
|
|
139
|
+
"types": "./dist/*.d.ts",
|
|
140
|
+
"default": "./dist/*.js"
|
|
137
141
|
}
|
|
138
142
|
}
|
|
139
143
|
}
|
|
@@ -5,10 +5,14 @@ import type {WrittenConfig} from '@changesets/types';
|
|
|
5
5
|
import {readFile, writeFile} from 'node:fs/promises';
|
|
6
6
|
import {join} from 'node:path';
|
|
7
7
|
import {existsSync, readdirSync} from 'node:fs';
|
|
8
|
+
import {
|
|
9
|
+
Git_Origin,
|
|
10
|
+
git_check_fully_staged_workspace,
|
|
11
|
+
git_push_to_create,
|
|
12
|
+
} from '@ryanatkn/belt/git.js';
|
|
8
13
|
|
|
9
14
|
import {Task_Error, type Task} from './task.ts';
|
|
10
15
|
import {find_cli, spawn_cli} from './cli.ts';
|
|
11
|
-
import {Git_Origin, git_check_fully_staged_workspace, git_push_to_create} from './git.ts';
|
|
12
16
|
import {has_sveltekit_library} from './sveltekit_helpers.ts';
|
|
13
17
|
import {
|
|
14
18
|
CHANGESET_CLI,
|
package/src/lib/check.task.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {z} from 'zod';
|
|
2
2
|
import {spawn} from '@ryanatkn/belt/process.js';
|
|
3
3
|
import {styleText as st} from 'node:util';
|
|
4
|
+
import {git_check_clean_workspace} from '@ryanatkn/belt/git.js';
|
|
4
5
|
|
|
5
6
|
import {Task_Error, type Task} from './task.ts';
|
|
6
|
-
import {git_check_clean_workspace} from './git.ts';
|
|
7
7
|
import {sync_package_json} from './package_json.ts';
|
|
8
8
|
|
|
9
9
|
export const Args = z.strictObject({
|
package/src/lib/clean.task.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {spawn} from '@ryanatkn/belt/process.js';
|
|
2
2
|
import {z} from 'zod';
|
|
3
|
+
import {Git_Origin} from '@ryanatkn/belt/git.js';
|
|
3
4
|
|
|
4
5
|
import type {Task} from './task.ts';
|
|
5
6
|
import {clean_fs} from './clean_fs.ts';
|
|
6
|
-
import {Git_Origin} from './git.ts';
|
|
7
7
|
|
|
8
8
|
export const Args = z.strictObject({
|
|
9
9
|
build_dev: z.boolean().meta({description: 'delete the Gro build dev directory'}).default(false),
|
package/src/lib/cli.ts
CHANGED
|
@@ -9,9 +9,9 @@ import {join} from 'node:path';
|
|
|
9
9
|
import {existsSync} from 'node:fs';
|
|
10
10
|
import {fileURLToPath, type URL} from 'node:url';
|
|
11
11
|
import type {Logger} from '@ryanatkn/belt/log.js';
|
|
12
|
+
import type {Path_Id} from '@ryanatkn/belt/path.js';
|
|
12
13
|
|
|
13
14
|
import {NODE_MODULES_DIRNAME} from './constants.ts';
|
|
14
|
-
import type {Path_Id} from './path.ts';
|
|
15
15
|
import {print_command_args} from './args.ts';
|
|
16
16
|
|
|
17
17
|
// TODO maybe upstream to Belt?
|
package/src/lib/commit.task.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {spawn} from '@ryanatkn/belt/process.js';
|
|
2
2
|
import {z} from 'zod';
|
|
3
|
+
import {Git_Origin, git_current_branch_name, git_push} from '@ryanatkn/belt/git.js';
|
|
3
4
|
|
|
4
5
|
import type {Task} from './task.ts';
|
|
5
|
-
import {Git_Origin, git_current_branch_name, git_push} from './git.ts';
|
|
6
6
|
|
|
7
7
|
export const Args = z.strictObject({
|
|
8
8
|
_: z
|
package/src/lib/deploy.task.ts
CHANGED
|
@@ -5,11 +5,6 @@ import {z} from 'zod';
|
|
|
5
5
|
import {cp, mkdir, rm} from 'node:fs/promises';
|
|
6
6
|
import {join, resolve} from 'node:path';
|
|
7
7
|
import {existsSync, readdirSync} from 'node:fs';
|
|
8
|
-
|
|
9
|
-
import {Task_Error, type Task} from './task.ts';
|
|
10
|
-
import {print_path} from './paths.ts';
|
|
11
|
-
import {GRO_DIRNAME, GIT_DIRNAME, SVELTEKIT_BUILD_DIRNAME} from './constants.ts';
|
|
12
|
-
import {empty_dir} from './fs.ts';
|
|
13
8
|
import {
|
|
14
9
|
git_check_clean_workspace,
|
|
15
10
|
git_checkout,
|
|
@@ -25,7 +20,12 @@ import {
|
|
|
25
20
|
git_check_setting_pull_rebase,
|
|
26
21
|
git_clone_locally,
|
|
27
22
|
git_current_branch_name,
|
|
28
|
-
} from '
|
|
23
|
+
} from '@ryanatkn/belt/git.js';
|
|
24
|
+
|
|
25
|
+
import {Task_Error, type Task} from './task.ts';
|
|
26
|
+
import {print_path} from './paths.ts';
|
|
27
|
+
import {GRO_DIRNAME, GIT_DIRNAME, SVELTEKIT_BUILD_DIRNAME} from './constants.ts';
|
|
28
|
+
import {empty_dir} from './fs.ts';
|
|
29
29
|
|
|
30
30
|
// docs at ./docs/deploy.md
|
|
31
31
|
|
package/src/lib/disknode.ts
CHANGED
package/src/lib/env.ts
CHANGED
|
@@ -18,6 +18,22 @@ export const load_env = (
|
|
|
18
18
|
return merge_envs(envs, visibility, public_prefix, private_prefix);
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Loads a single env value without merging it into `process.env`.
|
|
23
|
+
* By default searches process.env, then a local `.env` if one exists, then `../.env` if it exists.
|
|
24
|
+
* Empty strings are semantically the same as `undefined` for more ergonomic fallbacks.
|
|
25
|
+
*/
|
|
26
|
+
export const load_from_env = (key: string, paths = ['.env', '../.env']): string | undefined => {
|
|
27
|
+
let v = process.env[key];
|
|
28
|
+
if (v) return v;
|
|
29
|
+
for (const path of paths) {
|
|
30
|
+
const env = load(path);
|
|
31
|
+
v = env?.[key];
|
|
32
|
+
if (v) return v;
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
21
37
|
const load = (path: string): Record<string, string> | undefined => {
|
|
22
38
|
if (!existsSync(path)) return;
|
|
23
39
|
const loaded = readFileSync(path, 'utf8');
|
|
@@ -60,16 +76,3 @@ export const is_public_env = (
|
|
|
60
76
|
private_prefix: string,
|
|
61
77
|
): boolean =>
|
|
62
78
|
key.startsWith(public_prefix) && (private_prefix === '' || !key.startsWith(private_prefix));
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Loads a single env value without merging it into `process.env`.
|
|
66
|
-
* By default searches process.env, then a local `.env` if one exists, then `../.env` if it exists.
|
|
67
|
-
*/
|
|
68
|
-
export const load_from_env = (key: string, paths = ['.env', '../.env']): string | undefined => {
|
|
69
|
-
if (process.env[key]) return process.env[key];
|
|
70
|
-
for (const path of paths) {
|
|
71
|
-
const env = load(path);
|
|
72
|
-
if (env?.[key]) return env[key];
|
|
73
|
-
}
|
|
74
|
-
return undefined;
|
|
75
|
-
};
|
|
@@ -2,6 +2,7 @@ import * as esbuild from 'esbuild';
|
|
|
2
2
|
import type {Logger} from '@ryanatkn/belt/log.js';
|
|
3
3
|
import {basename} from 'node:path';
|
|
4
4
|
import type {CompileOptions, ModuleCompileOptions, PreprocessorGroup} from 'svelte/compiler';
|
|
5
|
+
import type {Path_Id} from '@ryanatkn/belt/path.js';
|
|
5
6
|
|
|
6
7
|
import {print_build_result, to_define_import_meta_env} from './esbuild_helpers.ts';
|
|
7
8
|
import {resolve_specifier} from './resolve_specifier.ts';
|
|
@@ -11,7 +12,6 @@ import {esbuild_plugin_sveltekit_shim_app} from './esbuild_plugin_sveltekit_shim
|
|
|
11
12
|
import {esbuild_plugin_sveltekit_local_imports} from './esbuild_plugin_sveltekit_local_imports.ts';
|
|
12
13
|
import {esbuild_plugin_svelte} from './esbuild_plugin_svelte.ts';
|
|
13
14
|
import type {Parsed_Svelte_Config} from './svelte_config.ts';
|
|
14
|
-
import type {Path_Id} from './path.ts';
|
|
15
15
|
|
|
16
16
|
export interface Esbuild_Plugin_External_Worker_Options {
|
|
17
17
|
dev: boolean;
|
package/src/lib/filer.ts
CHANGED
|
@@ -7,8 +7,8 @@ import {fileURLToPath, pathToFileURL} from 'node:url';
|
|
|
7
7
|
import {Unreachable_Error} from '@ryanatkn/belt/error.js';
|
|
8
8
|
import type {Logger} from '@ryanatkn/belt/log.js';
|
|
9
9
|
import type {Package_Json} from '@ryanatkn/belt/package_json.js';
|
|
10
|
+
import type {File_Filter, Path_Id} from '@ryanatkn/belt/path.js';
|
|
10
11
|
|
|
11
|
-
import type {File_Filter, Path_Id} from './path.ts';
|
|
12
12
|
import {
|
|
13
13
|
watch_dir,
|
|
14
14
|
type Watch_Node_Fs,
|
package/src/lib/gen.ts
CHANGED
|
@@ -5,9 +5,9 @@ import type {Result} from '@ryanatkn/belt/result.js';
|
|
|
5
5
|
import type {Timings} from '@ryanatkn/belt/timings.js';
|
|
6
6
|
import {styleText as st} from 'node:util';
|
|
7
7
|
import {existsSync} from 'node:fs';
|
|
8
|
+
import type {Path_Id} from '@ryanatkn/belt/path.js';
|
|
8
9
|
|
|
9
10
|
import {print_path} from './paths.ts';
|
|
10
|
-
import type {Path_Id} from './path.ts';
|
|
11
11
|
import type {Gro_Config} from './gro_config.ts';
|
|
12
12
|
import type {Parsed_Svelte_Config} from './svelte_config.ts';
|
|
13
13
|
import {load_modules, type Load_Modules_Failure, type Module_Meta} from './modules.ts';
|
package/src/lib/gen_helpers.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {resolve} from 'node:path';
|
|
2
2
|
import type {Logger} from '@ryanatkn/belt/log.js';
|
|
3
3
|
import type {Timings} from '@ryanatkn/belt/timings.js';
|
|
4
|
+
import type {Path_Id} from '@ryanatkn/belt/path.js';
|
|
4
5
|
|
|
5
6
|
import type {Gro_Config} from './gro_config.ts';
|
|
6
7
|
import {filter_dependents, type Filer} from './filer.ts';
|
|
@@ -14,7 +15,6 @@ import {
|
|
|
14
15
|
} from './gen.ts';
|
|
15
16
|
import {default_svelte_config} from './svelte_config.ts';
|
|
16
17
|
import {to_root_path} from './paths.ts';
|
|
17
|
-
import type {Path_Id} from './path.ts';
|
|
18
18
|
import {load_module} from './modules.ts';
|
|
19
19
|
|
|
20
20
|
/**
|
package/src/lib/gro_config.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {join, resolve} from 'node:path';
|
|
2
2
|
import {existsSync} from 'node:fs';
|
|
3
3
|
import {identity} from '@ryanatkn/belt/function.js';
|
|
4
|
+
import type {Path_Filter, Path_Id} from '@ryanatkn/belt/path.js';
|
|
4
5
|
|
|
5
6
|
import {GRO_DIST_DIR, IS_THIS_GRO, paths} from './paths.ts';
|
|
6
7
|
import {
|
|
@@ -15,7 +16,6 @@ import {
|
|
|
15
16
|
import create_default_config from './gro.config.default.ts';
|
|
16
17
|
import type {Create_Config_Plugins} from './plugin.ts';
|
|
17
18
|
import type {Map_Package_Json} from './package_json.ts';
|
|
18
|
-
import type {Path_Filter, Path_Id} from './path.ts';
|
|
19
19
|
import type {Parsed_Svelte_Config} from './svelte_config.ts';
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -7,10 +7,10 @@ import {strip_before, strip_end} from '@ryanatkn/belt/string.js';
|
|
|
7
7
|
import type {Result} from '@ryanatkn/belt/result.js';
|
|
8
8
|
import {existsSync} from 'node:fs';
|
|
9
9
|
import {throttle} from '@ryanatkn/belt/throttle.js';
|
|
10
|
+
import type {Path_Id} from '@ryanatkn/belt/path.js';
|
|
10
11
|
|
|
11
12
|
import type {Plugin} from './plugin.ts';
|
|
12
13
|
import {base_path_to_path_id, LIB_DIRNAME, paths} from './paths.ts';
|
|
13
|
-
import type {Path_Id} from './path.ts';
|
|
14
14
|
import {GRO_DEV_DIRNAME, SERVER_DIST_PATH} from './constants.ts';
|
|
15
15
|
import {parse_svelte_config, default_svelte_config} from './svelte_config.ts';
|
|
16
16
|
import {esbuild_plugin_sveltekit_shim_app} from './esbuild_plugin_sveltekit_shim_app.ts';
|
|
@@ -91,7 +91,7 @@ export const gro_plugin_sveltekit_app = ({
|
|
|
91
91
|
|
|
92
92
|
// `.well-known/src.json` and `.well-known/src/`
|
|
93
93
|
const final_package_json = mapped_package_json ?? package_json;
|
|
94
|
-
const src_json = create_src_json(final_package_json, undefined);
|
|
94
|
+
const src_json = create_src_json(final_package_json, undefined, log);
|
|
95
95
|
if (well_known_src_json === undefined) {
|
|
96
96
|
well_known_src_json = final_package_json.public; // eslint-disable-line no-param-reassign
|
|
97
97
|
}
|
package/src/lib/input_path.ts
CHANGED
|
@@ -3,9 +3,9 @@ import {existsSync, statSync} from 'node:fs';
|
|
|
3
3
|
import {strip_start} from '@ryanatkn/belt/string.js';
|
|
4
4
|
import {z} from 'zod';
|
|
5
5
|
import type {Flavored} from '@ryanatkn/belt/types.js';
|
|
6
|
+
import type {Path_Info, Path_Id, Resolved_Path} from '@ryanatkn/belt/path.js';
|
|
6
7
|
|
|
7
8
|
import {GRO_PACKAGE_DIR, GRO_DIST_DIR} from './paths.ts';
|
|
8
|
-
import type {Path_Info, Path_Id, Resolved_Path} from './path.ts';
|
|
9
9
|
import {search_fs} from './search_fs.ts';
|
|
10
10
|
import {TASK_FILE_SUFFIX_JS} from './task.ts';
|
|
11
11
|
|
package/src/lib/modules.ts
CHANGED
|
@@ -3,10 +3,10 @@ import {Unreachable_Error} from '@ryanatkn/belt/error.js';
|
|
|
3
3
|
import type {Result} from '@ryanatkn/belt/result.js';
|
|
4
4
|
import {print_error} from '@ryanatkn/belt/print.js';
|
|
5
5
|
import {pathToFileURL} from 'node:url';
|
|
6
|
+
import type {Path_Id} from '@ryanatkn/belt/path.js';
|
|
6
7
|
|
|
7
8
|
import type {Resolved_Input_File} from './input_path.ts';
|
|
8
9
|
import {print_path} from './paths.ts';
|
|
9
|
-
import type {Path_Id} from './path.ts';
|
|
10
10
|
|
|
11
11
|
export interface Module_Meta<T_Module extends Record<string, any> = Record<string, any>> {
|
|
12
12
|
id: Path_Id;
|
package/src/lib/package.gen.ts
CHANGED
|
@@ -11,13 +11,13 @@ import type {Gen} from './gen.ts';
|
|
|
11
11
|
* which mirrors `package.json` but in TypeScript,
|
|
12
12
|
* allowing apps to import typesafe data from their own `package.json`.
|
|
13
13
|
*/
|
|
14
|
-
export const gen: Gen = ({origin_path}) => {
|
|
14
|
+
export const gen: Gen = ({origin_path, log}) => {
|
|
15
15
|
const package_json = load_package_json();
|
|
16
16
|
// TODO this can error with bad json data, do we need to update the package.json here first?
|
|
17
17
|
// similarly do this in other places too?
|
|
18
18
|
// part of the problem is that the package_json actually has a dependency on each of its exports and their deps,
|
|
19
19
|
// but only when they're added/removed right? see gro_plugin_gen for details
|
|
20
|
-
const src_json = create_src_json(package_json, undefined);
|
|
20
|
+
const src_json = create_src_json(package_json, undefined, log);
|
|
21
21
|
|
|
22
22
|
const is_this_belt = package_json.name === '@ryanatkn/belt'; // TODO more robust?
|
|
23
23
|
|