Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as fs from 'fs';
import * as path from 'path';
import { Component } from 'projen';
import { DynamicKVInput } from './dynamic-kv-input';
import { Blueprint } from '../blueprint';

Expand Down Expand Up @@ -28,16 +27,11 @@ export type OptionsSchemaDefinition<
/**
* This component can be used to define a schema with a given identifier.
*/
export class OptionsSchema<T extends OptionsSchemaType> extends Component {
export class OptionsSchema<T extends OptionsSchemaType> {
constructor(protected readonly blueprint: Blueprint, protected readonly identifier: string, protected readonly schema: T) {
super(blueprint);
}

synthesize(): void {
if (!fs.existsSync(this.blueprint.context.wizardOptionsPath)) {
fs.mkdirSync(this.blueprint.context.wizardOptionsPath);
}

fs.writeFileSync(path.join(this.blueprint.context.wizardOptionsPath, this.identifier), JSON.stringify(this.schema));
}
}