Skip to content

Migrate tokens#2532

Open
joyenjoyer wants to merge 3 commits intomasterfrom
migrate_tokens
Open

Migrate tokens#2532
joyenjoyer wants to merge 3 commits intomasterfrom
migrate_tokens

Conversation

@joyenjoyer
Copy link
Copy Markdown
Contributor

@joyenjoyer joyenjoyer commented Apr 29, 2026

PLEASE DON'T MERGE IT, WE ARE WAITING FOR DESIGNERS TO FINISH TOKENS CHANGES ON A SEPARATE BRANCH AND PERSONAL ACCESS TOKEN APPROVAL FOR SERVICE ACCOUNT

Summary

  • Moves Token Studio JSON files out of ui-scripts into the external @instructure/instructure-design-tokens package and consumes them via its published API
  • Refactors build-themes, setupThemes, and generateSemantics to work natively with the nested token object instead of a flat slash-keyed map, TS typing can be improved later
  • Converts the three files from JavaScript to TypeScript

Test Plan

To verify the new pipeline produces identical output to the old one:

  • Checkout master, run pnpm run build:themes, copy the output: cp -r packages/ui-themes/src/themes/newThemeTokens /tmp/newThemeTokens-master
  • Checkout this branch, run pnpm install && pnpm run build:themes
  • Diff the outputs: diff -r /tmp/newThemeTokens-master packages/ui-themes/src/themes/newThemeTokens/ — should be empty
  • Run pnpm run bootstrap and confirm no TypeScript errors

Jira Reference

Fixes INSTUI-5002

🤖 Generated with Claude Code

@joyenjoyer joyenjoyer self-assigned this Apr 29, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2532/

Built to branch gh-pages at 2026-04-29 11:58 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@joyenjoyer joyenjoyer requested review from HerrTopi and matyasf April 29, 2026 10:08
Copy link
Copy Markdown
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some small changes

Comment thread packages/ui-scripts/lib/build/buildThemes/setupThemes.ts
const __dirname = dirname(__filename)
// @ts-ignore -- package ships JS source without type declarations
import { themeTokens } from '@instructure/instructure-design-tokens'
import setupThemes from './buildThemes/setupThemes.ts'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line raises a TS error for me:
TS5097: An import path can only end with a .ts extension when allowImportingTsExtensions is enabled.

@joyenjoyer joyenjoyer requested a review from matyasf April 29, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants