Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
undo and use simple type
  • Loading branch information
AdrianGonz97 committed Sep 27, 2025
commit b8a217408ed6c93e7c78b94e19d95ae6c8cb6ddc
21 changes: 18 additions & 3 deletions packages/addons/_config/official.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AddonWithoutExplicitArgs } from '@sveltejs/cli-core';
import type { Addon, AddonWithoutExplicitArgs } from '@sveltejs/cli-core';

import devtoolsJson from '../devtools-json/index.ts';
import drizzle from '../drizzle/index.ts';
Expand All @@ -13,9 +13,24 @@ import sveltekitAdapter from '../sveltekit-adapter/index.ts';
import tailwindcss from '../tailwindcss/index.ts';
import vitest from '../vitest-addon/index.ts';

type OfficialAddons = {
prettier: Addon<any>;
eslint: Addon<any>;
vitest: Addon<any>;
playwright: Addon<any>;
tailwindcss: Addon<any>;
sveltekitAdapter: Addon<any>;
devtoolsJson: Addon<any>;
drizzle: Addon<any>;
lucia: Addon<any>;
mdsvex: Addon<any>;
paraglide: Addon<any>;
storybook: Addon<any>;
};

// The order of addons here determines the order they are displayed inside the CLI
// We generally try to order them by perceived popularity
export const officialAddons = {
export const officialAddons: OfficialAddons = {
prettier,
eslint,
vitest,
Expand All @@ -28,7 +43,7 @@ export const officialAddons = {
mdsvex,
paraglide,
storybook
} as const;
};

export function getAddonDetails(id: string): AddonWithoutExplicitArgs {
const details = Object.values(officialAddons).find((a) => a.id === id);
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/lib/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
// "checkJs": false,
// "isolatedDeclarations": true,
"checkJs": false,
"isolatedDeclarations": true,
"declaration": true
},
// we'll only want to enforce `isolatedDeclarations` on the library portion of the CLI
Expand Down
11 changes: 3 additions & 8 deletions tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,23 @@ export default defineConfig({
entry: ['lib/index.ts', 'lib/testing.ts', 'bin.ts'],
sourcemap: !process.env.CI,
dts: {
oxc: false,
oxc: true,
// setting `resolve: true` seems to anger Rolldown due to our `postcss` dep
resolve: Object.keys(pkg.devDependencies)
},
plugins: [
{
name: 'evaluate-community-addon-ids',
transform: {
filter: {
id: /_config[/\\]community\.ts$/
},
filter: { id: /_config[/\\]community\.ts$/ },
handler(code, id) {
const ms = new MagicString(code, { filename: id });
const start = code.indexOf('export const communityAddonIds');
const end = code.indexOf(';', start);
const ids = fs.readdirSync('community-addons').map((p) => path.parse(p).name);
const generated = `export const communityAddonIds = ${JSON.stringify(ids)}`;
ms.overwrite(start, end, generated);
return {
code: ms.toString(),
map: ms.generateMap()
};
return { code: ms.toString(), map: ms.generateMap() };
}
}
}
Expand Down
Loading