druxt-schema 0.12.0-dev.20261023021249 → 0.12.0-dev.20261023045951
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/README.md +1 -0
- package/package.json +2 -2
- package/templates/plugin.js +7 -1
package/README.md
CHANGED
|
@@ -98,6 +98,7 @@ export default {
|
|
|
98
98
|
- The browser asks the server for a schema at `/_druxt/schema/<id>` and never reads Drupal's configuration itself. The server generates with the same access the build uses.
|
|
99
99
|
- Regeneration only covers schemas the build could generate. When it fails, the schema from the build is used.
|
|
100
100
|
- The hold is per server process, so a site with several instances needs each one cleared.
|
|
101
|
+
- A server started with a different base URL from its build still refreshes when it serves one site. A process serving several sites matches each by the base URL it was built with.
|
|
101
102
|
- Under `nuxt dev` there is no cache to clear, so each request regenerates the schemas it uses.
|
|
102
103
|
- A static site (`nuxt generate`) has no server and keeps the schemas from its build.
|
|
103
104
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "druxt-schema",
|
|
3
|
-
"version": "0.12.0-dev.
|
|
3
|
+
"version": "0.12.0-dev.20261023045951",
|
|
4
4
|
"description": "Drupal Content Entity schema generator for Druxt with support for View and Form displays.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"consola": "^2.15.3",
|
|
48
48
|
"drupal-jsonapi-params": "^2.3.2",
|
|
49
|
-
"druxt": "0.25.0-dev.
|
|
49
|
+
"druxt": "0.25.0-dev.20261023045951"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"axios": "0.34.0",
|
package/templates/plugin.js
CHANGED
|
@@ -15,7 +15,13 @@ const MISSING = {}
|
|
|
15
15
|
const refreshed = async (id) => {
|
|
16
16
|
try {
|
|
17
17
|
if (process.server) {
|
|
18
|
-
|
|
18
|
+
// The module registers the refresh under the base URL the server starts
|
|
19
|
+
// with, which can differ from the one the app was built with, as when a
|
|
20
|
+
// container builds against one host and runs against another. One refresh
|
|
21
|
+
// in the process is this app's; with several, only the built base URL decides.
|
|
22
|
+
const refreshes = process[Symbol.for('druxt.schemaRefresh')] || new Map()
|
|
23
|
+
const refresh = refreshes.get(<%= JSON.stringify(options.baseUrl) %>) ||
|
|
24
|
+
(refreshes.size === 1 ? refreshes.values().next().value : undefined)
|
|
19
25
|
const schema = refresh ? await refresh(id) : null
|
|
20
26
|
return schema === false ? MISSING : schema || null
|
|
21
27
|
}
|