@stratixlabs/core 1.7.1 → 1.7.2

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 CHANGED
@@ -1,16 +1,16 @@
1
- # Substrata
1
+ # Stratix
2
2
 
3
- Substrata is a framework-agnostic **design infrastructure** for tokens, schemas, and automation that transforms design decisions into **semantic contracts**. It serves as a stable foundation for semantic design governance, enabling automation, consistency, and long-term resilience across any platform or tech stack.
3
+ Stratix is a framework-agnostic **design infrastructure** for tokens, schemas, and automation that transforms design decisions into **semantic contracts**. It serves as a stable foundation for semantic design governance, enabling automation, consistency, and long-term resilience across any platform or tech stack.
4
4
 
5
- Unlike a UI library that couples design to components, Substrata provides the low-level *definitions* (design tokens and their canonical graph) that drive the UI, ensuring design intent is preserved from design tools to production code—even as frameworks change.
5
+ Unlike a UI library that couples design to components, Stratix provides the low-level *definitions* (design tokens and their canonical graph) that drive the UI, ensuring design intent is preserved from design tools to production code—even as frameworks change.
6
6
 
7
- **[Documentation](https://mikaelcarrara.github.io/substrata)**
7
+ **[Documentation](https://github.com/mikaelcarrara/stratix)**
8
8
 
9
9
  ---
10
10
 
11
11
  ## Philosophy
12
12
 
13
- Substrata is guided by a core set of architectural principles: tokens are the atomic foundation of design; infrastructure must outlive frameworks; and a single source of truth prevents divergence. We design for durability and longevity, achieving consistency through architecture, not discipline. Our focus is on defining the foundation, not the final UI surfaces.
13
+ Stratix is guided by a core set of architectural principles: tokens are the atomic foundation of design; infrastructure must outlive frameworks; and a single source of truth prevents divergence. We design for durability and longevity, achieving consistency through architecture, not discipline. Our focus is on defining the foundation, not the final UI surfaces.
14
14
 
15
15
  See our policies on [**Governance**](./GOVERNANCE.md) and [**Contributing**](./CONTRIBUTING.md).
16
16
 
@@ -18,7 +18,7 @@ See our policies on [**Governance**](./GOVERNANCE.md) and [**Contributing**](./C
18
18
 
19
19
  ## Architecture
20
20
 
21
- Substrata is architected as a system of independent layers. Each layer encapsulates a distinct responsibility and can evolve independently, enabling long-term scalability, resilience, and architectural clarity.
21
+ Stratix is architected as a system of independent layers. Each layer encapsulates a distinct responsibility and can evolve independently, enabling long-term scalability, resilience, and architectural clarity.
22
22
 
23
23
  1. **Tokens**: Define design decisions as CSS Variables—colors, spacing, typography, and core primitives. They are semantic, stable, versionable, and platform-agnostic.
24
24
  2. **Base Styles**: Apply tokens to native HTML elements, establishing predictable defaults and consistent rendering without adding abstractions or components.
@@ -30,11 +30,11 @@ This layered approach ensures that the core design system remains decoupled from
30
30
 
31
31
  ## W3C Alignment
32
32
 
33
- Substrata implements the "Source of Truth" layer in the W3C reference architecture:
33
+ Stratix implements the "Source of Truth" layer in the W3C reference architecture:
34
34
 
35
35
  1. **Definition**: Design intent defined in design tools (e.g., Figma).
36
36
  2. **Transformation**: Raw data processed into usable artifacts.
37
- 3. **Source of Truth (Substrata)**: The detailed, versioned, and semantic definition of all tokens (CSS variables, JSON).
37
+ 3. **Source of Truth (Stratix)**: The detailed, versioned, and semantic definition of all tokens (CSS variables, JSON).
38
38
  4. **Consumption**: Applications (React, Vue, iOS, Android) consuming these tokens.
39
39
 
40
40
  Read more in [W3C Alignment](./docs/w3c-alignment.html).
@@ -43,35 +43,35 @@ Read more in [W3C Alignment](./docs/w3c-alignment.html).
43
43
 
44
44
  ## Choose Your Path
45
45
 
46
- Substrata is designed to be used in three distinct ways depending on your goal.
46
+ Stratix is designed to be used in three distinct ways depending on your goal.
47
47
 
48
48
  | Path | Goal | Installation | Tool |
49
49
  | :--- | :--- | :--- | :--- |
50
- | **1. Consumer** | Use default tokens in your app | `npm install @stratixlabs/core` | NPM |
51
- | **2. Author** | Manage your own design system | `npx @stratixlabs/core init` | CLI (NPX) |
52
- | **3. Contributor** | Modify Substrata core/docs | `git clone ...` | Git |
50
+ | **1. Consumer** | Use default tokens in your app | `npm install @stratixlabs/core` | NPM |
51
+ | **2. Author** | Manage your own design system | `npx @stratixlabs/core init` | CLI (NPX) |
52
+ | **3. Contributor** | Modify Stratix core/docs | `git clone ...` | Git |
53
53
 
54
54
  ---
55
55
 
56
56
  ### Path 1: Consumer (Recommended)
57
- Best for developers who want to use the official Substrata tokens (colors, spacing, etc.) in their project.
57
+ Best for developers who want to use the official Stratix tokens (colors, spacing, etc.) in their project.
58
58
 
59
59
  ```bash
60
- npm install @stratixlabs/core
60
+ npm install @stratixlabs/core
61
61
  ```
62
- *See [Getting Started](https://mikaelcarrara.github.io/substrata/getting-started) for importing CSS/JSON.*
62
+ *See Getting Started for importing CSS/JSON.*
63
63
 
64
64
  ### Path 2: Author & Automation
65
- Best for architects building a custom design system using Substrata as the engine.
65
+ Best for architects building a custom design system using Stratix as the engine.
66
66
 
67
67
  `init` scaffolds a **complete, production-ready** system:
68
68
 
69
69
  **📦 Generated Structure:**
70
- - `substrata.config.js` - Configuration file
70
+ - `stratix.config.js` - Configuration file
71
71
  - `src/tokens/` - **9 token files** (colors, spacing, typography, radius-and-borders, elevation, motion, opacity, breakpoints, semantic-aliases)
72
72
  - `src/consumption/` - **3 framework examples** (Tailwind, styled-components, plain CSS)
73
73
  - `scripts/` - Automation scripts (generate, validate, lint, breaking-change detection, token-aware code lint)
74
- - `src/substrata.css` - Main entry point (imports all tokens)
74
+ - `src/stratix.css` - Main entry point (imports all tokens)
75
75
  - `src/base.css` - Typography reset and base styles
76
76
 
77
77
  **📜 NPM Scripts Added:**
@@ -83,7 +83,7 @@ Best for architects building a custom design system using Substrata as the engin
83
83
 
84
84
  ```bash
85
85
  # Set up complete design system infrastructure
86
- npx @stratixlabs/core init
86
+ npx stratix init
87
87
 
88
88
  # Generate tokens.json
89
89
  npm run build:tokens
@@ -92,16 +92,16 @@ npm run build:tokens
92
92
  npm run test:tokens
93
93
  ```
94
94
 
95
- Then import `src/substrata.css` in your app. Check `src/consumption/` for framework-specific integration examples.
95
+ Then import `src/stratix.css` in your app. Check `src/consumption/` for framework-specific integration examples.
96
96
 
97
- *See [Authoring & Automation](https://mikaelcarrara.github.io/substrata/automation) for detailed guide.*
97
+ *See Authoring & Automation for detailed guide.*
98
98
 
99
99
  ### Path 3: Contributor
100
- Best for those who want to improve Substrata itself or host their own fork.
100
+ Best for those who want to improve Stratix itself or host their own fork.
101
101
 
102
102
  ```bash
103
- git clone https://github.com/mikaelcarrara/substrata.git
104
- cd substrata
103
+ git clone https://github.com/mikaelcarrara/stratix.git
104
+ cd stratix
105
105
  npm install
106
106
  npm run build:tokens
107
107
  ```
@@ -111,39 +111,39 @@ npm run build:tokens
111
111
  Clone or download from GitHub:
112
112
 
113
113
  ```bash
114
- git clone https://github.com/mikaelcarrara/substrata.git
114
+ git clone https://github.com/mikaelcarrara/stratix.git
115
115
  ```
116
116
 
117
117
  Or download directly and include in your project.
118
118
 
119
119
  ## Usage
120
120
 
121
- Substrata is designed to be consumed, not imposed. You can use it in multiple ways:
121
+ Stratix is designed to be consumed, not imposed. You can use it in multiple ways:
122
122
 
123
123
  ### 1. Plain CSS
124
124
  Import the full system or valid subsets from the package:
125
125
  ```css
126
126
  /* Import everything */
127
- @import "@stratixlabs/core/substrata.css";
127
+ @import "@stratixlabs/core/stratix.css";
128
128
 
129
129
  /* Or just tokens */
130
- @import "@stratixlabs/core/src/tokens/colors.css";
130
+ @import "@stratixlabs/core/src/tokens/colors.css";
131
131
  ```
132
132
 
133
133
  ### 2. Tailwind CSS
134
- Substrata feeds Tailwind. It does not replace it.
134
+ Stratix feeds Tailwind. It does not replace it.
135
135
  ```css
136
- @import "@stratixlabs/core/substrata.css";
136
+ @import "@stratixlabs/core/stratix.css";
137
137
  @tailwind base;
138
138
  @tailwind components;
139
139
  @tailwind utilities;
140
140
  ```
141
- *See the [Next.js + Tailwind Quickstart](https://mikaelcarrara.github.io/substrata/getting-started#quickstart-next-tailwind) for a full app example, and [Consumption Strategies](./docs/consumption.html) for `tailwind.config.js` mapping.*
141
+ *See the Next.js + Tailwind Quickstart for a full app example, and [Consumption Strategies](./docs/consumption.html) for `tailwind.config.js` mapping.*
142
142
 
143
143
  ### 3. JavaScript / TypeScript
144
144
  Import tokens as a JSON object:
145
145
  ```js
146
- import tokens from '@stratixlabs/core';
146
+ import tokens from '@stratixlabs/core';
147
147
 
148
148
  const Button = styled.button`
149
149
  padding: ${tokens.space[3].value} ${tokens.space[4].value};
@@ -156,7 +156,7 @@ const Button = styled.button`
156
156
 
157
157
  ## Documentation
158
158
 
159
- Full documentation is available online. Key sections include [**Getting Started**](https://mikaelcarrara.github.io/substrata/getting-started), the [**Tokens Reference**](https://mikaelcarrara.github.io/substrata/tokens), [**Consumption Strategies**](https://mikaelcarrara.github.io/substrata/consumption), and guides on [**Automation**](https://mikaelcarrara.github.io/substrata/automation).
159
+ Full documentation is available online. Key sections include [**Getting Started**](https://mikaelcarrara.github.io/Stratix/getting-started), the [**Tokens Reference**](https://mikaelcarrara.github.io/Stratix/tokens), [**Consumption Strategies**](https://mikaelcarrara.github.io/Stratix/consumption), and guides on [**Automation**](https://mikaelcarrara.github.io/Stratix/automation).
160
160
 
161
161
  ---
162
162
 
@@ -181,11 +181,11 @@ These aliases help preserve intent across frameworks and refactors.
181
181
 
182
182
  ## Core Artifacts
183
183
 
184
- Substrata's architecture is defined by a few key artifacts that enable its semantic power:
184
+ Stratix's architecture is defined by a few key artifacts that enable its semantic power:
185
185
 
186
186
  - **`tokens.json`**: The canonical source of truth, containing all design tokens in a structured, machine-readable format.
187
187
  - **JSON Schema**: A strict schema for `tokens.json` that enables validation, IDE autocompletion, and automated CI checks.
188
- - **`substrata.d.ts`**: TypeScript declarations for type-safe token consumption in modern development workflows.
188
+ - **`stratix.d.ts`**: TypeScript declarations for type-safe token consumption in modern development workflows.
189
189
 
190
190
  See the [**ROADMAP.md**](./ROADMAP.md) and [**ARCHITECTURE.md**](./ARCHITECTURE.md) for more details on our architectural evolution.
191
191
 
@@ -193,35 +193,35 @@ See the [**ROADMAP.md**](./ROADMAP.md) and [**ARCHITECTURE.md**](./ARCHITECTURE.
193
193
 
194
194
  ## Tooling & Scripts
195
195
 
196
- - [detect-breaking-changes.js](file:///c:/Users/Usuario/Desktop/substrata/scripts/detect-breaking-changes.js)
196
+ - [detect-breaking-changes.js](file:///c:/Users/Usuario/Desktop/Stratix/scripts/detect-breaking-changes.js)
197
197
  - What it does: Detects when tokens are removed or renamed
198
198
  - Foundation: Basic validation, table stakes
199
199
 
200
- - [figma-sync.js](file:///c:/Users/Usuario/Desktop/substrata/scripts/figma-sync.js)
200
+ - [figma-sync.js](file:///c:/Users/Usuario/Desktop/Stratix/scripts/figma-sync.js)
201
201
  - What it does: Pull/push tokens to/from Figma
202
202
  - Foundation: The design ↔ code bridge you want standard
203
203
 
204
- - [generate-dts-from-tokens.js](file:///c:/Users/Usuario/Desktop/substrata/scripts/generate-dts-from-tokens.js)
204
+ - [generate-dts-from-tokens.js](file:///c:/Users/Usuario/Desktop/Stratix/scripts/generate-dts-from-tokens.js)
205
205
  - What it does: Generates TypeScript definitions
206
206
  - Why core: Basic DX expected in modern libraries
207
207
 
208
- - [generate-tokens.js](file:///c:/Users/Usuario/Desktop/substrata/scripts/generate-tokens.js)
208
+ - [generate-tokens.js](file:///c:/Users/Usuario/Desktop/Stratix/scripts/generate-tokens.js)
209
209
  - What it does: CSS → tokens.json
210
210
  - Foundation: Fundamental build pipeline
211
211
 
212
- - [lint-code.js](file:///c:/Users/Usuario/Desktop/substrata/scripts/lint-code.js)
212
+ - [lint-code.js](file:///c:/Users/Usuario/Desktop/Stratix/scripts/lint-code.js)
213
213
  - What it does: Detects hardcoded values in code
214
214
  - Foundation: Basic linting is expected
215
215
 
216
- - [lint-hardcoded.js](file:///c:/Users/Usuario/Desktop/substrata/scripts/lint-hardcoded.js)
216
+ - [lint-hardcoded.js](file:///c:/Users/Usuario/Desktop/Stratix/scripts/lint-hardcoded.js)
217
217
  - What it does: Similar, detects hardcoded values
218
218
  - Foundation: Basic quality tooling
219
219
 
220
- - [tokens-to-css.js](file:///c:/Users/Usuario/Desktop/substrata/scripts/tokens-to-css.js)
220
+ - [tokens-to-css.js](file:///c:/Users/Usuario/Desktop/Stratix/scripts/tokens-to-css.js)
221
221
  - What it does: tokens.json → CSS variables
222
222
  - Foundation: The bidirectional loop you promised
223
223
 
224
- - [validate-tokens.js](file:///c:/Users/Usuario/Desktop/substrata/scripts/validate-tokens.js)
224
+ - [validate-tokens.js](file:///c:/Users/Usuario/Desktop/Stratix/scripts/validate-tokens.js)
225
225
  - What it does: Validates tokens.json against schema
226
226
  - Foundation: Validation is fundamental
227
227
 
@@ -233,7 +233,7 @@ See the [**ROADMAP.md**](./ROADMAP.md) and [**ARCHITECTURE.md**](./ARCHITECTURE.
233
233
  npm run detect:breaking
234
234
  npm run sync:figma
235
235
  FIGMA_SYNC_DIRECTION=push npm run sync:figma
236
- FIGMA_TOKEN=... FIGMA_FILE_KEY=... npx @stratixlabs/core figma apply-preview
236
+ FIGMA_TOKEN=... FIGMA_FILE_KEY=... npx stratix figma apply-preview
237
237
  npm run build:types
238
238
  npm run build:tokens
239
239
  npm run lint:code
@@ -247,3 +247,4 @@ npm run test:tokens
247
247
  ## License
248
248
 
249
249
  MIT © 2026 Mikael Carrara
250
+
@@ -7,19 +7,19 @@ const args = process.argv.slice(2);
7
7
  const command = args[0];
8
8
 
9
9
  if (!command || (command !== 'init' && command !== 'generate' && command !== 'figma')) {
10
- console.log('Usage: @stratixlabs/core <command>');
10
+ console.log('Usage: stratix <command>');
11
11
  console.log('Commands:');
12
- console.log(' init Initialize a complete Substrata project with tokens, scripts, and examples');
12
+ console.log(' init Initialize a complete Stratix project with tokens, scripts, and examples');
13
13
  console.log(' generate Generate tokens.json from source');
14
14
  console.log(' figma Figma-related automation (sync, apply-preview)');
15
15
  process.exit(1);
16
16
  }
17
17
 
18
18
  if (command === 'init') {
19
- console.log('🚀 Initializing Substrata...\n');
19
+ console.log('🚀 Initializing Stratix...\n');
20
20
 
21
21
  const cwd = process.cwd();
22
- const configPath = path.join(cwd, 'substrata.config.js');
22
+ const configPath = path.join(cwd, 'stratix.config.js');
23
23
  const tokensDir = path.join(cwd, 'src/tokens');
24
24
  const consumptionDir = path.join(cwd, 'src/consumption');
25
25
  const scriptsDir = path.join(cwd, 'scripts');
@@ -27,7 +27,7 @@ if (command === 'init') {
27
27
 
28
28
  // 1. Create config file
29
29
  if (fs.existsSync(configPath)) {
30
- console.log('⚠️ substrata.config.js already exists.');
30
+ console.log('⚠️ stratix.config.js already exists.');
31
31
  } else {
32
32
  const defaultConfig = `module.exports = {
33
33
  tokens: './src/tokens',
@@ -35,7 +35,7 @@ if (command === 'init') {
35
35
  };
36
36
  `;
37
37
  fs.writeFileSync(configPath, defaultConfig);
38
- console.log('✅ Created substrata.config.js');
38
+ console.log('✅ Created stratix.config.js');
39
39
  }
40
40
 
41
41
  // 2. Create directory structure
@@ -217,9 +217,9 @@ if (command === 'init') {
217
217
  }
218
218
  }
219
219
 
220
- // 4. Create substrata.css (imports all tokens)
221
- const substrataCssPath = path.join(srcDir, 'substrata.css');
222
- const substrataCss = `@import "tokens/typography.css";
220
+ // 4. Create stratix.css (imports all tokens)
221
+ const stratixCssPath = path.join(srcDir, 'stratix.css');
222
+ const stratixCss = `@import "tokens/typography.css";
223
223
  @import "tokens/spacing.css";
224
224
  @import "tokens/colors.css";
225
225
  @import "tokens/radius-and-borders.css";
@@ -231,10 +231,10 @@ if (command === 'init') {
231
231
 
232
232
  @import "./base.css";
233
233
  `;
234
- if (!fs.existsSync(substrataCssPath)) {
234
+ if (!fs.existsSync(stratixCssPath)) {
235
235
  if (!fs.existsSync(srcDir)) fs.mkdirSync(srcDir, { recursive: true });
236
- fs.writeFileSync(substrataCssPath, substrataCss);
237
- console.log('\n✅ Created src/substrata.css');
236
+ fs.writeFileSync(stratixCssPath, stratixCss);
237
+ console.log('\n✅ Created src/stratix.css');
238
238
  }
239
239
 
240
240
  // 5. Create base.css
@@ -289,10 +289,10 @@ h4 {
289
289
  const consumptionExamples = {
290
290
  'plain.css': `/*
291
291
  Plain CSS Consumption Example
292
- Import Substrata tokens and use them directly in your styles.
292
+ Import Stratix tokens and use them directly in your styles.
293
293
  */
294
294
 
295
- @import "@stratixlabs/core/substrata.css";
295
+ @import "@stratixlabs/core/stratix.css";
296
296
 
297
297
  .card {
298
298
  background: var(--color-surface);
@@ -317,7 +317,7 @@ h4 {
317
317
  `,
318
318
  'styled-components.js': `/*
319
319
  CSS-in-JS Consumption Example (styled-components / emotion)
320
- Use Substrata tokens in template literals via CSS variables.
320
+ Use Stratix tokens in template literals via CSS variables.
321
321
  */
322
322
 
323
323
  import styled from 'styled-components';
@@ -347,7 +347,7 @@ export const Button = styled.button\`
347
347
  `,
348
348
  'tailwind.config.js': `/*
349
349
  Tailwind CSS Consumption Example
350
- Map Substrata tokens to Tailwind's theme configuration.
350
+ Map Stratix tokens to Tailwind's theme configuration.
351
351
  */
352
352
 
353
353
  /** @type {import('tailwindcss').Config} */
@@ -461,17 +461,17 @@ module.exports = {
461
461
  }
462
462
  }
463
463
 
464
- console.log('\n✨ Substrata is ready!\n');
464
+ console.log('\n✨ Stratix is ready!\n');
465
465
  console.log('📂 Generated structure:');
466
- console.log(' ├── substrata.config.js');
466
+ console.log(' ├── stratix.config.js');
467
467
  console.log(' ├── src/');
468
468
  console.log(' │ ├── tokens/ (9 token files)');
469
469
  console.log(' │ ├── consumption/ (3 framework examples)');
470
- console.log(' │ ├── substrata.css (main entry point)');
470
+ console.log(' │ ├── stratix.css (main entry point)');
471
471
  console.log(' │ └── base.css');
472
472
  console.log(' └── scripts/ (3 automation scripts)\n');
473
473
  console.log('▶️ Next steps:');
474
- console.log(' 1. Import src/substrata.css in your app');
474
+ console.log(' 1. Import src/stratix.css in your app');
475
475
  console.log(' 2. Run: npm run build:tokens');
476
476
  console.log(' 3. Check src/consumption/ for framework integration examples\n');
477
477
  }
@@ -497,7 +497,7 @@ if (command === 'figma') {
497
497
  const subcommand = args[1];
498
498
 
499
499
  if (!subcommand || subcommand !== 'apply-preview') {
500
- console.log('Usage: @stratixlabs/core figma <subcommand>');
500
+ console.log('Usage: stratix figma <subcommand>');
501
501
  console.log('Subcommands:');
502
502
  console.log(' apply-preview Apply figma-push-preview.json to Figma via Variables REST API');
503
503
  process.exit(1);
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@stratixlabs/core",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "...",
5
5
  "bin": {
6
- "substrata": "bin/substrata.js"
6
+ "stratix": "bin/stratix.js"
7
7
  },
8
8
  "main": "index.js",
9
9
  "scripts": {
@@ -39,9 +39,9 @@
39
39
  "src",
40
40
  "index.js",
41
41
  "tokens.json",
42
- "substrata.d.ts",
42
+ "stratix.d.ts",
43
43
  "README.md",
44
- "substrata.config.js"
44
+ "stratix.config.js"
45
45
  ],
46
46
  "devDependencies": {
47
47
  "ajv": "^8.12.0"