@ryanatkn/gro 0.140.3 → 0.140.5

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/README.md CHANGED
@@ -9,7 +9,6 @@
9
9
  [Windows won't be supported](https://github.com/ryanatkn/gro/issues/319), I chose Bash instead.
10
10
 
11
11
  Feel free to open issues with anything you'd like to discuss or report.
12
- I also run [a Discord community](https://discord.gg/YU5tyeK72X) that includes channels for Gro.
13
12
 
14
13
  ## about
15
14
 
@@ -1 +1 @@
1
- {"version":3,"file":"filer.d.ts","sourceRoot":"../src/lib/","sources":["filer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAGzD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EACN,SAAS,EAET,KAAK,cAAc,EACnB,KAAK,OAAO,IAAI,iBAAiB,EAEjC,MAAM,gBAAgB,CAAC;AAWxB,MAAM,WAAW,WAAW;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,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,OAAO;IACvB,SAAS,CAAC,EAAE,OAAO,SAAS,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAC;CACzE;AAED,qBAAa,KAAK;;IACjB,KAAK,EAAE,GAAG,CAAC,OAA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;IAU3C,SAAS,OAAQ,OAAO,KAAG,WAAW,GAAG,SAAS,CAEhD;IAEF,aAAa,OAAQ,OAAO,KAAG,WAAW,CAWxC;IAyII,KAAK,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;IAKxD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ5B"}
package/dist/filer.js CHANGED
@@ -9,7 +9,8 @@ import { resolve_specifier } from './resolve_specifier.js';
9
9
  import { default_sveltekit_config } from './sveltekit_config.js';
10
10
  import { map_sveltekit_aliases } from './sveltekit_helpers.js';
11
11
  import { Unreachable_Error } from '@ryanatkn/belt/error.js';
12
- import { resolve_node_specifier } from './resolve_node_specifier.js';
12
+ // TODO see below
13
+ // import {resolve_node_specifier} from './resolve_node_specifier.js';
13
14
  const aliases = Object.entries(default_sveltekit_config.alias);
14
15
  export class Filer {
15
16
  files = new Map();
@@ -53,16 +54,27 @@ export class Filer {
53
54
  // TODO logic is duplicated from loader
54
55
  const path = map_sveltekit_aliases(specifier, aliases);
55
56
  // The specifier `path` has now been mapped to its final form, so we can inspect it.
56
- const resolved = path[0] === '.' || path[0] === '/'
57
- ? resolve_specifier(path, dir)
58
- : resolve_node_specifier(path, dir);
59
- const { path_id } = resolved;
60
- dependencies_removed.delete(path_id);
61
- if (!dependencies_before.has(path_id)) {
62
- const d = this.get_or_create(path_id);
63
- file.dependencies.set(d.id, d);
64
- d.dependents.set(file.id, file);
57
+ if (path[0] === '.' || path[0] === '/') {
58
+ const { path_id } = resolve_specifier(path, dir);
59
+ dependencies_removed.delete(path_id);
60
+ if (!dependencies_before.has(path_id)) {
61
+ const d = this.get_or_create(path_id);
62
+ file.dependencies.set(d.id, d);
63
+ d.dependents.set(file.id, file);
64
+ }
65
65
  }
66
+ // TODO this doesn't work
67
+ // const resolved =
68
+ // path[0] === '.' || path[0] === '/'
69
+ // ? resolve_specifier(path, dir)
70
+ // : resolve_node_specifier(path, dir);
71
+ // const {path_id} = resolved;
72
+ // dependencies_removed.delete(path_id);
73
+ // if (!dependencies_before.has(path_id)) {
74
+ // const d = this.get_or_create(path_id);
75
+ // file.dependencies.set(d.id, d);
76
+ // d.dependents.set(file.id, file);
77
+ // }
66
78
  }
67
79
  // update any removed dependencies
68
80
  for (const dependency_removed of dependencies_removed) {
@@ -1,7 +1,7 @@
1
1
  import type { Result } from '@ryanatkn/belt/result.js';
2
2
  import { type Package_Json } from './package_json.js';
3
3
  export declare const MOSS_PACKAGE_DEP_NAME = "@ryanatkn/moss";
4
- export declare const load_moss_plugin: (package_json?: Package_Json, dep_name?: string, plugin_path?: string) => Promise<Result<{
4
+ export declare const load_moss_plugin: (package_json?: Package_Json, dep_name?: string, plugin_path?: string, local_plugin_path?: string) => Promise<Result<{
5
5
  gro_plugin_moss: any;
6
6
  }, {
7
7
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"moss_helpers.d.ts","sourceRoot":"../src/lib/","sources":["moss_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAIrD,OAAO,EAAU,KAAK,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE7D,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,kBACb,YAAY,8CAGzB,OAAO,CAAC,MAAM,CAAC;IAAC,eAAe,EAAE,GAAG,CAAA;CAAC,EAAE;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CAmB3D,CAAC"}
1
+ {"version":3,"file":"moss_helpers.d.ts","sourceRoot":"../src/lib/","sources":["moss_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAIrD,OAAO,EAAU,KAAK,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE7D,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,kBACb,YAAY,0EAIzB,OAAO,CAAC,MAAM,CAAC;IAAC,eAAe,EAAE,GAAG,CAAA;CAAC,EAAE;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CA4B3D,CAAC"}
@@ -3,20 +3,28 @@ import { resolve } from 'node:path';
3
3
  import { has_dep } from './package_json.js';
4
4
  export const MOSS_PACKAGE_DEP_NAME = '@ryanatkn/moss';
5
5
  // TODO plugin type?
6
- export const load_moss_plugin = async (package_json, dep_name = MOSS_PACKAGE_DEP_NAME, plugin_path = `node_modules/${dep_name}/dist/gro_plugin_moss.js`) => {
6
+ export const load_moss_plugin = async (package_json, dep_name = MOSS_PACKAGE_DEP_NAME, plugin_path = `node_modules/${dep_name}/dist/gro_plugin_moss.js`, // TODO maybe lookup from its `package_json.exports`? kinda unnecessary
7
+ local_plugin_path = 'src/lib/gro_plugin_moss.ts') => {
7
8
  if (!has_dep(dep_name, package_json)) {
8
9
  return {
9
10
  ok: false,
10
11
  message: `no dependency found in package.json for ${dep_name}, install it with \`npm i -D ${dep_name}\``,
11
12
  };
12
13
  }
13
- const path = resolve(plugin_path);
14
- if (!existsSync(path)) {
15
- return {
16
- ok: false,
17
- // TODO warn?
18
- message: `dependency on ${dep_name} detected but plugin not found at ${path}`,
19
- };
14
+ let path = undefined;
15
+ const resolved_local_plugin_path = resolve(local_plugin_path);
16
+ if (existsSync(resolved_local_plugin_path)) {
17
+ path = resolved_local_plugin_path;
18
+ }
19
+ if (path === undefined) {
20
+ path = resolve(plugin_path);
21
+ if (!existsSync(path)) {
22
+ return {
23
+ ok: false,
24
+ // TODO warn?
25
+ message: `dependency on ${dep_name} detected but plugin not found at ${path}`,
26
+ };
27
+ }
20
28
  }
21
29
  const mod = await import(path);
22
30
  return { ok: true, gro_plugin_moss: mod.gro_plugin_moss };
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.140.3',
4
+ version: '0.140.5',
5
5
  description: 'task runner and toolkit extending SvelteKit',
6
6
  motto: 'generate, run, optimize',
7
7
  glyph: '🌰',
@@ -61,7 +61,7 @@ export const package_json = {
61
61
  '@sveltejs/adapter-static': '^3.0.5',
62
62
  '@sveltejs/kit': '^2.6.4',
63
63
  '@sveltejs/package': '^2.3.5',
64
- '@sveltejs/vite-plugin-svelte': '^4.0.0-next.8',
64
+ '@sveltejs/vite-plugin-svelte': '^4.0.0-next.6',
65
65
  '@types/fs-extra': '^11.0.4',
66
66
  '@types/node': '^22.7.5',
67
67
  esbuild: '^0.21.5',
@@ -264,7 +264,7 @@ export const package_json = {
264
264
  };
265
265
  export const src_json = {
266
266
  name: '@ryanatkn/gro',
267
- version: '0.140.3',
267
+ version: '0.140.5',
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.140.3",
3
+ "version": "0.140.5",
4
4
  "description": "task runner and toolkit extending SvelteKit",
5
5
  "motto": "generate, run, optimize",
6
6
  "glyph": "🌰",
@@ -74,7 +74,7 @@
74
74
  "@sveltejs/adapter-static": "^3.0.5",
75
75
  "@sveltejs/kit": "^2.6.4",
76
76
  "@sveltejs/package": "^2.3.5",
77
- "@sveltejs/vite-plugin-svelte": "^4.0.0-next.8",
77
+ "@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
78
78
  "@types/fs-extra": "^11.0.4",
79
79
  "@types/node": "^22.7.5",
80
80
  "esbuild": "^0.21.5",
package/src/lib/filer.ts CHANGED
@@ -18,7 +18,8 @@ import {resolve_specifier} from './resolve_specifier.js';
18
18
  import {default_sveltekit_config} from './sveltekit_config.js';
19
19
  import {map_sveltekit_aliases} from './sveltekit_helpers.js';
20
20
  import {Unreachable_Error} from '@ryanatkn/belt/error.js';
21
- import {resolve_node_specifier} from './resolve_node_specifier.js';
21
+ // TODO see below
22
+ // import {resolve_node_specifier} from './resolve_node_specifier.js';
22
23
 
23
24
  const aliases = Object.entries(default_sveltekit_config.alias);
24
25
 
@@ -95,18 +96,27 @@ export class Filer {
95
96
  const path = map_sveltekit_aliases(specifier, aliases);
96
97
 
97
98
  // The specifier `path` has now been mapped to its final form, so we can inspect it.
98
- const resolved =
99
- path[0] === '.' || path[0] === '/'
100
- ? resolve_specifier(path, dir)
101
- : resolve_node_specifier(path, dir);
102
- const {path_id} = resolved;
103
-
104
- dependencies_removed.delete(path_id);
105
- if (!dependencies_before.has(path_id)) {
106
- const d = this.get_or_create(path_id);
107
- file.dependencies.set(d.id, d);
108
- d.dependents.set(file.id, file);
99
+ if (path[0] === '.' || path[0] === '/') {
100
+ const {path_id} = resolve_specifier(path, dir);
101
+ dependencies_removed.delete(path_id);
102
+ if (!dependencies_before.has(path_id)) {
103
+ const d = this.get_or_create(path_id);
104
+ file.dependencies.set(d.id, d);
105
+ d.dependents.set(file.id, file);
106
+ }
109
107
  }
108
+ // TODO this doesn't work
109
+ // const resolved =
110
+ // path[0] === '.' || path[0] === '/'
111
+ // ? resolve_specifier(path, dir)
112
+ // : resolve_node_specifier(path, dir);
113
+ // const {path_id} = resolved;
114
+ // dependencies_removed.delete(path_id);
115
+ // if (!dependencies_before.has(path_id)) {
116
+ // const d = this.get_or_create(path_id);
117
+ // file.dependencies.set(d.id, d);
118
+ // d.dependents.set(file.id, file);
119
+ // }
110
120
  }
111
121
 
112
122
  // update any removed dependencies
@@ -11,6 +11,7 @@ export const load_moss_plugin = async (
11
11
  package_json?: Package_Json,
12
12
  dep_name = MOSS_PACKAGE_DEP_NAME,
13
13
  plugin_path = `node_modules/${dep_name}/dist/gro_plugin_moss.js`, // TODO maybe lookup from its `package_json.exports`? kinda unnecessary
14
+ local_plugin_path = 'src/lib/gro_plugin_moss.ts',
14
15
  ): Promise<Result<{gro_plugin_moss: any}, {message: string}>> => {
15
16
  if (!has_dep(dep_name, package_json)) {
16
17
  return {
@@ -19,13 +20,22 @@ export const load_moss_plugin = async (
19
20
  };
20
21
  }
21
22
 
22
- const path = resolve(plugin_path);
23
- if (!existsSync(path)) {
24
- return {
25
- ok: false,
26
- // TODO warn?
27
- message: `dependency on ${dep_name} detected but plugin not found at ${path}`,
28
- };
23
+ let path: string | undefined = undefined;
24
+
25
+ const resolved_local_plugin_path = resolve(local_plugin_path);
26
+ if (existsSync(resolved_local_plugin_path)) {
27
+ path = resolved_local_plugin_path;
28
+ }
29
+
30
+ if (path === undefined) {
31
+ path = resolve(plugin_path);
32
+ if (!existsSync(path)) {
33
+ return {
34
+ ok: false,
35
+ // TODO warn?
36
+ message: `dependency on ${dep_name} detected but plugin not found at ${path}`,
37
+ };
38
+ }
29
39
  }
30
40
 
31
41
  const mod = await import(path);
@@ -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.140.3',
8
+ version: '0.140.5',
9
9
  description: 'task runner and toolkit extending SvelteKit',
10
10
  motto: 'generate, run, optimize',
11
11
  glyph: '🌰',
@@ -66,7 +66,7 @@ export const package_json = {
66
66
  '@sveltejs/adapter-static': '^3.0.5',
67
67
  '@sveltejs/kit': '^2.6.4',
68
68
  '@sveltejs/package': '^2.3.5',
69
- '@sveltejs/vite-plugin-svelte': '^4.0.0-next.8',
69
+ '@sveltejs/vite-plugin-svelte': '^4.0.0-next.6',
70
70
  '@types/fs-extra': '^11.0.4',
71
71
  '@types/node': '^22.7.5',
72
72
  esbuild: '^0.21.5',
@@ -270,7 +270,7 @@ export const package_json = {
270
270
 
271
271
  export const src_json = {
272
272
  name: '@ryanatkn/gro',
273
- version: '0.140.3',
273
+ version: '0.140.5',
274
274
  modules: {
275
275
  '.': {
276
276
  path: 'index.ts',