Skip to content

Commit cda9ae1

Browse files
committed
feat: ensure volumes are removed on cleanup, upgrade deps
1 parent c93408b commit cda9ae1

File tree

9 files changed

+4245
-3344
lines changed

9 files changed

+4245
-3344
lines changed

.mdeprc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
test_framework: 'c8 node --test',
88
tests: '__tests__/*.js',
99
auto_compose: true,
10-
node: '20.10',
10+
node: '20',
1111
tester_flavour: 'chrome-tester',
1212
services: [
1313
'redisSentinel',

.semaphore/semaphore.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ global_job_config:
1717
prologue:
1818
commands:
1919
- set -e
20-
- sem-version node 20.10
20+
- sem-version node 20
2121
- corepack enable
22-
- corepack install --global pnpm@8.x
22+
- corepack install --global pnpm@9.x
2323
- checkout
2424
- cache restore node-$(checksum pnpm-lock.yaml)
2525
- pnpm i --prefer-offline

__tests__/install.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe('(pnpm) test installing the package', () => {
158158
test('returns current node version in module', async () => {
159159
process.chdir(cwd);
160160
const { stdout } = await execa('mdep', ['get-config', '--path', 'node'], { buffer: true });
161-
assert.equal(stdout, '20.10');
161+
assert.equal(stdout, '20');
162162
});
163163
});
164164

bin/cli.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const configExplorer = cosmiconfig('mdep', { searchStrategy: 'project' });
2222
const configResult = await configExplorer.search();
2323
const config = configResult !== null && !configResult.isEmpty ? configResult.config : {};
2424

25-
yargs(hideBin(process.argv))
25+
await yargs(hideBin(process.argv))
2626
.version(false)
2727
.command(binCommand)
2828
.command(dockerCommand)
@@ -76,4 +76,4 @@ yargs(hideBin(process.argv))
7676
.config(config)
7777
.help()
7878
.strict()
79-
.parse();
79+
.parseAsync();

bin/cmds/test_cmds/auto-compose.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ async function tester(compose, argv) {
2727
ports: [],
2828
command: defaultCmd,
2929
}, argv.extras.tester);
30+
3031
const workingDir = testerConfig.working_dir;
3132
// eslint-disable-next-line no-template-curly-in-string
3233
const sourceDir = argv.mutagenDir || '${PWD}';
@@ -186,7 +187,6 @@ export const handler = async (argv) => {
186187

187188
// Header of the file
188189
const compose = {};
189-
compose.version = argv.acv;
190190
compose.networks = {};
191191
compose.services = {};
192192
compose.volumes = {};

bin/cmds/test_cmds/compose.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@ export const handler = async (argv) => {
2323
npmPath.set();
2424

2525
// verify if we have compose or not
26-
const [docker, dockerComposeBin, mutagen] = await Promise.all([
26+
const [docker, mutagen] = await Promise.all([
2727
which('docker'),
28-
which('docker-compose'),
2928
which('mutagen-compose'),
3029
]);
3130

3231
if (!docker) {
3332
throw new Error('docker must be installed, can\'t find it with `which`');
3433
}
3534

36-
const compose = mutagen || dockerComposeBin || docker;
35+
const compose = mutagen || docker;
3736
const composeArgs = compose === docker ? ['compose'] : [];
3837
const originalDockerCompose = argv.docker_compose;
3938
const dockerComposeFiles = [];
@@ -95,7 +94,7 @@ export const handler = async (argv) => {
9594
$({ stdio: 'inherit' }).sync`${argv.on_fail}`;
9695
}
9796

98-
const cleanup = argv.mutagenVolumeExternal ? ['down'] : ['down', '-v'];
97+
const cleanup = ['down', '-v'];
9998
if (argv.no_cleanup !== true && argv.onlyPrepare !== true) {
10099
console.log(`\nAutomatically cleaning up after ${signal}\n`);
101100
$({ reject: false, stdio: 'inherit' }).sync`${argv.compose} ${argv.composeArgs} ${cleanup} --remove-orphans`;

bin/cmds/test_cmds/run.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { handler as handlerCompose } from './compose.js';
2020
const pipeline = promisify(_pipeline);
2121
const debug = _debug('test');
2222

23-
const execAsync = (cmd, args, opts) => $(opts)`${cmd} ${args}`;
23+
const execAsync = (cmd, args, opts = {}) => $(opts)`${cmd} ${args}`;
2424
const echoAndExec = (cmd, args = [], { buffer = false, all = true, ...rest } = {}) => {
2525
console.log(cmd, ...args);
2626
if (!buffer && all) {

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"test:http": "./bin/cli.mjs test run --http",
1515
"test:exec": "./bin/cli.mjs test run",
1616
"semantic-release": "semantic-release",
17-
"prepare": "husky install"
17+
"prepare": "husky"
1818
},
1919
"publishConfig": {
2020
"access": "public"
@@ -24,46 +24,46 @@
2424
},
2525
"type": "module",
2626
"devDependencies": {
27-
"c8": "^9.0.0",
28-
"eslint": "^8.56.0",
27+
"c8": "^10.1.2",
28+
"eslint": "^8.57.1",
2929
"eslint-config-makeomatic": "^6.0.0",
30-
"eslint-plugin-import": "^2.29.1",
31-
"eslint-plugin-promise": "^6.1.1",
32-
"eslint-plugin-unicorn": "^50.0.1",
33-
"typescript": "^5.3.3"
30+
"eslint-plugin-import": "^2.30.0",
31+
"eslint-plugin-promise": "^6.6.0",
32+
"eslint-plugin-unicorn": "^55.0.0",
33+
"typescript": "^5.6.2"
3434
},
3535
"dependencies": {
36-
"@commitlint/cli": "^18.4.4",
37-
"@fastify/compress": "^6.5.0",
38-
"@sinclair/typebox": "^0.32.5",
39-
"@types/node": "^20.10.7",
40-
"chrome-launcher": "^1.1.0",
41-
"chrome-remote-interface": "^0.33.0",
36+
"@commitlint/cli": "^19.5.0",
37+
"@fastify/compress": "^8.0.1",
38+
"@sinclair/typebox": "^0.33.12",
39+
"@types/node": "^22.6.1",
40+
"chrome-launcher": "^1.1.2",
41+
"chrome-remote-interface": "^0.33.2",
4242
"cosmiconfig": "^9.0.0",
4343
"death": "^1.1.0",
44-
"debug": "^4.3.4",
45-
"execa": "^8.0.1",
46-
"fastify": "^4.25.2",
47-
"get-port": "^7.0.0",
48-
"glob": "^10.3.10",
49-
"husky": "~8.0.3",
50-
"hyperid": "^3.1.1",
44+
"debug": "^4.3.7",
45+
"execa": "^9.4.0",
46+
"fastify": "^5.0.0",
47+
"get-port": "^7.1.0",
48+
"glob": "^11.0.0",
49+
"husky": "~9.1.6",
50+
"hyperid": "^3.3.0",
5151
"is": "^3.3.0",
5252
"js-yaml": "^4.1.0",
5353
"lodash.get": "^4.4.2",
5454
"lodash.merge": "^4.6.2",
5555
"lodash.set": "^4.3.2",
5656
"npm-path": "^2.0.4",
57-
"p-limit": "^5.0.0",
58-
"pino": "^8.17.2",
57+
"p-limit": "^6.1.0",
58+
"pino": "^9.4.0",
5959
"read-pkg": "^9.0.1",
60-
"rimraf": "^5.0.5",
61-
"semantic-release": "22.0.12",
60+
"rimraf": "^6.0.1",
61+
"semantic-release": "24.1.1",
6262
"serialize-error": "^11.0.3",
6363
"split2": "^4.2.0",
6464
"strip-final-newline": "^4.0.0",
6565
"tempy": "^3.1.0",
66-
"undici": "^6.3.0",
66+
"undici": "^6.19.8",
6767
"yargs": "^17.7.2"
6868
},
6969
"bin": {

0 commit comments

Comments
 (0)