@interactivethings/scripts 2.0.0 → 2.0.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 +12 -14
- package/dist/cli.js +18 -9
- package/dist/config.js +22 -12
- package/dist/figma/cli.js +17 -7
- package/dist/figma/cli.test.js +17 -7
- package/dist/figma/images.js +17 -7
- package/dist/index.js +17 -7
- package/dist/init/cli.js +20 -12
- package/dist/tokens-studio/cli.js +42 -8
- package/dist/tokens-studio/cli.test.js +17 -7
- package/dist/tokens-studio/index.js +17 -7
- package/dist/vercel/deployments.js +1 -2
- package/package.json +2 -2
- package/dist/__tests__/figma-cli.test.js +0 -189
- package/dist/__tests__/tokens-studio-cli.test.js +0 -197
- package/dist/__tests__/vercel-cli.test.js +0 -86
- package/dist/cli.d.ts +0 -2
- package/dist/config.d.ts +0 -78
- package/dist/figma/api.d.ts +0 -71
- package/dist/figma/cli.d.ts +0 -20
- package/dist/figma/optimizeImage.js +0 -53
- package/dist/figma/utils.d.ts +0 -10
- package/dist/index.d.ts +0 -8
- package/dist/init/cli.d.ts +0 -3
- package/dist/mui-tokens-studio.js +0 -177
- package/dist/plugins/figma/index.js +0 -653
- package/dist/plugins/tokens-studio/utils.js +0 -155
- package/dist/tokens-studio/cli.d.ts +0 -8
- package/dist/tokens-studio/index.d.ts +0 -14
- package/dist/tokens-studio/mui.js +0 -212
- package/dist/tokens-studio/tailwind.js +0 -211
- package/dist/tokens-studio/utils.d.ts +0 -49
- package/dist/types.d.ts +0 -1
- package/dist/vercel/cli.d.ts +0 -4
- package/dist/vercel/waitForDeploymentReady.js +0 -43
- package/dist/wait-for-vercel-deploy.js +0 -79
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ export default defineConfig({
|
|
|
27
27
|
output: "src/assets/icons",
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
name: "illustrations",
|
|
30
|
+
name: "illustrations",
|
|
31
31
|
url: "https://www.figma.com/design/YOUR_FILE_ID/Design-System?node-id=789-012",
|
|
32
32
|
output: "src/assets/illustrations",
|
|
33
33
|
},
|
|
@@ -35,7 +35,7 @@ export default defineConfig({
|
|
|
35
35
|
},
|
|
36
36
|
tokensStudio: {
|
|
37
37
|
input: "./tokens",
|
|
38
|
-
output: "src/theme/tokens.json",
|
|
38
|
+
output: "src/theme/tokens.json",
|
|
39
39
|
handler: "./transforms/mui-transform.ts",
|
|
40
40
|
},
|
|
41
41
|
});
|
|
@@ -105,7 +105,7 @@ Download assets from Figma:
|
|
|
105
105
|
# Download all configured assets
|
|
106
106
|
ixt figma download
|
|
107
107
|
|
|
108
|
-
# Download specific asset collection
|
|
108
|
+
# Download specific asset collection
|
|
109
109
|
ixt figma download icons
|
|
110
110
|
|
|
111
111
|
# Get node information
|
|
@@ -113,7 +113,6 @@ ixt figma get "https://www.figma.com/design/..."
|
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
**Features:**
|
|
116
|
-
|
|
117
116
|
- Download SVG icons and optimize them
|
|
118
117
|
- Download assets exported from Figma
|
|
119
118
|
- Automatic asset optimization
|
|
@@ -136,10 +135,9 @@ ixt tokens-studio transform --handler ./custom-transform.ts --output theme.json
|
|
|
136
135
|
UI frameworks like MUI and Tailwind require variables in specific formats, while designers work with Figma Tokens. The `tokens-studio` tool bridges this gap by transforming design tokens into framework-compatible variables.
|
|
137
136
|
|
|
138
137
|
**Workflow:**
|
|
139
|
-
|
|
140
138
|
1. Designers create tokens in Figma
|
|
141
139
|
2. Designers export tokens using Tokens Studio plugin
|
|
142
|
-
3. Developers store token files in the code repository
|
|
140
|
+
3. Developers store token files in the code repository
|
|
143
141
|
4. Developers run `ixt tokens-studio transform` to convert tokens for their framework
|
|
144
142
|
|
|
145
143
|
### Vercel Commands
|
|
@@ -159,7 +157,7 @@ After transforming your design tokens, you can use them directly in your framewo
|
|
|
159
157
|
|
|
160
158
|
```typescript
|
|
161
159
|
// tailwind.config.ts
|
|
162
|
-
import theme from
|
|
160
|
+
import theme from 'src/theme/tokens.json'
|
|
163
161
|
|
|
164
162
|
export default {
|
|
165
163
|
darkMode: ["class"],
|
|
@@ -172,19 +170,19 @@ export default {
|
|
|
172
170
|
theme: {
|
|
173
171
|
extend: {
|
|
174
172
|
colors: {
|
|
175
|
-
...theme.colors
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
173
|
+
...theme.colors
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
180
178
|
```
|
|
181
179
|
|
|
182
180
|
### Material-UI (MUI)
|
|
183
181
|
|
|
184
182
|
```tsx
|
|
185
183
|
// theme.tsx
|
|
186
|
-
import { createTheme } from
|
|
187
|
-
import tokens from
|
|
184
|
+
import { createTheme } from '@mui/material/styles';
|
|
185
|
+
import tokens from 'src/theme/tokens.json';
|
|
188
186
|
|
|
189
187
|
export const theme = createTheme({
|
|
190
188
|
typography: {
|
package/dist/cli.js
CHANGED
|
@@ -16,15 +16,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
16
16
|
}) : function(o, v) {
|
|
17
17
|
o["default"] = v;
|
|
18
18
|
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
26
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.main =
|
|
37
|
+
exports.main = main;
|
|
28
38
|
const argparse_1 = require("argparse");
|
|
29
39
|
const env_1 = require("@next/env");
|
|
30
40
|
async function main() {
|
|
@@ -87,7 +97,6 @@ async function main() {
|
|
|
87
97
|
process.exit(1);
|
|
88
98
|
}
|
|
89
99
|
}
|
|
90
|
-
exports.main = main;
|
|
91
100
|
main().catch((err) => {
|
|
92
101
|
console.error(err);
|
|
93
102
|
process.exit(1);
|
package/dist/config.js
CHANGED
|
@@ -15,15 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
36
|
+
exports.IxtConfigSchema = exports.VercelConfigSchema = exports.TokensStudioConfigSchema = exports.FigmaConfigSchema = exports.FigmaAssetConfigSchema = void 0;
|
|
37
|
+
exports.defineConfig = defineConfig;
|
|
38
|
+
exports.loadConfig = loadConfig;
|
|
39
|
+
exports.mergeConfigWithArgs = mergeConfigWithArgs;
|
|
40
|
+
exports.validateRequiredConfig = validateRequiredConfig;
|
|
27
41
|
const fs = __importStar(require("fs/promises"));
|
|
28
42
|
const path = __importStar(require("path"));
|
|
29
43
|
const zod_1 = require("zod");
|
|
@@ -87,7 +101,6 @@ exports.IxtConfigSchema = zod_1.z.object({
|
|
|
87
101
|
function defineConfig(config) {
|
|
88
102
|
return exports.IxtConfigSchema.parse(config);
|
|
89
103
|
}
|
|
90
|
-
exports.defineConfig = defineConfig;
|
|
91
104
|
/**
|
|
92
105
|
* Default configuration values
|
|
93
106
|
*/
|
|
@@ -130,7 +143,6 @@ async function loadConfig(configPath) {
|
|
|
130
143
|
// No config file found, return default config
|
|
131
144
|
return DEFAULT_CONFIG;
|
|
132
145
|
}
|
|
133
|
-
exports.loadConfig = loadConfig;
|
|
134
146
|
/**
|
|
135
147
|
* Merge CLI arguments with configuration
|
|
136
148
|
* CLI arguments take precedence over config file values
|
|
@@ -143,7 +155,6 @@ function mergeConfigWithArgs(config, args, section) {
|
|
|
143
155
|
...Object.fromEntries(Object.entries(args).filter(([, value]) => value !== undefined)),
|
|
144
156
|
};
|
|
145
157
|
}
|
|
146
|
-
exports.mergeConfigWithArgs = mergeConfigWithArgs;
|
|
147
158
|
/**
|
|
148
159
|
* Validate that required values are present after merging config and args
|
|
149
160
|
*/
|
|
@@ -154,4 +165,3 @@ function validateRequiredConfig(mergedConfig, requiredFields) {
|
|
|
154
165
|
"Please provide these in your config file or via CLI arguments.");
|
|
155
166
|
}
|
|
156
167
|
}
|
|
157
|
-
exports.validateRequiredConfig = validateRequiredConfig;
|
package/dist/figma/cli.js
CHANGED
|
@@ -32,13 +32,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
32
32
|
}) : function(o, v) {
|
|
33
33
|
o["default"] = v;
|
|
34
34
|
});
|
|
35
|
-
var __importStar = (this && this.__importStar) || function (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
35
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
36
|
+
var ownKeys = function(o) {
|
|
37
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
38
|
+
var ar = [];
|
|
39
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
40
|
+
return ar;
|
|
41
|
+
};
|
|
42
|
+
return ownKeys(o);
|
|
43
|
+
};
|
|
44
|
+
return function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
42
52
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
43
53
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
44
54
|
};
|
package/dist/figma/cli.test.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
package/dist/figma/images.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.optimizeImage = void 0;
|
|
27
37
|
const child_process_1 = require("child_process");
|
package/dist/index.js
CHANGED
|
@@ -23,13 +23,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
23
23
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
24
24
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
25
25
|
};
|
|
26
|
-
var __importStar = (this && this.__importStar) || function (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
33
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
44
|
exports.tokensStudio = exports.defineConfig = void 0;
|
|
35
45
|
// Export commonly used types
|
package/dist/init/cli.js
CHANGED
|
@@ -15,18 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
39
|
+
exports.configParser = configParser;
|
|
40
|
+
exports.run = run;
|
|
30
41
|
const fs = __importStar(require("fs/promises"));
|
|
31
42
|
const path = __importStar(require("path"));
|
|
32
43
|
const prompts_1 = __importDefault(require("prompts"));
|
|
@@ -37,9 +48,7 @@ function configParser(parser) {
|
|
|
37
48
|
help: "Overwrite existing configuration files",
|
|
38
49
|
});
|
|
39
50
|
}
|
|
40
|
-
|
|
41
|
-
async function run(mainParser) {
|
|
42
|
-
const args = mainParser.parse_args();
|
|
51
|
+
async function run(args) {
|
|
43
52
|
console.log("🚀 Welcome to Interactive Things Scripts setup!\n");
|
|
44
53
|
console.log("This wizard will help you configure your project for optimal development workflow.\n");
|
|
45
54
|
// Check if config already exists
|
|
@@ -95,7 +104,6 @@ async function run(mainParser) {
|
|
|
95
104
|
throw error;
|
|
96
105
|
}
|
|
97
106
|
}
|
|
98
|
-
exports.run = run;
|
|
99
107
|
async function collectUserPreferences() {
|
|
100
108
|
const questions = [
|
|
101
109
|
{
|
|
@@ -20,13 +20,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
20
20
|
}) : function(o, v) {
|
|
21
21
|
o["default"] = v;
|
|
22
22
|
});
|
|
23
|
-
var __importStar = (this && this.__importStar) || function (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
30
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
41
|
exports.run = exports.configParser = void 0;
|
|
32
42
|
const fs = __importStar(require("fs"));
|
|
@@ -107,9 +117,10 @@ const run = async (args) => {
|
|
|
107
117
|
const transformInput = loadTokensFromDirectory(inputDir);
|
|
108
118
|
// Apply transformation
|
|
109
119
|
const result = transformerModule.transform(transformInput);
|
|
120
|
+
const resultSorted = sortKeysRecursively(result);
|
|
110
121
|
// Write output
|
|
111
122
|
const outputPath = path.resolve(mergedConfig.output);
|
|
112
|
-
fs.writeFileSync(outputPath, JSON.stringify(
|
|
123
|
+
fs.writeFileSync(outputPath, JSON.stringify(resultSorted, null, 2));
|
|
113
124
|
console.log(`✅ Transformation complete! Output written to: ${outputPath}`);
|
|
114
125
|
break;
|
|
115
126
|
default:
|
|
@@ -117,3 +128,26 @@ const run = async (args) => {
|
|
|
117
128
|
}
|
|
118
129
|
};
|
|
119
130
|
exports.run = run;
|
|
131
|
+
const sortKeysRecursively = (obj) => {
|
|
132
|
+
if (Array.isArray(obj)) {
|
|
133
|
+
return obj.map(sortKeysRecursively);
|
|
134
|
+
}
|
|
135
|
+
else if (obj !== null && typeof obj === "object") {
|
|
136
|
+
const sortedObj = {};
|
|
137
|
+
const sortedKeys = Object.keys(obj).sort((a, b) => {
|
|
138
|
+
// natural sort for numeric keys
|
|
139
|
+
const numA = parseFloat(a);
|
|
140
|
+
const numB = parseFloat(b);
|
|
141
|
+
if (!isNaN(numA) && !isNaN(numB)) {
|
|
142
|
+
return numA - numB;
|
|
143
|
+
}
|
|
144
|
+
return a.localeCompare(b);
|
|
145
|
+
});
|
|
146
|
+
sortedKeys.forEach((key) => {
|
|
147
|
+
const typedKey = key;
|
|
148
|
+
sortedObj[typedKey] = sortKeysRecursively(obj[typedKey]);
|
|
149
|
+
});
|
|
150
|
+
return sortedObj;
|
|
151
|
+
}
|
|
152
|
+
return obj;
|
|
153
|
+
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
const vitest_1 = require("vitest");
|
|
27
37
|
const fs = __importStar(require("fs"));
|
|
@@ -21,13 +21,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
21
21
|
}) : function(o, v) {
|
|
22
22
|
o["default"] = v;
|
|
23
23
|
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
31
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
42
|
exports.cli = exports.flattenTokens = exports.formatValues = exports.resolveReferences = exports.deepMerge = exports.isToken = exports.maybeParseToPx = exports.maybeParseToNumber = exports.mapEntries = exports.kebabCase = exports.simplifyValues = void 0;
|
|
33
43
|
// Export all utility functions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.waitForDeploymentReady =
|
|
3
|
+
exports.waitForDeploymentReady = waitForDeploymentReady;
|
|
4
4
|
async function fetchDeploymentForCommit(commitSha, teamId, projectId, accessToken) {
|
|
5
5
|
try {
|
|
6
6
|
const response = await fetch(`https://vercel.com/api/v6/deployments?limit=20&projectId=${projectId}&state=READY,ERROR,BUILDING,QUEUED&teamId=${teamId}`, {
|
|
@@ -39,4 +39,3 @@ async function waitForDeploymentReady({ team, project, commitSha, interval, time
|
|
|
39
39
|
throw new Error("Timeout for waitForDeploymentReady");
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
exports.waitForDeploymentReady = waitForDeploymentReady;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interactivethings/scripts",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@types/prompts": "^2.4.9",
|
|
57
57
|
"jscodeshift": "^0.15.1",
|
|
58
58
|
"oxlint": "^1.19.0",
|
|
59
|
-
"typescript": "^5.
|
|
59
|
+
"typescript": "^5.9.3",
|
|
60
60
|
"vitest": "^0.34.6"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|