Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,18 @@ All story files must follow `.storybook/STORY_STANDARD.md`. Key rules:
- After editing code, verify with `yarn typecheck` to catch TypeScript errors immediately.
- After completing a task or during planning, verify no circular dependencies or barrel import cycles are introduced. Use `npx madge --circular --extensions ts,vue framework/` or manual inspection of import chains.

## Documentation

`*.docs.md` files in `framework/` are the source of truth for vc-docs. The `cli/docs-sync` package transforms and publishes them.

```bash
yarn docs:lint # validate *.docs.md template compliance
yarn docs:sync # sync to ../vc-docs (must exist as a sibling checkout)
yarn docs:screenshot --story <id> --out <path>.png # capture a Storybook screenshot per style guide
```

CI auto-syncs on framework releases. See `cli/docs-sync/README.md` for details.

## Debugging Tips

- Check git history first for regression bugs: `git log --oneline -15` and `git diff HEAD~3`
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/docs-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: docs-lint

on:
pull_request:
paths:
- "framework/**/*.docs.md"
- "framework/**/*.stories.ts"
- "cli/docs-sync/**"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: corepack enable
- run: yarn install --immutable
- run: yarn workspace @vc-shell/docs-sync build
- run: yarn workspace @vc-shell/docs-sync exec docs-sync lint
56 changes: 56 additions & 0 deletions .github/workflows/sync-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Requires repository secret VC_DOCS_BOT_TOKEN — a personal access token
# (or GitHub App installation token) with write access to VirtoCommerce/vc-docs
# (specifically: contents:write and pull-requests:write).
# Set up via Settings → Secrets and variables → Actions.
name: sync-docs

on:
release:
types: [published]

jobs:
sync:
if: ${{ !github.event.release.prerelease }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: VirtoCommerce/vc-docs
path: vc-docs
token: ${{ secrets.VC_DOCS_BOT_TOKEN }}
ref: main
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: corepack enable
- run: yarn install --immutable
- run: yarn workspace @vc-shell/docs-sync build
- name: Run sync
run: |
yarn workspace @vc-shell/docs-sync exec docs-sync sync \
--target ./vc-docs \
--report ./sync-report.md
- name: Open PR
env:
GH_TOKEN: ${{ secrets.VC_DOCS_BOT_TOKEN }}
run: |
BRANCH="auto/sync-vc-shell-${{ github.event.release.tag_name }}"
cd vc-docs
if [[ -z "$(git status --porcelain)" ]]; then
echo "No changes to sync."
exit 0
fi
git checkout -b "$BRANCH"
git config user.email "bot@virto.dev"
git config user.name "vc-shell-docs-bot"
git add .
git commit -m "docs: sync from vc-shell@${{ github.event.release.tag_name }}"
git push origin "$BRANCH"
gh pr create \
--base main \
--head "$BRANCH" \
--title "docs: sync from vc-shell@${{ github.event.release.tag_name }}" \
--body-file ../sync-report.md \
--label auto-generated
Loading
Loading