Skip to content

Commit a971acc

Browse files
committed
ci: fix types of publish worker script
1 parent 2fc1bd1 commit a971acc

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

lage.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ const config = {
5050
dependsOn: ['^publish'],
5151
type: 'worker',
5252
options: {
53-
worker: 'scripts/src/worker/publish.js',
53+
worker: 'scripts/src/worker/publish.mts',
5454
},
5555
cache: false,
5656
},
5757
'publish-dry-run': {
5858
dependsOn: ['^publish-dry-run'],
5959
type: 'worker',
6060
options: {
61-
worker: 'scripts/src/worker/publish.js',
61+
worker: 'scripts/src/worker/publish.mts',
6262
dryRun: true,
6363
},
6464
cache: false,
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
// @ts-check
1+
import type { WorkerRunnerFunction } from 'lage';
22

33
import { $, fs } from 'zx';
44
import { join } from 'node:path';
55

6-
/**
7-
* @param {{ target: { cwd: string; label: string }, options: { dryRun?: boolean } }} data
8-
*/
9-
export async function run({ target, options }) {
6+
export const run: WorkerRunnerFunction = async ({ target }) => {
107
const pkg = await fs.readJson(join(target.cwd, 'package.json'));
118

129
if (pkg.private) {
1310
return;
1411
}
1512

16-
const dryRun = options?.dryRun ?? false;
13+
const dryRun = target.options?.dryRun ?? false;
1714
const args = ['--tolerate-republish', ...(dryRun ? ['--dry-run'] : [])];
1815

1916
await $({ cwd: target.cwd, verbose: true })`yarn npm publish ${args}`;
20-
}
17+
};

0 commit comments

Comments
 (0)