Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fu050409 committed Nov 18, 2024
0 parents commit fa5720f
Show file tree
Hide file tree
Showing 48 changed files with 9,114 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .changes/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"gitSiteUrl": "https://github.com/swpu-acm/algohub.git/",
"changeTags": {
"feat": "New Features",
"fix": "Bug Fixes",
"perf": "Performance Improvements",
"chore": "Chores",
"refactor": "Refactors"
},
"packages": {
"algohub": {
"path": "./src-tauri",
"publish": "echo 'Ignored publish to registries."
}
}
}
30 changes: 30 additions & 0 deletions .changes/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Changes

> via <https://github.com/jbolda/covector>
As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes.

When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process.

Use the following format:

```md
---
"package-a": patch
"package-b": minor
---

Change summary goes here
```

Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed.

Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/).

Given a version number MAJOR.MINOR.PATCH, increment the:

- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing).
10 changes: 10 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"words": [
"algohub",
"primevue",
"SWPU",
"tailwindcss",
"toastservice",
"usetoast"
]
}
18 changes: 18 additions & 0 deletions .github/workflows/covector-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Covector status
on: [pull_request]

jobs:
covector:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required for use of git history
- name: covector status
uses: jbolda/covector/packages/[email protected]
id: covector
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: 'status'
comment: true
96 changes: 96 additions & 0 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Version or publish

on:
push:
branches:
- main

permissions:
# required for npm provenance
id-token: write
# required to create the GitHub Release
contents: write
# required for creating the Version Packages Release
pull-requests: write

jobs:
version-or-publish:
runs-on: ubuntu-latest
timeout-minutes: 65
outputs:
change: ${{ steps.covector.outputs.change }}
commandRan: ${{ steps.covector.outputs.commandRan }}
releaseId: ${{ steps.covector.outputs.releaseId }}
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required for use of git history
- uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- name: covector version or publish (publish when no change files present)
uses: jbolda/covector/packages/[email protected]
id: covector
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: "version-or-publish"
createRelease: true
recognizeContributors: true
- name: Create Pull Request With Versions Bumped
id: cpr
uses: peter-evans/create-pull-request@v6
if: steps.covector.outputs.commandRan == 'version'
with:
title: "release: bump version"
commit-message: "chore: publish new versions"
labels: "version updates"
branch: "release"
body: ${{ steps.covector.outputs.change }}

release-tauri:
needs: version-or-publish
runs-on: ubuntu-latest
if: needs.version-or-publish.outputs.successfulPublish == 'true'
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest" # for Arm based macs (M1 and above).
args: "--target aarch64-apple-darwin"
- platform: "macos-latest" # for Intel based macs.
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
args: ""
- platform: "windows-latest"
args: ""
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install frontend dependencies
run: pnpm install
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.version-or-publish.outputs.releaseId }}
args: ${{ matrix.args }}
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# unplugin-vue-components
components.d.ts
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"Vue.volar",
"tauri-apps.tauri-vscode",
"rust-lang.rust-analyzer"
]
}
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Tauri + Vue + TypeScript

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)

## Type Support For `.vue` Imports in TS

Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's Take Over mode by following these steps:

1. Run `Extensions: Show Built-in Extensions` from VS Code's command palette, look for `TypeScript and JavaScript Language Features`, then right click and select `Disable (Workspace)`. By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.

You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AlgoHub</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions input.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "algohub",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview",
"tauri": "tauri"
},
"dependencies": {
"@primevue/forms": "^4.2.2",
"@primevue/themes": "^4.2.2",
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-shell": "^2",
"axios": "^1.7.7",
"primevue": "^4.2.2",
"vue": "^3.3.4",
"vue-router": "^4.4.5",
"zod": "^3.23.8"
},
"devDependencies": {
"@primevue/auto-import-resolver": "^4.2.2",
"@tauri-apps/cli": "^2",
"@types/node": "^22.9.0",
"@vitejs/plugin-vue": "^5.0.5",
"covector": "^0.12.3",
"tailwindcss": "^3.4.15",
"typescript": "^5.2.2",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.3.1",
"vue-tsc": "^2.0.22"
}
}
Loading

0 comments on commit fa5720f

Please sign in to comment.