Skip to content

Commit

Permalink
chore: update astro docs deps and add deprecation badges
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenbroekema committed Nov 29, 2024
1 parent ba66259 commit c80f112
Show file tree
Hide file tree
Showing 8 changed files with 1,238 additions and 735 deletions.
3 changes: 2 additions & 1 deletion docs/src/components/Head.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import Default from '@astrojs/starlight/components/Head.astro';
import type { Props } from '@astrojs/starlight/props';
---

<Default {...Astro.props}>
<slot />
</Default>
<script src="../setup"></script>
<script src="../setup"></script>
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
title: Tokens
---

import { Badge } from '@astrojs/starlight/components';

These utilities have to do with processing/formatting tokens.

## flattenTokens
## flattenTokens <Badge text="Deprecated" variant="danger" />

:::caution
Deprecated in favor of [`convertTokenData`](/reference/utils/tokens#converttokendata), see below
:::
> Deprecated in favor of [`convertTokenData`](/reference/utils/tokens#converttokendata), see below.
Flatten dictionary tokens object to an array of flattened tokens.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ sidebar:
order: 1
---

import { Badge } from '@astrojs/starlight/components';

## new StyleDictionary()

Create a new StyleDictionary instance.
Expand Down Expand Up @@ -204,7 +206,7 @@ type formatPlatform = (
| platform | `string` | Name of the platform you want to build. |
| opts | `{ cache?: boolean }` | `cache` prop determines whether or not it should reuse the cached tokens/config if they've already been processed earlier for this platform. `false` by default |

Runs [`getPlatform`](#getplatform) under the hood, and then loops over the `files`, and formats the dictionary for each file, returning an array of file objects:
Runs [`getPlatformTokens`](#getplatformtokens) under the hood, and then loops over the `files`, and formats the dictionary for each file, returning an array of file objects:

- `output` property, which is usually a string but depending on the format, it could also be any other data type. This is useful if you don't intend to write to a file, but want to do something else with the formatted tokens.
- `destination` property, this one is optional, if you don't intend on writing to a file you don't need this, but it can still be useful to name your outputs if you've got multiple `files`.
Expand Down Expand Up @@ -337,7 +339,9 @@ defined in the platform and calls the undo method on any actions.
- For `exportPlatform`, use `getPlatformTokens` instead, turning off the cache option if needed.
- For `getPlatform`, use `getPlatformConfig` insetad, turning off the cache option if needed.

### exportPlatform
### exportPlatform <Badge text="Deprecated" variant="danger" />

> Deprecated in favor of [`getPlatformTokens`](#getplatformtokens).
```ts
type exportPlatform = (platform: string, opts: { cache?: boolean }) => Promise<DesignTokens>;
Expand All @@ -354,7 +358,9 @@ This is useful if you want to use a Style Dictionary in JS build tools like Webp

---

### getPlatform
### getPlatform <Badge text="Deprecated" variant="danger" />

> Deprecated in favor of [`getPlatformConfig`](#getplatformconfig).
```ts
type getPlatform = (
Expand Down
1 change: 1 addition & 0 deletions lib/fs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-expect-error missing default export in type d file, but present in ESM entrypoint
import memfs from '@bundled-es-modules/memfs';

/**
Expand Down
Loading

0 comments on commit c80f112

Please sign in to comment.