Begin work on new structure resolvers.

This commit is contained in:
Daniel Scalzi
2019-08-21 22:25:11 -04:00
parent b942f4df59
commit 2bbf732d8e
12 changed files with 413 additions and 87 deletions

View File

@@ -0,0 +1,26 @@
import { mkdirs } from 'fs-extra'
import { join, resolve } from 'path'
import { ModelStructure } from './model.struct'
export abstract class BaseModelStructure<T> implements ModelStructure<T[]> {
protected resolvedModels: T[] | undefined
protected containerDirectory: string
constructor(
protected absoluteRoot: string,
protected relativeRoot: string,
protected structRoot: string,
protected baseUrl: string
) {
this.relativeRoot = join(relativeRoot, structRoot)
this.containerDirectory = resolve(absoluteRoot, structRoot)
}
public async init() {
mkdirs(this.containerDirectory)
}
public abstract async getSpecModel(): Promise<T[]>
}