diff --git a/.eslintrc b/.eslintrc index 442bafddf4..f8809a0402 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,7 @@ { "globals": { - "NodeJS": true + "NodeJS": true, + "$fetch": true }, "plugins": ["jsdoc"], "extends": [ diff --git a/examples/async-data/nuxt.config.ts b/examples/async-data/nuxt.config.ts new file mode 100644 index 0000000000..854fc6bfc5 --- /dev/null +++ b/examples/async-data/nuxt.config.ts @@ -0,0 +1,4 @@ +import { defineNuxtConfig } from '@nuxt/kit' + +export default defineNuxtConfig({ +}) diff --git a/examples/async-data/package.json b/examples/async-data/package.json new file mode 100644 index 0000000000..66c15042df --- /dev/null +++ b/examples/async-data/package.json @@ -0,0 +1,12 @@ +{ + "name": "example-async-data", + "private": true, + "devDependencies": { + "nuxt3": "^0.5.1" + }, + "scripts": { + "dev": "nu dev", + "build": "nu build", + "start": "node .output/server" + } +} diff --git a/examples/async-data/pages/index.vue b/examples/async-data/pages/index.vue new file mode 100644 index 0000000000..fe1ca66275 --- /dev/null +++ b/examples/async-data/pages/index.vue @@ -0,0 +1,19 @@ + + + diff --git a/examples/async-data/server/api/count.js b/examples/async-data/server/api/count.js new file mode 100644 index 0000000000..678b2b2700 --- /dev/null +++ b/examples/async-data/server/api/count.js @@ -0,0 +1,3 @@ +let ctr = 0 + +export default () => ({ count: ++ctr }) diff --git a/examples/hello-world/app.vue b/examples/hello-world/app.vue new file mode 100644 index 0000000000..9b85b82783 --- /dev/null +++ b/examples/hello-world/app.vue @@ -0,0 +1,5 @@ + diff --git a/examples/hello-world/nuxt.config.ts b/examples/hello-world/nuxt.config.ts new file mode 100644 index 0000000000..854fc6bfc5 --- /dev/null +++ b/examples/hello-world/nuxt.config.ts @@ -0,0 +1,4 @@ +import { defineNuxtConfig } from '@nuxt/kit' + +export default defineNuxtConfig({ +}) diff --git a/examples/hello-world/package.json b/examples/hello-world/package.json new file mode 100644 index 0000000000..bca50e5513 --- /dev/null +++ b/examples/hello-world/package.json @@ -0,0 +1,12 @@ +{ + "name": "example-hello-world", + "private": true, + "devDependencies": { + "nuxt3": "^0.5.1" + }, + "scripts": { + "dev": "nu dev", + "build": "nu build", + "start": "node .output/server" + } +} diff --git a/examples/pages/app.vue b/examples/pages/app.vue new file mode 100644 index 0000000000..368d5dfdee --- /dev/null +++ b/examples/pages/app.vue @@ -0,0 +1,12 @@ + diff --git a/examples/pages/nuxt.config.ts b/examples/pages/nuxt.config.ts new file mode 100644 index 0000000000..854fc6bfc5 --- /dev/null +++ b/examples/pages/nuxt.config.ts @@ -0,0 +1,4 @@ +import { defineNuxtConfig } from '@nuxt/kit' + +export default defineNuxtConfig({ +}) diff --git a/examples/pages/package.json b/examples/pages/package.json new file mode 100644 index 0000000000..4de82b7055 --- /dev/null +++ b/examples/pages/package.json @@ -0,0 +1,12 @@ +{ + "name": "example-pages", + "private": true, + "devDependencies": { + "nuxt3": "^0.5.1" + }, + "scripts": { + "dev": "nu dev", + "build": "nu build", + "start": "node .output/server" + } +} diff --git a/examples/pages/pages/about.vue b/examples/pages/pages/about.vue new file mode 100644 index 0000000000..43685bec2a --- /dev/null +++ b/examples/pages/pages/about.vue @@ -0,0 +1,5 @@ + diff --git a/examples/pages/pages/index.vue b/examples/pages/pages/index.vue new file mode 100644 index 0000000000..a9168c0bdf --- /dev/null +++ b/examples/pages/pages/index.vue @@ -0,0 +1,5 @@ + diff --git a/examples/with-vite/app.vue b/examples/with-vite/app.vue new file mode 100644 index 0000000000..a6eaac818d --- /dev/null +++ b/examples/with-vite/app.vue @@ -0,0 +1,5 @@ + diff --git a/examples/with-vite/nuxt.config.ts b/examples/with-vite/nuxt.config.ts new file mode 100644 index 0000000000..70d274d93d --- /dev/null +++ b/examples/with-vite/nuxt.config.ts @@ -0,0 +1,5 @@ +import { defineNuxtConfig } from '@nuxt/kit' + +export default defineNuxtConfig({ + vite: true +}) diff --git a/examples/with-vite/package.json b/examples/with-vite/package.json new file mode 100644 index 0000000000..22bd00b20e --- /dev/null +++ b/examples/with-vite/package.json @@ -0,0 +1,12 @@ +{ + "name": "example-with-vite", + "private": true, + "devDependencies": { + "nuxt3": "^0.5.1" + }, + "scripts": { + "dev": "nu dev", + "build": "nu build", + "start": "node .output/server" + } +} diff --git a/package.json b/package.json index a44e68daed..2e7f7f4920 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "license": "MIT", "workspaces": [ "packages/*", + "examples/*", "docs" ], "scripts": { @@ -12,6 +13,8 @@ "docs": "yarn nu dev docs", "nu": "./node_modules/.bin/nu", "play": "yarn run nu dev playground", + "example": "yarn workspace example-$0 dev", + "example:build": "yarn workspace example-$0 build", "lint": "eslint --ext .vue,.ts,.js .", "test": "yarn lint && jest", "test:compat": "TEST_COMPAT=1 jest", diff --git a/playground/pages/composables/asyncData/parallel.vue b/playground/pages/composables/asyncData/parallel.vue deleted file mode 100644 index e0b1c23e76..0000000000 --- a/playground/pages/composables/asyncData/parallel.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - diff --git a/playground/pages/composables/asyncData/series.vue b/playground/pages/composables/asyncData/series.vue deleted file mode 100644 index d0d556312d..0000000000 --- a/playground/pages/composables/asyncData/series.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/playground/pages/index.vue b/playground/pages/index.vue index 3ee4eab2e7..070e4f6358 100644 --- a/playground/pages/index.vue +++ b/playground/pages/index.vue @@ -1,28 +1,12 @@ diff --git a/yarn.lock b/yarn.lock index 2581479750..81213c47b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6190,6 +6190,38 @@ __metadata: languageName: node linkType: hard +"example-async-data@workspace:examples/async-data": + version: 0.0.0-use.local + resolution: "example-async-data@workspace:examples/async-data" + dependencies: + nuxt3: ^0.5.1 + languageName: unknown + linkType: soft + +"example-hello-world@workspace:examples/hello-world": + version: 0.0.0-use.local + resolution: "example-hello-world@workspace:examples/hello-world" + dependencies: + nuxt3: ^0.5.1 + languageName: unknown + linkType: soft + +"example-pages@workspace:examples/pages": + version: 0.0.0-use.local + resolution: "example-pages@workspace:examples/pages" + dependencies: + nuxt3: ^0.5.1 + languageName: unknown + linkType: soft + +"example-with-vite@workspace:examples/with-vite": + version: 0.0.0-use.local + resolution: "example-with-vite@workspace:examples/with-vite" + dependencies: + nuxt3: ^0.5.1 + languageName: unknown + linkType: soft + "exec-sh@npm:^0.3.2": version: 0.3.6 resolution: "exec-sh@npm:0.3.6"