@ditojs/server 2.6.10 → 2.7.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/server",
3
- "version": "2.6.10",
3
+ "version": "2.7.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,10 +22,10 @@
22
22
  "node >= 18"
23
23
  ],
24
24
  "dependencies": {
25
- "@ditojs/admin": "^2.6.10",
25
+ "@ditojs/admin": "^2.7.1",
26
26
  "@ditojs/build": "^2.5.0",
27
- "@ditojs/router": "^2.6.0",
28
- "@ditojs/utils": "^2.6.0",
27
+ "@ditojs/router": "^2.7.1",
28
+ "@ditojs/utils": "^2.7.1",
29
29
  "@koa/cors": "^4.0.0",
30
30
  "@koa/multer": "^3.0.2",
31
31
  "@originjs/vite-plugin-commonjs": "^1.0.3",
@@ -88,7 +88,7 @@
88
88
  "typescript": "^5.0.4"
89
89
  },
90
90
  "types": "types",
91
- "gitHead": "12d6a71efe6eb89b514b7ca9737fefc3afc319f2",
91
+ "gitHead": "3fe49034af7e93f2cc61da3f2add40c4e41893d5",
92
92
  "scripts": {
93
93
  "types": "tsc --noEmit --esModuleInterop ./types/index.d.ts"
94
94
  },
@@ -26,11 +26,12 @@ import {
26
26
  isModule,
27
27
  hyphenate,
28
28
  clone,
29
- merge,
29
+ assignDeeply,
30
30
  parseDataPath,
31
31
  normalizeDataPath,
32
32
  toPromiseCallback,
33
- mapConcurrently
33
+ mapConcurrently,
34
+ deprecate
34
35
  } from '@ditojs/utils'
35
36
  import { Validator } from './Validator.js'
36
37
  import { EventEmitter } from '../lib/index.js'
@@ -39,7 +40,6 @@ import { Service } from '../services/index.js'
39
40
  import { Storage } from '../storage/index.js'
40
41
  import { convertSchema } from '../schema/index.js'
41
42
  import { getDuration, subtractDuration } from '../utils/duration.js'
