You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(extensions): support .extensionignore to exclude files during install
Add .extensionignore support so extension authors can exclude files and
folders from being copied when users run 'specify extension add'.
The file uses glob-style patterns (one per line), supports comments (#),
blank lines, trailing-slash directory patterns, and relative path matching.
The .extensionignore file itself is always excluded from the copy.
- Add _load_extensionignore() to ExtensionManager
- Integrate ignore function into shutil.copytree in install_from_directory
- Document .extensionignore in EXTENSION-DEVELOPMENT-GUIDE.md
- Add 6 tests covering all pattern matching scenarios
- Bump version to 0.1.14
Copy file name to clipboardExpand all lines: extensions/EXTENSION-DEVELOPMENT-GUIDE.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -332,6 +332,50 @@ echo "$config"
332
332
333
333
---
334
334
335
+
## Excluding Files with `.extensionignore`
336
+
337
+
Extension authors can create a `.extensionignore` file in the extension root to exclude files and folders from being copied when a user installs the extension with `specify extension add`. This is useful for keeping development-only files (tests, CI configs, docs source, etc.) out of the installed copy.
338
+
339
+
### Format
340
+
341
+
The file uses glob-style patterns, one per line:
342
+
343
+
- Blank lines are ignored
344
+
- Lines starting with `#` are comments
345
+
- Patterns are matched against both the file/folder name and its path relative to the extension root
346
+
- The `.extensionignore` file itself is always excluded automatically
347
+
348
+
### Example
349
+
350
+
```gitignore
351
+
# .extensionignore
352
+
353
+
# Development files
354
+
tests/
355
+
.github/
356
+
.gitignore
357
+
358
+
# Build artifacts
359
+
__pycache__/
360
+
*.pyc
361
+
dist/
362
+
363
+
# Documentation source (keep only the built README)
364
+
docs/
365
+
CONTRIBUTING.md
366
+
```
367
+
368
+
### Pattern Matching
369
+
370
+
| Pattern | Matches |
371
+
|---------|---------|
372
+
| `*.pyc` | Any `.pyc` file in any directory |
373
+
| `tests/` | The `tests` directory (and all its contents) |
0 commit comments