diff --git a/__tests__/ut/resources/fc/impl/utils_test.ts b/__tests__/ut/resources/fc/impl/utils_test.ts index 3e589b6a..2a7dd3d7 100644 --- a/__tests__/ut/resources/fc/impl/utils_test.ts +++ b/__tests__/ut/resources/fc/impl/utils_test.ts @@ -30,6 +30,11 @@ describe('utils', () => { expect(result).toBe(true); }); + it('should return true for micro-sandbox runtime', () => { + const result = isCustomContainerRuntime('micro-sandbox'); + expect(result).toBe(true); + }); + it('should return false for non custom-container runtime', () => { const result = isCustomContainerRuntime('nodejs18'); expect(result).toBe(false); diff --git a/package-lock.json b/package-lock.json index b947601b..ea39bb79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "dependencies": { "@alicloud/devs20230714": "^2.5.0", "@alicloud/fc2": "^2.6.6", - "@alicloud/fc20230330": "4.7.4", + "@alicloud/fc20230330": "4.7.5", "@alicloud/pop-core": "^1.8.0", "@serverless-cd/srm-aliyun-oss": "^0.0.1-beta.8", "@serverless-cd/srm-aliyun-pop-core": "^0.0.8-beta.1", @@ -215,10 +215,9 @@ } }, "node_modules/@alicloud/fc20230330": { - "version": "4.7.4", - "resolved": "https://registry.npmmirror.com/@alicloud/fc20230330/-/fc20230330-4.7.4.tgz", - "integrity": "sha512-DkxiA9JT6e2tRdFx05Pub+vQxwgoPJK6ZbDB3ZLs1b+wSkYhU40t49EhlA8deBhm+shTpCrG3J0vdme0ZHCB1A==", - "license": "Apache-2.0", + "version": "4.7.5", + "resolved": "https://registry.npmmirror.com/@alicloud/fc20230330/-/fc20230330-4.7.5.tgz", + "integrity": "sha512-LKaRo2gj4HDCVOckNtDhGQQuTWyiPm+xA/BZ5BmFn4FTyV9O7jhRRSztcHdht9NfOuSQudTTyUhLl082kUrhsA==", "dependencies": { "@alicloud/openapi-core": "^1.0.0", "@darabonba/typescript": "^1.0.0" @@ -15784,9 +15783,9 @@ } }, "@alicloud/fc20230330": { - "version": "4.7.4", - "resolved": "https://registry.npmmirror.com/@alicloud/fc20230330/-/fc20230330-4.7.4.tgz", - "integrity": "sha512-DkxiA9JT6e2tRdFx05Pub+vQxwgoPJK6ZbDB3ZLs1b+wSkYhU40t49EhlA8deBhm+shTpCrG3J0vdme0ZHCB1A==", + "version": "4.7.5", + "resolved": "https://registry.npmmirror.com/@alicloud/fc20230330/-/fc20230330-4.7.5.tgz", + "integrity": "sha512-LKaRo2gj4HDCVOckNtDhGQQuTWyiPm+xA/BZ5BmFn4FTyV9O7jhRRSztcHdht9NfOuSQudTTyUhLl082kUrhsA==", "requires": { "@alicloud/openapi-core": "^1.0.0", "@darabonba/typescript": "^1.0.0" diff --git a/package.json b/package.json index d0d623e4..688d7d87 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "dependencies": { "@alicloud/devs20230714": "^2.5.0", "@alicloud/fc2": "^2.6.6", - "@alicloud/fc20230330": "4.7.4", + "@alicloud/fc20230330": "4.7.5", "@alicloud/pop-core": "^1.8.0", "@serverless-cd/srm-aliyun-oss": "^0.0.1-beta.8", "@serverless-cd/srm-aliyun-pop-core": "^0.0.8-beta.1", diff --git a/publish.yaml b/publish.yaml index 4c1a0c2b..dd97f053 100644 --- a/publish.yaml +++ b/publish.yaml @@ -3,7 +3,7 @@ Type: Component Name: fc3 Provider: - 阿里云 -Version: 0.1.21 +Version: 0.1.22 Description: 阿里云函数计算全生命周期管理 HomePage: https://github.com/devsapp/fc3 Organization: 阿里云函数计算(FC) diff --git a/src/interface/base.ts b/src/interface/base.ts index 98f712ec..52fc4537 100644 --- a/src/interface/base.ts +++ b/src/interface/base.ts @@ -40,6 +40,7 @@ export enum Runtime { 'custom.debian12' = 'custom.debian12', 'custom' = 'custom', 'custom-container' = 'custom-container', + 'micro-sandbox' = 'micro-sandbox', } export const RuntimeList = Object.values(Runtime); diff --git a/src/resources/fc/impl/utils.ts b/src/resources/fc/impl/utils.ts index e4df8560..22a712e6 100644 --- a/src/resources/fc/impl/utils.ts +++ b/src/resources/fc/impl/utils.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import { isDebugMode } from '@serverless-devs/utils'; export function isCustomContainerRuntime(runtime: string): boolean { - return runtime === Runtime['custom-container']; + return runtime === Runtime['custom-container'] || runtime === Runtime['micro-sandbox']; } export function isCustomRuntime(runtime: string): boolean { diff --git a/src/schema.json b/src/schema.json index e571bf07..b4fb6250 100644 --- a/src/schema.json +++ b/src/schema.json @@ -863,6 +863,7 @@ "enum": [ "custom", "custom-container", + "micro-sandbox", "custom.debian10", "custom.debian11", "custom.debian12", @@ -1428,7 +1429,7 @@ "properties": { "runtime": { "type": "string", - "const": "custom-container" + "enum": ["custom-container", "micro-sandbox"] } } }, diff --git a/src/subCommands/local/index.ts b/src/subCommands/local/index.ts index f14d2b89..81aa541c 100644 --- a/src/subCommands/local/index.ts +++ b/src/subCommands/local/index.ts @@ -83,7 +83,8 @@ export default class ComponentLocal { await customLocalInvoker.invoke(); break; } - case 'custom-container': { + case 'custom-container': + case 'micro-sandbox': { const customContainerLocalInvoker = new CustomContainerLocalInvoke(inputs); await customContainerLocalInvoker.invoke(); break; @@ -156,7 +157,8 @@ export default class ComponentLocal { await customLocalStart.start(); break; } - case 'custom-container': { + case 'custom-container': + case 'micro-sandbox': { const customContainerLocalStart = new CustomContainerLocalStart(inputs); await customContainerLocalStart.start(); break;