@machinemetrics/mm-react-components 1.0.0-rc.0 → 1.0.0-rc.1
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/CHANGELOG.md +20 -16
- package/README.md +9 -27
- package/agent-docs/agent-documentation-reference.md +12 -15
- package/agent-docs/ai-agent-init-guide.md +21 -30
- package/agent-docs/init-readme.md +28 -43
- package/agent-docs/init-troubleshooting.md +7 -56
- package/agent-docs/setup-reference.md +19 -20
- package/dist/README.md +9 -27
- package/dist/components/ui/button-group.d.ts.map +1 -1
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/code-preview.d.ts.map +1 -1
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/cursor-skill/mm-carbide/SKILL.md +4 -0
- package/dist/docs/GETTING_STARTED.md +23 -45
- package/dist/lib/mm-react-components.css +1 -1
- package/dist/mm-react-components.es.js +16 -16
- package/dist/mm-react-components.es.js.map +1 -1
- package/dist/mm-react-components.umd.js +1 -1
- package/dist/mm-react-components.umd.js.map +1 -1
- package/dist/scripts/ascii-logo.cjs +24 -0
- package/dist/scripts/init.cjs +9 -1
- package/dist/scripts/install-skill.cjs +8 -0
- package/dist/scripts/npx-init.cjs +54 -1
- package/dist/themes/carbide.css +22 -0
- package/package.json +1 -5
- package/dist/docs/TAILWIND_SETUP.md +0 -343
- package/dist/tailwind.base.config.js +0 -89
- package/docs/TAILWIND_SETUP.md +0 -343
package/CHANGELOG.md
CHANGED
|
@@ -5,39 +5,43 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [
|
|
8
|
+
## [1.0.0] - 2025-02-04
|
|
9
|
+
|
|
10
|
+
Summary of changes from v0.2.x (main) to 1.0: full shadcn component set, one-command init, Carbide AI skill, zero-config default, and package/docs cleanup.
|
|
9
11
|
|
|
10
12
|
### Added
|
|
11
13
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
14
|
+
- Full shadcn/ui-based component set (50+ components): DataTable (server-side pagination, events, toolbar), Chart, PageHeader, Sheet, Drawer, Form, DatePicker, DateRangePicker, HeroMetricCard, Sidebar, Command, Carousel, Combobox, Field, Empty, Item, Menubar, NavigationMenu, and remaining shadcn components with Carbide theming.
|
|
15
|
+
- `mm-init` CLI: one-command setup via `npx @machinemetrics/mm-react-components mm-init` (install library, add `/styles`, create examples, optional skill install or Chakra migration).
|
|
16
|
+
- `mm-install-skill` CLI and mm-carbide Agent Skill for Cursor, Copilot, Claude, Gemini (`--target`, `--scope=project|user`).
|
|
17
|
+
- Zero-config default: pre-compiled `/styles` import; no Tailwind or PostCSS required.
|
|
18
|
+
- Chakra-to-shadcn migration: `chakra-to-shadcn` bin and `migrate:chakra-to-shadcn` script.
|
|
19
|
+
- Static preview build (`build:static`, `serve:static`) and font extraction (fonts as separate files, not base64).
|
|
20
|
+
- AI agent docs: component reference, init/setup guides, Chakra migration docs.
|
|
19
21
|
|
|
20
22
|
### Changed
|
|
21
23
|
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
24
|
+
- Public init is `mm-init` (npx). All docs and agent-docs use mm-init and `/styles`; zero-config first.
|
|
25
|
+
- Component layout: base shadcn in `shadcn/`, overrides in `ui/` for easier `shadcn add` updates.
|
|
26
|
+
- Playwright: OS-agnostic snapshots, `domcontentloaded` (replaced `networkidle`), fewer flaky tests.
|
|
27
|
+
- Carbide theme: expanded data-slot coverage (alert-dialog, select, dropdown sub-menus). Fonts via @fontsource.
|
|
28
|
+
- Scripts: removed init.js, setup script, migrate-components-since, backups; single init path. Setup link: `https://components.machinemetrics.com/setup`.
|
|
27
29
|
|
|
28
30
|
### Removed
|
|
29
31
|
|
|
30
|
-
-
|
|
32
|
+
- Tailwind config and TAILWIND_SETUP from published package. Zero-config only; theme-only doc in repo only.
|
|
33
|
+
- Package exports `./tailwind.config` and `./docs/tailwind-setup`.
|
|
31
34
|
|
|
32
35
|
### Fixed
|
|
33
36
|
|
|
34
|
-
-
|
|
37
|
+
- Package `files`: removed non-existent `tailwind.config.export.js`; docs use `/styles` or inline config.
|
|
38
|
+
- Removed unused debug images. DataTable event passthrough and toolbar search events.
|
|
35
39
|
|
|
36
40
|
### Security
|
|
37
41
|
|
|
38
42
|
- N/A
|
|
39
43
|
|
|
40
|
-
## [0.
|
|
44
|
+
## [0.2.0] - 2025-09-23
|
|
41
45
|
|
|
42
46
|
### Added
|
|
43
47
|
|
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ npm install @machinemetrics/mm-react-components
|
|
|
44
44
|
|
|
45
45
|
**Automated Tools:**
|
|
46
46
|
|
|
47
|
-
- ✅ Init script: `npx @machinemetrics/mm-react-components init`
|
|
47
|
+
- ✅ Init script: `npx @machinemetrics/mm-react-components mm-init`
|
|
48
48
|
- ✅ Migration script: `npx @machinemetrics/mm-react-components chakra-to-shadcn`
|
|
49
49
|
- ✅ 98% automation rate for Chakra UI conversion
|
|
50
50
|
- ✅ Zero-config setup option (no build tools needed!)
|
|
@@ -55,23 +55,18 @@ npm install @machinemetrics/mm-react-components
|
|
|
55
55
|
|
|
56
56
|
### 🚀 Automated Setup (Recommended)
|
|
57
57
|
|
|
58
|
-
The fastest way to get started:
|
|
58
|
+
The fastest way to get started (from your React project root):
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
|
|
62
|
-
npm install @machinemetrics/mm-react-components
|
|
63
|
-
|
|
64
|
-
# Run the automated setup
|
|
65
|
-
npx @machinemetrics/mm-react-components/setup
|
|
61
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
66
62
|
```
|
|
67
63
|
|
|
68
64
|
This will automatically:
|
|
69
65
|
|
|
70
|
-
- ✅
|
|
71
|
-
- ✅
|
|
72
|
-
- ✅
|
|
73
|
-
- ✅
|
|
74
|
-
- ✅ Generate all necessary files
|
|
66
|
+
- ✅ Install the component library
|
|
67
|
+
- ✅ Add pre-compiled CSS import to your `index.css`
|
|
68
|
+
- ✅ Create example components
|
|
69
|
+
- ✅ Optionally install the Carbide AI skill and offer Chakra UI migration if detected
|
|
75
70
|
|
|
76
71
|
### 📋 Manual Setup
|
|
77
72
|
|
|
@@ -89,19 +84,7 @@ npm install @machinemetrics/mm-react-components
|
|
|
89
84
|
npm install -D tailwindcss postcss autoprefixer
|
|
90
85
|
```
|
|
91
86
|
|
|
92
|
-
#### 2.
|
|
93
|
-
|
|
94
|
-
> 💡 Skip this step if using `/styles` - Tailwind configuration is not needed!
|
|
95
|
-
|
|
96
|
-
**Only if using `/themes/carbide`:**
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
cp node_modules/@machinemetrics/mm-react-components/tailwind.config.export.js tailwind.config.js
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Note: The exported config is the main config (no preview-only utilities). The preview app in this repo uses a separate `tailwind.preview.config.js` that imports the main config and adds preview utilities.
|
|
103
|
-
|
|
104
|
-
#### 3. Import Styles
|
|
87
|
+
#### 2. Import Styles
|
|
105
88
|
|
|
106
89
|
Import the complete styles including Tailwind CSS, base styles, and Carbide theme:
|
|
107
90
|
|
|
@@ -120,7 +103,7 @@ document.documentElement.classList.add('carbide');
|
|
|
120
103
|
- ✅ Dark mode support
|
|
121
104
|
- ✅ Animations and utilities
|
|
122
105
|
|
|
123
|
-
####
|
|
106
|
+
#### 3. Use Components
|
|
124
107
|
|
|
125
108
|
```tsx
|
|
126
109
|
import { Button, Input } from '@machinemetrics/mm-react-components';
|
|
@@ -146,7 +129,6 @@ function App() {
|
|
|
146
129
|
**For Developers:**
|
|
147
130
|
|
|
148
131
|
- [Getting Started Guide](./docs/GETTING_STARTED.md) - Complete setup guide
|
|
149
|
-
- [Tailwind Setup Guide](./docs/TAILWIND_SETUP.md) - Detailed configuration
|
|
150
132
|
- [Chakra Migration Guide](./docs/CHAKRA_MIGRATION_GUIDE.md) - Detailed migration reference
|
|
151
133
|
- [Component Mapping Summary](./docs/COMPONENT_MAPPING_SUMMARY.md) - All 83 component mappings
|
|
152
134
|
|
|
@@ -341,20 +341,19 @@ ai-agent-guide.md (main guide)
|
|
|
341
341
|
|
|
342
342
|
The following files are exported via package.json for AI agent access:
|
|
343
343
|
|
|
344
|
-
### **Init
|
|
344
|
+
### **Init setup (files in agent-docs/)**
|
|
345
345
|
|
|
346
|
-
-
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
346
|
+
- `ai-agent-init-guide.md` – main setup guide (use `mm-init`, zero-config with `/styles`)
|
|
347
|
+
- `setup-reference.md` – technical reference
|
|
348
|
+
- `init-troubleshooting.md` – init failures and edge cases
|
|
349
|
+
- `init-readme.md` – overview
|
|
350
350
|
|
|
351
|
-
|
|
351
|
+
The package exports the whole folder: `@machinemetrics/mm-react-components/agent-docs` (or `./agent-docs` in package.json). There are no separate `./init/guide` subpath exports.
|
|
352
352
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
-
|
|
356
|
-
- `./migration/
|
|
357
|
-
- `./migration/readme` → `chakra-migration-readme.md`
|
|
353
|
+
### **Chakra migration (files in agent-docs/)**
|
|
354
|
+
|
|
355
|
+
- `chakra-migration-readme.md`, `ai-agent-guide.md`, `component-mapping-reference.md`, `chakra-migration-troubleshooting.md`
|
|
356
|
+
- Package export for migration config: `./migration/config` → `chakra-to-shadcn.config.json`
|
|
358
357
|
|
|
359
358
|
## Best Practices
|
|
360
359
|
|
|
@@ -363,16 +362,14 @@ The following files are exported via package.json for AI agent access:
|
|
|
363
362
|
1. **Always start with the main guide** for comprehensive instructions
|
|
364
363
|
2. **Use reference files** for technical details and specific information
|
|
365
364
|
3. **Check troubleshooting guides** when issues arise
|
|
366
|
-
4. **
|
|
367
|
-
5. **Validate setup** using provided checklists
|
|
365
|
+
4. **Validate setup** using provided checklists (e.g. /styles import, carbide class)
|
|
368
366
|
|
|
369
367
|
### **For Documentation Maintenance**
|
|
370
368
|
|
|
371
369
|
1. **Keep guides updated** with new components and features
|
|
372
370
|
2. **Update troubleshooting guides** with new issues and solutions
|
|
373
371
|
3. **Maintain reference files** with current dependency versions
|
|
374
|
-
4. **
|
|
375
|
-
5. **Update package.json exports** when adding new files
|
|
372
|
+
4. **Update package.json exports** when adding new files
|
|
376
373
|
|
|
377
374
|
## Support and Resources
|
|
378
375
|
|
|
@@ -22,8 +22,8 @@ The library uses a **ZERO-CONFIG** approach - no build tools, no configuration f
|
|
|
22
22
|
### 1. Automated Initialization (Recommended)
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
# Run the init script via npx
|
|
26
|
-
npx @machinemetrics/mm-react-components init
|
|
25
|
+
# Run the init script via npx (from your React project root)
|
|
26
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
27
27
|
|
|
28
28
|
# This installs the library and sets up the CSS import
|
|
29
29
|
```
|
|
@@ -130,20 +130,21 @@ function MyComponent() {
|
|
|
130
130
|
|
|
131
131
|
**Done!** Components are ready to use.
|
|
132
132
|
|
|
133
|
-
## Project Structure After Setup
|
|
133
|
+
## Project Structure After Setup (zero-config)
|
|
134
134
|
|
|
135
135
|
```
|
|
136
136
|
your-project/
|
|
137
137
|
├── src/
|
|
138
|
-
│ ├── index.css (
|
|
139
|
-
│ └── App.tsx (
|
|
140
|
-
├──
|
|
141
|
-
├── postcss.config.js
|
|
138
|
+
│ ├── index.css (with @import '.../styles')
|
|
139
|
+
│ └── App.tsx (root with className="carbide")
|
|
140
|
+
├── mm-components-examples/ (if you ran mm-init)
|
|
142
141
|
├── package.json
|
|
143
142
|
└── node_modules/
|
|
144
143
|
└── @machinemetrics/mm-react-components/
|
|
145
144
|
```
|
|
146
145
|
|
|
146
|
+
No `tailwind.config.js` or `postcss.config.js` required when using `/styles`.
|
|
147
|
+
|
|
147
148
|
## Framework-Specific Setup
|
|
148
149
|
|
|
149
150
|
### React with Vite
|
|
@@ -154,7 +155,7 @@ npm create vite@latest my-app -- --template react-ts
|
|
|
154
155
|
cd my-app
|
|
155
156
|
|
|
156
157
|
# Run init script
|
|
157
|
-
npx @machinemetrics/mm-react-components init
|
|
158
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
158
159
|
|
|
159
160
|
# Start development server
|
|
160
161
|
npm run dev
|
|
@@ -168,7 +169,7 @@ npx create-next-app@latest my-app --typescript --tailwind --eslint
|
|
|
168
169
|
cd my-app
|
|
169
170
|
|
|
170
171
|
# Run init script
|
|
171
|
-
npx @machinemetrics/mm-react-components init
|
|
172
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
172
173
|
|
|
173
174
|
# Start development server
|
|
174
175
|
npm run dev
|
|
@@ -182,17 +183,17 @@ npx create-react-app my-app --template typescript
|
|
|
182
183
|
cd my-app
|
|
183
184
|
|
|
184
185
|
# Run init script
|
|
185
|
-
npx @machinemetrics/mm-react-components init
|
|
186
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
186
187
|
|
|
187
188
|
# Start development server
|
|
188
189
|
npm start
|
|
189
190
|
```
|
|
190
191
|
|
|
191
|
-
## Advanced Configuration
|
|
192
|
+
## Advanced Configuration (optional)
|
|
192
193
|
|
|
193
194
|
### Custom Tailwind Configuration
|
|
194
195
|
|
|
195
|
-
|
|
196
|
+
Only needed if you use theme-only CSS (`/themes/carbide`) with your own Tailwind build. For zero-config, skip this.
|
|
196
197
|
|
|
197
198
|
```javascript
|
|
198
199
|
/** @type {import('tailwindcss').Config} */
|
|
@@ -218,9 +219,9 @@ module.exports = {
|
|
|
218
219
|
};
|
|
219
220
|
```
|
|
220
221
|
|
|
221
|
-
### Custom CSS Setup
|
|
222
|
+
### Custom CSS Setup (theme-only; optional)
|
|
222
223
|
|
|
223
|
-
|
|
224
|
+
Default is `/styles` (pre-compiled). Only if you run your own Tailwind:
|
|
224
225
|
|
|
225
226
|
```css
|
|
226
227
|
/* src/index.css */
|
|
@@ -261,8 +262,8 @@ If using TypeScript, ensure your `tsconfig.json` includes the component library
|
|
|
261
262
|
# Install npx globally
|
|
262
263
|
npm install -g npx
|
|
263
264
|
|
|
264
|
-
#
|
|
265
|
-
|
|
265
|
+
# Run init (same command)
|
|
266
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
266
267
|
```
|
|
267
268
|
|
|
268
269
|
### Issue: "Cannot find module" errors
|
|
@@ -282,22 +283,12 @@ rm -rf node_modules package-lock.json
|
|
|
282
283
|
npm install
|
|
283
284
|
|
|
284
285
|
# Run init script again
|
|
285
|
-
npx @machinemetrics/mm-react-components init
|
|
286
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
286
287
|
```
|
|
287
288
|
|
|
288
289
|
### Issue: Tailwind CSS not working
|
|
289
290
|
|
|
290
|
-
**
|
|
291
|
-
|
|
292
|
-
**Solution**:
|
|
293
|
-
|
|
294
|
-
```bash
|
|
295
|
-
# Initialize Tailwind manually
|
|
296
|
-
npx tailwindcss init -p
|
|
297
|
-
|
|
298
|
-
# Update tailwind.config.js with correct content paths
|
|
299
|
-
# Ensure PostCSS is configured
|
|
300
|
-
```
|
|
291
|
+
**Only relevant if** you chose to use theme-only CSS (`/themes/carbide`) with your own Tailwind. For zero-config, use `/styles` instead—no Tailwind needed.
|
|
301
292
|
|
|
302
293
|
### Issue: Components not styling correctly
|
|
303
294
|
|
|
@@ -306,8 +297,8 @@ npx tailwindcss init -p
|
|
|
306
297
|
**Solution**:
|
|
307
298
|
|
|
308
299
|
```tsx
|
|
309
|
-
// Ensure CSS is imported in your main file
|
|
310
|
-
import '@machinemetrics/mm-react-components/
|
|
300
|
+
// Ensure pre-compiled CSS is imported in your main CSS file (e.g. src/index.css):
|
|
301
|
+
// @import '@machinemetrics/mm-react-components/styles';
|
|
311
302
|
|
|
312
303
|
// Ensure carbide class is applied to root element
|
|
313
304
|
<div className="carbide">
|
|
@@ -15,19 +15,15 @@ This directory contains comprehensive documentation and tools for setting up the
|
|
|
15
15
|
|
|
16
16
|
### Scripts and Tools
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
- **`npx-init.cjs`** - NPX-specific initialization script (in `scripts/` directory)
|
|
18
|
+
- **mm-init** – Package bin (run via `npx @machinemetrics/mm-react-components mm-init`). Uses `npx-init.cjs` under the hood and installs the library, adds `/styles` import, creates examples, and optionally installs the Carbide skill or runs Chakra migration.
|
|
20
19
|
|
|
21
20
|
## Quick Start
|
|
22
21
|
|
|
23
22
|
### 1. Automated Setup (Preferred)
|
|
24
23
|
|
|
25
24
|
```bash
|
|
26
|
-
#
|
|
27
|
-
npx @machinemetrics/mm-react-components init
|
|
28
|
-
|
|
29
|
-
# Or use the direct script
|
|
30
|
-
npx mm-init
|
|
25
|
+
# From your React project root (run via npx; no install needed)
|
|
26
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
31
27
|
```
|
|
32
28
|
|
|
33
29
|
### 2. Manual Setup (Complete Control)
|
|
@@ -39,26 +35,23 @@ Follow the detailed instructions in `ai-agent-init-guide.md` for step-by-step ma
|
|
|
39
35
|
### Dependencies Installed
|
|
40
36
|
|
|
41
37
|
- **Core Library**: `@machinemetrics/mm-react-components`
|
|
42
|
-
- **
|
|
43
|
-
-
|
|
44
|
-
- **TypeScript Dependencies**: `@types/react`, `@types/react-dom`, `typescript` (if enabled)
|
|
38
|
+
- **React**: ^18.2.0 or ^19.0.0 (peer)
|
|
39
|
+
- No Tailwind, PostCSS, or other build tools required for zero-config.
|
|
45
40
|
|
|
46
|
-
###
|
|
41
|
+
### What mm-init Does
|
|
47
42
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
43
|
+
- Installs the library and adds the pre-compiled CSS import to your `index.css` (or creates it).
|
|
44
|
+
- Creates example components in `mm-components-examples/`.
|
|
45
|
+
- Optionally installs the Carbide AI skill and offers Chakra UI migration if detected.
|
|
51
46
|
|
|
52
|
-
### Project Structure
|
|
47
|
+
### Project Structure (zero-config)
|
|
53
48
|
|
|
54
49
|
```
|
|
55
50
|
your-project/
|
|
56
51
|
├── src/
|
|
57
|
-
│ ├── index.css (with
|
|
58
|
-
│
|
|
59
|
-
|
|
60
|
-
├── tailwind.config.js
|
|
61
|
-
├── postcss.config.js
|
|
52
|
+
│ ├── index.css (with @import '.../styles')
|
|
53
|
+
│ └── App.tsx (add className="carbide" to root)
|
|
54
|
+
├── mm-components-examples/ (created by mm-init)
|
|
62
55
|
├── package.json
|
|
63
56
|
└── node_modules/
|
|
64
57
|
└── @machinemetrics/mm-react-components/
|
|
@@ -75,11 +68,7 @@ your-project/
|
|
|
75
68
|
|
|
76
69
|
### Framework-Specific Setup
|
|
77
70
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- **Next.js**: Requires `transpilePackages` configuration
|
|
81
|
-
- **Vite**: Requires CSS processing configuration
|
|
82
|
-
- **CRA**: Requires CRACO for Tailwind support
|
|
71
|
+
With zero-config (`/styles`), no framework-specific build config is required. If using Next.js, add `transpilePackages: ['@machinemetrics/mm-react-components']` to next.config.js so the package is compiled.
|
|
83
72
|
|
|
84
73
|
## Usage Examples
|
|
85
74
|
|
|
@@ -91,7 +80,7 @@ npx create-react-app my-app --template typescript
|
|
|
91
80
|
cd my-app
|
|
92
81
|
|
|
93
82
|
# Run init script
|
|
94
|
-
npx @machinemetrics/mm-react-components init
|
|
83
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
95
84
|
|
|
96
85
|
# Start development server
|
|
97
86
|
npm start
|
|
@@ -105,7 +94,7 @@ npx create-next-app@latest my-app --typescript --tailwind --eslint
|
|
|
105
94
|
cd my-app
|
|
106
95
|
|
|
107
96
|
# Run init script
|
|
108
|
-
npx @machinemetrics/mm-react-components init
|
|
97
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
109
98
|
|
|
110
99
|
# Start development server
|
|
111
100
|
npm run dev
|
|
@@ -119,7 +108,7 @@ npm create vite@latest my-app -- --template react-ts
|
|
|
119
108
|
cd my-app
|
|
120
109
|
|
|
121
110
|
# Run init script
|
|
122
|
-
npx @machinemetrics/mm-react-components init
|
|
111
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
123
112
|
|
|
124
113
|
# Start development server
|
|
125
114
|
npm run dev
|
|
@@ -144,7 +133,7 @@ npm run dev
|
|
|
144
133
|
### Debugging Steps
|
|
145
134
|
|
|
146
135
|
1. **Check dependencies**: `npm list @machinemetrics/mm-react-components`
|
|
147
|
-
2. **Verify configuration**: Check `
|
|
136
|
+
2. **Verify configuration**: Check that `index.css` imports `@machinemetrics/mm-react-components/styles` and root has `carbide` class
|
|
148
137
|
3. **Test imports**: Try importing a component
|
|
149
138
|
4. **Check CSS**: Ensure theme is imported and applied
|
|
150
139
|
|
|
@@ -154,19 +143,15 @@ npm run dev
|
|
|
154
143
|
|
|
155
144
|
AI agents can use these files to:
|
|
156
145
|
|
|
157
|
-
1. **Automated Setup**: Use
|
|
158
|
-
2. **
|
|
159
|
-
3. **
|
|
160
|
-
4. **Troubleshooting**: Use the troubleshooting guide to resolve issues
|
|
146
|
+
1. **Automated Setup**: Use `npx @machinemetrics/mm-react-components mm-init` for standard setups
|
|
147
|
+
2. **Manual Setup**: Follow ai-agent-init-guide.md (install library, add /styles import, add carbide class)
|
|
148
|
+
3. **Troubleshooting**: Use init-troubleshooting.md when the init script fails or for edge cases
|
|
161
149
|
|
|
162
150
|
### AI Agent Commands
|
|
163
151
|
|
|
164
152
|
```bash
|
|
165
|
-
# Automated setup
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
# Or with npx
|
|
169
|
-
npx @machinemetrics/mm-react-components init
|
|
153
|
+
# Automated setup (from consumer project; no need to clone the repo)
|
|
154
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
170
155
|
|
|
171
156
|
# Manual setup (follow ai-agent-init-guide.md)
|
|
172
157
|
# 1. Install dependencies
|
|
@@ -184,8 +169,6 @@ After setup, verify:
|
|
|
184
169
|
- [ ] `@machinemetrics/mm-react-components` is installed
|
|
185
170
|
- [ ] All peer dependencies are installed
|
|
186
171
|
- [ ] CSS file imports the Carbide theme
|
|
187
|
-
- [ ] Tailwind CSS is configured
|
|
188
|
-
- [ ] PostCSS is configured
|
|
189
172
|
- [ ] Root element has `carbide` class
|
|
190
173
|
- [ ] Components can be imported and used
|
|
191
174
|
- [ ] Build process works without errors
|
|
@@ -239,10 +222,12 @@ module.exports = {
|
|
|
239
222
|
};
|
|
240
223
|
```
|
|
241
224
|
|
|
242
|
-
### Custom CSS Setup
|
|
225
|
+
### Custom CSS Setup (optional theme-only path)
|
|
226
|
+
|
|
227
|
+
For zero-config, use `/styles`. Only if you run your own Tailwind build, you can use theme-only:
|
|
243
228
|
|
|
244
229
|
```css
|
|
245
|
-
/* src/index.css */
|
|
230
|
+
/* src/index.css - theme-only (requires your own Tailwind config) */
|
|
246
231
|
@import '@machinemetrics/mm-react-components/themes/carbide';
|
|
247
232
|
|
|
248
233
|
/* Custom CSS variables */
|
|
@@ -280,4 +265,4 @@ module.exports = {
|
|
|
280
265
|
|
|
281
266
|
This initialization setup provides comprehensive tools and documentation for setting up the MachineMetrics React Components library. Whether using automated scripts or manual setup, the goal is to provide a smooth development experience with industrial-grade components.
|
|
282
267
|
|
|
283
|
-
For AI agents, these files provide everything needed to automate the setup process and handle edge cases when
|
|
268
|
+
For AI agents, these files provide everything needed to automate the setup process and handle edge cases when mm-init fails or for manual setup.
|
|
@@ -14,11 +14,8 @@
|
|
|
14
14
|
# Install NPX globally
|
|
15
15
|
npm install -g npx
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# Alternative: Use the package directly
|
|
21
|
-
npx @machinemetrics/mm-react-components init
|
|
17
|
+
# Run init (correct command)
|
|
18
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
22
19
|
```
|
|
23
20
|
|
|
24
21
|
#### Error: `Permission denied`
|
|
@@ -50,7 +47,7 @@ npm cache clean --force
|
|
|
50
47
|
npm config set registry https://registry.npmjs.org/
|
|
51
48
|
|
|
52
49
|
# Retry with verbose output
|
|
53
|
-
npx @machinemetrics/mm-react-components init
|
|
50
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
54
51
|
```
|
|
55
52
|
|
|
56
53
|
### 2. Dependency Installation Issues
|
|
@@ -80,16 +77,7 @@ npm list @machinemetrics/mm-react-components
|
|
|
80
77
|
|
|
81
78
|
**Solution**:
|
|
82
79
|
|
|
83
|
-
|
|
84
|
-
# Install all peer dependencies
|
|
85
|
-
npm install class-variance-authority clsx tailwind-merge @radix-ui/react-slot lucide-react
|
|
86
|
-
|
|
87
|
-
# Install build dependencies
|
|
88
|
-
npm install -D tailwindcss autoprefixer postcss
|
|
89
|
-
|
|
90
|
-
# Check for version conflicts
|
|
91
|
-
npm ls
|
|
92
|
-
```
|
|
80
|
+
For **zero-config** (recommended), you only need the library and React. Ensure `@import '@machinemetrics/mm-react-components/styles'` is in your CSS and the root has `className="carbide"`. If you see peer warnings for tailwind/PostCSS, they are optional when using `/styles`.
|
|
93
81
|
|
|
94
82
|
#### Error: `EACCES: permission denied`
|
|
95
83
|
|
|
@@ -112,48 +100,11 @@ nvm use node
|
|
|
112
100
|
|
|
113
101
|
#### Error: `Cannot find module 'tailwindcss'`
|
|
114
102
|
|
|
115
|
-
**
|
|
116
|
-
|
|
117
|
-
**Solution**:
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
# Install Tailwind CSS
|
|
121
|
-
npm install -D tailwindcss
|
|
122
|
-
|
|
123
|
-
# Initialize Tailwind
|
|
124
|
-
npx tailwindcss init -p
|
|
125
|
-
|
|
126
|
-
# Update tailwind.config.js
|
|
127
|
-
module.exports = {
|
|
128
|
-
content: [
|
|
129
|
-
"./src/**/*.{js,ts,jsx,tsx}",
|
|
130
|
-
"./node_modules/@machinemetrics/mm-react-components/dist/**/*.{js,ts,jsx,tsx}",
|
|
131
|
-
],
|
|
132
|
-
theme: {
|
|
133
|
-
extend: {},
|
|
134
|
-
},
|
|
135
|
-
plugins: [],
|
|
136
|
-
}
|
|
137
|
-
```
|
|
103
|
+
**Only relevant if** you are not using zero-config (`/styles`). For zero-config, use `@import '@machinemetrics/mm-react-components/styles'` in your CSS—no Tailwind needed. If you use Tailwind (theme-only path), run `npm install -D tailwindcss` and add content paths and theme extension per library docs.
|
|
138
104
|
|
|
139
105
|
#### Error: `PostCSS plugin tailwindcss requires Tailwind CSS`
|
|
140
106
|
|
|
141
|
-
**
|
|
142
|
-
|
|
143
|
-
**Solution**:
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
# Install PostCSS dependencies
|
|
147
|
-
npm install -D postcss autoprefixer
|
|
148
|
-
|
|
149
|
-
# Create postcss.config.js
|
|
150
|
-
echo "module.exports = {
|
|
151
|
-
plugins: {
|
|
152
|
-
tailwindcss: {},
|
|
153
|
-
autoprefixer: {},
|
|
154
|
-
},
|
|
155
|
-
}" > postcss.config.js
|
|
156
|
-
```
|
|
107
|
+
**Only relevant if** you use Tailwind. For zero-config, use `/styles` and skip PostCSS/Tailwind. If you use Tailwind, add `postcss.config.js` with `tailwindcss` and `autoprefixer` plugins.
|
|
157
108
|
|
|
158
109
|
#### Error: `Cannot resolve dependency 'lucide-react'`
|
|
159
110
|
|
|
@@ -444,7 +395,7 @@ ls -la dist/
|
|
|
444
395
|
|
|
445
396
|
```bash
|
|
446
397
|
# Run with verbose output
|
|
447
|
-
npx @machinemetrics/mm-react-components init
|
|
398
|
+
npx @machinemetrics/mm-react-components mm-init
|
|
448
399
|
|
|
449
400
|
# Check npm logs
|
|
450
401
|
npm config get loglevel
|