Skip to content

Commit 3feca42

Browse files
committed
Move to nuxt3
Signed-off-by: Piotr Karpala <[email protected]>
1 parent 5076a1f commit 3feca42

File tree

83 files changed

+13690
-12013
lines changed

Some content is hidden

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

83 files changed

+13690
-12013
lines changed

.browserslistrc

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

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ infra/
2424
/test-results-docker/
2525
test-results-docker-ent/
2626
test-results-docker-org/
27+
28+
.nuxt/
29+
.output/
30+
.vscode/
31+
dist/

.env

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
# Determines if mocked data should be used instead of making API calls.
2-
VUE_APP_MOCKED_DATA=true
2+
NUXT_PUBLIC_IS_DATA_MOCKED=false
33

44
# Determines the scope of the API calls.
55
# Can be 'enterprise' or 'organization' to target API calls to an enterprise or an organization respectively.
6-
VUE_APP_SCOPE=organization
6+
NUXT_PUBLIC_SCOPE=organization
77

88
# Determines the enterprise or organization name to target API calls.
9-
VUE_APP_GITHUB_ORG=octodemo
9+
NUXT_PUBLIC_GITHUB_ORG=cody-test-org
1010

11-
VUE_APP_GITHUB_ENT=
11+
NUXT_PUBLIC_GITHUB_ENT=
1212

1313
# Determines the team name if exists to target API calls.
14-
VUE_APP_GITHUB_TEAM=
14+
NUXT_PUBLIC_GITHUB_TEAM=
15+
16+
NUXT_PUBLIC_USING_GITHUB_AUTH=false
1517

1618
# Determines the GitHub Personal Access Token to use for API calls.
1719
# Create with scopes copilot, manage_billing:copilot or manage_billing:enterprise, read:enterprise AND read:org
18-
VUE_APP_GITHUB_TOKEN=
20+
# NUXT_GITHUB_TOKEN=<TOKEN>
1921

20-
# GitHub Api Url
21-
# for proxy api - set to /api/github defaults to https://api.github.com
22-
VUE_APP_GITHUB_API=
22+
NUXT_SESSION_PASSWORD=something_long_and_random
2323

24-
# Random string used in API to secure session, use when VUE_APP_GITHUB_API=/api/github
25-
#SESSION_SECRET=randomstring
24+
# for Github OAuth
25+
NUXT_OAUTH_GITHUB_CLIENT_ID=
26+
NUXT_OAUTH_GITHUB_CLIENT_SECRET=

.eslintrc.js

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

.gitignore

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
1-
.DS_Store
2-
node_modules
3-
/dist
4-
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
58

6-
# local env files
7-
.env.local
8-
.env.*.local
9+
# Node dependencies
10+
node_modules
911

10-
# Log files
11-
npm-debug.log*
12-
yarn-debug.log*
13-
yarn-error.log*
14-
pnpm-debug.log*
12+
# Logs
13+
logs
14+
*.log
1515

16-
# Editor directories and files
16+
# Misc
17+
.DS_Store
18+
.fleet
1719
.idea
18-
.vscode
19-
*.suo
20-
*.ntvs*
21-
*.njsproj
22-
*.sln
23-
*.sw?
24-
.azure
25-
26-
api/public
27-
test.http
2820

29-
/playwright-report/
30-
/blob-report/
31-
/playwright/.cache/
21+
# Local env files
22+
.env
23+
.env.*
24+
!.env.example
3225

33-
/test-results/
34-
/test-results-docker/
35-
test-results-docker-ent/
36-
test-results-docker-org/
26+
# Playwright
27+
playwright-report
28+
playwright-logs
29+
test-results

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Run nuxt",
11+
"runtimeExecutable": "nuxt",
12+
"cwd": "${workspaceFolder}",
13+
"args": []
14+
},
15+
{
16+
"type": "node-terminal",
17+
"name": "Run Script: dev",
18+
"request": "launch",
19+
"command": "npm run dev",
20+
"cwd": "${workspaceFolder}"
21+
}
22+
]
23+
}

Dockerfile

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,55 @@
11
# Stage 1: Build the Vue.js application
2+
# mode can be 'prod' - default or 'playwright'
3+
# for 'playwright' mode, the final image will be base-playwright
4+
# for 'prod' mode, the final image will be base-prod
5+
# build with 'docker build -t copilot-metrics-pw --build-arg mode=playwright .'
6+
# build with 'docker build -t copilot-metrics .' for production
7+
ARG mode=prod
8+
29
FROM node:23-alpine AS build-stage
10+
11+
USER node
312
WORKDIR /app
4-
COPY package*.json ./
5-
RUN npm install
6-
COPY . .
13+
14+
COPY --chown=1000:1000 package*.json ./
15+
RUN npm ci
16+
COPY --chown=1000:1000 . .
717
RUN npm run build
818

9-
# Stage 2: Serve the application with Nginx
10-
FROM nginx:1.27 AS production-stage
19+
# Stage 2: Prepare the Node.js API
20+
FROM node:23-alpine AS base-prod
21+
22+
WORKDIR /app
23+
COPY --chown=1000:1000 --from=build-stage /app/.output /app
24+
25+
# Expose the port your API will run on
26+
EXPOSE 3000
27+
28+
USER node
29+
CMD ["node", "/app/server/index.mjs"]
30+
31+
#-----------------------------------
32+
FROM mcr.microsoft.com/playwright:v1.49.1 AS base-playwright
33+
34+
WORKDIR /pw
35+
36+
RUN apt-get update && \
37+
apt-get install -y --no-install-recommends gettext-base && \
38+
apt-get clean && \
39+
rm -rf /var/lib/apt/lists/*
40+
41+
COPY --chown=1000:1000 --from=base-prod /app /app
42+
COPY --chown=1000:1000 e2e-tests ./e2e-tests
43+
COPY --chown=1000:1000 playwright.config.ts playwright.docker.config.ts tsconfig.json package*.json ./
44+
45+
RUN npm install --only=dev
46+
47+
# RUN npx playwright install --with-deps
48+
# this isn't a secret - it's only used in Playwright tests
49+
ENV NUXT_SESSION_PASSWORD=foo-foo-foo-foo-foo-foo-foo-foo-foo-foo-foo-foo
50+
# ENV CI=true
51+
52+
ENTRYPOINT [ "npx", "playwright", "test", "-c", "playwright.docker.config.ts" ]
1153

12-
COPY --from=build-stage /app/dist /usr/share/nginx/html
13-
COPY --from=build-stage /app/dist/assets/app-config.js /usr/share/nginx/html-template/app-config.template.js
14-
COPY ./docker-entrypoint.d/*.sh /docker-entrypoint.d/
15-
RUN chmod +x /docker-entrypoint.d/*.sh
16-
EXPOSE 80
17-
CMD ["nginx", "-g", "daemon off;"]
54+
#-----------------------------------
55+
FROM base-${mode} AS final

api.Dockerfile

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

api/.env

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

api/docker-entrypoint.api/entrypoint.sh

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

0 commit comments

Comments
 (0)