@biznetgio/neo-app 0.4.26 → 0.4.27
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/package.json +1 -1
- package/src/deploySource.js +4 -1
- package/src/mcp/tools.js +7 -1
package/package.json
CHANGED
package/src/deploySource.js
CHANGED
|
@@ -140,7 +140,7 @@ function looksStatic(dir) {
|
|
|
140
140
|
// With `dryRun`, it performs NO create/update/upload/deploy — only the GETs needed to
|
|
141
141
|
// build a plan — and returns { dryRun:true, plan } (JNG #93).
|
|
142
142
|
// Returns { pending, approvalId } or { appId, url, result }. `log(msg)` is optional.
|
|
143
|
-
export async function deploySource(api, { projectId, src, name, port, build, serviceType, environment, dryRun = false, timeout = 300, log = () => {} }) {
|
|
143
|
+
export async function deploySource(api, { projectId, src, name, port, build, serviceType, buildCommand, publishDirectory, environment, dryRun = false, timeout = 300, log = () => {} }) {
|
|
144
144
|
const defaultName =
|
|
145
145
|
src.mode === 'image' ? src.image.split('/').pop().split(':')[0]
|
|
146
146
|
: src.mode === 'git' ? basename(src.repo, '.git')
|
|
@@ -220,6 +220,9 @@ export async function deploySource(api, { projectId, src, name, port, build, ser
|
|
|
220
220
|
// A worker has no public listener: don't request a port or TLS/ingress.
|
|
221
221
|
port: isWorker ? undefined : (port ? Number(port) : undefined),
|
|
222
222
|
tls: isWorker ? false : true,
|
|
223
|
+
// static_site native hosting: build + serve a published directory (§4.3).
|
|
224
|
+
buildCommand: svcType === 'static_site' ? (buildCommand || undefined) : undefined,
|
|
225
|
+
publishDirectory: svcType === 'static_site' ? (publishDirectory || undefined) : undefined,
|
|
223
226
|
});
|
|
224
227
|
if (pending(res)) return { pending: true, approvalId: res.data.approvalId };
|
|
225
228
|
app = res.data?.application || res.data;
|
package/src/mcp/tools.js
CHANGED
|
@@ -92,7 +92,7 @@ export const TOOLS = [
|
|
|
92
92
|
const resourceTypes = [
|
|
93
93
|
{ type: 'web', create: true, deploy: true, scale: true, logs: true, variables: true, delete: true },
|
|
94
94
|
{ type: 'template', create: true, deploy: true, scale: false, logs: true, variables: true, delete: true },
|
|
95
|
-
{ type: 'static_site', create: 'via_folder', deploy: true, scale: false, logs: true, variables: true, delete: true, note: 'neo_deploy_folder serviceType=static_site (auto-detected for static-only folders
|
|
95
|
+
{ type: 'static_site', create: 'via_folder', deploy: true, scale: false, logs: true, variables: true, delete: true, nativeStatic: true, note: 'neo_deploy_folder serviceType=static_site with buildCommand/publishDirectory → native nginx static hosting (0.4.27); auto-detected for static-only folders' },
|
|
96
96
|
{ type: 'worker', create: 'via_folder', deploy: true, scale: true, logs: true, variables: true, delete: true, note: 'neo_deploy_folder serviceType=worker — no public ingress; repo auto-detection still TODO (handoff 6)' },
|
|
97
97
|
{ type: 'database', create: true, get: true, list: true, update: true, backup: true, delete: true, note: 'neo_create/list/get/update(resize)/delete_database + backup (list/create/run); restore still TODO (handoff 4.4)' },
|
|
98
98
|
{ type: 'queue', create: true, get: true, list: true, update: true, delete: true, note: 'neo_create/list/get/update/delete_queue (0.4.15-0.4.25) (handoff 4.5)' },
|
|
@@ -406,6 +406,8 @@ export const TOOLS = [
|
|
|
406
406
|
path: str('Local folder or .zip path'),
|
|
407
407
|
name: str('Service name (optional)'),
|
|
408
408
|
serviceType: { type: 'string', enum: ['web', 'worker', 'static_site'], description: 'web (default) | worker (no public URL) | static_site. Auto-detects static_site for a static-only folder; else web.' },
|
|
409
|
+
buildCommand: str('static_site: build command to run before serving (e.g. "npm ci && npm run build"); omit for a pre-built folder'),
|
|
410
|
+
publishDirectory: str('static_site: directory of built files to serve via nginx (e.g. "dist"); enables native static hosting'),
|
|
409
411
|
port: int('Container port (optional; ignored for worker)'),
|
|
410
412
|
environment: { type: 'string', enum: ['staging', 'production'], description: 'REQUIRED — staging or production. Never defaulted (handoff §2). Deploy to staging first.' },
|
|
411
413
|
dryRun: { type: 'boolean', description: 'Preview the plan without creating/uploading/deploying anything (JNG #93)' },
|
|
@@ -429,6 +431,8 @@ export const TOOLS = [
|
|
|
429
431
|
src,
|
|
430
432
|
name: args.name,
|
|
431
433
|
serviceType: args.serviceType,
|
|
434
|
+
buildCommand: args.buildCommand,
|
|
435
|
+
publishDirectory: args.publishDirectory,
|
|
432
436
|
port: args.port,
|
|
433
437
|
environment,
|
|
434
438
|
dryRun: !!args.dryRun,
|
|
@@ -849,6 +853,8 @@ export const TOOLS = [
|
|
|
849
853
|
kind: { type: 'string', enum: ['app', 'database', 'queue', 'bucket'] },
|
|
850
854
|
name: str('Unique resource name within this stack (bindings reference it)'),
|
|
851
855
|
serviceType: str('app: web | worker | static_site'),
|
|
856
|
+
buildCommand: str('app/static_site: build command (e.g. "npm ci && npm run build")'),
|
|
857
|
+
publishDirectory: str('static_site: built-files directory to serve (e.g. "dist")'),
|
|
852
858
|
image: str('app: prebuilt image reference'),
|
|
853
859
|
repoUrl: str('app: git repository URL'),
|
|
854
860
|
branch: str('app: git branch'),
|