@regardio/dev 1.16.1 → 1.16.3

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/README.md CHANGED
@@ -27,7 +27,7 @@ The goal is code that's correct, consistent, and a pleasure to work with.
27
27
  | **Testing** | Vitest, Playwright, Testing Library |
28
28
  | **Build** | TypeScript, tsx, Vite |
29
29
  | **Workflow** | Husky, GitLab Flow |
30
- | **CLI utilities** | exec-clean, exec-p, exec-s, exec-ts, ship-staging, ship-production, ship-hotfix, lint-biome, lint-md, lint-package |
30
+ | **CLI utilities** | exec-clean, exec-p, exec-s, exec-tsc, ship-staging, ship-production, ship-hotfix, lint-biome, lint-md, lint-package |
31
31
 
32
32
  ## Quick Start
33
33
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package.json",
3
3
  "name": "@regardio/dev",
4
- "version": "1.16.1",
4
+ "version": "1.16.3",
5
5
  "private": false,
6
6
  "description": "Regardio developer tooling for testing, linting, and build workflows",
7
7
  "keywords": [
@@ -59,7 +59,6 @@
59
59
  "exec-husky": "dist/bin/exec/husky.js",
60
60
  "exec-p": "dist/bin/exec/p.js",
61
61
  "exec-s": "dist/bin/exec/s.js",
62
- "exec-ts": "dist/bin/exec/ts.js",
63
62
  "exec-tsc": "dist/bin/exec/tsc.js",
64
63
  "lint-biome": "dist/bin/lint/biome.js",
65
64
  "lint-commit": "dist/bin/lint/commit.js",
@@ -91,28 +90,28 @@
91
90
  "typecheck": "tsc --noEmit"
92
91
  },
93
92
  "dependencies": {
94
- "@biomejs/biome": "2.4.4",
95
- "@commitlint/cli": "20.4.2",
96
- "@commitlint/config-conventional": "20.4.2",
93
+ "@biomejs/biome": "2.4.7",
94
+ "@commitlint/cli": "20.5.0",
95
+ "@commitlint/config-conventional": "20.5.0",
97
96
  "@playwright/test": "1.58.2",
98
97
  "@testing-library/jest-dom": "6.9.1",
99
98
  "@testing-library/react": "16.3.2",
100
99
  "@total-typescript/ts-reset": "0.6.1",
101
- "@types/node": "25.3.2",
102
- "@vitest/coverage-v8": "4.0.18",
103
- "@vitest/ui": "4.0.18",
100
+ "@types/node": "25.5.0",
101
+ "@vitest/coverage-v8": "4.1.0",
102
+ "@vitest/ui": "4.1.0",
104
103
  "husky": "9.1.7",
105
- "jsdom": "28.1.0",
104
+ "jsdom": "29.0.0",
106
105
  "markdownlint-cli2": "0.21.0",
107
106
  "npm-run-all": "4.1.5",
108
- "postcss": "8.5.6",
107
+ "postcss": "8.5.8",
109
108
  "rimraf": "6.1.3",
110
109
  "rollup": "4.59.0",
111
110
  "sort-package-json": "3.6.1",
112
111
  "tsx": "4.21.0",
113
112
  "typescript": "5.9.3",
114
- "vite": "7.3.1",
115
- "vitest": "4.0.18"
113
+ "vite": "8.0.0",
114
+ "vitest": "4.1.0"
116
115
  },
