Skip to content

Commit

Permalink
feat: short description for each add-on (#299)
Browse files Browse the repository at this point in the history
* feat: short description for each add-on

* add addon template

* make description optional

* Update packages/addons/lucia/index.ts

Co-authored-by: Victor Zhivotikov <[email protected]>

* tweak separator

* tweak separator

* changeset

---------

Co-authored-by: Manuel Serret <[email protected]>
Co-authored-by: Victor Zhivotikov <[email protected]>
Co-authored-by: AdrianGonz97 <[email protected]>
  • Loading branch information
4 people authored Nov 22, 2024
1 parent 0bc0a7c commit 7aa4f07
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silver-pianos-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'sv': patch
---

feat: add short descriptions for each add-on
1 change: 1 addition & 0 deletions packages/addons/drizzle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const options = defineAddonOptions({

export default defineAddon({
id: 'drizzle',
shortDescription: 'database orm',
homepage: 'https://orm.drizzle.team',
options,
setup: ({ kit, unsupported }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/addons/eslint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { parseJson, parseScript } from '@sveltejs/cli-core/parsers';

export default defineAddon({
id: 'eslint',
shortDescription: 'linter',
homepage: 'https://eslint.org',
options: {},
run: ({ sv, typescript, dependencyVersion }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/addons/lucia/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const options = defineAddonOptions({

export default defineAddon({
id: 'lucia',
shortDescription: 'auth guide',
homepage: 'https://lucia-auth.com',
options,
setup: ({ kit, dependencyVersion, unsupported, dependsOn }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/addons/mdsvex/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { parseScript } from '@sveltejs/cli-core/parsers';

export default defineAddon({
id: 'mdsvex',
shortDescription: 'svelte + markdown',
homepage: 'https://mdsvex.pngwn.io',
options: {},
run: ({ sv }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/addons/paraglide/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const options = defineAddonOptions({

export default defineAddon({
id: 'paraglide',
shortDescription: 'i18n',
homepage: 'https://inlang.com',
options,
setup: ({ kit, unsupported }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/addons/playwright/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { parseJson, parseScript } from '@sveltejs/cli-core/parsers';

export default defineAddon({
id: 'playwright',
shortDescription: 'browser testing',
homepage: 'https://playwright.dev',
options: {},
run: ({ sv, typescript }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/addons/prettier/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { parseJson } from '@sveltejs/cli-core/parsers';

export default defineAddon({
id: 'prettier',
shortDescription: 'formatter',
homepage: 'https://prettier.io',
options: {},
run: ({ sv, dependencyVersion }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/addons/storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineAddon } from '@sveltejs/cli-core';

export default defineAddon({
id: 'storybook',
shortDescription: 'frontend workshop',
homepage: 'https://storybook.js.org',
options: {},
run: async ({ sv }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/addons/tailwindcss/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const options = defineAddonOptions({
export default defineAddon({
id: 'tailwindcss',
alias: 'tailwind',
shortDescription: 'css framework',
homepage: 'https://tailwindcss.com',
options,
run: ({ sv, options, typescript, kit, dependencyVersion }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/addons/vitest-addon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { parseJson, parseScript } from '@sveltejs/cli-core/parsers';

export default defineAddon({
id: 'vitest',
shortDescription: 'unit testing',
homepage: 'https://vitest.dev',
options: {},
run: ({ sv, typescript }) => {
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/commands/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ export async function runAddCommand(
const addonOptions = officialAddons
// only display supported addons relative to the current environment
.filter(({ id }) => addonSetupResults[id].unsupported.length === 0)
.map(({ id, homepage }) => ({ label: id, value: id, hint: homepage }));
.map(({ id, homepage, shortDescription }) => ({
label: id,
value: id,
hint: `${shortDescription} - ${homepage}`
}));

const selected = await p.multiselect({
message: `What would you like to add to your project? ${pc.dim('(use arrow keys / space bar)')}`,
Expand Down
1 change: 1 addition & 0 deletions packages/core/addon/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type SvApi = {
export type Addon<Args extends OptionDefinition> = {
id: string;
alias?: string;
shortDescription?: string;
homepage?: string;
options: Args;
setup?: (
Expand Down

0 comments on commit 7aa4f07

Please sign in to comment.