@netlify/zip-it-and-ship-it 12.1.1 → 12.1.3

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.
@@ -46,10 +46,12 @@ const includedFilesToEsbuildExternals = async (includedFiles, baseDir) => {
46
46
  const hasMultipleGlobs = pattern.indexOf('*') !== pattern.lastIndexOf('*');
47
47
  if (hasMultipleGlobs) {
48
48
  const resolved = await glob(pattern, {
49
- noglobstar: true,
49
+ globstar: false,
50
50
  cwd: baseDir,
51
51
  });
52
- result.push(...resolved);
52
+ // esbuild expects relative paths to always have a leading `./`
53
+ const esbuildPatterns = resolved.map((pattern) => `./${pattern}`);
54
+ result.push(...esbuildPatterns);
53
55
  }
54
56
  else {
55
57
  result.push(pattern);
@@ -12,8 +12,7 @@ export const getSideFiles = async function (functionPath, stat) {
12
12
  const paths = await glob(`${functionPath}/**`, {
13
13
  absolute: true,
14
14
  cwd: functionPath,
15
- ignore: `**/node_modules/**`,
16
- nodir: true,
15
+ ignore: [`**/node_modules/**`],
17
16
  });
18
17
  return paths.filter((path) => !isJunk(basename(path)));
19
18
  };
@@ -4,7 +4,6 @@ export const getPublishedFiles = async function (modulePath) {
4
4
  const ignore = getIgnoredFiles(modulePath);
5
5
  const publishedFiles = await glob(`${modulePath}/**`, {
6
6
  ignore,
7
- nodir: true,
8
7
  absolute: true,
9
8
  dot: true,
10
9
  });
@@ -5,8 +5,7 @@ export const getTreeFiles = async function (srcPath, stat) {
5
5
  return [srcPath];
6
6
  }
7
7
  return await glob(`${srcPath}/**`, {
8
- ignore: `${srcPath}/**/node_modules/**`,
9
- nodir: true,
8
+ ignore: [`${srcPath}/**/node_modules/**`],
10
9
  absolute: true,
11
10
  });
12
11
  };
@@ -1,5 +1,5 @@
1
1
  import { normalize, resolve } from 'path';
2
- import fastGlob from 'fast-glob';
2
+ import glob from 'fast-glob';
3
3
  import { minimatch } from '../../../utils/matching.js';
4
4
  // Returns the subset of `paths` that don't match any of the glob expressions
5
5
  // from `exclude`.
@@ -32,7 +32,7 @@ export const getPathsOfIncludedFiles = async (includedFiles, basePath) => {
32
32
  excludePatterns: acc.excludePatterns,
33
33
  };
34
34
  }, { include: [], excludePatterns: [] });
