From d8b8ca627b80d18e32e1add8c57ee89680e0e7d6 Mon Sep 17 00:00:00 2001 From: Stuart Clark Date: Thu, 29 Aug 2024 15:29:04 +1000 Subject: [PATCH] chore(#693): re-implement dev tools plugin --- .../src/components/DruxtDevelTemplate.vue | 5 ++--- packages/druxt/src/nuxt/index.js | 21 +++++++++---------- .../__snapshots__/DruxtEntity.test.js.snap | 4 +++- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/druxt/src/components/DruxtDevelTemplate.vue b/packages/druxt/src/components/DruxtDevelTemplate.vue index 9ef5e6243..28ceae70f 100644 --- a/packages/druxt/src/components/DruxtDevelTemplate.vue +++ b/packages/druxt/src/components/DruxtDevelTemplate.vue @@ -7,10 +7,9 @@ v-text="label" /> - - + diff --git a/packages/druxt/src/nuxt/index.js b/packages/druxt/src/nuxt/index.js index f6e964c94..3e573e7af 100644 --- a/packages/druxt/src/nuxt/index.js +++ b/packages/druxt/src/nuxt/index.js @@ -189,18 +189,17 @@ const DruxtNuxtModule = defineNuxtModule({ // Development mode features. if (nuxt.options.dev) { - // @TODO - AddServerMiddleware isn't part of @nuxt/kit // Add the template stubber server middleware. - // this.addServerMiddleware({ - // path: '/_druxt/template', - // handler: 'druxt/dist/server-middleware/template.mjs' - // }) - - // // Add the Vue devtools plugin. - // this.addPlugin({ - // src: resolve(__dirname, '../dist/plugins/devtools.mjs'), - // fileName: 'druxt-devtools.js' - // }) + nuxt.options.serverMiddleware.push({ + path: '/_druxt/template', + handler: 'druxt/dist/server-middleware/template.mjs' + }) + + // Add the Vue devtools plugin. + addPluginTemplate({ + src: resolve(__dirname, '../dist/plugins/devtools.mjs'), + fileName: 'druxt-devtools.js' + }) } // Nuxt Storybook. diff --git a/packages/entity/test/components/__snapshots__/DruxtEntity.test.js.snap b/packages/entity/test/components/__snapshots__/DruxtEntity.test.js.snap index bf2a006b3..47bed1732 100644 --- a/packages/entity/test/components/__snapshots__/DruxtEntity.test.js.snap +++ b/packages/entity/test/components/__snapshots__/DruxtEntity.test.js.snap @@ -50,7 +50,9 @@ exports[`DruxtEntity missing schema 1`] = ` - +
JSON:API resource
{
   "type": "file--file",