Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vercel/remix

Package Overview
Dependencies
Maintainers
8
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/remix - npm Package Compare versions

Comparing version 1.2.10 to 1.2.11

37

dist/build.js

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

const fs_1 = require("fs");
const vm_1 = require("vm");
const path_1 = require("path");

@@ -147,6 +148,13 @@ const build_utils_1 = require("@vercel/build-utils");

}
const [staticFiles, renderFunction] = await Promise.all([
const [staticFiles, renderFunction, ssrRoutes] = await Promise.all([
(0, build_utils_1.glob)('**', (0, path_1.join)(entrypointFsDirname, 'public')),
createRenderFunction(entrypointFsDirname, repoRootPath, serverBuildPath, needsHandler, nodeVersion),
getSsrRoutes(entrypointFsDirname),
]);
const output = staticFiles;
for (const path of ssrRoutes) {
output[path] = renderFunction;
}
// Add a 404 path for not found pages to be server-side rendered by Remix
output['404'] = renderFunction;
return {

@@ -164,9 +172,6 @@ routes: [

src: '/(.*)',
dest: '/render',
dest: '/404',
},
],
output: {
render: renderFunction,
...staticFiles,
},
output,
};

@@ -211,2 +216,22 @@ };

}
async function getSsrRoutes(entrypointDir) {
// Find the name of the manifest file
const buildDir = (0, path_1.join)(entrypointDir, 'public/build');
const manifestFileName = (await fs_1.promises.readdir(buildDir)).find(n => n.startsWith('manifest-'));
if (!manifestFileName) {
throw new Error(`Failed to find manifest file in "${buildDir}"`);
}
const context = {
window: {},
};
(0, vm_1.createContext)(context);
const code = await fs_1.promises.readFile((0, path_1.join)(buildDir, manifestFileName), 'utf8');
(0, vm_1.runInContext)(code, context);
const routes = context.window.__remixManifest?.routes || {};
return Object.keys(routes)
.filter(id => id !== 'root')
.map(id => {
return routes[id].path || 'index';
});
}
//# sourceMappingURL=build.js.map

@@ -7,1 +7,8 @@ export interface AppConfig {

}
export interface RemixBuildManifest {
routes: {
[id: string]: {
path: string;
};
};
}

6

package.json
{
"name": "@vercel/remix",
"version": "1.2.10",
"version": "1.2.11",
"license": "MIT",

@@ -27,6 +27,6 @@ "main": "./dist/index.js",

"@types/node": "14.18.33",
"@vercel/build-utils": "6.1.0",
"@vercel/build-utils": "6.2.0",
"typescript": "4.9.4"
},
"gitHead": "a4d16c681a7e85f64a2d78432d499c599b398bde"
"gitHead": "a585969dd3b77a4ed36d6a2ca11b34f9050489f1"
}

Sorry, the diff of this file is not supported yet

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