cc-context-stats 1.7.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -1
- package/scripts/context-stats.sh +1 -1
- package/scripts/statusline.js +128 -18
- package/.editorconfig +0 -60
- package/.eslintrc.json +0 -35
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -49
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -31
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -33
- package/.github/dependabot.yml +0 -44
- package/.github/workflows/ci.yml +0 -294
- package/.github/workflows/release.yml +0 -151
- package/.pre-commit-config.yaml +0 -74
- package/.prettierrc +0 -33
- package/.shellcheckrc +0 -10
- package/CHANGELOG.md +0 -163
- package/CLAUDE.md +0 -66
- package/CODE_OF_CONDUCT.md +0 -59
- package/CONTRIBUTING.md +0 -240
- package/RELEASE_NOTES.md +0 -19
- package/SECURITY.md +0 -44
- package/TODOS.md +0 -72
- package/assets/logo/favicon.svg +0 -19
- package/assets/logo/logo-black.svg +0 -24
- package/assets/logo/logo-full.svg +0 -40
- package/assets/logo/logo-icon.svg +0 -27
- package/assets/logo/logo-mark.svg +0 -28
- package/assets/logo/logo-white.svg +0 -24
- package/assets/logo/logo-wordmark.svg +0 -6
- package/config/settings-example.json +0 -7
- package/config/settings-node.json +0 -7
- package/config/settings-python.json +0 -7
- package/docs/ARCHITECTURE.md +0 -128
- package/docs/CSV_FORMAT.md +0 -42
- package/docs/DEPLOYMENT.md +0 -71
- package/docs/DEVELOPMENT.md +0 -161
- package/docs/configuration.md +0 -118
- package/docs/context-stats.md +0 -143
- package/docs/installation.md +0 -255
- package/docs/scripts.md +0 -140
- package/docs/troubleshooting.md +0 -278
- package/images/claude-statusline-token-graph.gif +0 -0
- package/images/claude-statusline.png +0 -0
- package/images/context-status-dumbzone.png +0 -0
- package/images/context-status.png +0 -0
- package/images/statusline-detail.png +0 -0
- package/images/token-graph.jpeg +0 -0
- package/images/token-graph.png +0 -0
- package/images/v1.6.1.png +0 -0
- package/install +0 -351
- package/install.sh +0 -298
- package/jest.config.js +0 -11
- package/pyproject.toml +0 -115
- package/requirements-dev.txt +0 -12
- package/scripts/statusline-full.sh +0 -304
- package/scripts/statusline-git.sh +0 -88
- package/scripts/statusline-minimal.sh +0 -67
- package/scripts/statusline.py +0 -485
- package/src/claude_statusline/__init__.py +0 -11
- package/src/claude_statusline/__main__.py +0 -6
- package/src/claude_statusline/cli/__init__.py +0 -1
- package/src/claude_statusline/cli/context_stats.py +0 -512
- package/src/claude_statusline/cli/explain.py +0 -228
- package/src/claude_statusline/cli/statusline.py +0 -169
- package/src/claude_statusline/core/__init__.py +0 -1
- package/src/claude_statusline/core/colors.py +0 -124
- package/src/claude_statusline/core/config.py +0 -148
- package/src/claude_statusline/core/git.py +0 -78
- package/src/claude_statusline/core/state.py +0 -323
- package/src/claude_statusline/formatters/__init__.py +0 -1
- package/src/claude_statusline/formatters/layout.py +0 -67
- package/src/claude_statusline/formatters/time.py +0 -50
- package/src/claude_statusline/formatters/tokens.py +0 -70
- package/src/claude_statusline/graphs/__init__.py +0 -1
- package/src/claude_statusline/graphs/renderer.py +0 -366
- package/src/claude_statusline/graphs/statistics.py +0 -92
- package/src/claude_statusline/ui/__init__.py +0 -1
- package/src/claude_statusline/ui/icons.py +0 -93
- package/src/claude_statusline/ui/waiting.py +0 -62
- package/tests/bash/test_delta_parity.bats +0 -199
- package/tests/bash/test_install.bats +0 -29
- package/tests/bash/test_parity.bats +0 -315
- package/tests/bash/test_statusline_full.bats +0 -139
- package/tests/bash/test_statusline_git.bats +0 -42
- package/tests/bash/test_statusline_minimal.bats +0 -37
- package/tests/fixtures/json/comma_in_path.json +0 -31
- package/tests/fixtures/json/high_usage.json +0 -17
- package/tests/fixtures/json/low_usage.json +0 -17
- package/tests/fixtures/json/medium_usage.json +0 -17
- package/tests/fixtures/json/valid_full.json +0 -30
- package/tests/fixtures/json/valid_minimal.json +0 -9
- package/tests/node/rotation.test.js +0 -89
- package/tests/node/statusline.test.js +0 -240
- package/tests/python/conftest.py +0 -84
- package/tests/python/test_colors.py +0 -105
- package/tests/python/test_config_colors.py +0 -78
- package/tests/python/test_data_pipeline.py +0 -446
- package/tests/python/test_explain.py +0 -177
- package/tests/python/test_icons.py +0 -152
- package/tests/python/test_layout.py +0 -127
- package/tests/python/test_state_rotation_validation.py +0 -232
- package/tests/python/test_statusline.py +0 -215
- package/tests/python/test_waiting.py +0 -127
package/.github/workflows/ci.yml
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main]
|
|
8
|
-
|
|
9
|
-
concurrency:
|
|
10
|
-
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
-
cancel-in-progress: true
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
# ============================================
|
|
15
|
-
# BASH SCRIPTS - LINT AND TEST
|
|
16
|
-
# ============================================
|
|
17
|
-
bash-lint:
|
|
18
|
-
name: Bash Lint (ShellCheck)
|
|
19
|
-
runs-on: ubuntu-latest
|
|
20
|
-
steps:
|
|
21
|
-
- name: Checkout
|
|
22
|
-
uses: actions/checkout@v4
|
|
23
|
-
|
|
24
|
-
- name: Run ShellCheck
|
|
25
|
-
uses: ludeeus/action-shellcheck@master
|
|
26
|
-
with:
|
|
27
|
-
scandir: './scripts'
|
|
28
|
-
additional_files: 'install.sh'
|
|
29
|
-
severity: warning
|
|
30
|
-
format: tty
|
|
31
|
-
|
|
32
|
-
bash-test:
|
|
33
|
-
name: Bash Tests (${{ matrix.os }})
|
|
34
|
-
needs: bash-lint
|
|
35
|
-
runs-on: ${{ matrix.os }}
|
|
36
|
-
strategy:
|
|
37
|
-
fail-fast: false
|
|
38
|
-
matrix:
|
|
39
|
-
os: [ubuntu-latest, macos-latest]
|
|
40
|
-
steps:
|
|
41
|
-
- name: Checkout
|
|
42
|
-
uses: actions/checkout@v4
|
|
43
|
-
|
|
44
|
-
- name: Install jq
|
|
45
|
-
run: |
|
|
46
|
-
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
47
|
-
sudo apt-get update && sudo apt-get install -y jq
|
|
48
|
-
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
49
|
-
brew install jq
|
|
50
|
-
fi
|
|
51
|
-
|
|
52
|
-
- name: Install Bats
|
|
53
|
-
run: |
|
|
54
|
-
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
55
|
-
sudo apt-get install -y bats
|
|
56
|
-
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
57
|
-
brew install bats-core
|
|
58
|
-
fi
|
|
59
|
-
|
|
60
|
-
- name: Run Bats tests
|
|
61
|
-
run: bats tests/bash/*.bats
|
|
62
|
-
|
|
63
|
-
# ============================================
|
|
64
|
-
# PYTHON SCRIPT - LINT AND TEST
|
|
65
|
-
# ============================================
|
|
66
|
-
python-lint:
|
|
67
|
-
name: Python Lint
|
|
68
|
-
runs-on: ubuntu-latest
|
|
69
|
-
steps:
|
|
70
|
-
- name: Checkout
|
|
71
|
-
uses: actions/checkout@v4
|
|
72
|
-
|
|
73
|
-
- name: Set up Python
|
|
74
|
-
uses: actions/setup-python@v5
|
|
75
|
-
with:
|
|
76
|
-
python-version: '3.11'
|
|
77
|
-
cache: 'pip'
|
|
78
|
-
cache-dependency-path: 'requirements-dev.txt'
|
|
79
|
-
|
|
80
|
-
- name: Install dependencies
|
|
81
|
-
run: pip install -r requirements-dev.txt
|
|
82
|
-
|
|
83
|
-
- name: Run Ruff (linting)
|
|
84
|
-
run: ruff check scripts/statusline.py
|
|
85
|
-
|
|
86
|
-
- name: Run Ruff (formatting check)
|
|
87
|
-
run: ruff format --check scripts/statusline.py
|
|
88
|
-
|
|
89
|
-
- name: Run MyPy (type checking)
|
|
90
|
-
run: mypy scripts/statusline.py --ignore-missing-imports
|
|
91
|
-
|
|
92
|
-
python-test:
|
|
93
|
-
name: Python Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
|
|
94
|
-
needs: python-lint
|
|
95
|
-
runs-on: ${{ matrix.os }}
|
|
96
|
-
strategy:
|
|
97
|
-
fail-fast: false
|
|
98
|
-
matrix:
|
|
99
|
-
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
100
|
-
python-version: ['3.9', '3.10', '3.11', '3.12']
|
|
101
|
-
steps:
|
|
102
|
-
- name: Checkout
|
|
103
|
-
uses: actions/checkout@v4
|
|
104
|
-
|
|
105
|
-
- name: Set up Python ${{ matrix.python-version }}
|
|
106
|
-
uses: actions/setup-python@v5
|
|
107
|
-
with:
|
|
108
|
-
python-version: ${{ matrix.python-version }}
|
|
109
|
-
cache: 'pip'
|
|
110
|
-
cache-dependency-path: 'requirements-dev.txt'
|
|
111
|
-
|
|
112
|
-
- name: Install dependencies
|
|
113
|
-
run: |
|
|
114
|
-
pip install -r requirements-dev.txt
|
|
115
|
-
pip install -e .
|
|
116
|
-
|
|
117
|
-
- name: Run pytest with coverage
|
|
118
|
-
run: pytest tests/python/ -v --cov=scripts --cov=src --cov-report=xml --cov-report=term
|
|
119
|
-
|
|
120
|
-
- name: Upload coverage to Codecov
|
|
121
|
-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
|
|
122
|
-
uses: codecov/codecov-action@v4
|
|
123
|
-
with:
|
|
124
|
-
files: ./coverage.xml
|
|
125
|
-
flags: python
|
|
126
|
-
fail_ci_if_error: false
|
|
127
|
-
|
|
128
|
-
# ============================================
|
|
129
|
-
# NODE.JS SCRIPT - LINT AND TEST
|
|
130
|
-
# ============================================
|
|
131
|
-
node-lint:
|
|
132
|
-
name: Node.js Lint
|
|
133
|
-
runs-on: ubuntu-latest
|
|
134
|
-
steps:
|
|
135
|
-
- name: Checkout
|
|
136
|
-
uses: actions/checkout@v4
|
|
137
|
-
|
|
138
|
-
- name: Set up Node.js
|
|
139
|
-
uses: actions/setup-node@v4
|
|
140
|
-
with:
|
|
141
|
-
node-version: '20'
|
|
142
|
-
cache: 'npm'
|
|
143
|
-
|
|
144
|
-
- name: Install dependencies
|
|
145
|
-
run: npm ci
|
|
146
|
-
|
|
147
|
-
- name: Run ESLint
|
|
148
|
-
run: npx eslint scripts/statusline.js
|
|
149
|
-
|
|
150
|
-
- name: Run Prettier check
|
|
151
|
-
run: npx prettier --check scripts/statusline.js
|
|
152
|
-
|
|
153
|
-
node-test:
|
|
154
|
-
name: Node.js Tests (${{ matrix.os }}, Node ${{ matrix.node-version }})
|
|
155
|
-
needs: node-lint
|
|
156
|
-
runs-on: ${{ matrix.os }}
|
|
157
|
-
strategy:
|
|
158
|
-
fail-fast: false
|
|
159
|
-
matrix:
|
|
160
|
-
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
161
|
-
node-version: ['18', '20', '22']
|
|
162
|
-
steps:
|
|
163
|
-
- name: Checkout
|
|
164
|
-
uses: actions/checkout@v4
|
|
165
|
-
|
|
166
|
-
- name: Set up Node.js ${{ matrix.node-version }}
|
|
167
|
-
uses: actions/setup-node@v4
|
|
168
|
-
with:
|
|
169
|
-
node-version: ${{ matrix.node-version }}
|
|
170
|
-
cache: 'npm'
|
|
171
|
-
|
|
172
|
-
- name: Install dependencies
|
|
173
|
-
run: npm ci
|
|
174
|
-
|
|
175
|
-
- name: Run Jest tests
|
|
176
|
-
run: npm test -- --coverage
|
|
177
|
-
|
|
178
|
-
- name: Upload coverage to Codecov
|
|
179
|
-
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20'
|
|
180
|
-
uses: codecov/codecov-action@v4
|
|
181
|
-
with:
|
|
182
|
-
files: ./coverage/node/lcov.info
|
|
183
|
-
flags: node
|
|
184
|
-
fail_ci_if_error: false
|
|
185
|
-
|
|
186
|
-
# ============================================
|
|
187
|
-
# CROSS-IMPLEMENTATION PARITY TESTS
|
|
188
|
-
# ============================================
|
|
189
|
-
parity-test:
|
|
190
|
-
name: Parity Tests (${{ matrix.os }})
|
|
191
|
-
needs: [python-test, node-test]
|
|
192
|
-
runs-on: ${{ matrix.os }}
|
|
193
|
-
strategy:
|
|
194
|
-
fail-fast: false
|
|
195
|
-
matrix:
|
|
196
|
-
os: [ubuntu-latest, macos-latest]
|
|
197
|
-
steps:
|
|
198
|
-
- name: Checkout
|
|
199
|
-
uses: actions/checkout@v4
|
|
200
|
-
|
|
201
|
-
- name: Set up Python
|
|
202
|
-
uses: actions/setup-python@v5
|
|
203
|
-
with:
|
|
204
|
-
python-version: '3.11'
|
|
205
|
-
|
|
206
|
-
- name: Set up Node.js
|
|
207
|
-
uses: actions/setup-node@v4
|
|
208
|
-
with:
|
|
209
|
-
node-version: '20'
|
|
210
|
-
|
|
211
|
-
- name: Install Bats
|
|
212
|
-
run: |
|
|
213
|
-
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
214
|
-
sudo apt-get update && sudo apt-get install -y bats
|
|
215
|
-
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
216
|
-
brew install bats-core
|
|
217
|
-
fi
|
|
218
|
-
|
|
219
|
-
- name: Run parity tests
|
|
220
|
-
run: bats tests/bash/test_parity.bats
|
|
221
|
-
|
|
222
|
-
# ============================================
|
|
223
|
-
# INTEGRATION TESTS
|
|
224
|
-
# ============================================
|
|
225
|
-
integration-test:
|
|
226
|
-
name: Integration Tests (${{ matrix.os }})
|
|
227
|
-
needs: [bash-test, python-test, node-test]
|
|
228
|
-
runs-on: ${{ matrix.os }}
|
|
229
|
-
strategy:
|
|
230
|
-
fail-fast: false
|
|
231
|
-
matrix:
|
|
232
|
-
os: [ubuntu-latest, macos-latest]
|
|
233
|
-
steps:
|
|
234
|
-
- name: Checkout
|
|
235
|
-
uses: actions/checkout@v4
|
|
236
|
-
|
|
237
|
-
- name: Install jq
|
|
238
|
-
run: |
|
|
239
|
-
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
240
|
-
sudo apt-get update && sudo apt-get install -y jq
|
|
241
|
-
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
242
|
-
brew install jq
|
|
243
|
-
fi
|
|
244
|
-
|
|
245
|
-
- name: Set up Python
|
|
246
|
-
uses: actions/setup-python@v5
|
|
247
|
-
with:
|
|
248
|
-
python-version: '3.11'
|
|
249
|
-
|
|
250
|
-
- name: Set up Node.js
|
|
251
|
-
uses: actions/setup-node@v4
|
|
252
|
-
with:
|
|
253
|
-
node-version: '20'
|
|
254
|
-
|
|
255
|
-
- name: Run integration tests
|
|
256
|
-
run: |
|
|
257
|
-
SAMPLE_INPUT='{"model":{"display_name":"Claude 3.5 Sonnet"},"workspace":{"current_dir":"/tmp/test","project_dir":"/tmp/test"},"context_window":{"context_window_size":200000,"current_usage":{"input_tokens":1000,"cache_creation_input_tokens":500,"cache_read_input_tokens":200}}}'
|
|
258
|
-
|
|
259
|
-
echo "Testing bash scripts..."
|
|
260
|
-
echo "$SAMPLE_INPUT" | ./scripts/statusline-full.sh
|
|
261
|
-
echo "$SAMPLE_INPUT" | ./scripts/statusline-git.sh
|
|
262
|
-
echo "$SAMPLE_INPUT" | ./scripts/statusline-minimal.sh
|
|
263
|
-
|
|
264
|
-
echo "Testing Python script..."
|
|
265
|
-
echo "$SAMPLE_INPUT" | python3 ./scripts/statusline.py
|
|
266
|
-
|
|
267
|
-
echo "Testing Node.js script..."
|
|
268
|
-
echo "$SAMPLE_INPUT" | node ./scripts/statusline.js
|
|
269
|
-
|
|
270
|
-
echo "All integration tests passed!"
|
|
271
|
-
|
|
272
|
-
# ============================================
|
|
273
|
-
# FINAL STATUS CHECK
|
|
274
|
-
# ============================================
|
|
275
|
-
ci-success:
|
|
276
|
-
name: CI Success
|
|
277
|
-
needs: [bash-lint, bash-test, python-lint, python-test, node-lint, node-test, integration-test, parity-test]
|
|
278
|
-
runs-on: ubuntu-latest
|
|
279
|
-
if: always()
|
|
280
|
-
steps:
|
|
281
|
-
- name: Check all jobs passed
|
|
282
|
-
run: |
|
|
283
|
-
if [[ "${{ needs.bash-lint.result }}" != "success" ]] || \
|
|
284
|
-
[[ "${{ needs.bash-test.result }}" != "success" ]] || \
|
|
285
|
-
[[ "${{ needs.python-lint.result }}" != "success" ]] || \
|
|
286
|
-
[[ "${{ needs.python-test.result }}" != "success" ]] || \
|
|
287
|
-
[[ "${{ needs.node-lint.result }}" != "success" ]] || \
|
|
288
|
-
[[ "${{ needs.node-test.result }}" != "success" ]] || \
|
|
289
|
-
[[ "${{ needs.integration-test.result }}" != "success" ]] || \
|
|
290
|
-
[[ "${{ needs.parity-test.result }}" != "success" ]]; then
|
|
291
|
-
echo "One or more jobs failed"
|
|
292
|
-
exit 1
|
|
293
|
-
fi
|
|
294
|
-
echo "All CI jobs passed successfully!"
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*'
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
inputs:
|
|
9
|
-
version:
|
|
10
|
-
description: 'Version to release (e.g., 1.2.0)'
|
|
11
|
-
required: true
|
|
12
|
-
type: string
|
|
13
|
-
|
|
14
|
-
permissions:
|
|
15
|
-
contents: write
|
|
16
|
-
|
|
17
|
-
jobs:
|
|
18
|
-
validate:
|
|
19
|
-
name: Validate Release
|
|
20
|
-
runs-on: ubuntu-latest
|
|
21
|
-
outputs:
|
|
22
|
-
version: ${{ steps.version.outputs.version }}
|
|
23
|
-
steps:
|
|
24
|
-
- name: Checkout
|
|
25
|
-
uses: actions/checkout@v4
|
|
26
|
-
with:
|
|
27
|
-
fetch-depth: 0
|
|
28
|
-
|
|
29
|
-
- name: Determine version
|
|
30
|
-
id: version
|
|
31
|
-
run: |
|
|
32
|
-
if [[ "${{ github.event_name }}" == "push" ]]; then
|
|
33
|
-
VERSION="${GITHUB_REF#refs/tags/v}"
|
|
34
|
-
else
|
|
35
|
-
VERSION="${{ github.event.inputs.version }}"
|
|
36
|
-
fi
|
|
37
|
-
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
38
|
-
echo "Release version: $VERSION"
|
|
39
|
-
|
|
40
|
-
- name: Validate version format
|
|
41
|
-
run: |
|
|
42
|
-
VERSION="${{ steps.version.outputs.version }}"
|
|
43
|
-
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]]; then
|
|
44
|
-
echo "Invalid version format: $VERSION"
|
|
45
|
-
echo "Expected format: X.Y.Z or X.Y.Z-suffix"
|
|
46
|
-
exit 1
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
test:
|
|
50
|
-
name: Run Tests
|
|
51
|
-
needs: validate
|
|
52
|
-
runs-on: ubuntu-latest
|
|
53
|
-
steps:
|
|
54
|
-
- name: Checkout
|
|
55
|
-
uses: actions/checkout@v4
|
|
56
|
-
|
|
57
|
-
- name: Set up Python
|
|
58
|
-
uses: actions/setup-python@v5
|
|
59
|
-
with:
|
|
60
|
-
python-version: '3.11'
|
|
61
|
-
|
|
62
|
-
- name: Set up Node.js
|
|
63
|
-
uses: actions/setup-node@v4
|
|
64
|
-
with:
|
|
65
|
-
node-version: '20'
|
|
66
|
-
cache: 'npm'
|
|
67
|
-
|
|
68
|
-
- name: Install jq
|
|
69
|
-
run: sudo apt-get update && sudo apt-get install -y jq bats
|
|
70
|
-
|
|
71
|
-
- name: Install Python dependencies
|
|
72
|
-
run: |
|
|
73
|
-
pip install -r requirements-dev.txt
|
|
74
|
-
pip install -e .
|
|
75
|
-
|
|
76
|
-
- name: Install Node.js dependencies
|
|
77
|
-
run: npm ci
|
|
78
|
-
|
|
79
|
-
- name: Run Python tests
|
|
80
|
-
run: pytest tests/python/ -v
|
|
81
|
-
|
|
82
|
-
- name: Run Node.js tests
|
|
83
|
-
run: npm test
|
|
84
|
-
|
|
85
|
-
- name: Run Bash tests
|
|
86
|
-
run: bats tests/bash/*.bats
|
|
87
|
-
|
|
88
|
-
create-release:
|
|
89
|
-
name: Create GitHub Release
|
|
90
|
-
needs: [validate, test]
|
|
91
|
-
runs-on: ubuntu-latest
|
|
92
|
-
steps:
|
|
93
|
-
- name: Checkout
|
|
94
|
-
uses: actions/checkout@v4
|
|
95
|
-
with:
|
|
96
|
-
fetch-depth: 0
|
|
97
|
-
|
|
98
|
-
- name: Generate changelog
|
|
99
|
-
id: changelog
|
|
100
|
-
run: |
|
|
101
|
-
# Get commits since last tag
|
|
102
|
-
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
|
103
|
-
if [ -n "$LAST_TAG" ]; then
|
|
104
|
-
COMMITS=$(git log --pretty=format:"- %s" "$LAST_TAG"..HEAD)
|
|
105
|
-
else
|
|
106
|
-
COMMITS=$(git log --pretty=format:"- %s")
|
|
107
|
-
fi
|
|
108
|
-
|
|
109
|
-
# Create changelog
|
|
110
|
-
{
|
|
111
|
-
echo 'changelog<<EOF'
|
|
112
|
-
echo "## What's Changed"
|
|
113
|
-
echo ""
|
|
114
|
-
echo "$COMMITS"
|
|
115
|
-
echo ""
|
|
116
|
-
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${LAST_TAG}...v${{ needs.validate.outputs.version }}"
|
|
117
|
-
echo 'EOF'
|
|
118
|
-
} >> $GITHUB_OUTPUT
|
|
119
|
-
|
|
120
|
-
- name: Create Release Archive
|
|
121
|
-
run: |
|
|
122
|
-
VERSION="${{ needs.validate.outputs.version }}"
|
|
123
|
-
mkdir -p dist
|
|
124
|
-
|
|
125
|
-
# Create tarball
|
|
126
|
-
tar -czf dist/claude-statusline-${VERSION}.tar.gz \
|
|
127
|
-
scripts/ \
|
|
128
|
-
config/ \
|
|
129
|
-
install.sh \
|
|
130
|
-
README.md
|
|
131
|
-
|
|
132
|
-
# Create zip
|
|
133
|
-
zip -r dist/claude-statusline-${VERSION}.zip \
|
|
134
|
-
scripts/ \
|
|
135
|
-
config/ \
|
|
136
|
-
install.sh \
|
|
137
|
-
README.md
|
|
138
|
-
|
|
139
|
-
- name: Create GitHub Release
|
|
140
|
-
uses: softprops/action-gh-release@v2
|
|
141
|
-
with:
|
|
142
|
-
tag_name: v${{ needs.validate.outputs.version }}
|
|
143
|
-
name: Release v${{ needs.validate.outputs.version }}
|
|
144
|
-
body: ${{ steps.changelog.outputs.changelog }}
|
|
145
|
-
draft: false
|
|
146
|
-
prerelease: ${{ contains(needs.validate.outputs.version, '-') }}
|
|
147
|
-
files: |
|
|
148
|
-
dist/claude-statusline-*.tar.gz
|
|
149
|
-
dist/claude-statusline-*.zip
|
|
150
|
-
env:
|
|
151
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/.pre-commit-config.yaml
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# Pre-commit hooks for claude-statusline project
|
|
2
|
-
# Install: pip install pre-commit && pre-commit install
|
|
3
|
-
# Run all: pre-commit run --all-files
|
|
4
|
-
|
|
5
|
-
default_language_version:
|
|
6
|
-
python: python3
|
|
7
|
-
|
|
8
|
-
repos:
|
|
9
|
-
# General file checks
|
|
10
|
-
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
11
|
-
rev: v4.5.0
|
|
12
|
-
hooks:
|
|
13
|
-
- id: check-yaml
|
|
14
|
-
- id: check-json
|
|
15
|
-
- id: check-toml
|
|
16
|
-
- id: end-of-file-fixer
|
|
17
|
-
- id: trailing-whitespace
|
|
18
|
-
- id: mixed-line-ending
|
|
19
|
-
args: ['--fix=lf']
|
|
20
|
-
- id: check-executables-have-shebangs
|
|
21
|
-
- id: check-shebang-scripts-are-executable
|
|
22
|
-
- id: detect-private-key
|
|
23
|
-
- id: check-merge-conflict
|
|
24
|
-
- id: check-added-large-files
|
|
25
|
-
args: ['--maxkb=500']
|
|
26
|
-
|
|
27
|
-
# ShellCheck for bash scripts
|
|
28
|
-
- repo: https://github.com/shellcheck-py/shellcheck-py
|
|
29
|
-
rev: v0.9.0.6
|
|
30
|
-
hooks:
|
|
31
|
-
- id: shellcheck
|
|
32
|
-
args: ['--severity=warning']
|
|
33
|
-
files: \.(sh|bash)$
|
|
34
|
-
|
|
35
|
-
# Python: Ruff linter and formatter
|
|
36
|
-
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
37
|
-
rev: v0.1.14
|
|
38
|
-
hooks:
|
|
39
|
-
- id: ruff
|
|
40
|
-
args: ['--fix']
|
|
41
|
-
files: \.py$
|
|
42
|
-
- id: ruff-format
|
|
43
|
-
files: \.py$
|
|
44
|
-
|
|
45
|
-
# JavaScript: ESLint
|
|
46
|
-
- repo: https://github.com/pre-commit/mirrors-eslint
|
|
47
|
-
rev: v8.56.0
|
|
48
|
-
hooks:
|
|
49
|
-
- id: eslint
|
|
50
|
-
files: \.js$
|
|
51
|
-
types: [javascript]
|
|
52
|
-
additional_dependencies:
|
|
53
|
-
- eslint@8.56.0
|
|
54
|
-
|
|
55
|
-
# Prettier for JS, JSON, MD
|
|
56
|
-
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
57
|
-
rev: v4.0.0-alpha.8
|
|
58
|
-
hooks:
|
|
59
|
-
- id: prettier
|
|
60
|
-
types_or: [javascript, json, markdown]
|
|
61
|
-
additional_dependencies:
|
|
62
|
-
- prettier@3.2.5
|
|
63
|
-
|
|
64
|
-
# Markdown lint
|
|
65
|
-
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
66
|
-
rev: v0.39.0
|
|
67
|
-
hooks:
|
|
68
|
-
- id: markdownlint
|
|
69
|
-
args: ['--fix', '--disable', 'MD013', 'MD024', 'MD033', 'MD040', 'MD041', '--']
|
|
70
|
-
|
|
71
|
-
ci:
|
|
72
|
-
autofix_prs: true
|
|
73
|
-
autofix_commit_msg: 'style: auto-fix pre-commit issues'
|
|
74
|
-
autoupdate_schedule: monthly
|
package/.prettierrc
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"printWidth": 100,
|
|
3
|
-
"tabWidth": 4,
|
|
4
|
-
"useTabs": false,
|
|
5
|
-
"semi": true,
|
|
6
|
-
"singleQuote": true,
|
|
7
|
-
"quoteProps": "as-needed",
|
|
8
|
-
"trailingComma": "es5",
|
|
9
|
-
"bracketSpacing": true,
|
|
10
|
-
"arrowParens": "avoid",
|
|
11
|
-
"endOfLine": "lf",
|
|
12
|
-
"overrides": [
|
|
13
|
-
{
|
|
14
|
-
"files": "*.json",
|
|
15
|
-
"options": {
|
|
16
|
-
"tabWidth": 2
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"files": "*.md",
|
|
21
|
-
"options": {
|
|
22
|
-
"tabWidth": 2,
|
|
23
|
-
"proseWrap": "preserve"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"files": "*.{yml,yaml}",
|
|
28
|
-
"options": {
|
|
29
|
-
"tabWidth": 2
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
package/.shellcheckrc
DELETED