Skip to content

Commit 4965e0b

Browse files
lihbrhuang-julien
andauthored
feat!: v4 (#229)
Co-authored-by: Julien Huang <julien.h.dev@gmail.com> Co-authored-by: lihbr <lihbr@users.noreply.github.com>
1 parent a079178 commit 4965e0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1822
-1396
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
matrix:
3131
node: [lts/*]
3232
# Based on https://majors.nullvoxpopuli.com/q?minors=on&packages=typescript
33-
typescript: ["5.4"]
33+
typescript: ["5.5", "5.6", "5.7"]
3434
fail-fast: false
3535

3636
steps:

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
shamefully-hoist=true
22
strict-peer-dependencies=false
3+
ignore-workspace-root-check=true

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,48 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [4.0.0-rc.1](https://github.com/nuxt-modules/prismic/compare/v4.0.0-rc.0...v4.0.0-rc.1) (2025-01-14)
6+
7+
8+
### Features
9+
10+
* provide auto imports for `linkRel`, `richTextComponents`, and `sliceZoneDefaultComponent` ([5b754e4](https://github.com/nuxt-modules/prismic/commit/5b754e4afc51ad6bf8221d8d99be71a152bd9209))
11+
12+
13+
### Bug Fixes
14+
15+
* auto imports for `linkRel`, `richTextComponents`, and `sliceZoneDefaultComponent` in nuxt 4 ([bbec245](https://github.com/nuxt-modules/prismic/commit/bbec2458c711dcb2817d72ed13845e37afe693c8))
16+
17+
18+
### Chore
19+
20+
* **deps:** maintain dependencies ([f3255d4](https://github.com/nuxt-modules/prismic/commit/f3255d46258c9957ac45de45e343749b17ad3899))
21+
22+
23+
### Documentation
24+
25+
* fix doc ([4e8eecf](https://github.com/nuxt-modules/prismic/commit/4e8eecfe8fcef4b679ee0123326c57927e3860fe))
26+
* fix doc ([4b8a344](https://github.com/nuxt-modules/prismic/commit/4b8a3442f45bc92330ebe733f017b0ef025719c1))
27+
* simplify doc ([5baadd5](https://github.com/nuxt-modules/prismic/commit/5baadd54c697993f730b28b9410231964b473e7d))
28+
* tsdocs ([42d4392](https://github.com/nuxt-modules/prismic/commit/42d43926d97f58afadd9a7f4477644bff94780f5))
29+
30+
## [4.0.0-rc.0](https://github.com/nuxt-modules/prismic/compare/v3.4.7...v4.0.0-rc.0) (2025-01-06)
31+
32+
33+
### ⚠ BREAKING CHANGES
34+
35+
* set setup plugin as parallel (#226)
36+
37+
### Features
38+
39+
* improved devtools tab ([c1d6d51](https://github.com/nuxt-modules/prismic/commit/c1d6d51a5b46389adfe2488721c7937a8e6b8943))
40+
* set setup plugin as parallel ([#226](https://github.com/nuxt-modules/prismic/issues/226)) ([871b19f](https://github.com/nuxt-modules/prismic/commit/871b19f5c53e4a123cf75b4707e40fbb924659ee))
41+
42+
43+
### Chore
44+
45+
* **deps:** remove `consola` dependency ([df2ef44](https://github.com/nuxt-modules/prismic/commit/df2ef441f4126f21a9224e7f163eee89e3267fea))
46+
* update example and playground ([54d217c](https://github.com/nuxt-modules/prismic/commit/54d217c55ea4e9fd67ccef725af53b49290cf893))
547
### [3.4.8](https://github.com/nuxt-modules/prismic/compare/v3.4.7...v3.4.8) (2025-01-06)
648

749
### [3.4.7](https://github.com/nuxt-modules/prismic/compare/v3.4.6...v3.4.7) (2025-01-02)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Easily connect your Nuxt.js application to your content hosted on [Prismic][pris
3636
Install the module to your Nuxt application with one command:
3737

3838
```bash
39-
npx nuxi module add prismic
39+
npx nuxi@latest module add prismic
4040
```
4141

4242
Then, configure your Prismic API endpoint:
@@ -74,15 +74,15 @@ Whether you're helping us fix bugs, improve the docs, or spread the word, we'd l
7474

7575
[prismic]: https://prismic.io
7676

77-
<!-- TODO: Replace link with a more useful one if available -->
77+
<!-- Replace link with a more useful one if available -->
7878

7979
[playground]: https://stackblitz.com/github/nuxt-modules/prismic/tree/master/examples/minimal?file=pages%2Findex.vue
8080
[nuxt-docs]: https://prismic.nuxtjs.org
8181
[prismic-docs]: https://prismic.io/docs/technical-reference/prismicio-vue?version=v4
8282
[changelog]: ./CHANGELOG.md
8383
[contributing]: ./CONTRIBUTING.md
8484

85-
<!-- TODO: Replace link with a more useful one if available -->
85+
<!-- Replace link with a more useful one if available -->
8686

8787
[forum-question]: https://community.prismic.io
8888
[repo-bug-report]: https://github.com/nuxt-modules/prismic/issues/new?assignees=&labels=bug&template=bug_report.md&title=

client/app.vue renamed to client/app/app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
type RPCClientType,
1717
type ISlicemachineClientFunctions,
1818
type ISlicemachineServerFunctions,
19-
} from '../src/devtools/types'
19+
} from '../../src/devtools/types'
2020
2121
const sliceMachineStatus = useSliceMachineStatus()
2222

client/composables/slicemachine.ts renamed to client/app/composables/slicemachine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { RPCClientType } from '../../src/devtools/types'
1+
import type { RPCClientType } from '../../../src/devtools/types'
22

33
export const useSliceMachineStatus = () => useState(
44
'prismic-slice-machine-running',

client/app/pages/index.vue

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<script setup lang="ts">
2+
import type { RPCClientType } from '../../../src/devtools/types'
3+
4+
const props = defineProps<{
5+
rpc: RPCClientType
6+
}>()
7+
8+
const { status, start, stop, config } = await useSlicemachine(props.rpc)
9+
</script>
10+
11+
<template>
12+
<div class="relative p-4 n-bg-base space-y-4">
13+
<header>
14+
<h1 class="inline-block rounded border border-zinc-600 bg-zinc-900 p-1.5 heading text-m">
15+
<span class="i-simple-icons:prismic align-sub" /> @nuxtjs/prismic
16+
</h1>
17+
</header>
18+
19+
<main class="grid grid-cols-2 grid-auto-flow gap-4">
20+
<NCard class="col-span-2 p-4 space-y-4">
21+
<h2 class="text-m heading">
22+
<span class="i-carbon:tools-alt align-sub" /> Slicemachine
23+
</h2>
24+
<section class="flex gap-2">
25+
<SlicemachineStatusTip
26+
:running="status.running"
27+
class="flex-1"
28+
/>
29+
<NButton @click="status.running ? stop() : start()">
30+
{{ status.running ? 'Stop' : 'Start' }} Slicemachine
31+
</NButton>
32+
</section>
33+
</NCard>
34+
<NCard class="p-4 space-y-4">
35+
<h2 class="text-m heading">
36+
<span class="i-carbon:notebook-reference align-sub" /> Documentation
37+
</h2>
38+
<h3>Nuxt</h3>
39+
<p class="flex gap-2 flex-wrap">
40+
<NButton
41+
to="https://prismic.io/docs/content-modeling"
42+
icon="i-carbon-ruler-alt"
43+
target="_blank"
44+
>
45+
Model Content
46+
</NButton>
47+
<NButton
48+
to="https://prismic.io/docs/nuxt-3-define-routes"
49+
icon="i-carbon-3d-curve-manual"
50+
target="_blank"
51+
>
52+
Define Routes
53+
</NButton>
54+
<NButton
55+
to="https://prismic.io/docs/nuxt-3-fetch-data"
56+
icon="i-carbon-download"
57+
target="_blank"
58+
>
59+
Fetch Data
60+
</NButton>
61+
<NButton
62+
to="https://prismic.io/docs/nuxt-3-template-content"
63+
icon="i-carbon-paint-brush"
64+
target="_blank"
65+
>
66+
Template Content
67+
</NButton>
68+
</p>
69+
<h3>APIs</h3>
70+
<p class="flex gap-2 flex-wrap">
71+
<NButton
72+
to="https://prismic.io/docs/technical-reference/prismicio-client"
73+
icon="i-carbon-satellite-radar"
74+
target="_blank"
75+
>
76+
@prismicio/client
77+
</NButton>
78+
<NButton
79+
to="https://prismic.io/docs/technical-reference/prismicio-vue"
80+
icon="i-carbon-logo-vue"
81+
target="_blank"
82+
>
83+
@prismicio/vue
84+
</NButton>
85+
<NButton
86+
to="https://prismic.nuxtjs.org/"
87+
icon="i-simple-icons-nuxtdotjs"
88+
target="_blank"
89+
>
90+
@nuxtjs/prismic
91+
</NButton>
92+
</p>
93+
</NCard>
94+
<NCard
95+
v-if="config && 'repositoryName' in config && config.repositoryName"
96+
class="p-4 space-y-4"
97+
>
98+
<h2 class="text-m heading">
99+
<span class="i-carbon:tools-alt align-sub" /> Repository
100+
</h2>
101+
<p class="flex gap-2 flex-wrap">
102+
<NButton
103+
:to="`https://${config.repositoryName}.prismic.io/builder/working`"
104+
icon="i-carbon-book"
105+
target="_blank"
106+
>
107+
Documents
108+
</NButton>
109+
<NButton
110+
:to="`https://${config.repositoryName}.prismic.io/builder/medias`"
111+
icon="i-carbon-image"
112+
target="_blank"
113+
>
114+
Media Library
115+
</NButton>
116+
<NButton
117+
:to="`https://${config.repositoryName}.prismic.io/settings/repository`"
118+
icon="i-carbon-settings"
119+
target="_blank"
120+
>
121+
Settings
122+
</NButton>
123+
</p>
124+
</NCard>
125+
</main>
126+
</div>
127+
</template>
128+
129+
<style scoped>
130+
.heading {
131+
@apply font-bold uppercase tracking-wider font-mono;
132+
}
133+
</style>

client/nuxt.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ export default defineNuxtConfig({
99
baseURL: '/__prismic-client',
1010
},
1111
devServer: {
12-
port: 3300,
12+
port: 5173,
13+
},
14+
future: {
15+
compatibilityVersion: 4,
1316
},
1417
nitro: {
1518
output: {

client/pages/index.vue

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<script setup lang="ts">
2+
const tree = ref([
3+
{ title: 'Get Started', redirect: 'https://prismic.io/docs/nuxt-3-setup', icon: 'heroicons-outline:lightning-bolt' },
4+
{ title: 'Module Reference', redirect: 'https://prismic.io/docs/technical-reference/nuxtjs-prismic/v4', icon: 'heroicons-outline:book-open' },
5+
])
6+
</script>
7+
8+
<template>
9+
<nav>
10+
<ul>
11+
<li
12+
v-for="link in tree"
13+
:key="link.redirect"
14+
>
15+
<NuxtLink
16+
class="link"
17+
:to="link.redirect"
18+
target="_blank"
19+
>
20+
<Icon
21+
:name="link.icon"
22+
/>
23+
{{ link.title }}
24+
</NuxtLink>
25+
</li>
26+
</ul>
27+
</nav>
28+
</template>
29+
30+
<style scoped lang="ts">
31+
css({
32+
nav: {
33+
display: 'none',
34+
'@lg': {
35+
display: 'block'
36+
},
37+
ul: {
38+
display: 'flex',
39+
alignItems: 'center',
40+
justifyContent: 'center',
41+
flex: '1',
42+
maxWidth: '100%',
43+
truncate: true,
44+
45+
'& > * + *': {
46+
marginLeft: '{space.2}'
47+
},
48+
49+
li: {
50+
display: 'inline-flex',
51+
gap: '{space.1}',
52+
},
53+
54+
'.link': {
55+
display: 'flex',
56+
alignItems: 'center',
57+
gap: '{space.2}',
58+
padding: '{space.2} {space.4}',
59+
fontSize: '{fontSize.sm}',
60+
borderRadius: '{radii.md}',
61+
outline: 'none',
62+
transition: 'background 200ms ease',
63+
64+
svg: {
65+
display: 'inline-block'
66+
},
67+
68+
'&:active,&.active,&:hover': {
69+
backgroundColor: '{color.gray.100}',
70+
'@dark': {
71+
backgroundColor: '{color.gray.900}',
72+
},
73+
},
74+
75+
'&.active': {
76+
boxShadow: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',
77+
fontWeight: '{fontWeight.semibold}'
78+
}
79+
}
80+
}
81+
}
82+
})
83+
</style>

docs/components/AppSearch.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template>
2+
<div />
3+
</template>

0 commit comments

Comments
 (0)