ormless
Advanced tools
Comparing version 0.0.3 to 0.0.4
"use strict"; | ||
/* eslint-disable @typescript-eslint/no-empty-interface */ | ||
/* eslint-disable @typescript-eslint/no-namespace */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -9,2 +9,3 @@ "use strict"; | ||
const explorer_1 = require("./explorer"); | ||
const path = require("path"); | ||
class Introspection { | ||
@@ -18,3 +19,2 @@ #config; | ||
const definitions = await explorer.getDefinitions(); | ||
console.log(definitions.tables); | ||
const schemas = Object.keys(this.#config.database).map((schema) => ({ | ||
@@ -125,6 +125,7 @@ isInSearchPath: this.#config.paths.includes(schema), | ||
})); | ||
handlebars.registerPartial('generateSchema', fs.readFileSync('./src/templates/partials/schema.handlebars', 'utf-8')); | ||
handlebars.registerPartial('generateTableRepository', fs.readFileSync('./src/templates/partials/table-repository.handlebars', 'utf-8')); | ||
handlebars.registerPartial('generateViewRepository', fs.readFileSync('./src/templates/partials/view-repository.handlebars', 'utf-8')); | ||
const templates = await Promise.all(Object.entries(this.#config.generate).map(([key, { template = './src/templates/template.handlebars', root = 'Database', namespace = 'auto', imports = 'ormless', repository = false, },]) => new Promise((resolve, reject) => fs.readFile(template, { encoding: 'utf-8' }, (err, data) => { | ||
console.log(__dirname); | ||
handlebars.registerPartial('generateSchema', fs.readFileSync(path.join(__dirname, '../templates/partials/schema.handlebars'), 'utf-8')); | ||
handlebars.registerPartial('generateTableRepository', fs.readFileSync(path.join(__dirname, '../templates/partials/table-repository.handlebars'), 'utf-8')); | ||
handlebars.registerPartial('generateViewRepository', fs.readFileSync(path.join(__dirname, '../templates/partials/view-repository.handlebars'), 'utf-8')); | ||
const templates = await Promise.all(Object.entries(this.#config.generate).map(([key, { template = path.join(__dirname, '../templates/template.handlebars'), root = 'Database', namespace = 'auto', imports = 'ormless', repository = false, },]) => new Promise((resolve, reject) => fs.readFile(template, { encoding: 'utf-8' }, (err, data) => { | ||
if (err) { | ||
@@ -131,0 +132,0 @@ reject(err); |
@@ -1,3 +0,1 @@ | ||
/* eslint-disable @typescript-eslint/no-empty-interface */ | ||
/* eslint-disable @typescript-eslint/no-namespace */ | ||
export {}; |
@@ -6,2 +6,3 @@ import * as cases from 'change-case'; | ||
import { Explorer } from './explorer'; | ||
import * as path from 'path'; | ||
export class Introspection { | ||
@@ -15,3 +16,2 @@ #config; | ||
const definitions = await explorer.getDefinitions(); | ||
console.log(definitions.tables); | ||
const schemas = Object.keys(this.#config.database).map((schema) => ({ | ||
@@ -122,6 +122,7 @@ isInSearchPath: this.#config.paths.includes(schema), | ||
})); | ||
handlebars.registerPartial('generateSchema', fs.readFileSync('./src/templates/partials/schema.handlebars', 'utf-8')); | ||
handlebars.registerPartial('generateTableRepository', fs.readFileSync('./src/templates/partials/table-repository.handlebars', 'utf-8')); | ||
handlebars.registerPartial('generateViewRepository', fs.readFileSync('./src/templates/partials/view-repository.handlebars', 'utf-8')); | ||
const templates = await Promise.all(Object.entries(this.#config.generate).map(([key, { template = './src/templates/template.handlebars', root = 'Database', namespace = 'auto', imports = 'ormless', repository = false, },]) => new Promise((resolve, reject) => fs.readFile(template, { encoding: 'utf-8' }, (err, data) => { | ||
console.log(__dirname); | ||
handlebars.registerPartial('generateSchema', fs.readFileSync(path.join(__dirname, '../templates/partials/schema.handlebars'), 'utf-8')); | ||
handlebars.registerPartial('generateTableRepository', fs.readFileSync(path.join(__dirname, '../templates/partials/table-repository.handlebars'), 'utf-8')); | ||
handlebars.registerPartial('generateViewRepository', fs.readFileSync(path.join(__dirname, '../templates/partials/view-repository.handlebars'), 'utf-8')); | ||
const templates = await Promise.all(Object.entries(this.#config.generate).map(([key, { template = path.join(__dirname, '../templates/template.handlebars'), root = 'Database', namespace = 'auto', imports = 'ormless', repository = false, },]) => new Promise((resolve, reject) => fs.readFile(template, { encoding: 'utf-8' }, (err, data) => { | ||
if (err) { | ||
@@ -128,0 +129,0 @@ reject(err); |
{ | ||
"name": "ormless", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"bin": "./bin/ormless", | ||
@@ -40,4 +40,2 @@ "description": "Type safe SQL shortcuts based on kysely", | ||
"devDependencies": { | ||
"eslint": "^7.32.0", | ||
"ts-node": "^10.2.1", | ||
"@commitlint/cli": "^13.2.0", | ||
@@ -51,4 +49,6 @@ "@commitlint/config-conventional": "^13.2.0", | ||
"@typescript-eslint/eslint-plugin": "^4.32.0", | ||
"@typescript-eslint/parser": "^4.32.0" | ||
"@typescript-eslint/parser": "^4.32.0", | ||
"eslint": "^7.32.0", | ||
"ts-node": "^10.2.1" | ||
} | ||
} |
143098
79
3338