@mattpeng/orbit-cli 0.0.1 → 0.0.2
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/README.md +200 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,16 +1,209 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mattpeng/orbit-cli
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A powerful deployment toolkit for frontend projects.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🚀 Easy deployment to Orbit platform
|
|
8
|
+
- 📦 Automatic asset compression
|
|
9
|
+
- 🔐 Secure token-based authentication
|
|
10
|
+
- 🌳 Git-aware deployments
|
|
11
|
+
- ⚡️ Fast and efficient
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### Global Installation (Recommended)
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g @mattpeng/orbit-cli
|
|
19
|
+
# or
|
|
20
|
+
pnpm add -g @mattpeng/orbit-cli
|
|
21
|
+
# or
|
|
22
|
+
yarn global add @mattpeng/orbit-cli
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Local Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -D @mattpeng/orbit-cli
|
|
29
|
+
# or
|
|
30
|
+
pnpm add -D @mattpeng/orbit-cli
|
|
31
|
+
# or
|
|
32
|
+
yarn add -D @mattpeng/orbit-cli
|
|
33
|
+
```
|
|
4
34
|
|
|
5
35
|
## Usage
|
|
6
36
|
|
|
37
|
+
### Initialize Configuration
|
|
38
|
+
|
|
39
|
+
Create a deployment configuration file in your project:
|
|
40
|
+
|
|
7
41
|
```bash
|
|
8
|
-
# Initialize a new project
|
|
9
42
|
orbit init
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This will create an `orbit-deploy.json` file:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"name": "my-project",
|
|
50
|
+
"outputDirectory": "dist",
|
|
51
|
+
"routes": [
|
|
52
|
+
{
|
|
53
|
+
"path": "/api/*",
|
|
54
|
+
"target": "http://api.example.com"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Deploy Your Project
|
|
61
|
+
|
|
62
|
+
Build your project first, then deploy:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Build your project
|
|
66
|
+
npm run build
|
|
67
|
+
|
|
68
|
+
# Deploy to Orbit platform
|
|
69
|
+
orbit deploy --token YOUR_DEPLOY_TOKEN
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Environment Variables
|
|
73
|
+
|
|
74
|
+
You can set the deploy token as an environment variable:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
export DEPLOY_TOKEN=your_token_here
|
|
78
|
+
orbit deploy
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Custom Server URL
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
orbit deploy --token YOUR_TOKEN --server https://your-orbit-server.com
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Configuration File
|
|
88
|
+
|
|
89
|
+
The configuration file (`orbit-deploy.json`) supports the following options:
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
{
|
|
93
|
+
"name": string, // Project name
|
|
94
|
+
"outputDirectory": string, // Build output directory (e.g., "dist", "build")
|
|
95
|
+
"routes": Array<{ // Optional: Custom routing rules
|
|
96
|
+
"path": string, // Route path pattern
|
|
97
|
+
"target": string // Target URL or path
|
|
98
|
+
}>
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Commands
|
|
10
103
|
|
|
11
|
-
|
|
12
|
-
orbit dev
|
|
104
|
+
### `orbit init`
|
|
13
105
|
|
|
14
|
-
|
|
15
|
-
|
|
106
|
+
Initialize a new Orbit deployment configuration.
|
|
107
|
+
|
|
108
|
+
### `orbit deploy`
|
|
109
|
+
|
|
110
|
+
Deploy your built assets to the Orbit platform.
|
|
111
|
+
|
|
112
|
+
Options:
|
|
113
|
+
- `--token <token>` - Deploy token (or use DEPLOY_TOKEN env var)
|
|
114
|
+
- `--server <url>` - Server URL (default: http://localhost:3001)
|
|
115
|
+
|
|
116
|
+
### `orbit dev`
|
|
117
|
+
|
|
118
|
+
Start local development server (coming soon).
|
|
119
|
+
|
|
120
|
+
## Getting a Deploy Token
|
|
121
|
+
|
|
122
|
+
1. Log in to your Orbit dashboard
|
|
123
|
+
2. Navigate to your project settings
|
|
124
|
+
3. Go to "Deployment Tokens" section
|
|
125
|
+
4. Click "Generate New Token"
|
|
126
|
+
5. Copy the token and use it in your deployments
|
|
127
|
+
|
|
128
|
+
## Examples
|
|
129
|
+
|
|
130
|
+
### Basic Deployment
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
orbit deploy --token abc123xyz
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### CI/CD Integration
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
# .github/workflows/deploy.yml
|
|
140
|
+
name: Deploy to Orbit
|
|
141
|
+
|
|
142
|
+
on:
|
|
143
|
+
push:
|
|
144
|
+
branches: [main]
|
|
145
|
+
|
|
146
|
+
jobs:
|
|
147
|
+
deploy:
|
|
148
|
+
runs-on: ubuntu-latest
|
|
149
|
+
steps:
|
|
150
|
+
- uses: actions/checkout@v3
|
|
151
|
+
|
|
152
|
+
- name: Install dependencies
|
|
153
|
+
run: npm install
|
|
154
|
+
|
|
155
|
+
- name: Build
|
|
156
|
+
run: npm run build
|
|
157
|
+
|
|
158
|
+
- name: Deploy to Orbit
|
|
159
|
+
run: npx @mattpeng/orbit-cli deploy
|
|
160
|
+
env:
|
|
161
|
+
DEPLOY_TOKEN: ${{ secrets.ORBIT_DEPLOY_TOKEN }}
|
|
16
162
|
```
|
|
163
|
+
|
|
164
|
+
### Package.json Script
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"scripts": {
|
|
169
|
+
"build": "vite build",
|
|
170
|
+
"deploy": "npm run build && orbit deploy"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Then run:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
npm run deploy
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Requirements
|
|
182
|
+
|
|
183
|
+
- Node.js >= 18
|
|
184
|
+
- Built project in the specified output directory
|
|
185
|
+
|
|
186
|
+
## Support
|
|
187
|
+
|
|
188
|
+
For issues and feature requests, please visit:
|
|
189
|
+
- [GitHub Issues](https://github.com/mattpeng/orbit/issues)
|
|
190
|
+
- [Documentation](https://github.com/mattpeng/orbit)
|
|
191
|
+
|
|
192
|
+
## License
|
|
193
|
+
|
|
194
|
+
MIT © mattpeng
|
|
195
|
+
|
|
196
|
+
## Changelog
|
|
197
|
+
|
|
198
|
+
### 0.0.2
|
|
199
|
+
|
|
200
|
+
- Fixed workspace dependency issue
|
|
201
|
+
- Removed dependency on `@orbit/shared`
|
|
202
|
+
- Improved package portability
|
|
203
|
+
|
|
204
|
+
### 0.0.1
|
|
205
|
+
|
|
206
|
+
- Initial release
|
|
207
|
+
- Basic deployment functionality
|
|
208
|
+
- Git integration
|
|
209
|
+
- Token-based authentication
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
|
-
import { APP_NAME } from '@orbit/shared';
|
|
5
4
|
import { initCommand } from './commands/init';
|
|
6
5
|
import { devCommand } from './commands/dev';
|
|
7
6
|
import { deployCommand } from './commands/deploy';
|
|
7
|
+
const APP_NAME = 'Orbit';
|
|
8
8
|
const program = new Command();
|
|
9
9
|
program
|
|
10
10
|
.name('orbit')
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,QAAQ,GAAG,OAAO,CAAA;AAExB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AAE7B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,GAAG,QAAQ,sCAAsC,CAAC;KAC9D,OAAO,CAAC,OAAO,CAAC,CAAA;AAEnB,oBAAoB;AACpB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;AAC/B,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;AAC9B,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;AAEjC,0BAA0B;AAC1B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC3B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,2BAA2B,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IAC7E,OAAO,CAAC,IAAI,EAAE,CAAA;AAChB,CAAC,CAAC,CAAA;AAEF,kBAAkB;AAClB,OAAO,CAAC,KAAK,EAAE,CAAA;AAEf,mCAAmC;AACnC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAA;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattpeng/orbit-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Orbit CLI - A powerful deployment toolkit for frontend projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"format": "prettier --write ."
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@orbit/shared": "workspace:*",
|
|
45
44
|
"archiver": "^7.0.1",
|
|
46
45
|
"chalk": "^5.4.1",
|
|
47
46
|
"commander": "^12.1.0",
|