Skip to content

Commit f21c7bc

Browse files
authored
Merge pull request #214 from nuxt-modules/lh/maintain-module
misc: refresh project structure, fully migrate to pnpm, nuxt 4 enhancements, @nuxt/eslint integration, and more!
2 parents 8d4d3f7 + 03c9a94 commit f21c7bc

Some content is hidden

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

69 files changed

+15442
-43675
lines changed

.eslintignore

Lines changed: 0 additions & 45 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 51 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3,106 +3,82 @@ name: ci
33
on: push
44

55
jobs:
6-
prepare:
7-
name: Prepare (${{ matrix.os}}, Node ${{ matrix.node }})
8-
runs-on: ${{ matrix.os }}
9-
strategy:
10-
matrix:
11-
os: [ubuntu-latest]
12-
node: [16, 18, 20.7]
13-
6+
lint:
7+
runs-on: ubuntu-latest
148
steps:
15-
- name: Set up Node
16-
uses: actions/setup-node@v3
17-
with:
18-
node-version: ${{ matrix.node }}
9+
- uses: actions/checkout@v4
1910

20-
- name: Checkout
21-
uses: actions/checkout@master
22-
23-
- name: Cache node_modules and .nuxt
24-
id: cache
25-
uses: actions/cache@v3
11+
- name: Set node
12+
uses: actions/setup-node@v4
2613
with:
27-
path: |
28-
node_modules
29-
playground/.nuxt
30-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
14+
node-version: lts/*
15+
16+
- name: Install pnpm
17+
uses: pnpm/action-setup@v4
3118

3219
- name: Install dependencies
33-
if: steps.cache.outputs.cache-hit != 'true'
34-
run: npm ci
20+
run: pnpm install
21+
22+
- name: Lint
23+
run: pnpm lint
24+
25+
typecheck:
26+
runs-on: ubuntu-latest
27+
name: typecheck (node ${{ matrix.node }}, typescript ${{ matrix.typescript }})
3528

36-
suite:
37-
needs: prepare
38-
name: Suite (${{ matrix.os}}, Node ${{ matrix.node }})
39-
runs-on: ${{ matrix.os }}
4029
strategy:
41-
fail-fast: false
4230
matrix:
43-
os: [ubuntu-latest]
44-
node: [16, 18, 20.7]
31+
node: [lts/*]
32+
# Based on https://majors.nullvoxpopuli.com/q?minors=on&packages=typescript
33+
typescript: ["5.4"]
34+
fail-fast: false
4535

4636
steps:
47-
- name: Set up Node
48-
uses: actions/setup-node@v3
49-
with:
50-
node-version: ${{ matrix.node }}
51-
52-
- name: Checkout
53-
uses: actions/checkout@master
37+
- uses: actions/checkout@v4
5438

55-
- name: Retrieve node_modules and .nuxt
56-
uses: actions/cache@v3
39+
- name: Set node ${{ matrix.node }}
40+
uses: actions/setup-node@v4
5741
with:
58-
path: |
59-
node_modules
60-
playground/.nuxt
61-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
42+
node-version: ${{ matrix.node }}
6243

63-
- name: Lint
64-
run: npm run lint
44+
- name: Install pnpm
45+
uses: pnpm/action-setup@v4
6546

66-
- name: Unit
67-
run: npm run unit
47+
- name: Install dependencies
48+
run: pnpm install
6849

69-
- name: Build
70-
run: npm run build
50+
- name: Set typescript ${{ matrix.typescript }}
51+
run: pnpm add --workspace-root --save-dev typescript@${{ matrix.typescript }} && npx tsc --version
7152

72-
- name: Coverage
73-
if: matrix.os == 'ubuntu-latest' && matrix.node == 20.7
74-
uses: codecov/codecov-action@v3
53+
- name: Typecheck
54+
run: pnpm typecheck
7555

76-
types:
77-
needs: prepare
78-
name: Types (${{ matrix.os}}, Node ${{ matrix.node }}, TS ${{ matrix.typescript }})
56+
test:
7957
runs-on: ${{ matrix.os }}
58+
name: test (os ${{ matrix.os }}, node ${{ matrix.node }})
59+
8060
strategy:
81-
fail-fast: false
8261
matrix:
83-
os: [ubuntu-latest]
84-
node: [18]
85-
typescript: ["5.0", "5.1"]
62+
os: [ubuntu-latest, windows-latest, macos-latest]
63+
node: [18, 20, lts/*]
64+
fail-fast: false
8665

8766
steps:
88-
- name: Set up Node
89-
uses: actions/setup-node@v3
67+
- uses: actions/checkout@v4
68+
69+
- name: Set node ${{ matrix.node }}
70+
uses: actions/setup-node@v4
9071
with:
9172
node-version: ${{ matrix.node }}
9273

93-
- name: Checkout
94-
uses: actions/checkout@master
74+
- name: Install pnpm
75+
uses: pnpm/action-setup@v4
9576

96-
- name: Retrieve node_modules and .nuxt
97-
uses: actions/cache@v3
98-
with:
99-
path: |
100-
node_modules
101-
playground/.nuxt
102-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
77+
- name: Install dependencies
78+
run: pnpm install
10379

104-
- name: Overwrite TypeScript
105-
run: npm install --no-save typescript@${{ matrix.typescript }} && npx tsc --version
80+
- name: Unit
81+
run: pnpm unit
10682

107-
- name: Types
108-
run: npm run types
83+
- name: Build
84+
run: pnpm build

.gitignore

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,56 @@
1-
# custom
2-
dist
3-
.nuxt
4-
.output
5-
sw.*
1+
# Dependencies
2+
node_modules
63

7-
# os
8-
.DS_Store
9-
._*
4+
# Logs
5+
*.log*
106

11-
# node
12-
logs
13-
*.log
14-
node_modules
7+
# Temp directories
8+
.temp
9+
.tmp
10+
.cache
1511

16-
# yarn
17-
yarn-debug.log*
18-
yarn-error.log*
19-
lerna-debug.log*
20-
.yarn-integrity
21-
yarn.lock
12+
# Yarn
13+
**/.yarn/cache
14+
**/.yarn/*state*
2215

23-
# npm
24-
npm-debug.log*
16+
# Generated dirs
17+
dist
2518

26-
# tests
27-
coverage
28-
.eslintcache
29-
.nyc_output
19+
# Nuxt
20+
.nuxt
21+
.output
22+
.data
23+
.vercel_build_output
24+
.build-*
25+
.netlify
3026

31-
# .env
27+
# Env
3228
.env
33-
.env.test
34-
.env*.local
3529

36-
# vscode
30+
# Testing
31+
reports
32+
coverage
33+
*.lcov
34+
.nyc_output
35+
36+
# VSCode
3737
.vscode/*
38+
!.vscode/settings.json
3839
!.vscode/tasks.json
3940
!.vscode/launch.json
40-
*.code-workspace
41+
!.vscode/extensions.json
42+
!.vscode/*.code-snippets
43+
44+
# Intellij idea
45+
*.iml
46+
.idea
47+
48+
# OSX
49+
.DS_Store
50+
.AppleDouble
51+
.LSOverride
52+
.AppleDB
53+
.AppleDesktop
54+
Network Trash Folder
55+
Temporary Items
56+
.apdisk

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Nuxt.js Community
3+
Copyright (c) 2024 Nuxt.js Community
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
Replace all on all files (README.md, CONTRIBUTING.md, bug_report.md, package.json):
44
- @nuxtjs/prismic
5-
- Easily connect your Nuxt 3 application to your content hosted on Prismic
5+
- Easily connect your Nuxt application to your content hosted on Prismic
66
- nuxt-modules/prismic
77
- prismic
88
@@ -91,15 +91,15 @@ Whether you're helping us fix bugs, improve the docs, or spread the word, we'd l
9191

9292
<!-- Badges -->
9393

94-
[npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/prismic/latest.svg
94+
[npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/prismic/latest.svg?style=flat&colorA=020420&colorB=00DC82
9595
[npm-version-href]: https://npmjs.com/package/@nuxtjs/prismic
96-
[npm-downloads-src]: https://img.shields.io/npm/dm/@nuxtjs/prismic.svg
96+
[npm-downloads-src]: https://img.shields.io/npm/dm/@nuxtjs/prismic.svg?style=flat&colorA=020420&colorB=00DC82
9797
[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/prismic
98-
[github-actions-ci-src]: https://github.com/nuxt-modules/prismic/workflows/ci/badge.svg
98+
[github-actions-ci-src]: https://img.shields.io/github/actions/workflow/status/nuxt-modules/prismic/ci.yml.svg?style=flat&colorA=020420&colorB=00DC82
9999
[github-actions-ci-href]: https://github.com/nuxt-modules/prismic/actions?query=workflow%3Aci
100-
[codecov-src]: https://img.shields.io/codecov/c/github/nuxt-modules/prismic.svg
100+
[codecov-src]: https://img.shields.io/codecov/c/github/nuxt-modules/prismic.svg?style=flat&colorA=020420&colorB=00DC82
101101
[codecov-href]: https://codecov.io/gh/nuxt-modules/prismic
102-
[conventional-commits-src]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
102+
[conventional-commits-src]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat&colorA=020420&colorB=00DC82
103103
[conventional-commits-href]: https://conventionalcommits.org
104-
[license-src]: https://img.shields.io/npm/l/@nuxtjs/prismic.svg
104+
[license-src]: https://img.shields.io/npm/l/@nuxtjs/prismic.svg?style=flat&colorA=020420&colorB=00DC82
105105
[license-href]: https://npmjs.com/package/@nuxtjs/prismic

client/app.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<template>
22
<NuxtLayout>
3-
<NuxtPage v-if="rpcClient" :rpc="rpcClient" />
3+
<NuxtPage
4+
v-if="rpcClient"
5+
:rpc="rpcClient"
6+
/>
47
</NuxtLayout>
58
</template>
69

@@ -12,7 +15,7 @@ import {
1215
SliceMachineStatus,
1316
type RPCClientType,
1417
type ISlicemachineClientFunctions,
15-
type ISlicemachineServerFunctions
18+
type ISlicemachineServerFunctions,
1619
} from '../src/devtools/types'
1720
1821
const sliceMachineStatus = useSliceMachineStatus()
@@ -23,10 +26,10 @@ onDevtoolsClientConnected((client) => {
2326
rpcClient.value = client.devtools.extendClientRpc<ISlicemachineServerFunctions, ISlicemachineClientFunctions>(
2427
RPC_NAMESPACE,
2528
{
26-
updateStatus (status) {
29+
updateStatus(status) {
2730
sliceMachineStatus.value.running = status === SliceMachineStatus.STARTED
28-
}
29-
}
31+
},
32+
},
3033
)
3134
})
3235
</script>

client/components/SlicemachineStatusTip.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ const text = computed(() => {
1313
<template>
1414
<NTip :n="running ? 'green' : 'yellow'">
1515
{{ text }}
16-
<a v-if="running" target="_blank" href="http://localhost:9999">http://localhost:9999</a>
16+
<a
17+
v-if="running"
18+
target="_blank"
19+
href="http://localhost:9999"
20+
>http://localhost:9999</a>
1721
</NTip>
1822
</template>

0 commit comments

Comments
 (0)