@ryanatkn/gro 0.147.0 → 0.148.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/README.md +3 -1
- package/dist/args.d.ts +5 -5
- package/dist/args.d.ts.map +1 -1
- package/dist/changelog.d.ts +2 -1
- package/dist/changelog.d.ts.map +1 -1
- package/dist/cli.d.ts +4 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/esbuild_plugin_external_worker.d.ts +2 -2
- package/dist/esbuild_plugin_external_worker.d.ts.map +1 -1
- package/dist/esbuild_plugin_svelte.d.ts +1 -1
- package/dist/esbuild_plugin_svelte.d.ts.map +1 -1
- package/dist/esbuild_plugin_sveltekit_shim_env.d.ts +1 -1
- package/dist/esbuild_plugin_sveltekit_shim_env.d.ts.map +1 -1
- package/dist/filer.d.ts.map +1 -1
- package/dist/filer.js +3 -1
- package/dist/gen.d.ts +23 -22
- package/dist/gen.d.ts.map +1 -1
- package/dist/github.d.ts +3 -1
- package/dist/github.d.ts.map +1 -1
- package/dist/gro_config.d.ts +5 -5
- package/dist/gro_config.d.ts.map +1 -1
- package/dist/gro_helpers.d.ts +1 -1
- package/dist/gro_helpers.d.ts.map +1 -1
- package/dist/gro_plugin_gen.d.ts +2 -2
- package/dist/gro_plugin_gen.d.ts.map +1 -1
- package/dist/gro_plugin_moss.d.ts +1 -1
- package/dist/gro_plugin_moss.d.ts.map +1 -1
- package/dist/gro_plugin_server.d.ts +2 -2
- package/dist/gro_plugin_server.d.ts.map +1 -1
- package/dist/input_path.d.ts +10 -10
- package/dist/input_path.d.ts.map +1 -1
- package/dist/invoke.js +2 -0
- package/dist/modules.d.ts +6 -5
- package/dist/modules.d.ts.map +1 -1
- package/dist/package.d.ts +0 -1
- package/dist/package.d.ts.map +1 -1
- package/dist/package.js +17 -17
- package/dist/package_json.d.ts +2 -2
- package/dist/package_json.d.ts.map +1 -1
- package/dist/parse_imports.d.ts +1 -1
- package/dist/parse_imports.d.ts.map +1 -1
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/run_gen.d.ts +1 -1
- package/dist/run_gen.d.ts.map +1 -1
- package/dist/search_fs.d.ts +3 -3
- package/dist/search_fs.d.ts.map +1 -1
- package/dist/sveltekit_config.d.ts +1 -1
- package/dist/sveltekit_config.d.ts.map +1 -1
- package/dist/sveltekit_helpers.d.ts +1 -0
- package/dist/sveltekit_helpers.d.ts.map +1 -1
- package/dist/sveltekit_helpers.js +1 -0
- package/dist/sveltekit_shim_env.d.ts +1 -1
- package/dist/sveltekit_shim_env.d.ts.map +1 -1
- package/dist/task.d.ts +19 -19
- package/dist/task.d.ts.map +1 -1
- package/dist/task_logging.d.ts +1 -1
- package/dist/task_logging.d.ts.map +1 -1
- package/package.json +15 -16
- package/src/lib/args.ts +10 -10
- package/src/lib/cli.ts +3 -3
- package/src/lib/esbuild_plugin_external_worker.ts +2 -2
- package/src/lib/esbuild_plugin_svelte.ts +1 -1
- package/src/lib/esbuild_plugin_sveltekit_shim_env.ts +1 -1
- package/src/lib/filer.ts +2 -1
- package/src/lib/gen.ts +28 -26
- package/src/lib/github.ts +2 -2
- package/src/lib/gro_config.ts +5 -5
- package/src/lib/gro_helpers.ts +1 -1
- package/src/lib/gro_plugin_gen.ts +3 -3
- package/src/lib/gro_plugin_moss.ts +1 -1
- package/src/lib/gro_plugin_server.ts +2 -2
- package/src/lib/gro_plugin_sveltekit_app.ts +1 -1
- package/src/lib/input_path.ts +23 -23
- package/src/lib/invoke.ts +2 -0
- package/src/lib/modules.ts +8 -8
- package/src/lib/package.ts +17 -17
- package/src/lib/package_json.ts +2 -2
- package/src/lib/parse_imports.ts +2 -2
- package/src/lib/plugin.ts +4 -4
- package/src/lib/run_gen.ts +1 -1
- package/src/lib/search_fs.ts +8 -8
- package/src/lib/src_json.ts +1 -1
- package/src/lib/sveltekit_config.ts +1 -1
- package/src/lib/sveltekit_helpers.ts +1 -0
- package/src/lib/sveltekit_shim_env.ts +1 -1
- package/src/lib/task.ts +20 -20
- package/src/lib/task_logging.ts +6 -6
- package/src/lib/upgrade.task.ts +1 -1
|
@@ -12,7 +12,7 @@ export const render_env_shim_module = (
|
|
|
12
12
|
public_prefix = 'PUBLIC_',
|
|
13
13
|
private_prefix = '',
|
|
14
14
|
env_dir?: string,
|
|
15
|
-
env_files?: string
|
|
15
|
+
env_files?: Array<string>,
|
|
16
16
|
ambient_env?: Record<string, string | undefined>,
|
|
17
17
|
): string => {
|
|
18
18
|
const env = load_env(
|
package/src/lib/task.ts
CHANGED
|
@@ -95,40 +95,40 @@ export interface Found_Task {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
export interface Found_Tasks {
|
|
98
|
-
resolved_input_files: Resolved_Input_File
|
|
99
|
-
resolved_input_files_by_root_dir: Map<Path_Id, Resolved_Input_File
|
|
100
|
-
resolved_input_paths: Resolved_Input_Path
|
|
101
|
-
input_paths: Input_Path
|
|
102
|
-
task_root_dirs: Path_Id
|
|
98
|
+
resolved_input_files: Array<Resolved_Input_File>;
|
|
99
|
+
resolved_input_files_by_root_dir: Map<Path_Id, Array<Resolved_Input_File>>;
|
|
100
|
+
resolved_input_paths: Array<Resolved_Input_Path>;
|
|
101
|
+
input_paths: Array<Input_Path>;
|
|
102
|
+
task_root_dirs: Array<Path_Id>;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
export type Find_Tasks_Result = Result<{value: Found_Tasks}, Find_Modules_Failure>;
|
|
106
106
|
export type Find_Modules_Failure =
|
|
107
107
|
| {
|
|
108
108
|
type: 'unmapped_input_paths';
|
|
109
|
-
unmapped_input_paths: Input_Path
|
|
110
|
-
resolved_input_paths: Resolved_Input_Path
|
|
111
|
-
input_paths: Input_Path
|
|
112
|
-
task_root_dirs: Path_Id
|
|
113
|
-
reasons: string
|
|
109
|
+
unmapped_input_paths: Array<Input_Path>;
|
|
110
|
+
resolved_input_paths: Array<Resolved_Input_Path>;
|
|
111
|
+
input_paths: Array<Input_Path>;
|
|
112
|
+
task_root_dirs: Array<Path_Id>;
|
|
113
|
+
reasons: Array<string>;
|
|
114
114
|
}
|
|
115
115
|
| {
|
|
116
116
|
type: 'input_directories_with_no_files';
|
|
117
|
-
input_directories_with_no_files: Input_Path
|
|
118
|
-
resolved_input_files: Resolved_Input_File
|
|
119
|
-
resolved_input_files_by_root_dir: Map<Path_Id, Resolved_Input_File
|
|
120
|
-
resolved_input_paths: Resolved_Input_Path
|
|
121
|
-
input_paths: Input_Path
|
|
122
|
-
task_root_dirs: Path_Id
|
|
123
|
-
reasons: string
|
|
117
|
+
input_directories_with_no_files: Array<Input_Path>;
|
|
118
|
+
resolved_input_files: Array<Resolved_Input_File>;
|
|
119
|
+
resolved_input_files_by_root_dir: Map<Path_Id, Array<Resolved_Input_File>>;
|
|
120
|
+
resolved_input_paths: Array<Resolved_Input_Path>;
|
|
121
|
+
input_paths: Array<Input_Path>;
|
|
122
|
+
task_root_dirs: Array<Path_Id>;
|
|
123
|
+
reasons: Array<string>;
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
127
|
* Finds modules from input paths. (see `src/lib/input_path.ts` for more)
|
|
128
128
|
*/
|
|
129
129
|
export const find_tasks = (
|
|
130
|
-
input_paths: Input_Path
|
|
131
|
-
task_root_dirs: Path_Id
|
|
130
|
+
input_paths: Array<Input_Path>,
|
|
131
|
+
task_root_dirs: Array<Path_Id>,
|
|
132
132
|
config: Gro_Config,
|
|
133
133
|
timings?: Timings,
|
|
134
134
|
): Find_Tasks_Result => {
|
|
@@ -197,7 +197,7 @@ export const find_tasks = (
|
|
|
197
197
|
};
|
|
198
198
|
|
|
199
199
|
export interface Loaded_Tasks {
|
|
200
|
-
modules: Task_Module_Meta
|
|
200
|
+
modules: Array<Task_Module_Meta>;
|
|
201
201
|
found_tasks: Found_Tasks;
|
|
202
202
|
}
|
|
203
203
|
|
package/src/lib/task_logging.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const log_tasks = (log: Logger, loaded_tasks: Loaded_Tasks, log_intro = t
|
|
|
12
12
|
const {modules, found_tasks} = loaded_tasks;
|
|
13
13
|
const {resolved_input_files_by_root_dir} = found_tasks;
|
|
14
14
|
|
|
15
|
-
const logged: string
|
|
15
|
+
const logged: Array<string> = [];
|
|
16
16
|
if (log_intro) {
|
|
17
17
|
logged.unshift(
|
|
18
18
|
`\n\n${st('gray', 'Run a task:')} gro [name]`,
|
|
@@ -44,7 +44,7 @@ export const log_tasks = (log: Logger, loaded_tasks: Loaded_Tasks, log_intro = t
|
|
|
44
44
|
log[log_intro ? 'info' : 'plain'](logged.join('') + '\n');
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
export const log_error_reasons = (log: Logger, reasons: string
|
|
47
|
+
export const log_error_reasons = (log: Logger, reasons: Array<string>): void => {
|
|
48
48
|
for (const reason of reasons) {
|
|
49
49
|
log.error(st('red', reason));
|
|
50
50
|
}
|
|
@@ -57,7 +57,7 @@ export const log_task_help = (log: Logger, meta: Task_Module_Meta): void => {
|
|
|
57
57
|
name,
|
|
58
58
|
mod: {task},
|
|
59
59
|
} = meta;
|
|
60
|
-
const logged: string
|
|
60
|
+
const logged: Array<string> = [];
|
|
61
61
|
logged.push(
|
|
62
62
|
st('cyan', name),
|
|
63
63
|
'help',
|
|
@@ -93,7 +93,7 @@ interface Arg_Schema_Property {
|
|
|
93
93
|
schema: Arg_Schema;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
const to_arg_properties = (def: ZodTypeDef, meta: Task_Module_Meta): Arg_Schema_Property
|
|
96
|
+
const to_arg_properties = (def: ZodTypeDef, meta: Task_Module_Meta): Array<Arg_Schema_Property> => {
|
|
97
97
|
const type_name = to_type_name(def);
|
|
98
98
|
if (type_name !== ZodFirstPartyTypeKind.ZodObject) {
|
|
99
99
|
throw Error(
|
|
@@ -101,7 +101,7 @@ const to_arg_properties = (def: ZodTypeDef, meta: Task_Module_Meta): Arg_Schema_
|
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
103
|
const shape = (def as ZodObjectDef).shape();
|
|
104
|
-
const properties: Arg_Schema_Property
|
|
104
|
+
const properties: Array<Arg_Schema_Property> = [];
|
|
105
105
|
for (const name in shape) {
|
|
106
106
|
if ('no-' + name in shape) continue;
|
|
107
107
|
const s = shape[name];
|
|
@@ -115,7 +115,7 @@ const to_arg_properties = (def: ZodTypeDef, meta: Task_Module_Meta): Arg_Schema_
|
|
|
115
115
|
return properties;
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
const to_max_length = <T>(items: T
|
|
118
|
+
const to_max_length = <T>(items: Array<T>, toString: (item: T) => string) =>
|
|
119
119
|
items.reduce((max, m) => Math.max(toString(m).length, max), 0);
|
|
120
120
|
|
|
121
121
|
// The following Zod helpers only need to support single-depth schemas for CLI args,
|
package/src/lib/upgrade.task.ts
CHANGED
|
@@ -79,7 +79,7 @@ const CUSTOM_TAG_MATCHER = /^[\^~><=]*.+-(.+)/;
|
|
|
79
79
|
|
|
80
80
|
// TODO hacky and limited
|
|
81
81
|
// TODO probably want to pass through exact deps as well, e.g. @foo/bar@1
|
|
82
|
-
const to_upgrade_items = (deps: Package_Json_Dep
|
|
82
|
+
const to_upgrade_items = (deps: Array<Package_Json_Dep>): Array<string> =>
|
|
83
83
|
deps.map((dep) => {
|
|
84
84
|
if (EXACT_VERSION_MATCHER.test(dep.name)) {
|
|
85
85
|
return dep.name;
|