onlybuild 1.6.6 → 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 CHANGED
@@ -1,5 +1,14 @@
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
+
3
12
  ## [v1.6.6](https://github.com/neogeek/onlybuild/tree/v1.6.6) - (2025-07-02)
4
13
 
5
14
  [Full Changelog](https://github.com/neogeek/onlybuild/compare/v1.6.5...v1.6.6)
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2025 Scott Doxey
3
+ Copyright (c) 2026 Scott Doxey
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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 Air (M1, 2020), macOS Sonoma 14.4.1, 8 GB memory.
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.349` | `0.455` | `0.626` | `0.980` | `1.661` |
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` |
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env -S node --no-warnings
2
- import 'dotenv/config';
3
2
  import 'tsx/esm';
3
+ import '../src/env.js';
4
4
  export {};
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 { globby } from 'globby';
3
+ import { glob } from 'node:fs/promises';
4
+ import { parseArgs } from 'node:util';
5
5
  import chalk from 'chalk';
6
- import parseCmdArgs from 'parse-cmd-args';
6
+ import '../src/env.js';
7
7
  import { buildFiles, writeFiles } from '../src/build.js';
8
8
  import { copyFiles } from '../src/copy.js';
9
9
  import pkg from '../package.json' with { type: 'json' };
10
10
  const elapsedTimeLabel = 'Elapsed time';
11
11
  console.time(elapsedTimeLabel);
12
- const args = parseCmdArgs(null, {
13
- requireUserInput: false
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.flags['--version'] || args.flags['-v']) {
22
+ if (args.values.version) {
16
23
  process.stdout.write(`${pkg.version}\n`);
17
24
  process.exit();
18
25
  }
19
- else if (args.flags['--help'] || args.flags['-h']) {
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.flags['--out'], args.flags['-o']]
32
- .filter(flag => typeof flag === 'string')
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 [ignoreFile = '.onlyignore'] = [args.flags['--ignore'], args.flags['-i']]
35
- .filter(flag => typeof flag === 'string')
36
- .map(String);
37
- const filesToBuild = await globby([
38
- '**/*.mjs',
39
- '**/*.jsx',
40
- '**/*.ts',
41
- '**/*.tsx',
42
- '!_*/**/*',
43
- '!node_modules/',
44
- `!${buildDir}`
45
- ].filter(Boolean), {
46
- gitignore: false,
47
- ignoreFiles: [ignoreFile],
48
- cwd: args.inputs[0]
49
- });
50
- const filesToCopy = await globby([
51
- '**/*',
52
- '!**/*.mjs',
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": "1.6.6",
4
+ "version": "2.0.0",
5
5
  "engines": {
6
- "node": ">=20.x"
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.4.1",
21
- "dotenv": "17.0.1",
22
- "globby": "14.1.0",
23
- "parse-cmd-args": "5.0.2",
24
- "tsx": "4.20.3"
20
+ "chalk": "5.6.2",
21
+ "tsx": "4.21.0"
25
22
  },
26
23
  "devDependencies": {
27
- "@types/node": "24.0.10",
28
- "typescript": "5.8.3"
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 {};
@@ -0,0 +1,5 @@
1
+ import process from 'node:process';
2
+ import { existsSync } from 'node:fs';
3
+ if (existsSync('.env')) {
4
+ process.loadEnvFile('.env');
5
+ }
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": "1.6.6",
4
+ "version": "2.0.0",
5
5
  "engines": {
6
- "node": ">=20.x"
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.4.1",
21
- "dotenv": "17.0.1",
22
- "globby": "14.1.0",
23
- "parse-cmd-args": "5.0.2",
24
- "tsx": "4.20.3"
20
+ "chalk": "5.6.2",
21
+ "tsx": "4.21.0"
25
22
  },
26
23
  "devDependencies": {
27
- "@types/node": "24.0.10",
28
- "typescript": "5.8.3"
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",