Skip to content

Commit cb797cb

Browse files
committed
feat(tokens): export json, remove duplicate file generation
1 parent 88bfc5b commit cb797cb

23 files changed

+67
-10823
lines changed

.changeset/mean-adults-scream.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@spectrum-css/tokens": minor
3+
---
4+
5+
Add JSON to token package exports.
6+
7+
Remove CSS files from commit history (but continue to build and ship them in the releases).
8+
9+
Stop physically copying the `dist/css/index.css` to `dist/index.css` and instead, map `dist/index.css` in the package exports to the same `dist/css/index.css` file.

.github/workflows/compare-results.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
components/card/dist/index.css
132132
components/icon/dist/index.css
133133
components/sidenav/dist/index.css
134-
tokens/dist/index.css
134+
tokens/dist/css/index.css
135135
node_modules/diff2html/bundles/css/diff2html.min.css
136136
node_modules/diff2html/bundles/js/diff2html.min.js
137137

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dist
22
!dist/metadata.json
3-
!tokens/dist/**
3+
!tokens/dist/json/*
44

55
# Not committing the map assets, these are dev-only
66
*.map

.storybook/blocks/ThemeContainer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ThemeProvider } from "@storybook/theming";
33
import React, { useContext } from "react";
44
import { Container } from "./Layouts.jsx";
55

6-
import tokenStyles from "@spectrum-css/tokens/dist/index.css?raw";
6+
import tokenStyles from "@spectrum-css/tokens/dist/css/index.css?raw";
77

88
/**
99
* A container that wraps the children in a themed context

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@
101101
}
102102
],
103103
"cssVariables.lookupFiles": [
104-
"${workspaceFolder}/tokens/dist/index.css",
105-
"${workspaceFolder}/tokens/**/*.css",
104+
"${workspaceFolder}/tokens/dist/css/index.css",
105+
"${workspaceFolder}/tokens/dist/css/*.css",
106106
"${workspaceFolder}/components/*/index.css",
107107
"${workspaceFolder}/components/*/themes/*.css"
108108
],

postcss.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports = ({
4848
const filePath = packageParts.length > 2 ? packageParts.slice(2).join("/") : "index.css";
4949

5050
if (packageParts[1] === "tokens") {
51-
return join(__dirname, packageParts[1], "dist", filePath);
51+
return join(__dirname, packageParts[1], "dist", "css", filePath);
5252
}
5353

5454
return join(__dirname, "components", packageParts[1], filePath);

tasks/templates/compare-listing.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<link rel="stylesheet" type="text/css" href="{{ "../components/icon/dist/index.css" | safe }}"/>
1818
<link rel="stylesheet" type="text/css" href="{{ "../components/sidenav/dist/index.css" | safe }}"/>
1919

20-
<link rel="stylesheet" type="text/css" href="{{ "../tokens/dist/index.css" | safe }}"/>
20+
<link rel="stylesheet" type="text/css" href="{{ "../tokens/dist/css/index.css" | safe }}"/>
2121

2222
<style>
2323
body {

tasks/templates/diff-preview.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="stylesheet" type="text/css" href="{{ "../../../components/sidenav/dist/index.css" | safe }}"/>
1414
<link rel="stylesheet" type="text/css" href="{{ "../../../components/divider/dist/index.css" | safe }}"/>
1515

16-
<link rel="stylesheet" type="text/css" href="{{ "../../../tokens/dist/index.css" | safe }}"/>
16+
<link rel="stylesheet" type="text/css" href="{{ "../../../tokens/dist/css/index.css" | safe }}"/>
1717

1818
<!-- CSS to render the diff2html code -->
1919
<link rel="stylesheet" type="text/css" href="{{ "../../../node_modules/diff2html/bundles/css/diff2html.min.css" | safe }}" />

tokens/dist/css/dark-vars.css

Lines changed: 0 additions & 842 deletions
This file was deleted.

tokens/dist/css/global-vars.css

Lines changed: 0 additions & 669 deletions
This file was deleted.

0 commit comments

Comments
 (0)