Skip to content

Commit cb90ab7

Browse files
authored
feat: Add in plugin for Nuxt (#121)
Add in new plugin bringing direct support for Nuxt. GH #97
1 parent 5f68b60 commit cb90ab7

File tree

67 files changed

+7601
-820
lines changed

Some content is hidden

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

67 files changed

+7601
-820
lines changed

.changeset/little-knives-hunt.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@codecov/bundler-plugin-core": patch
3+
"@codecov/webpack-plugin": patch
4+
"@codecov/rollup-plugin": patch
5+
"@codecov/nuxt-plugin": patch
6+
"@codecov/vite-plugin": patch
7+
---
8+
9+
Add in a new plugin specifically for Nuxt

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const config = {
2727
"./tsconfig.json",
2828
"./integration-tests/tsconfig.json",
2929
"./packages/bundler-plugin-core/tsconfig.json",
30+
"./packages/nuxt-plugin/tsconfig.json",
3031
"./packages/rollup-plugin/tsconfig.json",
3132
"./packages/vite-plugin/tsconfig.json",
3233
"./packages/webpack-plugin/tsconfig.json",

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,21 +195,21 @@ jobs:
195195
with:
196196
token: ${{ secrets.CODECOV_ORG_TOKEN }}
197197
url: ${{ secrets.CODECOV_URL }}
198-
198+
199199
- name: Upload coverage reports to codecov (Staging)
200200
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
201201
uses: codecov/codecov-action@v4
202202
with:
203203
token: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }}
204204
url: ${{ secrets.CODECOV_STAGING_URL }}
205-
205+
206206
- name: Upload test result reports to codecov
207207
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
208208
uses: codecov/test-results-action@v1
209209
with:
210210
token: ${{ secrets.CODECOV_ORG_TOKEN }}
211211
url: ${{ secrets.CODECOV_URL }}
212-
212+
213213
- name: Upload test result reports to codecov (Staging)
214214
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
215215
uses: codecov/test-results-action@v1
@@ -279,7 +279,7 @@ jobs:
279279
strategy:
280280
fail-fast: false
281281
matrix:
282-
example: ["next-js", "rollup", "vite", "webpack"]
282+
example: ["next-js", "nuxt", "rollup", "vite", "webpack"]
283283
steps:
284284
- name: Checkout
285285
uses: actions/checkout@v4
@@ -342,7 +342,7 @@ jobs:
342342
strategy:
343343
fail-fast: false
344344
matrix:
345-
example: ["next-js", "rollup", "vite", "webpack"]
345+
example: ["next-js", "nuxt", "rollup", "vite", "webpack"]
346346
steps:
347347
- name: Checkout
348348
uses: actions/checkout@v4
@@ -408,6 +408,7 @@ jobs:
408408
package:
409409
[
410410
"bundler-plugin-core",
411+
"nuxt-plugin",
411412
"rollup-plugin",
412413
"vite-plugin",
413414
"webpack-plugin",
@@ -471,6 +472,7 @@ jobs:
471472
package:
472473
[
473474
"bundler-plugin-core",
475+
"nuxt-plugin",
474476
"rollup-plugin",
475477
"vite-plugin",
476478
"webpack-plugin",

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"vitest.disableWorkspaceWarning": true
3+
}

examples/next-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@codecov/nextjs-plugin-example",
2+
"name": "@codecov/example-nextjs-app",
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {

examples/nuxt/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
8+
9+
# Node dependencies
10+
node_modules
11+
12+
# Logs
13+
logs
14+
*.log
15+
16+
# Misc
17+
.DS_Store
18+
.fleet
19+
.idea
20+
21+
# Local env files
22+
.env
23+
.env.*
24+
!.env.example

examples/nuxt/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Nuxt 3 Minimal Starter
2+
3+
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
4+
5+
## Setup
6+
7+
Make sure to install the dependencies:
8+
9+
```bash
10+
# npm
11+
npm install
12+
13+
# pnpm
14+
pnpm install
15+
16+
# yarn
17+
yarn install
18+
19+
# bun
20+
bun install
21+
```
22+
23+
## Development Server
24+
25+
Start the development server on `http://localhost:3000`:
26+
27+
```bash
28+
# npm
29+
npm run dev
30+
31+
# pnpm
32+
pnpm run dev
33+
34+
# yarn
35+
yarn dev
36+
37+
# bun
38+
bun run dev
39+
```
40+
41+
## Production
42+
43+
Build the application for production:
44+
45+
```bash
46+
# npm
47+
npm run build
48+
49+
# pnpm
50+
pnpm run build
51+
52+
# yarn
53+
yarn build
54+
55+
# bun
56+
bun run build
57+
```
58+
59+
Locally preview production build:
60+
61+
```bash
62+
# npm
63+
npm run preview
64+
65+
# pnpm
66+
pnpm run preview
67+
68+
# yarn
69+
yarn preview
70+
71+
# bun
72+
bun run preview
73+
```
74+
75+
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

examples/nuxt/app.vue

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

examples/nuxt/nuxt.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// https://nuxt.com/docs/api/configuration/nuxt-config
2+
export default defineNuxtConfig({
3+
devtools: { enabled: true },
4+
modules: [
5+
[
6+
"@codecov/nuxt-plugin",
7+
{
8+
dryRun: true,
9+
enableBundleAnalysis: true,
10+
bundleName: "@codecov/example-nuxt-app",
11+
uploadToken: process.env.VITE_UPLOAD_TOKEN,
12+
apiUrl: process.env.VITE_API_URL,
13+
},
14+
],
15+
],
16+
});

examples/nuxt/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "@codecov/example-nuxt-app",
3+
"private": true,
4+
"type": "module",
5+
"scripts": {
6+
"build": "nuxt prepare && nuxt build",
7+
"dev": "nuxt dev",
8+
"generate": "nuxt generate",
9+
"preview": "nuxt preview"
10+
},
11+
"dependencies": {
12+
"nuxt": "^3.11.2",
13+
"vue": "^3.4.21",
14+
"vue-router": "^4.3.0"
15+
},
16+
"devDependencies": {
17+
"@codecov/nuxt-plugin": "workspace:^"
18+
}
19+
}

0 commit comments

Comments
 (0)