3 | Hello World ! 4 |5 | 6 | -------------------------------------------------------------------------------- /packages/extract-sfc-block/unplugin/vite.ts: -------------------------------------------------------------------------------- 1 | import unplugin from "./unplugin" 2 | 3 | export default unplugin.vite 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .nuxt 4 | .eslintcache 5 | .vitepress/cache 6 | .vitepress/dist 7 | .turbo 8 | .output 9 | -------------------------------------------------------------------------------- /playgrounds/prisma/prisma/dev.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hebilicious/server-block-nuxt/HEAD/playgrounds/prisma/prisma/dev.db -------------------------------------------------------------------------------- /packages/server-block-nuxt/src/volar.ts: -------------------------------------------------------------------------------- 1 | // @todo bundle the volar extension ? 2 | // export * from "@hebilicious/sfc-server-volar" 3 | -------------------------------------------------------------------------------- /playgrounds/basic/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hebilicious/server-block-nuxt/HEAD/playgrounds/basic/public/favicon.ico -------------------------------------------------------------------------------- /playgrounds/basic/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // https://nuxt.com/docs/guide/concepts/typescript 3 | "extends": "./.nuxt/tsconfig.json" 4 | } 5 | -------------------------------------------------------------------------------- /playgrounds/prisma/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hebilicious/server-block-nuxt/HEAD/playgrounds/prisma/public/favicon.ico -------------------------------------------------------------------------------- /playgrounds/prisma/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // https://nuxt.com/docs/guide/concepts/typescript 3 | "extends": "./.nuxt/tsconfig.json" 4 | } 5 | -------------------------------------------------------------------------------- /packages/sfc-server-volar/README.md: -------------------------------------------------------------------------------- 1 | # Extract Server Block Volar 2 | 3 | This is a volar plugin that enables IDE features in SFC `server` blocks. -------------------------------------------------------------------------------- /test/fixtures/basic/nuxt.config.ts: -------------------------------------------------------------------------------- 1 | export default defineNuxtConfig({ 2 | modules: ["../../../packages/server-block-nuxt/src/module.ts"] 3 | }) 4 | -------------------------------------------------------------------------------- /test/fixtures/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic-fixture", 3 | "private": true, 4 | "dependencies": { 5 | "nuxt": "3.6.5" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/basic/server/api/todos.ts: -------------------------------------------------------------------------------- 1 | export default defineEventHandler(() => { 2 | return [{ id: 1, todo: "Hello" }, { id: 2, todo: "World" }] 3 | }) 4 | -------------------------------------------------------------------------------- /playgrounds/prisma/prisma/migrations/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "sqlite" -------------------------------------------------------------------------------- /packages/server-block-nuxt/build.config.ts: -------------------------------------------------------------------------------- 1 | import { defineBuildConfig } from "unbuild" 2 | 3 | export default defineBuildConfig({ 4 | entries: ["src/module"], 5 | failOnWarn: false 6 | }) 7 | -------------------------------------------------------------------------------- /packages/server-block-nuxt/test/module.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from "vitest" 2 | 3 | describe("all", () => { 4 | it("tests", () => { 5 | expect(true).toBe(true) 6 | }) 7 | }) 8 | -------------------------------------------------------------------------------- /playgrounds/prisma/prisma.ts: -------------------------------------------------------------------------------- 1 | import PrismaClientPkg from "@prisma/client" 2 | 3 | const PrismaClient = PrismaClientPkg.PrismaClient 4 | 5 | const prisma = new PrismaClient() 6 | 7 | export { 8 | prisma 9 | } 10 | -------------------------------------------------------------------------------- /playgrounds/prisma/lib/prisma.ts: -------------------------------------------------------------------------------- 1 | import PrismaClientPkg from "@prisma/client" 2 | 3 | const PrismaClient = PrismaClientPkg.PrismaClient 4 | 5 | const prisma = new PrismaClient() 6 | 7 | export { 8 | prisma 9 | } 10 | -------------------------------------------------------------------------------- /playgrounds/prisma/nuxt.config.ts: -------------------------------------------------------------------------------- 1 | // https://nuxt.com/docs/api/configuration/nuxt-config 2 | export default defineNuxtConfig({ 3 | modules: [ 4 | "../../packages/server-block-nuxt/src/module" 5 | ], 6 | devtools: { enabled: true } 7 | }) 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_size = 2 5 | indent_style = space 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /playgrounds/prisma/.gitignore: -------------------------------------------------------------------------------- 1 | # Nuxt dev/build outputs 2 | .output 3 | .nuxt 4 | .nitro 5 | .cache 6 | dist 7 | 8 | # Node dependencies 9 | node_modules 10 | 11 | # Logs 12 | logs 13 | *.log 14 | 15 | # Misc 16 | .DS_Store 17 | .fleet 18 | .idea 19 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docs", 3 | "private": true, 4 | "scripts": { 5 | "dev": "vitepress dev", 6 | "build": "vitepress build", 7 | "preview": "vitepress preview" 8 | }, 9 | "devDependencies": { 10 | "vitepress": "1.0.0-rc.40" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "prettier.enable": false, 3 | "editor.formatOnSave": false, 4 | "editor.codeActionsOnSave": { 5 | "source.fixAll.eslint": true 6 | }, 7 | "workbench.colorCustomizations": {}, 8 | "inline-bookmarks.view.showVisibleFilesOnly": false 9 | } 10 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turborepo.org/schema.json", 3 | "pipeline": { 4 | "dev": { 5 | "cache": false, 6 | "persistent": true 7 | }, 8 | "build": { 9 | "dependsOn": ["^build"], 10 | "outputs": ["dist/**"] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/server-block-nuxt/scripts/readme.ts: -------------------------------------------------------------------------------- 1 | import { copyFileSync } from "node:fs" 2 | import { resolve } from "node:path" 3 | import { fileURLToPath } from "node:url" 4 | 5 | const dir = fileURLToPath(new URL("..", import.meta.url)) 6 | copyFileSync(resolve(dir, "../../README.md"), resolve(dir, "./README.md")) 7 | -------------------------------------------------------------------------------- /playgrounds/basic/README.md: -------------------------------------------------------------------------------- 1 | # AuthJS Nuxt 2 | 3 | This is a simple example to demonstrate how to use the module. 4 | ## Dependencies Caveats 5 | 6 | The dev dependencies are required for the build to work with pnpm. 7 | If you are using npm or `--shamefully-hoist=true`, you should be able to remove them from the `package.json` file. -------------------------------------------------------------------------------- /playgrounds/basic/pages/todos.vue: -------------------------------------------------------------------------------- 1 |
{{ data }}
14 |
15 |
--------------------------------------------------------------------------------
/playgrounds/prisma/pages/index.vue:
--------------------------------------------------------------------------------
1 |
12 | {{ data }}
13 |
14 |