@ryanatkn/gro 0.120.1 → 0.121.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/config.js +1 -1
- package/dist/config.test.js +50 -46
- package/dist/docs/README.gen.md.js +1 -1
- package/dist/docs/tasks.gen.md.js +1 -1
- package/dist/gen.js +2 -2
- package/dist/input_path.d.ts +2 -2
- package/dist/input_path.js +3 -3
- package/dist/input_path.test.js +1 -1
- package/dist/invoke_task.js +1 -1
- package/dist/package.js +2 -2
- package/dist/package_json.js +1 -1
- package/dist/resolve.task.js +1 -1
- package/dist/search_fs.d.ts +2 -2
- package/dist/search_fs.js +1 -1
- package/dist/search_fs.test.js +2 -2
- package/dist/task.d.ts +1 -1
- package/dist/task.js +3 -3
- package/dist/task.test.js +1 -1
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -20,7 +20,7 @@ export const create_empty_config = () => ({
|
|
|
20
20
|
* Customize via `search_filters` in the `Gro_Config`.
|
|
21
21
|
* See the test cases for the exact behavior.
|
|
22
22
|
*/
|
|
23
|
-
export const DEFAULT_SEARCH_EXCLUDER = new RegExp(`(
|
|
23
|
+
export const DEFAULT_SEARCH_EXCLUDER = new RegExp(`(${['\\.[^/]+', NODE_MODULES_DIRNAME, SVELTEKIT_BUILD_DIRNAME, `(?<!(^|/)gro/)${SVELTEKIT_DIST_DIRNAME}`, SERVER_DIST_PATH].map((p) => '(^|/)' + p).join('|')})($|/)`, 'u');
|
|
24
24
|
const default_map_package_json = async (package_json) => {
|
|
25
25
|
if (package_json.exports) {
|
|
26
26
|
package_json.exports = Object.fromEntries(Object.entries(package_json.exports).filter(([k]) => !DEFAULT_EXPORTS_EXCLUDER.test(k)));
|
package/dist/config.test.js
CHANGED
|
@@ -6,52 +6,56 @@ test('load_config', async () => {
|
|
|
6
6
|
assert.ok(config);
|
|
7
7
|
});
|
|
8
8
|
test('DEFAULT_SEARCH_EXCLUDER', () => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(`a/${
|
|
13
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(`a/${
|
|
14
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
15
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
16
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
17
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(`/a/${
|
|
18
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
19
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
20
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
21
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
22
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
23
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
24
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
25
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
26
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
27
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
28
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
29
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test(
|
|
9
|
+
const assert_includes = (path, exclude) => {
|
|
10
|
+
const m = `should ${exclude ? 'exclude' : 'include '}: ${path}`;
|
|
11
|
+
const b = (v) => (exclude ? !v : v);
|
|
12
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`a/${path}/c`)), m);
|
|
13
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`a/${path}/c/d.js`)), m);
|
|
14
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`a/${path}/c/d.e.js`)), m);
|
|
15
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`a/${path}/`)), m);
|
|
16
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`a/${path}`)), m);
|
|
17
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`/a/${path}/c`)), m);
|
|
18
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`/a/${path}/c/d.js`)), m);
|
|
19
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`/a/${path}/c/d.e.js`)), m);
|
|
20
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`/a/${path}/`)), m);
|
|
21
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`/a/${path}`)), m);
|
|
22
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`/${path}/a`)), m);
|
|
23
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`/${path}/a/b.js`)), m);
|
|
24
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`/${path}/a/b.e.js`)), m);
|
|
25
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`/${path}/`)), m);
|
|
26
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`/${path}`)), m);
|
|
27
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`./${path}/a`)), m);
|
|
28
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`./${path}/a/b.js`)), m);
|
|
29
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`./${path}/a/b.c.js`)), m);
|
|
30
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`./${path}/`)), m);
|
|
31
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`./${path}`)), m);
|
|
32
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`${path}/a`)), m);
|
|
33
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`${path}/a/b.js`)), m);
|
|
34
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`${path}/a/b.c.js`)), m);
|
|
35
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(`${path}/`)), m);
|
|
36
|
+
assert.ok(b(DEFAULT_SEARCH_EXCLUDER.test(path)), m);
|
|
30
37
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// But not `gro/build/` and others because they're not usecases:
|
|
54
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test('/home/gro/build/a.task.js'));
|
|
55
|
-
assert.ok(DEFAULT_SEARCH_EXCLUDER.test('/home/gro/node_modules/a.task.js'));
|
|
38
|
+
assert_includes('node_modules', false);
|
|
39
|
+
assert_includes('dist', false);
|
|
40
|
+
assert_includes('build', false);
|
|
41
|
+
assert_includes('.git', false);
|
|
42
|
+
assert_includes('.gro', false);
|
|
43
|
+
assert_includes('.svelte-kit', false);
|
|
44
|
+
assert_includes('a', true);
|
|
45
|
+
assert_includes('nodemodules', true);
|
|
46
|
+
// Special exception for `gro/dist/`, but not `gro/build/` etc because they're not usecases.
|
|
47
|
+
assert_includes('gro/build', false);
|
|
48
|
+
assert_includes('gro/buildE', true);
|
|
49
|
+
assert_includes('groE/build', false);
|
|
50
|
+
assert_includes('gro/dist', true);
|
|
51
|
+
assert_includes('gro/distE', true);
|
|
52
|
+
assert_includes('groE/dist', false);
|
|
53
|
+
assert_includes('Egro/dist', false);
|
|
54
|
+
assert_includes('Ebuild', true);
|
|
55
|
+
assert_includes('buildE', true);
|
|
56
|
+
assert_includes('grobuild', true);
|
|
57
|
+
assert_includes('distE', true);
|
|
58
|
+
assert_includes('Edist', true);
|
|
59
|
+
assert_includes('grodist', true);
|
|
56
60
|
});
|
|
57
61
|
test.run();
|
|
@@ -22,7 +22,7 @@ export const gen = async ({ origin_id }) => {
|
|
|
22
22
|
const output_file_name = to_output_file_name(origin_base);
|
|
23
23
|
// TODO this is GitHub-specific
|
|
24
24
|
const root_link = `[${root_path}](/../..)`;
|
|
25
|
-
const doc_files =
|
|
25
|
+
const doc_files = search_fs(origin_dir);
|
|
26
26
|
const doc_paths = [];
|
|
27
27
|
for (const { path } of doc_files) {
|
|
28
28
|
if (path === output_file_name || !path.endsWith('.md')) {
|
|
@@ -15,7 +15,7 @@ import { find_tasks, load_tasks, Task_Error } from '../task.js';
|
|
|
15
15
|
// TODO needs some cleanup and better APIs - paths are confusing and verbose!
|
|
16
16
|
// TODO add backlinks to every document that links to this one
|
|
17
17
|
export const gen = async ({ origin_id, log, config }) => {
|
|
18
|
-
const found =
|
|
18
|
+
const found = find_tasks(['.'], [paths.lib], config);
|
|
19
19
|
if (!found.ok) {
|
|
20
20
|
log_error_reasons(log, found.reasons);
|
|
21
21
|
throw new Task_Error(`Failed to generate task docs: ${found.type}`);
|
package/dist/gen.js
CHANGED
|
@@ -136,7 +136,7 @@ export const find_genfiles = async (input_paths, root_dirs, config, timings) =>
|
|
|
136
136
|
const extensions = [GEN_FILE_PATTERN];
|
|
137
137
|
// Check which extension variation works - if it's a directory, prefer others first!
|
|
138
138
|
const timing_to_resolve_input_paths = timings?.start('resolve input paths');
|
|
139
|
-
const { resolved_input_paths, resolved_input_paths_by_input_path, unmapped_input_paths } =
|
|
139
|
+
const { resolved_input_paths, resolved_input_paths_by_input_path, unmapped_input_paths } = resolve_input_paths(input_paths, root_dirs, extensions);
|
|
140
140
|
timing_to_resolve_input_paths?.();
|
|
141
141
|
// Error if any input path could not be mapped.
|
|
142
142
|
if (unmapped_input_paths.length) {
|
|
@@ -151,7 +151,7 @@ export const find_genfiles = async (input_paths, root_dirs, config, timings) =>
|
|
|
151
151
|
}
|
|
152
152
|
// Find all of the files for any directories.
|
|
153
153
|
const timing_to_search_fs = timings?.start('find files');
|
|
154
|
-
const { resolved_input_files, resolved_input_files_by_input_path, resolved_input_files_by_root_dir, input_directories_with_no_files, } =
|
|
154
|
+
const { resolved_input_files, resolved_input_files_by_input_path, resolved_input_files_by_root_dir, input_directories_with_no_files, } = resolve_input_files(resolved_input_paths, (id, options) => search_fs(id, {
|
|
155
155
|
...options,
|
|
156
156
|
filter: config.search_filters,
|
|
157
157
|
file_filter: (p) => extensions.some((e) => p.includes(e)),
|
package/dist/input_path.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface Resolved_Input_Paths {
|
|
|
51
51
|
* and stopping at the first existing file or falling back to the first existing directory.
|
|
52
52
|
* If none is found for an input path, it's added to `unmapped_input_paths`.
|
|
53
53
|
*/
|
|
54
|
-
export declare const resolve_input_paths: (input_paths: Input_Path[], root_dirs: Path_Id[], extensions: string[]) =>
|
|
54
|
+
export declare const resolve_input_paths: (input_paths: Input_Path[], root_dirs: Path_Id[], extensions: string[]) => Resolved_Input_Paths;
|
|
55
55
|
export interface Resolved_Input_Files {
|
|
56
56
|
resolved_input_files: Resolved_Input_File[];
|
|
57
57
|
resolved_input_files_by_input_path: Map<Input_Path, Resolved_Input_File[]>;
|
|
@@ -62,4 +62,4 @@ export interface Resolved_Input_Files {
|
|
|
62
62
|
* Finds all of the matching files for the given input paths.
|
|
63
63
|
* De-dupes source ids.
|
|
64
64
|
*/
|
|
65
|
-
export declare const resolve_input_files: (resolved_input_paths: Resolved_Input_Path[], custom_search_fs?: (dir: string, options?: import("./search_fs.js").Search_Fs_Options) =>
|
|
65
|
+
export declare const resolve_input_files: (resolved_input_paths: Resolved_Input_Path[], custom_search_fs?: (dir: string, options?: import("./search_fs.js").Search_Fs_Options) => import("./path.js").Resolved_Path[]) => Resolved_Input_Files;
|
package/dist/input_path.js
CHANGED
|
@@ -75,7 +75,7 @@ export const get_possible_paths = (input_path, root_dirs, extensions) => {
|
|
|
75
75
|
* and stopping at the first existing file or falling back to the first existing directory.
|
|
76
76
|
* If none is found for an input path, it's added to `unmapped_input_paths`.
|
|
77
77
|
*/
|
|
78
|
-
export const resolve_input_paths =
|
|
78
|
+
export const resolve_input_paths = (input_paths, root_dirs, extensions) => {
|
|
79
79
|
const resolved_input_paths = [];
|
|
80
80
|
const possible_paths_by_input_path = new Map();
|
|
81
81
|
const unmapped_input_paths = [];
|
|
@@ -139,7 +139,7 @@ export const resolve_input_paths = async (input_paths, root_dirs, extensions) =>
|
|
|
139
139
|
* Finds all of the matching files for the given input paths.
|
|
140
140
|
* De-dupes source ids.
|
|
141
141
|
*/
|
|
142
|
-
export const resolve_input_files =
|
|
142
|
+
export const resolve_input_files = (resolved_input_paths, custom_search_fs = search_fs) => {
|
|
143
143
|
const resolved_input_files = [];
|
|
144
144
|
const resolved_input_files_by_input_path = new Map();
|
|
145
145
|
const input_directories_with_no_files = [];
|
|
@@ -148,7 +148,7 @@ export const resolve_input_files = async (resolved_input_paths, custom_search_fs
|
|
|
148
148
|
for (const resolved_input_path of resolved_input_paths) {
|
|
149
149
|
const { input_path, id, is_directory } = resolved_input_path;
|
|
150
150
|
if (is_directory) {
|
|
151
|
-
const files =
|
|
151
|
+
const files = custom_search_fs(id, { include_directories: true });
|
|
152
152
|
if (files.length) {
|
|
153
153
|
const path_ids = [];
|
|
154
154
|
let has_files = false;
|
package/dist/input_path.test.js
CHANGED
|
@@ -148,7 +148,7 @@ test('resolve_input_files', async () => {
|
|
|
148
148
|
input_path: 'fake/nomatches',
|
|
149
149
|
root_dir: process.cwd(),
|
|
150
150
|
};
|
|
151
|
-
const result =
|
|
151
|
+
const result = resolve_input_files([a, b, c, d, e, f], (id) => test_files[id]);
|
|
152
152
|
const resolved_input_files = [
|
|
153
153
|
{ id: a.id, input_path: a.input_path, resolved_input_path: a },
|
|
154
154
|
{ id: b.id, input_path: b.input_path, resolved_input_path: b },
|
package/dist/invoke_task.js
CHANGED
|
@@ -45,7 +45,7 @@ export const invoke_task = async (task_name, args, config, timings = new Timings
|
|
|
45
45
|
const { task_root_dirs } = config;
|
|
46
46
|
// Find the task or directory specified by the `input_path`.
|
|
47
47
|
// Fall back to searching the Gro directory as well.
|
|
48
|
-
const found =
|
|
48
|
+
const found = find_tasks([input_path], task_root_dirs, config);
|
|
49
49
|
if (!found.ok) {
|
|
50
50
|
log_error_reasons(log, found.reasons);
|
|
51
51
|
process.exit(1);
|
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.121.0',
|
|
5
5
|
description: 'task runner and toolkit extending SvelteKit',
|
|
6
6
|
motto: 'generate, run, optimize',
|
|
7
7
|
icon: '🌰',
|
|
@@ -256,7 +256,7 @@ export const package_json = {
|
|
|
256
256
|
};
|
|
257
257
|
export const src_json = {
|
|
258
258
|
name: '@ryanatkn/gro',
|
|
259
|
-
version: '0.
|
|
259
|
+
version: '0.121.0',
|
|
260
260
|
modules: {
|
|
261
261
|
'.': {
|
|
262
262
|
path: 'index.ts',
|
package/dist/package_json.js
CHANGED
|
@@ -109,7 +109,7 @@ export const load_package_json = async (dir = IS_THIS_GRO ? gro_paths.root : pat
|
|
|
109
109
|
return package_json;
|
|
110
110
|
};
|
|
111
111
|
export const sync_package_json = async (map_package_json, log, check = false, dir = paths.root, exports_dir = paths.lib) => {
|
|
112
|
-
const exported_files =
|
|
112
|
+
const exported_files = search_fs(exports_dir);
|
|
113
113
|
const exported_paths = exported_files.map((f) => f.path);
|
|
114
114
|
const updated = await update_package_json(dir, async (package_json) => {
|
|
115
115
|
if ((await has_sveltekit_library(package_json)).ok) {
|
package/dist/resolve.task.js
CHANGED
|
@@ -16,7 +16,7 @@ export const task = {
|
|
|
16
16
|
log.info('input paths:', input_paths);
|
|
17
17
|
const { task_root_dirs } = config;
|
|
18
18
|
log.info('task root paths:', task_root_dirs);
|
|
19
|
-
const { resolved_input_paths, possible_paths_by_input_path, unmapped_input_paths } =
|
|
19
|
+
const { resolved_input_paths, possible_paths_by_input_path, unmapped_input_paths } = resolve_input_paths(input_paths, task_root_dirs, TASK_FILE_SUFFIXES);
|
|
20
20
|
log.info('resolved_input_paths:', resolved_input_paths);
|
|
21
21
|
log.info('possible_paths_by_input_path:', possible_paths_by_input_path);
|
|
22
22
|
log.info('unmapped_input_paths:', unmapped_input_paths);
|
package/dist/search_fs.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface Search_Fs_Options {
|
|
|
7
7
|
/**
|
|
8
8
|
* An array of file suffixes to include.
|
|
9
9
|
*/
|
|
10
|
-
file_filter?: File_Filter | File_Filter[];
|
|
10
|
+
file_filter?: File_Filter | File_Filter[] | null;
|
|
11
11
|
/**
|
|
12
12
|
* Pass `null` or `false` to speed things up at the cost of volatile ordering.
|
|
13
13
|
*/
|
|
@@ -21,4 +21,4 @@ export interface Search_Fs_Options {
|
|
|
21
21
|
*/
|
|
22
22
|
cwd?: string | null;
|
|
23
23
|
}
|
|
24
|
-
export declare const search_fs: (dir: string, options?: Search_Fs_Options) =>
|
|
24
|
+
export declare const search_fs: (dir: string, options?: Search_Fs_Options) => Resolved_Path[];
|
package/dist/search_fs.js
CHANGED
|
@@ -3,7 +3,7 @@ import { to_array } from '@ryanatkn/belt/array.js';
|
|
|
3
3
|
import { ensure_end } from '@ryanatkn/belt/string.js';
|
|
4
4
|
import { isAbsolute, join } from 'node:path';
|
|
5
5
|
import { existsSync, readdirSync } from 'node:fs';
|
|
6
|
-
export const search_fs =
|
|
6
|
+
export const search_fs = (dir, options = EMPTY_OBJECT) => {
|
|
7
7
|
const { filter, file_filter, sort = default_sort, include_directories = false, cwd = process.cwd(), } = options;
|
|
8
8
|
const final_dir = ensure_end(cwd && !isAbsolute(dir) ? join(cwd, dir) : dir, '/');
|
|
9
9
|
const filters = !filter || (Array.isArray(filter) && !filter.length) ? undefined : to_array(filter);
|
package/dist/search_fs.test.js
CHANGED
|
@@ -2,10 +2,10 @@ import { test } from 'uvu';
|
|
|
2
2
|
import * as assert from 'uvu/assert';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
4
|
import { search_fs } from './search_fs.js';
|
|
5
|
-
test('search_fs basic behavior',
|
|
5
|
+
test('search_fs basic behavior', () => {
|
|
6
6
|
const ignored_path = 'test1.foo.ts';
|
|
7
7
|
let has_ignored_path = false;
|
|
8
|
-
const result =
|
|
8
|
+
const result = search_fs('./src/fixtures', {
|
|
9
9
|
filter: (path) => {
|
|
10
10
|
if (!has_ignored_path)
|
|
11
11
|
has_ignored_path = path.endsWith(ignored_path);
|
package/dist/task.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export type Find_Modules_Failure = {
|
|
|
74
74
|
/**
|
|
75
75
|
* Finds modules from input paths. (see `src/lib/input_path.ts` for more)
|
|
76
76
|
*/
|
|
77
|
-
export declare const find_tasks: (input_paths: Input_Path[], task_root_dirs: Path_Id[], config: Gro_Config, timings?: any) =>
|
|
77
|
+
export declare const find_tasks: (input_paths: Input_Path[], task_root_dirs: Path_Id[], config: Gro_Config, timings?: any) => Find_Tasks_Result;
|
|
78
78
|
export interface Loaded_Tasks {
|
|
79
79
|
modules: Task_Module_Meta[];
|
|
80
80
|
found_tasks: Found_Tasks;
|
package/dist/task.js
CHANGED
|
@@ -27,10 +27,10 @@ export class Task_Error extends Error {
|
|
|
27
27
|
/**
|
|
28
28
|
* Finds modules from input paths. (see `src/lib/input_path.ts` for more)
|
|
29
29
|
*/
|
|
30
|
-
export const find_tasks =
|
|
30
|
+
export const find_tasks = (input_paths, task_root_dirs, config, timings) => {
|
|
31
31
|
// Check which extension variation works - if it's a directory, prefer others first!
|
|
32
32
|
const timing_to_resolve_input_paths = timings?.start('resolve input paths');
|
|
33
|
-
const { resolved_input_paths, resolved_input_paths_by_input_path, unmapped_input_paths } =
|
|
33
|
+
const { resolved_input_paths, resolved_input_paths_by_input_path, unmapped_input_paths } = resolve_input_paths(input_paths, task_root_dirs, TASK_FILE_SUFFIXES);
|
|
34
34
|
timing_to_resolve_input_paths?.();
|
|
35
35
|
// Error if any input path could not be mapped.
|
|
36
36
|
if (unmapped_input_paths.length) {
|
|
@@ -47,7 +47,7 @@ export const find_tasks = async (input_paths, task_root_dirs, config, timings) =
|
|
|
47
47
|
}
|
|
48
48
|
// Find all of the files for any directories.
|
|
49
49
|
const timing_to_resolve_input_files = timings?.start('resolve input files');
|
|
50
|
-
const { resolved_input_files, resolved_input_files_by_input_path, resolved_input_files_by_root_dir, input_directories_with_no_files, } =
|
|
50
|
+
const { resolved_input_files, resolved_input_files_by_input_path, resolved_input_files_by_root_dir, input_directories_with_no_files, } = resolve_input_files(resolved_input_paths, (id, options) => search_fs(id, {
|
|
51
51
|
...options,
|
|
52
52
|
filter: config.search_filters,
|
|
53
53
|
file_filter: (p) => TASK_FILE_SUFFIXES.some((s) => p.endsWith(s)),
|
package/dist/task.test.js
CHANGED
|
@@ -28,7 +28,7 @@ test('validate_task_module basic behavior', () => {
|
|
|
28
28
|
assert.ok(!validate_task_module({ task: { run: {} } }));
|
|
29
29
|
});
|
|
30
30
|
test('load_tasks basic behavior', async () => {
|
|
31
|
-
const found =
|
|
31
|
+
const found = find_tasks([resolve('src/lib/test'), resolve('src/lib/test.task.ts')], [resolve('src/lib')], create_empty_config());
|
|
32
32
|
assert.ok(found.ok);
|
|
33
33
|
const result = await load_tasks(found.value);
|
|
34
34
|
assert.ok(result.ok);
|