create-vike 0.0.306 → 0.0.307

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@
9
9
  // - See vavite + Vike examples at https://github.com/cyco130/vavite/tree/main/examples
10
10
  // - vite-node (https://github.com/antfu/vite-node)
11
11
  // - HatTip (https://github.com/hattipjs/hattip)
12
- // - You can use Bati (https://batijs.github.io/) to scaffold a vike + HatTip app. Note that Bati generates apps that use the V1 design (https://vike.dev/migration/v1-design) and Vike packages (https://vike.dev/vike-packages)
12
+ // - You can use Bati (https://batijs.github.io/) to scaffold a Vike + HatTip app. Note that Bati generates apps that use the V1 design (https://vike.dev/migration/v1-design) and Vike packages (https://vike.dev/vike-packages)
13
13
 
14
14
  import express from 'express'
15
15
  import compression from 'compression'
@@ -1,6 +1,6 @@
1
1
  import react from '@vitejs/plugin-react'
2
- import ssr from 'vike/plugin'
2
+ import vike from 'vike/plugin'
3
3
 
4
4
  export default {
5
- plugins: [react(), ssr()]
5
+ plugins: [react(), vike()]
6
6
  }
@@ -1,6 +1,7 @@
1
1
  module.exports = {
2
2
  rules: {
3
- 'react-refresh/only-export-components': 'warn'
3
+ 'react-refresh/only-export-components': 'warn',
4
+ '@typescript-eslint/no-namespace': 'off'
4
5
  },
5
6
  reportUnusedDisableDirectives: true,
6
7
  ignorePatterns: ['dist/*'],
@@ -1,35 +1,33 @@
1
- export type { PageContextServer }
2
- export type { PageContextClient }
3
- export type { PageContext }
4
- export type { PageProps }
5
-
6
- import type {
7
- PageContextBuiltInServer,
1
+ export type {
2
+ PageContextServer,
8
3
  /*
9
4
  // When using Client Routing https://vike.dev/clientRouting
10
- PageContextBuiltInClientWithClientRouting as PageContextBuiltInClient
5
+ PageContextClient,
6
+ PageContext,
11
7
  /*/
12
8
  // When using Server Routing
13
- PageContextBuiltInClientWithServerRouting as PageContextBuiltInClient
9
+ PageContextClientWithServerRouting as PageContextClient,
10
+ PageContextWithServerRouting as PageContext
14
11
  //*/
15
12
  } from 'vike/types'
13
+ export type { PageProps }
16
14
 
17
- type Page = (pageProps: PageProps) => React.ReactElement
18
- type PageProps = Record<string, unknown>
19
-
20
- export type PageContextCustom = {
21
- Page: Page
22
- pageProps?: PageProps
23
- urlPathname: string
24
- exports: {
25
- documentProps?: {
26
- title?: string
27
- description?: string
15
+ // https://vike.dev/pageContext#typescript
16
+ declare global {
17
+ namespace Vike {
18
+ interface PageContext {
19
+ Page: Page
20
+ pageProps?: PageProps
21
+ urlPathname: string
22
+ exports: {
23
+ documentProps?: {
24
+ title?: string
25
+ description?: string
26
+ }
27
+ }
28
28
  }
29
29
  }
30
30
  }
31
31
 
32
- type PageContextServer = PageContextBuiltInServer<Page> & PageContextCustom
33
- type PageContextClient = PageContextBuiltInClient<Page> & PageContextCustom
34
-
35
- type PageContext = PageContextClient | PageContextServer
32
+ type Page = (pageProps: PageProps) => React.ReactElement
33
+ type PageProps = Record<string, unknown>
@@ -9,7 +9,7 @@
9
9
  // - See vavite + Vike examples at https://github.com/cyco130/vavite/tree/main/examples
10
10
  // - vite-node (https://github.com/antfu/vite-node)
11
11
  // - HatTip (https://github.com/hattipjs/hattip)
12
- // - You can use Bati (https://batijs.github.io/) to scaffold a vike + HatTip app. Note that Bati generates apps that use the V1 design (https://vike.dev/migration/v1-design) and Vike packages (https://vike.dev/vike-packages)
12
+ // - You can use Bati (https://batijs.github.io/) to scaffold a Vike + HatTip app. Note that Bati generates apps that use the V1 design (https://vike.dev/migration/v1-design) and Vike packages (https://vike.dev/vike-packages)
13
13
 
14
14
  import express from 'express'
15
15
  import compression from 'compression'
@@ -1,9 +1,9 @@
1
1
  import react from '@vitejs/plugin-react'
2
- import ssr from 'vike/plugin'
2
+ import vike from 'vike/plugin'
3
3
  import { UserConfig } from 'vite'
4
4
 
5
5
  const config: UserConfig = {
6
- plugins: [react(), ssr()]
6
+ plugins: [react(), vike()]
7
7
  }
8
8
 
9
9
  export default config
@@ -9,7 +9,7 @@
9
9
  // - See vavite + Vike examples at https://github.com/cyco130/vavite/tree/main/examples
10
10
  // - vite-node (https://github.com/antfu/vite-node)
11
11
  // - HatTip (https://github.com/hattipjs/hattip)
12
- // - You can use Bati (https://batijs.github.io/) to scaffold a vike + HatTip app. Note that Bati generates apps that use the V1 design (https://vike.dev/migration/v1-design) and Vike packages (https://vike.dev/vike-packages)
12
+ // - You can use Bati (https://batijs.github.io/) to scaffold a Vike + HatTip app. Note that Bati generates apps that use the V1 design (https://vike.dev/migration/v1-design) and Vike packages (https://vike.dev/vike-packages)
13
13
 
14
14
  import express from 'express'
15
15
  import compression from 'compression'
@@ -1,6 +1,6 @@
1
1
  import vue from '@vitejs/plugin-vue'
2
- import ssr from 'vike/plugin'
2
+ import vike from 'vike/plugin'
3
3
 
4
4
  export default {
5
- plugins: [vue(), ssr()]
5
+ plugins: [vue(), vike()]
6
6
  }
@@ -1,38 +1,37 @@
1
- export type { PageContextServer }
2
- export type { PageContextClient }
3
- export type { PageContext }
4
- export type { PageProps }
5
- export type { Component }
6
-
7
- import type {
8
- PageContextBuiltInServer,
1
+ export type {
2
+ PageContextServer,
9
3
  /*
10
4
  // When using Client Routing https://vike.dev/clientRouting
11
- PageContextBuiltInClientWithClientRouting as PageContextBuiltInClient
5
+ PageContextClient,
6
+ PageContext,
12
7
  /*/
13
8
  // When using Server Routing
14
- PageContextBuiltInClientWithServerRouting as PageContextBuiltInClient
9
+ PageContextClientWithServerRouting as PageContextClient,
10
+ PageContextWithServerRouting as PageContext
15
11
  //*/
16
12
  } from 'vike/types'
17
- import type { ComponentPublicInstance } from 'vue'
18
-
19
- type Component = ComponentPublicInstance // https://stackoverflow.com/questions/63985658/how-to-type-vue-instance-out-of-definecomponent-in-vue-3/63986086#63986086
20
- type Page = Component
21
- type PageProps = {}
13
+ export type { PageProps }
14
+ export type { Component }
22
15
 
23
- export type PageContextCustom = {
24
- Page: Page
25
- pageProps?: PageProps
26
- urlPathname: string
27
- exports: {
28
- documentProps?: {
29
- title?: string
30
- description?: string
16
+ // https://vike.dev/pageContext#typescript
17
+ declare global {
18
+ namespace Vike {
19
+ interface PageContext {
20
+ Page: Page
21
+ pageProps?: PageProps
22
+ urlPathname: string
23
+ exports: {
24
+ documentProps?: {
25
+ title?: string
26
+ description?: string
27
+ }
28
+ }
31
29
  }
32
30
  }
33
31
  }
34
32
 
35
- type PageContextServer = PageContextBuiltInServer<Page> & PageContextCustom
36
- type PageContextClient = PageContextBuiltInClient<Page> & PageContextCustom
33
+ import type { ComponentPublicInstance } from 'vue'
37
34
 
38
- type PageContext = PageContextClient | PageContextServer
35
+ type Component = ComponentPublicInstance // https://stackoverflow.com/questions/63985658/how-to-type-vue-instance-out-of-definecomponent-in-vue-3/63986086#63986086
36
+ type Page = Component
37
+ type PageProps = {}
@@ -9,7 +9,7 @@
9
9
  // - See vavite + Vike examples at https://github.com/cyco130/vavite/tree/main/examples
10
10
  // - vite-node (https://github.com/antfu/vite-node)
11
11
  // - HatTip (https://github.com/hattipjs/hattip)
12
- // - You can use Bati (https://batijs.github.io/) to scaffold a vike + HatTip app. Note that Bati generates apps that use the V1 design (https://vike.dev/migration/v1-design) and Vike packages (https://vike.dev/vike-packages)
12
+ // - You can use Bati (https://batijs.github.io/) to scaffold a Vike + HatTip app. Note that Bati generates apps that use the V1 design (https://vike.dev/migration/v1-design) and Vike packages (https://vike.dev/vike-packages)
13
13
 
14
14
  import express from 'express'
15
15
  import compression from 'compression'
@@ -1,9 +1,9 @@
1
1
  import vue from '@vitejs/plugin-vue'
2
- import ssr from 'vike/plugin'
2
+ import vike from 'vike/plugin'
3
3
  import { UserConfig } from 'vite'
4
4
 
5
5
  const config: UserConfig = {
6
- plugins: [vue(), ssr()]
6
+ plugins: [vue(), vike()]
7
7
  }
8
8
 
9
9
  export default config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vike",
3
- "version": "0.0.306",
3
+ "version": "0.0.307",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "create-vike": "index.js"