Skip to content

Commit

Permalink
Website
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Aug 29, 2020
1 parent b200921 commit 21401ef
Show file tree
Hide file tree
Showing 19 changed files with 10,961 additions and 6 deletions.
17 changes: 12 additions & 5 deletions src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ import {Database} from "./components/Database";
import {StaticWebsite} from "./components/StaticWebsite";

export class Config {
getStack(): Stack {
const template = Config.readYaml();
if (!template || typeof template !== 'object' || !template.hasOwnProperty('name')) {
private readonly template: Record<string, any>;

constructor(yaml: string|undefined = undefined) {
this.template = Config.readYaml(yaml);
if (!this.template || typeof this.template !== 'object' || !this.template.hasOwnProperty('name')) {
throw 'Invalid YAML';
}
}

getStack(): Stack {
const template = this.template;

const stack = new Stack(template.name as string, template.region as string);

Expand All @@ -29,8 +35,9 @@ export class Config {
return stack;
}

private static readYaml(): Record<string, any> {
const template = yaml.safeLoad(fs.readFileSync('lift.yml', 'utf8'));
private static readYaml(yamlString: string|undefined): Record<string, any> {
yamlString = yamlString ? yamlString : fs.readFileSync('lift.yml', 'utf8');
const template = yaml.safeLoad(yamlString);
if (!template || typeof template !== 'object' || !template.hasOwnProperty('name')) {
throw 'Invalid YAML';
}
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"strict": true,
"target": "es2017",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true
},
"include": [
"src/**/*"
Expand Down
3 changes: 3 additions & 0 deletions website/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead
23 changes: 23 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
19 changes: 19 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# website

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
Loading

0 comments on commit 21401ef

Please sign in to comment.