Skip to content

Releases: carbon-design-system/sveld

v0.11.0

16 Dec 21:33
Compare
Choose a tag to compare

Features

  • support writing <!-- @component --> comments in Svelte components to TypeScript definitions

    Input:

    <!-- @component
    @example
    <Button>
      Text
    </Button>
    -->
    <button>
      <slot />
    </button>

    Output:

    /**
     * @example
     * <Button>
     *   Text
     * </Button>
     */
    export default class Button extends SvelteComponentTyped<ButtonProps, {}, { default: {} }> {}

v0.10.2

29 Aug 19:19
Compare
Choose a tag to compare

Fixes

  • tolerate slot spread syntax (<slot {...props} />) when parsing Svelte components

Note: the parser will not attempt to infer the type of spread attributes. Add a JSDoc notation if spreading an object to a slot:

<script>
  /** @slot {{ a: number; }} */

  const props = {
    a: 4,
  };
</script>

<slot {...props} />

v0.10.1

29 Aug 02:25
Compare
Choose a tag to compare
  • include .svelte extension in index.d.ts exports

v0.10.0

29 Aug 02:00
Compare
Choose a tag to compare
  • use .svelte.d.ts for Svelte files in type definitions to enable direct imports
- Button.d.ts
+ Button.svelte.d.ts
<script lang="ts">
  import Button from "<package-name>/src/Button.svelte";
</script>

v0.9.0

29 Aug 01:34
Compare
Choose a tag to compare
  • omit @constant, @default notations for component accessors

v0.8.3

29 Jul 11:46
Compare
Choose a tag to compare
  • replace backslashes with slashes on Windows when reading Svelte files using the glob method (PR #39, contributed by @berndfuhrmann)

v0.8.2

11 Jul 14:05
Compare
Choose a tag to compare
  • write constant props as accessors in the SvelteComponentTyped interface

v0.8.1

10 Jul 15:26
Compare
Choose a tag to compare
  • type function declarations as accessors in the SvelteComponentTyped interface
  • omit module name from generated TypeScript class if it's the reserved keyword "default"
  • move typescript to direct dependencies

v0.8.0

17 Jun 12:01
Compare
Choose a tag to compare

Features

  • use svelte-preprocess to preprocess TypeScript in Svelte files and remove style blocks (e8885b9, #31 contributed by @jelib3an)

Fixes

v0.7.1

20 Feb 13:10
Compare
Choose a tag to compare