load-populate-files 0.0.1 → 0.0.2
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.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/lib/loader.d.ts +1 -1
- package/dist/lib/loader.js +6 -4
- package/dist/lib/normalize.js +6 -6
- package/dist/lib/types.js +2 -2
- package/package.json +16 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PopulationResponse } from 'populate-files';
|
|
1
|
+
import { type PopulationResponse } from 'populate-files';
|
|
2
2
|
import type { RawOptions, RawParams } from './lib/types.js';
|
|
3
3
|
export type { FileContent, PopulateFileParams } from 'populate-files';
|
|
4
4
|
export declare const loadAndPopulateFiles: (params: RawParams, options?: RawOptions) => Promise<PopulationResponse[]>;
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { populateFiles } from
|
|
2
|
-
import { loadFile } from
|
|
3
|
-
import { normalizeParams } from
|
|
4
|
-
export const loadAndPopulateFiles = async (params, options)
|
|
1
|
+
import { populateFiles } from "populate-files";
|
|
2
|
+
import { loadFile } from "./lib/loader.js";
|
|
3
|
+
import { normalizeParams } from "./lib/normalize.js";
|
|
4
|
+
export const loadAndPopulateFiles = async (params, options)=>{
|
|
5
5
|
const normalized = await normalizeParams(params, options);
|
|
6
6
|
const files = await loadFile(normalized.filePath);
|
|
7
7
|
return populateFiles(files, normalized.options);
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
package/dist/lib/loader.d.ts
CHANGED
package/dist/lib/loader.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { defaultImport } from
|
|
2
|
-
export const loadFile = async (filePath)
|
|
1
|
+
import { defaultImport } from "default-import";
|
|
2
|
+
export const loadFile = async (filePath)=>{
|
|
3
3
|
const mod = await import(filePath);
|
|
4
4
|
const params = defaultImport(mod);
|
|
5
|
-
return
|
|
5
|
+
return [
|
|
6
|
+
params
|
|
7
|
+
].flat();
|
|
6
8
|
};
|
|
7
|
-
//# sourceMappingURL=loader.js.map
|
|
9
|
+
//# sourceMappingURL=loader.js.map
|
package/dist/lib/normalize.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { resolve } from
|
|
2
|
-
import { parseCwd } from
|
|
3
|
-
export const normalizeParams = async (params, options = {})
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { parseCwd } from "npm-parse-cwd";
|
|
3
|
+
export const normalizeParams = async (params, options = {})=>{
|
|
4
4
|
const cwd = await parseCwd(options.cwd);
|
|
5
5
|
return {
|
|
6
6
|
filePath: resolve(cwd, params.filePath),
|
|
7
7
|
options: {
|
|
8
8
|
cwd,
|
|
9
9
|
check: options.check,
|
|
10
|
-
dryRun: options.dryRun
|
|
11
|
-
}
|
|
10
|
+
dryRun: options.dryRun
|
|
11
|
+
}
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=normalize.js.map
|
|
14
|
+
//# sourceMappingURL=normalize.js.map
|
package/dist/lib/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=types.js.map
|
|
1
|
+
export { };
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "load-populate-files",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Load and dynamically populate file content",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"author": "
|
|
9
|
+
"author": "JacobLey",
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"repository": "
|
|
12
|
-
"homepage": "https://github.com/JacobLey/
|
|
11
|
+
"repository": "JacobLey/leyman",
|
|
12
|
+
"homepage": "https://github.com/JacobLey/leyman/tree/main/apps/populate-files/load-populate-files/nx-tsc#readme",
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/JacobLey/leyman/issues"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"content",
|
|
@@ -24,16 +24,20 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"npm-parse-cwd": "npm:parse-cwd@^1.0.8",
|
|
27
|
-
"populate-files": "^0.0.
|
|
27
|
+
"populate-files": "^0.0.2",
|
|
28
28
|
"default-import": "^1.1.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"@types/
|
|
33
|
-
"@types/
|
|
34
|
-
"
|
|
35
|
-
"
|
|
31
|
+
"@biomejs/biome": "^1.6.4",
|
|
32
|
+
"@types/chai": "^4.3.12",
|
|
33
|
+
"@types/mocha": "^10.0.6",
|
|
34
|
+
"@types/node": "^20.11.26",
|
|
35
|
+
"chai": "^5.1.0",
|
|
36
|
+
"mocha": "^10.4.0",
|
|
37
|
+
"npm-nx-update-ts-references": "npm:nx-update-ts-references@^0.0.2",
|
|
36
38
|
"nyc": "^15.1.0",
|
|
37
|
-
"typescript": "^5.
|
|
39
|
+
"typescript": "^5.4.3",
|
|
40
|
+
"@leyman/eslint-config": "^0.0.0",
|
|
41
|
+
"nx-tsc": "^0.0.4"
|
|
38
42
|
}
|
|
39
43
|
}
|