Merge branch 'next' into kasper/csf-factories

This commit is contained in:
Yann Braga 2025-02-05 17:25:56 +01:00
commit 39deab4e32
2 changed files with 9 additions and 5 deletions

View File

@ -86,10 +86,6 @@ export const link = async ({ target, local, start }: LinkOptions) => {
reproDir = join(reprosDir, reproName);
}
const reproPackageJson = JSON.parse(
await readFile(join(reproDir, 'package.json'), { encoding: 'utf8' })
);
const version = spawnSync('yarn', ['--version'], {
cwd: reproDir,
stdio: 'pipe',
@ -109,6 +105,10 @@ export const link = async ({ target, local, start }: LinkOptions) => {
logger.info(`Installing ${reproName}`);
const reproPackageJson = JSON.parse(
await readFile(join(reproDir, 'package.json'), { encoding: 'utf8' })
);
if (!reproPackageJson.devDependencies?.vite) {
reproPackageJson.devDependencies = {
...reproPackageJson.devDependencies,

View File

@ -1,3 +1,5 @@
import path from 'node:path';
import dirSize from 'fast-folder-size';
// eslint-disable-next-line depend/ban-dependencies
import { pathExists, remove } from 'fs-extra';
@ -49,7 +51,8 @@ export const sandbox: Task = {
options.link = false;
}
if (await this.ready(details, options)) {
if (!(await this.ready(details, options))) {
logger.info('🗑 Removing old sandbox dir');
await remove(details.sandboxDir);
}
@ -150,6 +153,7 @@ export const sandbox: Task = {
const packageManager = JsPackageManagerFactory.getPackageManager({}, details.sandboxDir);
await remove(path.join(details.sandboxDir, 'node_modules'));
await packageManager.installDependencies();
await runMigrations(details, options);