@ditojs/server 1.30.0 → 2.0.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.30.0",
3
+ "version": "2.0.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",
@@ -22,13 +22,15 @@
22
22
  "node >= 18"
23
23
  ],
24
24
  "dependencies": {
25
- "@ditojs/admin": "^1.30.0",
26
- "@ditojs/build": "^1.30.0",
27
- "@ditojs/router": "^1.30.0",
28
- "@ditojs/utils": "^1.30.0",
25
+ "@ditojs/admin": "^2.0.0",
26
+ "@ditojs/build": "^2.0.0",
27
+ "@ditojs/router": "^2.0.0",
28
+ "@ditojs/utils": "^2.0.0",
29
29
  "@koa/cors": "^4.0.0",
30
30
  "@koa/multer": "^3.0.2",
31
31
  "@originjs/vite-plugin-commonjs": "^1.0.3",
32
+ "@vitejs/plugin-vue": "^4.1.0",
33
+ "@vue/compiler-sfc": "^3.2.47",
32
34
  "ajv": "^8.12.0",
33
35
  "ajv-formats": "^2.1.1",
34
36
  "bcryptjs": "^2.4.3",
@@ -64,9 +66,7 @@
64
66
  "repl": "^0.1.3",
65
67
  "uuid": "^9.0.0",
66
68
  "vite": "^4.2.1",
67
- "vite-plugin-vue2": "^2.0.3",
68
- "vue": "^2.7.14",
69
- "vue-template-compiler": "^2.7.14"
69
+ "vue": "^3.2.47"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@aws-sdk/client-s3": "^3.0.0",
@@ -90,7 +90,7 @@
90
90
  "typescript": "^5.0.2"
91
91
  },
92
92
  "types": "types",
93
- "gitHead": "5d09dc24ecb77b511f3c25643275ea1b9514fb52",
93
+ "gitHead": "dde9462e778bce37bc4fa3e47127a9ba12a4d5e2",
94
94
  "scripts": {
95
95
  "types": "tsc --noEmit ./src/index.d.ts"
96
96
  },
package/src/cli/index.js CHANGED
@@ -18,9 +18,9 @@ function getCommand(commands, parts) {
18
18
  }
19
19
 
20
20
  function setSilent(silent) {
21
- const oldValue = process.env.DITO_SILENT
21
+ const wasSilent = process.env.DITO_SILENT
22
22
  process.env.DITO_SILENT = silent
23
- return oldValue
23
+ return wasSilent
24
24
  }
25
25
 
26
26
  async function execute() {
@@ -2,7 +2,7 @@ import path from 'path'
2
2
  import Koa from 'koa'
3
3
  import serve from 'koa-static'
4
4
  import { defineConfig, createServer } from 'vite'
5
- import { createVuePlugin } from 'vite-plugin-vue2'
5
+ import createVuePlugin from '@vitejs/plugin-vue'
6
6
  import {
7
7
  viteCommonjs as createCommonJsPlugin
8
8
  } from '@originjs/vite-plugin-commonjs'
@@ -206,7 +206,9 @@ export class AdminController extends Controller {
206
206
  } else if (id.startsWith(cwd)) {
207
207
  return 'common'
208
208
  } else {
209
- const module = id.match(/node_modules\/([^/$]*)/)?.[1] || ''
209
+ const module = (
210
+ id.match(/node_modules\/((?:@[^/]*\/)?[^/$]*)/)?.[1] || ''
211
+ )
210
212
  return testModuleIdentifier(module, coreDependencies)
211
213
  ? 'core'
212
214
  : 'vendor'
@@ -222,7 +224,16 @@ export class AdminController extends Controller {
222
224
  optimizeDeps: {
223
225
  exclude: development ? ditoPackages : [],
224
226
  include: [
225
- ...(development ? [] : ditoPackages),
227
+ ...(development
228
+ // https://discuss.prosemirror.net/t/rangeerror-adding-different-instances-of-a-keyed-plugin-plugin/4242/13
229
+ ? [
230
+ 'prosemirror-state',
231
+ 'prosemirror-transform',
232
+ 'prosemirror-model',
233
+ 'prosemirror-view'
234
+ ]
235
+ : ditoPackages
236
+ ),
226
237
  ...nonEsmDependencies
227
238
  ]
228
239
  },
@@ -249,11 +260,7 @@ const ditoPackages = [
249
260
  const nonEsmDependencies = [
250
261
  // All non-es modules need to be explicitly included here, and some of
251
262
  // them only work due to the use of `createCommonJsPlugin()`.
252
- 'vue-color',
253
- 'vue-js-modal',
254
- 'vue-multiselect',
255
- 'vue-notification',
256
- 'lowlight'
263
+ '@lk77/vue3-color'
257
264
  ]
258
265
 
259
266
  const coreDependencies = [
@@ -265,29 +272,21 @@ const coreDependencies = [
265
272
  // a json file?
266
273
 
267
274
  'vue',
268
- 'vue-color',
269
- 'vue-js-modal',
275
+ '@lk77/vue3-color',
276
+ '@kyvg/vue3-notification',
270
277
  'vue-multiselect',
271
- 'vue-notification',
272
278
  'vue-router',
273
279
  'vue-upload-component',
274
- 'vuedraggable',
275
-
276
- 'core-js',
277
- 'lowlight',
280
+ 'tinycolor2',
281
+ 'sortablejs-vue3',
278
282
  'sortablejs',
279
- 'tiptap',
280
- 'tiptap-*',
281
- 'tslib',
283
+ '@tiptap/*',
282
284
  'prosemirror-*',
283
285
  'codeflask',
284
286
  'rope-sequence',
285
- 'tinycolor2',
286
- 'fault',
287
287
  'filesize',
288
288
  'filesize-parser',
289
- 'format',
290
- 'highlight.js',
289
+ 'tslib',
291
290
  'orderedmap',
292
291
  'w3c-keyname'
293
292
  ]
package/types/index.d.ts CHANGED
@@ -1571,6 +1571,7 @@ export class QueryBuilder<
1571
1571
  SingleQueryBuilderType: QueryBuilder<M, M>
1572
1572
  NumberQueryBuilderType: QueryBuilder<M, number>
1573
1573
  PageQueryBuilderType: QueryBuilder<M, objection.Page<M>>
1574
+ MaybeSingleQueryBuilderType: QueryBuilder<M, M | undefined>
1574
1575
  }
1575
1576
  export interface QueryBuilder<M extends Model, R = M[]> extends KnexHelper {}
1576
1577