Skip to content

Commit

Permalink
feat: export remote function caller from client
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Nov 30, 2022
1 parent 98cb04b commit 8f81ae9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"./server": {
"import": "./dist/runtime/server.mjs",
"types": "./dist/runtime/server.d.ts"
},
"./client": {
"import": "./dist/runtime/client.mjs",
"types": "./dist/runtime/client.d.ts"
}
},
"main": "./dist/module.cjs",
Expand Down Expand Up @@ -43,6 +47,7 @@
"@types/dedent": "^0.7.0",
"bumpp": "^8.2.1",
"eslint": "^8.28.0",
"nuxt": "^3.0.0"
"nuxt": "^3.0.0",
"nuxt-remote-fn": "workspace:*"
}
}
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default defineNuxtModule({
})

addVitePlugin(transformServerFiles())
addImportsDir(join(runtimeDir, 'composables'))

await scanRemoteFunctions()

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/runtime/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function transformExportsToRemoteFunctions (src: string, moduleId: string)
})

return `
import { callRemoteFunction } from '#imports'
import { callRemoteFunction } from 'nuxt-remote-fn/client'
${exportList.join('\n')}
`
}

0 comments on commit 8f81ae9

Please sign in to comment.