@ryanatkn/gro 0.136.0 → 0.136.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,9 +6,10 @@ export interface Task_Args extends Args {
6
6
  watch?: boolean;
7
7
  }
8
8
  export interface Options {
9
+ input_paths?: string[];
9
10
  root_dirs?: string[];
10
11
  flush_debounce_delay?: number;
11
12
  }
12
- export declare const gro_plugin_gen: ({ root_dirs, flush_debounce_delay, }?: Options) => Plugin;
13
+ export declare const gro_plugin_gen: ({ input_paths, root_dirs, flush_debounce_delay, }?: Options) => Plugin;
13
14
  export declare const filter_dependents: (source_file: Source_File, get_by_id: (id: Path_Id) => Source_File | undefined, filter?: File_Filter, results?: Set<string>, searched?: Set<string>) => Set<string>;
14
15
  //# sourceMappingURL=gro_plugin_gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gro_plugin_gen.d.ts","sourceRoot":"../src/lib/","sources":["gro_plugin_gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAKpC,OAAO,KAAK,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAgB,WAAW,EAAC,MAAM,YAAY,CAAC;AAK3D,MAAM,WAAW,SAAU,SAAQ,IAAI;IACtC,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,cAAc,0CAGxB,OAAO,KAAkB,MA+F3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBAChB,WAAW,aACb,CAAC,EAAE,EAAE,OAAO,KAAK,WAAW,GAAG,SAAS,WAC1C,WAAW,YACX,GAAG,CAAC,MAAM,CAAC,aACV,GAAG,CAAC,MAAM,CAAC,KACnB,GAAG,CAAC,MAAM,CAYZ,CAAC"}
