Skip to content

Commit

Permalink
Move design-tokens into @guardian/source (#1638)
Browse files Browse the repository at this point in the history
Co-authored-by: Joe Cowton <77005274+joecowton1@users.noreply.github.com>
Co-authored-by: Oliver Abrahams <ollie.abrahams@guardian.co.uk>
Co-authored-by: James Mockett <1166188+jamesmockett@users.noreply.github.com>
Co-authored-by: oliverabrahams <ollie.abrahams@guardian.co.uk>
  • Loading branch information
4 people authored Aug 14, 2024
1 parent 019b69a commit 69ecc3f
Show file tree
Hide file tree
Showing 51 changed files with 2,008 additions and 5,106 deletions.
7 changes: 7 additions & 0 deletions .changeset/silver-games-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@guardian/source': patch
---

Moves design tokens into `@guardian/source` itself.

Allows us to calculate `@guardian/source/foundations` values during build, rather than at the point of consumption, which relieves user's devices of this overhead and means the design tokens JSON will no longer be included in consumer's bundles.
24 changes: 4 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -269,22 +269,6 @@ install: check-node-version
@guardian/core-web-vitals\:verify-dist: env
@corepack pnpm --filter @guardian/core-web-vitals verify-dist

.PHONY: @guardian/design-tokens\:build
@guardian/design-tokens\:build: env
@corepack pnpm --filter @guardian/design-tokens build

.PHONY: @guardian/design-tokens\:fix
@guardian/design-tokens\:fix: env
@corepack pnpm --filter @guardian/design-tokens fix

.PHONY: @guardian/design-tokens\:lint
@guardian/design-tokens\:lint: env
@corepack pnpm --filter @guardian/design-tokens lint

.PHONY: @guardian/design-tokens\:tsc
@guardian/design-tokens\:tsc: env
@corepack pnpm --filter @guardian/design-tokens tsc

.PHONY: @guardian/eslint-config\:fix
@guardian/eslint-config\:fix: env
@corepack pnpm --filter @guardian/eslint-config fix
Expand Down Expand Up @@ -441,14 +425,14 @@ install: check-node-version
@guardian/source\:build: env
@corepack pnpm --filter @guardian/source build

.PHONY: @guardian/source\:build-generated
@guardian/source\:build-generated: env
@corepack pnpm --filter @guardian/source build-generated

.PHONY: @guardian/source\:build-storybook
@guardian/source\:build-storybook: env
@corepack pnpm --filter @guardian/source build-storybook

.PHONY: @guardian/source\:build-type-presets
@guardian/source\:build-type-presets: env
@corepack pnpm --filter @guardian/source build-type-presets

.PHONY: @guardian/source\:create-icons
@guardian/source\:create-icons: env
@corepack pnpm --filter @guardian/source create-icons
Expand Down
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@ Project-specific tasks are defined as `scripts` in their `package.json`, and can
- `make @guardian/core-web-vitals:tsc`
- `make @guardian/core-web-vitals:verify-dist`

#### @guardian/design-tokens

- `make @guardian/design-tokens:build`
- `make @guardian/design-tokens:fix`
- `make @guardian/design-tokens:lint`
- `make @guardian/design-tokens:tsc`

#### @guardian/eslint-config

- `make @guardian/eslint-config:fix`
Expand Down Expand Up @@ -185,8 +178,8 @@ Project-specific tasks are defined as `scripts` in their `package.json`, and can
#### @guardian/source

- `make @guardian/source:build`
- `make @guardian/source:build-generated`
- `make @guardian/source:build-storybook`
- `make @guardian/source:build-type-presets`
- `make @guardian/source:create-icons`
- `make @guardian/source:dev`
- `make @guardian/source:fix`
Expand Down
6 changes: 3 additions & 3 deletions configs/rollup/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { nodeExternals } from 'rollup-plugin-node-externals';
/** @type {Input} */
const defaultInput = { index: 'src/index.ts' };

/** @type {import("rollup").RollupOptions.output} */
/** @type {import("rollup").RollupOptions["output"]} */
const output = {
dir: 'dist',
format: 'esm',
Expand All @@ -31,8 +31,8 @@ const defaultPlugins = [

/**
* @param {object} param0
* @param {Plugins} param0.plugins
* @param {Input} param0.input
* @param {Plugins} [param0.plugins]
* @param {Input} [param0.input]
* @returns {import("rollup").RollupOptions[]}
*/
export default ({ input = defaultInput, plugins = [] } = {}) => [
Expand Down
23 changes: 0 additions & 23 deletions libs/@guardian/design-tokens/.eslintrc.cjs

This file was deleted.

7 changes: 0 additions & 7 deletions libs/@guardian/design-tokens/CHANGELOG.md

This file was deleted.

21 changes: 0 additions & 21 deletions libs/@guardian/design-tokens/README.md

This file was deleted.

Loading

0 comments on commit 69ecc3f

Please sign in to comment.