mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-28 05:10:17 +08:00
28 lines
718 B
TypeScript
28 lines
718 B
TypeScript
import { pathExists } from 'fs-extra';
|
|
import { resolve } from 'path';
|
|
|
|
import { exec } from '../utils/exec';
|
|
import type { Task } from '../task';
|
|
|
|
const verdaccioCacheDir = resolve(__dirname, '../../.verdaccio-cache');
|
|
|
|
export const publish: Task = {
|
|
description: 'Publish the packages of the monorepo to an internal npm server',
|
|
dependsOn: ['compile'],
|
|
async ready() {
|
|
return pathExists(verdaccioCacheDir);
|
|
},
|
|
async run({ codeDir }, { dryRun, debug }) {
|
|
return exec(
|
|
'yarn local-registry --publish',
|
|
{ cwd: codeDir },
|
|
{
|
|
startMessage: '📕 Publishing packages',
|
|
errorMessage: '❌ Failed publishing packages',
|
|
dryRun,
|
|
debug,
|
|
}
|
|
);
|
|
},
|
|
};
|