locter 0.7.1 → 0.8.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/index.cjs +471 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +459 -1
- package/dist/index.mjs.map +1 -1
- package/dist/loader/{file-type → built-in}/index.d.ts +0 -0
- package/dist/loader/built-in/json/index.d.ts +1 -0
- package/dist/loader/built-in/json/module.d.ts +6 -0
- package/dist/loader/{file-type → built-in}/script/index.d.ts +1 -2
- package/dist/loader/built-in/script/module.d.ts +12 -0
- package/dist/loader/{file-type → built-in}/script/type.d.ts +0 -0
- package/dist/loader/{file-type → built-in}/script/utils.d.ts +0 -0
- package/dist/loader/helpers.d.ts +3 -0
- package/dist/loader/index.d.ts +2 -2
- package/dist/loader/module.d.ts +16 -2
- package/dist/loader/singleton.d.ts +2 -0
- package/dist/loader/type.d.ts +9 -0
- package/dist/locator/async.d.ts +3 -0
- package/dist/locator/type.d.ts +1 -0
- package/package.json +18 -20
- package/dist/loader/file-type/json.d.ts +0 -3
- package/dist/loader/file-type/script/async.d.ts +0 -4
- package/dist/loader/file-type/script/sync.d.ts +0 -4
package/dist/loader/module.d.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
import { LocatorInfo } from '../locator';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
2
|
+
import { Loader, Rule } from './type';
|
|
3
|
+
export declare class LoaderManager {
|
|
4
|
+
protected loaders: Record<string, Loader>;
|
|
5
|
+
protected rules: Rule[];
|
|
6
|
+
constructor();
|
|
7
|
+
register(rule: Rule): void;
|
|
8
|
+
execute(info: LocatorInfo): Promise<any>;
|
|
9
|
+
executeSync(info: LocatorInfo): any;
|
|
10
|
+
findRule(info: LocatorInfo): Rule | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve loader by id.
|
|
13
|
+
*
|
|
14
|
+
* @param id
|
|
15
|
+
*/
|
|
16
|
+
resolve(id: string | Loader): Loader;
|
|
17
|
+
}
|
package/dist/locator/async.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { LocatorInfo, LocatorOptions } from './type';
|
|
2
2
|
export declare function locateFiles(pattern: string | string[], options?: Partial<LocatorOptions>): Promise<LocatorInfo[]>;
|
|
3
|
+
export declare function locateFile(pattern: string | string[], options: Partial<LocatorOptions> & {
|
|
4
|
+
soft: false;
|
|
5
|
+
}): Promise<LocatorInfo>;
|
|
3
6
|
export declare function locateFile(pattern: string | string[], options?: Partial<LocatorOptions>): Promise<LocatorInfo | undefined>;
|
package/dist/locator/type.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "locter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "A library to locate a file by criteria and load it",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Peter Placzek",
|
|
@@ -39,35 +39,34 @@
|
|
|
39
39
|
"keywords": [
|
|
40
40
|
"file",
|
|
41
41
|
"loader",
|
|
42
|
+
"transpiling",
|
|
43
|
+
"compiler",
|
|
44
|
+
"loading",
|
|
45
|
+
"on-demand-transpiling",
|
|
42
46
|
"locator",
|
|
43
47
|
"file-extension"
|
|
44
48
|
],
|
|
45
49
|
"license": "MIT",
|
|
46
50
|
"devDependencies": {
|
|
47
|
-
"@babel/core": "^7.20.12",
|
|
48
|
-
"@babel/preset-env": "^7.20.2",
|
|
49
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
50
51
|
"@commitlint/cli": "^17.4.2",
|
|
51
|
-
"@commitlint/config-angular": "^17.4.
|
|
52
|
+
"@commitlint/config-angular": "^17.4.2",
|
|
52
53
|
"@commitlint/config-conventional": "^17.4.2",
|
|
53
54
|
"@commitlint/cz-commitlint": "^17.4.2",
|
|
54
|
-
"@rollup/plugin-babel": "^6.0.3",
|
|
55
55
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
56
|
-
"@rollup/plugin-terser": "^0.3.0",
|
|
57
56
|
"@semantic-release/changelog": "^6.0.2",
|
|
58
57
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
59
58
|
"@semantic-release/git": "^10.0.1",
|
|
60
59
|
"@semantic-release/github": "^8.0.7",
|
|
61
60
|
"@semantic-release/npm": "^9.0.1",
|
|
62
61
|
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"@types/
|
|
62
|
+
"@swc/core": "^1.3.30",
|
|
63
|
+
"@swc/jest": "^0.2.24",
|
|
64
|
+
"@tada5hi/eslint-config-typescript": "^1.1.1",
|
|
65
|
+
"@tada5hi/tsconfig": "^0.4.0",
|
|
66
|
+
"@types/glob": "^8.0.1",
|
|
67
|
+
"@types/jest": "^27.5.2",
|
|
68
68
|
"@types/node": "^18.11.18",
|
|
69
|
-
"@types/yargs": "^17.0.
|
|
70
|
-
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
69
|
+
"@types/yargs": "^17.0.20",
|
|
71
70
|
"coveralls": "^3.1.0",
|
|
72
71
|
"cross-env": "^7.0.3",
|
|
73
72
|
"eslint": "^8.32.0",
|
|
@@ -75,17 +74,16 @@
|
|
|
75
74
|
"jest": "^27.5.1",
|
|
76
75
|
"magic-string": "^0.27.0",
|
|
77
76
|
"mlly": "^1.1.0",
|
|
78
|
-
"rimraf": "^4.1.
|
|
79
|
-
"rollup": "^3.
|
|
77
|
+
"rimraf": "^4.1.2",
|
|
78
|
+
"rollup": "^3.12.0",
|
|
80
79
|
"semantic-release": "^19.0.5",
|
|
81
80
|
"sourcemap-codec": "^1.4.8",
|
|
82
|
-
"ts-jest": "^27.1.4",
|
|
83
|
-
"ts-node": "^10.9.1",
|
|
84
81
|
"typescript": "^4.9.4"
|
|
85
82
|
},
|
|
86
83
|
"dependencies": {
|
|
87
|
-
"ebec": "^0.1
|
|
88
|
-
"glob": "^8.1.0"
|
|
84
|
+
"ebec": "^0.2.1",
|
|
85
|
+
"glob": "^8.1.0",
|
|
86
|
+
"jiti": "^1.16.2"
|
|
89
87
|
},
|
|
90
88
|
"config": {
|
|
91
89
|
"commitizen": {
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { LocatorInfo } from '../../../locator';
|
|
2
|
-
import { LoaderFilterFn, ScriptFileExportItem, ScriptFileLoadOptions } from './type';
|
|
3
|
-
export declare function loadScriptFile(data: LocatorInfo | string, options?: ScriptFileLoadOptions): Promise<unknown>;
|
|
4
|
-
export declare function loadScriptFileExport(data: LocatorInfo | string, filterFn?: LoaderFilterFn): Promise<ScriptFileExportItem>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { LoaderFilterFn, ScriptFileExportItem, ScriptFileLoadOptions } from './type';
|
|
2
|
-
import { LocatorInfo } from '../../../locator';
|
|
3
|
-
export declare function loadScriptFileSync(data: LocatorInfo | string, options?: ScriptFileLoadOptions): unknown;
|
|
4
|
-
export declare function loadScriptFileExportSync(data: LocatorInfo | string, filterFn?: LoaderFilterFn): ScriptFileExportItem;
|