@netlify/edge-bundler
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -1,4 +0,4 @@ | ||
import { join, resolve } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import { join } from 'path'; | ||
import { wrapBundleError } from '../bundle_error.js'; | ||
import { getPackagePath } from '../package_json.js'; | ||
import { getFileHash } from '../utils/sha256.js'; | ||
@@ -29,7 +29,6 @@ const bundleESZIP = async ({ basePath, buildID, debug, deno, distDirectory, functions, importMap, }) => { | ||
const getESZIPBundler = () => { | ||
const url = new URL(import.meta.url); | ||
const pathname = fileURLToPath(url); | ||
const bundlerPath = resolve(pathname, '../../../deno/bundle.ts'); | ||
const packagePath = getPackagePath(); | ||
const bundlerPath = join(packagePath, 'deno', 'bundle.ts'); | ||
return bundlerPath; | ||
}; | ||
export { bundleESZIP as bundle }; |
@@ -0,2 +1,3 @@ | ||
declare const getPackagePath: () => string; | ||
declare const getPackageVersion: () => string; | ||
export { getPackageVersion }; | ||
export { getPackagePath, getPackageVersion }; |
import { readFileSync } from 'fs'; | ||
import { dirname, join } from 'path'; | ||
import { findUpSync } from 'find-up'; | ||
const getPackageVersion = () => { | ||
const getPackagePath = () => { | ||
const packageJSONPath = findUpSync('package.json', { cwd: import.meta.url }); | ||
// We should never get here, but let's show a somewhat useful error message. | ||
if (packageJSONPath === undefined) { | ||
return ''; | ||
throw new Error('Could not find `package.json` for `@netlify/edge-bundler`. Please try running `npm install` to reinstall your dependencies.'); | ||
} | ||
return dirname(packageJSONPath); | ||
}; | ||
const getPackageVersion = () => { | ||
const packagePath = getPackagePath(); | ||
try { | ||
const packageJSON = readFileSync(packageJSONPath, 'utf8'); | ||
const packageJSON = readFileSync(join(packagePath, 'package.json'), 'utf8'); | ||
const { version } = JSON.parse(packageJSON); | ||
@@ -17,2 +23,2 @@ return version; | ||
}; | ||
export { getPackageVersion }; | ||
export { getPackagePath, getPackageVersion }; |
{ | ||
"name": "@netlify/edge-bundler", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Intelligently prepare Netlify Edge Functions for deployment", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57256
1332