@tachui/cli 0.7.0-alpha1 โ†’ 0.8.0-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 +439 -0
  2. package/package.json +16 -5
package/README.md ADDED
@@ -0,0 +1,439 @@
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@0.8.0-alpha
27
+ # or
28
+ pnpm add -g @tachui/cli@0.8.0-alpha
29
+ ```
30
+
31
+ ### Local Project Installation
32
+
33
+ ```bash
34
+ npm install --save-dev @tachui/cli@0.8.0-alpha
35
+ # or
36
+ pnpm add -D @tachui/cli@0.8.0-alpha
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 { createSignal } from '@tachui/core'
277
+ import { VStack, Text, Button } from '@tachui/primitives'
278
+
279
+ const ContentView = () => {
280
+ const [count, setCount] = createSignal(0)
281
+
282
+ return VStack({
283
+ children: [
284
+ Text(() => `Count: ${count()}`)
285
+ .modifier.font({ size: 24, weight: 'bold' })
286
+ .foregroundColor('#007AFF')
287
+ .build(),
288
+
289
+ Button('Increment', () => setCount(count() + 1))
290
+ .modifier.padding(16)
291
+ .backgroundColor('#007AFF')
292
+ .foregroundColor('white')
293
+ .cornerRadius(8)
294
+ .build(),
295
+ ],
296
+ spacing: 20,
297
+ }).build()
298
+ }
299
+ ```
300
+
301
+ ## Plugin Development
302
+
303
+ ### Create Plugin Template
304
+
305
+ ```bash
306
+ tacho generate plugin MyPlugin --type enhancement
307
+
308
+ # Generates:
309
+ # - src/plugins/MyPlugin/
310
+ # - index.ts (main plugin file)
311
+ # - components/ (plugin components)
312
+ # - types.ts (TypeScript definitions)
313
+ # - README.md (plugin documentation)
314
+ ```
315
+
316
+ ### Plugin Structure
317
+
318
+ ```typescript
319
+ // Generated plugin template
320
+ import { createTachUIPlugin } from '@tachui/core'
321
+
322
+ export const MyPlugin = createTachUIPlugin({
323
+ name: 'MyPlugin',
324
+ version: '1.0.0',
325
+ components: {
326
+ // Custom components
327
+ },
328
+ modifiers: {
329
+ // Custom modifiers
330
+ },
331
+ utilities: {
332
+ // Helper functions
333
+ },
334
+ })
335
+
336
+ export default MyPlugin
337
+ ```
338
+
339
+ ## Development Server
340
+
341
+ ```bash
342
+ # Start development server with hot reload
343
+ tacho dev
344
+
345
+ # Start with custom configuration
346
+ tacho dev --port 3000 --host 0.0.0.0 --https
347
+
348
+ # Start with specific environment
349
+ tacho dev --mode development --env local
350
+ ```
351
+
352
+ Features:
353
+
354
+ - **Hot Module Replacement** - Instant updates without page refresh
355
+ - **Error Overlay** - In-browser error display
356
+ - **Performance Metrics** - Real-time performance monitoring
357
+ - **Component Inspector** - Debug component hierarchy
358
+
359
+ ## Performance Tools
360
+
361
+ ### Bundle Analysis
362
+
363
+ ```bash
364
+ # Analyze bundle composition
365
+ tacho analyze
366
+
367
+ # Generate detailed report
368
+ tacho analyze --output report.html --detailed
369
+
370
+ # Compare bundle sizes
371
+ tacho analyze --compare baseline.json
372
+ ```
373
+
374
+ ### Performance Profiling
375
+
376
+ ```bash
377
+ # Profile application performance
378
+ tacho perf profile --duration 30s
379
+
380
+ # Benchmark specific components
381
+ tacho perf benchmark --components Button,Text,VStack
382
+
383
+ # Memory usage analysis
384
+ tacho perf memory --watch
385
+ ```
386
+
387
+ ## Integration Examples
388
+
389
+ ### React Integration
390
+
391
+ ```bash
392
+ tacho create my-react-app --template react-integration
393
+
394
+ # Generates project with:
395
+ # - React + tachUI setup
396
+ # - Custom React hooks for tachUI signals
397
+ # - Component interoperability
398
+ # - Shared state management
399
+ ```
400
+
401
+ ### Vue Integration
402
+
403
+ ```bash
404
+ tacho create my-vue-app --template vue-integration
405
+
406
+ # Generates project with:
407
+ # - Vue 3 + tachUI setup
408
+ # - Vue composition API integration
409
+ # - Reactive property bindings
410
+ # - Component bridge utilities
411
+ ```
412
+
413
+ ## Examples
414
+
415
+ Check out generated project examples:
416
+
417
+ - **[Basic App](https://github.com/tach-UI/tachUI/tree/main/apps/examples/cli/basic-app)**
418
+ - **[React Integration](https://github.com/tach-UI/tachUI/tree/main/apps/examples/cli/react-integration)**
419
+ - **[SwiftUI Migration](https://github.com/tach-UI/tachUI/tree/main/apps/examples/cli/swiftui-migration)**
420
+
421
+ ## API Reference
422
+
423
+ - **[CLI Commands](https://github.com/tach-UI/tachUI/blob/main/docs/api/cli/src/functions/main.md)**
424
+ - **[Configuration Options](https://github.com/tach-UI/tachUI/blob/main/docs/guide/cli/configuration.md)**
425
+ - **[Plugin Development](https://github.com/tach-UI/tachUI/blob/main/docs/guide/cli/plugins.md)**
426
+
427
+ ## Requirements
428
+
429
+ - **Node.js** 20.0+
430
+ - **@tachui/core** ^0.8.0-alpha or later
431
+ - **TypeScript** 5.0+ (recommended)
432
+
433
+ ## Contributing
434
+
435
+ See the main [Contributing Guide](https://github.com/tach-UI/tachUI/blob/main/CONTRIBUTING.md) for information on contributing to tachUI CLI.
436
+
437
+ ## License
438
+
439
+ Mozilla Public License 2.0 - see [LICENSE](https://github.com/tach-UI/tachUI/blob/main/LICENSE) for details.
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@tachui/cli",
3
- "version": "0.7.0-alpha1",
3
+ "version": "0.8.0-alpha",
4
4
  "description": "Tacho CLI - Comprehensive developer tooling for tachUI",
5
+ "homepage": "https://tachui.dev/",
5
6
  "type": "module",
6
7
  "main": "./dist/index.js",
8
+ "module": "./dist/index.js",
7
9
  "types": "./dist/index.d.ts",
8
10
  "bin": {
9
11
  "tacho": "./bin/tacho.js"
@@ -20,14 +22,14 @@
20
22
  "prompts": "^2.4.0",
21
23
  "fs-extra": "^11.0.0",
22
24
  "glob": "^10.0.0",
23
- "@tachui/core": "0.7.0-alpha1"
25
+ "@tachui/core": "0.8.0-alpha"
24
26
  },
25
27
  "devDependencies": {
26
28
  "@types/fs-extra": "^11.0.0",
27
29
  "@types/prompts": "^2.4.0",
28
30
  "@types/node": "^20.0.0",
29
- "typescript": "^5.2.0",
30
- "vitest": "^1.0.0"
31
+ "typescript": "^5.8.0",
32
+ "vitest": "^3.2.4"
31
33
  },
32
34
  "keywords": [
33
35
  "cli",
@@ -42,12 +44,21 @@
42
44
  "license": "MPL-2.0",
43
45
  "repository": {
44
46
  "type": "git",
45
- "url": "https://github.com/tachui/tachui",
47
+ "url": "https://github.com/tach-UI/tachUI",
46
48
  "directory": "packages/cli"
47
49
  },
50
+ "bugs": "https://github.com/tach-UI/tachUI/issues",
51
+ "engines": {
52
+ "node": ">=20.0.0"
53
+ },
54
+ "sideEffects": false,
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
48
58
  "scripts": {
49
59
  "build": "tsc -p tsconfig.build.json",
50
60
  "dev": "tsc -p tsconfig.build.json --watch",
61
+ "valid": "clear && vitest run && tsc --noEmit && pnpm lint && pnpm build",
51
62
  "test": "vitest",
52
63
  "test:ci": "vitest run",
53
64
  "type-check": "tsc --noEmit",