Repository navigation
Conversation
…egex
parseGitHubPlugin built the per-directory matchers with
new RegExp(`^${prefix}rules/...`) where prefix is a sub-plugin dir taken
from marketplace.json plugins[].source or from the tree. Any regex
metacharacter in the dir name changed the pattern; a name like
plugins/c++ made RegExp throw "Nothing to repeat", a plain SyntaxError
that escaped parseGitHubPlugin instead of a GitHubParseError. A dot in a
dir name matched any character, and a leading ./ in source only worked
because . matched the literal dot.
pathUnder() escapes the prefix before building the RegExp, and
normalizeSubPluginDir() strips a leading ./ so that case keeps working
on purpose rather than by accident.
|
@deanrie is attempting to deploy a commit to the Anysphere Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
parseGitHubPlugindiscovers sub-plugin directories frommarketplace.jsonplugins[].sourceand from every<dir>/.cursor-plugin/plugin.jsonin the tree, then filters the tree withand the same shape for
agents/,skills/andcommands/.prefixis interpolated raw, so the directory name is read as a regex:plugins/c++(any+,(,?,[in a dir name) makesRegExpthrowInvalid regular expression: Nothing to repeat. That is a plainSyntaxError, not aGitHubParseError, so it leavesparseGitHubPluginunclassified and the import action shows a generic failure..matches any character, soplugins/foo.bar/also matchesplugins/fooXbar/../plugins/foosource was never normalized; it works today only because.matches the literal dot.Repro with a stubbed
fetch(tree and raw files for a marketplace with"source": "./plugins/c++", a command and a rule under it):Fix
pathUnder(prefix, pattern)escapes the prefix before building theRegExp; the four tree filters use it.normalizeSubPluginDir()strips a leading./and surrounding slashes, so the./form keeps working on purpose. Tree-derived dirs never had the prefix and are unchanged.Plain directory names produce the same matches as before, verified with the same stub against
./plugins/cppon both versions.Checks
The repo has no test runner, so the stub script is not committed; happy to add it if you want a place for it.
tsc --noEmit -p apps/cursor/tsconfig.jsonreports the same two pre-existingprocesstyping errors on this file as onmainand nothing new.One thing I noticed while here and did not touch: components from different sub-plugins are de-duplicated by
type:slugalone, so two sub-plugins that both shipcommands/review.mdkeep one and silently drop the other, whilehooksget a-<prefix>suffix. Whether sub-plugin components should be namespaced the same way is your call.