@netlify/zip-it-and-ship-it 9.28.2 → 9.28.4
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 +2 -0
- package/dist/feature_flags.js +2 -0
- package/dist/runtimes/index.d.ts +2 -2
- package/dist/runtimes/node/bundlers/esbuild/src_files.js +2 -2
- package/dist/runtimes/node/bundlers/nft/index.js +3 -3
- package/dist/runtimes/node/bundlers/none/index.js +2 -2
- package/dist/runtimes/node/bundlers/zisi/src_files.js +1 -1
- package/dist/runtimes/node/utils/included_files.d.ts +2 -1
- package/dist/runtimes/node/utils/included_files.js +18 -4
- package/package.json +5 -5
package/dist/feature_flags.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const defaultFlags: {
|
|
|
8
8
|
readonly zisi_unique_entry_file: false;
|
|
9
9
|
readonly zisi_esbuild_fail_double_glob: false;
|
|
10
10
|
readonly zisi_go_drop_runtime_override: false;
|
|
11
|
+
readonly zisi_fix_symlinks: false;
|
|
11
12
|
};
|
|
12
13
|
export type FeatureFlags = Partial<Record<keyof typeof defaultFlags, boolean>>;
|
|
13
14
|
export declare const getFlags: (input?: Record<string, boolean>, flags?: {
|
|
@@ -20,4 +21,5 @@ export declare const getFlags: (input?: Record<string, boolean>, flags?: {
|
|
|
20
21
|
readonly zisi_unique_entry_file: false;
|
|
21
22
|
readonly zisi_esbuild_fail_double_glob: false;
|
|
22
23
|
readonly zisi_go_drop_runtime_override: false;
|
|
24
|
+
readonly zisi_fix_symlinks: false;
|
|
23
25
|
}) => FeatureFlags;
|
package/dist/feature_flags.js
CHANGED
|
@@ -20,6 +20,8 @@ export const defaultFlags = {
|
|
|
20
20
|
zisi_esbuild_fail_double_glob: false,
|
|
21
21
|
// drops the "runtimeVersion" override field
|
|
22
22
|
zisi_go_drop_runtime_override: false,
|
|
23
|
+
// fixes symlinks in included files
|
|
24
|
+
zisi_fix_symlinks: false,
|
|
23
25
|
};
|
|
24
26
|
// List of supported flags and their default value.
|
|
25
27
|
export const getFlags = (input = {}, flags = defaultFlags) => Object.entries(flags).reduce((result, [key, defaultValue]) => ({
|
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?: Partial<Record<"buildRustSource" | "parseWithEsbuild" | "traceWithNft" | "zisi_pure_esm" | "zisi_pure_esm_mjs" | "zisi_output_cjs_extension" | "zisi_unique_entry_file" | "zisi_esbuild_fail_double_glob" | "zisi_go_drop_runtime_override", boolean>> | undefined;
|
|
14
|
+
featureFlags?: Partial<Record<"buildRustSource" | "parseWithEsbuild" | "traceWithNft" | "zisi_pure_esm" | "zisi_pure_esm_mjs" | "zisi_output_cjs_extension" | "zisi_unique_entry_file" | "zisi_esbuild_fail_double_glob" | "zisi_go_drop_runtime_override" | "zisi_fix_symlinks", 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?: Partial<Record<"buildRustSource" | "parseWithEsbuild" | "traceWithNft" | "zisi_pure_esm" | "zisi_pure_esm_mjs" | "zisi_output_cjs_extension" | "zisi_unique_entry_file" | "zisi_esbuild_fail_double_glob" | "zisi_go_drop_runtime_override", boolean>> | undefined;
|
|
23
|
+
featureFlags?: Partial<Record<"buildRustSource" | "parseWithEsbuild" | "traceWithNft" | "zisi_pure_esm" | "zisi_pure_esm_mjs" | "zisi_output_cjs_extension" | "zisi_unique_entry_file" | "zisi_esbuild_fail_double_glob" | "zisi_go_drop_runtime_override" | "zisi_fix_symlinks", boolean>> | undefined;
|
|
24
24
|
}) => Promise<FunctionSource | undefined>;
|
|
25
25
|
export {};
|
|
@@ -2,9 +2,9 @@ import { filterExcludedPaths, getPathsOfIncludedFiles } from '../../utils/includ
|
|
|
2
2
|
import { getPackageJson } from '../../utils/package_json.js';
|
|
3
3
|
import { getNewCache } from '../../utils/traversal_cache.js';
|
|
4
4
|
import { getDependencyPathsForDependency } from '../zisi/traverse.js';
|
|
5
|
-
export const getSrcFiles = async ({ config, mainFile, pluginsModulesPath, srcDir }) => {
|
|
5
|
+
export const getSrcFiles = async ({ config, mainFile, pluginsModulesPath, srcDir, featureFlags, }) => {
|
|
6
6
|
const { externalNodeModules = [], includedFiles = [], includedFilesBasePath, nodeVersion } = config;
|
|
7
|
-
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(includedFiles, includedFilesBasePath);
|
|
7
|
+
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(includedFiles, featureFlags, includedFilesBasePath);
|
|
8
8
|
const dependencyPaths = await getSrcFilesForDependencies({
|
|
9
9
|
basedir: srcDir,
|
|
10
10
|
dependencies: externalNodeModules,
|
|
@@ -27,7 +27,7 @@ const bundle = async ({ basePath, cache, config, featureFlags, mainFile, name, p
|
|
|
27
27
|
const sideFiles = await getSideFiles(srcPath, stat);
|
|
28
28
|
includedFiles.push(...sideFiles);
|
|
29
29
|
}
|
|
30
|
-
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(includedFiles, includedFilesBasePath || basePath);
|
|
30
|
+
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(includedFiles, featureFlags, includedFilesBasePath || basePath);
|
|
31
31
|
const { aliases, bundledPaths = [], mainFile: normalizedMainFile, moduleFormat, rewrites, tracedPaths, } = await traceFilesAndTranspile({
|
|
32
32
|
basePath: repositoryRoot,
|
|
33
33
|
cache,
|
|
@@ -159,9 +159,9 @@ const traceFilesAndTranspile = async function ({ basePath, cache, config, featur
|
|
|
159
159
|
tracedPaths: normalizedTracedPaths,
|
|
160
160
|
};
|
|
161
161
|
};
|
|
162
|
-
const getSrcFiles = async function ({ basePath, config, mainFile }) {
|
|
162
|
+
const getSrcFiles = async function ({ basePath, config, mainFile, featureFlags }) {
|
|
163
163
|
const { includedFiles = [], includedFilesBasePath } = config;
|
|
164
|
-
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(includedFiles, includedFilesBasePath);
|
|
164
|
+
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(includedFiles, featureFlags, includedFilesBasePath);
|
|
165
165
|
const { fileList: dependencyPaths } = await nodeFileTrace([mainFile], {
|
|
166
166
|
base: basePath,
|
|
167
167
|
ignore: getIgnoreFunction(config),
|
|
@@ -28,9 +28,9 @@ const getModuleFormat = async function (mainFile) {
|
|
|
28
28
|
}
|
|
29
29
|
return MODULE_FORMAT.COMMONJS;
|
|
30
30
|
};
|
|
31
|
-
export const getSrcFiles = async function ({ config, mainFile }) {
|
|
31
|
+
export const getSrcFiles = async function ({ config, mainFile, featureFlags }) {
|
|
32
32
|
const { includedFiles = [], includedFilesBasePath } = config;
|
|
33
|
-
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(includedFiles, includedFilesBasePath);
|
|
33
|
+
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(includedFiles, featureFlags, includedFilesBasePath);
|
|
34
34
|
const includedPaths = filterExcludedPaths(includedFilePaths, excludePatterns);
|
|
35
35
|
return { srcFiles: [mainFile, ...includedPaths], includedFiles: includedPaths };
|
|
36
36
|
};
|
|
@@ -14,7 +14,7 @@ import { shouldTreeShake } from './tree_shake.js';
|
|
|
14
14
|
// has a size limit for the zipped file. It also makes cold starts faster.
|
|
15
15
|
export const getSrcFiles = async function ({ config, featureFlags, mainFile, name, pluginsModulesPath, srcDir, srcPath, stat, }) {
|
|
16
16
|
const { includedFiles = [], includedFilesBasePath, nodeVersion } = config;
|
|
17
|
-
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(includedFiles, includedFilesBasePath);
|
|
17
|
+
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(includedFiles, featureFlags, includedFilesBasePath);
|
|
18
18
|
const [treeFiles, depFiles] = await Promise.all([
|
|
19
19
|
getTreeFiles(srcPath, stat),
|
|
20
20
|
getDependencies({ featureFlags, functionName: name, mainFile, pluginsModulesPath, srcDir, nodeVersion }),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type FeatureFlags } from '../../../feature_flags.js';
|
|
1
2
|
export declare const filterExcludedPaths: (paths: string[], excludePattern?: string[]) => string[];
|
|
2
|
-
export declare const getPathsOfIncludedFiles: (includedFiles: string[], basePath?: string) => Promise<{
|
|
3
|
+
export declare const getPathsOfIncludedFiles: (includedFiles: string[], featureFlags: FeatureFlags, basePath?: string) => Promise<{
|
|
3
4
|
excludePatterns: string[];
|
|
4
5
|
paths: string[];
|
|
5
6
|
}>;
|
|
@@ -10,7 +10,7 @@ export const filterExcludedPaths = (paths, excludePattern = []) => {
|
|
|
10
10
|
const excludedPaths = paths.filter((path) => !excludePattern.some((pattern) => minimatch(path, pattern)));
|
|
11
11
|
return excludedPaths;
|
|
12
12
|
};
|
|
13
|
-
export const getPathsOfIncludedFiles = async (includedFiles, basePath) => {
|
|
13
|
+
export const getPathsOfIncludedFiles = async (includedFiles, featureFlags, basePath) => {
|
|
14
14
|
if (basePath === undefined) {
|
|
15
15
|
return { excludePatterns: [], paths: [] };
|
|
16
16
|
}
|
|
@@ -37,9 +37,23 @@ export const getPathsOfIncludedFiles = async (includedFiles, basePath) => {
|
|
|
37
37
|
cwd: basePath,
|
|
38
38
|
dot: true,
|
|
39
39
|
ignore: excludePatterns,
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
...(featureFlags.zisi_fix_symlinks
|
|
41
|
+
? {
|
|
42
|
+
onlyFiles: false,
|
|
43
|
+
// get directories as well to get symlinked directories,
|
|
44
|
+
// to filter the regular non symlinked directories out mark them with a slash at the end to filter them out.
|
|
45
|
+
markDirectories: true,
|
|
46
|
+
followSymbolicLinks: false,
|
|
47
|
+
}
|
|
48
|
+
: {
|
|
49
|
+
followSymbolicLinks: true,
|
|
50
|
+
throwErrorOnBrokenSymbolicLink: true,
|
|
51
|
+
}),
|
|
42
52
|
});
|
|
43
|
-
|
|
53
|
+
const paths = featureFlags.zisi_fix_symlinks
|
|
54
|
+
? pathGroups.filter((path) => !path.endsWith('/')).map(normalize)
|
|
55
|
+
: pathGroups.map(normalize);
|
|
56
|
+
// now filter the non symlinked directories out that got marked with a trailing slash
|
|
57
|
+
return { excludePatterns, paths };
|
|
44
58
|
};
|
|
45
59
|
//# sourceMappingURL=included_files.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/zip-it-and-ship-it",
|
|
3
|
-
"version": "9.28.
|
|
3
|
+
"version": "9.28.4",
|
|
4
4
|
"description": "Zip it and ship it",
|
|
5
5
|
"main": "./dist/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -55,15 +55,15 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@babel/parser": "^7.22.5",
|
|
58
|
-
"@babel/types": "7.23.
|
|
58
|
+
"@babel/types": "7.23.6",
|
|
59
59
|
"@netlify/binary-info": "^1.0.0",
|
|
60
|
-
"@netlify/serverless-functions-api": "^1.13.
|
|
60
|
+
"@netlify/serverless-functions-api": "^1.13.1",
|
|
61
61
|
"@vercel/nft": "^0.23.0",
|
|
62
62
|
"archiver": "^6.0.0",
|
|
63
63
|
"common-path-prefix": "^3.0.0",
|
|
64
64
|
"cp-file": "^10.0.0",
|
|
65
65
|
"es-module-lexer": "^1.0.0",
|
|
66
|
-
"esbuild": "0.19.
|
|
66
|
+
"esbuild": "0.19.11",
|
|
67
67
|
"execa": "^6.0.0",
|
|
68
68
|
"fast-glob": "^3.3.2",
|
|
69
69
|
"filter-obj": "^5.0.0",
|
|
@@ -102,10 +102,10 @@
|
|
|
102
102
|
"@types/unixify": "1.0.2",
|
|
103
103
|
"@types/yargs": "17.0.32",
|
|
104
104
|
"@vitest/coverage-v8": "0.34.6",
|
|
105
|
-
"adm-zip": "0.5.10",
|
|
106
105
|
"browserslist": "4.22.2",
|
|
107
106
|
"cardinal": "2.1.1",
|
|
108
107
|
"cpy": "9.0.1",
|
|
108
|
+
"decompress": "^4.2.1",
|
|
109
109
|
"deepmerge": "4.3.1",
|
|
110
110
|
"get-stream": "8.0.1",
|
|
111
111
|
"husky": "8.0.3",
|