@ryanatkn/gro 0.150.1 → 0.151.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/filer.d.ts +3 -1
- package/dist/filer.d.ts.map +1 -1
- package/dist/filer.js +23 -3
- package/dist/gro.config.default.js +2 -2
- package/dist/gro_helpers.d.ts.map +1 -1
- package/dist/gro_helpers.js +1 -0
- package/dist/gro_plugin_gen.d.ts +0 -3
- package/dist/gro_plugin_gen.d.ts.map +1 -1
- package/dist/gro_plugin_gen.js +2 -15
- package/dist/gro_plugin_moss.js +2 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +2 -1
- package/dist/package.d.ts +3 -0
- package/dist/package.d.ts.map +1 -1
- package/dist/package.js +10 -9
- package/dist/package_json.d.ts +1 -0
- package/dist/package_json.d.ts.map +1 -1
- package/dist/package_json.js +1 -0
- package/dist/plugin.d.ts +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/resolve_specifier.js +1 -1
- package/package.json +7 -7
- package/src/lib/filer.ts +34 -4
- package/src/lib/gro.config.default.ts +2 -2
- package/src/lib/gro_helpers.ts +1 -0
- package/src/lib/gro_plugin_gen.ts +4 -22
- package/src/lib/gro_plugin_moss.ts +1 -1
- package/src/lib/loader.ts +3 -1
- package/src/lib/package.ts +10 -9
- package/src/lib/package_json.ts +5 -0
- package/src/lib/plugin.ts +1 -1
- package/src/lib/resolve_specifier.ts +1 -1
package/dist/filer.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Omit_Strict } from '@ryanatkn/belt/types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Logger } from '@ryanatkn/belt/log.js';
|
|
3
|
+
import type { File_Filter, Path_Id } from './path.js';
|
|
3
4
|
import { watch_dir, type Watcher_Change, type Watch_Dir_Options } from './watch_dir.js';
|
|
4
5
|
import type { Package_Json } from './package_json.js';
|
|
5
6
|
export interface Source_File {
|
|
@@ -35,4 +36,5 @@ export declare class Filer {
|
|
|
35
36
|
watch(listener: On_Filer_Change): Promise<Cleanup_Watch>;
|
|
36
37
|
close(): Promise<void>;
|
|
37
38
|
}
|
|
39
|
+
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>, log?: Logger) => Set<string>;
|
|
38
40
|
//# sourceMappingURL=filer.d.ts.map
|
package/dist/filer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filer.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/filer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"filer.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/filer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAKzD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AACpD,OAAO,EACN,SAAS,EAET,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEtB,MAAM,gBAAgB,CAAC;AAMxB,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAIpD,MAAM,WAAW,WAAW;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACtC,YAAY,EAAE,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;CACxC;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;AAEzF,MAAM,WAAW,aAAa;IAC7B,SAAS,CAAC,EAAE,OAAO,SAAS,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAC;IACzE,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAClD;AAED,qBAAa,KAAK;;IACjB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAa;gBAK1C,OAAO,GAAE,aAA4B;IAWjD,SAAS,GAAI,IAAI,OAAO,KAAG,WAAW,GAAG,SAAS,CAEhD;IAEF,aAAa,GAAI,IAAI,OAAO,KAAG,WAAW,CAkBxC;IA6II,KAAK,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;IAKxD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAa5B;AAGD,eAAO,MAAM,iBAAiB,GAC7B,aAAa,WAAW,EACxB,WAAW,CAAC,EAAE,EAAE,OAAO,KAAK,WAAW,GAAG,SAAS,EACnD,SAAS,WAAW,EACpB,UAAS,GAAG,CAAC,MAAM,CAAa,EAChC,WAAU,GAAG,CAAC,MAAM,CAAa,EACjC,MAAM,MAAM,KACV,GAAG,CAAC,MAAM,CAkBZ,CAAC"}
|
package/dist/filer.js
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
|
3
3
|
import { dirname, resolve } from 'node:path';
|
|
4
4
|
import { wait } from '@ryanatkn/belt/async.js';
|
|
5
5
|
import { isBuiltin } from 'node:module';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
7
|
import { Unreachable_Error } from '@ryanatkn/belt/error.js';
|
|
8
8
|
import { watch_dir, } from './watch_dir.js';
|
|
9
9
|
import { paths } from './paths.js';
|
|
@@ -53,7 +53,7 @@ export class Filer {
|
|
|
53
53
|
const stats = existsSync(id) ? statSync(id) : null;
|
|
54
54
|
file.ctime = stats?.ctimeMs ?? null;
|
|
55
55
|
file.mtime = stats?.mtimeMs ?? null;
|
|
56
|
-
const new_contents = stats ? readFileSync(id, 'utf8') : null;
|
|
56
|
+
const new_contents = stats ? readFileSync(id, 'utf8') : null; // TODO need to lazily load contents, probably turn `Source_File` into a class
|
|
57
57
|
if (file.contents === new_contents) {
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
@@ -75,7 +75,8 @@ export class Filer {
|
|
|
75
75
|
if (isBuiltin(path))
|
|
76
76
|
continue;
|
|
77
77
|
try {
|
|
78
|
-
|
|
78
|
+
const file_url = pathToFileURL(file.id);
|
|
79
|
+
path_id = fileURLToPath(import.meta.resolve(path, file_url.href));
|
|
79
80
|
}
|
|
80
81
|
catch (error) {
|
|
81
82
|
// If it's imported from an external module, ignore any import errors.
|
|
@@ -192,3 +193,22 @@ export class Filer {
|
|
|
192
193
|
return !id.startsWith(this.root_dir + '/') || (!!filter && !filter(id, false));
|
|
193
194
|
}
|
|
194
195
|
}
|
|
196
|
+
// TODO maybe `Source_File` class?
|
|
197
|
+
export const filter_dependents = (source_file, get_by_id, filter, results = new Set(), searched = new Set(), log) => {
|
|
198
|
+
const { dependents } = source_file;
|
|
199
|
+
for (const dependent_id of dependents.keys()) {
|
|
200
|
+
if (searched.has(dependent_id))
|
|
201
|
+
continue;
|
|
202
|
+
searched.add(dependent_id);
|
|
203
|
+
if (!filter || filter(dependent_id)) {
|
|
204
|
+
results.add(dependent_id);
|
|
205
|
+
}
|
|
206
|
+
const dependent_source_file = get_by_id(dependent_id);
|
|
207
|
+
if (!dependent_source_file) {
|
|
208
|
+
log?.warn(`[filer.filter_dependents]: dependent source file ${dependent_id} not found for ${source_file.id}`);
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
filter_dependents(dependent_source_file, get_by_id, filter, results, searched);
|
|
212
|
+
}
|
|
213
|
+
return results;
|
|
214
|
+
};
|
|
@@ -3,7 +3,7 @@ import { has_server, gro_plugin_server } from './gro_plugin_server.js';
|
|
|
3
3
|
import { gro_plugin_sveltekit_app } from './gro_plugin_sveltekit_app.js';
|
|
4
4
|
import { has_sveltekit_app, has_sveltekit_library } from './sveltekit_helpers.js';
|
|
5
5
|
import { gro_plugin_gen } from './gro_plugin_gen.js';
|
|
6
|
-
import { has_dep, load_package_json } from './package_json.js';
|
|
6
|
+
import { has_dep, is_dep, load_package_json } from './package_json.js';
|
|
7
7
|
/**
|
|
8
8
|
* This is the default config that's passed to `gro.config.ts`
|
|
9
9
|
* if it exists in the current project, and if not, this is the final config.
|
|
@@ -16,7 +16,7 @@ import { has_dep, load_package_json } from './package_json.js';
|
|
|
16
16
|
const config = async (cfg) => {
|
|
17
17
|
const package_json = load_package_json(); // TODO gets wastefully loaded by some plugins, maybe put in plugin/task context? how does that interact with `map_package_json`?
|
|
18
18
|
const [has_moss_dep, has_server_result, has_sveltekit_library_result, has_sveltekit_app_result] = await Promise.all([
|
|
19
|
-
has_dep('@ryanatkn/moss', package_json),
|
|
19
|
+
has_dep('@ryanatkn/moss', package_json) || is_dep('@ryanatkn/moss', package_json),
|
|
20
20
|
has_server(),
|
|
21
21
|
has_sveltekit_library(package_json),
|
|
22
22
|
has_sveltekit_app(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,uBAAuB,GAAI,aAAS,KAAG,MAsBnD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC7B,aAAa,MAAM,EACnB,aAAa,MAAM,EACnB,MAAM,KAAK,CAAC,MAAM,CAAC,EACnB,eAAuB,KACrB,OAAO,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"gro_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,uBAAuB,GAAI,aAAS,KAAG,MAsBnD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC7B,aAAa,MAAM,EACnB,aAAa,MAAM,EACnB,MAAM,KAAK,CAAC,MAAM,CAAC,EACnB,eAAuB,KACrB,OAAO,CAAC,YAAY,CAiBtB,CAAC"}
|
package/dist/gro_helpers.js
CHANGED
|
@@ -82,6 +82,7 @@ export const spawn_with_loader = (loader_path, invoke_path, argv, js_cli = JS_CL
|
|
|
82
82
|
import {register} from "node:module";
|
|
83
83
|
import {pathToFileURL} from "node:url";
|
|
84
84
|
register("${loader_path}", pathToFileURL("./"));`,
|
|
85
|
+
'--experimental-import-meta-resolve', // for `import.meta.resolve`
|
|
85
86
|
'--enable-source-maps', // because TypeScript
|
|
86
87
|
];
|
|
87
88
|
// In almost all cases we want the exports condition to be `"development"`. Needed for `esm-env`.
|
package/dist/gro_plugin_gen.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from './plugin.js';
|
|
2
2
|
import type { Args } from './args.js';
|
|
3
|
-
import type { File_Filter, Path_Id } from './path.js';
|
|
4
|
-
import type { Source_File } from './filer.js';
|
|
5
3
|
export interface Task_Args extends Args {
|
|
6
4
|
watch?: boolean;
|
|
7
5
|
}
|
|
@@ -11,5 +9,4 @@ export interface Gro_Plugin_Gen_Options {
|
|
|
11
9
|
flush_debounce_delay?: number;
|
|
12
10
|
}
|
|
13
11
|
export declare const gro_plugin_gen: ({ input_paths, root_dirs, flush_debounce_delay, }?: Gro_Plugin_Gen_Options) => Plugin;
|
|
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>;
|
|
15
12
|
//# sourceMappingURL=gro_plugin_gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_plugin_gen.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_gen.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"gro_plugin_gen.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gro_plugin_gen.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAQpC,MAAM,WAAW,SAAU,SAAQ,IAAI;IACtC,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACtC,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,cAAc,GAAI,oDAI5B,sBAAqC,KAAG,MAqF1C,CAAC"}
|
package/dist/gro_plugin_gen.js
CHANGED
|
@@ -4,6 +4,7 @@ import { Unreachable_Error } from '@ryanatkn/belt/error.js';
|
|
|
4
4
|
import { paths } from './paths.js';
|
|
5
5
|
import { find_genfiles, is_gen_path } from './gen.js';
|
|
6
6
|
import { spawn_cli } from './cli.js';
|
|
7
|
+
import { filter_dependents } from './filer.js';
|
|
7
8
|
const FLUSH_DEBOUNCE_DELAY = 500;
|
|
8
9
|
export const gro_plugin_gen = ({ input_paths = [paths.source], root_dirs = [paths.source], flush_debounce_delay = FLUSH_DEBOUNCE_DELAY, } = EMPTY_OBJECT) => {
|
|
9
10
|
let flushing_timeout;
|
|
@@ -55,7 +56,7 @@ export const gro_plugin_gen = ({ input_paths = [paths.source], root_dirs = [path
|
|
|
55
56
|
if (is_gen_path(source_file.id)) {
|
|
56
57
|
queue_gen(source_file.id);
|
|
57
58
|
}
|
|
58
|
-
const dependent_gen_file_ids = filter_dependents(source_file, filer.get_by_id, is_gen_path);
|
|
59
|
+
const dependent_gen_file_ids = filter_dependents(source_file, filer.get_by_id, is_gen_path, undefined, undefined, log);
|
|
59
60
|
for (const dependent_gen_file_id of dependent_gen_file_ids) {
|
|
60
61
|
queue_gen(dependent_gen_file_id);
|
|
61
62
|
}
|
|
@@ -78,17 +79,3 @@ export const gro_plugin_gen = ({ input_paths = [paths.source], root_dirs = [path
|
|
|
78
79
|
},
|
|
79
80
|
};
|
|
80
81
|
};
|
|
81
|
-
export const filter_dependents = (source_file, get_by_id, filter, results = new Set(), searched = new Set()) => {
|
|
82
|
-
const { dependents } = source_file;
|
|
83
|
-
for (const dependent_id of dependents.keys()) {
|
|
84
|
-
if (searched.has(dependent_id))
|
|
85
|
-
continue;
|
|
86
|
-
searched.add(dependent_id);
|
|
87
|
-
if (!filter || filter(dependent_id)) {
|
|
88
|
-
results.add(dependent_id);
|
|
89
|
-
}
|
|
90
|
-
const dependent_source_File = get_by_id(dependent_id);
|
|
91
|
-
filter_dependents(dependent_source_File, get_by_id, filter, results, searched);
|
|
92
|
-
}
|
|
93
|
-
return results;
|
|
94
|
-
};
|
package/dist/gro_plugin_moss.js
CHANGED
|
@@ -7,7 +7,8 @@ import { css_classes_by_name } from '@ryanatkn/moss/css_classes.js';
|
|
|
7
7
|
import { format_file } from './format_file.js';
|
|
8
8
|
const FLUSH_DEBOUNCE_DELAY = 500;
|
|
9
9
|
export const gro_plugin_moss = ({ include_classes = null, outfile = 'src/routes/moss.css', // TODO maybe support multiple files using file filters to check where to collect them?
|
|
10
|
-
filter_file = (p) => !p.includes('.test.') && !p.includes('/test/'),
|
|
10
|
+
filter_file = (p) => !p.includes('.test.') && !p.includes('/test/'), // TODO hacky, centralize this and maybe exclude other things like `.gen.` files
|
|
11
|
+
flush_debounce_delay = FLUSH_DEBOUNCE_DELAY, banner = 'generated by gro_plugin_moss', } = EMPTY_OBJECT) => {
|
|
11
12
|
const css_classes = new Css_Classes(Array.isArray(include_classes) ? new Set(include_classes) : include_classes);
|
|
12
13
|
let previous_output;
|
|
13
14
|
let flushing_timeout;
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AA8EvD,eAAO,MAAM,IAAI,EAAE,QAwFlB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAoDrB,CAAC"}
|
package/dist/loader.js
CHANGED
|
@@ -13,6 +13,7 @@ import { JSON_MATCHER, NODE_MODULES_DIRNAME, TS_MATCHER } from './constants.js';
|
|
|
13
13
|
import { to_define_import_meta_env, default_ts_transform_options } from './esbuild_helpers.js';
|
|
14
14
|
import { resolve_specifier } from './resolve_specifier.js';
|
|
15
15
|
import { map_sveltekit_aliases } from './sveltekit_helpers.js';
|
|
16
|
+
// TODO get out of the loader business, starting with https://nodejs.org/api/typescript.html#type-stripping
|
|
16
17
|
/*
|
|
17
18
|
|
|
18
19
|
Usage via `$lib/register.ts`:
|
|
@@ -30,7 +31,7 @@ gro run foo.ts
|
|
|
30
31
|
Direct usage without register (see also `$lib/gro.ts`):
|
|
31
32
|
|
|
32
33
|
```bash
|
|
33
|
-
node --import 'data:text/javascript,import {register} from "node:module"; import {pathToFileURL} from "node:url"; register("@ryanatkn/gro/loader.js", pathToFileURL("./"));' --enable-source-maps' foo.ts
|
|
34
|
+
node --import 'data:text/javascript,import {register} from "node:module"; import {pathToFileURL} from "node:url"; register("@ryanatkn/gro/loader.js", pathToFileURL("./"));' --experimental-import-meta-resolve --enable-source-maps' foo.ts
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
TODO how to improve that gnarly import line? was originally designed for the now-deprecated `--loader`
|
package/dist/package.d.ts
CHANGED
package/dist/package.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/package.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgxBD,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.
|
|
4
|
+
version: '0.151.1',
|
|
5
5
|
description: 'task runner and toolkit extending SvelteKit',
|
|
6
6
|
motto: 'generate, run, optimize',
|
|
7
7
|
glyph: '🌰',
|
|
@@ -56,20 +56,20 @@ export const package_json = {
|
|
|
56
56
|
'@changesets/changelog-git': '^0.2.1',
|
|
57
57
|
'@changesets/types': '^6.1.0',
|
|
58
58
|
'@ryanatkn/eslint-config': '^0.8.0',
|
|
59
|
-
'@ryanatkn/fuz': '^0.
|
|
60
|
-
'@ryanatkn/moss': '^0.
|
|
59
|
+
'@ryanatkn/fuz': '^0.139.0',
|
|
60
|
+
'@ryanatkn/moss': '^0.25.0',
|
|
61
61
|
'@sveltejs/adapter-static': '^3.0.8',
|
|
62
|
-
'@sveltejs/kit': '^2.20.
|
|
63
|
-
'@sveltejs/package': '^2.3.
|
|
62
|
+
'@sveltejs/kit': '^2.20.7',
|
|
63
|
+
'@sveltejs/package': '^2.3.11',
|
|
64
64
|
'@sveltejs/vite-plugin-svelte': '^5.0.3',
|
|
65
65
|
'@types/node': '^22.14.1',
|
|
66
66
|
esbuild: '^0.25.2',
|
|
67
67
|
eslint: '^9.24.0',
|
|
68
68
|
'eslint-plugin-svelte': '^3.5.1',
|
|
69
|
-
svelte: '^5.
|
|
69
|
+
svelte: '^5.27.0',
|
|
70
70
|
'svelte-check': '^4.1.6',
|
|
71
71
|
typescript: '^5.8.3',
|
|
72
|
-
'typescript-eslint': '^8.
|
|
72
|
+
'typescript-eslint': '^8.30.1',
|
|
73
73
|
uvu: '^0.5.6',
|
|
74
74
|
},
|
|
75
75
|
prettier: {
|
|
@@ -263,7 +263,7 @@ export const package_json = {
|
|
|
263
263
|
};
|
|
264
264
|
export const src_json = {
|
|
265
265
|
name: '@ryanatkn/gro',
|
|
266
|
-
version: '0.
|
|
266
|
+
version: '0.151.1',
|
|
267
267
|
modules: {
|
|
268
268
|
'.': {
|
|
269
269
|
path: 'index.ts',
|
|
@@ -479,6 +479,7 @@ export const src_json = {
|
|
|
479
479
|
{ name: 'On_Filer_Change', kind: 'type' },
|
|
480
480
|
{ name: 'Filer_Options', kind: 'type' },
|
|
481
481
|
{ name: 'Filer', kind: 'class' },
|
|
482
|
+
{ name: 'filter_dependents', kind: 'function' },
|
|
482
483
|
],
|
|
483
484
|
},
|
|
484
485
|
'./format_directory.js': {
|
|
@@ -600,7 +601,6 @@ export const src_json = {
|
|
|
600
601
|
{ name: 'Task_Args', kind: 'type' },
|
|
601
602
|
{ name: 'Gro_Plugin_Gen_Options', kind: 'type' },
|
|
602
603
|
{ name: 'gro_plugin_gen', kind: 'function' },
|
|
603
|
-
{ name: 'filter_dependents', kind: 'function' },
|
|
604
604
|
],
|
|
605
605
|
},
|
|
606
606
|
'./gro_plugin_moss.js': {
|
|
@@ -722,6 +722,7 @@ export const src_json = {
|
|
|
722
722
|
{ name: 'update_package_json', kind: 'function' },
|
|
723
723
|
{ name: 'to_package_exports', kind: 'function' },
|
|
724
724
|
{ name: 'parse_repo_url', kind: 'function' },
|
|
725
|
+
{ name: 'is_dep', kind: 'function' },
|
|
725
726
|
{ name: 'has_dep', kind: 'function' },
|
|
726
727
|
{ name: 'Package_Json_Dep', kind: 'type' },
|
|
727
728
|
{ name: 'extract_deps', kind: 'function' },
|
package/dist/package_json.d.ts
CHANGED
|
@@ -382,6 +382,7 @@ export declare const parse_repo_url: (package_json: Package_Json) => {
|
|
|
382
382
|
owner: string;
|
|
383
383
|
repo: string;
|
|
384
384
|
} | undefined;
|
|
385
|
+
export declare const is_dep: (dep_name: string, package_json?: Package_Json) => boolean;
|
|
385
386
|
export declare const has_dep: (dep_name: string, package_json?: Package_Json) => boolean;
|
|
386
387
|
export interface Package_Json_Dep {
|
|
387
388
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/package_json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAUtD,eAAO,MAAM,GAAG,aAAa,CAAC;AAC9B,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;AAGvD,eAAO,MAAM,KAAK,aAAa,CAAC;AAChC,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAG7D,eAAO,MAAM,mCAAmC,GAAI,CAAC,EAAE,KAAK,CAAC,KAAG,CAAC,GAAG,SAKnE,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;kCASlC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,C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CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC/B,uBAAgB,EAChB,QAAQ,CAAC,YAAY,EAAE,YAAY,KAAK,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,EAC1F,eAAY,KACV,OAAO,CAAC;IAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAC,CAa/D,CAAC;AAIF,eAAO,MAAM,kBAAkB,GAAI,OAAO,KAAK,CAAC,MAAM,CAAC,KAAG,oBA6CzD,CAAC;AAIF,eAAO,MAAM,cAAc,GAC1B,cAAc,YAAY,KACxB;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,SAgBlC,CAAC;AA8BF,eAAO,MAAM,MAAM,GAClB,UAAU,MAAM,EAChB,eAAc,YAAkC,KAC9C,OAAyC,CAAC;AAE7C,eAAO,MAAM,OAAO,GACnB,UAAU,MAAM,EAChB,eAAc,YAAkC,KAC9C,OAGyC,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,YAAY,GAAI,cAAc,YAAY,KAAG,KAAK,CAAC,gBAAgB,CAe/E,CAAC"}
|
package/dist/package_json.js
CHANGED
|
@@ -275,6 +275,7 @@ const parse_or_throw_formatted_error = (name, schema, value) => {
|
|
|
275
275
|
}
|
|
276
276
|
return parsed.data;
|
|
277
277
|
};
|
|
278
|
+
export const is_dep = (dep_name, package_json = load_package_json()) => package_json.name === dep_name;
|
|
278
279
|
export const has_dep = (dep_name, package_json = load_package_json()) => !!package_json.devDependencies?.[dep_name] ||
|
|
279
280
|
!!package_json.dependencies?.[dep_name] ||
|
|
280
281
|
!!package_json.peerDependencies?.[dep_name];
|
package/dist/plugin.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface Plugin_Context<T_Args = object> extends Task_Context<T_Args> {
|
|
|
14
14
|
dev: boolean;
|
|
15
15
|
watch: boolean;
|
|
16
16
|
}
|
|
17
|
+
/** See `Plugins.create` for a usage example. */
|
|
17
18
|
export declare class Plugins<T_Plugin_Context extends Plugin_Context> {
|
|
18
19
|
private ctx;
|
|
19
20
|
private instances;
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,MAAM,CAAC,gBAAgB,SAAS,cAAc,GAAG,cAAc;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D;AAED,MAAM,MAAM,qBAAqB,CAAC,gBAAgB,SAAS,cAAc,GAAG,cAAc,IAAI,CAC7F,GAAG,EAAE,gBAAgB,KACjB,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEhF,MAAM,WAAW,cAAc,CAAC,MAAM,GAAG,MAAM,CAAE,SAAQ,YAAY,CAAC,MAAM,CAAC;IAC5E,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CACf;AAED,qBAAa,OAAO,CAAC,gBAAgB,SAAS,cAAc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AAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAetB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAatB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAc/B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAC1B,SAAS,KAAK,CAAC,MAAM,CAAC,EACtB,YAAY,MAAM,EAClB,aAAsB,KACpB,KAAK,CAAC,MAAM,CAMd,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -7,7 +7,7 @@ import { replace_extension } from './paths.js';
|
|
|
7
7
|
* If no `.js` file is found for the specifier on the filesystem, it assumes `.ts`.
|
|
8
8
|
*/
|
|
9
9
|
export const resolve_specifier = (specifier, dir) => {
|
|
10
|
-
const raw = specifier.endsWith('?raw');
|
|
10
|
+
const raw = specifier.endsWith('?raw'); // TODO more robust detection? other values?
|
|
11
11
|
const final_specifier = raw ? specifier.substring(0, specifier.length - 4) : specifier;
|
|
12
12
|
const absolute_path = isAbsolute(final_specifier) ? final_specifier : join(dir, final_specifier);
|
|
13
13
|
let mapped_path;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryanatkn/gro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.151.1",
|
|
4
4
|
"description": "task runner and toolkit extending SvelteKit",
|
|
5
5
|
"motto": "generate, run, optimize",
|
|
6
6
|
"glyph": "🌰",
|
|
@@ -69,20 +69,20 @@
|
|
|
69
69
|
"@changesets/changelog-git": "^0.2.1",
|
|
70
70
|
"@changesets/types": "^6.1.0",
|
|
71
71
|
"@ryanatkn/eslint-config": "^0.8.0",
|
|
72
|
-
"@ryanatkn/fuz": "^0.
|
|
73
|
-
"@ryanatkn/moss": "^0.
|
|
72
|
+
"@ryanatkn/fuz": "^0.139.0",
|
|
73
|
+
"@ryanatkn/moss": "^0.25.0",
|
|
74
74
|
"@sveltejs/adapter-static": "^3.0.8",
|
|
75
|
-
"@sveltejs/kit": "^2.20.
|
|
76
|
-
"@sveltejs/package": "^2.3.
|
|
75
|
+
"@sveltejs/kit": "^2.20.7",
|
|
76
|
+
"@sveltejs/package": "^2.3.11",
|
|
77
77
|
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
78
78
|
"@types/node": "^22.14.1",
|
|
79
79
|
"esbuild": "^0.25.2",
|
|
80
80
|
"eslint": "^9.24.0",
|
|
81
81
|
"eslint-plugin-svelte": "^3.5.1",
|
|
82
|
-
"svelte": "^5.
|
|
82
|
+
"svelte": "^5.27.0",
|
|
83
83
|
"svelte-check": "^4.1.6",
|
|
84
84
|
"typescript": "^5.8.3",
|
|
85
|
-
"typescript-eslint": "^8.
|
|
85
|
+
"typescript-eslint": "^8.30.1",
|
|
86
86
|
"uvu": "^0.5.6"
|
|
87
87
|
},
|
|
88
88
|
"prettier": {
|
package/src/lib/filer.ts
CHANGED
|
@@ -4,10 +4,11 @@ import {dirname, resolve} from 'node:path';
|
|
|
4
4
|
import type {Omit_Strict} from '@ryanatkn/belt/types.js';
|
|
5
5
|
import {wait} from '@ryanatkn/belt/async.js';
|
|
6
6
|
import {isBuiltin} from 'node:module';
|
|
7
|
-
import {fileURLToPath} from 'node:url';
|
|
7
|
+
import {fileURLToPath, pathToFileURL} from 'node:url';
|
|
8
8
|
import {Unreachable_Error} from '@ryanatkn/belt/error.js';
|
|
9
|
+
import type {Logger} from '@ryanatkn/belt/log.js';
|
|
9
10
|
|
|
10
|
-
import type {Path_Id} from './path.js';
|
|
11
|
+
import type {File_Filter, Path_Id} from './path.js';
|
|
11
12
|
import {
|
|
12
13
|
watch_dir,
|
|
13
14
|
type Watch_Node_Fs,
|
|
@@ -101,7 +102,7 @@ export class Filer {
|
|
|
101
102
|
file.ctime = stats?.ctimeMs ?? null;
|
|
102
103
|
file.mtime = stats?.mtimeMs ?? null;
|
|
103
104
|
|
|
104
|
-
const new_contents = stats ? readFileSync(id, 'utf8') : null;
|
|
105
|
+
const new_contents = stats ? readFileSync(id, 'utf8') : null; // TODO need to lazily load contents, probably turn `Source_File` into a class
|
|
105
106
|
|
|
106
107
|
if (file.contents === new_contents) {
|
|
107
108
|
return null;
|
|
@@ -126,7 +127,8 @@ export class Filer {
|
|
|
126
127
|
} else {
|
|
127
128
|
if (isBuiltin(path)) continue;
|
|
128
129
|
try {
|
|
129
|
-
|
|
130
|
+
const file_url = pathToFileURL(file.id);
|
|
131
|
+
path_id = fileURLToPath(import.meta.resolve(path, file_url.href));
|
|
130
132
|
} catch (error) {
|
|
131
133
|
// If it's imported from an external module, ignore any import errors.
|
|
132
134
|
if (error.code === 'ERR_MODULE_NOT_FOUND' && file.external) {
|
|
@@ -251,3 +253,31 @@ export class Filer {
|
|
|
251
253
|
return !id.startsWith(this.root_dir + '/') || (!!filter && !filter(id, false));
|
|
252
254
|
}
|
|
253
255
|
}
|
|
256
|
+
|
|
257
|
+
// TODO maybe `Source_File` class?
|
|
258
|
+
export const filter_dependents = (
|
|
259
|
+
source_file: Source_File,
|
|
260
|
+
get_by_id: (id: Path_Id) => Source_File | undefined,
|
|
261
|
+
filter?: File_Filter,
|
|
262
|
+
results: Set<string> = new Set(),
|
|
263
|
+
searched: Set<string> = new Set(),
|
|
264
|
+
log?: Logger,
|
|
265
|
+
): Set<string> => {
|
|
266
|
+
const {dependents} = source_file;
|
|
267
|
+
for (const dependent_id of dependents.keys()) {
|
|
268
|
+
if (searched.has(dependent_id)) continue;
|
|
269
|
+
searched.add(dependent_id);
|
|
270
|
+
if (!filter || filter(dependent_id)) {
|
|
271
|
+
results.add(dependent_id);
|
|
272
|
+
}
|
|
273
|
+
const dependent_source_file = get_by_id(dependent_id);
|
|
274
|
+
if (!dependent_source_file) {
|
|
275
|
+
log?.warn(
|
|
276
|
+
`[filer.filter_dependents]: dependent source file ${dependent_id} not found for ${source_file.id}`,
|
|
277
|
+
);
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
filter_dependents(dependent_source_file, get_by_id, filter, results, searched);
|
|
281
|
+
}
|
|
282
|
+
return results;
|
|
283
|
+
};
|
|
@@ -4,7 +4,7 @@ import {has_server, gro_plugin_server} from './gro_plugin_server.js';
|
|
|
4
4
|
import {gro_plugin_sveltekit_app} from './gro_plugin_sveltekit_app.js';
|
|
5
5
|
import {has_sveltekit_app, has_sveltekit_library} from './sveltekit_helpers.js';
|
|
6
6
|
import {gro_plugin_gen} from './gro_plugin_gen.js';
|
|
7
|
-
import {has_dep, load_package_json} from './package_json.js';
|
|
7
|
+
import {has_dep, is_dep, load_package_json} from './package_json.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* This is the default config that's passed to `gro.config.ts`
|
|
@@ -20,7 +20,7 @@ const config: Create_Gro_Config = async (cfg) => {
|
|
|
20
20
|
|
|
21
21
|
const [has_moss_dep, has_server_result, has_sveltekit_library_result, has_sveltekit_app_result] =
|
|
22
22
|
await Promise.all([
|
|
23
|
-
has_dep('@ryanatkn/moss', package_json),
|
|
23
|
+
has_dep('@ryanatkn/moss', package_json) || is_dep('@ryanatkn/moss', package_json),
|
|
24
24
|
has_server(),
|
|
25
25
|
has_sveltekit_library(package_json),
|
|
26
26
|
has_sveltekit_app(),
|
package/src/lib/gro_helpers.ts
CHANGED
|
@@ -93,6 +93,7 @@ export const spawn_with_loader = (
|
|
|
93
93
|
import {register} from "node:module";
|
|
94
94
|
import {pathToFileURL} from "node:url";
|
|
95
95
|
register("${loader_path}", pathToFileURL("./"));`,
|
|
96
|
+
'--experimental-import-meta-resolve', // for `import.meta.resolve`
|
|
96
97
|
'--enable-source-maps', // because TypeScript
|
|
97
98
|
];
|
|
98
99
|
// In almost all cases we want the exports condition to be `"development"`. Needed for `esm-env`.
|
|
@@ -7,8 +7,7 @@ import type {Args} from './args.js';
|
|
|
7
7
|
import {paths} from './paths.js';
|
|
8
8
|
import {find_genfiles, is_gen_path} from './gen.js';
|
|
9
9
|
import {spawn_cli} from './cli.js';
|
|
10
|
-
import
|
|
11
|
-
import type {Cleanup_Watch, Source_File} from './filer.js';
|
|
10
|
+
import {filter_dependents, type Cleanup_Watch} from './filer.js';
|
|
12
11
|
|
|
13
12
|
const FLUSH_DEBOUNCE_DELAY = 500;
|
|
14
13
|
|
|
@@ -86,6 +85,9 @@ export const gro_plugin_gen = ({
|
|
|
86
85
|
source_file,
|
|
87
86
|
filer.get_by_id,
|
|
88
87
|
is_gen_path,
|
|
88
|
+
undefined,
|
|
89
|
+
undefined,
|
|
90
|
+
log,
|
|
89
91
|
);
|
|
90
92
|
for (const dependent_gen_file_id of dependent_gen_file_ids) {
|
|
91
93
|
queue_gen(dependent_gen_file_id);
|
|
@@ -109,23 +111,3 @@ export const gro_plugin_gen = ({
|
|
|
109
111
|
},
|
|
110
112
|
};
|
|
111
113
|
};
|
|
112
|
-
|
|
113
|
-
export const filter_dependents = (
|
|
114
|
-
source_file: Source_File,
|
|
115
|
-
get_by_id: (id: Path_Id) => Source_File | undefined,
|
|
116
|
-
filter?: File_Filter,
|
|
117
|
-
results: Set<string> = new Set(),
|
|
118
|
-
searched: Set<string> = new Set(),
|
|
119
|
-
): Set<string> => {
|
|
120
|
-
const {dependents} = source_file;
|
|
121
|
-
for (const dependent_id of dependents.keys()) {
|
|
122
|
-
if (searched.has(dependent_id)) continue;
|
|
123
|
-
searched.add(dependent_id);
|
|
124
|
-
if (!filter || filter(dependent_id)) {
|
|
125
|
-
results.add(dependent_id);
|
|
126
|
-
}
|
|
127
|
-
const dependent_source_File = get_by_id(dependent_id)!;
|
|
128
|
-
filter_dependents(dependent_source_File, get_by_id, filter, results, searched);
|
|
129
|
-
}
|
|
130
|
-
return results;
|
|
131
|
-
};
|
|
@@ -32,7 +32,7 @@ export interface Gro_Plugin_Moss_Options {
|
|
|
32
32
|
export const gro_plugin_moss = ({
|
|
33
33
|
include_classes = null,
|
|
34
34
|
outfile = 'src/routes/moss.css', // TODO maybe support multiple files using file filters to check where to collect them?
|
|
35
|
-
filter_file = (p) => !p.includes('.test.') && !p.includes('/test/'),
|
|
35
|
+
filter_file = (p) => !p.includes('.test.') && !p.includes('/test/'), // TODO hacky, centralize this and maybe exclude other things like `.gen.` files
|
|
36
36
|
flush_debounce_delay = FLUSH_DEBOUNCE_DELAY,
|
|
37
37
|
banner = 'generated by gro_plugin_moss',
|
|
38
38
|
}: Gro_Plugin_Moss_Options = EMPTY_OBJECT): Plugin => {
|
package/src/lib/loader.ts
CHANGED
|
@@ -22,6 +22,8 @@ import {to_define_import_meta_env, default_ts_transform_options} from './esbuild
|
|
|
22
22
|
import {resolve_specifier} from './resolve_specifier.js';
|
|
23
23
|
import {map_sveltekit_aliases} from './sveltekit_helpers.js';
|
|
24
24
|
|
|
25
|
+
// TODO get out of the loader business, starting with https://nodejs.org/api/typescript.html#type-stripping
|
|
26
|
+
|
|
25
27
|
/*
|
|
26
28
|
|
|
27
29
|
Usage via `$lib/register.ts`:
|
|
@@ -39,7 +41,7 @@ gro run foo.ts
|
|
|
39
41
|
Direct usage without register (see also `$lib/gro.ts`):
|
|
40
42
|
|
|
41
43
|
```bash
|
|
42
|
-
node --import 'data:text/javascript,import {register} from "node:module"; import {pathToFileURL} from "node:url"; register("@ryanatkn/gro/loader.js", pathToFileURL("./"));' --enable-source-maps' foo.ts
|
|
44
|
+
node --import 'data:text/javascript,import {register} from "node:module"; import {pathToFileURL} from "node:url"; register("@ryanatkn/gro/loader.js", pathToFileURL("./"));' --experimental-import-meta-resolve --enable-source-maps' foo.ts
|
|
43
45
|
```
|
|
44
46
|
|
|
45
47
|
TODO how to improve that gnarly import line? was originally designed for the now-deprecated `--loader`
|
package/src/lib/package.ts
CHANGED
|
@@ -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.
|
|
8
|
+
version: '0.151.1',
|
|
9
9
|
description: 'task runner and toolkit extending SvelteKit',
|
|
10
10
|
motto: 'generate, run, optimize',
|
|
11
11
|
glyph: '🌰',
|
|
@@ -61,20 +61,20 @@ export const package_json = {
|
|
|
61
61
|
'@changesets/changelog-git': '^0.2.1',
|
|
62
62
|
'@changesets/types': '^6.1.0',
|
|
63
63
|
'@ryanatkn/eslint-config': '^0.8.0',
|
|
64
|
-
'@ryanatkn/fuz': '^0.
|
|
65
|
-
'@ryanatkn/moss': '^0.
|
|
64
|
+
'@ryanatkn/fuz': '^0.139.0',
|
|
65
|
+
'@ryanatkn/moss': '^0.25.0',
|
|
66
66
|
'@sveltejs/adapter-static': '^3.0.8',
|
|
67
|
-
'@sveltejs/kit': '^2.20.
|
|
68
|
-
'@sveltejs/package': '^2.3.
|
|
67
|
+
'@sveltejs/kit': '^2.20.7',
|
|
68
|
+
'@sveltejs/package': '^2.3.11',
|
|
69
69
|
'@sveltejs/vite-plugin-svelte': '^5.0.3',
|
|
70
70
|
'@types/node': '^22.14.1',
|
|
71
71
|
esbuild: '^0.25.2',
|
|
72
72
|
eslint: '^9.24.0',
|
|
73
73
|
'eslint-plugin-svelte': '^3.5.1',
|
|
74
|
-
svelte: '^5.
|
|
74
|
+
svelte: '^5.27.0',
|
|
75
75
|
'svelte-check': '^4.1.6',
|
|
76
76
|
typescript: '^5.8.3',
|
|
77
|
-
'typescript-eslint': '^8.
|
|
77
|
+
'typescript-eslint': '^8.30.1',
|
|
78
78
|
uvu: '^0.5.6',
|
|
79
79
|
},
|
|
80
80
|
prettier: {
|
|
@@ -269,7 +269,7 @@ export const package_json = {
|
|
|
269
269
|
|
|
270
270
|
export const src_json = {
|
|
271
271
|
name: '@ryanatkn/gro',
|
|
272
|
-
version: '0.
|
|
272
|
+
version: '0.151.1',
|
|
273
273
|
modules: {
|
|
274
274
|
'.': {
|
|
275
275
|
path: 'index.ts',
|
|
@@ -485,6 +485,7 @@ export const src_json = {
|
|
|
485
485
|
{name: 'On_Filer_Change', kind: 'type'},
|
|
486
486
|
{name: 'Filer_Options', kind: 'type'},
|
|
487
487
|
{name: 'Filer', kind: 'class'},
|
|
488
|
+
{name: 'filter_dependents', kind: 'function'},
|
|
488
489
|
],
|
|
489
490
|
},
|
|
490
491
|
'./format_directory.js': {
|
|
@@ -606,7 +607,6 @@ export const src_json = {
|
|
|
606
607
|
{name: 'Task_Args', kind: 'type'},
|
|
607
608
|
{name: 'Gro_Plugin_Gen_Options', kind: 'type'},
|
|
608
609
|
{name: 'gro_plugin_gen', kind: 'function'},
|
|
609
|
-
{name: 'filter_dependents', kind: 'function'},
|
|
610
610
|
],
|
|
611
611
|
},
|
|
612
612
|
'./gro_plugin_moss.js': {
|
|
@@ -728,6 +728,7 @@ export const src_json = {
|
|
|
728
728
|
{name: 'update_package_json', kind: 'function'},
|
|
729
729
|
{name: 'to_package_exports', kind: 'function'},
|
|
730
730
|
{name: 'parse_repo_url', kind: 'function'},
|
|
731
|
+
{name: 'is_dep', kind: 'function'},
|
|
731
732
|
{name: 'has_dep', kind: 'function'},
|
|
732
733
|
{name: 'Package_Json_Dep', kind: 'type'},
|
|
733
734
|
{name: 'extract_deps', kind: 'function'},
|
package/src/lib/package_json.ts
CHANGED
|
@@ -347,6 +347,11 @@ const parse_or_throw_formatted_error = <T extends z.ZodTypeAny>(
|
|
|
347
347
|
return parsed.data;
|
|
348
348
|
};
|
|
349
349
|
|
|
350
|
+
export const is_dep = (
|
|
351
|
+
dep_name: string,
|
|
352
|
+
package_json: Package_Json = load_package_json(),
|
|
353
|
+
): boolean => package_json.name === dep_name;
|
|
354
|
+
|
|
350
355
|
export const has_dep = (
|
|
351
356
|
dep_name: string,
|
|
352
357
|
package_json: Package_Json = load_package_json(),
|
package/src/lib/plugin.ts
CHANGED
|
@@ -20,8 +20,8 @@ export interface Plugin_Context<T_Args = object> extends Task_Context<T_Args> {
|
|
|
20
20
|
watch: boolean;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/** See `Plugins.create` for a usage example. */
|
|
23
24
|
export class Plugins<T_Plugin_Context extends Plugin_Context> {
|
|
24
|
-
/* prefer `Plugins.create` to the constructor */
|
|
25
25
|
constructor(
|
|
26
26
|
private ctx: T_Plugin_Context,
|
|
27
27
|
private instances: Array<Plugin>,
|
|
@@ -25,7 +25,7 @@ export interface Resolved_Specifier {
|
|
|
25
25
|
* If no `.js` file is found for the specifier on the filesystem, it assumes `.ts`.
|
|
26
26
|
*/
|
|
27
27
|
export const resolve_specifier = (specifier: string, dir: string): Resolved_Specifier => {
|
|
28
|
-
const raw = specifier.endsWith('?raw');
|
|
28
|
+
const raw = specifier.endsWith('?raw'); // TODO more robust detection? other values?
|
|
29
29
|
const final_specifier = raw ? specifier.substring(0, specifier.length - 4) : specifier;
|
|
30
30
|
const absolute_path = isAbsolute(final_specifier) ? final_specifier : join(dir, final_specifier);
|
|
31
31
|
|