Skip to content

Commit d750af3

Browse files
committed
initial commit
0 parents  commit d750af3

File tree

1,203 files changed

+103033
-0
lines changed

Some content is hidden

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

1,203 files changed

+103033
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
3+
name: 🐞 Bug report
4+
about: Create a report to help us improve
5+
title: "[Bug] the title of bug report"
6+
labels: bug
7+
assignees: ''
8+
9+
---
10+
11+
#### Describe the bug
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: 🥺 Help wanted
3+
about: Confuse about the use of electron-vue-vite
4+
title: "[Help] the title of help wanted report"
5+
labels: help wanted
6+
assignees: ''
7+
8+
---
9+
10+
#### Describe the problem you confuse

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Thank you for contributing! -->
2+
3+
### Description
4+
5+
<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->
6+
7+
### What is the purpose of this pull request? <!-- (put an "X" next to an item) -->
8+
9+
- [ ] Bug fix
10+
- [ ] New Feature
11+
- [ ] Documentation update
12+
- [ ] Other

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "monthly"

.github/workflows/build.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
paths-ignore:
8+
- "**.md"
9+
- "**.spec.js"
10+
- ".idea"
11+
- ".vscode"
12+
- ".dockerignore"
13+
- "Dockerfile"
14+
- ".gitignore"
15+
- ".github/**"
16+
- "!.github/workflows/build.yml"
17+
18+
permissions:
19+
contents: write
20+
21+
jobs:
22+
build:
23+
runs-on: ${{ matrix.os }}
24+
25+
strategy:
26+
matrix:
27+
os: [macos-latest, macos-13, windows-latest]
28+
29+
steps:
30+
- name: Checkout Code
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 18
37+
38+
- name: Install Dependencies
39+
run: npm install
40+
41+
- name: Build Release Files
42+
run: npm run build
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Upload Artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: release_on_${{ matrix.os }}
50+
path: release/
51+
retention-days: 5
52+
53+
- name: Create Release
54+
if: startsWith(github.ref, 'refs/tags/')
55+
uses: softprops/action-gh-release@v1
56+
with:
57+
files: |
58+
release/*.exe
59+
release/*.dmg
60+
release/*.zip
61+
draft: false
62+
prerelease: false
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: CI
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- main
7+
8+
permissions:
9+
pull-requests: write
10+
11+
jobs:
12+
job1:
13+
name: Check Not Allowed File Changes
14+
runs-on: ubuntu-latest
15+
outputs:
16+
markdown_change: ${{ steps.filter_markdown.outputs.change }}
17+
markdown_files: ${{ steps.filter_markdown.outputs.change_files }}
18+
steps:
19+
20+
- name: Check Not Allowed File Changes
21+
uses: dorny/paths-filter@v2
22+
id: filter_not_allowed
23+
with:
24+
list-files: json
25+
filters: |
26+
change:
27+
- 'package-lock.json'
28+
- 'yarn.lock'
29+
- 'pnpm-lock.yaml'
30+
31+
# ref: https://github.com/github/docs/blob/main/.github/workflows/triage-unallowed-contributions.yml
32+
- name: Comment About Changes We Can't Accept
33+
if: ${{ steps.filter_not_allowed.outputs.change == 'true' }}
34+
uses: actions/github-script@v6
35+
with:
36+
script: |
37+
let workflowFailMessage = "It looks like you've modified some files that we can't accept as contributions."
38+
try {
39+
const badFilesArr = [
40+
'package-lock.json',
41+
'yarn.lock',
42+
'pnpm-lock.yaml',
43+
]
44+
const badFiles = badFilesArr.join('\n- ')
45+
const reviewMessage = `👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions. The complete list of files we can't accept are:\n- ${badFiles}\n\nYou'll need to revert all of the files you changed in that list using [GitHub Desktop](https://docs.github.com/en/free-pro-team@latest/desktop/contributing-and-collaborating-using-github-desktop/managing-commits/reverting-a-commit) or \`git checkout origin/main <file name>\`. Once you get those files reverted, we can continue with the review process. :octocat:\n\nMore discussion:\n- https://github.com/electron-vite/electron-vite-vue/issues/192`
46+
createdComment = await github.rest.issues.createComment({
47+
owner: context.repo.owner,
48+
repo: context.repo.repo,
49+
issue_number: context.payload.number,
50+
body: reviewMessage,
51+
})
52+
workflowFailMessage = `${workflowFailMessage} Please see ${createdComment.data.html_url} for details.`
53+
} catch(err) {
54+
console.log("Error creating comment.", err)
55+
}
56+
core.setFailed(workflowFailMessage)
57+
58+
- name: Check Not Linted Markdown
59+
if: ${{ always() }}
60+
uses: dorny/paths-filter@v2
61+
id: filter_markdown
62+
with:
63+
list-files: shell
64+
filters: |
65+
change:
66+
- added|modified: '*.md'
67+
68+
69+
job2:
70+
name: Lint Markdown
71+
runs-on: ubuntu-latest
72+
needs: job1
73+
if: ${{ always() && needs.job1.outputs.markdown_change == 'true' }}
74+
steps:
75+
- name: Checkout Code
76+
uses: actions/checkout@v3
77+
with:
78+
ref: ${{ github.event.pull_request.head.sha }}
79+
80+
- name: Lint markdown
81+
run: npx markdownlint-cli ${{ needs.job1.outputs.markdown_files }} --ignore node_modules
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Remove old artifacts
2+
3+
on:
4+
schedule:
5+
# Every day at 1am
6+
- cron: '0 1 * * *'
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
remove-old-artifacts:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
16+
# For private repos
17+
permissions:
18+
actions: write
19+
20+
steps:
21+
- name: Remove old artifacts
22+
uses: c-hive/gha-remove-artifacts@v1
23+
with:
24+
age: '2 days' # '<number> <unit>', e.g. 5 days, 2 years, 90 seconds, parsed by Moment.js
25+
# Optional inputs
26+
# skip-tags: true
27+
# skip-recent: 5

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
10+
node_modules
11+
dist
12+
!package/**/dist
13+
dist-ssr
14+
dist-electron
15+
release
16+
*.local
17+
18+
# Editor directories and files
19+
.vscode/.debug.env
20+
.idea
21+
.DS_Store
22+
*.suo
23+
*.ntvs*
24+
*.njsproj
25+
*.sln
26+
*.sw?
27+
28+
#lockfile
29+
package-lock.json
30+
pnpm-lock.yaml
31+
yarn.lock
32+
/test-results/
33+
/playwright-report/
34+
/playwright/.cache/
35+
36+
.env
37+
.env.local
38+
.env.development
39+
.env.production
40+
41+
.cursor
42+

.npmrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# For electron-builder
2+
# https://github.com/electron-userland/electron-builder/issues/6289#issuecomment-1042620422
3+
shamefully-hoist=true
4+
5+
# For China 🇨🇳 developers
6+
# electron_mirror=https://npmmirror.com/mirrors/electron/

.vscode/.debug.script.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import fs from 'node:fs'
2+
import path from 'node:path'
3+
import { fileURLToPath } from 'node:url'
4+
import { createRequire } from 'node:module'
5+
import { spawn } from 'node:child_process'
6+
7+
const pkg = createRequire(import.meta.url)('../package.json')
8+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
9+
10+
// write .debug.env
11+
const envContent = Object.entries(pkg.debug.env).map(([key, val]) => `${key}=${val}`)
12+
fs.writeFileSync(path.join(__dirname, '.debug.env'), envContent.join('\n'))
13+
14+
// bootstrap
15+
spawn(
16+
// TODO: terminate `npm run dev` when Debug exits.
17+
process.platform === 'win32' ? 'npm.cmd' : 'npm',
18+
['run', 'dev'],
19+
{
20+
stdio: 'inherit',
21+
env: Object.assign(process.env, { VSCODE_DEBUG: 'true' }),
22+
},
23+
)

0 commit comments

Comments
 (0)