@tachui/cli 0.7.0-alpha1 โ†’ 0.7.1-alpha

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.
Files changed (2) hide show
  1. package/README.md +438 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,438 @@
1
+ # @tachui/cli
2
+
3
+ > Comprehensive developer tooling and CLI for tachUI framework
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@tachui/cli.svg)](https://www.npmjs.com/package/@tachui/cli)
6
+ [![License: MPL-2.0](https://img.shields.io/badge/License-MPL--2.0-blue.svg)](https://opensource.org/licenses/MPL-2.0)
7
+
8
+ ## Overview
9
+
10
+ The tachUI CLI (`tacho`) provides comprehensive developer tooling including project scaffolding, code generation, SwiftUI migration utilities, performance analysis, and development server capabilities.
11
+
12
+ ## Features
13
+
14
+ - ๐Ÿš€ **Project Scaffolding** - Create new tachUI projects with templates
15
+ - ๐Ÿ”ง **Code Generation** - Generate components, pages, and plugins
16
+ - ๐Ÿ“ฑ **SwiftUI Migration** - Convert SwiftUI code to tachUI
17
+ - โšก **Performance Tools** - Bundle analysis and optimization
18
+ - ๐Ÿ” **Development Server** - Hot reload and debugging capabilities
19
+ - ๐Ÿงช **Testing Utilities** - Test generation and runner integration
20
+
21
+ ## Installation
22
+
23
+ ### Global Installation
24
+
25
+ ```bash
26
+ npm install -g @tachui/cli
27
+ # or
28
+ pnpm add -g @tachui/cli
29
+ ```
30
+
31
+ ### Local Project Installation
32
+
33
+ ```bash
34
+ npm install --save-dev @tachui/cli
35
+ # or
36
+ pnpm add -D @tachui/cli
37
+ ```
38
+
39
+ ## Quick Start
40
+
41
+ ### Create New Project
42
+
43
+ ```bash
44
+ # Create a new tachUI project
45
+ tacho create my-app
46
+
47
+ # Create with specific template
48
+ tacho create my-app --template react-integration
49
+ tacho create my-app --template mobile-first
50
+ tacho create my-app --template desktop-app
51
+ ```
52
+
53
+ ### Generate Components
54
+
55
+ ```bash
56
+ # Generate a new component
57
+ tacho generate component UserProfile
58
+ tacho generate component --interactive
59
+
60
+ # Generate a page with routing
61
+ tacho generate page ProductDetail --route "/products/:id"
62
+
63
+ # Generate a plugin
64
+ tacho generate plugin MyCustomPlugin
65
+ ```
66
+
67
+ ## Commands
68
+
69
+ ### Project Management
70
+
71
+ ```bash
72
+ # Create new project
73
+ tacho create <project-name> [options]
74
+
75
+ # Initialize tachUI in existing project
76
+ tacho init
77
+
78
+ # Add tachUI packages to existing project
79
+ tacho add forms navigation symbols
80
+ ```
81
+
82
+ ### Code Generation
83
+
84
+ ```bash
85
+ # Generate component
86
+ tacho generate component <ComponentName>
87
+ tacho g c <ComponentName> # Shorthand
88
+
89
+ # Generate page
90
+ tacho generate page <PageName> --route <route>
91
+
92
+ # Generate plugin
93
+ tacho generate plugin <PluginName>
94
+
95
+ # Generate form
96
+ tacho generate form <FormName> --fields name:string,email:email,age:number
97
+ ```
98
+
99
+ ### SwiftUI Migration
100
+
101
+ ```bash
102
+ # Migrate SwiftUI file to tachUI
103
+ tacho migrate swiftui ./MyView.swift
104
+
105
+ # Migrate entire SwiftUI project
106
+ tacho migrate swiftui-project ./MySwiftUIApp
107
+
108
+ # Interactive migration with suggestions
109
+ tacho migrate --interactive ./ContentView.swift
110
+ ```
111
+
112
+ ### Development Tools
113
+
114
+ ```bash
115
+ # Start development server
116
+ tacho dev
117
+ tacho serve --port 3000
118
+
119
+ # Build project
120
+ tacho build
121
+ tacho build --mode production
122
+
123
+ # Analyze bundle size
124
+ tacho analyze
125
+ tacho bundle-size --detailed
126
+ ```
127
+
128
+ ### Performance & Optimization
129
+
130
+ ```bash
131
+ # Performance analysis
132
+ tacho perf analyze
133
+ tacho perf benchmark
134
+
135
+ # Bundle optimization
136
+ tacho optimize --tree-shake
137
+ tacho optimize --compress-assets
138
+
139
+ # Audit dependencies
140
+ tacho audit
141
+ tacho audit --security
142
+ ```
143
+
144
+ ## Templates
145
+
146
+ ### Available Project Templates
147
+
148
+ ```bash
149
+ # Basic tachUI application
150
+ tacho create my-app --template basic
151
+
152
+ # React.js integration
153
+ tacho create my-app --template react-integration
154
+
155
+ # Vue.js integration
156
+ tacho create my-app --template vue-integration
157
+
158
+ # Mobile-first application
159
+ tacho create my-app --template mobile-first
160
+
161
+ # Desktop application with Electron
162
+ tacho create my-app --template desktop
163
+
164
+ # Full-stack application with backend
165
+ tacho create my-app --template fullstack
166
+ ```
167
+
168
+ ### Component Templates
169
+
170
+ ```bash
171
+ # Basic component
172
+ tacho generate component Button
173
+
174
+ # Component with props interface
175
+ tacho generate component UserCard --props "user:User,onClick:Function"
176
+
177
+ # Form component with validation
178
+ tacho generate component LoginForm --type form
179
+
180
+ # List component with data binding
181
+ tacho generate component TodoList --type list --data-source todos
182
+ ```
183
+
184
+ ## Configuration
185
+
186
+ ### `tacho.config.js`
187
+
188
+ ```javascript
189
+ export default {
190
+ // Project settings
191
+ projectName: 'my-tachui-app',
192
+ version: '1.0.0',
193
+
194
+ // Development server
195
+ dev: {
196
+ port: 3000,
197
+ host: 'localhost',
198
+ open: true,
199
+ https: false,
200
+ },
201
+
202
+ // Build configuration
203
+ build: {
204
+ outDir: 'dist',
205
+ sourcemap: true,
206
+ minify: 'terser',
207
+ target: 'es2020',
208
+ },
209
+
210
+ // Code generation preferences
211
+ generate: {
212
+ componentsDir: 'src/components',
213
+ pagesDir: 'src/pages',
214
+ pluginsDir: 'src/plugins',
215
+ typescript: true,
216
+ cssModules: false,
217
+ },
218
+
219
+ // SwiftUI migration settings
220
+ migration: {
221
+ outputDir: 'src/migrated',
222
+ preserveComments: true,
223
+ generateTypes: true,
224
+ swiftUIVersion: '5.0',
225
+ },
226
+ }
227
+ ```
228
+
229
+ ## SwiftUI Migration
230
+
231
+ ### Supported SwiftUI Features
232
+
233
+ ```bash
234
+ # Migrate common SwiftUI patterns
235
+ tacho migrate swiftui MyView.swift
236
+
237
+ # What gets converted:
238
+ # - VStack, HStack, ZStack โ†’ VStack, HStack, ZStack
239
+ # - Text, Button, Image โ†’ Text, Button, Image
240
+ # - @State โ†’ createSignal
241
+ # - @ObservedObject โ†’ createComputed
242
+ # - .modifier chains โ†’ .modifier chains
243
+ # - NavigationView โ†’ NavigationView
244
+ # - List, ForEach โ†’ List, ForEach
245
+ ```
246
+
247
+ ### Migration Examples
248
+
249
+ **Before (SwiftUI):**
250
+
251
+ ```swift
252
+ struct ContentView: View {
253
+ @State private var count = 0
254
+
255
+ var body: some View {
256
+ VStack(spacing: 20) {
257
+ Text("Count: \(count)")
258
+ .font(.title)
259
+ .foregroundColor(.blue)
260
+
261
+ Button("Increment") {
262
+ count += 1
263
+ }
264
+ .padding()
265
+ .background(Color.blue)
266
+ .foregroundColor(.white)
267
+ .cornerRadius(8)
268
+ }
269
+ }
270
+ }
271
+ ```
272
+
273
+ **After (tachUI):**
274
+
275
+ ```typescript
276
+ import { VStack, Text, Button, createSignal } from '@tachui/core'
277
+
278
+ const ContentView = () => {
279
+ const [count, setCount] = createSignal(0)
280
+
281
+ return VStack({
282
+ children: [
283
+ Text(() => `Count: ${count()}`)
284
+ .modifier.font({ size: 24, weight: 'bold' })
285
+ .foregroundColor('#007AFF')
286
+ .build(),
287
+
288
+ Button('Increment', () => setCount(count() + 1))
289
+ .modifier.padding(16)
290
+ .backgroundColor('#007AFF')
291
+ .foregroundColor('white')
292
+ .cornerRadius(8)
293
+ .build(),
294
+ ],
295
+ spacing: 20,
296
+ }).build()
297
+ }
298
+ ```
299
+
300
+ ## Plugin Development
301
+
302
+ ### Create Plugin Template
303
+
304
+ ```bash
305
+ tacho generate plugin MyPlugin --type enhancement
306
+
307
+ # Generates:
308
+ # - src/plugins/MyPlugin/
309
+ # - index.ts (main plugin file)
310
+ # - components/ (plugin components)
311
+ # - types.ts (TypeScript definitions)
312
+ # - README.md (plugin documentation)
313
+ ```
314
+
315
+ ### Plugin Structure
316
+
317
+ ```typescript
318
+ // Generated plugin template
319
+ import { createTachUIPlugin } from '@tachui/core'
320
+
321
+ export const MyPlugin = createTachUIPlugin({
322
+ name: 'MyPlugin',
323
+ version: '1.0.0',
324
+ components: {
325
+ // Custom components
326
+ },
327
+ modifiers: {
328
+ // Custom modifiers
329
+ },
330
+ utilities: {
331
+ // Helper functions
332
+ },
333
+ })
334
+
335
+ export default MyPlugin
336
+ ```
337
+
338
+ ## Development Server
339
+
340
+ ```bash
341
+ # Start development server with hot reload
342
+ tacho dev
343
+
344
+ # Start with custom configuration
345
+ tacho dev --port 3000 --host 0.0.0.0 --https
346
+
347
+ # Start with specific environment
348
+ tacho dev --mode development --env local
349
+ ```
350
+
351
+ Features:
352
+
353
+ - **Hot Module Replacement** - Instant updates without page refresh
354
+ - **Error Overlay** - In-browser error display
355
+ - **Performance Metrics** - Real-time performance monitoring
356
+ - **Component Inspector** - Debug component hierarchy
357
+
358
+ ## Performance Tools
359
+
360
+ ### Bundle Analysis
361
+
362
+ ```bash
363
+ # Analyze bundle composition
364
+ tacho analyze
365
+
366
+ # Generate detailed report
367
+ tacho analyze --output report.html --detailed
368
+
369
+ # Compare bundle sizes
370
+ tacho analyze --compare baseline.json
371
+ ```
372
+
373
+ ### Performance Profiling
374
+
375
+ ```bash
376
+ # Profile application performance
377
+ tacho perf profile --duration 30s
378
+
379
+ # Benchmark specific components
380
+ tacho perf benchmark --components Button,Text,VStack
381
+
382
+ # Memory usage analysis
383
+ tacho perf memory --watch
384
+ ```
385
+
386
+ ## Integration Examples
387
+
388
+ ### React Integration
389
+
390
+ ```bash
391
+ tacho create my-react-app --template react-integration
392
+
393
+ # Generates project with:
394
+ # - React + tachUI setup
395
+ # - Custom React hooks for tachUI signals
396
+ # - Component interoperability
397
+ # - Shared state management
398
+ ```
399
+
400
+ ### Vue Integration
401
+
402
+ ```bash
403
+ tacho create my-vue-app --template vue-integration
404
+
405
+ # Generates project with:
406
+ # - Vue 3 + tachUI setup
407
+ # - Vue composition API integration
408
+ # - Reactive property bindings
409
+ # - Component bridge utilities
410
+ ```
411
+
412
+ ## Examples
413
+
414
+ Check out generated project examples:
415
+
416
+ - **[Basic App](https://github.com/tach-UI/tachUI/tree/main/apps/examples/cli/basic-app)**
417
+ - **[React Integration](https://github.com/tach-UI/tachUI/tree/main/apps/examples/cli/react-integration)**
418
+ - **[SwiftUI Migration](https://github.com/tach-UI/tachUI/tree/main/apps/examples/cli/swiftui-migration)**
419
+
420
+ ## API Reference
421
+
422
+ - **[CLI Commands](https://github.com/tach-UI/tachUI/blob/main/docs/api/cli/src/functions/main.md)**
423
+ - **[Configuration Options](https://github.com/tach-UI/tachUI/blob/main/docs/guide/cli/configuration.md)**
424
+ - **[Plugin Development](https://github.com/tach-UI/tachUI/blob/main/docs/guide/cli/plugins.md)**
425
+
426
+ ## Requirements
427
+
428
+ - **Node.js** 20.0+
429
+ - **@tachui/core** ^0.1.0 or later
430
+ - **TypeScript** 5.0+ (recommended)
431
+
432
+ ## Contributing
433
+
434
+ See the main [Contributing Guide](https://github.com/tach-UI/tachUI/blob/main/CONTRIBUTING.md) for information on contributing to tachUI CLI.
435
+
436
+ ## License
437
+
438
+ Mozilla Public License 2.0 - see [LICENSE](https://github.com/tach-UI/tachUI/blob/main/LICENSE) for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachui/cli",
3
- "version": "0.7.0-alpha1",
3
+ "version": "0.7.1-alpha",
4
4
  "description": "Tacho CLI - Comprehensive developer tooling for tachUI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -20,7 +20,7 @@
20
20
  "prompts": "^2.4.0",
21
21
  "fs-extra": "^11.0.0",
22
22
  "glob": "^10.0.0",
23
- "@tachui/core": "0.7.0-alpha1"
23
+ "@tachui/core": "0.7.1-alpha"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/fs-extra": "^11.0.0",
@@ -42,7 +42,7 @@
42
42
  "license": "MPL-2.0",
43
43
  "repository": {
44
44
  "type": "git",
45
- "url": "https://github.com/tachui/tachui",
45
+ "url": "https://github.com/tach-UI/tachUI",
46
46
  "directory": "packages/cli"
47
47
  },
48
48
  "scripts": {