Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove json schema validation, replace with compile time typing #1

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions infra/cloud-url-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import {HttpOrigin} from "aws-cdk-lib/aws-cloudfront-origins";
import {OutputSet} from "./constructs/output-set";
import {CfnLogGroup, LogGroup, RetentionDays} from "aws-cdk-lib/aws-logs";
import {readFileSync} from "fs";
import {readLinksFromFile} from "./utils";
import {default as links} from '../links.json';

export type LinkRecords = {
[key: string]: string | { url: string, expiresAt: string }
[key: string]: string | { url: string, expiresAt: string|null }
};

type CloudUrlStackProps = StackProps & {
Expand All @@ -29,7 +29,7 @@ export class CloudUrlStack extends Stack {
constructor(scope: Construct, id: string, props?: CloudUrlStackProps) {

if (props?.stage == null) {
throw new Error('Stage not set');
throw new Error('stage context value not set');
}

super(scope, id, {
Expand All @@ -50,8 +50,6 @@ export class CloudUrlStack extends Stack {

const logGroup = this.createLogGroup(functionName);

const links = readLinksFromFile();

const redirectFn = this.createRedirectFunction(functionName, logGroup, links);

const distribution = this.createDistribution(redirectFn);
Expand Down
33 changes: 0 additions & 33 deletions infra/utils.ts

This file was deleted.

39 changes: 0 additions & 39 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"typescript": "~5.4.3"
},
"dependencies": {
"ajv": "^8.17.1",
"aws-cdk-lib": "2.135.0",
"constructs": "^10.0.0",
"source-map-support": "^0.5.21"
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"allowJs": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"typeRoots": [
"./node_modules/@types"
]
Expand Down