sitevision-cli 0.0.0
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/dist/app.d.ts +7 -0
- package/dist/app.js +180 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +95 -0
- package/dist/commands/build.d.ts +12 -0
- package/dist/commands/build.js +168 -0
- package/dist/commands/deploy.d.ts +17 -0
- package/dist/commands/deploy.js +162 -0
- package/dist/commands/dev.d.ts +15 -0
- package/dist/commands/dev.js +291 -0
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/index.js +20 -0
- package/dist/commands/info.d.ts +2 -0
- package/dist/commands/info.js +66 -0
- package/dist/commands/setup-signing.d.ts +2 -0
- package/dist/commands/setup-signing.js +82 -0
- package/dist/commands/sign.d.ts +14 -0
- package/dist/commands/sign.js +103 -0
- package/dist/commands/types.d.ts +18 -0
- package/dist/commands/types.js +1 -0
- package/dist/components/DevPropertiesForm.d.ts +11 -0
- package/dist/components/DevPropertiesForm.js +87 -0
- package/dist/components/InfoScreen.d.ts +8 -0
- package/dist/components/InfoScreen.js +60 -0
- package/dist/components/MainMenu.d.ts +8 -0
- package/dist/components/MainMenu.js +138 -0
- package/dist/components/PasswordInput.d.ts +8 -0
- package/dist/components/PasswordInput.js +30 -0
- package/dist/components/ProcessOutput.d.ts +7 -0
- package/dist/components/ProcessOutput.js +32 -0
- package/dist/components/SetupFlow.d.ts +8 -0
- package/dist/components/SetupFlow.js +194 -0
- package/dist/components/SigningPropertiesForm.d.ts +8 -0
- package/dist/components/SigningPropertiesForm.js +49 -0
- package/dist/components/StatusIndicator.d.ts +9 -0
- package/dist/components/StatusIndicator.js +36 -0
- package/dist/components/TextInput.d.ts +11 -0
- package/dist/components/TextInput.js +37 -0
- package/dist/types/index.d.ts +250 -0
- package/dist/types/index.js +6 -0
- package/dist/utils/password-prompt.d.ts +4 -0
- package/dist/utils/password-prompt.js +45 -0
- package/dist/utils/process-runner.d.ts +30 -0
- package/dist/utils/process-runner.js +119 -0
- package/dist/utils/project-detection.d.ts +103 -0
- package/dist/utils/project-detection.js +287 -0
- package/dist/utils/sitevision-api.d.ts +56 -0
- package/dist/utils/sitevision-api.js +393 -0
- package/dist/utils/webpack-runner.d.ts +75 -0
- package/dist/utils/webpack-runner.js +313 -0
- package/dist/utils/zip.d.ts +64 -0
- package/dist/utils/zip.js +246 -0
- package/package.json +59 -0
- package/readme.md +196 -0
package/readme.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Sitevision CLI
|
|
2
|
+
|
|
3
|
+
A modern TUI (Terminal User Interface) for Sitevision app development. Built with [Ink](https://github.com/vadimdemedes/ink) for a beautiful command-line experience.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Interactive Menu** - Full-screen TUI with arrow key navigation
|
|
8
|
+
- **Standalone CLI** - No dependency on sitevision-scripts, handles everything natively
|
|
9
|
+
- **Project Detection** - Automatically detects Sitevision projects
|
|
10
|
+
- **Webpack Integration** - Built-in webpack bundling for development and production
|
|
11
|
+
- **App Signing** - Sign apps via developer.sitevision.se for production deployment
|
|
12
|
+
- **Live Feedback** - Real-time status updates and progress indicators
|
|
13
|
+
- **Two Modes** - Interactive menu OR direct command execution
|
|
14
|
+
- **Automatic Setup** - Guided setup for dev properties and signing credentials
|
|
15
|
+
- **Secure Credentials** - Passwords can be entered per-session (not stored on disk)
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install --global @sitevision/cli
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
The CLI must be run inside a Sitevision project directory (containing a `manifest.json`).
|
|
26
|
+
|
|
27
|
+
### Interactive Mode
|
|
28
|
+
|
|
29
|
+
Simply run `svc` to launch the interactive menu:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
svc
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
On first run (or if setup is incomplete), the CLI will:
|
|
36
|
+
1. Check if `node_modules` exists and offer to run `npm install` if missing
|
|
37
|
+
2. Check if dev properties are configured and offer to set them up if missing
|
|
38
|
+
3. Display project information
|
|
39
|
+
4. Show the main menu
|
|
40
|
+
|
|
41
|
+
Use arrow keys to navigate and Enter to select:
|
|
42
|
+
- **Dev** - Start development server with watch mode
|
|
43
|
+
- **Dev (Signed)** - Development with automatic signing before each deploy
|
|
44
|
+
- **Build** - Build for production
|
|
45
|
+
- **Sign** - Sign the app for production deployment
|
|
46
|
+
- **Deploy** - Deploy to dev server
|
|
47
|
+
- **Deploy (Force)** - Force deploy (overwrite existing)
|
|
48
|
+
- **Deploy Production** - Deploy signed app to production
|
|
49
|
+
- **Info** - Show project info
|
|
50
|
+
- **Exit**
|
|
51
|
+
|
|
52
|
+
### Direct Commands
|
|
53
|
+
|
|
54
|
+
You can also run commands directly:
|
|
55
|
+
|
|
56
|
+
#### Development
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Start development server with watch mode
|
|
60
|
+
svc dev
|
|
61
|
+
|
|
62
|
+
# Start development server with automatic signing
|
|
63
|
+
svc dev --signed
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Building
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Build the application for production
|
|
70
|
+
svc build
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### Signing
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Sign the app for production deployment
|
|
77
|
+
svc sign
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Deployment
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Deploy to development server
|
|
84
|
+
svc deploy
|
|
85
|
+
|
|
86
|
+
# Force deploy (overwrite existing)
|
|
87
|
+
svc deploy --force
|
|
88
|
+
|
|
89
|
+
# Deploy to production (requires signed app)
|
|
90
|
+
svc deploy --production
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Setup
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Configure signing credentials
|
|
97
|
+
svc setup-signing
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Project Info
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Show project information and configuration
|
|
104
|
+
svc info
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Configuration
|
|
108
|
+
|
|
109
|
+
### Development Properties (`.dev_properties.json`)
|
|
110
|
+
|
|
111
|
+
Create this file in your project root for deployment configuration:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"domain": "your-site.sitevision.se",
|
|
116
|
+
"siteName": "YourSite",
|
|
117
|
+
"addonName": "your-addon",
|
|
118
|
+
"username": "your-email@example.com",
|
|
119
|
+
"password": "",
|
|
120
|
+
"useHTTPForDevDeploy": false,
|
|
121
|
+
"signingUsername": "your-developer-account@example.com",
|
|
122
|
+
"certificateName": "optional-certificate-name"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Note:** You can leave `password` empty - the CLI will prompt for it securely at runtime and store it in session memory only.
|
|
127
|
+
|
|
128
|
+
### Signing Credentials
|
|
129
|
+
|
|
130
|
+
Signing credentials are used to sign apps via developer.sitevision.se:
|
|
131
|
+
- `signingUsername` - Your developer.sitevision.se account
|
|
132
|
+
- `certificateName` - Optional, if you have multiple certificates
|
|
133
|
+
|
|
134
|
+
The signing password is never stored on disk - it's prompted for each session.
|
|
135
|
+
|
|
136
|
+
## Architecture
|
|
137
|
+
|
|
138
|
+
This CLI is a standalone tool that handles all Sitevision development tasks natively:
|
|
139
|
+
|
|
140
|
+
- **Webpack Bundling** - Uses webpack directly for building bundled apps
|
|
141
|
+
- **REST API Integration** - Communicates directly with Sitevision REST APIs
|
|
142
|
+
- **App Signing** - Signs apps via developer.sitevision.se API
|
|
143
|
+
- **TUI Components** - Rich terminal UI built with Ink
|
|
144
|
+
|
|
145
|
+
### Directory Structure
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
source/
|
|
149
|
+
├── cli.tsx # CLI entry point and argument parsing
|
|
150
|
+
├── app.tsx # Main app component and state management
|
|
151
|
+
├── commands/ # Command implementations
|
|
152
|
+
│ ├── types.ts # Command type definitions
|
|
153
|
+
│ ├── index.ts # Command exports
|
|
154
|
+
│ ├── dev.tsx # Development server with watch mode
|
|
155
|
+
│ ├── build.tsx # Production build
|
|
156
|
+
│ ├── deploy.tsx # Deployment to dev/production
|
|
157
|
+
│ ├── sign.tsx # App signing
|
|
158
|
+
│ ├── setup-signing.tsx # Signing credentials setup
|
|
159
|
+
│ └── info.tsx # Project info display
|
|
160
|
+
├── components/ # Reusable UI components
|
|
161
|
+
│ ├── MainMenu.tsx # Interactive main menu
|
|
162
|
+
│ ├── SetupFlow.tsx # Initial setup wizard
|
|
163
|
+
│ ├── DevPropertiesForm.tsx # Dev properties configuration
|
|
164
|
+
│ ├── SigningPropertiesForm.tsx # Signing setup form
|
|
165
|
+
│ ├── PasswordInput.tsx # Secure password input
|
|
166
|
+
│ ├── TextInput.tsx # Text input component
|
|
167
|
+
│ ├── InfoScreen.tsx # Project info display
|
|
168
|
+
│ ├── StatusIndicator.tsx # Status/progress indicator
|
|
169
|
+
│ └── ProcessOutput.tsx # Process output display
|
|
170
|
+
├── types/ # TypeScript type definitions
|
|
171
|
+
│ └── index.ts # Shared types
|
|
172
|
+
└── utils/ # Utility modules
|
|
173
|
+
├── project-detection.ts # Project validation and paths
|
|
174
|
+
├── sitevision-api.ts # Sitevision REST API client
|
|
175
|
+
├── webpack-runner.ts # Webpack integration
|
|
176
|
+
├── zip.ts # Zip file utilities
|
|
177
|
+
├── process-runner.ts # Process spawning
|
|
178
|
+
└── password-prompt.ts # Password prompting
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Development
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Install dependencies
|
|
185
|
+
npm install
|
|
186
|
+
|
|
187
|
+
# Build
|
|
188
|
+
npm run build
|
|
189
|
+
|
|
190
|
+
# Watch mode
|
|
191
|
+
npm run dev
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## License
|
|
195
|
+
|
|
196
|
+
MIT
|