Skip to content

Commit

Permalink
Merge pull request #3180 from Zemnmez/pr3180
Browse files Browse the repository at this point in the history
Introduce my own pulumi Website component. I didn't want to have to do this, but have had to becuase of https://github.c
  • Loading branch information
Zemnmez authored Jun 5, 2023
2 parents 7cd16a6 + f27abf7 commit 959017a
Show file tree
Hide file tree
Showing 21 changed files with 348 additions and 226 deletions.
6 changes: 3 additions & 3 deletions deploy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ ts_project(
"//project/ck3/recursive-vassals:mod_zip",
"//project/ck3/recursive-vassals:patch",
"//ts/cmd/svgshot:npm_pkg.publish",
"//ts/cmd/svgshot:package.json",
"//ts/cmd/svgshot:npm_pkg.tgz",
"//ts/cmd/svgshot:package.json",
"//ts/do-sync:npm_pkg.publish",
"//ts/do-sync:package.json",
"//ts/do-sync:npm_pkg.tgz",
"//ts/do-sync:package.json",
"//ts/knowitwhenyouseeit:npm_pkg.publish",
"//ts/knowitwhenyouseeit:package.json",
"//ts/knowitwhenyouseeit:npm_pkg.tgz",
"//ts/knowitwhenyouseeit:package.json",
],
deps = [
"//:node_modules/@actions/github",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
},
"dependencies": {
"@commander-js/extra-typings": "^10.0.3",
"@pulumi/aws-static-website": "^0.4.0",
"@pulumi/command": "4.5.0",
"@types/bcryptjs": "2.4.2",
"csstype": "^3.1.1",
Expand Down
35 changes: 22 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions ts/guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ export function isNotNull<T>(i: T | null): i is T {
return i !== null;
}

export function must<I, O extends I>(f: (v: I) => v is O): (v: I) => O {
export function must<I, O extends I>(
f: (v: I) => v is O,
message?: () => string
): (v: I) => O {
return v => {
if (!f(v)) throw new Error(`${v} not ${f.name}`);
if (!f(v))
throw new Error(
`${v} not ${f.name} ${message ? `(${message()})` : ''}`
);
return v;
};
}
Expand Down
11 changes: 0 additions & 11 deletions ts/pulumi/dog/pleaseintroducemetoyour/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,11 @@ ts_project(
name = "pleaseintroducemetoyour",
srcs = ["index.ts"],
deps = [
":cert",
":zone",
"//ts/pulumi/dog/pleaseintroducemetoyour/public",
],
)

ts_project(
name = "cert",
srcs = ["cert.ts"],
deps = [
":zone",
"//:node_modules/@pulumi/aws",
"//:node_modules/@pulumi/pulumi",
],
)

ts_project(
name = "zone",
srcs = ["zone.ts"],
Expand Down
46 changes: 0 additions & 46 deletions ts/pulumi/dog/pleaseintroducemetoyour/cert.ts

This file was deleted.

1 change: 0 additions & 1 deletion ts/pulumi/dog/pleaseintroducemetoyour/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from 'ts/pulumi/dog/pleaseintroducemetoyour/cert';
export * as Public from 'ts/pulumi/dog/pleaseintroducemetoyour/public';
export * from 'ts/pulumi/dog/pleaseintroducemetoyour/zone';
4 changes: 2 additions & 2 deletions ts/pulumi/dog/pleaseintroducemetoyour/public/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ts_project(
name = "public",
data = ["//ts/pulumi/dog/pleaseintroducemetoyour/public/static"],
deps = [
"//:node_modules/@pulumi/aws-static-website",
"//:node_modules/@pulumi/pulumi",
"//ts/pulumi/dog/pleaseintroducemetoyour:cert",
"//ts/pulumi/dog/pleaseintroducemetoyour:zone",
"//ts/pulumi/lib",
],
)
23 changes: 9 additions & 14 deletions ts/pulumi/dog/pleaseintroducemetoyour/public/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import * as staticwebsite from '@pulumi/aws-static-website';
import * as asset from '@pulumi/pulumi/asset';
import * as cert from 'ts/pulumi/dog/pleaseintroducemetoyour/cert';
import * as zone from 'ts/pulumi/dog/pleaseintroducemetoyour/zone';
import Website from 'ts/pulumi/lib/website';

export const site = new staticwebsite.Website('pleaseintroducemetoyour.dog', {
withCDN: true,
indexHTML: new asset.FileAsset(
'ts/pulumi/dog/pleaseintroducmetoyour/public/static/out/index.html'
).path,
error404: new asset.FileAsset(
'ts/pulumi/dog/pleaseintroducemetoyour/public/static/out/404.html'
).path,
sitePath: 'ts/pulumi/dog/pleaseintroducemetoyour/public/static/out',
targetDomain: 'pleaseintroducemetoyour.dog',
certificateARN: cert.arn,
export const site = new Website('pleaseintroducemetoyour.dog', {
index: 'ts/pulumi/dog/pleaseintroducemetoyour/public/static/out/index.html',
notFound:
'ts/pulumi/dog/pleaseintroducemetoyour/public/static/out/404.html',
directory: 'ts/pulumi/dog/pleaseintroducemetoyour/public/static/out',
zone: zone.zone,
subDomain: undefined,
});
1 change: 0 additions & 1 deletion ts/pulumi/im/shadwell/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ts_project(
name = "shadwell",
deps = [
"//:node_modules/@pulumi/aws",
"//ts/pulumi/im/shadwell/cert",
"//ts/pulumi/im/shadwell/thomas",
"//ts/pulumi/im/shadwell/zone",
],
Expand Down
12 changes: 0 additions & 12 deletions ts/pulumi/im/shadwell/cert/BUILD.bazel

This file was deleted.

Loading

0 comments on commit 959017a

Please sign in to comment.