@ditojs/server 1.30.0 → 2.0.1
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 +17 -17
- package/src/cli/index.js +2 -2
- package/src/controllers/AdminController.js +24 -22
- package/src/storage/S3Storage.js +1 -1
- package/src/storage/Storage.js +1 -1
- package/types/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
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": "^
|
|
26
|
-
"@ditojs/build": "^
|
|
27
|
-
"@ditojs/router": "^
|
|
28
|
-
"@ditojs/utils": "^
|
|
25
|
+
"@ditojs/admin": "^2.0.1",
|
|
26
|
+
"@ditojs/build": "^2.0.0",
|
|
27
|
+
"@ditojs/router": "^2.0.1",
|
|
28
|
+
"@ditojs/utils": "^2.0.1",
|
|
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",
|
|
@@ -42,17 +44,17 @@
|
|
|
42
44
|
"koa-compress": "^5.1.0",
|
|
43
45
|
"koa-conditional-get": "^3.0.0",
|
|
44
46
|
"koa-etag": "^4.0.0",
|
|
45
|
-
"koa-helmet": "^7.0.
|
|
47
|
+
"koa-helmet": "^7.0.2",
|
|
46
48
|
"koa-mount": "^4.0.0",
|
|
47
49
|
"koa-passport": "^6.0.0",
|
|
48
50
|
"koa-response-time": "^2.1.0",
|
|
49
51
|
"koa-session": "^6.4.0",
|
|
50
52
|
"koa-static": "^5.0.0",
|
|
51
|
-
"leather": "^
|
|
53
|
+
"leather": "^3.0.0",
|
|
52
54
|
"mime-types": "^2.1.35",
|
|
53
55
|
"multer": "^1.4.5-lts.1",
|
|
54
56
|
"multer-s3": "https://github.com/ditojs/multer-s3#dito",
|
|
55
|
-
"nanoid": "^4.0.
|
|
57
|
+
"nanoid": "^4.0.2",
|
|
56
58
|
"parse-duration": "^1.0.3",
|
|
57
59
|
"passport-local": "^1.0.0",
|
|
58
60
|
"passthrough-counter": "^1.0.0",
|
|
@@ -64,9 +66,7 @@
|
|
|
64
66
|
"repl": "^0.1.3",
|
|
65
67
|
"uuid": "^9.0.0",
|
|
66
68
|
"vite": "^4.2.1",
|
|
67
|
-
"
|
|
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",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"objection": "^3.0.1"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@aws-sdk/client-s3": "^3.
|
|
77
|
+
"@aws-sdk/client-s3": "^3.304.0",
|
|
78
78
|
"@types/koa-bodyparser": "^4.3.10",
|
|
79
79
|
"@types/koa-compress": "^4.0.3",
|
|
80
80
|
"@types/koa-logger": "^3.1.2",
|
|
@@ -83,14 +83,14 @@
|
|
|
83
83
|
"@types/koa-session": "^6.4.0",
|
|
84
84
|
"@types/koa-static": "^4.0.2",
|
|
85
85
|
"@types/koa__cors": "^4.0.0",
|
|
86
|
-
"@types/node": "^18.15.
|
|
86
|
+
"@types/node": "^18.15.11",
|
|
87
87
|
"knex": "^2.4.2",
|
|
88
|
-
"objection": "^3.0.
|
|
89
|
-
"type-fest": "^3.
|
|
90
|
-
"typescript": "^5.0.
|
|
88
|
+
"objection": "^3.0.2",
|
|
89
|
+
"type-fest": "^3.7.2",
|
|
90
|
+
"typescript": "^5.0.3"
|
|
91
91
|
},
|
|
92
92
|
"types": "types",
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "80c209774fe4ee5243eb25d77ac9a97bfb694d8c",
|
|
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
|
|
21
|
+
const wasSilent = process.env.DITO_SILENT
|
|
22
22
|
process.env.DITO_SILENT = silent
|
|
23
|
-
return
|
|
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
|
|
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 =
|
|
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
|
|
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
|
-
'
|
|
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,24 @@ const coreDependencies = [
|
|
|
265
272
|
// a json file?
|
|
266
273
|
|
|
267
274
|
'vue',
|
|
268
|
-
'vue
|
|
269
|
-
'
|
|
275
|
+
'@vue/*',
|
|
276
|
+
'@lk77/vue3-color',
|
|
277
|
+
'@kyvg/vue3-notification',
|
|
270
278
|
'vue-multiselect',
|
|
271
|
-
'vue-notification',
|
|
272
279
|
'vue-router',
|
|
273
280
|
'vue-upload-component',
|
|
274
|
-
'
|
|
275
|
-
|
|
276
|
-
'core-js',
|
|
277
|
-
'lowlight',
|
|
281
|
+
'tinycolor2',
|
|
282
|
+
'sortablejs-vue3',
|
|
278
283
|
'sortablejs',
|
|
279
|
-
'tiptap',
|
|
280
|
-
'tiptap-*',
|
|
281
|
-
'tslib',
|
|
284
|
+
'@tiptap/*',
|
|
282
285
|
'prosemirror-*',
|
|
286
|
+
'linkifyjs',
|
|
283
287
|
'codeflask',
|
|
288
|
+
'punycode',
|
|
284
289
|
'rope-sequence',
|
|
285
|
-
'tinycolor2',
|
|
286
|
-
'fault',
|
|
287
290
|
'filesize',
|
|
288
291
|
'filesize-parser',
|
|
289
|
-
'
|
|
290
|
-
'highlight.js',
|
|
292
|
+
'tslib',
|
|
291
293
|
'orderedmap',
|
|
292
294
|
'w3c-keyname'
|
|
293
295
|
]
|
package/src/storage/S3Storage.js
CHANGED
|
@@ -3,7 +3,7 @@ import { fileTypeFromBuffer } from 'file-type'
|
|
|
3
3
|
import { Storage } from './Storage.js'
|
|
4
4
|
import { PassThrough } from 'stream'
|
|
5
5
|
import consumers from 'stream/consumers'
|
|
6
|
-
import {
|
|
6
|
+
import { readMediaAttributes } from 'leather'
|
|
7
7
|
|
|
8
8
|
export class S3Storage extends Storage {
|
|
9
9
|
static type = 's3'
|
package/src/storage/Storage.js
CHANGED
|
@@ -3,7 +3,7 @@ import { URL } from 'url'
|
|
|
3
3
|
import multer from '@koa/multer'
|
|
4
4
|
import picomatch from 'picomatch'
|
|
5
5
|
import { PassThrough } from 'stream'
|
|
6
|
-
import {
|
|
6
|
+
import { readMediaAttributes } from 'leather'
|
|
7
7
|
import { hyphenate, toPromiseCallback } from '@ditojs/utils'
|
|
8
8
|
import { AssetFile } from './AssetFile.js'
|
|
9
9
|
import { deprecate } from '../utils/deprecate.js'
|
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
|
|