onlybuild 2.1.0 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v2.2.0](https://github.com/neogeek/onlybuild/tree/v2.2.0) - (2026-07-03)
4
+
5
+ [Full Changelog](https://github.com/neogeek/onlybuild/compare/v2.1.0...v2.2.0)
6
+
7
+ - [hotfix] Fixed issue with copyfile failing on directory with file extension. [#45](https://github.com/neogeek/onlybuild/pull/45)
8
+ - [feat] Added isDirectory method. [#44](https://github.com/neogeek/onlybuild/pull/44)
9
+ - [hotfix] Updated packages. [#43](https://github.com/neogeek/onlybuild/pull/43)
10
+
3
11
  ## [v2.1.0](https://github.com/neogeek/onlybuild/tree/v2.1.0) - (2026-04-02)
4
12
 
5
13
  [Full Changelog](https://github.com/neogeek/onlybuild/compare/v2.0.1...v2.1.0)
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "onlybuild",
3
3
  "description": "A zero-config cli for building static websites.",
4
- "version": "2.1.0",
4
+ "version": "2.2.0",
5
5
  "engines": {
6
6
  "node": ">=22.22"
7
7
  },
@@ -21,8 +21,8 @@
21
21
  "tsx": "4.21.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@types/node": "25.5.0",
25
- "typescript": "6.0.2"
24
+ "@types/node": "25.6.0",
25
+ "typescript": "6.0.3"
26
26
  },
27
27
  "scripts": {
28
28
  "test": "node --import tsx --test --experimental-test-coverage ./src/*.test.ts",
package/dist/src/copy.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { copyFile, mkdir } from 'node:fs/promises';
2
2
  import { dirname, join } from 'node:path';
3
+ import { isDirectory } from './files.js';
3
4
  /**
4
5
  * Copies a file from one path to another, creating parent directories as needed.
5
6
  *
@@ -7,6 +8,10 @@ import { dirname, join } from 'node:path';
7
8
  * @param {string} dest
8
9
  */
9
10
  export const copyFileAndMakeDir = async (src, dest) => {
11
+ if (await isDirectory(src)) {
12
+ await mkdir(dest, { recursive: true });
13
+ return;
14
+ }
10
15
  await mkdir(dirname(dest), { recursive: true });
11
16
  await copyFile(src, dest);
12
17
  };
@@ -1,2 +1,3 @@
1
1
  export declare const findFiles: (pattern: string | readonly string[], excludePattern?: ((fileName: string) => boolean) | readonly string[] | undefined, cwd?: string) => Promise<string[]>;
2
2
  export declare const getPatternsFromGitIgnore: (cwd?: string, filename?: string) => Promise<string[]>;
3
+ export declare const isDirectory: (path: string) => Promise<boolean>;
package/dist/src/files.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EOL } from 'node:os';
2
2
  import { join } from 'node:path';
3
- import { glob, readFile } from 'node:fs/promises';
3
+ import { glob, readFile, stat } from 'node:fs/promises';
4
4
  export const findFiles = async (pattern, excludePattern, cwd) => {
5
5
  return await Array.fromAsync(glob(Array.isArray(pattern) ? pattern.filter(Boolean) : pattern, {
6
6
  exclude: Array.isArray(excludePattern)
@@ -14,3 +14,12 @@ export const getPatternsFromGitIgnore = async (cwd, filename = '.gitignore') =>
14
14
  .split(EOL)
15
15
  .filter(Boolean);
16
16
  };
17
+ export const isDirectory = async (path) => {
18
+ try {
19
+ const stats = await stat(path);
20
+ return stats.isDirectory();
21
+ }
22
+ catch {
23
+ return false;
24
+ }
25
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "onlybuild",
3
3
  "description": "A zero-config cli for building static websites.",
4
- "version": "2.1.0",
4
+ "version": "2.2.0",
5
5
  "engines": {
6
6
  "node": ">=22.22"
7
7
  },
@@ -21,8 +21,8 @@
21
21
  "tsx": "4.21.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@types/node": "25.5.0",
25
- "typescript": "6.0.2"
24
+ "@types/node": "25.6.0",
25
+ "typescript": "6.0.3"
26
26
  },
27
27
  "scripts": {
28
28
  "test": "node --import tsx --test --experimental-test-coverage ./src/*.test.ts",