druxt-schema 0.9.1 → 0.10.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": "druxt-schema",
3
- "version": "0.9.1",
3
+ "version": "0.10.1",
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.14.0"
44
+ "druxt": "^0.17.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,136 +0,0 @@
1
- # druxt-schema
2
-
3
- ## 0.9.1
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [45bc0b9]
8
- - druxt@0.14.0
9
-
10
- ## 0.9.0
11
-
12
- ### Minor Changes
13
-
14
- - 77ab204: Disabled API Proxy when generating schema files
15
-
16
- ### Patch Changes
17
-
18
- - d12dfb5: Added missing schemaType prop to DruxtSchemaMixin
19
- - Updated dependencies [77ab204]
20
- - druxt@0.13.0
21
-
22
- ## 0.8.1
23
-
24
- ### Patch Changes
25
-
26
- - Updated dependencies [4504a2f]
27
- - druxt@0.12.0
28
-
29
- ## 0.8.0
30
-
31
- ### Minor Changes
32
-
33
- - dae345e: Added module level options
34
-
35
- ### Patch Changes
36
-
37
- - Updated dependencies [dae345e]
38
- - druxt@0.11.0
39
-
40
- ## 0.7.10
41
-
42
- ### Patch Changes
43
-
44
- - Updated dependencies [715e5ef]
45
- - druxt@0.10.0
46
-
47
- ## 0.7.9
48
-
49
- ### Patch Changes
50
-
51
- - c4616df: Fixed dependencies
52
-
53
- ## 0.7.8
54
-
55
- ### Patch Changes
56
-
57
- - Updated dependencies [21170fb]
58
- - druxt@0.9.0
59
-
60
- ## 0.7.7
61
-
62
- ### Patch Changes
63
-
64
- - Fixed issue with inconsistent schemas
65
-
66
- ## 0.7.2
67
-
68
- ### Patch Changes
69
-
70
- - Updated get() query
71
-
72
- ## 0.7.1
73
-
74
- ### Patch Changes
75
-
76
- - Updated Nuxt module
77
-
78
- ## 0.7.0
79
-
80
- ### Minor Changes
81
-
82
- - Refactored to use DruxtClient
83
-
84
- ## 0.6.2
85
-
86
- ### Patch Changes
87
-
88
- - Add support for more than 50 schemas
89
-
90
- ## 0.6.1
91
-
92
- ### Patch Changes
93
-
94
- - Updated dependencies
95
-
96
- ## 0.6.0
97
-
98
- ### Minor Changes
99
-
100
- - Removed auth functionality
101
- - Updated dependencies
102
-
103
- ## 0.5.1
104
-
105
- ### Patch Changes
106
-
107
- - Fixed dependencies
108
-
109
- ## 0.5.0
110
-
111
- ### Minor Changes
112
-
113
- - Refactored to use Nuxt fetch hook
114
-
115
- ## 0.4.0
116
-
117
- ### Minor Changes
118
-
119
- - Added support for remapped resources
120
-
121
- ## 0.3.0
122
-
123
- ### Minor Changes
124
-
125
- - Added support for custom endpoint
126
- - Added message to Nuxt build
127
-
128
- ## 0.2.0
129
-
130
- ### Minor Changes
131
-
132
- - Add ability to filter require schemas
133
-
134
- ## 0.1.0
135
-
136
- ### Initial release