Skip to content

Commit 2f485ec

Browse files
committed
chore: initial commit
0 parents  commit 2f485ec

File tree

90 files changed

+15584
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+15584
-0
lines changed

.commitlintrc.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Commitlint configuration for conventional commits
2+
# Based on: https://www.conventionalcommits.org/
3+
4+
extends:
5+
- '@commitlint/config-conventional'
6+
7+
rules:
8+
# Type enum - allowed commit types
9+
type-enum:
10+
- 2 # Level: error
11+
- always
12+
- # Allowed types:
13+
- feat # New feature
14+
- fix # Bug fix
15+
- docs # Documentation only changes
16+
- style # Code style changes (formatting, missing semi-colons, etc)
17+
- refactor # Code refactoring (neither fixes a bug nor adds a feature)
18+
- perf # Performance improvements
19+
- test # Adding or updating tests
20+
- build # Changes to build system or dependencies
21+
- ci # CI/CD configuration changes
22+
- chore # Other changes that don't modify src or test files
23+
- revert # Revert a previous commit
24+
25+
# Type case should be lowercase
26+
type-case:
27+
- 2
28+
- always
29+
- lower-case
30+
31+
# Type must not be empty
32+
type-empty:
33+
- 2
34+
- never
35+
36+
# Scope case should be lowercase
37+
scope-case:
38+
- 2
39+
- always
40+
- lower-case
41+
42+
# Subject must not be empty
43+
subject-empty:
44+
- 2
45+
- never
46+
47+
# Subject must not end with a period
48+
subject-full-stop:
49+
- 2
50+
- never
51+
- '.'
52+
53+
# Disable subject-case to allow uppercase abbreviations (PR, API, CLI, etc.)
54+
subject-case:
55+
- 0
56+
57+
# Header (first line) max length
58+
header-max-length:
59+
- 2
60+
- always
61+
- 72
62+
63+
# Body should have a blank line before it
64+
body-leading-blank:
65+
- 1 # Warning level
66+
- always
67+
68+
# Footer should have a blank line before it
69+
footer-leading-blank:
70+
- 1 # Warning level
71+
- always
72+
73+
# Body max line length
74+
body-max-line-length:
75+
- 1 # Warning level
76+
- always
77+
- 100
78+
79+
# Help URL shown in error messages
80+
helpUrl: 'https://www.conventionalcommits.org/'

.editorconfig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# EditorConfig - https://editorconfig.org
2+
3+
root = true
4+
5+
# All files
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = crlf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
# TypeScript/JavaScript files
15+
[*.{ts,tsx,js,jsx,mjs,cjs}]
16+
indent_size = 4
17+
18+
# JSON/YAML files
19+
[*.{json,yml,yaml}]
20+
indent_size = 2
21+
22+
# Markdown files
23+
[*.md]
24+
trim_trailing_whitespace = false
25+
26+
# Package files
27+
[package.json]
28+
indent_size = 2
29+
30+
# Config files (use LF for cross-platform tools)
31+
[*.{yml,yaml,sh}]
32+
end_of_line = lf

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Auto detect text files and normalize line endings
2+
* text=auto eol=crlf
3+
4+
# TypeScript/JavaScript source files
5+
*.ts text eol=crlf
6+
*.tsx text eol=crlf
7+
*.js text eol=crlf
8+
*.jsx text eol=crlf
9+
*.mjs text eol=crlf
10+
*.cjs text eol=crlf
11+
12+
# Config files (use LF for cross-platform tools)
13+
*.md text eol=lf
14+
*.yml text eol=lf
15+
*.yaml text eol=lf
16+
*.json text eol=lf
17+
*.sh text eol=lf

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, reopened, synchronize]
7+
paths:
8+
- 'src/**'
9+
- 'package.json'
10+
- 'package-lock.json'
11+
- 'tsconfig.json'
12+
- '.github/workflows/build.yml'
13+
push:
14+
branches:
15+
- main
16+
paths:
17+
- 'src/**'
18+
- 'package.json'
19+
- 'package-lock.json'
20+
- 'tsconfig.json'
21+
- '.github/workflows/build.yml'
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
cache: 'npm'
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Run linting
40+
run: npm run lint
41+
42+
- name: Run tests
43+
run: npm run test
44+
45+
- name: Build extension
46+
run: npm run build
47+
48+
- name: Package VSIX
49+
run: npx @vscode/vsce package
50+
51+
- name: Upload VSIX artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: vsix
55+
path: '*.vsix'

