Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2a057c6f1 | ||
|
|
08cc6f3287 | ||
|
|
84fcc7f7e0 |
13
.github/workflows/release.yml
vendored
13
.github/workflows/release.yml
vendored
@@ -4,9 +4,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
concurrency:
|
||||
group: auto-release-${{ github.ref }}
|
||||
@@ -15,7 +12,6 @@ concurrency:
|
||||
jobs:
|
||||
release-please:
|
||||
name: Release Please
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -34,7 +30,8 @@ jobs:
|
||||
|
||||
publish-npm:
|
||||
name: Publish to npm
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
needs: release-please
|
||||
if: ${{ needs.release-please.outputs.release_created == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
environment: release
|
||||
permissions:
|
||||
@@ -44,7 +41,7 @@ jobs:
|
||||
- name: Checkout release tag
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
|
||||
with:
|
||||
ref: ${{ github.event.release.tag_name }}
|
||||
ref: ${{ needs.release-please.outputs.tag_name }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Node.js
|
||||
@@ -84,8 +81,8 @@ jobs:
|
||||
- name: Release summary
|
||||
run: |
|
||||
{
|
||||
echo "## Released ${{ github.event.release.tag_name }}"
|
||||
echo "## Released ${{ needs.release-please.outputs.tag_name }}"
|
||||
echo
|
||||
echo "- npm: https://www.npmjs.com/package/@gitlawb/openclaude"
|
||||
echo "- GitHub: https://github.com/Gitlawb/openclaude/releases/tag/${{ github.event.release.tag_name }}"
|
||||
echo "- GitHub: https://github.com/Gitlawb/openclaude/releases/tag/${{ needs.release-please.outputs.tag_name }}"
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "0.2.1"
|
||||
".": "0.2.2"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## [0.2.2](https://github.com/Gitlawb/openclaude/compare/v0.2.1...v0.2.2) (2026-04-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **read/edit:** make compact line prefix unambiguous for tab-indented files ([#613](https://github.com/Gitlawb/openclaude/issues/613)) ([08cc6f3](https://github.com/Gitlawb/openclaude/commit/08cc6f328711cd93ce9fa53351266c29a0b0a341))
|
||||
|
||||
## [0.2.1](https://github.com/Gitlawb/openclaude/compare/v0.2.0...v0.2.1) (2026-04-12)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitlawb/openclaude",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"description": "Claude Code opened to any LLM — OpenAI, Gemini, DeepSeek, Ollama, and 200+ models",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
@@ -11,7 +11,7 @@ export function getEditToolDescription(): string {
|
||||
|
||||
function getDefaultEditDescription(): string {
|
||||
const prefixFormat = isCompactLinePrefixEnabled()
|
||||
? 'line number + tab'
|
||||
? 'line number + arrow'
|
||||
: 'spaces + line number + arrow'
|
||||
const minimalUniquenessHint =
|
||||
process.env.USER_TYPE === 'ant'
|
||||
|
||||
51
src/utils/file.test.ts
Normal file
51
src/utils/file.test.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { afterEach, describe, expect, mock, test } from 'bun:test'
|
||||
|
||||
async function importFileModuleWithKillswitchEnabled(
|
||||
killswitchEnabled: boolean,
|
||||
) {
|
||||
mock.module('../services/analytics/growthbook.js', () => ({
|
||||
getFeatureValue_CACHED_MAY_BE_STALE: () => killswitchEnabled,
|
||||
}))
|
||||
|
||||
return import(`./file.js?ts=${Date.now()}-${Math.random()}`)
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
mock.restore()
|
||||
})
|
||||
|
||||
describe('addLineNumbers', () => {
|
||||
test('uses unambiguous arrow compact prefix and preserves leading tabs', async () => {
|
||||
const { addLineNumbers } = await importFileModuleWithKillswitchEnabled(false)
|
||||
|
||||
const result = addLineNumbers({
|
||||
content: '\tfirst\n\t\tsecond',
|
||||
startLine: 41,
|
||||
})
|
||||
|
||||
expect(result).toBe('41→\tfirst\n42→\t\tsecond')
|
||||
})
|
||||
|
||||
test('keeps padded arrow format when compact mode is disabled', async () => {
|
||||
const { addLineNumbers } = await importFileModuleWithKillswitchEnabled(true)
|
||||
|
||||
const result = addLineNumbers({
|
||||
content: 'alpha\nbeta',
|
||||
startLine: 1,
|
||||
})
|
||||
|
||||
expect(result).toBe(' 1→alpha\n 2→beta')
|
||||
})
|
||||
})
|
||||
|
||||
describe('stripLineNumberPrefix', () => {
|
||||
test('strips compact arrow, padded arrow, and legacy tab prefixes', async () => {
|
||||
const { stripLineNumberPrefix } = await importFileModuleWithKillswitchEnabled(
|
||||
false,
|
||||
)
|
||||
|
||||
expect(stripLineNumberPrefix('41→\tfirst')).toBe('\tfirst')
|
||||
expect(stripLineNumberPrefix(' 2→beta')).toBe('beta')
|
||||
expect(stripLineNumberPrefix('7\t\tlegacy-tab')).toBe('\tlegacy-tab')
|
||||
})
|
||||
})
|
||||
@@ -267,7 +267,7 @@ export async function suggestPathUnderCwd(
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to use the compact line-number prefix format (`N\t` instead of
|
||||
* Whether to use the compact line-number prefix format (`N→` instead of
|
||||
* ` N→`). The padded-arrow format costs 9 bytes/line overhead; at
|
||||
* 1.35B Read calls × 132 lines avg this is 2.18% of fleet uncached input
|
||||
* (bq-queries/read_line_prefix_overhead_verify.sql).
|
||||
@@ -303,7 +303,7 @@ export function addLineNumbers({
|
||||
|
||||
if (isCompactLinePrefixEnabled()) {
|
||||
return lines
|
||||
.map((line, index) => `${index + startLine}\t${line}`)
|
||||
.map((line, index) => `${index + startLine}→${line}`)
|
||||
.join('\n')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user