onlybuild 2.0.1 → 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 +14 -0
- package/dist/package.json +4 -5
- package/dist/src/copy.js +5 -0
- package/dist/src/files.d.ts +3 -0
- package/dist/src/files.js +25 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/package.json +4 -5
- package/tsconfig.build.json +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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
|
+
|
|
11
|
+
## [v2.1.0](https://github.com/neogeek/onlybuild/tree/v2.1.0) - (2026-04-02)
|
|
12
|
+
|
|
13
|
+
[Full Changelog](https://github.com/neogeek/onlybuild/compare/v2.0.1...v2.1.0)
|
|
14
|
+
|
|
15
|
+
- [feat] Added file utils. [#42](https://github.com/neogeek/onlybuild/pull/42)
|
|
16
|
+
|
|
3
17
|
## [v2.0.1](https://github.com/neogeek/onlybuild/tree/v2.0.1) - (2026-02-23)
|
|
4
18
|
|
|
5
19
|
[Full Changelog](https://github.com/neogeek/onlybuild/compare/v2.0.0...v2.0.1)
|
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.0
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.22"
|
|
7
7
|
},
|
|
@@ -21,13 +21,12 @@
|
|
|
21
21
|
"tsx": "4.21.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/node": "25.
|
|
25
|
-
"typescript": "
|
|
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",
|
|
29
|
-
"build": "rm -rf dist/ && tsc && chmod +x ./dist/bin/index.js"
|
|
30
|
-
"prepare": "npm run build"
|
|
29
|
+
"build": "rm -rf dist/ && tsc --project tsconfig.build.json && chmod +x ./dist/bin/index.js"
|
|
31
30
|
},
|
|
32
31
|
"keywords": [
|
|
33
32
|
"javascript",
|
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
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const findFiles: (pattern: string | readonly string[], excludePattern?: ((fileName: string) => boolean) | readonly string[] | undefined, cwd?: string) => Promise<string[]>;
|
|
2
|
+
export declare const getPatternsFromGitIgnore: (cwd?: string, filename?: string) => Promise<string[]>;
|
|
3
|
+
export declare const isDirectory: (path: string) => Promise<boolean>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EOL } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { glob, readFile, stat } from 'node:fs/promises';
|
|
4
|
+
export const findFiles = async (pattern, excludePattern, cwd) => {
|
|
5
|
+
return await Array.fromAsync(glob(Array.isArray(pattern) ? pattern.filter(Boolean) : pattern, {
|
|
6
|
+
exclude: Array.isArray(excludePattern)
|
|
7
|
+
? excludePattern.filter(Boolean)
|
|
8
|
+
: excludePattern,
|
|
9
|
+
cwd
|
|
10
|
+
}));
|
|
11
|
+
};
|
|
12
|
+
export const getPatternsFromGitIgnore = async (cwd, filename = '.gitignore') => {
|
|
13
|
+
return (await readFile(cwd ? join(cwd, filename) : filename, 'utf8'))
|
|
14
|
+
.split(EOL)
|
|
15
|
+
.filter(Boolean);
|
|
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/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
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.0
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.22"
|
|
7
7
|
},
|
|
@@ -21,13 +21,12 @@
|
|
|
21
21
|
"tsx": "4.21.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/node": "25.
|
|
25
|
-
"typescript": "
|
|
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",
|
|
29
|
-
"build": "rm -rf dist/ && tsc && chmod +x ./dist/bin/index.js"
|
|
30
|
-
"prepare": "npm run build"
|
|
29
|
+
"build": "rm -rf dist/ && tsc --project tsconfig.build.json && chmod +x ./dist/bin/index.js"
|
|
31
30
|
},
|
|
32
31
|
"keywords": [
|
|
33
32
|
"javascript",
|