Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a task queue loading spinner #27

Merged
merged 3 commits into from
Dec 18, 2023
Merged

Adds a task queue loading spinner #27

merged 3 commits into from
Dec 18, 2023

Conversation

natemoo-re
Copy link
Member

A community member is working on a create-astro PR that defers all async actions until after the complete user input has been collected. This requires a new UI since the original loading animation was designed for a single blocking task rather than a queue of tasks.

CleanShot.2023-12-18.at.14.02.27.mp4

Usage

import { tasks } from '@astrojs/cli-kit';

const queue = [
	{
		pending: 'Task 1',
		start: 'Task 1 initializing',
		end: 'Task 1 completed',
		while: () => someAsyncAction()
	},
	// ... and so on
]

const labels = {
	start: 'Initializing project...', 
	end: 'Project initialized!'
};

await tasks(labels, queue)

Copy link

changeset-bot bot commented Dec 18, 2023

🦋 Changeset detected

Latest commit: fbec51e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/cli-kit Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a professional in CLIs, but it looks great to me!

@natemoo-re natemoo-re merged commit c12279b into main Dec 18, 2023
1 check passed
@natemoo-re natemoo-re deleted the feat/queue branch December 18, 2023 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants