Skip to content

Commit af7ede7

Browse files
committed
Add Nuxt.js application structure with CI/CD workflows, Playwright tests, and image/video components
1 parent 3f5b59b commit af7ede7

File tree

15 files changed

+619
-0
lines changed

15 files changed

+619
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Node CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
# 1️⃣ Build the package and publish it as an artifact
9+
pack:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: ⬇️ Check out code
14+
uses: actions/checkout@v4
15+
16+
- name: 🟢 Set up Node 20
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20.x
20+
21+
- name: 📦 Install, build, pack
22+
run: |
23+
npm ci
24+
npm run build
25+
npm pack
26+
env:
27+
CI: true
28+
29+
- name: 📤 Upload .tgz artifact
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: imagekit-package
33+
path: imagekit-vue-*.tgz
34+
35+
# 2️⃣ Matrix job: run E2E tests for each demo app in parallel
36+
test:
37+
needs: pack # wait for the pack job
38+
runs-on: ubuntu-latest
39+
40+
strategy:
41+
matrix:
42+
app: [vue-ts, nuxt] # folders inside test-apps
43+
44+
steps:
45+
- name: ⬇️ Check out code
46+
uses: actions/checkout@v4
47+
48+
- name: 🟢 Set up Node 20
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: 20.x
52+
53+
- name: 📥 Download package artifact
54+
uses: actions/download-artifact@v4
55+
with:
56+
name: imagekit-package
57+
path: ./
58+
59+
- name: 🔧 Install app deps + local package
60+
run: |
61+
cd test-apps/${{ matrix.app }}
62+
npm ci
63+
npm install ../../imagekit-vue-*.tgz --no-save
64+
- name: 🧑‍💻 Install Playwright browsers
65+
run: npx playwright install --with-deps
66+
67+
- name: 🚀 Run E2E tests
68+
run: npm run test:e2e
69+
env:
70+
CI: true

.github/workflows/npmpublish.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node-version: [20.x]
14+
15+
steps:
16+
- uses: actions/checkout@v1
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- name: Build and Test
22+
run: |
23+
npm install
24+
npm run build
25+
npm pack
26+
cd test-app
27+
npm install
28+
npm install ../imagekit-react-*.tgz --no-save
29+
npx playwright install --with-deps
30+
npm run test:e2e
31+
env:
32+
CI: true
33+
34+
35+
publish:
36+
needs: build
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v1
40+
- uses: actions/setup-node@v1
41+
with:
42+
node-version: 20
43+
registry-url: https://registry.npmjs.org/
44+
- name: NPM Publish
45+
run: |
46+
npm install
47+
npm run build
48+
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
49+
# print the NPM user name for validation
50+
npm whoami
51+
VERSION=$(node -p "require('./package.json').version" )
52+
# Only publish stable versions to the latest tag
53+
if [[ "$VERSION" =~ ^[^-]+$ ]]; then
54+
NPM_TAG="latest"
55+
else
56+
NPM_TAG="beta"
57+
fi
58+
echo "Publishing $VERSION with $NPM_TAG tag."
59+
npm publish --tag $NPM_TAG --access public
60+
env:
61+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
62+
CI: true

test-apps/nuxt/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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
25+
26+
package-lock.json

test-apps/nuxt/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Nuxt Minimal Starter
2+
3+
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
4+
5+
## Setup
6+
7+
Make sure to install 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 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 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 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.

test-apps/nuxt/app.vue

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

0 commit comments

Comments
 (0)