@batijs/build 0.0.20 → 0.0.21

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/exec.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { VikeMeta } from '@batijs/core';
2
2
 
3
+ declare function walk(dir: string): AsyncGenerator<string>;
3
4
  declare function main(options: {
4
5
  source: string | string[];
5
6
  dist: string;
6
7
  }, meta: VikeMeta): Promise<void>;
7
8
 
8
- export { main as default };
9
+ export { main as default, walk };
package/dist/exec.js CHANGED
@@ -23,13 +23,13 @@ async function safeWriteFile(destination, content) {
23
23
  });
24
24
  await writeFile(destination, content, { encoding: "utf-8" });
25
25
  }
26
- async function* walk(dir, meta) {
26
+ async function* walk(dir) {
27
27
  if (!existsSync(dir))
28
28
  return;
29
29
  for await (const d of await opendir(dir)) {
30
30
  const entry = path.join(dir, d.name);
31
31
  if (d.isDirectory()) {
32
- yield* walk(entry, meta);
32
+ yield* walk(entry);
33
33
  } else if (d.isFile())
34
34
  yield entry;
35
35
  }
@@ -58,7 +58,7 @@ async function main(options, meta) {
58
58
  const sources = Array.isArray(options.source) ? options.source : [options.source];
59
59
  const targets = /* @__PURE__ */ new Set();
60
60
  for (const source of sources) {
61
- for await (const p of walk(source, meta)) {
61
+ for await (const p of walk(source)) {
62
62
  const target = toDist(p, source, options.dist);
63
63
  const parsed = path.parse(p);
64
64
  if (parsed.name.match(reIgnoreFile)) {
@@ -95,5 +95,6 @@ Please report this issue to https://github.com/magne4000/bati`
95
95
  }
96
96
  }
97
97
  export {
98
- main as default
98
+ main as default,
99
+ walk
99
100
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batijs/build",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -8,10 +8,10 @@
8
8
  "license": "MIT",
9
9
  "devDependencies": {
10
10
  "@types/node": "^16.18.34",
11
- "@batijs/tsup": "0.0.20"
11
+ "@batijs/tsup": "0.0.21"
12
12
  },
13
13
  "dependencies": {
14
- "@batijs/core": "0.0.20"
14
+ "@batijs/core": "0.0.21"
15
15
  },
16
16
  "main": "./dist/exec.js",
17
17
  "module": "./dist/exec.js",