@fuf-stack/project-cli-tools 1.0.20 → 1.0.22
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 +52 -0
- package/package.json +9 -9
- package/test/commitizen.test.ts +19 -0
- package/test/commitlint.test.ts +9 -0
- package/test/husky.test.ts +22 -0
- package/test/lerna.test.ts +86 -0
- package/test/lint-staged.test.ts +9 -0
- package/test/nodemon.test.ts +9 -0
- package/test/test-utils.ts +47 -0
- package/test/turbo.test.ts +9 -0
- package/test/wait-on.test.ts +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,58 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.22](https://github.com/fuf-stack/ts-project-setup/compare/project-cli-tools-v1.0.21...project-cli-tools-v1.0.22) (2026-08-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **project-cli-tools:** restore reliable release tooling ([892c9a3](https://github.com/fuf-stack/ts-project-setup/commit/892c9a3b42cbcff2810a17a6e94c65438d5393c3))
|
|
12
|
+
* **project-cli-tools:** update commitlint monorepo to v21.2.2 ([#1407](https://github.com/fuf-stack/ts-project-setup/issues/1407)) ([54adaf2](https://github.com/fuf-stack/ts-project-setup/commit/54adaf28104cf0fc19919cd7a136926a824cf8fd))
|
|
13
|
+
* **project-cli-tools:** update dependency lint-staged to v17.1.0 ([#1365](https://github.com/fuf-stack/ts-project-setup/issues/1365)) ([123031b](https://github.com/fuf-stack/ts-project-setup/commit/123031bf67deee581fd2c9087ec223c73c09b93e))
|
|
14
|
+
* **project-cli-tools:** update dependency lint-staged to v17.1.1 ([#1373](https://github.com/fuf-stack/ts-project-setup/issues/1373)) ([6fd2be6](https://github.com/fuf-stack/ts-project-setup/commit/6fd2be6c1464e27aedeec8354a627341d1cdfadc))
|
|
15
|
+
* **project-cli-tools:** update dependency lint-staged to v17.2.0 ([#1376](https://github.com/fuf-stack/ts-project-setup/issues/1376)) ([0b12f81](https://github.com/fuf-stack/ts-project-setup/commit/0b12f8165a8c26b94a4b02ee45896effe660ced3))
|
|
16
|
+
* **project-cli-tools:** update dependency lint-staged to v17.3.0 ([#1390](https://github.com/fuf-stack/ts-project-setup/issues/1390)) ([01e16e7](https://github.com/fuf-stack/ts-project-setup/commit/01e16e7793c5ae8d5877fc28775fb2a1c440255b))
|
|
17
|
+
* **project-cli-tools:** update dependency turbo to v2.10.10 ([#1409](https://github.com/fuf-stack/ts-project-setup/issues/1409)) ([f6956cd](https://github.com/fuf-stack/ts-project-setup/commit/f6956cd0c88e6c39a211d032d0eef98567af57b3))
|
|
18
|
+
* **project-cli-tools:** update dependency turbo to v2.10.11 ([#1413](https://github.com/fuf-stack/ts-project-setup/issues/1413)) ([3831055](https://github.com/fuf-stack/ts-project-setup/commit/3831055dbb3a7a4890dc8121cc0f9312d37f5d85))
|
|
19
|
+
* **project-cli-tools:** update dependency turbo to v2.10.5 ([#1361](https://github.com/fuf-stack/ts-project-setup/issues/1361)) ([601fb53](https://github.com/fuf-stack/ts-project-setup/commit/601fb53c30d12709584d63f68ff5fa6b099def46))
|
|
20
|
+
* **project-cli-tools:** update dependency turbo to v2.10.6 ([#1374](https://github.com/fuf-stack/ts-project-setup/issues/1374)) ([431a05a](https://github.com/fuf-stack/ts-project-setup/commit/431a05a2de843a6feac0941abfdc0db854a03fe8))
|
|
21
|
+
* **project-cli-tools:** update dependency turbo to v2.10.7 ([#1383](https://github.com/fuf-stack/ts-project-setup/issues/1383)) ([9b8d1ed](https://github.com/fuf-stack/ts-project-setup/commit/9b8d1ed4dcbf7df37d8fc6e22a9982fefc421e5e))
|
|
22
|
+
* **project-cli-tools:** update dependency turbo to v2.10.8 ([#1391](https://github.com/fuf-stack/ts-project-setup/issues/1391)) ([e3ba84b](https://github.com/fuf-stack/ts-project-setup/commit/e3ba84bf21202fab63515a15ab6c4dbff12a3798))
|
|
23
|
+
* **project-cli-tools:** update dependency turbo to v2.10.9 ([#1402](https://github.com/fuf-stack/ts-project-setup/issues/1402)) ([04da5f1](https://github.com/fuf-stack/ts-project-setup/commit/04da5f1890cdfa59c956c066903c5dd2c24a39bc))
|
|
24
|
+
* **project-cli-tools:** update dependency wait-on to v9.1.0 ([#1372](https://github.com/fuf-stack/ts-project-setup/issues/1372)) ([694f3e3](https://github.com/fuf-stack/ts-project-setup/commit/694f3e35c98fb058fcbaae113fed92e169fe3a60))
|
|
25
|
+
* **project-cli-tools:** update lerna-lite monorepo to v5.4.1 ([#1363](https://github.com/fuf-stack/ts-project-setup/issues/1363)) ([341238d](https://github.com/fuf-stack/ts-project-setup/commit/341238d2c6890867f1a0b3dea4a27ee2e6fbd033))
|
|
26
|
+
* **project-cli-tools:** update lerna-lite monorepo to v5.4.2 ([#1379](https://github.com/fuf-stack/ts-project-setup/issues/1379)) ([b1e16cf](https://github.com/fuf-stack/ts-project-setup/commit/b1e16cf37e80112474b4e531027a2615d17a9ab0))
|
|
27
|
+
* **project-cli-tools:** update lerna-lite monorepo to v5.5.0 ([#1406](https://github.com/fuf-stack/ts-project-setup/issues/1406)) ([581f179](https://github.com/fuf-stack/ts-project-setup/commit/581f17915558218752f32b6c887c64b387c912ed))
|
|
28
|
+
* **project-cli-tools:** update lerna-lite monorepo to v5.6.0 ([#1415](https://github.com/fuf-stack/ts-project-setup/issues/1415)) ([a092a95](https://github.com/fuf-stack/ts-project-setup/commit/a092a9584e729fb2805093ad9b505d6ee8dc5648))
|
|
29
|
+
|
|
30
|
+
## [1.0.21](https://github.com/fuf-stack/ts-project-setup/compare/project-cli-tools-v1.0.20...project-cli-tools-v1.0.21) (2026-07-17)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **project-cli-tools:** update commitlint monorepo to v21.0.2 ([#1286](https://github.com/fuf-stack/ts-project-setup/issues/1286)) ([fb7952c](https://github.com/fuf-stack/ts-project-setup/commit/fb7952c946b256144c3e754f2dad449b485815c9))
|
|
36
|
+
* **project-cli-tools:** update commitlint monorepo to v21.1.0 ([#1326](https://github.com/fuf-stack/ts-project-setup/issues/1326)) ([72a723d](https://github.com/fuf-stack/ts-project-setup/commit/72a723dcece9e3074c068b4cbfc6c9cec1be805f))
|
|
37
|
+
* **project-cli-tools:** update commitlint monorepo to v21.2.0 ([#1338](https://github.com/fuf-stack/ts-project-setup/issues/1338)) ([b71d6ff](https://github.com/fuf-stack/ts-project-setup/commit/b71d6ff09dae5430fccdf9328ec3453bb0d3a5ec))
|
|
38
|
+
* **project-cli-tools:** update dependency @commitlint/cli to v21.2.1 ([#1347](https://github.com/fuf-stack/ts-project-setup/issues/1347)) ([d0fbf55](https://github.com/fuf-stack/ts-project-setup/commit/d0fbf55cffffd50219a2d6ac5fdb1be5604cb89f))
|
|
39
|
+
* **project-cli-tools:** update dependency commitizen to v4.3.2 ([#1312](https://github.com/fuf-stack/ts-project-setup/issues/1312)) ([ddbee4e](https://github.com/fuf-stack/ts-project-setup/commit/ddbee4e5423d81737acf519de8ca3b4d61afeaf6))
|
|
40
|
+
* **project-cli-tools:** update dependency lint-staged to v17.0.5 ([#1269](https://github.com/fuf-stack/ts-project-setup/issues/1269)) ([48f8780](https://github.com/fuf-stack/ts-project-setup/commit/48f878027407cc271f1105ea4aabb7490fa85f48))
|
|
41
|
+
* **project-cli-tools:** update dependency lint-staged to v17.0.6 ([#1287](https://github.com/fuf-stack/ts-project-setup/issues/1287)) ([e13c9f8](https://github.com/fuf-stack/ts-project-setup/commit/e13c9f80f7200fa132e5f63da008279908991f23))
|
|
42
|
+
* **project-cli-tools:** update dependency lint-staged to v17.0.7 ([#1290](https://github.com/fuf-stack/ts-project-setup/issues/1290)) ([cd6b291](https://github.com/fuf-stack/ts-project-setup/commit/cd6b29185bcbb2060c2df808fc5060c69fed2db9))
|
|
43
|
+
* **project-cli-tools:** update dependency lint-staged to v17.0.8 ([#1323](https://github.com/fuf-stack/ts-project-setup/issues/1323)) ([96c1ce5](https://github.com/fuf-stack/ts-project-setup/commit/96c1ce59c09d788dd01f3760c453b3b4f89aa682))
|
|
44
|
+
* **project-cli-tools:** update dependency turbo to v2.10.0 ([#1328](https://github.com/fuf-stack/ts-project-setup/issues/1328)) ([7014235](https://github.com/fuf-stack/ts-project-setup/commit/70142352e6314950f7fc38fb8643f0d0c7b6708f))
|
|
45
|
+
* **project-cli-tools:** update dependency turbo to v2.10.1 ([#1336](https://github.com/fuf-stack/ts-project-setup/issues/1336)) ([4e252ba](https://github.com/fuf-stack/ts-project-setup/commit/4e252ba6bef6bd4f09a9aa745d0e77119b6cb78a))
|
|
46
|
+
* **project-cli-tools:** update dependency turbo to v2.10.2 ([#1339](https://github.com/fuf-stack/ts-project-setup/issues/1339)) ([5812ff6](https://github.com/fuf-stack/ts-project-setup/commit/5812ff6d398a1e1c353e4ec035ba14e46ed6acf3))
|
|
47
|
+
* **project-cli-tools:** update dependency turbo to v2.10.3 ([#1341](https://github.com/fuf-stack/ts-project-setup/issues/1341)) ([8f4ad4a](https://github.com/fuf-stack/ts-project-setup/commit/8f4ad4afccdbbf2429e2f91cb82439c9240f82ec))
|
|
48
|
+
* **project-cli-tools:** update dependency turbo to v2.10.4 ([#1345](https://github.com/fuf-stack/ts-project-setup/issues/1345)) ([2e7ea95](https://github.com/fuf-stack/ts-project-setup/commit/2e7ea95ad6a71955c03b2ace192a72c3bb5cb677))
|
|
49
|
+
* **project-cli-tools:** update dependency turbo to v2.9.14 ([#1265](https://github.com/fuf-stack/ts-project-setup/issues/1265)) ([aacf77a](https://github.com/fuf-stack/ts-project-setup/commit/aacf77ad729d6062d6ab9c9cb6298e1c921ba271))
|
|
50
|
+
* **project-cli-tools:** update lerna-lite monorepo to v5.2.2 ([#1281](https://github.com/fuf-stack/ts-project-setup/issues/1281)) ([6782302](https://github.com/fuf-stack/ts-project-setup/commit/6782302af830ec0548e30aee1c9137c65d863588))
|
|
51
|
+
* **project-cli-tools:** update lerna-lite monorepo to v5.3.0 ([#1297](https://github.com/fuf-stack/ts-project-setup/issues/1297)) ([33f9646](https://github.com/fuf-stack/ts-project-setup/commit/33f964669f0b06274e8a97e67660f34fa112d5ab))
|
|
52
|
+
* **project-cli-tools:** update lerna-lite monorepo to v5.4.0 ([#1340](https://github.com/fuf-stack/ts-project-setup/issues/1340)) ([ffe287a](https://github.com/fuf-stack/ts-project-setup/commit/ffe287af735ee3b12e577551f607540175858a5e))
|
|
53
|
+
* **project-cli-tools:** update turbo monorepo to v2.9.15 ([#1282](https://github.com/fuf-stack/ts-project-setup/issues/1282)) ([6ec14bf](https://github.com/fuf-stack/ts-project-setup/commit/6ec14bfd8f47e31251185c30b23ad862949d329f))
|
|
54
|
+
* **project-cli-tools:** update turbo monorepo to v2.9.16 ([#1288](https://github.com/fuf-stack/ts-project-setup/issues/1288)) ([2e1e9d3](https://github.com/fuf-stack/ts-project-setup/commit/2e1e9d3e8f8ea408493f9af705302f83424c8498))
|
|
55
|
+
* **project-cli-tools:** update turbo monorepo to v2.9.17 ([#1305](https://github.com/fuf-stack/ts-project-setup/issues/1305)) ([768bec7](https://github.com/fuf-stack/ts-project-setup/commit/768bec778e6de3bb6d4b8b8f5250114b69964e7f))
|
|
56
|
+
* **project-cli-tools:** update turbo monorepo to v2.9.18 ([#1309](https://github.com/fuf-stack/ts-project-setup/issues/1309)) ([d9d3d41](https://github.com/fuf-stack/ts-project-setup/commit/d9d3d41b42d537ac9581af995ad64b1f40482ad5))
|
|
57
|
+
|
|
6
58
|
## [1.0.20](https://github.com/fuf-stack/ts-project-setup/compare/project-cli-tools-v1.0.19...project-cli-tools-v1.0.20) (2026-05-19)
|
|
7
59
|
|
|
8
60
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuf-stack/project-cli-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"description": "shared cli tools commonly used in a Fröhlich ∧ Frei repo",
|
|
5
5
|
"author": "Fröhlich ∧ Frei",
|
|
6
6
|
"homepage": "https://github.com/fuf-stack/ts-project-setup#readme",
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
"url": "https://github.com/fuf-stack/ts-project-setup/issues"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@commitlint/cli": "21.
|
|
22
|
-
"@commitlint/config-conventional": "21.
|
|
23
|
-
"@commitlint/config-pnpm-scopes": "21.
|
|
21
|
+
"@commitlint/cli": "21.2.2",
|
|
22
|
+
"@commitlint/config-conventional": "21.2.2",
|
|
23
|
+
"@commitlint/config-pnpm-scopes": "21.2.2",
|
|
24
24
|
"@lerna-lite/cli": "5.2.1",
|
|
25
25
|
"@lerna-lite/list": "5.2.1",
|
|
26
26
|
"@lerna-lite/publish": "5.2.1",
|
|
27
27
|
"@lerna-lite/version": "5.2.1",
|
|
28
|
-
"commitizen": "4.3.
|
|
28
|
+
"commitizen": "4.3.2",
|
|
29
29
|
"husky": "9.1.7",
|
|
30
|
-
"lint-staged": "17.0
|
|
30
|
+
"lint-staged": "17.3.0",
|
|
31
31
|
"nodemon": "3.1.14",
|
|
32
|
-
"turbo": "2.
|
|
33
|
-
"wait-on": "9.0
|
|
32
|
+
"turbo": "2.10.11",
|
|
33
|
+
"wait-on": "9.1.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "c3633622fbb959d70a0d8cdadf3981b47ab757bd"
|
|
36
36
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
|
|
5
|
+
import { binaryPath, run } from './test-utils.js';
|
|
6
|
+
|
|
7
|
+
it('starts the bundled Commitizen executable', async () => {
|
|
8
|
+
const result = await run(binaryPath('commitizen'), []);
|
|
9
|
+
|
|
10
|
+
expect(result.stdout).toContain('Commitizen has two command line tools');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it.each(['cz', 'git-cz'])('links the interactive %s alias', async (alias) => {
|
|
14
|
+
// Running these aliases would open an interactive commit prompt. Comparing
|
|
15
|
+
// the pnpm shim targets verifies the package wiring without hanging CI.
|
|
16
|
+
const shim = await readFile(binaryPath(alias), 'utf8');
|
|
17
|
+
|
|
18
|
+
expect(shim).toContain('commitizen/bin/git-cz');
|
|
19
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { binaryPath, run, versionOutputPattern } from './test-utils.js';
|
|
4
|
+
|
|
5
|
+
it('starts the bundled Commitlint executable', async () => {
|
|
6
|
+
const result = await run(binaryPath('commitlint'), ['--version']);
|
|
7
|
+
|
|
8
|
+
expect(result.stdout.trim()).toMatch(versionOutputPattern);
|
|
9
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
|
|
6
|
+
import { binaryPath, run, withTemporaryDirectory } from './test-utils.js';
|
|
7
|
+
|
|
8
|
+
it('initializes hooks in a disposable Git repository', async () => {
|
|
9
|
+
await withTemporaryDirectory('project-cli-tools-husky-', async (root) => {
|
|
10
|
+
await writeFile(
|
|
11
|
+
path.join(root, 'package.json'),
|
|
12
|
+
`${JSON.stringify({ name: 'husky-fixture', private: true }, null, 2)}\n`,
|
|
13
|
+
);
|
|
14
|
+
await run('git', ['init', '--initial-branch=main'], root);
|
|
15
|
+
|
|
16
|
+
await run(binaryPath('husky'), ['init'], root);
|
|
17
|
+
|
|
18
|
+
await expect(
|
|
19
|
+
readFile(path.join(root, '.husky', 'pre-commit'), 'utf8'),
|
|
20
|
+
).resolves.toContain('npm test');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
|
|
6
|
+
import { binaryPath, run, withTemporaryDirectory } from './test-utils.js';
|
|
7
|
+
|
|
8
|
+
it('versions a package and renders its conventional changelog', async () => {
|
|
9
|
+
await withTemporaryDirectory('project-cli-tools-lerna-', async (root) => {
|
|
10
|
+
const workspace = path.join(root, 'packages', 'fixture');
|
|
11
|
+
await mkdir(workspace, { recursive: true });
|
|
12
|
+
await writeFile(
|
|
13
|
+
path.join(root, 'package.json'),
|
|
14
|
+
`${JSON.stringify(
|
|
15
|
+
{
|
|
16
|
+
name: 'lerna-release-fixture',
|
|
17
|
+
private: true,
|
|
18
|
+
workspaces: ['packages/*'],
|
|
19
|
+
},
|
|
20
|
+
null,
|
|
21
|
+
2,
|
|
22
|
+
)}\n`,
|
|
23
|
+
);
|
|
24
|
+
await writeFile(
|
|
25
|
+
path.join(root, 'lerna.json'),
|
|
26
|
+
`${JSON.stringify(
|
|
27
|
+
{
|
|
28
|
+
npmClient: 'pnpm',
|
|
29
|
+
packages: ['packages/*'],
|
|
30
|
+
version: '0.0.0',
|
|
31
|
+
},
|
|
32
|
+
null,
|
|
33
|
+
2,
|
|
34
|
+
)}\n`,
|
|
35
|
+
);
|
|
36
|
+
await writeFile(
|
|
37
|
+
path.join(workspace, 'package.json'),
|
|
38
|
+
`${JSON.stringify({ name: 'release-fixture', version: '0.0.0' }, null, 2)}\n`,
|
|
39
|
+
);
|
|
40
|
+
await writeFile(path.join(workspace, 'README.md'), 'Initial fixture.\n');
|
|
41
|
+
|
|
42
|
+
await run('git', ['init', '--initial-branch=main'], root);
|
|
43
|
+
await run('git', ['config', 'user.name', 'Release Fixture'], root);
|
|
44
|
+
await run('git', ['config', 'user.email', 'fixture@example.invalid'], root);
|
|
45
|
+
await run('git', ['add', '.'], root);
|
|
46
|
+
await run('git', ['commit', '-m', 'chore: initial fixture'], root);
|
|
47
|
+
await run('git', ['tag', 'v0.0.0'], root);
|
|
48
|
+
|
|
49
|
+
await writeFile(
|
|
50
|
+
path.join(workspace, 'README.md'),
|
|
51
|
+
'Release-worthy change.\n',
|
|
52
|
+
);
|
|
53
|
+
await run('git', ['add', '.'], root);
|
|
54
|
+
await run(
|
|
55
|
+
'git',
|
|
56
|
+
['commit', '-m', 'feat: exercise changelog rendering'],
|
|
57
|
+
root,
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
await run(
|
|
61
|
+
binaryPath('lerna'),
|
|
62
|
+
[
|
|
63
|
+
'version',
|
|
64
|
+
'--conventional-commits',
|
|
65
|
+
'--yes',
|
|
66
|
+
'--no-push',
|
|
67
|
+
'--no-git-tag-version',
|
|
68
|
+
'--allow-branch',
|
|
69
|
+
'main',
|
|
70
|
+
],
|
|
71
|
+
root,
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const manifest = JSON.parse(
|
|
75
|
+
await readFile(path.join(workspace, 'package.json'), 'utf8'),
|
|
76
|
+
) as { version: string };
|
|
77
|
+
const changelog = await readFile(
|
|
78
|
+
path.join(workspace, 'CHANGELOG.md'),
|
|
79
|
+
'utf8',
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
expect(manifest.version).toBe('0.1.0');
|
|
83
|
+
expect(changelog).toContain('Features');
|
|
84
|
+
expect(changelog).toContain('exercise changelog rendering');
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { binaryPath, run, versionOutputPattern } from './test-utils.js';
|
|
4
|
+
|
|
5
|
+
it('starts the bundled lint-staged executable', async () => {
|
|
6
|
+
const result = await run(binaryPath('lint-staged'), ['--version']);
|
|
7
|
+
|
|
8
|
+
expect(result.stdout.trim()).toMatch(versionOutputPattern);
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { binaryPath, run, versionOutputPattern } from './test-utils.js';
|
|
4
|
+
|
|
5
|
+
it('starts the bundled Nodemon executable', async () => {
|
|
6
|
+
const result = await run(binaryPath('nodemon'), ['--version']);
|
|
7
|
+
|
|
8
|
+
expect(result.stdout.trim()).toMatch(versionOutputPattern);
|
|
9
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { mkdtemp, rm } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { promisify } from 'node:util';
|
|
7
|
+
|
|
8
|
+
const execute = promisify(execFile);
|
|
9
|
+
const packageDirectory = path.resolve(
|
|
10
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
11
|
+
'..',
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export function binaryPath(name: string): string {
|
|
15
|
+
return path.join(packageDirectory, 'node_modules', '.bin', name);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Check CLI contracts without coupling tests to the currently pinned versions.
|
|
19
|
+
// Renovate upgrades should pass without requiring mechanical test edits.
|
|
20
|
+
export const versionOutputPattern =
|
|
21
|
+
/(?:^|@)v?\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u;
|
|
22
|
+
|
|
23
|
+
export async function run(
|
|
24
|
+
command: string,
|
|
25
|
+
arguments_: string[],
|
|
26
|
+
cwd = packageDirectory,
|
|
27
|
+
) {
|
|
28
|
+
return execute(command, arguments_, {
|
|
29
|
+
cwd,
|
|
30
|
+
encoding: 'utf8',
|
|
31
|
+
env: { ...process.env, CI: 'true' },
|
|
32
|
+
timeout: 15_000,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function withTemporaryDirectory<T>(
|
|
37
|
+
prefix: string,
|
|
38
|
+
callback: (directory: string) => Promise<T>,
|
|
39
|
+
): Promise<T> {
|
|
40
|
+
const directory = await mkdtemp(path.join(tmpdir(), prefix));
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
return await callback(directory);
|
|
44
|
+
} finally {
|
|
45
|
+
await rm(directory, { force: true, recursive: true });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { binaryPath, run, versionOutputPattern } from './test-utils.js';
|
|
4
|
+
|
|
5
|
+
it('starts the bundled Turbo executable', async () => {
|
|
6
|
+
const result = await run(binaryPath('turbo'), ['--version']);
|
|
7
|
+
|
|
8
|
+
expect(result.stdout.trim()).toMatch(versionOutputPattern);
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { binaryPath, run } from './test-utils.js';
|
|
4
|
+
|
|
5
|
+
it('starts the bundled wait-on executable', async () => {
|
|
6
|
+
const result = await run(binaryPath('wait-on'), ['--help']);
|
|
7
|
+
|
|
8
|
+
expect(result.stdout).toContain('Usage: wait-on');
|
|
9
|
+
});
|