42
- import { deprecate } from '../utils/deprecate.js'
43
43
  import {
44
44
  ResponseError,
45
45
  ValidationError,
@@ -86,8 +86,8 @@ export class Application extends Koa {
86
86
  log === false || log?.silent || process.env.DITO_SILENT
87
87
  ? {}
88
88
  : getOptions(log),
89
- assets: merge(defaultAssetOptions, getOptions(assets)),
90
- logger: merge(defaultLoggerOptions, getOptions(logger)),
89
+ assets: assignDeeply(defaultAssetOptions, getOptions(assets)),
90
+ logger: assignDeeply(defaultLoggerOptions, getOptions(logger)),
91
91
  ...rest
92
92
  }
93
93
  this.keys = keys
@@ -586,7 +586,7 @@ export class Application extends Koa {
586
586
  if (app.compress !== false) {
587
587
  this.use(
588
588
  compress(
589
- merge(
589
+ assignDeeply(
590
590
  {
591
591
  // Use a reasonable default for Brotli compression.
592
592
  // See https://github.com/koajs/compress/issues/126
@@ -5,13 +5,12 @@ import { defineConfig, createServer } from 'vite'
5
5
  import createVuePlugin from '@vitejs/plugin-vue'
6
6
  import { viteCommonjs as createCommonJsPlugin } from '@originjs/vite-plugin-commonjs'
7
7
  import { testModuleIdentifier, getPostCssConfig } from '@ditojs/build'
8
- import { merge } from '@ditojs/utils'
8
+ import { assignDeeply, deprecate } from '@ditojs/utils'
9
9
  import { Controller } from './Controller.js'
10
10
  import { handleConnectMiddleware } from '../middleware/index.js'
11
11
  import { ControllerError } from '../errors/index.js'
12
12
  import { getRandomFreePort } from '../utils/net.js'
13
13
  import { formatJson } from '../utils/json.js'
14
- import { deprecate } from '../utils/deprecate.js'
15
14
 
16
15
  export class AdminController extends Controller {
17
16
  // @override
@@ -180,7 +179,7 @@ export class AdminController extends Controller {
180
179
  const views = path.join(root, 'views')
181
180
 
182
181
  return defineConfig(
183
- merge(
182
+ assignDeeply(
184
183
  {
185
184
  root,
186
185
  base,
@@ -16,7 +16,6 @@ import {
16
16
  import { processHandlerParameters } from '../utils/handler.js'
17
17
  import { describeFunction } from '../utils/function.js'
18
18
  import { formatJson } from '../utils/json.js'
19
- import { deprecate } from '../utils/deprecate.js'
20
19
  import {
21
20
  isObject,
22
21
  isString,
@@ -26,7 +25,8 @@ import {
26
25
  asArray,
27
26
  equals,
28
27
  parseDataPath,
29
- normalizeDataPath
28
+ normalizeDataPath,
29
+ deprecate
30
30
  } from '@ditojs/utils'
31
31
 
32
32
  export class Controller {
@@ -1,7 +1,6 @@
1
- import { isArray, isObject } from '@ditojs/utils'
1
+ import { isArray, isObject, deprecate } from '@ditojs/utils'
2
2
  import { createDecorator } from '../utils/decorator.js'
3
3
  import { formatJson } from '../utils/json.js'
4
- import { deprecate } from '../utils/deprecate.js'
5
4
 
6
5
  export function parameters(parameters, options) {
7
6
  if (isObject(parameters)) {
@@ -6,12 +6,12 @@ import {
6
6
  isFunction,
7
7
  isPromise,
8
8
  asArray,
9
- merge,
10
9
  flatten,
11
10
  parseDataPath,
12
11
  normalizeDataPath,
13
12
  getValueAtDataPath,
14
- mapConcurrently
13
+ mapConcurrently,
14
+ assignDeeply
15
15
  } from '@ditojs/utils'
16
16
  import { QueryBuilder } from '../query/index.js'
17
17
  import { EventEmitter, KnexHelper } from '../lib/index.js'
@@ -391,7 +391,7 @@ export class Model extends objection.Model {
391
391
  })
392
392
  addRelationSchemas(this, schema.properties)
393
393
  // Merge in root-level schema additions
394
- merge(schema, this.definition.schema)
394
+ assignDeeply(schema, this.definition.schema)
395
395
  return {
396
396
  $id: this.name,
397
397
  ...schema
@@ -8,7 +8,8 @@ import {
8
8
  mapKeys,
9
9
  getValueAtDataPath,
10
10
  setValueAtDataPath,
11
- parseDataPath
11
+ parseDataPath,
12
+ deprecate
12
13
  } from '@ditojs/utils'
13
14
  import { QueryParameters } from './QueryParameters.js'
14
15
  import { KnexHelper } from '../lib/index.js'
@@ -16,7 +17,6 @@ import { DitoGraphProcessor, walkGraph } from '../graph/index.js'
16
17
  import { QueryBuilderError, RelationError } from '../errors/index.js'
17
18
  import { createLookup } from '../utils/object.js'
18
19
  import { getScope } from '../utils/scope.js'
19
- import { deprecate } from '../utils/deprecate.js'
20
20
 
21
21
  const SYMBOL_ALL = Symbol('all')
22
22
 
@@ -4,9 +4,8 @@ import multer from '@koa/multer'
4
4
  import picomatch from 'picomatch'
5
5
  import { PassThrough } from 'stream'
6
6
  import { readMediaAttributes } from 'leather'
7
- import { hyphenate, toPromiseCallback } from '@ditojs/utils'
7
+ import { hyphenate, toPromiseCallback, deprecate } from '@ditojs/utils'
8
8
  import { AssetFile } from './AssetFile.js'
9
- import { deprecate } from '../utils/deprecate.js'
10
9
 
11
10
  const storageClasses = {}
12
11
 
@@ -1,9 +0,0 @@
1
- const loggedDeprecations = new Set()
2
-
3
- export function deprecate(message) {
4
- // Only log deprecation messages once.
5
- if (!loggedDeprecations.has(message)) {
6
- loggedDeprecations.add(message)
7
- console.warn(message)
8
- }
9
- }