Socket
Socket
Sign inDemoInstall

vercel-deno-dev

Package Overview
Dependencies
26
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-dc4ad47db8397a0bb5c9bbb2da3808af6865420f to 0.1.0-e00d21098705d6180e32020eb71449e7e8854e6c

dist/boot/test.ts

8

dist/boot/runtime.ts

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

import { Context, APIGatewayProxyEvent } from 'https://deno.land/x/lambda/mod.ts';
import { NowApiHandler, NowRequest, NowResponse, NowRequestCookies, NowRequestQuery } from './NowHandler.ts';
import { NowApiHandler, NowRequest, NowResponse, NowRequestCookies, NowRequestQuery } from './nowHandler.ts';

@@ -24,3 +24,4 @@ import { setLazyProp, getCookieParser, getQueryParser } from './helpers.ts';

AWS_LAMBDA_LOG_STREAM_NAME,
_HANDLER,
_HANDLER,
LAMBDA_TASK_ROOT,
AWS_LAMBDA_RUNTIME_API

@@ -31,2 +32,3 @@ } = Deno.env.toObject();

const RUNTIME_PATH = '2018-06-01/runtime';
const [HANDLER_FILE,HANDLER_NAME] = _HANDLER.split('.');

@@ -238,3 +240,3 @@ async function initialize() {

chunk = '';
} else if (Buffer.isBuffer(chunk)) {
} else if (chunk instanceof Uint8Array) {
if (!res.headers?.get('content-type')) {

@@ -241,0 +243,0 @@ res.headers?.set('content-type', 'application/octet-stream');

@@ -9,3 +9,2 @@ "use strict";

const path_1 = __importDefault(require("path"));
const util_1 = require("./util");
const gatherExtraFiles_1 = __importDefault(require("./gatherExtraFiles"));

@@ -16,6 +15,4 @@ const runUserScripts_1 = __importDefault(require("./runUserScripts"));

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);

@@ -43,3 +40,3 @@ // if (meta.isDev) {

// Booleans
const unstable = !!process.env.DENO_UNSTABLE;
//const unstable = !!process.env.DENO_UNSTABLE;
let tsconfig = "";

@@ -56,31 +53,37 @@ 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 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_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 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_1.default(denoDir);

@@ -92,13 +95,5 @@ const lambda = await build_utils_1.createLambda({

...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"
});

@@ -109,4 +104,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-dc4ad47db8397a0bb5c9bbb2da3808af6865420f",
"version": "0.1.0-e00d21098705d6180e32020eb71449e7e8854e6c",
"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