Skip to content

Commit

Permalink
fix: Serverless Deployment provider packs correctly (redwoodjs#10646)
Browse files Browse the repository at this point in the history
Fixes redwoodjs#10528

Simple fix that restores Serverless deployment functionality.

---------

Co-authored-by: David Thyresson <dthyresson@gmail.com>
  • Loading branch information
jwwisgerhof and dthyresson committed May 23, 2024
1 parent de67ddf commit 902d006
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changesets/10646.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- fix(cli): Fix issues with Serverless deployments in 7.x (#10646) by @jwwisgerhof

Serverless deployments were not functional since an internal update in the last
minor versions. This change updates the NFT packer to a more modern import system
which resolves the issue.
6 changes: 4 additions & 2 deletions packages/cli/src/commands/deploy/packing/nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import fse from 'fs-extra'
import { findApiDistFunctions } from '@redwoodjs/internal/dist/files'
import { ensurePosixPath, getPaths } from '@redwoodjs/project-config'

import * as nftPacker from '../packing/nft'

const ZIPBALL_DIR = './api/dist/zipball'

export function zipDirectory(source, out) {
Expand Down Expand Up @@ -59,7 +61,7 @@ export async function packageSingleFunction(functionFile) {
copyPromises.push(functionEntryPromise)

await Promise.all(copyPromises)
await exports.zipDirectory(
await zipDirectory(
`${ZIPBALL_DIR}/${functionName}`,
`${ZIPBALL_DIR}/${functionName}.zip`,
)
Expand All @@ -69,5 +71,5 @@ export async function packageSingleFunction(functionFile) {

export function nftPack() {
const filesToBePacked = findApiDistFunctions()
return Promise.all(filesToBePacked.map(exports.packageSingleFunction))
return Promise.all(filesToBePacked.map(nftPacker.packageSingleFunction))
}

0 comments on commit 902d006

Please sign in to comment.