druxt-schema 0.7.8 → 0.8.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/CHANGELOG.md +31 -0
- package/README.md +2 -1
- package/dist/druxt-schema.esm.js +15 -9
- package/dist/druxt-schema.ssr.js +14 -9
- package/package.json +21 -13
- /package/{nuxt → templates}/plugin.js +0 -0
- /package/{nuxt → templates}/schema.json +0 -0
- /package/{nuxt → templates}/store.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# druxt-schema
|
|
2
2
|
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [4504a2f]
|
|
8
|
+
- druxt@0.12.0
|
|
9
|
+
|
|
10
|
+
## 0.8.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- dae345e: Added module level options
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [dae345e]
|
|
19
|
+
- druxt@0.11.0
|
|
20
|
+
|
|
21
|
+
## 0.7.10
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [715e5ef]
|
|
26
|
+
- druxt@0.10.0
|
|
27
|
+
|
|
28
|
+
## 0.7.9
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- c4616df: Fixed dependencies
|
|
33
|
+
|
|
3
34
|
## 0.7.8
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/README.md
CHANGED
package/dist/druxt-schema.esm.js
CHANGED
|
@@ -221,21 +221,26 @@ class DruxtSchema {
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
const DruxtSchemaNuxtModule = function(moduleOptions = {}) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
const options = {
|
|
225
|
+
baseUrl: moduleOptions.baseUrl,
|
|
226
|
+
...(this.options || {}).druxt || {},
|
|
227
|
+
schema: {
|
|
228
|
+
...((this.options || {}).druxt || {}).schema || {},
|
|
229
|
+
...moduleOptions
|
|
230
|
+
}
|
|
231
|
+
};
|
|
228
232
|
this.addPlugin({
|
|
229
|
-
src: resolve(__dirname, "../
|
|
233
|
+
src: resolve(__dirname, "../templates/plugin.js"),
|
|
230
234
|
fileName: "druxt-schema.js",
|
|
231
235
|
options
|
|
232
236
|
});
|
|
237
|
+
this.options.store = true;
|
|
233
238
|
this.addPlugin({
|
|
234
|
-
src: resolve(__dirname, "../
|
|
239
|
+
src: resolve(__dirname, "../templates/store.js"),
|
|
235
240
|
fileName: "store/druxt-schema.js",
|
|
236
241
|
options
|
|
237
242
|
});
|
|
238
|
-
this.nuxt.hook("builder:prepared", async (
|
|
243
|
+
this.nuxt.hook("builder:prepared", async () => {
|
|
239
244
|
const druxtSchema = new DruxtSchema(options.baseUrl, options);
|
|
240
245
|
const { schemas } = await druxtSchema.get();
|
|
241
246
|
for (const name in schemas) {
|
|
@@ -243,7 +248,7 @@ const DruxtSchemaNuxtModule = function(moduleOptions = {}) {
|
|
|
243
248
|
if (typeof schema === "undefined")
|
|
244
249
|
continue;
|
|
245
250
|
this.addTemplate({
|
|
246
|
-
src: resolve(__dirname, "../
|
|
251
|
+
src: resolve(__dirname, "../templates/schema.json"),
|
|
247
252
|
fileName: `schemas/${name}.json`,
|
|
248
253
|
options: { schema }
|
|
249
254
|
});
|
|
@@ -325,4 +330,5 @@ const DruxtSchemaStore = ({ store }) => {
|
|
|
325
330
|
});
|
|
326
331
|
};
|
|
327
332
|
|
|
328
|
-
export
|
|
333
|
+
export default DruxtSchemaNuxtModule;
|
|
334
|
+
export { DruxtSchema, DruxtSchemaMixin, DruxtSchemaStore };
|
package/dist/druxt-schema.ssr.js
CHANGED
|
@@ -229,21 +229,26 @@ class DruxtSchema {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
const DruxtSchemaNuxtModule = function(moduleOptions = {}) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
const options = {
|
|
233
|
+
baseUrl: moduleOptions.baseUrl,
|
|
234
|
+
...(this.options || {}).druxt || {},
|
|
235
|
+
schema: {
|
|
236
|
+
...((this.options || {}).druxt || {}).schema || {},
|
|
237
|
+
...moduleOptions
|
|
238
|
+
}
|
|
239
|
+
};
|
|
236
240
|
this.addPlugin({
|
|
237
|
-
src: path.resolve(__dirname, "../
|
|
241
|
+
src: path.resolve(__dirname, "../templates/plugin.js"),
|
|
238
242
|
fileName: "druxt-schema.js",
|
|
239
243
|
options
|
|
240
244
|
});
|
|
245
|
+
this.options.store = true;
|
|
241
246
|
this.addPlugin({
|
|
242
|
-
src: path.resolve(__dirname, "../
|
|
247
|
+
src: path.resolve(__dirname, "../templates/store.js"),
|
|
243
248
|
fileName: "store/druxt-schema.js",
|
|
244
249
|
options
|
|
245
250
|
});
|
|
246
|
-
this.nuxt.hook("builder:prepared", async (
|
|
251
|
+
this.nuxt.hook("builder:prepared", async () => {
|
|
247
252
|
const druxtSchema = new DruxtSchema(options.baseUrl, options);
|
|
248
253
|
const { schemas } = await druxtSchema.get();
|
|
249
254
|
for (const name in schemas) {
|
|
@@ -251,7 +256,7 @@ const DruxtSchemaNuxtModule = function(moduleOptions = {}) {
|
|
|
251
256
|
if (typeof schema === "undefined")
|
|
252
257
|
continue;
|
|
253
258
|
this.addTemplate({
|
|
254
|
-
src: path.resolve(__dirname, "../
|
|
259
|
+
src: path.resolve(__dirname, "../templates/schema.json"),
|
|
255
260
|
fileName: `schemas/${name}.json`,
|
|
256
261
|
options: { schema }
|
|
257
262
|
});
|
|
@@ -336,4 +341,4 @@ const DruxtSchemaStore = ({ store }) => {
|
|
|
336
341
|
exports.DruxtSchema = DruxtSchema;
|
|
337
342
|
exports.DruxtSchemaMixin = DruxtSchemaMixin;
|
|
338
343
|
exports.DruxtSchemaStore = DruxtSchemaStore;
|
|
339
|
-
exports
|
|
344
|
+
exports.default = DruxtSchemaNuxtModule;
|
package/package.json
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "druxt-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Drupal Content Entity schema generator for Druxt with support for View and Form displays.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"cms",
|
|
7
|
+
"decoupled",
|
|
6
8
|
"drupal",
|
|
7
9
|
"druxt",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"nuxt"
|
|
10
|
+
"druxtjs",
|
|
11
|
+
"headless",
|
|
12
|
+
"jsonapi",
|
|
13
|
+
"json:api",
|
|
14
|
+
"nuxt",
|
|
15
|
+
"nuxtjs",
|
|
16
|
+
"module",
|
|
17
|
+
"schema"
|
|
13
18
|
],
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
"homepage": "https://druxtjs.org",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/druxt/druxt.js/issues"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/druxt/druxt.js"
|
|
19
26
|
},
|
|
27
|
+
"license": "MIT",
|
|
20
28
|
"exports": {
|
|
21
29
|
".": {
|
|
22
30
|
"require": "./dist/druxt-schema.ssr.js",
|
|
@@ -28,12 +36,12 @@
|
|
|
28
36
|
"module": "dist/druxt-schema.esm.js",
|
|
29
37
|
"files": [
|
|
30
38
|
"dist",
|
|
31
|
-
"
|
|
39
|
+
"templates"
|
|
32
40
|
],
|
|
33
41
|
"dependencies": {
|
|
34
42
|
"consola": "^2.15.0",
|
|
35
43
|
"drupal-jsonapi-params": "^1.2.2",
|
|
36
|
-
"druxt": "
|
|
44
|
+
"druxt": "^0.12.0"
|
|
37
45
|
},
|
|
38
46
|
"optionalDependencies": {
|
|
39
47
|
"vue": "^2.6.14",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|