-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
179df78
commit a445d07
Showing
10 changed files
with
319 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { bundleAll } from "../build"; | ||
import { color } from "./console"; | ||
|
||
export async function build() { | ||
const log = (text: string) => { | ||
console.log(color(" Build ", "Blue"), text); | ||
}; | ||
|
||
log("bulding app from ./app"); | ||
const routes = await bundleAll(); | ||
routes.forEach((x) => log(`created route ${x}`)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const colors = { | ||
Black: "\x1b[40m", | ||
Red: "\x1b[41m", | ||
Green: "\x1b[42m", | ||
Yellow: "\x1b[43m", | ||
Blue: "\x1b[44m", | ||
Magenta: "\x1b[45m", | ||
Cyan: "\x1b[46m", | ||
White: "\x1b[47m", | ||
Gray: "\x1b[100m", | ||
Reset: "\x1b[0m", | ||
}; | ||
|
||
export function color(text: string, color: keyof typeof colors) { | ||
return `${colors[color]}${text}${colors.Reset}`; | ||
} | ||
|
||
export function withHeading( | ||
text: string, | ||
heading: string, | ||
color: keyof typeof colors | ||
) { | ||
return `${colors[color]} ${heading} ${colors.Reset} ${text}`; | ||
} | ||
|
||
export function error(...text: string[]) { | ||
console.log( | ||
withHeading( | ||
text.reduce((acc, x) => `${acc}${x}`, ""), | ||
"ERROR", | ||
"Red" | ||
) | ||
); | ||
} | ||
|
||
export function warn(...text: string[]) { | ||
console.log( | ||
withHeading( | ||
text.reduce((acc, x) => `${acc}${x}`, ""), | ||
"WARN", | ||
"Yellow" | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { build } from "./build"; | ||
import { color } from "./console"; | ||
import { deploy as cdkDeploy } from "../deploy"; | ||
|
||
export async function deploy() { | ||
const log = (text: string) => { | ||
console.log(color(" Deploy ", "Green"), text); | ||
}; | ||
|
||
log("starting deploying app"); | ||
await build(); | ||
log("done building, starting deploy"); | ||
cdkDeploy(); | ||
} |
Oops, something went wrong.