117
116
  "peerDependencies": {
118
117
  "postcss": "8.4"
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export declare function resolveTsxBin(require: NodeRequire): string | null;
3
- //# sourceMappingURL=ts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ts.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/ts.ts"],"names":[],"mappings":";AAcA,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAYjE"}
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import { spawn } from 'node:child_process';
3
- import { createRequire } from 'node:module';
4
- import path from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- export function resolveTsxBin(require) {
7
- const pkgPath = require.resolve('tsx/package.json');
8
- const pkg = require(pkgPath);
9
- const binRel = pkg.bin;
10
- const binEntry = typeof binRel === 'string'
11
- ? binRel
12
- : typeof binRel === 'object' && binRel !== null && 'tsx' in binRel
13
- ? binRel.tsx
14
- : undefined;
15
- if (!binEntry)
16
- return null;
17
- return path.join(path.dirname(pkgPath), binEntry);
18
- }
19
- if (fileURLToPath(import.meta.url) === path.resolve(process.argv[1] ?? '')) {
20
- const args = process.argv.slice(2);
21
- if (args.length === 0) {
22
- console.error('Usage: exec-ts <script.ts> [args...]');
23
- process.exit(1);
24
- }
25
- const [scriptArg, ...rest] = args;
26
- const script = scriptArg ?? '';
27
- const require = createRequire(import.meta.url);
28
- const bin = resolveTsxBin(require);
29
- if (!bin) {
30
- console.error('Unable to locate tsx binary from package.json bin field');
31
- process.exit(1);
32
- }
33
- const spawnOptions = { stdio: 'inherit' };
34
- const child = spawn(process.execPath, [bin, script, ...rest], spawnOptions);
35
- child.on('exit', (code) => process.exit(code ?? 0));
36
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ts.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ts.test.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/ts.test.ts"],"names":[],"mappings":""}
@@ -1,39 +0,0 @@
1
- import { createRequire } from 'node:module';
2
- import path from 'node:path';
3
- import { describe, expect, it } from 'vitest';
4
- import { resolveTsxBin } from './ts.js';
5
- function makeRequire(pkgPath, pkg) {
6
- const req = (id) => (id === pkgPath ? pkg : undefined);
7
- req.resolve = (_id) => pkgPath;
8
- return req;
9
- }
10
- describe('resolveTsxBin', () => {
11
- it('resolves when bin is a string', () => {
12
- const pkgPath = '/node_modules/tsx/package.json';
13
- const req = makeRequire(pkgPath, { bin: './dist/cli.mjs' });
14
- const result = resolveTsxBin(req);
15
- expect(result).toBe(path.join('/node_modules/tsx', 'dist/cli.mjs'));
16
- });
17
- it('resolves when bin is an object with a tsx key', () => {
18
- const pkgPath = '/node_modules/tsx/package.json';
19
- const req = makeRequire(pkgPath, { bin: { tsx: './dist/cli.mjs' } });
20
- const result = resolveTsxBin(req);
21
- expect(result).toBe(path.join('/node_modules/tsx', 'dist/cli.mjs'));
22
- });
23
- it('returns null when bin field is missing', () => {
24
- const pkgPath = '/node_modules/tsx/package.json';
25
- const req = makeRequire(pkgPath, {});
26
- expect(resolveTsxBin(req)).toBeNull();
27
- });
28
- it('returns null when bin object has no tsx key', () => {
29
- const pkgPath = '/node_modules/tsx/package.json';
30
- const req = makeRequire(pkgPath, { bin: { other: './dist/other.js' } });
31
- expect(resolveTsxBin(req)).toBeNull();
32
- });
33
- it('resolves against the real tsx package', () => {
34
- const req = createRequire(import.meta.url);
35
- const result = resolveTsxBin(req);
36
- expect(result).not.toBeNull();
37
- expect(path.isAbsolute(result ?? '')).toBe(true);
38
- });
39
- });
@@ -1,54 +0,0 @@
1
- import { createRequire } from 'node:module';
2
- import path from 'node:path';
3
- import { describe, expect, it } from 'vitest';
4
-
5
- import { resolveTsxBin } from './ts.js';
6
-
7
- function makeRequire(pkgPath: string, pkg: unknown): NodeRequire {
8
- const req = (id: string): unknown => (id === pkgPath ? pkg : undefined);
9
- req.resolve = (_id: string) => pkgPath;
10
- return req as unknown as NodeRequire;
11
- }
12
-
13
- describe('resolveTsxBin', () => {
14
- it('resolves when bin is a string', () => {
15
- const pkgPath = '/node_modules/tsx/package.json';
16
- const req = makeRequire(pkgPath, { bin: './dist/cli.mjs' });
17
-
18
- const result = resolveTsxBin(req);
19
-
20
- expect(result).toBe(path.join('/node_modules/tsx', 'dist/cli.mjs'));
21
- });
22
-
23
- it('resolves when bin is an object with a tsx key', () => {
24
- const pkgPath = '/node_modules/tsx/package.json';
25
- const req = makeRequire(pkgPath, { bin: { tsx: './dist/cli.mjs' } });
26
-
27
- const result = resolveTsxBin(req);
28
-
29
- expect(result).toBe(path.join('/node_modules/tsx', 'dist/cli.mjs'));
30
- });
31
-
32
- it('returns null when bin field is missing', () => {
33
- const pkgPath = '/node_modules/tsx/package.json';
34
- const req = makeRequire(pkgPath, {});
35
-
36
- expect(resolveTsxBin(req)).toBeNull();
37
- });
38
-
39
- it('returns null when bin object has no tsx key', () => {
40
- const pkgPath = '/node_modules/tsx/package.json';
41
- const req = makeRequire(pkgPath, { bin: { other: './dist/other.js' } });
42
-
43
- expect(resolveTsxBin(req)).toBeNull();
44
- });
45
-
46
- it('resolves against the real tsx package', () => {
47
- const req = createRequire(import.meta.url);
48
-
49
- const result = resolveTsxBin(req);
50
-
51
- expect(result).not.toBeNull();
52
- expect(path.isAbsolute(result ?? '')).toBe(true);
53
- });
54
- });
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * exec-ts: Run a local TypeScript file via tsx with TS support.
4
- * Usage: exec-ts path/to/script.ts [args...]
5
- */
6
- import { type SpawnOptions, spawn } from 'node:child_process';
7
- import { createRequire } from 'node:module';
8
- import path from 'node:path';
9
- import { fileURLToPath } from 'node:url';
10
-
11
- /**
12
- * Resolve the absolute path to the tsx binary from its package.json bin field.
13
- * Returns the resolved path, or null if it cannot be determined.
14
- */
15
- export function resolveTsxBin(require: NodeRequire): string | null {
16
- const pkgPath = require.resolve('tsx/package.json');
17
- const pkg = require(pkgPath) as { bin?: unknown };
18
- const binRel = pkg.bin;
19
- const binEntry: string | undefined =
20
- typeof binRel === 'string'
21
- ? binRel
22
- : typeof binRel === 'object' && binRel !== null && 'tsx' in binRel
23
- ? (binRel as Record<string, string>).tsx
24
- : undefined;
25
- if (!binEntry) return null;
26
- return path.join(path.dirname(pkgPath), binEntry);
27
- }
28
-
29
- // ---------------------------------------------------------------------------
30
- // CLI entry point — only runs when executed directly
31
- // ---------------------------------------------------------------------------
32
- if (fileURLToPath(import.meta.url) === path.resolve(process.argv[1] ?? '')) {
33
- const args = process.argv.slice(2);
34
- if (args.length === 0) {
35
- console.error('Usage: exec-ts <script.ts> [args...]');
36
- process.exit(1);
37
- }
38
-
39
- const [scriptArg, ...rest] = args;
40
- const script = scriptArg ?? '';
41
-
42
- const require = createRequire(import.meta.url);
43
- const bin = resolveTsxBin(require);
44
- if (!bin) {
45
- console.error('Unable to locate tsx binary from package.json bin field');
46
- process.exit(1);
47
- }
48
-
49
- const spawnOptions: SpawnOptions = { stdio: 'inherit' };
50
- const child = spawn(process.execPath, [bin, script, ...rest], spawnOptions);
51
- child.on('exit', (code: number | null) => process.exit(code ?? 0));
52
- }