druxt-schema 0.9.0 → 0.10.0

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": "druxt-schema",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Drupal Content Entity schema generator for Druxt with support for View and Form displays.",
5
5
  "keywords": [
6
6
  "cms",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "consola": "^2.15.0",
43
43
  "drupal-jsonapi-params": "^1.2.2",
44
- "druxt": "^0.13.0"
44
+ "druxt": "^0.16.0"
45
45
  },
46
46
  "optionalDependencies": {
47
47
  "vue": "^2.6.14",
@@ -11,7 +11,20 @@ const DruxtSchemaPlugin = {
11
11
  * @example @lang js
12
12
  * const schema = await this.$druxtSchema.import('node--page--default--view')
13
13
  */
14
- import: async id => import(`./schemas/${id}.json`).then(m => m.default || m)
14
+ import: async id => {
15
+ return import(`./schemas/${id}.json`)
16
+ .then(m => m.default || m)
17
+ .catch(async (err) => {
18
+ const parts = id.split('--')
19
+
20
+ // Error if there's no default view mode.
21
+ if (parts[parts.length - 2] === 'default') throw err
22
+
23
+ // Fallback to the default view mode.
24
+ parts[parts.length - 2] = 'default'
25
+ return import(`./schemas/${parts.join('--')}.json`).then(m => m.default || m)
26
+ })
27
+ }
15
28
  }
16
29
 
17
30
  export default (context, inject) => {
package/CHANGELOG.md DELETED
@@ -1,129 +0,0 @@
1
- # druxt-schema
2
-
3
- ## 0.9.0
4
-
5
- ### Minor Changes
6
-
7
- - 77ab204: Disabled API Proxy when generating schema files
8
-
9
- ### Patch Changes
10
-
11
- - d12dfb5: Added missing schemaType prop to DruxtSchemaMixin
12
- - Updated dependencies [77ab204]
13
- - druxt@0.13.0
14
-
15
- ## 0.8.1
16
-
17
- ### Patch Changes
18
-
19
- - Updated dependencies [4504a2f]
20
- - druxt@0.12.0
21
-
22
- ## 0.8.0
23
-
24
- ### Minor Changes
25
-
26
- - dae345e: Added module level options
27
-
28
- ### Patch Changes
29
-
30
- - Updated dependencies [dae345e]
31
- - druxt@0.11.0
32
-
33
- ## 0.7.10
34
-
35
- ### Patch Changes
36
-
37
- - Updated dependencies [715e5ef]
38
- - druxt@0.10.0
39
-
40
- ## 0.7.9
41
-
42
- ### Patch Changes
43
-
44
- - c4616df: Fixed dependencies
45
-
46
- ## 0.7.8
47
-
48
- ### Patch Changes
49
-
50
- - Updated dependencies [21170fb]
51
- - druxt@0.9.0
52
-
53
- ## 0.7.7
54
-
55
- ### Patch Changes
56
-
57
- - Fixed issue with inconsistent schemas
58
-
59
- ## 0.7.2
60
-
61
- ### Patch Changes
62
-
63
- - Updated get() query
64
-
65
- ## 0.7.1
66
-
67
- ### Patch Changes
68
-
69
- - Updated Nuxt module
70
-
71
- ## 0.7.0
72
-
73
- ### Minor Changes
74
-
75
- - Refactored to use DruxtClient
76
-
77
- ## 0.6.2
78
-
79
- ### Patch Changes
80
-
81
- - Add support for more than 50 schemas
82
-
83
- ## 0.6.1
84
-
85
- ### Patch Changes
86
-
87
- - Updated dependencies
88
-
89
- ## 0.6.0
90
-
91
- ### Minor Changes
92
-
93
- - Removed auth functionality
94
- - Updated dependencies
95
-
96
- ## 0.5.1
97
-
98
- ### Patch Changes
99
-
100
- - Fixed dependencies
101
-
102
- ## 0.5.0
103
-
104
- ### Minor Changes
105
-
106
- - Refactored to use Nuxt fetch hook
107
-
108
- ## 0.4.0
109
-
110
- ### Minor Changes
111
-
112
- - Added support for remapped resources
113
-
114
- ## 0.3.0
115
-
116
- ### Minor Changes
117
-
118
- - Added support for custom endpoint
119
- - Added message to Nuxt build
120
-
121
- ## 0.2.0
122
-
123
- ### Minor Changes
124
-
125
- - Add ability to filter require schemas
126
-
127
- ## 0.1.0
128
-
129
- ### Initial release