(args: SitesCreateArgs)
| 31 | } |
| 32 | |
| 33 | export async function runSitesCreate(args: SitesCreateArgs): Promise<void> { |
| 34 | const stack = requireStack(args.stackName); |
| 35 | const projectDir = resolvePath(args.projectDir); |
| 36 | |
| 37 | const { deploySite } = await loadSDK(); |
| 38 | const handle = await deploySite({ |
| 39 | projectDir, |
| 40 | bucketName: stack.bucketName, |
| 41 | region: stack.region, |
| 42 | siteId: args.siteId, |
| 43 | }); |
| 44 | |
| 45 | if (args.json) { |
| 46 | console.log(JSON.stringify(handle, null, 2)); |
| 47 | return; |
| 48 | } |
| 49 | |
| 50 | console.log( |
| 51 | c.success(handle.uploaded ? "Site uploaded." : "Site already up to date (skipped upload)."), |
| 52 | ); |
| 53 | console.log(` ${c.dim("Site ID:")} ${handle.siteId}`); |
| 54 | console.log(` ${c.dim("S3 URI:")} ${handle.projectS3Uri}`); |
| 55 | console.log(` ${c.dim("Bytes:")} ${handle.bytes}`); |
| 56 | console.log(` ${c.dim("Uploaded at:")} ${handle.uploadedAt}`); |
| 57 | console.log(); |
| 58 | console.log( |
| 59 | c.dim( |
| 60 | `Render with: hyperframes lambda render ${args.projectDir} --site-id=${handle.siteId}` + |
| 61 | (args.stackName === DEFAULT_STACK_NAME ? "" : ` --stack-name=${args.stackName}`), |
| 62 | ), |
| 63 | ); |
| 64 | } |
no test coverage detected