New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vercel/static-build

Package Overview
Dependencies
Maintainers
23
Versions
270
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/static-build - npm Package Compare versions

Comparing version 0.17.12 to 0.17.13-canary.0

dist/utils/read-build-output.js

59

dist/utils/_shared.js

@@ -6,9 +6,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.readBuildOutputDirectory = exports.writePackageJson = exports.readPackageJson = exports.fileExists = void 0;
exports.isObjectEmpty = exports.writePackageJson = exports.readPackageJson = exports.fileExists = void 0;
const fs_1 = require("fs");
const build_utils_1 = require("@vercel/build-utils");
const launcher_1 = require("../launcher");
const build_utils_2 = __importDefault(require("../build-utils"));
const path_1 = __importDefault(require("path"));
const { createLambda, debug, getLatestNodeVersion, glob } = build_utils_2.default;
async function fileExists(path) {

@@ -38,51 +34,8 @@ return fs_1.promises.access(path, fs_1.constants.F_OK).then(() => true, () => false);

exports.writePackageJson = writePackageJson;
/**
* Reads the .vercel_build_output directory and returns and object
* that should be merged with the build outputs.
*
* At the moment only `functions/node` is supported.
*/
async function readBuildOutputDirectory({ workPath, }) {
const output = {};
const nodeFunctionPath = path_1.default.join(workPath, '.vercel_build_output', 'functions', 'node');
const nodeFunctionFiles = await glob('**/index.js', {
cwd: nodeFunctionPath,
});
const nodeBridgeData = await fs_1.promises.readFile(path_1.default.join(__dirname, 'bridge.js'));
for (const fileName of Object.keys(nodeFunctionFiles)) {
const launcherFileName = '___now_launcher';
const bridgeFileName = '___now_bridge';
const launcherFiles = {
[`${launcherFileName}.js`]: new build_utils_1.FileBlob({
data: launcher_1.makeNowLauncher({
entrypointPath: `./index.js`,
bridgePath: `./${bridgeFileName}`,
helpersPath: '',
sourcemapSupportPath: '',
shouldAddHelpers: false,
shouldAddSourcemapSupport: false,
}),
}),
[`${bridgeFileName}.js`]: new build_utils_1.FileBlob({
data: nodeBridgeData,
}),
};
const requiredFiles = await glob('**', {
cwd: path_1.default.join(nodeFunctionPath, path_1.default.dirname(fileName)),
});
const lambda = await createLambda({
files: {
...requiredFiles,
...launcherFiles,
},
handler: `${launcherFileName}.launcher`,
runtime: getLatestNodeVersion().runtime,
});
const parsed = path_1.default.parse(fileName);
const newPath = path_1.default.join(parsed.dir, parsed.name);
output[newPath] = lambda;
debug(`Created Lambda "${newPath}" from "${path_1.default.join(nodeFunctionPath, fileName)}".`);
function isObjectEmpty(object) {
for (const _prop in object) {
return false;
}
return { output };
return true;
}
exports.readBuildOutputDirectory = readBuildOutputDirectory;
exports.isObjectEmpty = isObjectEmpty;
{
"name": "@vercel/static-build",
"version": "0.17.12",
"version": "0.17.13-canary.0",
"license": "MIT",

@@ -34,3 +34,3 @@ "main": "./dist/index",

},
"gitHead": "a2c56425f426272364bc39abde6e8cb82267b3ad"
"gitHead": "4205d643a17d1b717b6dad6430462ae5196df591"
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc