@ryanatkn/gro 0.117.0 → 0.119.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 +37 -19
- package/dist/build.task.d.ts +3 -0
- package/dist/build.task.js +5 -1
- package/dist/changeset.task.d.ts +2 -2
- package/dist/changeset.task.js +10 -6
- package/dist/check.task.js +1 -1
- package/dist/clean_fs.js +2 -1
- package/dist/cli.js +1 -1
- package/dist/config.js +3 -2
- package/dist/deploy.task.d.ts +0 -6
- package/dist/deploy.task.js +7 -11
- package/dist/dev.task.d.ts +2 -2
- package/dist/docs/gen.md +27 -0
- package/dist/docs/publish.md +1 -8
- package/dist/docs/task.md +7 -0
- package/dist/docs/tasks.gen.md.js +2 -3
- package/dist/docs/tasks.md +1 -0
- package/dist/esbuild_plugin_external_worker.js +1 -2
- package/dist/esbuild_plugin_svelte.js +1 -2
- package/dist/esbuild_plugin_sveltekit_shim_alias.js +1 -2
- package/dist/format_directory.d.ts +8 -2
- package/dist/format_directory.js +18 -12
- package/dist/gen.d.ts +19 -0
- package/dist/gen.js +45 -0
- package/dist/gen.task.js +19 -19
- package/dist/gen_module.d.ts +1 -14
- package/dist/gen_module.js +0 -22
- package/dist/git.d.ts +5 -0
- package/dist/git.js +15 -0
- package/dist/git.test.js +4 -1
- package/dist/gro.config.default.js +8 -11
- package/dist/gro_helpers.js +18 -17
- package/dist/gro_plugin_gen.js +1 -1
- package/dist/gro_plugin_server.d.ts +4 -1
- package/dist/gro_plugin_server.js +15 -6
- package/dist/gro_plugin_sveltekit_app.d.ts +0 -1
- package/dist/gro_plugin_sveltekit_app.js +2 -4
- package/dist/gro_plugin_sveltekit_library.d.ts +0 -2
- package/dist/gro_plugin_sveltekit_library.js +10 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -1
- package/dist/input_path.d.ts +1 -1
- package/dist/input_path.js +1 -1
- package/dist/input_path.test.js +3 -3
- package/dist/invoke.js +2 -0
- package/dist/invoke_task.d.ts +1 -1
- package/dist/invoke_task.js +10 -11
- package/dist/lint.task.js +1 -1
- package/dist/loader.js +11 -4
- package/dist/module.d.ts +1 -1
- package/dist/module.js +2 -2
- package/dist/modules.test.js +2 -2
- package/dist/package.d.ts +52 -0
- package/dist/package.js +80 -36
- package/dist/package_json.d.ts +5 -0
- package/dist/package_json.js +8 -3
- package/dist/package_meta.d.ts +1 -2
- package/dist/path_constants.d.ts +21 -0
- package/dist/path_constants.js +28 -0
- package/dist/paths.d.ts +2 -26
- package/dist/paths.js +10 -33
- package/dist/publish.task.d.ts +9 -6
- package/dist/publish.task.js +26 -14
- package/dist/register.d.ts +1 -0
- package/dist/register.js +2 -0
- package/dist/reinstall.task.d.ts +5 -0
- package/dist/reinstall.task.js +32 -0
- package/dist/release.task.js +5 -7
- package/dist/resolve_node_specifier.js +2 -1
- package/dist/run.task.js +1 -1
- package/dist/run_gen.d.ts +2 -1
- package/dist/run_gen.js +2 -2
- package/dist/run_gen.test.js +3 -2
- package/dist/run_task.js +1 -1
- package/dist/sveltekit_config.d.ts +1 -1
- package/dist/sveltekit_config.js +9 -5
- package/dist/sveltekit_config_global.d.ts +4 -0
- package/dist/sveltekit_config_global.js +5 -0
- package/dist/sveltekit_helpers.d.ts +17 -0
- package/dist/sveltekit_helpers.js +54 -0
- package/dist/sync.task.d.ts +0 -1
- package/dist/sync.task.js +5 -11
- package/dist/task.d.ts +1 -1
- package/dist/task.js +11 -7
- package/dist/task.test.js +9 -13
- package/dist/task_logging.d.ts +2 -2
- package/dist/task_logging.js +29 -15
- package/dist/task_module.d.ts +3 -3
- package/dist/task_module.js +6 -6
- package/dist/task_module.test.js +4 -7
- package/dist/typecheck.task.js +1 -1
- package/dist/upgrade.task.d.ts +4 -1
- package/dist/upgrade.task.js +30 -5
- package/package.json +23 -3
package/dist/task.test.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { test } from 'uvu';
|
|
2
2
|
import * as assert from 'uvu/assert';
|
|
3
3
|
import { is_task_path, to_task_name } from './task.js';
|
|
4
|
-
|
|
5
|
-
const test__is_task_path = suite('is_task_path');
|
|
6
|
-
test__is_task_path('basic behavior', () => {
|
|
4
|
+
test('is_task_path basic behavior', () => {
|
|
7
5
|
assert.ok(is_task_path('foo.task.ts'));
|
|
8
6
|
assert.ok(is_task_path('foo.task.js'));
|
|
9
7
|
assert.ok(!is_task_path('foo.ts'));
|
|
10
8
|
assert.ok(is_task_path('bar/baz/foo.task.ts'));
|
|
11
9
|
assert.ok(!is_task_path('bar/baz/foo.ts'));
|
|
12
10
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
assert.is(to_task_name('foo.task.ts'), 'foo');
|
|
19
|
-
assert.is(to_task_name('bar/baz/foo.task.ts'), 'bar/baz/foo');
|
|
11
|
+
test('to_task_name basic behavior', () => {
|
|
12
|
+
assert.is(to_task_name('foo.task.ts', []), 'foo');
|
|
13
|
+
assert.is(to_task_name('bar/baz/foo.task.ts', []), 'bar/baz/foo');
|
|
14
|
+
assert.is(to_task_name('a/b/c/foo.task.ts', ['a/b/c', 'a']), 'foo');
|
|
15
|
+
assert.is(to_task_name('a/b/c/foo.task.ts', ['a']), 'b/c/foo');
|
|
16
|
+
assert.is(to_task_name('a/b/c/foo.task.ts', ['a/b', 'a']), 'c/foo');
|
|
20
17
|
});
|
|
21
|
-
|
|
22
|
-
/* test__to_task_name */
|
|
18
|
+
test.run();
|
package/dist/task_logging.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type Find_Modules_Result } from './modules.js';
|
|
|
2
2
|
import { type Task_Module_Meta } from './task_module.js';
|
|
3
3
|
import { type Input_Path } from './input_path.js';
|
|
4
4
|
import { type Source_Id } from './paths.js';
|
|
5
|
-
export declare const log_tasks: (log: Logger, dir_label: string, source_ids_by_input_path: Map<Input_Path, Source_Id[]>, log_intro?: boolean) => Promise<void>;
|
|
6
|
-
export declare const log_gro_package_tasks: (input_path: Flavored<string, "Input_Path">, log: Logger) => Promise<Find_Modules_Result>;
|
|
5
|
+
export declare const log_tasks: (log: Logger, dir_label: string, source_ids_by_input_path: Map<Input_Path, Source_Id[]>, task_root_paths: string[], log_intro?: boolean) => Promise<void>;
|
|
6
|
+
export declare const log_gro_package_tasks: (input_path: Flavored<string, "Input_Path">, task_root_paths: string[], log: Logger) => Promise<Find_Modules_Result>;
|
|
7
7
|
export declare const log_error_reasons: (log: Logger, reasons: string[]) => void;
|
|
8
8
|
export declare const log_task_help: (log: Logger, meta: Task_Module_Meta) => void;
|
package/dist/task_logging.js
CHANGED
|
@@ -8,11 +8,11 @@ import { to_gro_input_path } from './input_path.js';
|
|
|
8
8
|
import { print_path_or_gro_path } from './paths.js';
|
|
9
9
|
import { is_task_path } from './task.js';
|
|
10
10
|
import { search_fs } from './search_fs.js';
|
|
11
|
-
export const log_tasks = async (log, dir_label, source_ids_by_input_path, log_intro = true) => {
|
|
11
|
+
export const log_tasks = async (log, dir_label, source_ids_by_input_path, task_root_paths, log_intro = true) => {
|
|
12
12
|
const source_ids = Array.from(source_ids_by_input_path.values()).flat();
|
|
13
13
|
if (source_ids.length) {
|
|
14
14
|
// Load all of the tasks so we can log their summary, and args for the `--help` flag.
|
|
15
|
-
const load_modules_result = await load_modules(source_ids_by_input_path, load_task_module);
|
|
15
|
+
const load_modules_result = await load_modules(source_ids_by_input_path, (id) => load_task_module(id, task_root_paths));
|
|
16
16
|
if (!load_modules_result.ok) {
|
|
17
17
|
log_error_reasons(log, load_modules_result.reasons);
|
|
18
18
|
process.exit(1);
|
|
@@ -33,13 +33,13 @@ export const log_tasks = async (log, dir_label, source_ids_by_input_path, log_in
|
|
|
33
33
|
log.info(`No tasks found in ${dir_label}.`);
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
export const log_gro_package_tasks = async (input_path, log) => {
|
|
36
|
+
export const log_gro_package_tasks = async (input_path, task_root_paths, log) => {
|
|
37
37
|
const gro_dir_input_path = to_gro_input_path(input_path);
|
|
38
38
|
const gro_dir_find_modules_result = await find_modules([gro_dir_input_path], (id) => search_fs(id, { filter: (path) => is_task_path(path) }));
|
|
39
39
|
if (gro_dir_find_modules_result.ok) {
|
|
40
40
|
const gro_path_data = gro_dir_find_modules_result.source_id_path_data_by_input_path.get(gro_dir_input_path);
|
|
41
41
|
// Log the Gro matches.
|
|
42
|
-
await log_tasks(log, print_path_or_gro_path(gro_path_data.id), gro_dir_find_modules_result.source_ids_by_input_path);
|
|
42
|
+
await log_tasks(log, print_path_or_gro_path(gro_path_data.id), gro_dir_find_modules_result.source_ids_by_input_path, task_root_paths);
|
|
43
43
|
}
|
|
44
44
|
return gro_dir_find_modules_result;
|
|
45
45
|
};
|
|
@@ -111,11 +111,9 @@ const to_args_schema_type = ({ _def }) => {
|
|
|
111
111
|
case ZodFirstPartyTypeKind.ZodUnion:
|
|
112
112
|
return 'string | string[]'; // TODO support unions of arbitrary types, or more hardcoded ones as needed
|
|
113
113
|
default: {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
else if ('innerType' in _def) {
|
|
118
|
-
return to_args_schema_type(_def.innerType);
|
|
114
|
+
const subschema = to_subschema(_def);
|
|
115
|
+
if (subschema) {
|
|
116
|
+
return to_args_schema_type(subschema);
|
|
119
117
|
}
|
|
120
118
|
else {
|
|
121
119
|
throw Error('Unknown zod type ' + t);
|
|
@@ -124,18 +122,34 @@ const to_args_schema_type = ({ _def }) => {
|
|
|
124
122
|
}
|
|
125
123
|
};
|
|
126
124
|
const to_args_schema_description = ({ _def }) => {
|
|
127
|
-
if (_def.description)
|
|
125
|
+
if (_def.description) {
|
|
128
126
|
return _def.description;
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
}
|
|
128
|
+
const subschema = to_subschema(_def);
|
|
129
|
+
if (subschema) {
|
|
130
|
+
return to_args_schema_description(subschema);
|
|
131
131
|
}
|
|
132
132
|
return '';
|
|
133
133
|
};
|
|
134
134
|
const to_args_schema_default = ({ _def }) => {
|
|
135
|
-
if (_def.defaultValue)
|
|
135
|
+
if (_def.defaultValue) {
|
|
136
136
|
return _def.defaultValue();
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
}
|
|
138
|
+
const subschema = to_subschema(_def);
|
|
139
|
+
if (subschema) {
|
|
140
|
+
return to_args_schema_default(subschema);
|
|
141
|
+
}
|
|
142
|
+
return undefined;
|
|
143
|
+
};
|
|
144
|
+
const to_subschema = (_def) => {
|
|
145
|
+
if ('type' in _def) {
|
|
146
|
+
return _def.type;
|
|
147
|
+
}
|
|
148
|
+
else if ('innerType' in _def) {
|
|
149
|
+
return _def.innerType;
|
|
150
|
+
}
|
|
151
|
+
else if ('schema' in _def) {
|
|
152
|
+
return _def.schema;
|
|
139
153
|
}
|
|
140
154
|
return undefined;
|
|
141
155
|
};
|
package/dist/task_module.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export interface Task_Module_Meta extends Module_Meta<Task_Module> {
|
|
|
8
8
|
name: string;
|
|
9
9
|
}
|
|
10
10
|
export declare const validate_task_module: (mod: Record<string, any>) => mod is Task_Module;
|
|
11
|
-
export declare const load_task_module: (id: string) => Promise<Load_Module_Result<Task_Module_Meta>>;
|
|
12
|
-
export declare const find_task_modules: (input_paths: Input_Path[],
|
|
13
|
-
export declare const load_task_modules: (input_paths: Input_Path[],
|
|
11
|
+
export declare const load_task_module: (id: string, task_root_paths: string[]) => Promise<Load_Module_Result<Task_Module_Meta>>;
|
|
12
|
+
export declare const find_task_modules: (input_paths: Input_Path[], task_root_paths: string[]) => Promise<ReturnType<typeof find_modules>>;
|
|
13
|
+
export declare const load_task_modules: (input_paths: Input_Path[], task_root_paths: string[]) => Promise<ReturnType<typeof load_modules<Task_Module, Task_Module_Meta>> | ({
|
|
14
14
|
ok: false;
|
|
15
15
|
} & Find_Modules_Failure)>;
|
package/dist/task_module.js
CHANGED
|
@@ -3,16 +3,16 @@ import { to_task_name, is_task_path, TASK_FILE_SUFFIX_TS, TASK_FILE_SUFFIX_JS, }
|
|
|
3
3
|
import { Input_Path, get_possible_source_ids } from './input_path.js';
|
|
4
4
|
import { search_fs } from './search_fs.js';
|
|
5
5
|
export const validate_task_module = (mod) => !!mod.task && typeof mod.task.run === 'function';
|
|
6
|
-
export const load_task_module = async (id) => {
|
|
6
|
+
export const load_task_module = async (id, task_root_paths) => {
|
|
7
7
|
const result = await load_module(id, validate_task_module);
|
|
8
8
|
if (!result.ok)
|
|
9
9
|
return result;
|
|
10
|
-
return { ...result, mod: { ...result.mod, name: to_task_name(id) } }; // TODO this task name needs to use task root paths or cwd
|
|
10
|
+
return { ...result, mod: { ...result.mod, name: to_task_name(id, task_root_paths) } }; // TODO this task name needs to use task root paths or cwd
|
|
11
11
|
};
|
|
12
|
-
export const find_task_modules = async (input_paths,
|
|
13
|
-
export const load_task_modules = async (input_paths,
|
|
14
|
-
const find_modules_result = await find_task_modules(input_paths,
|
|
12
|
+
export const find_task_modules = async (input_paths, task_root_paths) => find_modules(input_paths, (id) => search_fs(id, { filter: (path) => is_task_path(path) }), (input_path) => get_possible_source_ids(input_path, [TASK_FILE_SUFFIX_TS, TASK_FILE_SUFFIX_JS], task_root_paths));
|
|
13
|
+
export const load_task_modules = async (input_paths, task_root_paths) => {
|
|
14
|
+
const find_modules_result = await find_task_modules(input_paths, task_root_paths);
|
|
15
15
|
if (!find_modules_result.ok)
|
|
16
16
|
return find_modules_result;
|
|
17
|
-
return load_modules(find_modules_result.source_ids_by_input_path, load_task_module);
|
|
17
|
+
return load_modules(find_modules_result.source_ids_by_input_path, (id) => load_task_module(id, task_root_paths));
|
|
18
18
|
};
|
package/dist/task_module.test.js
CHANGED
|
@@ -21,7 +21,7 @@ const test__load_task_module = suite('load_task_module');
|
|
|
21
21
|
test__load_task_module('basic behavior', async () => {
|
|
22
22
|
const name = 'fixtures/test_task_module.task_fixture.js';
|
|
23
23
|
const id = resolve('src/' + name);
|
|
24
|
-
const result = await load_task_module(id);
|
|
24
|
+
const result = await load_task_module(id, []);
|
|
25
25
|
assert.ok(result.ok);
|
|
26
26
|
assert.is(result.mod.id, id);
|
|
27
27
|
assert.is(result.mod.id, id);
|
|
@@ -30,7 +30,7 @@ test__load_task_module('basic behavior', async () => {
|
|
|
30
30
|
});
|
|
31
31
|
test__load_task_module('invalid module', async () => {
|
|
32
32
|
const id = resolve('src/fixtures/test_invalid_task_module.js');
|
|
33
|
-
const result = await load_task_module(id);
|
|
33
|
+
const result = await load_task_module(id, []);
|
|
34
34
|
assert.ok(!result.ok);
|
|
35
35
|
if (result.type === 'invalid') {
|
|
36
36
|
assert.is(result.id, id);
|
|
@@ -43,7 +43,7 @@ test__load_task_module('invalid module', async () => {
|
|
|
43
43
|
});
|
|
44
44
|
test__load_task_module('failing module', async () => {
|
|
45
45
|
const id = resolve('src/fixtures/test_failing_task_module.js');
|
|
46
|
-
const result = await load_task_module(id);
|
|
46
|
+
const result = await load_task_module(id, []);
|
|
47
47
|
assert.ok(!result.ok);
|
|
48
48
|
if (result.type === 'importFailed') {
|
|
49
49
|
assert.is(result.id, id);
|
|
@@ -58,10 +58,7 @@ test__load_task_module.run();
|
|
|
58
58
|
/* test__load_task_modules */
|
|
59
59
|
const test__load_task_modules = suite('load_task_modules');
|
|
60
60
|
test__load_task_modules('basic behavior', async () => {
|
|
61
|
-
const result = await load_task_modules([
|
|
62
|
-
resolve('src/lib/test'),
|
|
63
|
-
resolve('src/lib/test.task.ts'),
|
|
64
|
-
]);
|
|
61
|
+
const result = await load_task_modules([resolve('src/lib/test'), resolve('src/lib/test.task.ts')], [resolve('src/lib')]);
|
|
65
62
|
assert.ok(result.ok);
|
|
66
63
|
assert.is(result.modules.length, 1);
|
|
67
64
|
assert.is(result.modules[0].mod, actual_test_task_module);
|
package/dist/typecheck.task.js
CHANGED
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { Task_Error } from './task.js';
|
|
4
4
|
import { print_command_args, serialize_args, to_forwarded_args } from './args.js';
|
|
5
5
|
import { find_cli, spawn_cli } from './cli.js';
|
|
6
|
-
import { sveltekit_sync } from './
|
|
6
|
+
import { sveltekit_sync } from './sveltekit_helpers.js';
|
|
7
7
|
export const Args = z.object({}).strict();
|
|
8
8
|
export const task = {
|
|
9
9
|
summary: 'run tsc on the project without emitting any files',
|
package/dist/upgrade.task.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type
|
|
2
|
+
import { type Task } from './task.js';
|
|
3
3
|
export declare const Args: z.ZodObject<{
|
|
4
4
|
_: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
5
|
+
only: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>, string[], string | string[] | undefined>;
|
|
5
6
|
origin: z.ZodDefault<z.ZodBranded<z.ZodString, "Git_Origin">>;
|
|
6
7
|
force: z.ZodDefault<z.ZodBoolean>;
|
|
7
8
|
pull: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -14,6 +15,7 @@ export declare const Args: z.ZodObject<{
|
|
|
14
15
|
dry: boolean;
|
|
15
16
|
force: boolean;
|
|
16
17
|
'no-pull': boolean;
|
|
18
|
+
only: string[];
|
|
17
19
|
}, {
|
|
18
20
|
_?: string[] | undefined;
|
|
19
21
|
origin?: string | undefined;
|
|
@@ -21,6 +23,7 @@ export declare const Args: z.ZodObject<{
|
|
|
21
23
|
dry?: boolean | undefined;
|
|
22
24
|
force?: boolean | undefined;
|
|
23
25
|
'no-pull'?: boolean | undefined;
|
|
26
|
+
only?: string | string[] | undefined;
|
|
24
27
|
}>;
|
|
25
28
|
export type Args = z.infer<typeof Args>;
|
|
26
29
|
export declare const task: Task<Args>;
|
package/dist/upgrade.task.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { spawn } from '@ryanatkn/belt/process.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { Task_Error } from './task.js';
|
|
3
4
|
import { load_package_json } from './package_json.js';
|
|
4
5
|
import { Git_Origin, git_pull } from './git.js';
|
|
6
|
+
import { spawn_cli } from './cli.js';
|
|
5
7
|
export const Args = z
|
|
6
8
|
.object({
|
|
7
9
|
_: z.array(z.string(), { description: 'names of deps to exclude from the upgrade' }).default([]),
|
|
10
|
+
only: z
|
|
11
|
+
.union([z.string(), z.array(z.string())], {
|
|
12
|
+
description: 'names of deps to include in the upgrade',
|
|
13
|
+
})
|
|
14
|
+
.default([])
|
|
15
|
+
.transform((v) => (Array.isArray(v) ? v : [v])),
|
|
8
16
|
origin: Git_Origin.describe('git origin to deploy to').default('origin'),
|
|
9
17
|
force: z.boolean({ description: 'if true, print out the planned upgrades' }).default(false),
|
|
10
18
|
pull: z.boolean({ description: 'dual of no-pull' }).default(true),
|
|
@@ -15,14 +23,23 @@ export const Args = z
|
|
|
15
23
|
export const task = {
|
|
16
24
|
summary: 'upgrade deps',
|
|
17
25
|
Args,
|
|
18
|
-
run: async ({ args, log
|
|
19
|
-
const { _, origin, force, pull, dry } = args;
|
|
26
|
+
run: async ({ args, log }) => {
|
|
27
|
+
const { _, only, origin, force, pull, dry } = args;
|
|
28
|
+
if (_.length && only.length) {
|
|
29
|
+
throw new Task_Error('Cannot call `gro upgrade` with both rest args and --only.');
|
|
30
|
+
}
|
|
20
31
|
// TODO maybe a different task that pulls and does other things, like `gro ready`
|
|
21
32
|
if (pull) {
|
|
22
33
|
await git_pull(origin);
|
|
23
34
|
}
|
|
24
35
|
const package_json = await load_package_json();
|
|
25
|
-
const
|
|
36
|
+
const all_deps = to_deps(package_json);
|
|
37
|
+
const deps = only.length
|
|
38
|
+
? all_deps.filter((d) => only.includes(d.key))
|
|
39
|
+
: all_deps.filter((d) => !_.includes(d.key));
|
|
40
|
+
if (only.length && only.length !== deps.length) {
|
|
41
|
+
throw new Task_Error(`Some deps to upgrade were not found: ${only.filter((o) => !deps.find((d) => d.key === o)).join(', ')}`);
|
|
42
|
+
}
|
|
26
43
|
const upgrade_items = to_upgrade_items(deps);
|
|
27
44
|
log.info(`upgrading:`, upgrade_items.join(' '));
|
|
28
45
|
const install_args = ['install'].concat(upgrade_items);
|
|
@@ -34,7 +51,8 @@ export const task = {
|
|
|
34
51
|
install_args.push('--force');
|
|
35
52
|
}
|
|
36
53
|
await spawn('npm', install_args);
|
|
37
|
-
|
|
54
|
+
// Sync in a new process to pick up any changes after installing, avoiding some errors.
|
|
55
|
+
await spawn_cli('gro', ['sync']);
|
|
38
56
|
},
|
|
39
57
|
};
|
|
40
58
|
const to_deps = (package_json) => {
|
|
@@ -46,4 +64,11 @@ const to_deps = (package_json) => {
|
|
|
46
64
|
: [];
|
|
47
65
|
return prod_deps.concat(dev_deps);
|
|
48
66
|
};
|
|
49
|
-
|
|
67
|
+
// TODO hacky and limited
|
|
68
|
+
// TODO probably want to pass through exact deps as well, e.g. @foo/bar@1
|
|
69
|
+
const to_upgrade_items = (deps) => deps.map((dep) => {
|
|
70
|
+
if (dep.key.endsWith('@next') || dep.key.endsWith('@latest')) {
|
|
71
|
+
return dep.key;
|
|
72
|
+
}
|
|
73
|
+
return dep.key + (dep.value.includes('-next.') ? '@next' : '@latest');
|
|
74
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryanatkn/gro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.119.0",
|
|
4
4
|
"description": "task runner and toolkit extending SvelteKit",
|
|
5
5
|
"motto": "generate, run, optimize",
|
|
6
6
|
"icon": "🌰",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@ryanatkn/fuz": "^0.102.1",
|
|
70
70
|
"@ryanatkn/moss": "^0.4.0",
|
|
71
71
|
"@sveltejs/adapter-static": "^3.0.2",
|
|
72
|
-
"@sveltejs/kit": "^2.5.
|
|
72
|
+
"@sveltejs/kit": "^2.5.16",
|
|
73
73
|
"@sveltejs/package": "^2.3.2",
|
|
74
74
|
"@sveltejs/vite-plugin-svelte": "^3.1.1",
|
|
75
75
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@typescript-eslint/parser": "^7.13.0",
|
|
79
79
|
"esbuild": "^0.20.2",
|
|
80
80
|
"eslint": "^8.57.0",
|
|
81
|
-
"eslint-plugin-svelte": "^2.39.
|
|
81
|
+
"eslint-plugin-svelte": "^2.39.4",
|
|
82
82
|
"svelte": "^5.0.0-next.155",
|
|
83
83
|
"svelte-check": "^3.8.0",
|
|
84
84
|
"typescript": "^5.4.5",
|
|
@@ -306,6 +306,10 @@
|
|
|
306
306
|
"default": "./dist/package.js",
|
|
307
307
|
"types": "./dist/package.d.ts"
|
|
308
308
|
},
|
|
309
|
+
"./path_constants.js": {
|
|
310
|
+
"default": "./dist/path_constants.js",
|
|
311
|
+
"types": "./dist/path_constants.d.ts"
|
|
312
|
+
},
|
|
309
313
|
"./path.js": {
|
|
310
314
|
"default": "./dist/path.js",
|
|
311
315
|
"types": "./dist/path.d.ts"
|
|
@@ -322,6 +326,14 @@
|
|
|
322
326
|
"default": "./dist/publish.task.js",
|
|
323
327
|
"types": "./dist/publish.task.d.ts"
|
|
324
328
|
},
|
|
329
|
+
"./register.js": {
|
|
330
|
+
"default": "./dist/register.js",
|
|
331
|
+
"types": "./dist/register.d.ts"
|
|
332
|
+
},
|
|
333
|
+
"./reinstall.task.js": {
|
|
334
|
+
"default": "./dist/reinstall.task.js",
|
|
335
|
+
"types": "./dist/reinstall.task.d.ts"
|
|
336
|
+
},
|
|
325
337
|
"./release.task.js": {
|
|
326
338
|
"default": "./dist/release.task.js",
|
|
327
339
|
"types": "./dist/release.task.d.ts"
|
|
@@ -358,10 +370,18 @@
|
|
|
358
370
|
"default": "./dist/svelte_helpers.js",
|
|
359
371
|
"types": "./dist/svelte_helpers.d.ts"
|
|
360
372
|
},
|
|
373
|
+
"./sveltekit_config_global.js": {
|
|
374
|
+
"default": "./dist/sveltekit_config_global.js",
|
|
375
|
+
"types": "./dist/sveltekit_config_global.d.ts"
|
|
376
|
+
},
|
|
361
377
|
"./sveltekit_config.js": {
|
|
362
378
|
"default": "./dist/sveltekit_config.js",
|
|
363
379
|
"types": "./dist/sveltekit_config.d.ts"
|
|
364
380
|
},
|
|
381
|
+
"./sveltekit_helpers.js": {
|
|
382
|
+
"default": "./dist/sveltekit_helpers.js",
|
|
383
|
+
"types": "./dist/sveltekit_helpers.d.ts"
|
|
384
|
+
},
|
|
365
385
|
"./sveltekit_shim_app_environment.js": {
|
|
366
386
|
"default": "./dist/sveltekit_shim_app_environment.js",
|
|
367
387
|
"types": "./dist/sveltekit_shim_app_environment.d.ts"
|