@interactivethings/scripts 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -26
- package/dist/init/cli.js +9 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -69,32 +69,6 @@ ixt-scripts uses a unified configuration system with a single `ixt.config.ts` fi
|
|
|
69
69
|
|
|
70
70
|
For detailed configuration options and schema reference, see [CONFIG.md](./CONFIG.md).
|
|
71
71
|
|
|
72
|
-
## Creating Custom Transformers
|
|
73
|
-
|
|
74
|
-
You can create custom transformers for the tokens-studio command:
|
|
75
|
-
|
|
76
|
-
```typescript
|
|
77
|
-
// transforms/my-transform.ts
|
|
78
|
-
export function transform(input: { metadata: any; tokenData: any }) {
|
|
79
|
-
// Transform the tokens to your desired format
|
|
80
|
-
return {
|
|
81
|
-
colors: transformColors(input.tokenData.colors),
|
|
82
|
-
typography: transformTypography(input.tokenData.typography),
|
|
83
|
-
// ... other transformations
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Then reference it in your config:
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
export default defineConfig({
|
|
92
|
-
tokensStudio: {
|
|
93
|
-
handler: "./transforms/my-transform.ts",
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
```
|
|
97
|
-
|
|
98
72
|
## Available Commands
|
|
99
73
|
|
|
100
74
|
### Figma Commands
|
|
@@ -140,6 +114,32 @@ UI frameworks like MUI and Tailwind require variables in specific formats, while
|
|
|
140
114
|
3. Developers store token files in the code repository
|
|
141
115
|
4. Developers run `ixt tokens-studio transform` to convert tokens for their framework
|
|
142
116
|
|
|
117
|
+
#### Creating Custom Transformers
|
|
118
|
+
|
|
119
|
+
You can create custom transformers for the tokens-studio command:
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
// transforms/my-transform.ts
|
|
123
|
+
export function transform(input: { metadata: any; tokenData: any }) {
|
|
124
|
+
// Transform the tokens to your desired format
|
|
125
|
+
return {
|
|
126
|
+
colors: transformColors(input.tokenData.colors),
|
|
127
|
+
typography: transformTypography(input.tokenData.typography),
|
|
128
|
+
// ... other transformations
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Then reference it in your config:
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
export default defineConfig({
|
|
137
|
+
tokensStudio: {
|
|
138
|
+
handler: "./transforms/my-transform.ts",
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
143
|
### Vercel Commands
|
|
144
144
|
|
|
145
145
|
Utilities for Vercel deployments:
|
package/dist/init/cli.js
CHANGED
|
@@ -282,6 +282,15 @@ async function createProjectStructure(answers) {
|
|
|
282
282
|
const outputDir = path.dirname(path.join(cwd, answers.tokensOutputFile));
|
|
283
283
|
await fs.mkdir(outputDir, { recursive: true });
|
|
284
284
|
}
|
|
285
|
+
if (answers.stylingFramework === "mui") {
|
|
286
|
+
await fs.cp(path.join(__dirname, "../../examples/mui-transform.ts"), path.join(transformsDir, "mui-transform.ts"));
|
|
287
|
+
}
|
|
288
|
+
else if (answers.stylingFramework === "tailwind") {
|
|
289
|
+
await fs.cp(path.join(__dirname, "../../examples/tailwind-transform.ts"), path.join(transformsDir, "tailwind-transform.ts"));
|
|
290
|
+
}
|
|
291
|
+
else if (answers.stylingFramework === "custom") {
|
|
292
|
+
await fs.cp(path.join(__dirname, "../../examples/custom-transform.ts"), path.join(transformsDir, "custom-transform.ts"));
|
|
293
|
+
}
|
|
285
294
|
}
|
|
286
295
|
// Create assets directories if using Figma
|
|
287
296
|
if (answers.useFigma && answers.figmaAssets) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interactivethings/scripts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@next/env": "^15.5.4",
|
|
43
43
|
"argparse": "^2.0.1",
|
|
44
|
+
"bottleneck": "^2.19.5",
|
|
44
45
|
"jiti": "^2.6.1",
|
|
45
46
|
"ora": "^9.0.0",
|
|
46
47
|
"prompts": "^2.4.2",
|