@ryanatkn/gro 0.183.0 → 0.184.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/gro_config.d.ts +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/package_json.d.ts +0 -1
- package/dist/package_json.d.ts.map +1 -1
- package/dist/package_json.js +0 -2
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.js +2 -2
- package/dist/source_json.d.ts +1 -1
- package/dist/source_json.d.ts.map +1 -1
- package/dist/source_json.js +2 -2
- package/package.json +2 -2
- package/src/lib/gro_config.ts +3 -3
- package/src/lib/index.ts +1 -1
- package/src/lib/package_json.ts +0 -3
- package/src/lib/plugin.ts +3 -3
- package/src/lib/source_json.ts +2 -2
package/dist/gro_config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PathFilter, PathId } from '@fuzdev/fuz_util/path.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PluginsCreateConfig } from './plugin.ts';
|
|
3
3
|
import type { PackageJsonMapper } from './package_json.ts';
|
|
4
4
|
import type { ParsedSvelteConfig } from './svelte_config.ts';
|
|
5
5
|
/**
|
|
@@ -16,7 +16,7 @@ export interface GroConfig extends RawGroConfig {
|
|
|
16
16
|
/**
|
|
17
17
|
* @see https://github.com/ryanatkn/gro/blob/main/src/docs/plugin.md
|
|
18
18
|
*/
|
|
19
|
-
plugins:
|
|
19
|
+
plugins: PluginsCreateConfig;
|
|
20
20
|
/**
|
|
21
21
|
* Maps the project's `package.json` before writing it to the filesystem.
|
|
22
22
|
* The `package_json` argument may be mutated, but the return value is what's used by the caller.
|
|
@@ -57,7 +57,7 @@ export interface GroConfig extends RawGroConfig {
|
|
|
57
57
|
* @see https://github.com/ryanatkn/gro/blob/main/src/docs/config.md
|
|
58
58
|
*/
|
|
59
59
|
export interface RawGroConfig {
|
|
60
|
-
plugins?:
|
|
60
|
+
plugins?: PluginsCreateConfig;
|
|
61
61
|
map_package_json?: PackageJsonMapper | null;
|
|
62
62
|
task_root_dirs?: Array<string>;
|
|
63
63
|
search_filters?: PathFilter | Array<PathFilter> | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @nodocs */
|
|
2
2
|
export type { GroConfig, CreateGroConfig, RawGroConfig } from './gro_config.ts';
|
|
3
3
|
/** @nodocs */
|
|
4
|
-
export { type Plugin,
|
|
4
|
+
export { type Plugin, plugin_replace } from './plugin.ts';
|
|
5
5
|
/** @nodocs */
|
|
6
6
|
export type { Gen, GenContext } from './gen.ts';
|
|
7
7
|
/** @nodocs */
|
package/dist/index.js
CHANGED
package/dist/package_json.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export type PackageJsonMapper = (package_json: PackageJson) => PackageJson | nul
|
|
|
4
4
|
export declare const PACKAGE_JSON_EMPTY: PackageJson;
|
|
5
5
|
export declare const package_json_load: (dir?: string, cache?: Record<string, PackageJson>, parse?: boolean, // TODO pass `false` here in more places, especially anything perf-sensitive like work on startup
|
|
6
6
|
log?: Logger) => Promise<PackageJson>;
|
|
7
|
-
export declare const load_package_json: (dir?: string, cache?: Record<string, PackageJson>, parse?: boolean, log?: Logger) => Promise<PackageJson>;
|
|
8
7
|
export declare const package_json_sync: (map_package_json: PackageJsonMapper, log: Logger, write?: boolean, dir?: string, exports_dir?: string) => Promise<{
|
|
9
8
|
package_json: PackageJson | null;
|
|
10
9
|
changed: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/package_json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAgBjF,MAAM,MAAM,iBAAiB,GAAG,CAC/B,YAAY,EAAE,WAAW,KACrB,WAAW,G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sBAAsB,GAAI,cAAc,WAAW,KAAG,MACW,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC/B,QAAQ,CAAC,YAAY,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,EACvF,YAAgB,EAChB,eAAY,KACV,OAAO,CAAC;IAAC,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAC,CAa9D,CAAC;AAIF,eAAO,MAAM,uBAAuB,GAAI,OAAO,KAAK,CAAC,MAAM,CAAC,KAAG,kBAmD9D,CAAC;AAIF,eAAO,MAAM,2BAA2B,GACvC,cAAc,WAAW,KACvB;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG,SAgBlC,CAAC;AA8BF,eAAO,MAAM,2BAA2B,GAAI,UAAU,MAAM,EAAE,cAAc,WAAW,KAAG,OAG9C,CAAC;AAE7C,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,iCAAiC,GAC7C,cAAc,WAAW,KACvB,KAAK,CAAC,cAAc,CAetB,CAAC"}
|
package/dist/package_json.js
CHANGED
|
@@ -31,8 +31,6 @@ log) => {
|
|
|
31
31
|
}
|
|
32
32
|
return package_json;
|
|
33
33
|
};
|
|
34
|
-
// TODO remove
|
|
35
|
-
export const load_package_json = package_json_load;
|
|
36
34
|
export const package_json_sync = async (map_package_json, log, write = true, dir = paths.root, exports_dir = paths.lib) => {
|
|
37
35
|
const exported_files = await fs_search(exports_dir);
|
|
38
36
|
const exported_paths = exported_files.map((f) => f.path);
|
package/dist/plugin.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface Plugin<TPluginContext extends PluginContext = PluginContext> {
|
|
|
9
9
|
adapt?: (ctx: TPluginContext) => void | Promise<void>;
|
|
10
10
|
teardown?: (ctx: TPluginContext) => void | Promise<void>;
|
|
11
11
|
}
|
|
12
|
-
export type
|
|
12
|
+
export type PluginsCreateConfig<TPluginContext extends PluginContext = PluginContext> = (ctx: TPluginContext) => Array<Plugin<TPluginContext>> | Promise<Array<Plugin<TPluginContext>>>;
|
|
13
13
|
export interface PluginContext<TArgs = object> extends TaskContext<TArgs> {
|
|
14
14
|
dev: boolean;
|
|
15
15
|
watch: boolean;
|
|
@@ -27,10 +27,10 @@ export declare class Plugins<TPluginContext extends PluginContext> {
|
|
|
27
27
|
/**
|
|
28
28
|
* Replaces a plugin by name in `plugins` without mutating the param.
|
|
29
29
|
* Throws if the plugin name cannot be found.
|
|
30
|
-
* @param plugins - accepts the same types as the return value of `
|
|
30
|
+
* @param plugins - accepts the same types as the return value of `PluginsCreateConfig`
|
|
31
31
|
* @param new_plugin
|
|
32
32
|
* @param name - @default new_plugin.name
|
|
33
33
|
* @returns `plugins` with `new_plugin` at the index of the plugin with `name`
|
|
34
34
|
*/
|
|
35
|
-
export declare const
|
|
35
|
+
export declare const plugin_replace: (plugins: Array<Plugin>, new_plugin: Plugin, name?: string) => Array<Plugin>;
|
|
36
36
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.js
CHANGED
|
@@ -63,12 +63,12 @@ export class Plugins {
|
|
|
63
63
|
/**
|
|
64
64
|
* Replaces a plugin by name in `plugins` without mutating the param.
|
|
65
65
|
* Throws if the plugin name cannot be found.
|
|
66
|
-
* @param plugins - accepts the same types as the return value of `
|
|
66
|
+
* @param plugins - accepts the same types as the return value of `PluginsCreateConfig`
|
|
67
67
|
* @param new_plugin
|
|
68
68
|
* @param name - @default new_plugin.name
|
|
69
69
|
* @returns `plugins` with `new_plugin` at the index of the plugin with `name`
|
|
70
70
|
*/
|
|
71
|
-
export const
|
|
71
|
+
export const plugin_replace = (plugins, new_plugin, name = new_plugin.name) => {
|
|
72
72
|
const index = plugins.findIndex((p) => p.name === name);
|
|
73
73
|
if (index === -1)
|
|
74
74
|
throw Error('Failed to find plugin to replace: ' + name);
|
package/dist/source_json.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { SourceJson, type ModuleJson } from '@fuzdev/fuz_util/source_json.js';
|
|
|
3
3
|
import type { Logger } from '@fuzdev/fuz_util/log.js';
|
|
4
4
|
export type SourceJsonMapper = (source_json: SourceJson) => SourceJson | null | Promise<SourceJson | null>;
|
|
5
5
|
export declare const source_json_create: (package_json: PackageJson, lib_path?: string, log?: Logger) => Promise<SourceJson>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const source_json_modules_create: (exports: PackageJsonExports | undefined, lib_path?: string, log?: Logger) => Promise<Array<ModuleJson> | undefined>;
|
|
7
7
|
//# sourceMappingURL=source_json.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/source_json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AACtF,OAAO,EAAC,UAAU,EAAE,KAAK,UAAU,EAAuB,MAAM,iCAAiC,CAAC;AAClG,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAMpD,MAAM,MAAM,gBAAgB,GAAG,CAC9B,WAAW,EAAE,UAAU,KACnB,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;AAEpD,eAAO,MAAM,kBAAkB,GAC9B,cAAc,WAAW,EACzB,WAAW,MAAM,EACjB,MAAM,MAAM,KACV,OAAO,CAAC,UAAU,CAKlB,CAAC;AAEJ,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"source_json.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/source_json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AACtF,OAAO,EAAC,UAAU,EAAE,KAAK,UAAU,EAAuB,MAAM,iCAAiC,CAAC;AAClG,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAMpD,MAAM,MAAM,gBAAgB,GAAG,CAC9B,WAAW,EAAE,UAAU,KACnB,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;AAEpD,eAAO,MAAM,kBAAkB,GAC9B,cAAc,WAAW,EACzB,WAAW,MAAM,EACjB,MAAM,MAAM,KACV,OAAO,CAAC,UAAU,CAKlB,CAAC;AAEJ,eAAO,MAAM,0BAA0B,GACtC,SAAS,kBAAkB,GAAG,SAAS,EACvC,iBAAoB,EACpB,MAAM,MAAM,KACV,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,SAAS,CAgDvC,CAAC"}
|
package/dist/source_json.js
CHANGED
|
@@ -9,9 +9,9 @@ import { TS_MATCHER, SVELTE_MATCHER, JSON_MATCHER, CSS_MATCHER } from "./constan
|
|
|
9
9
|
export const source_json_create = async (package_json, lib_path, log) => SourceJson.parse({
|
|
10
10
|
name: package_json.name,
|
|
11
11
|
version: package_json.version,
|
|
12
|
-
modules: await
|
|
12
|
+
modules: await source_json_modules_create(package_json.exports, lib_path, log),
|
|
13
13
|
});
|
|
14
|
-
export const
|
|
14
|
+
export const source_json_modules_create = async (exports, lib_path = paths.lib, log) => {
|
|
15
15
|
if (!exports)
|
|
16
16
|
return;
|
|
17
17
|
const file_paths = await collect_file_paths(exports, lib_path);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryanatkn/gro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.184.0",
|
|
4
4
|
"description": "task runner and toolkit extending SvelteKit",
|
|
5
5
|
"motto": "generate, run, optimize",
|
|
6
6
|
"glyph": "🌰",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@changesets/types": "^6.1.0",
|
|
84
84
|
"@fuzdev/fuz_code": "^0.38.0",
|
|
85
85
|
"@fuzdev/fuz_css": "^0.42.1",
|
|
86
|
-
"@fuzdev/fuz_ui": "^0.
|
|
86
|
+
"@fuzdev/fuz_ui": "^0.174.0",
|
|
87
87
|
"@fuzdev/fuz_util": "^0.45.0",
|
|
88
88
|
"@ryanatkn/eslint-config": "^0.9.0",
|
|
89
89
|
"@sveltejs/adapter-static": "^3.0.10",
|
package/src/lib/gro_config.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
SVELTEKIT_DIST_DIRNAME,
|
|
16
16
|
} from './constants.ts';
|
|
17
17
|
import create_default_config from './gro.config.default.ts';
|
|
18
|
-
import type {
|
|
18
|
+
import type {PluginsCreateConfig} from './plugin.ts';
|
|
19
19
|
import type {PackageJsonMapper} from './package_json.ts';
|
|
20
20
|
import type {ParsedSvelteConfig} from './svelte_config.ts';
|
|
21
21
|
import {to_hash} from './hash.ts';
|
|
@@ -36,7 +36,7 @@ export interface GroConfig extends RawGroConfig {
|
|
|
36
36
|
/**
|
|
37
37
|
* @see https://github.com/ryanatkn/gro/blob/main/src/docs/plugin.md
|
|
38
38
|
*/
|
|
39
|
-
plugins:
|
|
39
|
+
plugins: PluginsCreateConfig;
|
|
40
40
|
/**
|
|
41
41
|
* Maps the project's `package.json` before writing it to the filesystem.
|
|
42
42
|
* The `package_json` argument may be mutated, but the return value is what's used by the caller.
|
|
@@ -78,7 +78,7 @@ export interface GroConfig extends RawGroConfig {
|
|
|
78
78
|
* @see https://github.com/ryanatkn/gro/blob/main/src/docs/config.md
|
|
79
79
|
*/
|
|
80
80
|
export interface RawGroConfig {
|
|
81
|
-
plugins?:
|
|
81
|
+
plugins?: PluginsCreateConfig;
|
|
82
82
|
map_package_json?: PackageJsonMapper | null;
|
|
83
83
|
task_root_dirs?: Array<string>;
|
|
84
84
|
search_filters?: PathFilter | Array<PathFilter> | null;
|
package/src/lib/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @nodocs */
|
|
2
2
|
export type {GroConfig, CreateGroConfig, RawGroConfig} from './gro_config.ts';
|
|
3
3
|
/** @nodocs */
|
|
4
|
-
export {type Plugin,
|
|
4
|
+
export {type Plugin, plugin_replace} from './plugin.ts';
|
|
5
5
|
/** @nodocs */
|
|
6
6
|
export type {Gen, GenContext} from './gen.ts';
|
|
7
7
|
/** @nodocs */
|
package/src/lib/package_json.ts
CHANGED
package/src/lib/plugin.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface Plugin<TPluginContext extends PluginContext = PluginContext> {
|
|
|
11
11
|
teardown?: (ctx: TPluginContext) => void | Promise<void>;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export type
|
|
14
|
+
export type PluginsCreateConfig<TPluginContext extends PluginContext = PluginContext> = (
|
|
15
15
|
ctx: TPluginContext,
|
|
16
16
|
) => Array<Plugin<TPluginContext>> | Promise<Array<Plugin<TPluginContext>>>;
|
|
17
17
|
|
|
@@ -88,12 +88,12 @@ export class Plugins<TPluginContext extends PluginContext> {
|
|
|
88
88
|
/**
|
|
89
89
|
* Replaces a plugin by name in `plugins` without mutating the param.
|
|
90
90
|
* Throws if the plugin name cannot be found.
|
|
91
|
-
* @param plugins - accepts the same types as the return value of `
|
|
91
|
+
* @param plugins - accepts the same types as the return value of `PluginsCreateConfig`
|
|
92
92
|
* @param new_plugin
|
|
93
93
|
* @param name - @default new_plugin.name
|
|
94
94
|
* @returns `plugins` with `new_plugin` at the index of the plugin with `name`
|
|
95
95
|
*/
|
|
96
|
-
export const
|
|
96
|
+
export const plugin_replace = (
|
|
97
97
|
plugins: Array<Plugin>,
|
|
98
98
|
new_plugin: Plugin,
|
|
99
99
|
name = new_plugin.name,
|
package/src/lib/source_json.ts
CHANGED
|
@@ -22,10 +22,10 @@ export const source_json_create = async (
|
|
|
22
22
|
SourceJson.parse({
|
|
23
23
|
name: package_json.name,
|
|
24
24
|
version: package_json.version,
|
|
25
|
-
modules: await
|
|
25
|
+
modules: await source_json_modules_create(package_json.exports, lib_path, log),
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
export const
|
|
28
|
+
export const source_json_modules_create = async (
|
|
29
29
|
exports: PackageJsonExports | undefined,
|
|
30
30
|
lib_path = paths.lib,
|
|
31
31
|
log?: Logger,
|