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

nextjs-server-modules

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextjs-server-modules - npm Package Compare versions

Comparing version 1.5.2 to 1.5.3

27

nsm/scripts/generate-routes.js

@@ -0,9 +1,14 @@

const glob = require("glob-promise")
const path = require("path")
const prettier = require("prettier")
const fs = require("fs/promises")
const { existsSync } = require("fs")
async function generateRoutes() {
const pagesDir = path.resolve(__dirname, "../../.next/server/pages")
const staticDir = path.resolve(__dirname, "../../.next/static")
const staticFiles = (await glob("**/*", { cwd: staticDir })).filter((fp) =>
fp.includes(".")
)
const pagesManifest = JSON.parse(

@@ -14,13 +19,13 @@ await fs.readFile(path.resolve(pagesDir, "../pages-manifest.json"))

const routesFile = prettier.format(
`import path from "path"
export default {
`export default {
${Object.entries(pagesManifest)
.map(([route, fp]) => {
if (!fp.startsWith("pages/api")) {
return `"${route}": path.resolve(__dirname, "../.next/server/${fp}")`
}
return `"${route}": require("../${fp.split(".")[0]}")`
})
.join(",")}
.map(([route, fp]) =>
fp.startsWith("pages/api")
? `"${route}": require("../${fp}")`
: `"${route}": require.resolve("../.next/server/${fp}")`
)
.join(",")},
${staticFiles.map(
(fp) => `"/_next/static/${fp}": require.resolve("../.next/static/${fp}")`
)}
}

@@ -27,0 +32,0 @@

{
"name": "nextjs-server-modules",
"version": "1.5.2",
"version": "1.5.3",
"main": "bin.js",

@@ -5,0 +5,0 @@ "repository": "git@github.com:hello-seam/nextjs-server-modules.git",

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