Skip to content

Commit

Permalink
init: Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
WRXinYue committed Jan 10, 2024
1 parent 6751de1 commit ca912af
Show file tree
Hide file tree
Showing 74 changed files with 7,652 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: YunYouJun
custom: https://sponsors.yunyoujun.cn
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- name: Install
run: pnpm install

- name: Lint
run: pnpm run lint

# typecheck:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: pnpm/action-setup@v2
# - uses: actions/setup-node@v3
# with:
# node-version: 16.x
# cache: pnpm

# - name: Install
# run: pnpm install

# - name: Typecheck
# run: pnpm run typecheck

# check windows build
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest, windows-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
cache: pnpm

- name: Install
run: pnpm install

- name: Build
run: pnpm run build

- name: Build:demo
run: pnpm run build:demo
37 changes: 37 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: GitHub Pages

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- name: Install
run: pnpm install

- name: Build Theme
run: pnpm run build

- name: Build Demo
run: pnpm run build:demo

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./demo/dist
force_orphan: true
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: true

# after pnpm
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
cache: pnpm

- run: pnpm run build
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
- run: pnpm ci:publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# custom
package-lock.json
yarn.lock

pnpm-global

# vite plugin
components.d.ts
auto-imports.d.ts

.vite-ssg-dist
.vite-ssg-temp

dist/
dist-ssr
*.local

temp/

# local env files
.env.local
.env.*.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Dependencies
node_modules/

# Coverage
coverage

# Transpiled files
build/

# JetBrains IDEs
.idea/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Misc
.DS_Store

# plugins
.VSCodeCounter
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shamefully-hoist=true
ignore-workspace-root-check=true
strict-peer-dependencies=false
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"recommendations": [
"antfu.iconify",
"antfu.unocss",
"antfu.vite",
"antfu.goto-alias",
"csstools.postcss",
"dbaeumer.vscode-eslint",
"vue.volar",
"lokalise.i18n-ally",
"streetsidesoftware.code-spell-checker"
]
}
44 changes: 44 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"cSpell.words": [
"algoliasearch",
"instantsearch",
"valaxy",
"valaxyjs",
"beian"
],
"i18n-ally.sourceLanguage": "en",
"i18n-ally.keystyle": "nested",
"i18n-ally.localesPaths": ["./locales"],
"i18n-ally.sortKeys": true,
"files.associations": {
"*.css": "postcss"
},
"[scss]": {
"editor.formatOnSave": true
},
"svg.preview.background": "editor",

// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,
// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}
15 changes: 15 additions & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# vite-ssg
.vite-ssg-dist
.vite-ssg-temp

temp/

.DS_Store
*.local
dist
dist-ssr
node_modules
.idea/
*.log

components.d.ts
2 changes: 2 additions & 0 deletions demo/locales/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docs:
view_docs: See Docs
2 changes: 2 additions & 0 deletions demo/locales/zh-CN.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docs:
view_docs: 查看文档指南
18 changes: 18 additions & 0 deletions demo/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[build.environment]
# bypass npm auto install
NPM_FLAGS = "--version"
NODE_VERSION = "16"

[build]
publish = "dist"
command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200

[[headers]]
for = "/manifest.webmanifest"
[headers.values]
Content-Type = "application/manifest+json"
19 changes: 19 additions & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"private": true,
"scripts": {
"build": "npm run build:ssg && npm run rss",
"build:spa": "valaxy build",
"build:ssg": "valaxy build --ssg",
"dev": "valaxy",
"rss": "valaxy rss",
"serve": "vite preview"
},
"dependencies": {
"valaxy": "^0.15.10",
"valaxy-theme-sakura": "workspace:*"
},
"devDependencies": {
"nodemon": "^3.0.1",
"vite-plugin-inspect": "^0.7.41"
}
}
7 changes: 7 additions & 0 deletions demo/pages/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: 关于
---

About

<!-- more -->
6 changes: 6 additions & 0 deletions demo/pages/archives/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
layout: archives
title: 归档
nav: false
comment: false
---
9 changes: 9 additions & 0 deletions demo/pages/categories/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: categories
nav: false
toc: false
icon: i-ri-folder-2-line
# You can custom title
# title: 云游的小分类
# comment: false
---
5 changes: 5 additions & 0 deletions demo/pages/notes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Dev Notes
---

How about writing some dev notes?
Loading

0 comments on commit ca912af

Please sign in to comment.