@sitblueprint/website-construct 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ name: prettier
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - name: Clone repository
13
+ uses: actions/checkout@v4
14
+
15
+ - name: Run prettier -check
16
+ run: |
17
+ npm ci
18
+ npm run format:check
@@ -0,0 +1,24 @@
1
+ name: Run Tests
2
+ on:
3
+ push:
4
+ pull_request:
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - name: Checkout repository
10
+ uses: actions/checkout@v4
11
+
12
+ - name: Set up Node.js
13
+ uses: actions/setup-node@v4
14
+ with:
15
+ node-version: "20"
16
+ cache: "npm"
17
+
18
+ - name: Install dependencies
19
+ run: npm ci
20
+
21
+ - name: Run Jest tests
22
+ env:
23
+ CI: true
24
+ run: npm test
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Website CDK Construct
2
+
3
+ A reusable [AWS CDK](https://docs.aws.amazon.com/cdk/) construct to deploy a website via S3 and CloudFont.
4
+
5
+ ## Features
6
+
7
+ - CDN caching via CloudFont
8
+ - Deployment via S3
9
+
10
+ ## Installation
11
+
12
+ ```
13
+ npm install website-construct
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ ```ts
19
+ export class MyWebsiteStack extends cdk.Stack {
20
+ constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
21
+ super(scope, id, props);
22
+
23
+ new WebsiteConstruct(this, "MyWebsite", {
24
+ bucketName: "my-static-site-bucket",
25
+ indexFile: "index.html",
26
+ errorFile: "error.html",
27
+ notFoundResponsePagePath: "/404.html",
28
+ domainConfig: {
29
+ domainName: "example.com",
30
+ subdomainName: "www",
31
+ certificateArn: "arn:aws:acm:us-east-1:123456789012:certificate/abc123",
32
+ },
33
+ });
34
+ }
35
+ }
36
+ ```
37
+
38
+ ## Development
39
+
40
+ - Build: `npm run build`
41
+ - Test: `npm run test`
42
+
43
+ ## License
44
+
45
+ MIT
@@ -0,0 +1,3 @@
1
+ {
2
+ "acknowledged-issue-numbers": [34892, 34892]
3
+ }
package/jest.config.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ testEnvironment: "node",
3
+ roots: ["<rootDir>/test"],
4
+ testMatch: ["**/*.test.ts"],
5
+ transform: {
6
+ "^.+\\.tsx?$": "ts-jest",
7
+ },
8
+ };
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@sitblueprint/website-construct",
3
+ "version": "0.1.0",
4
+ "description": "A reusable AWS CDK construct for deploying static websites with optional custom domain support.",
5
+ "author": "Miguel Merlin <mmerlin@stevens.edu>",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/stevensblueprint/website-construct"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "keywords": [
15
+ "aws",
16
+ "cdk",
17
+ "construct",
18
+ "s3",
19
+ "cloudfront",
20
+ "route53",
21
+ "static-website"
22
+ ],
23
+ "main": "lib/index.js",
24
+ "types": "lib/index.d.ts",
25
+ "scripts": {
26
+ "build": "tsc",
27
+ "watch": "tsc -w",
28
+ "test": "jest",
29
+ "format:check": "prettier --check .",
30
+ "format:write": "prettier --write ."
31
+ },
32
+ "devDependencies": {
33
+ "@types/jest": "^29.5.14",
34
+ "@types/node": "22.7.9",
35
+ "aws-cdk-lib": "2.208.0",
36
+ "constructs": "^10.0.0",
37
+ "jest": "^29.7.0",
38
+ "prettier": "^3.6.2",
39
+ "ts-jest": "^29.2.5",
40
+ "typescript": "~5.6.3"
41
+ },
42
+ "peerDependencies": {
43
+ "aws-cdk-lib": "2.208.0",
44
+ "constructs": "^10.0.0"
45
+ }
46
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "lib": ["es2022"],
7
+ "declaration": true,
8
+ "strict": true,
9
+ "noImplicitAny": true,
10
+ "strictNullChecks": true,
11
+ "noImplicitThis": true,
12
+ "alwaysStrict": true,
13
+ "noUnusedLocals": false,
14
+ "noUnusedParameters": false,
15
+ "noImplicitReturns": true,
16
+ "noFallthroughCasesInSwitch": false,
17
+ "inlineSourceMap": true,
18
+ "inlineSources": true,
19
+ "experimentalDecorators": true,
20
+ "strictPropertyInitialization": false,
21
+ "typeRoots": ["./node_modules/@types"]
22
+ },
23
+ "exclude": ["node_modules", "cdk.out"]
24
+ }