@designid/tokens 1.1.2 → 1.2.0

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/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "@designid/tokens",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "author": "Isa Ozler",
5
5
  "packageManager": "bun@1.2.16",
6
6
  "license": "Apache-2.0",
7
7
  "scripts": {
8
8
  "prebuild": "bun install",
9
- "build": "bun run src/cli/build-tokens.ts",
10
- "build:cli": "bun run scripts/build-cli.ts",
9
+ "build": "bun src/cli/build-tokens.ts",
10
+ "build:cli": "bun ./scripts/build-cli.ts",
11
11
  "lint": "bun run lint:prettier && bun run lint:fix",
12
12
  "lint:prettier": "prettier --write \"./**/*.tokens.json\"",
13
13
  "lint:fix": "eslint src --ext .ts,.tokens.json --fix",
14
14
  "prepare": "husky || true",
15
- "prepack": "bun run build:cli"
15
+ "prepack": "bun run build:cli",
16
+ "editor:server": "bun src/editor/server.ts",
17
+ "editor:open": "open http://localhost:4000"
16
18
  },
17
19
  "dependencies": {
18
20
  "chokidar": "^3.5.3",
@@ -22,6 +24,7 @@
22
24
  },
23
25
  "devDependencies": {
24
26
  "@eslint/js": "^9.27.0",
27
+ "@types/bun": "^1.3.1",
25
28
  "@types/lodash": "^4.17.17",
26
29
  "@types/node": "^22.15.30",
27
30
  "@typescript-eslint/eslint-plugin": "^8.32.1",
@@ -36,7 +39,6 @@
36
39
  "husky": "^9.1.7",
37
40
  "jiti": "^2.4.2",
38
41
  "prettier": "3.5.3",
39
- "svelte": "^5.34.1",
40
42
  "ts-node": "^10.9.2",
41
43
  "typescript": "^5.8.3",
42
44
  "typescript-eslint": "^8.32.1"
@@ -64,11 +66,13 @@
64
66
  "README.md",
65
67
  "bin/build.js",
66
68
  "bin/watch.js",
69
+ "bin/editor.js",
67
70
  "types"
68
71
  ],
69
72
  "bin": {
70
73
  "tokens-build": "./bin/build.js",
71
- "tokens-watch": "./bin/watch.js"
74
+ "tokens-watch": "./bin/watch.js",
75
+ "tokens-editor": "./bin/editor.js"
72
76
  },
73
77
  "exports": {
74
78
  ".": {
package/types/files.d.ts CHANGED
@@ -55,6 +55,7 @@ export type TConfigFile = {
55
55
  baseDir: string;
56
56
  buildDir: string;
57
57
  tokensDir: string;
58
+ compositionsDir?: string;
58
59
  distDir: string;
59
60
  assets?: {
60
61
  icons?: {
@@ -95,6 +96,13 @@ export type TConfigFile = {
95
96
  tokenNamespace: string;
96
97
  dsNamespace?: string;
97
98
  fontNamespace?: `${string}-${string}-${string}` | string;
99
+ editor?: {
100
+ enabled: boolean;
101
+ port?: number;
102
+ };
103
+ modes?: {
104
+ isHost: boolean;
105
+ };
98
106
  icons?: TConfigMetaDataIcons;
99
107
  tokens?: {
100
108
  /**
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Platform Compositions Type Definitions
3
+ *
4
+ * Platform compositions map design tokens to CSS/platform-specific properties
5
+ * to generate complete style definitions for components.
6
+ *
7
+ * Note: This is different from token composition types (which combine multiple token values).
8
+ * Platform compositions are component-level style definitions that reference tokens.
9
+ */
10
+
11
+ /**
12
+ * A platform composition maps design tokens to specific properties
13
+ * for generating platform-specific styles (CSS, iOS, Android, Flutter)
14
+ */
15
+ export interface PlatformComposition {
16
+ /** Unique identifier for the composition */
17
+ id: string;
18
+
19
+ /** Human-readable name */
20
+ name: string;
21
+
22
+ /** CSS selector or platform-specific target */
23
+ selector: string;
24
+
25
+ /** Target platform for output generation */
26
+ platform: 'css' | 'ios' | 'android' | 'flutter';
27
+
28
+ /** Optional custom file path for export (e.g., 'button' or 'input/button') */
29
+ fileName?: string;
30
+
31
+ /** Property-to-token mappings */
32
+ properties: Array<{
33
+ /** CSS property or platform-specific property name */
34
+ property: string;
35
+
36
+ /** Token reference (e.g., '{foundation.color.primary}') */
37
+ token: string;
38
+ }>;
39
+ }
40
+
41
+ /**
42
+ * Collection of platform compositions
43
+ */
44
+ export type PlatformCompositions = PlatformComposition[];