35
- const pathGroups = await fastGlob(include, {
35
+ const pathGroups = await glob(include, {
36
36
  absolute: true,
37
37
  cwd: basePath,
38
38
  dot: true,
@@ -1,9 +1,9 @@
1
- import globFunction from 'glob';
2
- import { MinimatchOptions } from 'minimatch';
1
+ import originalGlob from 'fast-glob';
2
+ import { type MinimatchOptions } from 'minimatch';
3
3
  /**
4
4
  * Both glob and minimatch only support unix style slashes in patterns
5
- * For this reason we wrap them and ensure all patters are always unixified
5
+ * For this reason we wrap them and ensure all patterns are always unixified
6
6
  * We use `normalize-path` here instead of `unixify` because we do not want to remove drive letters
7
7
  */
8
- export declare const glob: (pattern: string, options: globFunction.IOptions) => Promise<string[]>;
8
+ export declare const glob: (pattern: string, options: originalGlob.Options) => Promise<string[]>;
9
9
  export declare const minimatch: (target: string, pattern: string, options?: MinimatchOptions) => boolean;
@@ -1,22 +1,14 @@
1
- import { promisify } from 'util';
2
- import globFunction from 'glob';
1
+ import originalGlob from 'fast-glob';
3
2
  import { minimatch as minimatchFunction } from 'minimatch';
4
3
  import normalizePath from 'normalize-path';
5
- const pGlob = promisify(globFunction);
6
4
  /**
7
5
  * Both glob and minimatch only support unix style slashes in patterns
8
- * For this reason we wrap them and ensure all patters are always unixified
6
+ * For this reason we wrap them and ensure all patterns are always unixified
9
7
  * We use `normalize-path` here instead of `unixify` because we do not want to remove drive letters
10
8
  */
11
9
  export const glob = function (pattern, options) {
12
- let normalizedIgnore;
13
- if (options.ignore) {
14
- normalizedIgnore =
15
- typeof options.ignore === 'string'
16
- ? normalizePath(options.ignore)
17
- : options.ignore.map((expression) => normalizePath(expression));
18
- }
19
- return pGlob(normalizePath(pattern), { ...options, ignore: normalizedIgnore });
10
+ const normalizedIgnore = options.ignore?.map((expression) => normalizePath(expression));
11
+ return originalGlob(normalizePath(pattern), { ...options, ignore: normalizedIgnore });
20
12
  };
21
13
  export const minimatch = function (target, pattern, options) {
22
14
  return minimatchFunction(target, normalizePath(pattern), options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/zip-it-and-ship-it",
3
- "version": "12.1.1",
3
+ "version": "12.1.3",
4
4
  "description": "Zip it and ship it",
5
5
  "main": "./dist/main.js",
6
6
  "type": "module",
@@ -44,18 +44,17 @@
44
44
  "@babel/parser": "^7.22.5",
45
45
  "@babel/types": "7.27.3",
46
46
  "@netlify/binary-info": "^1.0.0",
47
- "@netlify/serverless-functions-api": "^1.41.2",
48
- "@vercel/nft": "0.29.3",
47
+ "@netlify/serverless-functions-api": "^2.1.1",
48
+ "@vercel/nft": "0.29.4",
49
49
  "archiver": "^7.0.0",
50
50
  "common-path-prefix": "^3.0.0",
51
51
  "copy-file": "^11.0.0",
52
52
  "es-module-lexer": "^1.0.0",
53
53
  "esbuild": "0.25.4",
54
54
  "execa": "^8.0.0",
55
- "fast-glob": "^3.3.2",
55
+ "fast-glob": "^3.3.3",
56
56
  "filter-obj": "^6.0.0",
57
57
  "find-up": "^7.0.0",
58
- "glob": "^8.0.3",
59
58
  "is-builtin-module": "^3.1.0",
60
59
  "is-path-inside": "^4.0.0",
61
60
  "junk": "^4.0.0",
@@ -78,7 +77,6 @@
78
77
  },
79
78
  "devDependencies": {
80
79
  "@types/archiver": "6.0.3",
81
- "@types/glob": "8.1.0",
82
80
  "@types/is-ci": "3.0.4",
83
81
  "@types/node": "20.12.11",
84
82
  "@types/normalize-path": "3.0.2",
@@ -86,7 +84,7 @@
86
84
  "@types/semver": "7.7.0",
87
85
  "@types/unixify": "1.0.2",
88
86
  "@types/yargs": "17.0.33",
89
- "@vitest/coverage-v8": "0.34.6",
87
+ "@vitest/coverage-v8": "^3.0.0",
90
88
  "browserslist": "4.24.5",
91
89
  "cardinal": "2.1.1",
92
90
  "cpy": "11.1.0",
@@ -97,10 +95,10 @@
97
95
  "lambda-local": "2.2.0",
98
96
  "source-map-support": "0.5.21",
99
97
  "typescript": "5.8.3",
100
- "vitest": "0.34.6"
98
+ "vitest": "^3.0.0"
101
99
  },
102
100
  "engines": {
103
101
  "node": ">=18.14.0"
104
102
  },
105
- "gitHead": "df148594017a78f0f419591da402311ed08e4d64"
103
+ "gitHead": "44309b889269b8555b19127ed9988bc5972cb4ec"
106
104
  }