@ditojs/server 1.5.6 → 1.6.0

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/server",
3
- "version": "1.5.6",
3
+ "version": "1.6.0",
4
4
  "type": "module",
5
5
  "description": "Dito.js Server – Dito.js is a declarative and modern web framework, based on Objection.js, Koa.js and Vue.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/master/packages/server",
@@ -21,16 +21,16 @@
21
21
  "node >= 16"
22
22
  ],
23
23
  "dependencies": {
24
- "@ditojs/admin": "^1.5.5",
24
+ "@ditojs/admin": "^1.6.0",
25
25
  "@ditojs/build": "^1.5.5",
26
- "@ditojs/router": "^1.5.5",
27
- "@ditojs/utils": "^1.5.5",
26
+ "@ditojs/router": "^1.6.0",
27
+ "@ditojs/utils": "^1.6.0",
28
28
  "@koa/cors": "^3.3.0",
29
29
  "@koa/multer": "^3.0.0",
30
30
  "@originjs/vite-plugin-commonjs": "^1.0.3",
31
31
  "ajv": "^8.11.0",
32
32
  "ajv-formats": "^2.1.1",
33
- "aws-sdk": "^2.1131.0",
33
+ "aws-sdk": "^2.1135.0",
34
34
  "axios": "^0.27.2",
35
35
  "bcryptjs": "^2.4.3",
36
36
  "bytes": "^3.1.2",
@@ -66,7 +66,7 @@
66
66
  "pluralize": "^8.0.0",
67
67
  "repl": "^0.1.3",
68
68
  "uuid": "^8.3.2",
69
- "vite": "^2.9.8",
69
+ "vite": "^2.9.9",
70
70
  "vite-plugin-vue2": "^2.0.0",
71
71
  "vue": "^2.6.14",
72
72
  "vue-template-compiler": "^2.6.14"
@@ -79,5 +79,5 @@
79
79
  "knex": "^2.0.0",
80
80
  "objection": "^3.0.1"
81
81
  },
82
- "gitHead": "ab441bf2ebc4976288da803dcfe976c6cf40f997"
82
+ "gitHead": "a442b0e47237fef8aeb65793fa3f5bc6621442ce"
83
83
  }
@@ -1,7 +1,7 @@
1
1
  import pico from 'picocolors'
2
2
 
3
- export async function migrate(knex, config) {
4
- const [batch, log] = await knex.migrate.latest(config)
3
+ export async function migrate(knex) {
4
+ const [batch, log] = await knex.migrate.latest()
5
5
  console.info(log.length === 0
6
6
  ? pico.cyan('Already up to date')
7
7
  : pico.green(`Batch ${batch} run: ${log.length} migrations\n`) +
@@ -1,11 +1,11 @@
1
1
  import pico from 'picocolors'
2
2
  import { migrate } from './migrate.js'
3
3
 
4
- export async function reset(knex, config) {
4
+ export async function reset(knex) {
5
5
  const batches = []
6
6
  const migrations = []
7
7
  while (true) {
8
- const [batch, log] = await knex.migrate.rollback(config)
8
+ const [batch, log] = await knex.migrate.rollback()
9
9
  if (log.length === 0) break
10
10
  batches.push(batch)
11
11
  migrations.push(...log)
@@ -1,7 +1,7 @@
1
1
  import pico from 'picocolors'
2
2
 
3
- export async function rollback(knex, config) {
4
- const [batch, log] = await knex.migrate.rollback(config)
3
+ export async function rollback(knex) {
4
+ const [batch, log] = await knex.migrate.rollback()
5
5
  console.info(log.length === 0
6
6
  ? pico.cyan('Already at the base migration')
7
7
  : pico.green(`Batch ${batch} rolled back: ${log.length} migrations\n`) +
@@ -1,7 +1,7 @@
1
1
  import pico from 'picocolors'
2
2
 
3
- export async function unlock(knex, config) {
4
- await knex.migrate.forceFreeMigrationsLock(config)
3
+ export async function unlock(knex) {
4
+ await knex.migrate.forceFreeMigrationsLock()
5
5
  console.info(
6
6
  pico.green(`Successfully unlocked the migrations lock table`)
7
7
  )
package/src/cli/index.js CHANGED
@@ -44,11 +44,7 @@ async function execute() {
44
44
  if (isPlainObject(arg) && arg.knex) {
45
45
  // A config object with a knex field was passed in, create a knex object
46
46
  // from it to pass on to the execute function.
47
- const knex = Knex(arg.knex)
48
- // Also add `knex.migrations` config as the first argument to `execute()`,
49
- // so db:migrate & co. can receive migration configuration settings.
50
- args.unshift(arg.knex.migrations || null)
51
- arg = knex
47
+ arg = Knex(arg.knex)
52
48
  }
53
49
  const res = await execute(arg, ...args)
54
50
  process.exit(res === true ? 0 : 1)