Skip to content

Commit b6182a5

Browse files
committed
update
1 parent 0d33357 commit b6182a5

File tree

9 files changed

+219
-345
lines changed

9 files changed

+219
-345
lines changed

Pulumi.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: egghead
2-
runtime: nodejs
3-
main: infra/index.ts
2+
main: infra.ts
3+
runtime:
4+
name: nodejs
5+
options:
6+
nodeargs: "--loader ts-node/esm --no-warnings"
47
description: Browser history replacement that doesn't suck eggs

custom.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
declare module '@jlongster/sql.js';
1+
declare module "@jlongster/sql.js";
22

3-
declare module 'absurd-sql';
3+
declare module "absurd-sql";
44

5-
declare module 'absurd-sql/dist/indexeddb-backend';
5+
declare module "absurd-sql/dist/indexeddb-backend";
66

7-
declare module 'absurd-sql/dist/indexeddb-main-thread';
7+
declare module "absurd-sql/dist/indexeddb-main-thread";
88

9-
declare module 'wa-sqlite/src/examples/IDBVersionedVFS';
9+
declare module "wa-sqlite/src/examples/IDBVersionedVFS";
1010

11-
declare module '*.css';
11+
declare module "*.css";
1212

13-
declare module '*.svg';
13+
declare module "*.svg";
1414

15-
declare module '*.db' {
15+
declare module "*.db" {
1616
const content: string;
1717
export default content;
1818
}
1919

20-
declare module '*.txt' {
20+
declare module "*.txt" {
2121
const content: string;
2222
export default content;
2323
}

favicon.ico

-909 Bytes
Binary file not shown.

infra.mts

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import * as aws from "@pulumi/aws";
2+
import * as pulumi from "@pulumi/pulumi";
3+
import * as saws from "@stackattack/aws";
4+
5+
export default () => {
6+
const ctx = saws.context();
7+
const config = new pulumi.Config();
8+
9+
const dnsName = config.require("dns-name");
10+
const docsDnsName = config.require("docs-dns-name");
11+
12+
const demoBucket = saws.bucket(ctx.prefix("demo"));
13+
14+
saws.bucketFiles(ctx.prefix("demo"), {
15+
bucket: demoBucket,
16+
paths: [
17+
"dist/demo",
18+
"dist/chrome.zip",
19+
"dist/firefox.zip",
20+
"dist/firefox-mv2.zip",
21+
],
22+
});
23+
24+
saws.staticSite(ctx.prefix("demo"), {
25+
bucket: demoBucket,
26+
domain: dnsName,
27+
adapter: {
28+
index: "demo-history.html",
29+
defaultHeaders: {
30+
"Cross-Origin-Opener-Policy": "same-origin",
31+
"Cross-Origin-Embedder-Policy": "require-corp",
32+
},
33+
},
34+
});
35+
36+
const docsBucket = saws.bucket(ctx.prefix("docs"));
37+
38+
saws.bucketFiles(ctx.prefix("docs"), {
39+
bucket: docsBucket,
40+
paths: ["dist/docs/html"],
41+
});
42+
43+
saws.staticSite(ctx.prefix("demo"), {
44+
bucket: docsBucket,
45+
domain: docsDnsName,
46+
adapter: {
47+
index: "index.html",
48+
},
49+
});
50+
51+
const githubRole = saws.githubRole(ctx, {
52+
repo: "cfeenstra67/egghead",
53+
policy: aws.iam.getPolicyDocumentOutput({
54+
statements: [
55+
{
56+
actions: ["iam", "s3", "acm", "route53", "cloudfront"].flatMap(
57+
(service) => [
58+
`${service}:Get*`,
59+
`${service}:List*`,
60+
`${service}:Describe*`,
61+
],
62+
),
63+
resources: ["*"],
64+
},
65+
{
66+
actions: ["s3:PutObject*", "s3:DeleteObject"],
67+
resources: [demoBucket.bucket.arn, docsBucket.bucket.arn].flatMap(
68+
(arn) => [arn, pulumi.interpolate`${arn}/*`],
69+
),
70+
},
71+
],
72+
}).json,
73+
});
74+
75+
return {
76+
demoUrl: `https://${dnsName}`,
77+
docsUrl: `https://${docsDnsName}`,
78+
githubRoleArn: githubRole.arn,
79+
};
80+
};

0 commit comments

Comments
 (0)