0.0.1 • Published 1 year ago
@terrazzo/plugin-swift v0.0.1
⛋ @terrazzo/plugin-swift
Generate Swift code from DTCG tokens.
Setup
Requires Node.js 18 or later. With that installed, and a package.json, run:
npm i -D @terrazzo/cli @terrazzo/plugin-swiftAdd a terrazzo.config.js to the root of your project with:
import { defineConfig } from "@terrazzo/cli";
import swift from "@terrazzo/plugin-swift";
export default defineConfig({
outDir: "./tokens/",
plugins: [
swift({
catalogName: "Tokens",
}),
],
});Lastly, run:
npx tz buildAnd you’ll see a ./tokens/Tokens.xcassets catalog generated in your project. Import it into your project and you’ll have access to all your tokens!