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

@remix-run/cloudflare-pages

Package Overview
Dependencies
Maintainers
2
Versions
1028
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remix-run/cloudflare-pages - npm Package Compare versions

Comparing version 0.0.0-experimental-56ff64d1 to 0.0.0-experimental-583953af

magicExports/esm/remix.js

2

cookieSigning.js
/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-583953af
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-583953af
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-583953af
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-583953af
*

@@ -13,4 +13,4 @@ * Copyright (c) Remix Software Inc.

export { createCloudflareKVSessionStorage } from './sessions/cloudflareKVSessionStorage.js';
export { createFetchHandler, createRequestHandler } from './worker.js';
export { createPagesFunctionHandler, createRequestHandler } from './worker.js';
installGlobals();
/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-583953af
*

@@ -18,2 +18,4 @@ * Copyright (c) Remix Software Inc.

* KV Store may contain much more data than cookies.
*
* @see https://remix.run/api/remix#createcloudflarekvsessionstorage-cloudflare-workers
*/

@@ -20,0 +22,0 @@ function createCloudflareKVSessionStorage({

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-583953af
*

@@ -25,10 +25,3 @@ * Copyright (c) Remix Software Inc.

}
async function handleAsset(request, env) {
let envWithAssets = env;
const response = await envWithAssets.ASSETS.fetch(request);
if (response.ok) return response;
}
function createFetchHandler({
function createPagesFunctionHandler({
build,

@@ -45,7 +38,11 @@ getLoadContext,

const handleFetch = async context => {
let response;
let url = new URL(context.request.url);
response = // TODO: Remove this once a fix has been meged to wranger@v2
process.env.NODE_ENV === "development" && url.pathname === "/" ? undefined : await handleAsset(context.request.clone(), context.env);
let response; // https://github.com/cloudflare/wrangler2/issues/117
context.request.headers.delete("if-none-match");
try {
response = await context.env.ASSETS.fetch(context.request.url, context.request.clone());
response = response && response.status >= 200 && response.status < 400 ? new Response(response.body, response) : undefined;
} catch {}
if (!response) {

@@ -76,2 +73,2 @@ response = await handleRequest(context);

export { createFetchHandler, createRequestHandler };
export { createPagesFunctionHandler, createRequestHandler };
/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-583953af
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

export { createCloudflareKVSessionStorage } from "./sessions/cloudflareKVSessionStorage";
export type { CreateFetchHandlerParams } from "./worker";
export { createFetchHandler, createRequestHandler } from "./worker";
export type { createPagesFunctionHandlerParams } from "./worker";
export { createPagesFunctionHandler, createRequestHandler } from "./worker";
/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-583953af
*

@@ -22,3 +22,3 @@ * Copyright (c) Remix Software Inc.

exports.createCloudflareKVSessionStorage = cloudflareKVSessionStorage.createCloudflareKVSessionStorage;
exports.createFetchHandler = worker.createFetchHandler;
exports.createPagesFunctionHandler = worker.createPagesFunctionHandler;
exports.createRequestHandler = worker.createRequestHandler;
{
"name": "@remix-run/cloudflare-pages",
"description": "Cloudflare Pages request handler for Remix",
"version": "0.0.0-experimental-56ff64d1",
"version": "0.0.0-experimental-583953af",
"license": "MIT",

@@ -17,3 +17,3 @@ "main": "./index.js",

"dependencies": {
"@remix-run/server-runtime": "0.0.0-experimental-56ff64d1"
"@remix-run/server-runtime": "0.0.0-experimental-583953af"
},

@@ -24,4 +24,5 @@ "peerDependencies": {

"devDependencies": {
"@cloudflare/workers-types": "^3.2.0"
"@cloudflare/workers-types": "^3.2.0",
"@types/mime": "^2.0.3"
}
}

@@ -19,4 +19,6 @@ /// <reference types="@cloudflare/workers-types" />

* KV Store may contain much more data than cookies.
*
* @see https://remix.run/api/remix#createcloudflarekvsessionstorage-cloudflare-workers
*/
export declare function createCloudflareKVSessionStorage({ cookie, kv }: KVSessionStorageOptions): SessionStorage;
export declare function createCloudflareKVSessionStorage({ cookie, kv, }: KVSessionStorageOptions): SessionStorage;
export {};
/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-583953af
*

@@ -22,2 +22,4 @@ * Copyright (c) Remix Software Inc.

* KV Store may contain much more data than cookies.
*
* @see https://remix.run/api/remix#createcloudflarekvsessionstorage-cloudflare-workers
*/

@@ -24,0 +26,0 @@ function createCloudflareKVSessionStorage({

/// <reference types="@cloudflare/workers-types" />
import type { ServerBuild, AppLoadContext } from "@remix-run/server-runtime";
export interface CreateFetchHandlerParams<Env = any> {
export interface createPagesFunctionHandlerParams<Env = any> {
build: ServerBuild;

@@ -8,3 +8,3 @@ getLoadContext?: (context: EventContext<Env, any, any>) => AppLoadContext;

}
export declare function createRequestHandler<Env = any>({ build, getLoadContext, mode }: CreateFetchHandlerParams<Env>): PagesFunction<Env>;
export declare function createFetchHandler<Env = any>({ build, getLoadContext, mode }: CreateFetchHandlerParams<Env>): (context: EventContext<Env, any, any>) => Promise<Response>;
export declare function createRequestHandler<Env = any>({ build, getLoadContext, mode, }: createPagesFunctionHandlerParams<Env>): PagesFunction<Env>;
export declare function createPagesFunctionHandler<Env = any>({ build, getLoadContext, mode, }: createPagesFunctionHandlerParams<Env>): (context: EventContext<Env, any, any>) => Promise<Response>;
/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-583953af
*

@@ -29,10 +29,3 @@ * Copyright (c) Remix Software Inc.

}
async function handleAsset(request, env) {
let envWithAssets = env;
const response = await envWithAssets.ASSETS.fetch(request);
if (response.ok) return response;
}
function createFetchHandler({
function createPagesFunctionHandler({
build,

@@ -49,7 +42,11 @@ getLoadContext,

const handleFetch = async context => {
let response;
let url = new URL(context.request.url);
response = // TODO: Remove this once a fix has been meged to wranger@v2
process.env.NODE_ENV === "development" && url.pathname === "/" ? undefined : await handleAsset(context.request.clone(), context.env);
let response; // https://github.com/cloudflare/wrangler2/issues/117
context.request.headers.delete("if-none-match");
try {
response = await context.env.ASSETS.fetch(context.request.url, context.request.clone());
response = response && response.status >= 200 && response.status < 400 ? new Response(response.body, response) : undefined;
} catch {}
if (!response) {

@@ -80,3 +77,3 @@ response = await handleRequest(context);

exports.createFetchHandler = createFetchHandler;
exports.createPagesFunctionHandler = createPagesFunctionHandler;
exports.createRequestHandler = createRequestHandler;
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