Socket
Socket
Sign inDemoInstall

vercel-deno-dev

Package Overview
Dependencies
4
Maintainers
1
Versions
191
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0-7b646479eba56e16ae746f5032130b9c9947174c to 0.1.0-8674f4f79629f761b97df442ed38b3e23501ed27

dist/boot/test.ts

2

dist/boot/runtime.ts

@@ -73,3 +73,3 @@ import * as base64 from 'https://deno.land/x/base64/mod.ts';

if (!handler) {
const module = await import(`${LAMBDA_TASK_ROOT}/${_HANDLER}`);
const module = await import(`./${_HANDLER}`);
handler = module.default;

@@ -76,0 +76,0 @@ if (!handler) {

@@ -9,12 +9,9 @@ "use strict";

const path_1 = __importDefault(require("path"));
const util_1 = require("./util");
const gatherExtraFiles_1 = __importDefault(require("./gatherExtraFiles"));
const runUserScripts_1 = __importDefault(require("./runUserScripts"));
const grabDenoDirFiles_1 = __importDefault(require("./grabDenoDirFiles"));
//import grabDenoDirFiles from "./grabDenoDirFiles";
const getDenoLambdaLayer_1 = __importDefault(require("./getDenoLambdaLayer"));
const version_1 = require("../version");
const execa_1 = __importDefault(require("execa"));
async function build(opts) {
const { files, entrypoint, workPath: wp, config, meta = {} } = opts;
const workPath = util_1.getWorkPath(wp, entrypoint);
const { files, entrypoint, workPath, config, meta = {} } = opts;
await fs_extra_1.default.mkdirp(workPath);

@@ -42,3 +39,4 @@ // if (meta.isDev) {

// Booleans
const unstable = !!process.env.DENO_UNSTABLE;
//const unstable = !!process.env.DENO_UNSTABLE;
console.log({ workPath });
let tsconfig = "";

@@ -55,48 +53,46 @@ try {

}
console.log({ tsconfig });
console.log("building single file");
const entrypointPath = downloadedFiles[entrypoint].fsPath;
const entrypointDirname = path_1.default.dirname(entrypointPath);
const extname = path_1.default.extname(entrypointPath);
const binName = path_1.default.basename(entrypointPath).replace(extname, "");
const binPath = path_1.default.join(workPath, binName) + ".bundle.js";
const denoDir = path_1.default.join(workPath, "layer", ".deno_dir");
const denoVer = util_1.parseDenoVersion(process.env.DENO_VERSION || "latest");
console.log("running `deno bundle`...");
try {
const denoBin = layerFiles["bin/deno"].fsPath;
await execa_1.default(denoBin, [
"bundle",
entrypointPath,
binPath,
...(tsconfig && (denoVer.major >= 1) ? ["-c", tsconfig] : []),
...(unstable ? ["--unstable"] : []),
], {
env: {
DENO_DIR: denoDir,
},
cwd: entrypointDirname,
stdio: "pipe",
});
}
catch (err) {
build_utils_1.debug("failed to `deno bundle`");
throw new Error("Failed to run `deno bundle`: " + err.stdout + " " + err.stderr);
}
const denoDirFiles = await grabDenoDirFiles_1.default(denoDir);
// const entrypointPath = downloadedFiles[entrypoint].fsPath;
// const entrypointDirname = path.dirname(entrypointPath);
// const extname = path.extname(entrypointPath);
// const binName = path.basename(entrypointPath).replace(extname, "");
// const binPath = path.join(workPath, binName) + ".bundle.js";
// const denoDir = path.join(workPath, "layer", ".deno_dir");
// const denoVer = parseDenoVersion(process.env.DENO_VERSION || "latest");
// console.log("running `deno bundle`...");
// try {
// const denoBin = layerFiles["bin/deno"].fsPath as string;
// await execa(
// denoBin,
// [
// "bundle",
// entrypointPath,
// binPath,
// ...(tsconfig && (denoVer.major >= 1) ? ["-c", tsconfig] : []),
// ...(unstable ? ["--unstable"] : []),
// ],
// {
// env: {
// DENO_DIR: denoDir,
// },
// cwd: entrypointDirname,
// stdio: "pipe",
// },
// );
// } catch (err) {
// debug("failed to `deno bundle`");
// throw new Error(
// "Failed to run `deno bundle`: " + err.stdout + " " + err.stderr,
// );
// }
// const denoDirFiles = await grabDenoDirFiles(denoDir);
const lambda = await build_utils_1.createLambda({
files: {
...downloadedFiles,
...extraFiles,
...layerFiles,
...denoDirFiles,
[binName + ".bundle.js"]: new build_utils_1.FileFsRef({
mode: 0o755,
fsPath: binPath,
}),
},
handler: binName + ".handler",
runtime: "provided",
environment: {
HANDLER_EXT: "bundle.js",
PATH: process.env.PATH + ":./bin",
},
handler: entrypoint,
runtime: "provided"
});

@@ -107,4 +103,4 @@ if (version_1.version === 3) {

return {
[entrypoint]: lambda,
output: lambda,
};
}

@@ -6,4 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getWorkPath = exports.parseDenoVersion = exports.getDeno = exports.DENO_VERSION = exports.DENO_LATEST = void 0;
const path_1 = __importDefault(require("path"));
exports.parseDenoVersion = exports.getDeno = exports.DENO_VERSION = exports.DENO_LATEST = void 0;
const execa_1 = __importDefault(require("execa"));

@@ -43,2 +42,1 @@ exports.DENO_LATEST = "latest";

exports.parseDenoVersion = parseDenoVersion;
exports.getWorkPath = (workPath, entrypoint) => path_1.default.join(workPath, ".now", "builders", "now-denolis", entrypoint);
{
"name": "vercel-deno-dev",
"version": "0.1.0-7b646479eba56e16ae746f5032130b9c9947174c",
"version": "0.1.0-8674f4f79629f761b97df442ed38b3e23501ed27",
"description": "run deno on vercel",

@@ -5,0 +5,0 @@ "main": "./dist/index",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc