Skip to content

Commit

Permalink
Feature: migrate skeleton 3 install spinner (#3150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugos68 authored Jan 23, 2025
1 parent 24049a2 commit f94cd6b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-hounds-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@skeletonlabs/skeleton-cli': patch
---

Feature (migrate/skeleton-3): Installing dependencies shows actual spinner.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ export default async function (options: MigrateOptions) {
return;
}

let theme: string | null = null;

// Migrate package.json
const packageSpinner = spinner();
packageSpinner.start(`Migrating ${pkg.name}...`);
Expand All @@ -80,6 +78,8 @@ export default async function (options: MigrateOptions) {
cli.error('Migration canceled, nothing written to disk');
}

let theme: string | null = null;

// Migrate tailwind config
const tailwindSpinner = spinner();
tailwindSpinner.start(`Migrating ${tailwindConfig.name}...`);
Expand Down
10 changes: 6 additions & 4 deletions packages/skeleton-cli/src/utility/install-dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { detect, resolveCommand } from 'package-manager-detector';
import { execSync } from 'node:child_process';
import child_process from 'node:child_process';
import { promisify } from 'node:util';

const exec = promisify(child_process.exec);

async function installDependencies(cwd = process.cwd()) {
const pm = await detect({
Expand All @@ -9,9 +12,8 @@ async function installDependencies(cwd = process.cwd()) {
if (!resolvedCommand) {
throw new Error('Could not resolve package manager command.');
}
execSync(`${resolvedCommand.command} ${resolvedCommand.args.join(' ')}`, {
cwd: cwd,
stdio: 'ignore'
return exec(`${resolvedCommand.command} ${resolvedCommand.args.join(' ')}`, {
cwd: cwd
});
}

Expand Down

0 comments on commit f94cd6b

Please sign in to comment.