Skip to content

Releases: carbon-design-system/sveld

v0.13.1

22 Jan 20:45
Compare
Choose a tag to compare

Fixes

    • return original entry point instead of resolved path in getSvelteEntry (47bd04a)

v0.13.0

22 Jan 20:40
Compare
Choose a tag to compare

Features

  • export sveld for programmatic usage (6782da6, #66)
  • upgrade prettier, rollup, svelte, svelte-preprocess, typescript (1c8366a)

v0.12.1

21 Jan 03:14
Compare
Choose a tag to compare
  • include @default annotation for undefined prop values (i.e., let prop1; let prop2 = undefined) (146ebc9, #64)

    Input

    <script>
      /** @type {boolean} */
      export let prop;
    </script>

    Output

    export interface InputProps {
      /**
      * @default undefined
      */
      prop?: boolean;
    }

v0.12.0

02 Jan 19:33
Compare
Choose a tag to compare

Features

  • support props defined via renamed exports (31aec44, #62 contributed by @aabounegm)

    Input:

    <script>
      let className = "test";
    
      /**
       * Just your average CSS class string.
       * @type {string|null}
       */
      export { className as class };
    </script>

    Output:

    /// <reference types="svelte" />
    import { SvelteComponentTyped } from "svelte";
    
    export interface InputProps {
      /**
       * Just your average CSS class string.
       * @default "test"
       */
      class?: string | null;
    }
    
    export default class Input extends SvelteComponentTyped<InputProps, {}, {}> {}

v0.11.1

31 Dec 16:30
Compare
Choose a tag to compare

Fixes

  • replace backslashes with forward slashes in filePath values (73d899a, #60 contributed by @brunnerh)

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