Skip to content

Commit

Permalink
build: migrate ecosystem into a separate repo
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Nov 29, 2023
0 parents commit 301c5d8
Show file tree
Hide file tree
Showing 309 changed files with 20,685 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const fs = require('fs')
const path = require('path')

const getSubDirectories = (dir) =>
fs
.readdirSync(dir)
.filter((item) => fs.statSync(path.join(dir, item)).isDirectory())

const pluginPackages = getSubDirectories(path.resolve(__dirname, 'plugins'))
const themePackages = getSubDirectories(path.resolve(__dirname, 'themes'))

module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [2, 'always', [...pluginPackages, ...themePackages]],
'footer-max-line-length': [0],
},
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
!.vuepress/
!.*.js
.cache/
.temp/
node_modules/
lib/
dist/
32 changes: 32 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
root: true,
extends: 'vuepress',
overrides: [
{
files: ['*.ts', '*.vue', '*.cts'],
extends: 'vuepress-typescript',
parserOptions: {
project: ['tsconfig.json'],
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'vue/multi-word-component-names': 'off',
},
},
{
files: ['**/client/config.ts'],
rules: {
'vue/match-component-file-name': 'off',
},
},
{
files: ['**/tests/**/*.ts'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'import/no-extraneous-dependencies': 'off',
'vue/one-component-per-file': 'off',
},
},
],
}
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text eol=lf
*.txt text eol=crlf

*.png binary
*.jpg binary
*.jpeg binary
*.ico binary
*.tff binary
*.woff binary
*.woff2 binary
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Bug Report
description: Create a report to help us improve
title: '[Bug report] '
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: bug-description
attributes:
label: Description
description: A clear and concise description of what the bug is. If applicable, add screenshots to help explain your problem. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: Bug description
validations:
required: true
- type: input
id: reproduction
attributes:
label: Reproduction
description: Please provide a link via [v2.vuepress.vuejs.org/new](https://v2.vuepress.vuejs.org/new) or a link to a repo that can reproduce the problem you ran into. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required.
placeholder: Reproduction
validations:
required: true
- type: dropdown
id: package-manager
attributes:
label: Used Package Manager
description: Select the used package manager
options:
- npm
- yarn
- pnpm
validations:
required: true
- type: textarea
id: system-info
attributes:
label: System Info
description: Output of `vuepress info`
render: shell
placeholder: Paste output of `vuepress info` here
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Question & Discussion
url: https://github.com/vuepress/ecosystem/discussions
about: Please ask and answer questions here.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Feature Request
description: Suggest an idea for this project
title: '[Feature request] '
body:
- type: markdown
attributes:
value: |
Thanks for your interest in the project and taking the time to fill out this feature request!
- type: textarea
id: feature-description
attributes:
label: Clear and concise description of the problem
description: As a developer using VuePress, what feature your want in details. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: Feature description
validations:
required: true
- type: textarea
id: suggested-solution
attributes:
label: Suggested solution
description: We could provide following implementation...
placeholder: Suggested solution
validations:
required: true
- type: textarea
id: alternative
attributes:
label: Alternative
description: Clear and concise description of any alternative solutions or features you've considered.
placeholder: Alternative solution
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Any other context or screenshots about the feature request here.
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Thank you for contributing! -->

### Before submitting the PR, please make sure you do the following <!-- (put an "X" next to an item) -->

- [ ] Read the [Contributing Guidelines](https://github.com/vuepress/ecosystem/blob/main/CONTRIBUTING.md).
- [ ] Provide a description in this PR that addresses **what** the PR is solving. If this PR is going to solve an existing issue, please reference the issue (e.g. `close #123`).

### What is the purpose of this pull request? <!-- (put an "X" next to an item) -->

- [ ] Bug fix
- [ ] New feature
- [ ] Other

### Description

<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->

### Screenshots

<!-- If your PR includes UI changes, please provide before/after screenshots. If there are any other images that add context to the PR, add them here as well -->

**Before**

**After**
55 changes: 55 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: check

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
workflow_dispatch:

jobs:
check:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: ['18', '20']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

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

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Lint
run: pnpm lint

- name: Test
run: pnpm test

check-result:
if: ${{ always() }}
name: check result
runs-on: ubuntu-latest
needs: [check]
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1
45 changes: 45 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: coverage

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
workflow_dispatch:

jobs:
coverage:
runs-on: ubuntu-latest

env:
NODE_VERSION: '18'

steps:
- uses: actions/checkout@v4

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build source code
run: pnpm build

- name: Test coverage
run: pnpm test:cov

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/issue-commented.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: issue-commented

on:
issue_comment:
types: [created]

jobs:
issue-commented:
name: remove stale on commented
if: contains(github.event.issue.labels.*.name, 'stale')
runs-on: ubuntu-latest
steps:
- uses: actions-cool/issues-helper@v3
with:
actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }}
labels: 'stale'
42 changes: 42 additions & 0 deletions .github/workflows/issue-daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: issue-daily

on:
schedule:
- cron: '0 0 * * *'

jobs:
issue-label-stale:
name: label stale issues
runs-on: ubuntu-latest
steps:
- uses: actions-cool/issues-helper@v3
with:
actions: 'check-inactive'
token: ${{ secrets.GITHUB_TOKEN }}
inactive-day: 15
inactive-label: 'stale'
exclude-labels: 'bug, documentation, enhancement, feature, help wanted, need reproduction, need review, stale'
body: |
This issue is marked as `stale` because it has not had recent activity. Issues marked with `stale` will be closed if they have no activity within 7 days.
issue-close-stale:
name: close stale issues
runs-on: ubuntu-latest
steps:
- uses: actions-cool/issues-helper@v3
with:
actions: 'close-issues'
token: ${{ secrets.GITHUB_TOKEN }}
labels: 'stale'
inactive-day: 7

issue-close-need-reproduction:
name: close need-reproduction issues
runs-on: ubuntu-latest
steps:
- uses: actions-cool/issues-helper@v3
with:
actions: 'close-issues'
token: ${{ secrets.GITHUB_TOKEN }}
labels: 'need reproduction'
inactive-day: 7
30 changes: 30 additions & 0 deletions .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: issue-labeled

on:
issues:
types: [labeled]

jobs:
issue-invalid:
name: close invalid issue
if: github.event.label.name == 'invalid'
runs-on: ubuntu-latest
steps:
- uses: actions-cool/issues-helper@v3
with:
actions: 'close-issue, create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Hello @${{ github.event.issue.user.login }}. This issue is marked as `invalid` and closed. Please follow the issue template.
issue-need-reproduction:
name: need reproduction
if: github.event.label.name == 'need reproduction'
runs-on: ubuntu-latest
steps:
- uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [v2.vuepress.vuejs.org/new](https://v2.vuepress.vuejs.org/new). Issues marked with `need reproduction` will be closed if they have no activity within 7 days.
Loading

0 comments on commit 301c5d8

Please sign in to comment.