Skip to content

Commit

Permalink
example nextjs site
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Nov 21, 2023
1 parent 1e630c1 commit ec9db15
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.sst
dist
node_modules
Pulumi.*.yaml

# osx
.DS_Store
10 changes: 5 additions & 5 deletions cmd/sst/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@ func main() {
continue
}
if evt.ResourcePreEvent.Metadata.Op == apitype.OpSame {
color.New(color.FgHiBlack).Print("| ")
color.New(color.FgHiBlack, color.Bold).Print("| ")
color.New(color.FgHiBlack).Println("Skipping ", evt.ResourcePreEvent.Metadata.URN)
continue
}

timing[evt.ResourcePreEvent.Metadata.URN] = time.Now()
if evt.ResourcePreEvent.Metadata.Op == apitype.OpCreate {
color.New(color.FgYellow).Print("| ")
color.New(color.FgYellow, color.Bold).Print("| ")
color.New(color.FgHiBlack).Println("Creating ", evt.ResourcePreEvent.Metadata.URN)
continue
}

if evt.ResourcePreEvent.Metadata.Op == apitype.OpUpdate {
color.New(color.FgYellow).Print("| ")
color.New(color.FgYellow, color.Bold).Print("| ")
color.New(color.FgHiBlack).Println("Updating ", evt.ResourcePreEvent.Metadata.URN)
continue
}
Expand All @@ -104,7 +104,7 @@ func main() {
}
duration := time.Since(timing[evt.ResOutputsEvent.Metadata.URN]).Milliseconds()
if evt.ResOutputsEvent.Metadata.Op == apitype.OpCreate {
color.New(color.FgGreen).Print("| ")
color.New(color.FgGreen, color.Bold).Print("| ")
color.New(color.FgHiBlack).Println("Created ", evt.ResOutputsEvent.Metadata.URN, " in ", duration, "ms")
}
if evt.ResOutputsEvent.Metadata.Op == apitype.OpUpdate {
Expand All @@ -119,7 +119,7 @@ func main() {
color.New(color.FgWhite, color.Bold).Println(" Deployed:")
for k, v := range outputs {
color.New(color.FgHiBlack).Print(" ")
color.New(color.FgWhite, color.Bold).Print(k)
color.New(color.FgWhite).Print(k)
color.New(color.FgHiBlack).Print(" = ")
color.New(color.FgWhite).Println(v)
}
Expand Down
4 changes: 4 additions & 0 deletions examples/nextjs/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: nextjs
runtime: nodejs
backend:
url: 's3://sst-bootstrap-a4ff42d8-0699-4f7a-be4d-5508d3e16e66-us-east-1'
Empty file.
13 changes: 13 additions & 0 deletions examples/nextjs/sst.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/// <reference path="./.sst/types/global.d.ts" />

export default {
config() {
return {
name: "nextjs",
region: "us-east-1",
};
},
async run() {
const { SSRSite } = await import("./components/NextJSSite");
},
};
1 change: 0 additions & 1 deletion examples/test/Pulumi.thdxr.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/test/sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
async run() {
const a = new aws.s3.Bucket("my-bucket", {
tags: {
foo: "12",
foo: "1123",
},
});
return {
Expand Down

0 comments on commit ec9db15

Please sign in to comment.