onlybuild 1.6.5 → 2.0.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 +22 -0
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/bin/index.d.ts +1 -1
- package/dist/bin/index.js +37 -42
- package/dist/package.json +6 -9
- package/dist/src/env.d.ts +1 -0
- package/dist/src/env.js +5 -0
- package/package.json +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v2.0.0](https://github.com/neogeek/onlybuild/tree/v2.0.0) - (2026-02-21)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/neogeek/onlybuild/compare/v1.6.6...v2.0.0)
|
|
6
|
+
|
|
7
|
+
- [feat] Removed parse-cmd-args package. [#40](https://github.com/neogeek/onlybuild/pull/40)
|
|
8
|
+
- Removed globby package. [#39](https://github.com/neogeek/onlybuild/pull/39)
|
|
9
|
+
- [feat] Removed dotenv package. [#38](https://github.com/neogeek/onlybuild/pull/38)
|
|
10
|
+
- [hotfix] Updated packages. [#37](https://github.com/neogeek/onlybuild/pull/37)
|
|
11
|
+
|
|
12
|
+
## [v1.6.6](https://github.com/neogeek/onlybuild/tree/v1.6.6) - (2025-07-02)
|
|
13
|
+
|
|
14
|
+
[Full Changelog](https://github.com/neogeek/onlybuild/compare/v1.6.5...v1.6.6)
|
|
15
|
+
|
|
16
|
+
- [hotfix] Updated packages. [#36](https://github.com/neogeek/onlybuild/pull/36)
|
|
17
|
+
- [hotfix] Updated packages. [#35](https://github.com/neogeek/onlybuild/pull/35)
|
|
18
|
+
|
|
19
|
+
## [v1.6.5](https://github.com/neogeek/onlybuild/tree/v1.6.5) - (2025-02-18)
|
|
20
|
+
|
|
21
|
+
[Full Changelog](https://github.com/neogeek/onlybuild/compare/v1.6.4...v1.6.5)
|
|
22
|
+
|
|
23
|
+
- [hotfix] Updated packages. [#34](https://github.com/neogeek/onlybuild/pull/34)
|
|
24
|
+
|
|
3
25
|
## [v1.6.4](https://github.com/neogeek/onlybuild/tree/v1.6.4) - (2024-09-09)
|
|
4
26
|
|
|
5
27
|
[Full Changelog](https://github.com/neogeek/onlybuild/compare/v1.6.3...v1.6.4)
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -420,13 +420,13 @@ Serving the files once the build is complete is easy using the NPM package [http
|
|
|
420
420
|
## Benchmark
|
|
421
421
|
|
|
422
422
|
> [!NOTE]
|
|
423
|
-
> Each run (for `onlybuild` only) was repeated 5 times and the lowest/fastest time was selected. This result set was generated on a MacBook
|
|
423
|
+
> Each run (for `onlybuild` only) was repeated 5 times and the lowest/fastest time was selected. This result set was generated on a MacBook Pro (M4, 2024), macOS Sonoma 26.3, 32 GB memory.
|
|
424
424
|
|
|
425
425
|
Times shown are in seconds. Lower is better.
|
|
426
426
|
|
|
427
427
|
| Markdown Files | 250 | 500 | 1000 | 2000 | 4000 |
|
|
428
428
|
| ---------------------------------------------- | -------: | -------: | -------: | -------: | -------: |
|
|
429
|
-
| onlybuild | `0.
|
|
429
|
+
| onlybuild | `0.228` | `0.299` | `0.442` | `0.740` | `1.297` |
|
|
430
430
|
| [Hugo](https://gohugo.io/) v0.101.0 | `0.071` | `0.110` | `0.171` | `0.352` | `0.684` |
|
|
431
431
|
| [Eleventy](https://www.11ty.dev/) 1.0.1 | `0.584` | `0.683` | `0.914` | `1.250` | `1.938` |
|
|
432
432
|
| [Astro](https://astro.build/) 1.0.1 | `2.270` | `3.172` | `5.098` | `9.791` | `22.907` |
|
package/dist/bin/index.d.ts
CHANGED
package/dist/bin/index.js
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --no-warnings
|
|
2
|
-
import 'dotenv/config';
|
|
3
2
|
import 'tsx/esm';
|
|
4
|
-
import {
|
|
3
|
+
import { glob } from 'node:fs/promises';
|
|
4
|
+
import { parseArgs } from 'node:util';
|
|
5
5
|
import chalk from 'chalk';
|
|
6
|
-
import
|
|
6
|
+
import '../src/env.js';
|
|
7
7
|
import { buildFiles, writeFiles } from '../src/build.js';
|
|
8
8
|
import { copyFiles } from '../src/copy.js';
|
|
9
|
-
import pkg from '../package.json'
|
|
9
|
+
import pkg from '../package.json' with { type: 'json' };
|
|
10
10
|
const elapsedTimeLabel = 'Elapsed time';
|
|
11
11
|
console.time(elapsedTimeLabel);
|
|
12
|
-
const args =
|
|
13
|
-
|
|
12
|
+
const args = parseArgs({
|
|
13
|
+
args: process.argv.slice(2),
|
|
14
|
+
options: {
|
|
15
|
+
version: { type: 'boolean', short: 'v' },
|
|
16
|
+
help: { type: 'boolean', short: 'h' },
|
|
17
|
+
out: { type: 'string', short: 'o' },
|
|
18
|
+
ignore: { type: 'string', short: 'i' }
|
|
19
|
+
},
|
|
20
|
+
allowPositionals: true
|
|
14
21
|
});
|
|
15
|
-
if (args.
|
|
22
|
+
if (args.values.version) {
|
|
16
23
|
process.stdout.write(`${pkg.version}\n`);
|
|
17
24
|
process.exit();
|
|
18
25
|
}
|
|
19
|
-
else if (args.
|
|
26
|
+
else if (args.values.help) {
|
|
20
27
|
process.stdout.write(`Usage: onlybuild <path> [options]
|
|
21
28
|
|
|
22
29
|
Options:
|
|
@@ -28,41 +35,29 @@ else if (args.flags['--help'] || args.flags['-h']) {
|
|
|
28
35
|
`);
|
|
29
36
|
process.exit();
|
|
30
37
|
}
|
|
31
|
-
const [buildDir = 'build/'] = [args.
|
|
32
|
-
|
|
38
|
+
const [buildDir = 'build/'] = [args.values.out].filter(Boolean).map(String);
|
|
39
|
+
const [ignoreFile = '.onlyignore'] = [args.values.ignore]
|
|
40
|
+
.filter(Boolean)
|
|
33
41
|
.map(String);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
'!**/*.jsx',
|
|
54
|
-
'!**/*.ts',
|
|
55
|
-
'!**/*.tsx',
|
|
56
|
-
'!_*/**/*',
|
|
57
|
-
'!package.json',
|
|
58
|
-
'!package-lock.json',
|
|
59
|
-
'!node_modules/',
|
|
60
|
-
`!${buildDir}`
|
|
61
|
-
], {
|
|
62
|
-
gitignore: false,
|
|
63
|
-
ignoreFiles: [ignoreFile],
|
|
64
|
-
cwd: args.inputs[0]
|
|
65
|
-
});
|
|
42
|
+
const filesToBuild = (await Array.fromAsync(glob(['**/*.mjs', '**/*.jsx', '**/*.ts', '**/*.tsx'].filter(Boolean), {
|
|
43
|
+
exclude: ['node_modules/', '_*/**/*', buildDir, ignoreFile],
|
|
44
|
+
cwd: args.positionals[0]
|
|
45
|
+
}))).filter(path => path.includes('.'));
|
|
46
|
+
const filesToCopy = (await Array.fromAsync(glob(['**/*'], {
|
|
47
|
+
exclude: [
|
|
48
|
+
'**/*.mjs',
|
|
49
|
+
'**/*.jsx',
|
|
50
|
+
'**/*.ts',
|
|
51
|
+
'**/*.tsx',
|
|
52
|
+
'_*/**/*',
|
|
53
|
+
'package.json',
|
|
54
|
+
'package-lock.json',
|
|
55
|
+
'node_modules/',
|
|
56
|
+
buildDir,
|
|
57
|
+
ignoreFile
|
|
58
|
+
],
|
|
59
|
+
cwd: args.positionals[0]
|
|
60
|
+
}))).filter(path => path.includes('.'));
|
|
66
61
|
const filesToWrite = await buildFiles(filesToBuild);
|
|
67
62
|
await writeFiles(filesToWrite, buildDir);
|
|
68
63
|
await copyFiles(filesToCopy, buildDir);
|
package/dist/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onlybuild",
|
|
3
3
|
"description": "A zero-config cli for building static websites.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=22.22"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"bin": {
|
|
@@ -17,15 +17,12 @@
|
|
|
17
17
|
"types": "./dist/src/index.d.ts",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"chalk": "5.
|
|
21
|
-
"
|
|
22
|
-
"globby": "14.1.0",
|
|
23
|
-
"parse-cmd-args": "5.0.2",
|
|
24
|
-
"tsx": "4.19.2"
|
|
20
|
+
"chalk": "5.6.2",
|
|
21
|
+
"tsx": "4.21.0"
|
|
25
22
|
},
|
|
26
23
|
"devDependencies": {
|
|
27
|
-
"@types/node": "
|
|
28
|
-
"typescript": "5.
|
|
24
|
+
"@types/node": "25.3.0",
|
|
25
|
+
"typescript": "5.9.3"
|
|
29
26
|
},
|
|
30
27
|
"scripts": {
|
|
31
28
|
"test": "node --import tsx --test --experimental-test-coverage ./src/*.test.ts",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/env.js
ADDED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onlybuild",
|
|
3
3
|
"description": "A zero-config cli for building static websites.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=22.22"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"bin": {
|
|
@@ -17,15 +17,12 @@
|
|
|
17
17
|
"types": "./dist/src/index.d.ts",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"chalk": "5.
|
|
21
|
-
"
|
|
22
|
-
"globby": "14.1.0",
|
|
23
|
-
"parse-cmd-args": "5.0.2",
|
|
24
|
-
"tsx": "4.19.2"
|
|
20
|
+
"chalk": "5.6.2",
|
|
21
|
+
"tsx": "4.21.0"
|
|
25
22
|
},
|
|
26
23
|
"devDependencies": {
|
|
27
|
-
"@types/node": "
|
|
28
|
-
"typescript": "5.
|
|
24
|
+
"@types/node": "25.3.0",
|
|
25
|
+
"typescript": "5.9.3"
|
|
29
26
|
},
|
|
30
27
|
"scripts": {
|
|
31
28
|
"test": "node --import tsx --test --experimental-test-coverage ./src/*.test.ts",
|