@modernpoacher/halacious 6.2.1 → 6.2.4
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/.husky/pre-commit +4 -0
- package/examples/auto-namespace.js +3 -1
- package/examples/query-string.js +3 -1
- package/lib/plugin.js +6 -2
- package/package.json +23 -29
- package/test/plugin.spec.js +5 -3
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
require('module-alias/register')
|
|
2
2
|
|
|
3
|
+
const path = require('path')
|
|
4
|
+
|
|
3
5
|
const hapi = require('@hapi/hapi')
|
|
4
6
|
const vision = require('@hapi/vision')
|
|
5
7
|
const halacious = require('halacious')
|
|
@@ -14,7 +16,7 @@ async function init () {
|
|
|
14
16
|
await server.register(halacious)
|
|
15
17
|
|
|
16
18
|
server.plugins[PLUGIN].namespaces.add({
|
|
17
|
-
dir:
|
|
19
|
+
dir: path.resolve(__dirname, 'rels/mycompany'),
|
|
18
20
|
prefix: 'mco'
|
|
19
21
|
})
|
|
20
22
|
|
package/examples/query-string.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
require('module-alias/register')
|
|
2
2
|
|
|
3
|
+
const path = require('path')
|
|
4
|
+
|
|
3
5
|
const hapi = require('@hapi/hapi')
|
|
4
6
|
const vision = require('@hapi/vision')
|
|
5
7
|
const halacious = require('halacious')
|
|
@@ -19,7 +21,7 @@ async function init () {
|
|
|
19
21
|
})
|
|
20
22
|
|
|
21
23
|
server.plugins[PLUGIN].namespaces.add({
|
|
22
|
-
dir:
|
|
24
|
+
dir: path.resolve(__dirname, 'rels/mycompany'),
|
|
23
25
|
prefix: 'mco'
|
|
24
26
|
})
|
|
25
27
|
|
package/lib/plugin.js
CHANGED
|
@@ -7,14 +7,18 @@ const path = require('path')
|
|
|
7
7
|
const pug = require('pug')
|
|
8
8
|
const util = require('util')
|
|
9
9
|
const async = require('async')
|
|
10
|
-
const
|
|
10
|
+
const {
|
|
11
|
+
marked
|
|
12
|
+
} = require('marked')
|
|
11
13
|
const urlTemplate = require('url-template')
|
|
12
14
|
const Negotiator = require('negotiator')
|
|
13
15
|
const URITemplate = require('urijs/src/URITemplate')
|
|
14
16
|
const url = require('url')
|
|
15
17
|
const URI = require('urijs')
|
|
16
18
|
|
|
17
|
-
const {
|
|
19
|
+
const {
|
|
20
|
+
RepresentationFactory
|
|
21
|
+
} = require('./representation')
|
|
18
22
|
|
|
19
23
|
const HAL_MIME_TYPE = 'application/hal+json'
|
|
20
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/halacious",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.4",
|
|
4
4
|
"description": "A HAL processor for Hapi",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"HAL",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=16.13.0"
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
@@ -36,42 +36,36 @@
|
|
|
36
36
|
"@hapi/boom": "9.1.0",
|
|
37
37
|
"@hapi/hoek": "9.0.4",
|
|
38
38
|
"@hapi/joi": "15.1.1",
|
|
39
|
-
"async": "^3.2.
|
|
40
|
-
"lodash": "^4.17.
|
|
41
|
-
"marked": "^
|
|
42
|
-
"negotiator": "^0.6.
|
|
43
|
-
"pug": "^3.0.
|
|
44
|
-
"urijs": "^1.19.
|
|
45
|
-
"url-template": "
|
|
39
|
+
"async": "^3.2.3",
|
|
40
|
+
"lodash": "^4.17.21",
|
|
41
|
+
"marked": "^4.0.12",
|
|
42
|
+
"negotiator": "^0.6.3",
|
|
43
|
+
"pug": "^3.0.2",
|
|
44
|
+
"urijs": "^1.19.8",
|
|
45
|
+
"url-template": "2.0.8"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@babel/core": "^7.
|
|
49
|
-
"@babel/eslint-parser": "^7.
|
|
48
|
+
"@babel/core": "^7.17.5",
|
|
49
|
+
"@babel/eslint-parser": "^7.17.0",
|
|
50
50
|
"@hapi/hapi": "18.4.1",
|
|
51
51
|
"@hapi/vision": "6.0.1",
|
|
52
|
-
"babel-loader": "^8.
|
|
53
|
-
"chai": "^4.
|
|
52
|
+
"babel-loader": "^8.2.3",
|
|
53
|
+
"chai": "^4.3.6",
|
|
54
54
|
"chai-string": "^1.5.0",
|
|
55
|
-
"cross-env": "^7.0.
|
|
56
|
-
"eslint": "
|
|
57
|
-
"eslint-config-standard": "^
|
|
58
|
-
"eslint-plugin-import": "^2.
|
|
59
|
-
"eslint-plugin-mocha": "^
|
|
55
|
+
"cross-env": "^7.0.3",
|
|
56
|
+
"eslint": "7.32.0",
|
|
57
|
+
"eslint-config-standard": "^16.0.3",
|
|
58
|
+
"eslint-plugin-import": "^2.25.4",
|
|
59
|
+
"eslint-plugin-mocha": "^10.0.3",
|
|
60
60
|
"eslint-plugin-node": "^11.1.0",
|
|
61
|
-
"eslint-plugin-promise": "
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"mocha": "^8.2.0",
|
|
61
|
+
"eslint-plugin-promise": "5.2.0",
|
|
62
|
+
"husky": "^7.0.4",
|
|
63
|
+
"mocha": "^9.2.1",
|
|
65
64
|
"module-alias": "^2.2.2",
|
|
66
|
-
"sinon": "^
|
|
67
|
-
"sinon-chai": "^3.
|
|
65
|
+
"sinon": "^13.0.1",
|
|
66
|
+
"sinon-chai": "^3.7.0"
|
|
68
67
|
},
|
|
69
68
|
"_moduleAliases": {
|
|
70
69
|
"halacious": "."
|
|
71
|
-
},
|
|
72
|
-
"husky": {
|
|
73
|
-
"hooks": {
|
|
74
|
-
"pre-commit": "npm run pre-commit"
|
|
75
|
-
}
|
|
76
70
|
}
|
|
77
71
|
}
|
package/test/plugin.spec.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
require('module-alias/register')
|
|
2
2
|
|
|
3
|
+
const path = require('path')
|
|
4
|
+
|
|
3
5
|
const chai = require('chai')
|
|
4
6
|
|
|
5
7
|
const should = chai.should()
|
|
@@ -346,7 +348,7 @@ describe('Halacious Plugin', () => {
|
|
|
346
348
|
} = server
|
|
347
349
|
|
|
348
350
|
namespaces.add({
|
|
349
|
-
dir:
|
|
351
|
+
dir: path.resolve(__dirname, 'rels/mycompany'),
|
|
350
352
|
prefix: 'mco'
|
|
351
353
|
})
|
|
352
354
|
})
|
|
@@ -373,7 +375,7 @@ describe('Halacious Plugin', () => {
|
|
|
373
375
|
} = server
|
|
374
376
|
|
|
375
377
|
const namespace = plugin.namespaces.add({
|
|
376
|
-
dir:
|
|
378
|
+
dir: path.resolve(__dirname, 'rels/mycompany'),
|
|
377
379
|
prefix: 'mco'
|
|
378
380
|
})
|
|
379
381
|
|
|
@@ -402,7 +404,7 @@ describe('Halacious Plugin', () => {
|
|
|
402
404
|
} = server
|
|
403
405
|
|
|
404
406
|
plugin.namespaces.add({
|
|
405
|
-
dir:
|
|
407
|
+
dir: path.resolve(__dirname, 'rels/mycompany'),
|
|
406
408
|
prefix: 'mco'
|
|
407
409
|
})
|
|
408
410
|
})
|