-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
git
committed
Sep 17, 2024
0 parents
commit d6037a0
Showing
174 changed files
with
48,722 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml, yaml}] | ||
indent_size = 4 | ||
|
||
[*.{less, css}] | ||
indent_size = 4 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
|
||
name: 🐞 Bug report | ||
about: Create a report to help us improve | ||
title: "[Bug] the title of bug report" | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
#### Describe the bug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: 🥺 Help wanted | ||
about: Confuse about the use of electron-vue-vite | ||
title: "[Help] the title of help wanted report" | ||
labels: help wanted | ||
assignees: '' | ||
|
||
--- | ||
|
||
#### Describe the problem you confuse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- Thank you for contributing! --> | ||
|
||
### Description | ||
|
||
<!-- Please insert your description here and provide especially info about the "what" this PR is solving --> | ||
|
||
### What is the purpose of this pull request? <!-- (put an "X" next to an item) --> | ||
|
||
- [ ] Bug fix | ||
- [ ] New Feature | ||
- [ ] Documentation update | ||
- [ ] Other |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "monthly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
tags: | ||
- v*.*.* | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
arch: [arm64, amd64] | ||
- os: macos-latest | ||
arch: [arm64, amd64] | ||
- os: windows-latest | ||
arch: [arm64, amd64] | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Build Release Files | ||
run: npm run build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Release Assets | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
draft: false | ||
prerelease: false | ||
fail_on_unmatched_files: false | ||
files: | | ||
dist-release/*.exe | ||
dist-release/*.dmg | ||
dist-release/*.AppImage | ||
dist-release/*.deb | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request_target: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
job1: | ||
name: Check Not Allowed File Changes | ||
runs-on: ubuntu-latest | ||
outputs: | ||
markdown_change: ${{ steps.filter_markdown.outputs.change }} | ||
markdown_files: ${{ steps.filter_markdown.outputs.change_files }} | ||
steps: | ||
|
||
- name: Check Not Allowed File Changes | ||
uses: dorny/paths-filter@v2 | ||
id: filter_not_allowed | ||
with: | ||
list-files: json | ||
filters: | | ||
change: | ||
- 'package-lock.json' | ||
- 'yarn.lock' | ||
- 'pnpm-lock.yaml' | ||
# ref: https://github.com/github/docs/blob/main/.github/workflows/triage-unallowed-contributions.yml | ||
- name: Comment About Changes We Can't Accept | ||
if: ${{ steps.filter_not_allowed.outputs.change == 'true' }} | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
let workflowFailMessage = "It looks like you've modified some files that we can't accept as contributions." | ||
try { | ||
const badFilesArr = [ | ||
'package-lock.json', | ||
'yarn.lock', | ||
'pnpm-lock.yaml', | ||
] | ||
const badFiles = badFilesArr.join('\n- ') | ||
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` | ||
createdComment = await github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.number, | ||
body: reviewMessage, | ||
}) | ||
workflowFailMessage = `${workflowFailMessage} Please see ${createdComment.data.html_url} for details.` | ||
} catch(err) { | ||
console.log("Error creating comment.", err) | ||
} | ||
core.setFailed(workflowFailMessage) | ||
- name: Check Not Linted Markdown | ||
if: ${{ always() }} | ||
uses: dorny/paths-filter@v2 | ||
id: filter_markdown | ||
with: | ||
list-files: shell | ||
filters: | | ||
change: | ||
- added|modified: '*.md' | ||
job2: | ||
name: Lint Markdown | ||
runs-on: ubuntu-latest | ||
needs: job1 | ||
if: ${{ always() && needs.job1.outputs.markdown_change == 'true' }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Lint markdown | ||
run: npx markdownlint-cli ${{ needs.job1.outputs.markdown_files }} --ignore node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
dist-electron | ||
dist-release | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/.debug.env | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# lockfile | ||
package-lock.json | ||
pnpm-lock.yaml | ||
yarn.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# For electron-builder | ||
# https://github.com/electron-userland/electron-builder/issues/6289#issuecomment-1042620422 | ||
shamefully-hoist=true | ||
|
||
# For China 🇨🇳 developers | ||
electron_mirror=https://npmmirror.com/mirrors/electron/ | ||
electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import fs from 'node:fs' | ||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
import { createRequire } from 'node:module' | ||
import { spawn } from 'node:child_process' | ||
|
||
const pkg = createRequire(import.meta.url)('../package.json') | ||
const __dirname = path.dirname(fileURLToPath(import.meta.url)) | ||
|
||
// write .debug.env | ||
const envContent = Object.entries(pkg.debug.env).map(([key, val]) => `${key}=${val}`) | ||
fs.writeFileSync(path.join(__dirname, '.debug.env'), envContent.join('\n')) | ||
|
||
// bootstrap | ||
spawn( | ||
// TODO: terminate `npm run dev` when Debug exits. | ||
process.platform === 'win32' ? 'npm.cmd' : 'npm', | ||
['run', 'dev'], | ||
{ | ||
stdio: 'inherit', | ||
env: Object.assign(process.env, { VSCODE_DEBUG: 'true' }), | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"Vue.volar", | ||
"Vue.vscode-typescript-vue-plugin" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"compounds": [ | ||
{ | ||
"name": "Debug App", | ||
"preLaunchTask": "Before Debug", | ||
"configurations": [ | ||
"Debug Main Process", | ||
"Debug Renderer Process" | ||
], | ||
"presentation": { | ||
"hidden": false, | ||
"group": "", | ||
"order": 1 | ||
}, | ||
"stopAll": true | ||
} | ||
], | ||
"configurations": [ | ||
{ | ||
"name": "Debug Main Process", | ||
"type": "node", | ||
"request": "launch", | ||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", | ||
"windows": { | ||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd" | ||
}, | ||
"runtimeArgs": [ | ||
"--remote-debugging-port=9229", | ||
"." | ||
], | ||
"envFile": "${workspaceFolder}/.vscode/.debug.env", | ||
"console": "integratedTerminal" | ||
}, | ||
{ | ||
"name": "Debug Renderer Process", | ||
"port": 9229, | ||
"request": "attach", | ||
"type": "chrome", | ||
"timeout": 60000, | ||
"skipFiles": [ | ||
"<node_internals>/**", | ||
"${workspaceRoot}/node_modules/**", | ||
"${workspaceRoot}/dist-electron/**", | ||
// Skip files in host(VITE_DEV_SERVER_URL) | ||
"http://127.0.0.1:3344/**" | ||
] | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"typescript.tsc.autoDetect": "off", | ||
"json.schemas": [ | ||
{ | ||
"fileMatch": [ | ||
"/*electron-builder.json5", | ||
"/*electron-builder.json" | ||
], | ||
"url": "https://json.schemastore.org/electron-builder" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Before Debug", | ||
"type": "shell", | ||
"command": "node .vscode/.debug.script.mjs", | ||
"isBackground": true, | ||
"problemMatcher": { | ||
"owner": "typescript", | ||
"fileLocation": "relative", | ||
"pattern": { | ||
// TODO: correct "regexp" | ||
"regexp": "^([a-zA-Z]\\:\/?([\\w\\-]\/?)+\\.\\w+):(\\d+):(\\d+): (ERROR|WARNING)\\: (.*)$", | ||
"file": 1, | ||
"line": 3, | ||
"column": 4, | ||
"code": 5, | ||
"message": 6 | ||
}, | ||
"background": { | ||
"activeOnStart": true, | ||
"beginsPattern": "^.*VITE v.* ready in \\d* ms.*$", | ||
"endsPattern": "^.*\\[startup\\] Electron App.*$" | ||
} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.