Skip to content

Commit

Permalink
dapplink docs init
Browse files Browse the repository at this point in the history
  • Loading branch information
guoshijiang committed Oct 5, 2024
1 parent 6d26a3a commit ea9f5b4
Show file tree
Hide file tree
Showing 251 changed files with 24,807 additions and 128 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
Empty file added .github/contributing.md
Empty file.
18 changes: 18 additions & 0 deletions .github/workflows/cr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Add continuous release label

on:
issue_comment:
types: [created]

permissions:
pull-requests: write

jobs:
label:
if: ${{ github.event.issue.pull_request && (github.event.comment.user.id == github.event.issue.user.id || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR') && startsWith(github.event.comment.body, '/publish') }}
runs-on: ubuntu-latest

steps:
- run: gh issue edit ${{ github.event.issue.number }} --add-label cr-tracked --repo ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
37 changes: 37 additions & 0 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CR

env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'

on:
pull_request:
branches: [main]
types: [opened, synchronize, labeled, ready_for_review]
paths-ignore:
- '.github/**'
- '__tests__/**'
- 'art/**'
- 'docs/**'
- '*.md'

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true

jobs:
release:
if: ${{ !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'cr-tracked') && !contains(github.event.pull_request.labels.*.name, 'spam') && !contains(github.event.pull_request.labels.*.name, 'invalid') }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install
- run: pnpm build
- run: npx pkg-pr-new publish --compact --no-template --pnpm
26 changes: 26 additions & 0 deletions .github/workflows/lock-threads.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lock Threads

on:
schedule:
- cron: 38 4 * * *
workflow_dispatch:

permissions:
issues: write
pull-requests: write
discussions: write

concurrency:
group: lock

jobs:
action:
if: github.repository == 'dapplink-labs/dapplink-docs'
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v5
with:
issue-inactive-days: 7
pr-inactive-days: 7
exclude-any-issue-labels: 'keep-open'
exclude-any-pr-labels: 'keep-open'
25 changes: 25 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
release:
if: github.repository == 'dapplink-labs/dapplink-docs'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create Release for Tag
id: release_tag
uses: yyx990803/release-tag@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
body: |
Please refer to [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details.
18 changes: 18 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Close stale issues and PRs
on:
workflow_dispatch:

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
days-before-stale: 30
days-before-close: -1
stale-issue-label: stale
stale-pr-label: stale
# action has a bug that keeps removing the stale label from stale PRs
# it's thinking that the PR is updated when the stale label is added
remove-pr-stale-when-updated: false
operations-per-run: 1000
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test

env:
NODE_OPTIONS: --max-old-space-size=6144
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
VITEST_SEGFAULT_RETRY: 3

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node_version: [18, 20, 22]

steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: pnpm

- name: Install deps
run: pnpm install

- name: Install Playwright
run: pnpm playwright install chromium

- name: Check
run: pnpm check
142 changes: 15 additions & 127 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1,18 @@
# Logs
logs
/coverage
/src/client/shared.ts
/src/node/shared.ts
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.DS_Store
.idea
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.vite_opt_cache
.vscode
dist
cache
temp
examples-temp
node_modules
pnpm-global
TODOs.md
*.timestamp-*.mjs
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shell-emulator=true
auto-install-peers=false
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.md
*.vue
dist
pnpm-lock.yaml
cache
template
temp
!CHANGELOG.md
.temp
4 changes: 4 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
semi: false
singleQuote: true
printWidth: 80
trailingComma: none
Empty file added CHANGELOG.md
Empty file.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# dapplink-docs
2 changes: 2 additions & 0 deletions bin/dapplink.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
import('../dist/node/cli.js')
5 changes: 5 additions & 0 deletions client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// re-export vite client types. with strict installers like pnpm, user won't
// be able to dapplink vite/client in project root.
/// <dapplink types="vite/client" />

export * from './dist/client/index.js'
Loading

0 comments on commit ea9f5b4

Please sign in to comment.