sveltejs / sveltejs/kit

.d.ts without export

Open
#9,841 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

p3-edge-case pkg:svelte-package
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug
  1. When I run "package": "svelte-kit sync && svelte-package && publint",, some of export are not reflected in .d.ts file.

In typs.js

// ... more line
export type AuthFunctionType = () => Promise<void>;

export type ButtonType = 'button' | 'submit' | 'reset';

export type Buttontypes = 'blue' | 'blue-outline' | 'dark' | 'dark-outline' | 'light' | 'green' | 'green-outline' | 'red' | 'red-outline' | 'yellow' | 'yellow-outline' | 'purple' | 'purple-outline';

export type Buttonshadows = 'blue' | 'green' | 'cyan' | 'teal' | 'lime' | 'red' | 'pink' | 'purple';

export type CarouselIconType = {
	next: typeof SvelteComponent;
	prev: typeof SvelteComponent;
};

In types.d.ts

type AlignType = "text-center" | "text-left" | "text-right";
export interface AuthFieldType {
    label: string;
    fieldtype: string;
    required?: boolean | undefined;
    placeholder?: string | undefined;
}
type AuthFunctionType = () => Promise<void>;
type ButtonType = "reset" | "submit" | "button";
type Buttontypes = "red" | "yellow" | "green" | "purple" | "blue" | "light" | "dark" | "blue-outline" | "dark-outline" | "green-outline" | "red-outline" | "yellow-outline" | "purple-outline";
type Buttonshadows = "red" | "green" | "purple" | "pink" | "blue" | "cyan" | "teal" | "lime";
type CarouselIconType = {
    next: typeof SvelteComponentDev;
    prev: typeof SvelteComponentDev;
};
  1. SvelteComponent is changed to SvelteComponentDev

In types.js:

export type SidebarType = {
	id: number;
	name: string;
	href?: string;
	icon?: typeof SvelteComponent;
	iconSize?: number;
	iconClass?: string;
	iconColor?: string;
	rel?: string;
	children?: SidebarType[];
	subtext?: HTMLElement;
};

In types.d.ts

type SidebarType = {
    id: number;
    name: string;
    href?: string | undefined;
    icon?: typeof SvelteComponentDev | undefined;
    iconSize?: number | undefined;
    iconClass?: string | undefined;
    iconColor?: string | undefined;
    rel?: string | undefined;
    children?: SidebarType[] | undefined;
    subtext?: HTMLElement | undefined;
};
Reproduction
git clone git@github.com:themesberg/flowbite-svelte.git my-app
cd my-app
pnpm i
pnpm package

Compare dist/types.js and dist/types.d.ts

Logs

No response

System Info
N/A
Severity

annoyance

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in the flowbite-svelte project with pnpm i followed by pnpm package, then compare dist/types.js and dist/types.d.ts. Check why exported types are missing from the declaration output and why SvelteComponent becomes SvelteComponentDev; done means the generated declarations preserve the exports and component type shown in the source.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.