@seeka-labs/cli-apps-azure 3.8.8 → 3.9.1
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/{index.js → index.cjs} +26046 -878
- package/dist/init-template.zip +0 -0
- package/package.json +16 -12
- package/README.md +0 -307
- package/dist/index.js.map +0 -7
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seeka-labs/cli-apps-azure",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "Seeka - Apps CLI - Azure",
|
|
5
6
|
"author": "SEEKA <platform@seeka.co>",
|
|
6
7
|
"license": "MIT",
|
|
@@ -11,32 +12,35 @@
|
|
|
11
12
|
"azure"
|
|
12
13
|
],
|
|
13
14
|
"files": [
|
|
14
|
-
"dist/"
|
|
15
|
+
"dist/index.cjs",
|
|
16
|
+
"dist/init-template.zip"
|
|
15
17
|
],
|
|
16
|
-
"bin": "./dist/index.
|
|
18
|
+
"bin": "./dist/index.cjs",
|
|
17
19
|
"publishConfig": {
|
|
18
20
|
"access": "public"
|
|
19
21
|
},
|
|
20
22
|
"scripts": {
|
|
21
|
-
"test": "jest",
|
|
23
|
+
"test": "jest --config jest.config.cjs",
|
|
22
24
|
"typecheck": "tsc --noEmit",
|
|
23
|
-
"build:ci": "tsc --noEmit && esbuild src/index.ts --bundle --sourcemap --platform=node --target=node22 --outfile=dist/index.
|
|
24
|
-
"build": "tsc --noEmit && esbuild src/index.ts --bundle --sourcemap --platform=node --target=node22 --outfile=dist/index.
|
|
25
|
+
"build:ci": "tsc --noEmit && esbuild src/index.ts --bundle --sourcemap --platform=node --target=node22 --outfile=dist/index.cjs && ts-node scripts/copy-template-zip.ts",
|
|
26
|
+
"build": "tsc --noEmit && esbuild src/index.ts --bundle --sourcemap --platform=node --target=node22 --outfile=dist/index.cjs && ts-node scripts/copy-template-zip.ts",
|
|
25
27
|
"watch": "tsc -w",
|
|
26
28
|
"clean": "rimraf dist",
|
|
27
|
-
"dev": "yarn run clean && yarn build && node dist/index.
|
|
28
|
-
"dev:kim": "yarn run clean && yarn build && node dist/index.
|
|
29
|
-
"dev:linkedin": "yarn run clean && yarn build && node dist/index.
|
|
29
|
+
"dev": "yarn run clean && yarn build && node dist/index.cjs",
|
|
30
|
+
"dev:kim": "yarn run clean && yarn build && node dist/index.cjs --configFile ../cli-apps/configs/azurefunc/kim-experiment.seeka.cli.config.json",
|
|
31
|
+
"dev:linkedin": "yarn run clean && yarn build && node dist/index.cjs --configFile ../cli-apps/configs/azurefunc/linkedin.prod.seeka.cli.config.json"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
34
|
"@jest/globals": "^30",
|
|
33
35
|
"@octokit/rest": "^22.0.1",
|
|
34
|
-
"@seeka-labs/cli-apps": "^3.
|
|
36
|
+
"@seeka-labs/cli-apps": "^3.9.1",
|
|
37
|
+
"@types/cross-spawn": "^6",
|
|
35
38
|
"@types/jest": "^30",
|
|
36
39
|
"@types/libsodium-wrappers": "^0.7",
|
|
37
40
|
"@types/lodash-es": "^4",
|
|
38
41
|
"@types/node": "^22",
|
|
39
42
|
"commander": "^14",
|
|
43
|
+
"cross-spawn": "^7",
|
|
40
44
|
"esbuild": "^0",
|
|
41
45
|
"glob": "^13",
|
|
42
46
|
"inquirer": "^13.2.0",
|
|
@@ -46,7 +50,7 @@
|
|
|
46
50
|
"open": "^11",
|
|
47
51
|
"source-map-support": "^0",
|
|
48
52
|
"ts-jest": "^29",
|
|
53
|
+
"ts-node": "^10",
|
|
49
54
|
"typescript": "^5"
|
|
50
|
-
}
|
|
51
|
-
"gitHead": "6e7b919b2db9028b1757cc74738bb5a0b9fb68b6"
|
|
55
|
+
}
|
|
52
56
|
}
|
package/README.md
DELETED
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
# @seeka-labs/cli-apps-azure
|
|
2
|
-
|
|
3
|
-
Azure-specific CLI tools for Seeka Apps. This package provides commands for setting up GitHub repositories and managing deployment environments for Seeka apps running on Azure Functions.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# Using npm
|
|
9
|
-
npm install -g @seeka-labs/cli-apps-azure
|
|
10
|
-
|
|
11
|
-
# Using yarn
|
|
12
|
-
yarn global add @seeka-labs/cli-apps-azure
|
|
13
|
-
|
|
14
|
-
# Or run directly with npx
|
|
15
|
-
npx @seeka-labs/cli-apps-azure@latest
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Prerequisites
|
|
19
|
-
|
|
20
|
-
- A Seeka app created with [`@seeka-labs/cli-apps`](https://www.npmjs.com/package/@seeka-labs/cli-apps)
|
|
21
|
-
- A GitHub account with permissions to create repositories
|
|
22
|
-
- Node.js 18 or later
|
|
23
|
-
|
|
24
|
-
## Quick Start
|
|
25
|
-
|
|
26
|
-
Run the CLI from your Seeka app directory:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
cd your-seeka-app
|
|
30
|
-
npx @seeka-labs/cli-apps-azure@latest
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
The CLI will automatically detect your app configuration from `.seeka/init.app.seeka.cli.config.json`.
|
|
34
|
-
|
|
35
|
-
## Commands
|
|
36
|
-
|
|
37
|
-
The CLI operates in **interactive mode** and presents a menu of available actions:
|
|
38
|
-
|
|
39
|
-
### 1. Initialize GitHub Repository
|
|
40
|
-
|
|
41
|
-
Creates a new GitHub repository for your Seeka app with all the necessary configuration for Azure Functions deployment.
|
|
42
|
-
|
|
43
|
-
#### What It Does
|
|
44
|
-
|
|
45
|
-
1. **Prompts for VITE_BASE_URL** - The base URL path for your app (default: `/{appName}/app/`)
|
|
46
|
-
2. **Authenticates with GitHub** - Uses OAuth Device Flow (opens browser for authorization)
|
|
47
|
-
3. **Selects repository owner** - Choose between your personal account or an organization
|
|
48
|
-
4. **Creates private repository** - Named `seeka-app-{appName}`
|
|
49
|
-
5. **Sets repository variables**:
|
|
50
|
-
- `AZURE_FUNC_RESOURCE_NAME` - Azure Function resource name
|
|
51
|
-
6. **Creates `prod` environment** with variables:
|
|
52
|
-
- `VITE_BASE_URL` - Base URL for the app
|
|
53
|
-
- `HOSTING_ENV_NAME` - Set to `prod`
|
|
54
|
-
|
|
55
|
-
#### Example Flow
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
$ npx @seeka-labs/cli-apps-azure@latest
|
|
59
|
-
|
|
60
|
-
🔐 Authenticating with GitHub...
|
|
61
|
-
|
|
62
|
-
Please visit: https://github.com/login/device
|
|
63
|
-
And enter code: ABCD-1234
|
|
64
|
-
|
|
65
|
-
? Open browser automatically? Yes
|
|
66
|
-
Waiting for authorization...
|
|
67
|
-
|
|
68
|
-
✓ Successfully authenticated with GitHub!
|
|
69
|
-
|
|
70
|
-
? Where do you want to create the repository?
|
|
71
|
-
> my-username (Personal Account)
|
|
72
|
-
my-organization - My Organization Description
|
|
73
|
-
|
|
74
|
-
✅ GitHub repository initialized successfully!
|
|
75
|
-
|
|
76
|
-
Repository: https://github.com/my-username/seeka-app-my-app
|
|
77
|
-
Environment: prod
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
### 2. Add Environment to Existing Repository
|
|
83
|
-
|
|
84
|
-
Adds a new deployment environment (e.g., staging) to an existing GitHub repository.
|
|
85
|
-
|
|
86
|
-
#### What It Does
|
|
87
|
-
|
|
88
|
-
1. **Prompts for environment details**:
|
|
89
|
-
- Repository owner (username or organization)
|
|
90
|
-
- Repository name (default: `seeka-app-{appName}`)
|
|
91
|
-
- Environment name (default: `seeka-app-{appName}-stag`)
|
|
92
|
-
- Azure Function slot name (default: `staging`)
|
|
93
|
-
- Various URL configurations
|
|
94
|
-
2. **Authenticates with GitHub**
|
|
95
|
-
3. **Creates the environment**
|
|
96
|
-
4. **Sets environment variables**:
|
|
97
|
-
- `AZURE_FUNC_SLOT_NAME` - Azure Function deployment slot
|
|
98
|
-
- `VITE_BASE_URL` - Base URL for the app
|
|
99
|
-
- `VITE_URLS_SEEKA_API_CORE` - Seeka API Core URL (optional)
|
|
100
|
-
- `VITE_URLS_SEEKA_APP_CORE_ORIGIN` - Seeka App Core Origin (optional)
|
|
101
|
-
- `HOSTING_ENV_NAME` - Environment name (e.g., `stag`)
|
|
102
|
-
- `SEEKA_APP_SETTINGS` - App settings JSON (default: `{}`)
|
|
103
|
-
- `SEEKA_APP_CFG_SEEKA_APP_SECRET` - Placeholder for app secret
|
|
104
|
-
|
|
105
|
-
#### Example Flow
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
$ npx @seeka-labs/cli-apps-azure@latest
|
|
109
|
-
|
|
110
|
-
? What would you like to do? Add environment to existing GitHub repository
|
|
111
|
-
|
|
112
|
-
? Enter GitHub repository owner: my-username
|
|
113
|
-
? Enter GitHub repository name: seeka-app-my-app
|
|
114
|
-
? Enter environment name: stag
|
|
115
|
-
? Enter AZURE_FUNC_SLOT_NAME: staging
|
|
116
|
-
? Enter VITE_BASE_URL: /my-app/app/
|
|
117
|
-
? Enter VITE_URLS_SEEKA_API_CORE (optional):
|
|
118
|
-
? Enter VITE_URLS_SEEKA_APP_CORE_ORIGIN (optional):
|
|
119
|
-
? Enter HOSTING_ENV_NAME: stag
|
|
120
|
-
|
|
121
|
-
🔐 Authenticating with GitHub...
|
|
122
|
-
...
|
|
123
|
-
|
|
124
|
-
✅ Environment added successfully!
|
|
125
|
-
|
|
126
|
-
Repository: https://github.com/my-username/seeka-app-my-app
|
|
127
|
-
Environment: stag
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
### 3. Update Environment Variables and Secrets
|
|
133
|
-
|
|
134
|
-
Updates all environment variables and secrets for an existing environment, with confirmation prompts before overwriting existing values.
|
|
135
|
-
|
|
136
|
-
#### What It Does
|
|
137
|
-
|
|
138
|
-
1. **Prompts for environment details**:
|
|
139
|
-
- Repository owner (username or organization)
|
|
140
|
-
- Repository name (default: `seeka-app-{appName}`)
|
|
141
|
-
- Environment name (default: `seeka-app-{appName}-stag`)
|
|
142
|
-
2. **Authenticates with GitHub**
|
|
143
|
-
3. **Fetches existing variables and secrets**
|
|
144
|
-
4. **For each variable/secret to update**:
|
|
145
|
-
- If it exists, prompts for confirmation before overwriting
|
|
146
|
-
- For plain text variables: shows old and new values in the confirmation
|
|
147
|
-
- For secrets: only shows the name (value hidden for security)
|
|
148
|
-
5. **Sets environment variables and secrets** based on configuration
|
|
149
|
-
|
|
150
|
-
#### Example Flow
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
$ npx @seeka-labs/cli-apps-azure@latest
|
|
154
|
-
|
|
155
|
-
? What would you like to do? Update environment variables and secrets (overwrite existing)
|
|
156
|
-
|
|
157
|
-
? Enter GitHub repository owner: my-username
|
|
158
|
-
? Enter GitHub repository name: seeka-app-my-app
|
|
159
|
-
? Enter environment name: stag
|
|
160
|
-
|
|
161
|
-
🔐 Authenticating with GitHub...
|
|
162
|
-
...
|
|
163
|
-
|
|
164
|
-
🔐 Processing environment secrets...
|
|
165
|
-
? Overwrite secret "SEEKA_APP_CFG_SEEKA_APP_SECRET"? (value hidden for security) Yes
|
|
166
|
-
✓ Set environment secret: SEEKA_APP_CFG_SEEKA_APP_SECRET
|
|
167
|
-
|
|
168
|
-
🔧 Processing environment variables...
|
|
169
|
-
? Overwrite variable "VITE_BASE_URL"?
|
|
170
|
-
Old: /old-app/app/
|
|
171
|
-
New: /my-app/app/ Yes
|
|
172
|
-
✓ Set environment variable: VITE_BASE_URL
|
|
173
|
-
|
|
174
|
-
✅ Environment updated successfully!
|
|
175
|
-
|
|
176
|
-
Repository: https://github.com/my-username/seeka-app-my-app
|
|
177
|
-
Environment: stag
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Configuration
|
|
183
|
-
|
|
184
|
-
### Automatic Configuration Detection
|
|
185
|
-
|
|
186
|
-
The CLI automatically looks for configuration in:
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
.seeka/init.app.seeka.cli.config.json
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
This file is created when you initialize a Seeka app with `@seeka-labs/cli-apps`.
|
|
193
|
-
|
|
194
|
-
### Manual Configuration
|
|
195
|
-
|
|
196
|
-
You can specify a custom configuration file:
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
npx @seeka-labs/cli-apps-azure@latest --configFile ./path/to/config.json
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
#### Configuration File Format
|
|
203
|
-
|
|
204
|
-
```json
|
|
205
|
-
{
|
|
206
|
-
"orgName": "my-org",
|
|
207
|
-
"appName": "my-app"
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
If no configuration file is found, the CLI will prompt you for the organization and app name.
|
|
212
|
-
|
|
213
|
-
---
|
|
214
|
-
|
|
215
|
-
## GitHub Authentication
|
|
216
|
-
|
|
217
|
-
This CLI uses **OAuth Device Flow** for GitHub authentication:
|
|
218
|
-
|
|
219
|
-
1. **Secure** - No client secret required (safe for public npm distribution)
|
|
220
|
-
2. **Browser-based** - Opens your browser for authorization
|
|
221
|
-
3. **Scoped** - Only requests `repo` scope for repository management
|
|
222
|
-
4. **Session-only** - Access tokens are stored in-memory only and never persisted to disk
|
|
223
|
-
|
|
224
|
-
### Required GitHub Permissions
|
|
225
|
-
|
|
226
|
-
The authenticated user needs:
|
|
227
|
-
- Permission to create repositories (personal or in the selected organization)
|
|
228
|
-
- Permission to manage repository variables and environments
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
## Environment Variables Reference
|
|
233
|
-
|
|
234
|
-
### Repository-Level Variables
|
|
235
|
-
|
|
236
|
-
| Variable | Description |
|
|
237
|
-
|----------|-------------|
|
|
238
|
-
| `AZURE_FUNC_RESOURCE_NAME` | Name of the Azure Function App resource |
|
|
239
|
-
|
|
240
|
-
### Environment-Level Variables
|
|
241
|
-
|
|
242
|
-
| Variable | Description |
|
|
243
|
-
|----------|-------------|
|
|
244
|
-
| `AZURE_FUNC_SLOT_NAME` | Azure Function deployment slot name |
|
|
245
|
-
| `VITE_BASE_URL` | Base URL path for the app |
|
|
246
|
-
| `VITE_URLS_SEEKA_API_CORE` | Seeka API Core URL |
|
|
247
|
-
| `VITE_URLS_SEEKA_APP_CORE_ORIGIN` | Seeka App Core Origin URL |
|
|
248
|
-
| `HOSTING_ENV_NAME` | Environment name (e.g., `prod`, `stag`) |
|
|
249
|
-
| `SEEKA_APP_SETTINGS` | JSON object for app-specific settings |
|
|
250
|
-
| `SEEKA_APP_CFG_SEEKA_APP_SECRET` | Seeka App Secret (configure in GitHub) |
|
|
251
|
-
|
|
252
|
-
---
|
|
253
|
-
|
|
254
|
-
## Typical Workflow
|
|
255
|
-
|
|
256
|
-
1. **Create your Seeka app**:
|
|
257
|
-
```bash
|
|
258
|
-
npx @seeka-labs/cli-apps@latest init my-org my-app --template azure-function
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
2. **Initialize GitHub repository**:
|
|
262
|
-
```bash
|
|
263
|
-
cd seeka-app-my-app
|
|
264
|
-
npx @seeka-labs/cli-apps-azure@latest
|
|
265
|
-
# Select "Initialize GitHub repository"
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
3. **Push your code**:
|
|
269
|
-
```bash
|
|
270
|
-
git init
|
|
271
|
-
git add .
|
|
272
|
-
git commit -m "Initial commit"
|
|
273
|
-
git remote add origin https://github.com/your-username/seeka-app-my-app.git
|
|
274
|
-
git push -u origin main
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
4. **Add staging environment** (optional):
|
|
278
|
-
```bash
|
|
279
|
-
npx @seeka-labs/cli-apps-azure@latest
|
|
280
|
-
# Select "Add environment to existing GitHub repository"
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
5. **Configure Azure OIDC** in GitHub repository secrets:
|
|
284
|
-
- `AZURE_CLIENT_ID`
|
|
285
|
-
- `AZURE_TENANT_ID`
|
|
286
|
-
- `AZURE_SUBSCRIPTION_ID`
|
|
287
|
-
|
|
288
|
-
6. **Deploy** - Push to `main` or `staging` branch to trigger GitHub Actions deployment
|
|
289
|
-
|
|
290
|
-
---
|
|
291
|
-
|
|
292
|
-
## Related Packages
|
|
293
|
-
|
|
294
|
-
- [`@seeka-labs/cli-apps`](https://www.npmjs.com/package/@seeka-labs/cli-apps) - Main Seeka Apps CLI for scaffolding applications
|
|
295
|
-
|
|
296
|
-
---
|
|
297
|
-
|
|
298
|
-
## Support
|
|
299
|
-
|
|
300
|
-
- [Seeka Developer Documentation](https://developers.seeka.co)
|
|
301
|
-
- [Seeka Platform](https://seeka.app)
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
## License
|
|
306
|
-
|
|
307
|
-
MIT
|