1
+ {"version":3,"file":"gro_plugin_gen.d.ts","sourceRoot":"../src/lib/","sources":["gro_plugin_gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAKpC,OAAO,KAAK,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAgB,WAAW,EAAC,MAAM,YAAY,CAAC;AAK3D,MAAM,WAAW,SAAU,SAAQ,IAAI;IACtC,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,cAAc,uDAIxB,OAAO,KAAkB,MA2F3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBAChB,WAAW,aACb,CAAC,EAAE,EAAE,OAAO,KAAK,WAAW,GAAG,SAAS,WAC1C,WAAW,YACX,GAAG,CAAC,MAAM,CAAC,aACV,GAAG,CAAC,MAAM,CAAC,KACnB,GAAG,CAAC,MAAM,CAYZ,CAAC"}
@@ -5,8 +5,7 @@ import { throttle } from './throttle.js';
5
5
  import { spawn_cli } from './cli.js';
6
6
  import { Unreachable_Error } from '@ryanatkn/belt/error.js';
7
7
  const FLUSH_DEBOUNCE_DELAY = 500;
8
- export const gro_plugin_gen = ({ root_dirs = [paths.source], flush_debounce_delay = FLUSH_DEBOUNCE_DELAY, } = EMPTY_OBJECT) => {
9
- const input_path = paths.source; // TODO option?
8
+ export const gro_plugin_gen = ({ input_paths = [paths.source], root_dirs = [paths.source], flush_debounce_delay = FLUSH_DEBOUNCE_DELAY, } = EMPTY_OBJECT) => {
10
9
  let generating = false;
11
10
  let regen = false;
12
11
  let flushing_timeout;
@@ -46,14 +45,13 @@ export const gro_plugin_gen = ({ root_dirs = [paths.source], flush_debounce_dela
46
45
  if (!dev)
47
46
  return;
48
47
  // Do we need to just generate everything once and exit?
49
- // TODO could we have an esbuild context here? problem is watching the right files, maybe a plugin that tracks deps
50
48
  if (!watch) {
51
49
  log.info('generating and exiting early');
52
50
  // Run `gen`, first checking if there are any modules to avoid a console error.
53
51
  // Some parts of the build may have already happened,
54
52
  // making us miss `build` events for gen dependencies,
55
53
  // so we run `gen` here even if it's usually wasteful.
56
- const found = find_genfiles([input_path], root_dirs, config);
54
+ const found = find_genfiles(input_paths, root_dirs, config);
57
55
  if (found.ok && found.value.resolved_input_files.length > 0) {
58
56
  await gen();
59
57
  }
@@ -65,8 +63,6 @@ export const gro_plugin_gen = ({ root_dirs = [paths.source], flush_debounce_dela
65
63
  switch (change.type) {
66
64
  case 'add':
67
65
  case 'update': {
68
- // TODO how to handle this now? the loader traces deps for us with `parentPath`,
69
- // but we probably want to make this an esbuild plugin instead
70
66
  if (is_gen_path(source_file.id)) {
71
67
  queue_gen(source_file.id);
72
68
  }
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.136.0',
4
+ version: '0.136.1',
5
5
  description: 'task runner and toolkit extending SvelteKit',
6
6
  motto: 'generate, run, optimize',
7
7
  glyph: '🌰',
@@ -264,7 +264,7 @@ export const package_json = {
264
264
  };
265
265
  export const src_json = {
266
266
  name: '@ryanatkn/gro',
267
- version: '0.136.0',
267
+ version: '0.136.1',
268
268
  modules: {
269
269
  '.': {
270
270
  path: 'index.ts',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanatkn/gro",
3
- "version": "0.136.0",
3
+ "version": "0.136.1",
4
4
  "description": "task runner and toolkit extending SvelteKit",
5
5
  "motto": "generate, run, optimize",
6
6
  "glyph": "🌰",
@@ -17,15 +17,16 @@ export interface Task_Args extends Args {
17
17
  }
18
18
 
19
19
  export interface Options {
20
+ input_paths?: string[];
20
21
  root_dirs?: string[];
21
22
  flush_debounce_delay?: number;
22
23
  }
23
24
 
24
25
  export const gro_plugin_gen = ({
26
+ input_paths = [paths.source],
25
27
  root_dirs = [paths.source],
26
28
  flush_debounce_delay = FLUSH_DEBOUNCE_DELAY,
27
29
  }: Options = EMPTY_OBJECT): Plugin => {
28
- const input_path = paths.source; // TODO option?
29
30
  let generating = false;
30
31
  let regen = false;
31
32
  let flushing_timeout: NodeJS.Timeout | undefined;
@@ -67,7 +68,6 @@ export const gro_plugin_gen = ({
67
68
  if (!dev) return;
68
69
 
69
70
  // Do we need to just generate everything once and exit?
70
- // TODO could we have an esbuild context here? problem is watching the right files, maybe a plugin that tracks deps
71
71
  if (!watch) {
72
72
  log.info('generating and exiting early');
73
73
 
@@ -75,7 +75,7 @@ export const gro_plugin_gen = ({
75
75
  // Some parts of the build may have already happened,
76
76
  // making us miss `build` events for gen dependencies,
77
77
  // so we run `gen` here even if it's usually wasteful.
78
- const found = find_genfiles([input_path], root_dirs, config);
78
+ const found = find_genfiles(input_paths, root_dirs, config);
79
79
  if (found.ok && found.value.resolved_input_files.length > 0) {
80
80
  await gen();
81
81
  }
@@ -88,8 +88,6 @@ export const gro_plugin_gen = ({
88
88
  switch (change.type) {
89
89
  case 'add':
90
90
  case 'update': {
91
- // TODO how to handle this now? the loader traces deps for us with `parentPath`,
92
- // but we probably want to make this an esbuild plugin instead
93
91
  if (is_gen_path(source_file.id)) {
94
92
  queue_gen(source_file.id);
95
93
  }
@@ -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.136.0',
8
+ version: '0.136.1',
9
9
  description: 'task runner and toolkit extending SvelteKit',
10
10
  motto: 'generate, run, optimize',
11
11
  glyph: '🌰',
@@ -270,7 +270,7 @@ export const package_json = {
270
270
 
271
271
  export const src_json = {
272
272
  name: '@ryanatkn/gro',
273
- version: '0.136.0',
273
+ version: '0.136.1',
274
274
  modules: {
275
275
  '.': {
276
276
  path: 'index.ts',