Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update to latest @nuxt/module-builder #712

Merged
merged 4 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@antfu/ni": "^0.22.4",
"@nuxt/devtools": "workspace:*",
"@nuxt/devtools-ui-kit": "workspace:*",
"@nuxt/module-builder": "~0.6.0",
"@nuxt/module-builder": "^0.8.3",
"@nuxt/schema": "^3.13.0",
"@types/markdown-it": "^14.1.2",
"@types/node": "^22.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools-kit/host-client.mjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './dist/runtime/host-client.mjs'
export * from './dist/runtime/host-client.js'
2 changes: 1 addition & 1 deletion packages/devtools-kit/iframe-client.mjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './dist/runtime/iframe-client.mjs'
export * from './dist/runtime/iframe-client.js'
29 changes: 0 additions & 29 deletions packages/devtools/build.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { fileURLToPath } from 'node:url'
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
Expand All @@ -23,32 +22,4 @@ export default defineBuildConfig({
rollup: {
inlineDependencies: true,
},
hooks: {
// Patch @nuxt/[email protected] not adding .mjs extension for runtime files
// https://github.com/nuxt/module-builder/issues/261
'rollup:options': (_, options) => {
options.plugins ||= []
if (!Array.isArray(options.plugins))
options.plugins = [options.plugins]

const runtimeDir = fileURLToPath(new URL('./src/runtime', import.meta.url))
options.plugins.unshift({
name: 'unbuild:runtime-build:patch',
async resolveId(id, importter) {
if (!id.includes('runtime'))
return
const resolved = await this.resolve(id, importter, { skipSelf: true })
if (resolved?.id.startsWith(runtimeDir)) {
let id = resolved.id
if (!id.endsWith('.mjs'))
id += '.mjs'
return {
external: true,
id,
}
}
},
})
},
},
})
2 changes: 1 addition & 1 deletion packages/devtools/src/integrations/vue-devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function setup({ nuxt }: NuxtDevtoolsServerContext) {
const appendTo = /\/entry\.m?js$/

if (!options?.ssr && appendTo.test(filename))
code = `import 'virtual:vue-devtools-path:overlay.mjs';\n${code}`
code = `import 'virtual:vue-devtools-path:overlay.js';\n${code}`

return code
},
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools/src/server-rpc/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function setupOptionsRPC({ nuxt }: NuxtDevtoolsServerContext) {
)
nuxt.callHook('builder:generateApp', {
filter(template) {
return template.filename.includes('devtools/settings.mjs')
return template.filename.includes('devtools/settings.js')
},
})
},
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/module-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@iconify-json/carbon": "^1.1.37",
"@nuxt/devtools": "workspace:*",
"@nuxt/devtools-ui-kit": "workspace:*",
"@nuxt/module-builder": "~0.6.0",
"@nuxt/module-builder": "^0.8.3",
"@nuxt/schema": "^3.13.0",
"@nuxt/test-utils": "^3.14.1",
"eslint": "^9.9.0",
Expand Down
1,554 changes: 276 additions & 1,278 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Loading