@netlify/zip-it-and-ship-it 9.2.0 → 9.2.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/feature_flags.d.ts +23 -4
- package/dist/feature_flags.js +2 -0
- package/dist/main.d.ts +2 -2
- package/dist/manifest.d.ts +4 -2
- package/dist/manifest.js +4 -4
- package/dist/runtimes/index.d.ts +2 -2
- package/dist/runtimes/node/bundlers/types.d.ts +2 -2
- package/dist/zip.js +1 -1
- package/package.json +1 -1
package/dist/feature_flags.d.ts
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
export declare const defaultFlags:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare const defaultFlags: {
|
|
2
|
+
readonly buildRustSource: boolean;
|
|
3
|
+
readonly parseWithEsbuild: false;
|
|
4
|
+
readonly traceWithNft: false;
|
|
5
|
+
readonly functions_inherit_build_nodejs_version: false;
|
|
6
|
+
readonly zisi_pure_esm: false;
|
|
7
|
+
readonly zisi_pure_esm_mjs: false;
|
|
8
|
+
readonly zisi_output_cjs_extension: false;
|
|
9
|
+
readonly zisi_disallow_new_entry_name: false;
|
|
10
|
+
readonly zisi_functions_api_v2: false;
|
|
11
|
+
};
|
|
12
|
+
export type FeatureFlags = Partial<Record<keyof typeof defaultFlags, boolean>>;
|
|
13
|
+
export declare const getFlags: (input?: Record<string, boolean>, flags?: {
|
|
14
|
+
readonly buildRustSource: boolean;
|
|
15
|
+
readonly parseWithEsbuild: false;
|
|
16
|
+
readonly traceWithNft: false;
|
|
17
|
+
readonly functions_inherit_build_nodejs_version: false;
|
|
18
|
+
readonly zisi_pure_esm: false;
|
|
19
|
+
readonly zisi_pure_esm_mjs: false;
|
|
20
|
+
readonly zisi_output_cjs_extension: false;
|
|
21
|
+
readonly zisi_disallow_new_entry_name: false;
|
|
22
|
+
readonly zisi_functions_api_v2: false;
|
|
23
|
+
}) => FeatureFlags;
|
package/dist/feature_flags.js
CHANGED
|
@@ -6,6 +6,8 @@ export const defaultFlags = {
|
|
|
6
6
|
parseWithEsbuild: false,
|
|
7
7
|
// Use NFT as the default bundler.
|
|
8
8
|
traceWithNft: false,
|
|
9
|
+
// Should Lambda functions inherit the build Node.js version
|
|
10
|
+
functions_inherit_build_nodejs_version: false,
|
|
9
11
|
// Output pure (i.e. untranspiled) ESM files when the function file has ESM
|
|
10
12
|
// syntax and the parent `package.json` file has `{"type": "module"}`.
|
|
11
13
|
zisi_pure_esm: false,
|
package/dist/main.d.ts
CHANGED
|
@@ -27,13 +27,13 @@ interface ListFunctionsOptions {
|
|
|
27
27
|
parseISC?: boolean;
|
|
28
28
|
}
|
|
29
29
|
export declare const listFunctions: (relativeSrcFolders: string | string[], { featureFlags: inputFeatureFlags, config, configFileDirectories, parseISC, }?: {
|
|
30
|
-
featureFlags?:
|
|
30
|
+
featureFlags?: Partial<Record<"buildRustSource" | "parseWithEsbuild" | "traceWithNft" | "functions_inherit_build_nodejs_version" | "zisi_pure_esm" | "zisi_pure_esm_mjs" | "zisi_output_cjs_extension" | "zisi_disallow_new_entry_name" | "zisi_functions_api_v2", boolean>> | undefined;
|
|
31
31
|
config?: Config | undefined;
|
|
32
32
|
configFileDirectories?: string[] | undefined;
|
|
33
33
|
parseISC?: boolean | undefined;
|
|
34
34
|
}) => Promise<ListedFunction[]>;
|
|
35
35
|
export declare const listFunction: (path: string, { featureFlags: inputFeatureFlags, config, configFileDirectories, parseISC, }?: {
|
|
36
|
-
featureFlags?:
|
|
36
|
+
featureFlags?: Partial<Record<"buildRustSource" | "parseWithEsbuild" | "traceWithNft" | "functions_inherit_build_nodejs_version" | "zisi_pure_esm" | "zisi_pure_esm_mjs" | "zisi_output_cjs_extension" | "zisi_disallow_new_entry_name" | "zisi_functions_api_v2", boolean>> | undefined;
|
|
37
37
|
config?: Config | undefined;
|
|
38
38
|
configFileDirectories?: string[] | undefined;
|
|
39
39
|
parseISC?: boolean | undefined;
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FeatureFlags } from './feature_flags.js';
|
|
2
|
+
import type { FunctionResult } from './utils/format_result.js';
|
|
2
3
|
interface ManifestFunction {
|
|
3
4
|
mainFile: string;
|
|
4
5
|
name: string;
|
|
@@ -19,7 +20,8 @@ export interface Manifest {
|
|
|
19
20
|
timestamp: number;
|
|
20
21
|
version: number;
|
|
21
22
|
}
|
|
22
|
-
export declare const createManifest: ({ functions, path }: {
|
|
23
|
+
export declare const createManifest: ({ featureFlags, functions, path, }: {
|
|
24
|
+
featureFlags: FeatureFlags;
|
|
23
25
|
functions: FunctionResult[];
|
|
24
26
|
path: string;
|
|
25
27
|
}) => Promise<void>;
|
package/dist/manifest.js
CHANGED
|
@@ -2,8 +2,8 @@ import { promises as fs } from 'fs';
|
|
|
2
2
|
import { resolve } from 'path';
|
|
3
3
|
import { arch, platform } from 'process';
|
|
4
4
|
const MANIFEST_VERSION = 1;
|
|
5
|
-
export const createManifest = async ({ functions, path }) => {
|
|
6
|
-
const formattedFunctions = functions.map(formatFunctionForManifest);
|
|
5
|
+
export const createManifest = async ({ featureFlags, functions, path, }) => {
|
|
6
|
+
const formattedFunctions = functions.map((func) => formatFunctionForManifest(func, featureFlags));
|
|
7
7
|
const payload = {
|
|
8
8
|
functions: formattedFunctions,
|
|
9
9
|
system: { arch, platform },
|
|
@@ -12,13 +12,13 @@ export const createManifest = async ({ functions, path }) => {
|
|
|
12
12
|
};
|
|
13
13
|
await fs.writeFile(path, JSON.stringify(payload));
|
|
14
14
|
};
|
|
15
|
-
const formatFunctionForManifest = ({ bundler, displayName, generator, mainFile, name, path, runtime, runtimeVersion, schedule,
|
|
15
|
+
const formatFunctionForManifest = ({ bundler, displayName, generator, mainFile, name, path, runtime, runtimeVersion, schedule }, featureFlags) => ({
|
|
16
16
|
bundler,
|
|
17
17
|
displayName,
|
|
18
18
|
generator,
|
|
19
19
|
mainFile,
|
|
20
20
|
name,
|
|
21
|
-
runtimeVersion,
|
|
21
|
+
runtimeVersion: featureFlags.functions_inherit_build_nodejs_version ? runtimeVersion : undefined,
|
|
22
22
|
path: resolve(path),
|
|
23
23
|
runtime,
|
|
24
24
|
schedule,
|
package/dist/runtimes/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const getFunctionsFromPaths: (paths: string[], { cache, config, c
|
|
|
11
11
|
config?: Config | undefined;
|
|
12
12
|
configFileDirectories?: string[] | undefined;
|
|
13
13
|
dedupe?: boolean | undefined;
|
|
14
|
-
featureFlags?:
|
|
14
|
+
featureFlags?: Partial<Record<"buildRustSource" | "parseWithEsbuild" | "traceWithNft" | "functions_inherit_build_nodejs_version" | "zisi_pure_esm" | "zisi_pure_esm_mjs" | "zisi_output_cjs_extension" | "zisi_disallow_new_entry_name" | "zisi_functions_api_v2", boolean>> | undefined;
|
|
15
15
|
}) => Promise<FunctionMap>;
|
|
16
16
|
/**
|
|
17
17
|
* Gets a list of functions found in a list of paths.
|
|
@@ -20,6 +20,6 @@ export declare const getFunctionFromPath: (path: string, { cache, config, config
|
|
|
20
20
|
cache: RuntimeCache;
|
|
21
21
|
config?: Config | undefined;
|
|
22
22
|
configFileDirectories?: string[] | undefined;
|
|
23
|
-
featureFlags?:
|
|
23
|
+
featureFlags?: Partial<Record<"buildRustSource" | "parseWithEsbuild" | "traceWithNft" | "functions_inherit_build_nodejs_version" | "zisi_pure_esm" | "zisi_pure_esm_mjs" | "zisi_output_cjs_extension" | "zisi_disallow_new_entry_name" | "zisi_functions_api_v2", boolean>> | undefined;
|
|
24
24
|
}) => Promise<FunctionSource | undefined>;
|
|
25
25
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Message } from '@netlify/esbuild';
|
|
2
2
|
import type { FunctionConfig } from '../../../config.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { FeatureFlags } from '../../../feature_flags.js';
|
|
4
4
|
import type { FunctionSource } from '../../../function.js';
|
|
5
5
|
import { ObjectValues } from '../../../types/utils.js';
|
|
6
6
|
import type { RuntimeCache } from '../../../utils/cache.js';
|
|
@@ -20,7 +20,7 @@ export type BundleFunction = (args: {
|
|
|
20
20
|
basePath?: string;
|
|
21
21
|
cache: RuntimeCache;
|
|
22
22
|
config: FunctionConfig;
|
|
23
|
-
featureFlags:
|
|
23
|
+
featureFlags: FeatureFlags;
|
|
24
24
|
pluginsModulesPath?: string;
|
|
25
25
|
repositoryRoot?: string;
|
|
26
26
|
} & FunctionSource) => Promise<{
|
package/dist/zip.js
CHANGED
|
@@ -80,7 +80,7 @@ export const zipFunctions = async function (relativeSrcFolders, destFolder, { ar
|
|
|
80
80
|
return formatZipResult(resultWithSize);
|
|
81
81
|
}));
|
|
82
82
|
if (manifest !== undefined) {
|
|
83
|
-
await createManifest({ functions: formattedResults, path: resolve(manifest) });
|
|
83
|
+
await createManifest({ featureFlags, functions: formattedResults, path: resolve(manifest) });
|
|
84
84
|
}
|
|
85
85
|
return formattedResults;
|
|
86
86
|
};
|