@ryanatkn/gro 0.132.0 → 0.133.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/package.d.ts CHANGED
@@ -736,7 +736,10 @@ export declare const src_json: {
736
736
  };
737
737
  './module.js': {
738
738
  path: string;
739
- declarations: never[];
739
+ declarations: {
740
+ name: string;
741
+ kind: string;
742
+ }[];
740
743
  };
741
744
  './modules.js': {
742
745
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"package.d.ts","sourceRoot":"../src/lib/","sources":["package.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyQD,CAAC;AAEzB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsuBD,CAAC"}
package/dist/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // generated by src/lib/package.gen.ts
2
2
  export const package_json = {
3
3
  name: '@ryanatkn/gro',
4
- version: '0.132.0',
4
+ version: '0.133.0',
5
5
  description: 'task runner and toolkit extending SvelteKit',
6
6
  motto: 'generate, run, optimize',
7
7
  glyph: '🌰',
@@ -56,7 +56,7 @@ export const package_json = {
56
56
  '@changesets/changelog-git': '^0.2.0',
57
57
  '@changesets/types': '^6.0.0',
58
58
  '@ryanatkn/eslint-config': '^0.4.2',
59
- '@ryanatkn/fuz': '^0.111.0',
59
+ '@ryanatkn/fuz': '^0.113.0',
60
60
  '@ryanatkn/moss': '^0.8.0',
61
61
  '@sveltejs/adapter-static': '^3.0.2',
62
62
  '@sveltejs/kit': '^2.5.18',
@@ -266,7 +266,7 @@ export const package_json = {
266
266
  };
267
267
  export const src_json = {
268
268
  name: '@ryanatkn/gro',
269
- version: '0.132.0',
269
+ version: '0.133.0',
270
270
  modules: {
271
271
  '.': {
272
272
  path: 'index.ts',
@@ -448,7 +448,7 @@ export const src_json = {
448
448
  { name: 'task', kind: 'variable' },
449
449
  ],
450
450
  },
451
- './fs.js': { path: 'fs.ts', declarations: [{ name: 'clean_fs', kind: 'function' }] },
451
+ './fs.js': { path: 'fs.ts', declarations: [{ name: 'empty_dir', kind: 'function' }] },
452
452
  './gen.task.js': {
453
453
  path: 'gen.task.ts',
454
454
  declarations: [
@@ -622,7 +622,14 @@ export const src_json = {
622
622
  { name: 'resolve', kind: 'function' },
623
623
  ],
624
624
  },
625
- './module.js': { path: 'module.ts', declarations: [] },
625
+ './module.js': {
626
+ path: 'module.ts',
627
+ declarations: [
628
+ { name: 'MODULE_PATH_SRC_PREFIX', kind: 'variable' },
629
+ { name: 'MODULE_PATH_LIB_PREFIX', kind: 'variable' },
630
+ { name: 'is_external_module', kind: 'function' },
631
+ ],
632
+ },
626
633
  './modules.js': {
627
634
  path: 'modules.ts',
628
635
  declarations: [
@@ -704,18 +711,12 @@ export const src_json = {
704
711
  './path.js': {
705
712
  path: 'path.ts',
706
713
  declarations: [
707
- { name: 'Input_Path', kind: 'variable' },
708
- { name: 'Raw_Input_Path', kind: 'variable' },
709
- { name: 'to_input_path', kind: 'function' },
710
- { name: 'to_input_paths', kind: 'function' },
711
- { name: 'Possible_Path', kind: 'type' },
712
- { name: 'get_possible_paths', kind: 'function' },
713
- { name: 'Resolved_Input_Path', kind: 'type' },
714
- { name: 'Resolved_Input_File', kind: 'type' },
715
- { name: 'Resolved_Input_Paths', kind: 'type' },
716
- { name: 'resolve_input_paths', kind: 'function' },
717
- { name: 'Resolved_Input_Files', kind: 'type' },
718
- { name: 'resolve_input_files', kind: 'function' },
714
+ { name: 'Path_Id', kind: 'type' },
715
+ { name: 'Path_Info', kind: 'type' },
716
+ { name: 'Resolved_Path', kind: 'type' },
717
+ { name: 'Path_Filter', kind: 'type' },
718
+ { name: 'File_Filter', kind: 'type' },
719
+ { name: 'to_file_path', kind: 'function' },
719
720
  ],
720
721
  },
721
722
  './paths.js': {
@@ -920,16 +921,16 @@ export const src_json = {
920
921
  './sveltekit_shim_app.js': {
921
922
  path: 'sveltekit_shim_app.ts',
922
923
  declarations: [
923
- { name: 'Options', kind: 'type' },
924
- { name: 'esbuild_plugin_sveltekit_shim_app', kind: 'function' },
924
+ { name: 'SVELTEKIT_SHIM_APP_PATHS_MATCHER', kind: 'variable' },
925
+ { name: 'SVELTEKIT_SHIM_APP_ENVIRONMENT_MATCHER', kind: 'variable' },
926
+ { name: 'sveltekit_shim_app_specifiers', kind: 'variable' },
927
+ { name: 'render_sveltekit_shim_app_paths', kind: 'function' },
928
+ { name: 'render_sveltekit_shim_app_environment', kind: 'function' },
925
929
  ],
926
930
  },
927
931
  './sveltekit_shim_env.js': {
928
932
  path: 'sveltekit_shim_env.ts',
929
- declarations: [
930
- { name: 'Options', kind: 'type' },
931
- { name: 'esbuild_plugin_sveltekit_shim_env', kind: 'function' },
932
- ],
933
+ declarations: [{ name: 'render_env_shim_module', kind: 'function' }],
933
934
  },
934
935
  './sync.task.js': {
935
936
  path: 'sync.task.ts',
@@ -949,8 +950,26 @@ export const src_json = {
949
950
  './task.js': {
950
951
  path: 'task.ts',
951
952
  declarations: [
952
- { name: 'Args', kind: 'variable' },
953
- { name: 'task', kind: 'variable' },
953
+ { name: 'Task', kind: 'type' },
954
+ { name: 'Task_Context', kind: 'type' },
955
+ { name: 'TASK_FILE_SUFFIX_TS', kind: 'variable' },
956
+ { name: 'TASK_FILE_SUFFIX_JS', kind: 'variable' },
957
+ { name: 'TASK_FILE_SUFFIXES', kind: 'variable' },
958
+ { name: 'is_task_path', kind: 'function' },
959
+ { name: 'to_task_name', kind: 'function' },
960
+ { name: 'Task_Error', kind: 'class' },
961
+ { name: 'Found_Task', kind: 'type' },
962
+ { name: 'Found_Tasks', kind: 'type' },
963
+ { name: 'Find_Tasks_Result', kind: 'type' },
964
+ { name: 'Find_Modules_Failure', kind: 'type' },
965
+ { name: 'find_tasks', kind: 'function' },
966
+ { name: 'Loaded_Tasks', kind: 'type' },
967
+ { name: 'Task_Module', kind: 'type' },
968
+ { name: 'Task_Module_Meta', kind: 'type' },
969
+ { name: 'Load_Tasks_Result', kind: 'type' },
970
+ { name: 'Load_Tasks_Failure', kind: 'type' },
971
+ { name: 'load_tasks', kind: 'function' },
972
+ { name: 'validate_task_module', kind: 'function' },
954
973
  ],
955
974
  },
956
975
  './test.task.js': {
@@ -1,12 +1,11 @@
1
1
  import type { Package_Json, Url } from './package_json.js';
2
2
  import type { Src_Json } from './src_json.js';
3
3
  export interface Package_Meta {
4
- url: Url;
4
+ repo_url: Url;
5
5
  package_json: Package_Json;
6
6
  src_json: Src_Json;
7
7
  name: string;
8
8
  repo_name: string;
9
- repo_url: Url | null;
10
9
  /**
11
10
  * the is the github user/org, not npm
12
11
  */
@@ -18,7 +17,7 @@ export interface Package_Meta {
18
17
  changelog_url: Url | null;
19
18
  published: boolean;
20
19
  }
21
- export declare const parse_package_meta: (url: Url, package_json: Package_Json, src_json: Src_Json) => Package_Meta;
20
+ export declare const parse_package_meta: (package_json: Package_Json, src_json: Src_Json) => Package_Meta;
22
21
  export declare const parse_repo_name: (name: string) => string;
23
22
  export declare const parse_org_url: (pkg: Package_Meta) => string | null;
24
23
  //# sourceMappingURL=package_meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"package_meta.d.ts","sourceRoot":"../src/lib/","sources":["package_meta.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,YAAY,EAAE,GAAG,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAG5C,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,GAAG,CAAC;IACT,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAC;IACrB;;OAEG;IACH,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eAAO,MAAM,eAAe,SAAU,MAAM,KAAG,MACH,CAAC;AAE7C,eAAO,MAAM,aAAa,QAAS,YAAY,KAAG,MAAM,GAAG,IAQ1D,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { strip_start, strip_end, ensure_end } from '@ryanatkn/belt/string.js';
2
- export const parse_package_meta = (url, package_json, src_json) => {
2
+ export const parse_package_meta = (package_json, src_json) => {
3
3
  const { name } = package_json;
4
4
  // TODO hacky
5
5
  const parse_repo = (r) => {
@@ -12,6 +12,9 @@ export const parse_package_meta = (url, package_json, src_json) => {
12
12
  ? package_json.repository
13
13
  : package_json.repository.url
14
14
  : null);
15
+ if (!repo_url) {
16
+ throw new Error('failed to parse package_meta - `repo_url` is required in package_json');
17
+ }
15
18
  const homepage_url = package_json.homepage ?? null;
16
19
  const published = !package_json.private && !!package_json.exports && package_json.version !== '0.0.1';
17
20
  // TODO generic registries
@@ -25,7 +28,6 @@ export const parse_package_meta = (url, package_json, src_json) => {
25
28
  : null;
26
29
  const logo_alt = package_json.logo_alt ?? `logo for ${repo_name}`;
27
30
  return {
28
- url,
29
31
  package_json,
30
32
  src_json,
31
33
  name,
@@ -90,7 +90,7 @@ export type Src_Modules = z.infer<typeof Src_Modules>;
90
90
  /**
91
91
  * @see https://github.com/ryanatkn/gro/blob/main/src/docs/gro_plugin_sveltekit_app.md#well-known-src
92
92
  */
93
- export declare const Src_Json: z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodObject<{
93
+ export declare const Src_Json: z.ZodObject<{
94
94
  name: z.ZodString;
95
95
  version: z.ZodString;
96
96
  modules: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -246,10 +246,10 @@ export declare const Src_Json: z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodU
246
246
  kind: z.ZodNullable<z.ZodEnum<["type", "function", "variable", "class"]>>;
247
247
  }, z.ZodTypeAny, "passthrough">>, "many">;
248
248
  }, z.ZodTypeAny, "passthrough">>>>;
249
- }, z.ZodTypeAny, "passthrough">>>;
249
+ }, z.ZodTypeAny, "passthrough">>;
250
250
  export type Src_Json = z.infer<typeof Src_Json>;
251
251
  export type Map_Src_Json = (src_json: Src_Json) => Src_Json | null | Promise<Src_Json | null>;
252
- export declare const create_src_json: (package_json: Package_Json, log?: any, lib_path?: string) => Src_Json;
252
+ export declare const create_src_json: (package_json: Package_Json, lib_path?: string) => Src_Json;
253
253
  export declare const serialize_src_json: (src_json: Src_Json) => string;
254
- export declare const to_src_modules: (exports: Package_Json_Exports | undefined, log?: any, lib_path?: string) => Src_Modules | undefined;
254
+ export declare const to_src_modules: (exports: Package_Json_Exports | undefined, lib_path?: string) => Src_Modules | undefined;
255
255
  //# sourceMappingURL=src_json.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"src_json.d.ts","sourceRoot":"../src/lib/","sources":["src_json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAQtB,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,sBAAsB;;;;;;;;;gCAQpB,CAAC;AAChB,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAKR,CAAC;AAChB,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAuB,CAAC;AAChD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC;AAEtD;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAMN,CAAC;AAChB,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,MAAM,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;AAE9F,eAAO,MAAM,eAAe,iBAAkB,YAAY,aAAa,MAAM,KAAG,QAK7E,CAAC;AAEJ,eAAO,MAAM,kBAAkB,aAAc,QAAQ,KAAG,MAGvD,CAAC;AAEF,eAAO,MAAM,cAAc,YACjB,oBAAoB,GAAG,SAAS,wBAEvC,WAAW,GAAG,SAsEhB,CAAC"}
package/dist/src_json.js CHANGED
@@ -24,31 +24,29 @@ export const Src_Modules = z.record(Src_Module);
24
24
  /**
25
25
  * @see https://github.com/ryanatkn/gro/blob/main/src/docs/gro_plugin_sveltekit_app.md#well-known-src
26
26
  */
27
- export const Src_Json = z.intersection(z.record(z.unknown()), // TODO is this what we want?
28
- z
27
+ export const Src_Json = z
29
28
  .object({
30
29
  name: z.string(), // same as Package_Json
31
30
  version: z.string(), // same as Package_Json
32
31
  modules: Src_Modules.transform(transform_empty_object_to_undefined).optional(),
33
32
  })
34
- .passthrough());
35
- export const create_src_json = (package_json, log, lib_path) => Src_Json.parse({
33
+ .passthrough();
34
+ export const create_src_json = (package_json, lib_path) => Src_Json.parse({
36
35
  name: package_json.name,
37
36
  version: package_json.version,
38
- modules: to_src_modules(package_json.exports, log, lib_path),
37
+ modules: to_src_modules(package_json.exports, lib_path),
39
38
  });
40
39
  export const serialize_src_json = (src_json) => {
41
40
  const parsed = Src_Json.parse(src_json); // TODO can parse do the logic that normalize does? see `.transform`
42
41
  return JSON.stringify(parsed, null, 2) + '\n';
43
42
  };
44
- export const to_src_modules = (exports, log, lib_path = paths.lib) => {
43
+ export const to_src_modules = (exports, lib_path = paths.lib) => {
45
44
  if (!exports)
46
45
  return;
47
46
  const project = new Project();
48
- project.addSourceFilesAtPaths('src/**/*.ts'); // TODO dir? maybe rewrite with `lib_path`?
49
- return Object.fromEntries(Object.entries(exports)
50
- .map(([k, _v]) => {
51
- // TODO hacky - doesn't handle any but the normal mappings, also add a helper?
47
+ project.addSourceFilesAtPaths(join(lib_path, '**/*.ts'));
48
+ return Object.fromEntries(Object.entries(exports).map(([k, _v]) => {
49
+ // TODO hacky - doesn't handle any but the typical mappings, also add a helper?
52
50
  const source_file_path = k === '.' || k === './'
53
51
  ? 'index.ts'
54
52
  : strip_start(k.endsWith('.js') ? replace_extension(k, '.ts') : k, './');
@@ -60,11 +58,10 @@ export const to_src_modules = (exports, log, lib_path = paths.lib) => {
60
58
  }
61
59
  const source_file_id = join(lib_path, source_file_path);
62
60
  if (!existsSync(source_file_id)) {
63
- log?.warn('failed to infer source file from export path', k, '- the inferred file', source_file_id, 'does not exist');
64
- return null;
61
+ throw Error(`Failed to infer source file from package.json export path ${k} - the inferred file ${source_file_id} does not exist`);
65
62
  }
66
63
  const declarations = [];
67
- const source_file = project.getSourceFile((f) => f.getFilePath().endsWith(source_file_path)); // TODO expected this to work without the callback, according to my read of the docs it is, but `project.getSourceFile(source_file_path)` fails
64
+ const source_file = project.getSourceFile(source_file_id);
68
65
  if (source_file) {
69
66
  for (const [name, decls] of source_file.getExportedDeclarations()) {
70
67
  // TODO how to correctly handle multiples?
@@ -103,6 +100,5 @@ export const to_src_modules = (exports, log, lib_path = paths.lib) => {
103
100
  }
104
101
  const src_module = { path: source_file_path, declarations };
105
102
  return [k, src_module];
106
- })
107
- .filter((v) => v !== null));
103
+ }));
108
104
  };
@@ -18,8 +18,17 @@ export interface Parsed_Sveltekit_Config {
18
18
  alias: Record<string, string> | undefined;
19
19
  base_url: '' | `/${string}` | undefined;
20
20
  assets_url: '' | `http://${string}` | `https://${string}` | undefined;
21
+ /**
22
+ * Same as the SvelteKit `files.assets`.
23
+ */
21
24
  assets_path: string;
25
+ /**
26
+ * Same as the SvelteKit `files.lib`.
27
+ */
22
28
  lib_path: string;
29
+ /**
30
+ * Same as the SvelteKit `files.routes`.
31
+ */
23
32
  routes_path: string;
24
33
  env_dir: string | undefined;
25
34
  private_prefix: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"sveltekit_config.d.ts","sourceRoot":"../src/lib/","sources":["sveltekit_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,IAAI,eAAe,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAC,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAW7F;;;GAGG;AACH,eAAO,MAAM,qBAAqB,SAC5B,MAAM,KACT,OAAO,CAAC,eAAe,GAAG,IAAI,CAMhC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IAEvC,gBAAgB,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC1C,QAAQ,EAAE,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,SAAS,CAAC;IACxC,UAAU,EAAE,EAAE,GAAG,UAAU,MAAM,EAAE,GAAG,WAAW,MAAM,EAAE,GAAG,SAAS,CAAC;IAGtE,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IAEpB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,aAAa,EAAE,MAAM,G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EAAE,oBAAoB,CAAC;IACpD,oBAAoB,EAAE,iBAAiB,GAAG,iBAAiB,EAAE,GAAG,SAAS,CAAC;CAC1E;AAGD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,mBAClB,MAAM,GAAG,eAAe,KACrC,OAAO,CAAC,uBAAuB,CAsCjC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanatkn/gro",
3
- "version": "0.132.0",
3
+ "version": "0.133.0",
4
4
  "description": "task runner and toolkit extending SvelteKit",
5
5
  "motto": "generate, run, optimize",
6
6
  "glyph": "🌰",
@@ -69,7 +69,7 @@
69
69
  "@changesets/changelog-git": "^0.2.0",
70
70
  "@changesets/types": "^6.0.0",
71
71
  "@ryanatkn/eslint-config": "^0.4.2",
72
- "@ryanatkn/fuz": "^0.111.0",
72
+ "@ryanatkn/fuz": "^0.113.0",
73
73
  "@ryanatkn/moss": "^0.8.0",
74
74
  "@sveltejs/adapter-static": "^3.0.2",
75
75
  "@sveltejs/kit": "^2.5.18",
@@ -5,7 +5,7 @@ import type {Src_Json} from './src_json.js';
5
5
 
6
6
  export const package_json = {
7
7
  name: '@ryanatkn/gro',
8
- version: '0.132.0',
8
+ version: '0.133.0',
9
9
  description: 'task runner and toolkit extending SvelteKit',
10
10
  motto: 'generate, run, optimize',
11
11
  glyph: '🌰',
@@ -61,7 +61,7 @@ export const package_json = {
61
61
  '@changesets/changelog-git': '^0.2.0',
62
62
  '@changesets/types': '^6.0.0',
63
63
  '@ryanatkn/eslint-config': '^0.4.2',
64
- '@ryanatkn/fuz': '^0.111.0',
64
+ '@ryanatkn/fuz': '^0.113.0',
65
65
  '@ryanatkn/moss': '^0.8.0',
66
66
  '@sveltejs/adapter-static': '^3.0.2',
67
67
  '@sveltejs/kit': '^2.5.18',
@@ -272,7 +272,7 @@ export const package_json = {
272
272
 
273
273
  export const src_json = {
274
274
  name: '@ryanatkn/gro',
275
- version: '0.132.0',
275
+ version: '0.133.0',
276
276
  modules: {
277
277
  '.': {
278
278
  path: 'index.ts',
@@ -454,7 +454,7 @@ export const src_json = {
454
454
  {name: 'task', kind: 'variable'},
455
455
  ],
456
456
  },
457
- './fs.js': {path: 'fs.ts', declarations: [{name: 'clean_fs', kind: 'function'}]},
457
+ './fs.js': {path: 'fs.ts', declarations: [{name: 'empty_dir', kind: 'function'}]},
458
458
  './gen.task.js': {
459
459
  path: 'gen.task.ts',
460
460
  declarations: [
@@ -628,7 +628,14 @@ export const src_json = {
628
628
  {name: 'resolve', kind: 'function'},
629
629
  ],
630
630
  },
631
- './module.js': {path: 'module.ts', declarations: []},
631
+ './module.js': {
632
+ path: 'module.ts',
633
+ declarations: [
634
+ {name: 'MODULE_PATH_SRC_PREFIX', kind: 'variable'},
635
+ {name: 'MODULE_PATH_LIB_PREFIX', kind: 'variable'},
636
+ {name: 'is_external_module', kind: 'function'},
637
+ ],
638
+ },
632
639
  './modules.js': {
633
640
  path: 'modules.ts',
634
641
  declarations: [
@@ -710,18 +717,12 @@ export const src_json = {
710
717
  './path.js': {
711
718
  path: 'path.ts',
712
719
  declarations: [
713
- {name: 'Input_Path', kind: 'variable'},
714
- {name: 'Raw_Input_Path', kind: 'variable'},
715
- {name: 'to_input_path', kind: 'function'},
716
- {name: 'to_input_paths', kind: 'function'},
717
- {name: 'Possible_Path', kind: 'type'},
718
- {name: 'get_possible_paths', kind: 'function'},
719
- {name: 'Resolved_Input_Path', kind: 'type'},
720
- {name: 'Resolved_Input_File', kind: 'type'},
721
- {name: 'Resolved_Input_Paths', kind: 'type'},
722
- {name: 'resolve_input_paths', kind: 'function'},
723
- {name: 'Resolved_Input_Files', kind: 'type'},
724
- {name: 'resolve_input_files', kind: 'function'},
720
+ {name: 'Path_Id', kind: 'type'},
721
+ {name: 'Path_Info', kind: 'type'},
722
+ {name: 'Resolved_Path', kind: 'type'},
723
+ {name: 'Path_Filter', kind: 'type'},
724
+ {name: 'File_Filter', kind: 'type'},
725
+ {name: 'to_file_path', kind: 'function'},
725
726
  ],
726
727
  },
727
728
  './paths.js': {
@@ -926,16 +927,16 @@ export const src_json = {
926
927
  './sveltekit_shim_app.js': {
927
928
  path: 'sveltekit_shim_app.ts',
928
929
  declarations: [
929
- {name: 'Options', kind: 'type'},
930
- {name: 'esbuild_plugin_sveltekit_shim_app', kind: 'function'},
930
+ {name: 'SVELTEKIT_SHIM_APP_PATHS_MATCHER', kind: 'variable'},
931
+ {name: 'SVELTEKIT_SHIM_APP_ENVIRONMENT_MATCHER', kind: 'variable'},
932
+ {name: 'sveltekit_shim_app_specifiers', kind: 'variable'},
933
+ {name: 'render_sveltekit_shim_app_paths', kind: 'function'},
934
+ {name: 'render_sveltekit_shim_app_environment', kind: 'function'},
931
935
  ],
932
936
  },
933
937
  './sveltekit_shim_env.js': {
934
938
  path: 'sveltekit_shim_env.ts',
935
- declarations: [
936
- {name: 'Options', kind: 'type'},
937
- {name: 'esbuild_plugin_sveltekit_shim_env', kind: 'function'},
938
- ],
939
+ declarations: [{name: 'render_env_shim_module', kind: 'function'}],
939
940
  },
940
941
  './sync.task.js': {
941
942
  path: 'sync.task.ts',
@@ -955,8 +956,26 @@ export const src_json = {
955
956
  './task.js': {
956
957
  path: 'task.ts',
957
958
  declarations: [
958
- {name: 'Args', kind: 'variable'},
959
- {name: 'task', kind: 'variable'},
959
+ {name: 'Task', kind: 'type'},
960
+ {name: 'Task_Context', kind: 'type'},
961
+ {name: 'TASK_FILE_SUFFIX_TS', kind: 'variable'},
962
+ {name: 'TASK_FILE_SUFFIX_JS', kind: 'variable'},
963
+ {name: 'TASK_FILE_SUFFIXES', kind: 'variable'},
964
+ {name: 'is_task_path', kind: 'function'},
965
+ {name: 'to_task_name', kind: 'function'},
966
+ {name: 'Task_Error', kind: 'class'},
967
+ {name: 'Found_Task', kind: 'type'},
968
+ {name: 'Found_Tasks', kind: 'type'},
969
+ {name: 'Find_Tasks_Result', kind: 'type'},
970
+ {name: 'Find_Modules_Failure', kind: 'type'},
971
+ {name: 'find_tasks', kind: 'function'},
972
+ {name: 'Loaded_Tasks', kind: 'type'},
973
+ {name: 'Task_Module', kind: 'type'},
974
+ {name: 'Task_Module_Meta', kind: 'type'},
975
+ {name: 'Load_Tasks_Result', kind: 'type'},
976
+ {name: 'Load_Tasks_Failure', kind: 'type'},
977
+ {name: 'load_tasks', kind: 'function'},
978
+ {name: 'validate_task_module', kind: 'function'},
960
979
  ],
961
980
  },
962
981
  './test.task.js': {
@@ -5,12 +5,11 @@ import type {Src_Json} from './src_json.js';
5
5
 
6
6
  // TODO needs refactoring, more clarity
7
7
  export interface Package_Meta {
8
- url: Url;
8
+ repo_url: Url; // 'https://github.com/ryanatkn/fuz'
9
9
  package_json: Package_Json;
10
10
  src_json: Src_Json;
11
11
  name: string; // '@ryanatkn/fuz_library'
12
12
  repo_name: string; // fuz_library
13
- repo_url: Url | null; // 'https://github.com/ryanatkn/fuz'
14
13
  /**
15
14
  * the is the github user/org, not npm
16
15
  */
@@ -24,7 +23,6 @@ export interface Package_Meta {
24
23
  }
25
24
 
26
25
  export const parse_package_meta = (
27
- url: Url,
28
26
  package_json: Package_Json,
29
27
  src_json: Src_Json,
30
28
  ): Package_Meta => {
@@ -43,6 +41,9 @@ export const parse_package_meta = (
43
41
  : package_json.repository.url
44
42
  : null,
45
43
  );
44
+ if (!repo_url) {
45
+ throw new Error('failed to parse package_meta - `repo_url` is required in package_json');
46
+ }
46
47
 
47
48
  const homepage_url = package_json.homepage ?? null;
48
49
 
@@ -66,7 +67,6 @@ export const parse_package_meta = (
66
67
  const logo_alt = package_json.logo_alt ?? `logo for ${repo_name}`;
67
68
 
68
69
  return {
69
- url,
70
70
  package_json,
71
71
  src_json,
72
72
  name,
@@ -1,7 +1,6 @@
1
1
  import {z} from 'zod';
2
2
  import {join} from 'node:path';
3
3
  import {strip_start} from '@ryanatkn/belt/string.js';
4
- import type {Logger} from '@ryanatkn/belt/log.js';
5
4
  import {Project} from 'ts-morph';
6
5
  import {existsSync} from 'node:fs';
7
6
 
@@ -37,29 +36,22 @@ export type Src_Modules = z.infer<typeof Src_Modules>;
37
36
  /**
38
37
  * @see https://github.com/ryanatkn/gro/blob/main/src/docs/gro_plugin_sveltekit_app.md#well-known-src
39
38
  */
40
- export const Src_Json = z.intersection(
41
- z.record(z.unknown()), // TODO is this what we want?
42
- z
43
- .object({
44
- name: z.string(), // same as Package_Json
45
- version: z.string(), // same as Package_Json
46
- modules: Src_Modules.transform(transform_empty_object_to_undefined).optional(),
47
- })
48
- .passthrough(),
49
- );
39
+ export const Src_Json = z
40
+ .object({
41
+ name: z.string(), // same as Package_Json
42
+ version: z.string(), // same as Package_Json
43
+ modules: Src_Modules.transform(transform_empty_object_to_undefined).optional(),
44
+ })
45
+ .passthrough();
50
46
  export type Src_Json = z.infer<typeof Src_Json>;
51
47
 
52
48
  export type Map_Src_Json = (src_json: Src_Json) => Src_Json | null | Promise<Src_Json | null>;
53
49
 
54
- export const create_src_json = (
55
- package_json: Package_Json,
56
- log?: Logger,
57
- lib_path?: string,
58
- ): Src_Json =>
50
+ export const create_src_json = (package_json: Package_Json, lib_path?: string): Src_Json =>
59
51
  Src_Json.parse({
60
52
  name: package_json.name,
61
53
  version: package_json.version,
62
- modules: to_src_modules(package_json.exports, log, lib_path),
54
+ modules: to_src_modules(package_json.exports, lib_path),
63
55
  });
64
56
 
65
57
  export const serialize_src_json = (src_json: Src_Json): string => {
@@ -69,85 +61,75 @@ export const serialize_src_json = (src_json: Src_Json): string => {
69
61
 
70
62
  export const to_src_modules = (
71
63
  exports: Package_Json_Exports | undefined,
72
- log?: Logger,
73
64
  lib_path = paths.lib,
74
65
  ): Src_Modules | undefined => {
75
66
  if (!exports) return;
76
67
 
77
68
  const project = new Project();
78
- project.addSourceFilesAtPaths('src/**/*.ts'); // TODO dir? maybe rewrite with `lib_path`?
69
+ project.addSourceFilesAtPaths(join(lib_path, '**/*.ts'));
79
70
 
80
71
  return Object.fromEntries(
81
- Object.entries(exports)
82
- .map(([k, _v]) => {
83
- // TODO hacky - doesn't handle any but the normal mappings, also add a helper?
84
- const source_file_path =
85
- k === '.' || k === './'
86
- ? 'index.ts'
87
- : strip_start(k.endsWith('.js') ? replace_extension(k, '.ts') : k, './');
88
- if (!source_file_path.endsWith('.ts')) {
89
- // TODO support more than just TypeScript - maybe use @sveltejs/language-tools,
90
- // see how @sveltejs/package generates types, or maybe use its generated declaration files with ts-morph
91
- const src_module: Src_Module = {path: source_file_path, declarations: []};
92
- return [k, src_module];
93
- }
94
- const source_file_id = join(lib_path, source_file_path);
95
- if (!existsSync(source_file_id)) {
96
- log?.warn(
97
- 'failed to infer source file from export path',
98
- k,
99
- '- the inferred file',
100
- source_file_id,
101
- 'does not exist',
102
- );
103
- return null;
104
- }
72
+ Object.entries(exports).map(([k, _v]) => {
73
+ // TODO hacky - doesn't handle any but the typical mappings, also add a helper?
74
+ const source_file_path =
75
+ k === '.' || k === './'
76
+ ? 'index.ts'
77
+ : strip_start(k.endsWith('.js') ? replace_extension(k, '.ts') : k, './');
78
+ if (!source_file_path.endsWith('.ts')) {
79
+ // TODO support more than just TypeScript - maybe use @sveltejs/language-tools,
80
+ // see how @sveltejs/package generates types, or maybe use its generated declaration files with ts-morph
81
+ const src_module: Src_Module = {path: source_file_path, declarations: []};
82
+ return [k, src_module];
83
+ }
84
+ const source_file_id = join(lib_path, source_file_path);
85
+ if (!existsSync(source_file_id)) {
86
+ throw Error(
87
+ `Failed to infer source file from package.json export path ${k} - the inferred file ${source_file_id} does not exist`,
88
+ );
89
+ }
105
90
 
106
- const declarations: Src_Module_Declaration[] = [];
91
+ const declarations: Src_Module_Declaration[] = [];
107
92
 
108
- const source_file = project.getSourceFile((f) =>
109
- f.getFilePath().endsWith(source_file_path),
110
- ); // TODO expected this to work without the callback, according to my read of the docs it is, but `project.getSourceFile(source_file_path)` fails
111
- if (source_file) {
112
- for (const [name, decls] of source_file.getExportedDeclarations()) {
113
- // TODO how to correctly handle multiples?
114
- for (const decl of decls) {
115
- // TODO helper
116
- const decl_type = decl.getType();
117
- const k = decl.getKindName();
118
- const kind =
119
- k === 'InterfaceDeclaration' || k === 'TypeAliasDeclaration'
120
- ? 'type'
121
- : k === 'ClassDeclaration'
122
- ? 'class'
123
- : k === 'VariableDeclaration'
124
- ? decl_type.getCallSignatures().length
125
- ? 'function'
126
- : 'variable' // TODO name?
127
- : null;
128
- // TODO
129
- // const code =
130
- // k === 'InterfaceDeclaration' || k === 'TypeAliasDeclaration'
131
- // ? decl_type.getText(source_file) // TODO
132
- // : decl_type.getText(source_file);
133
- const found = declarations.find((d) => d.name === name);
134
- if (found) {
135
- // TODO hacky, this only was added to prevent `TypeAliasDeclaration` from overriding `VariableDeclaration`
136
- if (found.kind === 'type') {
137
- found.kind = kind;
138
- // found.code = code;
139
- }
140
- } else {
141
- // TODO more
142
- declarations.push({name, kind}); // code
93
+ const source_file = project.getSourceFile(source_file_id);
94
+ if (source_file) {
95
+ for (const [name, decls] of source_file.getExportedDeclarations()) {
96
+ // TODO how to correctly handle multiples?
97
+ for (const decl of decls) {
98
+ // TODO helper
99
+ const decl_type = decl.getType();
100
+ const k = decl.getKindName();
101
+ const kind =
102
+ k === 'InterfaceDeclaration' || k === 'TypeAliasDeclaration'
103
+ ? 'type'
104
+ : k === 'ClassDeclaration'
105
+ ? 'class'
106
+ : k === 'VariableDeclaration'
107
+ ? decl_type.getCallSignatures().length
108
+ ? 'function'
109
+ : 'variable' // TODO name?
110
+ : null;
111
+ // TODO
112
+ // const code =
113
+ // k === 'InterfaceDeclaration' || k === 'TypeAliasDeclaration'
114
+ // ? decl_type.getText(source_file) // TODO
115
+ // : decl_type.getText(source_file);
116
+ const found = declarations.find((d) => d.name === name);
117
+ if (found) {
118
+ // TODO hacky, this only was added to prevent `TypeAliasDeclaration` from overriding `VariableDeclaration`
119
+ if (found.kind === 'type') {
120
+ found.kind = kind;
121
+ // found.code = code;
143
122
  }
123
+ } else {
124
+ // TODO more
125
+ declarations.push({name, kind}); // code
144
126
  }
145
127
  }
146
128
  }
129
+ }
147
130
 
148
- const src_module: Src_Module = {path: source_file_path, declarations};
149
- return [k, src_module];
150
- })
151
- .filter((v) => v !== null),
131
+ const src_module: Src_Module = {path: source_file_path, declarations};
132
+ return [k, src_module];
133
+ }),
152
134
  );
153
135
  };
@@ -40,8 +40,17 @@ export interface Parsed_Sveltekit_Config {
40
40
  assets_url: '' | `http://${string}` | `https://${string}` | undefined;
41
41
 
42
42
  // TODO others, but maybe replace with a Zod schema? https://kit.svelte.dev/docs/configuration
43
+ /**
44
+ * Same as the SvelteKit `files.assets`.
45
+ */
43
46
  assets_path: string;
47
+ /**
48
+ * Same as the SvelteKit `files.lib`.
49
+ */
44
50
  lib_path: string;
51
+ /**
52
+ * Same as the SvelteKit `files.routes`.
53
+ */
45
54
  routes_path: string;
46
55
 
47
56
  env_dir: string | undefined;