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

@dealmore/terraform-next-build

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dealmore/terraform-next-build - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

40

dist/commands/build.js

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

buildId: props.buildId,
prerenders: props.prerenders,
staticFilesArchive: 'static-website-files.zip',

@@ -101,3 +102,5 @@ };

// On download create a tmp dir where the files can be downloaded
const tmpDir = mode === 'download' ? tmp_1.default.dirSync() : null;
const tmpDir = mode === 'download'
? tmp_1.default.dirSync({ unsafeCleanup: deleteBuildCache })
: null;
const entryPath = cwd;

@@ -112,2 +115,3 @@ const entrypoint = 'package.json';

const lambdas = {};
const prerenders = {};
const staticWebsiteFiles = {};

@@ -118,3 +122,3 @@ const buildResult = await next_tf_1.build({

entrypoint,
config: {},
config: { sharedLambdas: true },
meta: {

@@ -129,9 +133,27 @@ isDev: false,

for (const [key, file] of Object.entries(buildResult.output)) {
if (file.type === 'Lambda') {
// Filter for lambdas
lambdas[key] = file;
switch (file.type) {
case 'Lambda': {
lambdas[key] = file;
break;
}
case 'Prerender': {
prerenders[key] = file;
break;
}
case 'FileFsRef': {
staticWebsiteFiles[key] = file;
break;
}
}
else if (file.type === 'FileFsRef') {
// Filter for static Website content
staticWebsiteFiles[key] = file;
}
// Build the mapping for prerendered routes
const prerenderedOutput = {};
for (const [key, prerender] of Object.entries(prerenders)) {
// Find the matching the Lambda route
const match = Object.entries(lambdas).find(([, lambda]) => {
return lambda === prerender.lambda;
});
if (match) {
const [lambdaKey] = match;
prerenderedOutput[`/${key}`] = { lambda: lambdaKey };
}

@@ -141,2 +163,3 @@ }

buildId,
prerenders: prerenderedOutput,
routes: buildResult.routes,

@@ -161,3 +184,2 @@ lambdas,

if (tmpDir && deleteBuildCache) {
fs.emptyDirSync(tmpDir.name);
tmpDir.removeCallback();

@@ -164,0 +186,0 @@ }

{
"name": "@dealmore/terraform-next-build",
"version": "0.1.0",
"version": "0.2.0",
"description": "CLI build tool for AWS Next.js Terraform module",

@@ -22,7 +22,7 @@ "homepage": "https://github.com/dealmore/terraform-aws-next-js",

"dependencies": {
"@dealmore/next-tf": "2.6.19",
"@vercel/build-utils": "^2.4.2",
"@dealmore/next-tf": "2.7.3",
"@vercel/build-utils": "^2.6.0",
"@vercel/frameworks": "^0.0.15",
"@vercel/routing-utils": "^1.8.3",
"archiver": "^4.0.1",
"archiver": "^5.1.0",
"fs-extra": "^9.0.1",

@@ -34,3 +34,3 @@ "glob": "^7.1.6",

"devDependencies": {
"@types/archiver": "^3.1.0",
"@types/archiver": "^5.1.0",
"@types/fs-extra": "^9.0.1",

@@ -37,0 +37,0 @@ "@types/glob": "^7.1.2",

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