serverless-esbuild
Advanced tools
Comparing version 1.43.1 to 1.44.0
@@ -31,10 +31,15 @@ import type Serverless from 'serverless'; | ||
}; | ||
export type ScalewayNodeProviderRuntimeMatcher<Versions extends number> = { | ||
[Version in Versions as `node${Version}`]: `node${Version}`; | ||
}; | ||
export type AwsNodeMatcher = AwsNodeProviderRuntimeMatcher<12 | 14 | 16 | 18>; | ||
export type AzureNodeMatcher = AzureNodeProviderRuntimeMatcher<12 | 14 | 16 | 18>; | ||
export type GoogleNodeMatcher = GoogleNodeProviderRuntimeMatcher<12 | 14 | 16 | 18>; | ||
export type NodeMatcher = AwsNodeMatcher & AzureNodeMatcher & GoogleNodeMatcher; | ||
export type ScalewayNodeMatcher = ScalewayNodeProviderRuntimeMatcher<12 | 14 | 16 | 18 | 20>; | ||
export type NodeMatcher = AwsNodeMatcher & AzureNodeMatcher & GoogleNodeMatcher & ScalewayNodeMatcher; | ||
export type AwsNodeMatcherKey = keyof AwsNodeMatcher; | ||
export type AzureNodeMatcherKey = keyof AzureNodeMatcher; | ||
export type GoogleNodeMatcherKey = keyof GoogleNodeMatcher; | ||
export type NodeMatcherKey = AwsNodeMatcherKey | AzureNodeMatcherKey | GoogleNodeMatcherKey; | ||
export type ScalewayNodeMatcherKey = keyof ScalewayNodeMatcher; | ||
export type NodeMatcherKey = AwsNodeMatcherKey | AzureNodeMatcherKey | GoogleNodeMatcherKey | ScalewayNodeMatcherKey; | ||
export declare const providerRuntimeMatcher: Readonly<Record<string, NodeMatcher>>; | ||
@@ -41,0 +46,0 @@ export declare const isNodeMatcherKey: (input: unknown) => input is NodeMatcherKey; |
@@ -218,3 +218,15 @@ "use strict"; | ||
}; | ||
const nodeMatcher = { ...googleNodeMatcher, ...awsNodeMatcher, ...azureNodeMatcher }; | ||
const scalewayNodeMatcher = { | ||
node20: 'node20', | ||
node18: 'node18', | ||
node16: 'node16', | ||
node14: 'node14', | ||
node12: 'node12', | ||
}; | ||
const nodeMatcher = { | ||
...googleNodeMatcher, | ||
...awsNodeMatcher, | ||
...azureNodeMatcher, | ||
...scalewayNodeMatcher, | ||
}; | ||
exports.providerRuntimeMatcher = Object.freeze({ | ||
@@ -224,2 +236,3 @@ aws: awsNodeMatcher, | ||
google: googleNodeMatcher, | ||
scaleway: scalewayNodeMatcher, | ||
}); | ||
@@ -226,0 +239,0 @@ const isNodeMatcherKey = (input) => typeof input === 'string' && Object.keys(nodeMatcher).includes(input); |
@@ -66,7 +66,10 @@ "use strict"; | ||
// GOOGLE Provider requires a package.json and NO node_modules | ||
const providerName = this.serverless?.service?.provider?.name; | ||
const isGoogleProvider = this.serverless?.service?.provider?.name === 'google'; | ||
const isScalewayProvider = this.serverless?.service?.provider?.name === 'scaleway'; // Scaleway can not have package: individually | ||
const excludedFiles = isGoogleProvider ? [] : excludedFilesDefault; | ||
// Google provider cannot use individual packaging for now - this could be built in a future release | ||
if (isGoogleProvider && this.serverless?.service?.package?.individually) { | ||
throw new Error('Packaging failed: cannot package function individually when using Google provider'); | ||
// Google and Scaleway providers cannot use individual packaging for now - this could be built in a future release | ||
const isPackageIndividuallyNotSupported = isGoogleProvider || isScalewayProvider || false; | ||
if (isPackageIndividuallyNotSupported && this.serverless?.service?.package?.individually) { | ||
throw new Error(`Packaging failed: cannot package function individually when using ${providerName} provider`); | ||
} | ||
@@ -73,0 +76,0 @@ const { buildDirPath, workDirPath } = this; |
{ | ||
"name": "serverless-esbuild", | ||
"version": "1.43.1", | ||
"version": "1.44.0", | ||
"description": "Serverless plugin for zero-config JavaScript and TypeScript code bundling using extremely fast esbuild", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
235663
2541