Fix josh-proxy rejecting stored filter path with slash
Josh-proxy's parser treats "/" in :+ paths as a filter separator, so :+.josh-filters/backend fails. Use flat naming at repo root: .josh-filter-<target>.josh referenced as :+.josh-filter-<target>. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -541,7 +541,7 @@ targets:
|
||||
|
||||
### How it works
|
||||
|
||||
When `exclude` is present, josh-sync generates a `.josh-filters/<target>.josh` file containing a [josh stored filter](https://josh-project.github.io/josh/reference/filters.html) with `:exclude` clauses:
|
||||
When `exclude` is present, josh-sync generates a `.josh-filter-<target>.josh` file at the monorepo root containing a [josh stored filter](https://josh-project.github.io/josh/reference/filters.html) with `:exclude` clauses:
|
||||
|
||||
```
|
||||
:/services/billing:exclude[
|
||||
@@ -551,6 +551,8 @@ When `exclude` is present, josh-sync generates a `.josh-filters/<target>.josh` f
|
||||
]
|
||||
```
|
||||
|
||||
The file is referenced in the josh-proxy URL as `:+.josh-filter-<target>` (flat naming — josh-proxy's parser treats `/` in `:+` paths as a filter separator, so subdirectory paths don't work).
|
||||
|
||||
Josh-proxy reads this file from the monorepo and applies the filter at the transport layer. This means:
|
||||
- **Forward sync**: the filtered clone already excludes the files
|
||||
- **Reverse sync**: pushes through josh also respect the exclusion
|
||||
@@ -572,11 +574,11 @@ Josh uses `::` patterns inside `:exclude[...]`:
|
||||
### Setup
|
||||
|
||||
1. Add `exclude` to the target in `.josh-sync.yml`
|
||||
2. Run `josh-sync preflight` — this generates `.josh-filters/<target>.josh`
|
||||
3. Commit the generated file: `git add .josh-filters/ && git commit`
|
||||
2. Run `josh-sync preflight` — this generates `.josh-filter-<target>.josh`
|
||||
3. Commit the generated file: `git add .josh-filter-*.josh && git commit`
|
||||
4. Forward sync will now exclude the specified files
|
||||
|
||||
If you change the `exclude` list, re-run `preflight` and commit the updated `.josh-filters/` file.
|
||||
If you change the `exclude` list, re-run `preflight` and commit the updated `.josh-filter-*.josh` file.
|
||||
|
||||
## Adding a New Target
|
||||
|
||||
|
||||
Reference in New Issue
Block a user