Skip to content

Commit 6d16828

Browse files
author
Chris
committed
upgrading app to vue 3
1 parent 38dbfaf commit 6d16828

32 files changed

+2219
-20259
lines changed

quiz-app/.eslintrc.cjs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* eslint-env node */
2+
module.exports = {
3+
root: true,
4+
'extends': [
5+
'plugin:vue/vue3-essential',
6+
'eslint:recommended'
7+
],
8+
parserOptions: {
9+
ecmaVersion: 'latest'
10+
}
11+
}

quiz-app/.eslintrc.js

-8
This file was deleted.

quiz-app/.gitignore

+29
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
110
node_modules
11+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?
29+
30+
*.tsbuildinfo

quiz-app/.vscode/settings.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"staticWebApps.appSubpath": "/",
3-
"staticWebApps.apiSubpath": "api",
4-
"staticWebApps.outputSubpath": "dist"
5-
}
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll": "explicit"
4+
}
5+
}

quiz-app/LICENSE

-21
This file was deleted.

quiz-app/README.md

+19-97
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,35 @@
1-
# Quizzes
1+
# vue-project
22

3-
These quizzes are the pre- and post-lecture quizzes for the web development for beginners curriculum at https://aka.ms/webdev-beginners
3+
This template should help get you started developing with Vue 3 in Vite.
44

5-
## Project setup
5+
## Recommended IDE Setup
66

7-
```
8-
npm install
9-
```
7+
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
108

11-
### Compiles and hot-reloads for development
9+
## Customize configuration
1210

13-
```
14-
npm run serve
15-
```
11+
See [Vite Configuration Reference](https://vitejs.dev/config/).
1612

17-
### Compiles and minifies for production
13+
## Project Setup
1814

19-
```
20-
npm run build
15+
```sh
16+
npm install
2117
```
2218

23-
### Lints and fixes files
19+
### Compile and Hot-Reload for Development
2420

21+
```sh
22+
npm run dev
2523
```
26-
npm run lint
27-
```
28-
29-
### Customize configuration
30-
31-
See [Configuration Reference](https://cli.vuejs.org/config/).
32-
33-
Credits: Thanks to the original version of this quiz app: https://github.com/arpan45/simple-quiz-vue
34-
35-
## Deploying to Azure
3624

37-
Here’s a step-by-step guide to help you get started:
25+
### Compile and Minify for Production
3826

39-
1. Fork the a GitHub Repository
40-
Ensure your static web app code is in your GitHub repository. Fork this repository.
41-
42-
2. Create an Azure Static Web App
43-
- Create and [Azure account](http://azure.microsoft.com)
44-
- Go to the [Azure portal](https://portal.azure.com)
45-
- Click on “Create a resource” and search for “Static Web App”.
46-
- Click “Create”.
47-
48-
3. Configure the Static Web App
49-
- Basics: Subscription: Select your Azure subscription.
50-
- Resource Group: Create a new resource group or use an existing one.
51-
- Name: Provide a name for your static web app.
52-
- Region: Choose the region closest to your users.
53-
54-
- #### Deployment Details:
55-
- Source: Select “GitHub”.
56-
- GitHub Account: Authorize Azure to access your GitHub account.
57-
- Organization: Select your GitHub organization.
58-
- Repository: Choose the repository containing your static web app.
59-
- Branch: Select the branch you want to deploy from.
60-
61-
- #### Build Details:
62-
- Build Presets: Choose the framework your app is built with (e.g., React, Angular, Vue, etc.).
63-
- App Location: Specify the folder containing your app code (e.g., / if it’s in the root).
64-
- API Location: If you have an API, specify its location (optional).
65-
- Output Location: Specify the folder where the build output is generated (e.g., build or dist).
66-
67-
4. Review and Create
68-
Review your settings and click “Create”. Azure will set up the necessary resources and create a GitHub Actions workflow in your repository.
69-
70-
5. GitHub Actions Workflow
71-
Azure will automatically create a GitHub Actions workflow file in your repository (.github/workflows/azure-static-web-apps-<name>.yml). This workflow will handle the build and deployment process.
72-
73-
6. Monitor the Deployment
74-
Go to the “Actions” tab in your GitHub repository.
75-
You should see a workflow running. This workflow will build and deploy your static web app to Azure.
76-
Once the workflow completes, your app will be live on the provided Azure URL.
77-
78-
### Example Workflow File
79-
80-
Here’s an example of what the GitHub Actions workflow file might look like:
81-
name: Azure Static Web Apps CI/CD
82-
```
83-
on:
84-
push:
85-
branches:
86-
- main
87-
pull_request:
88-
types: [opened, synchronize, reopened, closed]
89-
branches:
90-
- main
91-
92-
jobs:
93-
build_and_deploy_job:
94-
runs-on: ubuntu-latest
95-
name: Build and Deploy Job
96-
steps:
97-
- uses: actions/checkout@v2
98-
- name: Build And Deploy
99-
id: builddeploy
100-
uses: Azure/static-web-apps-deploy@v1
101-
with:
102-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
103-
repo_token: ${{ secrets.GITHUB_TOKEN }}
104-
action: "upload"
105-
app_location: "/quiz-app # App source code path"
106-
api_location: ""API source code path optional
107-
output_location: "dist" #Built app content directory - optional
27+
```sh
28+
npm run build
10829
```
10930

110-
### Additional Resources
111-
- [Azure Static Web Apps Documentation](https://learn.microsoft.com/azure/static-web-apps/getting-started)
112-
- [GitHub Actions Documentation](https://docs.github.com/actions/use-cases-and-examples/deploying/deploying-to-azure-static-web-app)
31+
### Lint with [ESLint](https://eslint.org/)
11332

33+
```sh
34+
npm run lint
35+
```

quiz-app/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<link rel="icon" href="/favicon.ico">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.js"></script>
12+
</body>
13+
</html>

quiz-app/jsconfig.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"paths": {
4+
"@/*": ["./src/*"]
5+
}
6+
},
7+
"exclude": ["node_modules", "dist"]
8+
}

0 commit comments

Comments
 (0)