.github/workflows/commit-lint.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Lint Commit Messages
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened, synchronize]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: read
10+
11+
jobs:
12+
lint-pr-title:
13+
name: Lint PR Title
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
24+
- name: Install commitlint
25+
run: |
26+
npm install --save-dev @commitlint/[email protected] @commitlint/[email protected]
27+
28+
- name: Validate PR title
29+
env:
30+
PR_TITLE: ${{ github.event.pull_request.title }}
31+
run: |
32+
echo "Validating PR title: $PR_TITLE"
33+
echo "$PR_TITLE" | npx commitlint --verbose
34+
35+
commitlint:
36+
name: Lint Commit Messages
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0 # Fetch all history for all branches and tags
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: '20'
48+
49+
- name: Install commitlint
50+
run: |
51+
npm install --save-dev @commitlint/[email protected] @commitlint/[email protected]
52+
53+
- name: Validate PR commits
54+
run: |
55+
# Get the base branch (usually main)
56+
BASE_SHA=$(git merge-base origin/${{ github.base_ref }} HEAD)
57+
58+
# Lint all commits in the PR
59+
npx commitlint --from $BASE_SHA --to HEAD --verbose

.github/workflows/contributors.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Update Contributors
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
contributors:
10+
uses: CodingWithCalvin/.github/.github/workflows/contributors.yml@main
11+
secrets: inherit
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Preview Changelog
2+
3+
run-name: Preview release notes for next release
4+
5+
on:
6+
workflow_dispatch:
7+
8+
jobs:
9+
preview:
10+
name: Preview
11+
uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main
12+
secrets: inherit

.github/workflows/publish.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Publish to VS Code Marketplace
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version bump type'
8+
required: true
9+
default: 'patch'
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
16+
permissions:
17+
contents: write
18+
actions: read
19+
20+
jobs:
21+
publish:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
version: ${{ steps.version.outputs.version }}
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: '20'
36+
cache: 'npm'
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Run tests
42+
run: npm run test
43+
44+
- name: Build extension
45+
run: npm run build
46+
47+
- name: Bump version
48+
run: npm version ${{ inputs.version }} --no-git-tag-version
49+
50+
- name: Get new version
51+
id: version
52+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
53+
54+
- name: Package VSIX
55+
run: npx @vscode/vsce package
56+
57+
- name: Publish to VS Code Marketplace
58+
run: npx @vscode/vsce publish -p ${{ secrets.VS_PAT }}
59+
60+
- name: Upload VSIX artifact
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: vsix
64+
path: '*.vsix'
65+
66+
- name: Commit version bump
67+
run: |
68+
git config user.name "github-actions[bot]"
69+
git config user.email "github-actions[bot]@users.noreply.github.com"
70+
git add package.json package-lock.json
71+
git commit -m "chore: bump version to ${{ steps.version.outputs.version }} [skip ci]"
72+
git tag "v${{ steps.version.outputs.version }}"
73+
git push
74+
git push --tags
75+
76+
changelog:
77+
needs: publish
78+
uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main
79+
secrets: inherit
80+
81+
release:
82+
needs: [publish, changelog]
83+
runs-on: ubuntu-latest
84+
permissions:
85+
contents: write
86+
steps:
87+
- name: Download VSIX artifact
88+
uses: actions/download-artifact@v4
89+
with:
90+
name: vsix
91+
92+
- name: Create GitHub Release
93+
uses: softprops/action-gh-release@v1
94+
with:
95+
tag_name: v${{ needs.publish.outputs.version }}
96+
name: v${{ needs.publish.outputs.version }}
97+
body: ${{ needs.changelog.outputs.changelog }}
98+
files: '*.vsix'

0 commit comments

Comments
 (0)