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 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
@@ -10,7 +10,8 @@
10
10
  ## Links
11
11
 
12
12
  - Druxt.js: https://druxtjs.org
13
- - Documentation: https://schema.druxtjs.org/
13
+ - Documentation: https://druxtjs.org/modules/schema
14
+ - Community Discord server: https://discord.druxtjs.org
14
15
 
15
16
  ## Install
16
17
 
@@ -221,21 +221,26 @@ class DruxtSchema {
221
221
  }
222
222
 
223
223
  const DruxtSchemaNuxtModule = function(moduleOptions = {}) {
224
- if (typeof this.options === "undefined" || !this.options.druxt) {
225
- throw new TypeError("Druxt settings missing.");
226
- }
227
- const options = this.options.druxt;
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, "../nuxt/plugin.js"),
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, "../nuxt/store.js"),
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 (nuxt, buildOptions) => {
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, "../nuxt/schema.json"),
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 { DruxtSchema, DruxtSchemaMixin, DruxtSchemaStore, DruxtSchemaNuxtModule as default };
333
+ export default DruxtSchemaNuxtModule;
334
+ export { DruxtSchema, DruxtSchemaMixin, DruxtSchemaStore };
@@ -229,21 +229,26 @@ class DruxtSchema {
229
229
  }
230
230
 
231
231
  const DruxtSchemaNuxtModule = function(moduleOptions = {}) {
232
- if (typeof this.options === "undefined" || !this.options.druxt) {
233
- throw new TypeError("Druxt settings missing.");
234
- }
235
- const options = this.options.druxt;
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, "../nuxt/plugin.js"),
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, "../nuxt/store.js"),
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 (nuxt, buildOptions) => {
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, "../nuxt/schema.json"),
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['default'] = DruxtSchemaNuxtModule;
344
+ exports.default = DruxtSchemaNuxtModule;
package/package.json CHANGED
@@ -1,22 +1,30 @@
1
1
  {
2
2
  "name": "druxt-schema",
3
- "version": "0.7.8",
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
- "schema",
9
- "entities",
10
- "field",
11
- "fields",
12
- "nuxt"
10
+ "druxtjs",
11
+ "headless",
12
+ "jsonapi",
13
+ "json:api",
14
+ "nuxt",
15
+ "nuxtjs",
16
+ "module",
17
+ "schema"
13
18
  ],
14
- "license": "MIT",
15
- "author": {
16
- "name": "Stuart Clark",
17
- "email": "stuart@realityloop.com",
18
- "url": "https://realityloop.com"
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
- "nuxt"
39
+ "templates"
32
40
  ],
33
41
  "dependencies": {
34
42
  "consola": "^2.15.0",
35
43
  "drupal-jsonapi-params": "^1.2.2",
36
- "druxt": "workspace:*"
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