forj 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "forj",
3
3
  "description": "SQLite ORM and Query Builder whitout dependencies",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
7
7
  "files": ["src"],
@@ -40,6 +40,7 @@ export class Migrator {
40
40
 
41
41
  static async queue() {
42
42
  this.#ensureDir(this.#input)
43
+ this.#ensureDir(this.#output)
43
44
  const files = await glob(join(this.#input, '/*.{ts,js}'))
44
45
  const list: Queue = {pending: [], migrated: []}
45
46
 
@@ -57,8 +58,7 @@ export class Migrator {
57
58
  static async compile(migrations: MigrationInfo[]) {
58
59
  for (const migration of migrations) {
59
60
  const sql = await this.run(migration.handler)
60
- if (!existsSync(migration.output))
61
- writeFileSync(migration.output, `-- Migration: ${migration.name}\n\n${sql}\n`)
61
+ writeFileSync(migration.output, `-- Migration: ${migration.name}\n\n${sql}\n`)
62
62
  }
63
63
  }
64
64
 
@@ -149,6 +149,6 @@ export class Migrator {
149
149
  }
150
150
 
151
151
  static #ensureDir(dir: string) {
152
- if (!existsSync(dir)) mkdirSync(dir, { recursive: true })
152
+ if (!existsSync(dir)) mkdirSync(dir, {recursive: true})
153
153
  }
154
154
  }