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