@webmate-studio/cli 0.2.12 → 0.2.13

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/bin/wm.mjs +95 -0
  2. package/package.json +2 -2
package/bin/wm.mjs ADDED
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Command } from 'commander';
4
+ import { buildCommand } from '../src/commands/build.js';
5
+ import { pushCommand } from '../src/commands/push.js';
6
+ import { devCommand } from '../src/commands/dev.js';
7
+ import { initCommand } from '../src/commands/init.js';
8
+ import { loginCommand } from '../src/commands/login.js';
9
+ import { generate } from '../src/commands/generate.js';
10
+ import { logout } from '../src/commands/logout.js';
11
+ import { info } from '../src/commands/info.js';
12
+ import { switchCommand } from '../src/commands/switch.js';
13
+
14
+ const program = new Command();
15
+
16
+ program
17
+ .name('wm')
18
+ .description('Webmate Component CLI - Build and manage HTML-first components')
19
+ .version('0.1.0');
20
+
21
+ // wm login - Login to CMS
22
+ program
23
+ .command('login')
24
+ .description('Login to Webmate CMS')
25
+ .option('-u, --url <url>', 'CMS base URL')
26
+ .action(loginCommand);
27
+
28
+ // wm init - Create new component project
29
+ program
30
+ .command('init')
31
+ .description('Initialize a new Webmate component project')
32
+ .argument('[directory]', 'Directory to initialize', '.')
33
+ .action(initCommand);
34
+
35
+ // wm generate (g) - Generate new component
36
+ program
37
+ .command('generate [type] [name]')
38
+ .alias('g')
39
+ .description('Generate a new component (optionally with islands)')
40
+ .option('--skip-wizard', 'Skip interactive wizard and create basic skeleton')
41
+ .option('--islands', 'Create component with islands support')
42
+ .option('--assets', 'Create component with assets directory')
43
+ .option('--template <framework>', 'Island framework template (vanilla|react|svelte|preact|alpine|lit)')
44
+ .option('--list-templates', 'List available island templates')
45
+ .action(generate);
46
+
47
+ // wm dev - Start development server
48
+ program
49
+ .command('dev')
50
+ .description('Start development server with live preview')
51
+ .option('-p, --port <port>', 'Port to run on', '5173')
52
+ .option('-o, --open', 'Open browser automatically')
53
+ .action(devCommand);
54
+
55
+ // wm build - Build components
56
+ program
57
+ .command('build')
58
+ .description('Build components for production')
59
+ .option('-o, --output <dir>', 'Output directory', './dist')
60
+ .option('-m, --minify', 'Minify output')
61
+ .option('--watch', 'Watch for changes')
62
+ .action(buildCommand);
63
+
64
+ // wm push - Upload to CMS
65
+ program
66
+ .command('push')
67
+ .description('Upload components to CMS (auto-builds by default)')
68
+ .option('-t, --target <url>', 'CMS target URL')
69
+ .option('--token <token>', 'Authentication token')
70
+ .option('-f, --force', 'Overwrite existing version (development only)')
71
+ .option('--patch', 'Increment patch version (x.y.Z)')
72
+ .option('--minor', 'Increment minor version (x.Y.0)')
73
+ .option('--major', 'Increment major version (X.0.0)')
74
+ .option('--no-build', 'Skip auto-build, use existing dist/ (for CI/CD)')
75
+ .action(pushCommand);
76
+
77
+ // wm logout - Logout from CMS
78
+ program
79
+ .command('logout')
80
+ .description('Logout from Webmate CMS')
81
+ .action(logout);
82
+
83
+ // wm info - Show current project information
84
+ program
85
+ .command('info')
86
+ .description('Show current project information')
87
+ .action(info);
88
+
89
+ // wm switch - Switch to a different project
90
+ program
91
+ .command('switch')
92
+ .description('Switch to a different project')
93
+ .action(switchCommand);
94
+
95
+ program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webmate-studio/cli",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio CLI - Build and manage your Webmate components",
6
6
  "keywords": [
@@ -17,7 +17,7 @@
17
17
  "url": "https://github.com/webmate-studio/cli.git"
18
18
  },
19
19
  "bin": {
20
- "wm": "./bin/wm.js"
20
+ "wm": "./bin/wm.mjs"
21
21
  },
22
22
  "files": [
23
23
  "bin",