Skip to content

Commit d3ba1e3

Browse files
nullvariantclaude
andauthored
feat: add npm workspaces and developer quick start (#199)
* feat: add npm workspaces and developer quick start - Add npm workspaces configuration to root package.json - Add lint:all, test:all, compile:all, watch:all scripts - Add .nvmrc with Node.js 20 - Add Quick Start for Developers section to README - Add Extension Initialization Flow diagram (Mermaid) 🖥️ IDE: [Cursor](https://cursor.sh) 🔌 Extension: [Claude Code](https://claude.ai/download) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Model-Raw: claude-opus-4-5-20251101 * fix(ci): use workspace-specific npm ci for extension isolation - Change npm ci to npm ci --workspace=git-id-switcher in all workflows - Use matrix variable in hash-check.yml for future extension support - Ensures each extension's CI runs independently without interference 🖥️ IDE: [Cursor](https://cursor.sh) 🔌 Extension: [Claude Code](https://claude.ai/download) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Model-Raw: claude-opus-4-5-20251101 * fix(ci): restore original workflow structure and handle husky in CI - Revert workflows to working-directory approach (pre-workspace change) - Add || true to prepare script to handle husky absence in CI - CI runs npm ci in extensions/git-id-switcher directory - Local development still works with npm workspaces from root 🖥️ IDE: [Cursor](https://cursor.sh) 🔌 Extension: [Claude Code](https://claude.ai/download) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Model-Raw: claude-opus-4-5-20251101 * fix(package): add --no-dependencies flag to vsce package Prevents vsce from traversing workspace dependencies in npm workspaces environment, which caused invalid relative path errors when packaging. 🖥️ IDE: [Cursor](https://cursor.sh) 🔌 Extension: [Claude Code](https://claude.ai/download) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Model-Raw: claude-opus-4-5-20251101 --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c17a7a6 commit d3ba1e3

6 files changed

Lines changed: 6875 additions & 5 deletions

File tree

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,49 @@ VS Code extensions by [Null;Variant](https://github.com/nullvariant).
4040

4141
<img src="https://assets.nullvariant.com/nullvariant-vscode-extensions/extensions/git-id-switcher/images/demo.png" width="600" alt="Git ID Switcher Demo">
4242

43+
## Quick Start for Developers
44+
45+
Get started in 5 steps:
46+
47+
```bash
48+
# 1. Clone
49+
git clone https://github.com/nullvariant/nullvariant-vscode-extensions.git
50+
cd nullvariant-vscode-extensions
51+
52+
# 2. Install dependencies (from repository root)
53+
npm install
54+
55+
# 3. Compile
56+
npm run compile:all
57+
58+
# 4. Run tests
59+
npm run test:all
60+
61+
# 5. Start watch mode for development
62+
npm run watch:all
63+
```
64+
65+
For linting: `npm run lint:all`
66+
67+
## Extension Initialization Flow
68+
69+
```mermaid
70+
flowchart TD
71+
A[Extension Activated] --> B{Workspace Trusted?}
72+
B -->|No| C[Restricted Mode]
73+
B -->|Yes| D[initializeState]
74+
D --> E{Saved Identity?}
75+
E -->|Yes| I[Apply Identity]
76+
E -->|No| F{Detect from Git Config?}
77+
F -->|Yes| I
78+
F -->|No| G{Detect from SSH Agent?}
79+
G -->|Yes| I
80+
G -->|No| H[No Identity]
81+
I --> J[Update Status Bar]
82+
H --> J
83+
J --> K[Ready]
84+
```
85+
4386
## Development
4487

4588
### Prerequisites

extensions/git-id-switcher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271
"test:coverage": "npm run compile && npx c8 --reporter=lcov --reporter=text node out/test/runTests.js",
272272
"test:fuzz": "npm run compile && node -e \"require('./out/test/validation.fuzz.test').runFuzzingTests()\"",
273273
"test:e2e": "npm run compile && vscode-test",
274-
"package": "vsce package",
274+
"package": "vsce package --no-dependencies",
275275
"publish": "echo '❌ Do not use vsce publish directly. Push a tag instead: git tag git-id-switcher-vX.X.X && git push --tags' && exit 1",
276276
"generate:readme": "node scripts/generate-root-readme.js"
277277
},

extensions/git-id-switcher/src/documentation.internal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const DOCUMENT_HASHES: Record<string, string> = {
5858
'extensions/git-id-switcher/LICENSE': 'e2383295422577622666fa2ff00e5f03abd8f2772d74cca5d5443020ab23d03d',
5959
'extensions/git-id-switcher/README.md': 'cc8dc766afdd43c1fb9051b5270617382c845ebabd103654f190ce63850e3c6e',
6060
'LICENSE': 'e2383295422577622666fa2ff00e5f03abd8f2772d74cca5d5443020ab23d03d',
61-
'README.md': '65c7c62bae6132227288b5a230c21b9be5591f5e55da9143f0f7405e9e6bb190',
61+
'README.md': 'e6c0c4e5924873eabd0e49973e29457abc5e8171ba4ff9da77700e6a19c28f9d',
6262
'SECURITY.md': '72dbadafd9a5caaa4e16f6b1f19a5255f7f84310432bf3c8207c163f5f8088da',
6363
};
6464

0 commit comments

Comments
 (0)