@netlify/edge-bundler 2.0.4 → 2.0.5

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.
@@ -1,13 +1,18 @@
1
1
  import { readFileSync } from 'fs';
2
- import { dirname, join } from 'path';
3
- import { findUpSync } from 'find-up';
2
+ import { join } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { findUpSync, pathExistsSync } from 'find-up';
4
5
  const getPackagePath = () => {
5
- const packageJSONPath = findUpSync('package.json', { cwd: import.meta.url });
6
+ const packagePath = findUpSync((directory) => {
7
+ if (pathExistsSync(join(directory, 'package.json'))) {
8
+ return directory;
9
+ }
10
+ }, { cwd: fileURLToPath(import.meta.url), type: 'directory' });
6
11
  // We should never get here, but let's show a somewhat useful error message.
7
- if (packageJSONPath === undefined) {
12
+ if (packagePath === undefined) {
8
13
  throw new Error('Could not find `package.json` for `@netlify/edge-bundler`. Please try running `npm install` to reinstall your dependencies.');
9
14
  }
10
- return dirname(packageJSONPath);
15
+ return packagePath;
11
16
  };
12
17
  const getPackageVersion = () => {
13
18
  const packagePath = getPackagePath();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/edge-bundler",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Intelligently prepare Netlify Edge Functions for deployment",
5
5
  "type": "module",
6
6
  "main": "./dist/node/index.js",
@@ -72,7 +72,7 @@
72
72
  "husky": "^8.0.0",
73
73
  "nock": "^13.2.4",
74
74
  "nyc": "^15.0.0",
75
- "sinon": "^13.0.0",
75
+ "sinon": "^14.0.0",
76
76
  "ts-node": "^10.4.0",
77
77
  "typescript": "^4.5.4"
78
78
  },