@seeka-labs/cli-apps-azure 3.9.2 → 3.9.3

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.cjs CHANGED
@@ -5730,7 +5730,7 @@ var require_commander = __commonJS({
5730
5730
  var version;
5731
5731
  var init_package = __esm({
5732
5732
  "../cli-apps/package.json"() {
5733
- version = "3.9.2";
5733
+ version = "3.9.3";
5734
5734
  }
5735
5735
  });
5736
5736
 
@@ -104460,7 +104460,7 @@ npmScopes:
104460
104460
  var version2;
104461
104461
  var init_package2 = __esm({
104462
104462
  "package.json"() {
104463
- version2 = "3.9.2";
104463
+ version2 = "3.9.3";
104464
104464
  }
104465
104465
  });
104466
104466
 
@@ -104569,7 +104569,7 @@ async function initAppCommand2(config) {
104569
104569
  if (fs14.existsSync(localAppPath)) {
104570
104570
  const files = fs14.readdirSync(localAppPath);
104571
104571
  if (files.length > 0) {
104572
- const isOnlySeeka = files.length === 1 && (files[0] === ".seeka" || files[0] === ".vscode" || files[0] === ".idea");
104572
+ const isOnlySeeka = files.every((file) => file === ".seeka" || file === ".vscode" || file === ".idea");
104573
104573
  if (!isOnlySeeka) {
104574
104574
  throw new Error(`Directory ${localAppPath} is not empty and contains files other than .seeka or .idea or .vscode folders. Please provide an empty directory or one that only contains a .seeka/ folder.`);
104575
104575
  }
@@ -104706,7 +104706,7 @@ async function initAppCommand2(config) {
104706
104706
  type: "input",
104707
104707
  name: "selfHostBaseUrl",
104708
104708
  message: sharedEnvConfigPrompts.selfHostBaseUrl.message,
104709
- default: mergedEnvVars.SELF_HOST_BASEURL ?? "https://seeka-app-kim-experiment-localdev.au.ngrok.io"
104709
+ default: mergedEnvVars.SELF_HOST_BASEURL ?? `https://apps.seeka.services/${config.appName}`
104710
104710
  }
104711
104711
  ]);
104712
104712
  const { azureFunctionResourceGroupName, viteBaseUrl } = answers;
@@ -105022,7 +105022,7 @@ async function initEnvironmentCommand(config) {
105022
105022
  type: "input",
105023
105023
  name: "selfHostBaseUrl",
105024
105024
  message: sharedEnvConfigPrompts.selfHostBaseUrl.message,
105025
- default: config.environmentVariables?.SELF_HOST_BASEURL ?? "https://seeka-app-kim-experiment-localdev.au.ngrok.io"
105025
+ default: config.environmentVariables?.SELF_HOST_BASEURL ?? `https://apps.seeka.services/${config.appName}`
105026
105026
  }
105027
105027
  ]);
105028
105028
  const { octokit } = await authenticateWithGitHub();
@@ -105262,7 +105262,7 @@ async function updateEnvironmentCommand(config) {
105262
105262
  type: "input",
105263
105263
  name: "selfHostBaseUrl",
105264
105264
  message: sharedEnvConfigPrompts.selfHostBaseUrl.message,
105265
- default: configEnvVars.SELF_HOST_BASEURL ?? "https://seeka-app-kim-experiment-localdev.au.ngrok.io"
105265
+ default: configEnvVars.SELF_HOST_BASEURL ?? `https://apps.seeka.services/${config.appName}`
105266
105266
  }
105267
105267
  ]);
105268
105268
  const azureFuncSlotName = additionalAnswers.azureFuncSlotName;
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seeka-labs/cli-apps-azure",
3
- "version": "3.9.2",
3
+ "version": "3.9.3",
4
4
  "type": "module",
5
5
  "description": "Seeka - Apps CLI - Azure",
6
6
  "author": "SEEKA <platform@seeka.co>",
@@ -33,7 +33,7 @@
33
33
  "devDependencies": {
34
34
  "@jest/globals": "^30",
35
35
  "@octokit/rest": "^22.0.1",
36
- "@seeka-labs/cli-apps": "^3.9.2",
36
+ "@seeka-labs/cli-apps": "^3.9.3",
37
37
  "@types/cross-spawn": "^6",
38
38
  "@types/jest": "^30",
39
39
  "@types/libsodium-wrappers": "^0.7",
@@ -52,6 +52,5 @@
52
52
  "ts-jest": "^29",
53
53
  "ts-node": "^10",
54
54
  "typescript": "^5"
55
- },
56
- "gitHead": "6cc6b19261cbd4af64587a225406946210392c0c"
55
+ }
57
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