Skip to content

feat: move rule parsing to config-yaml #6138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 17, 2025
Merged

feat: move rule parsing to config-yaml #6138

merged 13 commits into from
Jun 17, 2025

Conversation

Patrick-Erichsen
Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen commented Jun 16, 2025

Consolidates rule parsing functionality by moving it from the core config module to the shared config-yaml package.

Copy link

netlify bot commented Jun 16, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit eaca464
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/6850af6e0c85e00008eb2f88

Copy link

recurseml bot commented Jun 16, 2025

⚠️ Only 5 files will be analyzed due to processing limits.

Copy link

recurseml bot commented Jun 16, 2025

😱 Found 2 issues. Time to roll up your sleeves! 😱

@Patrick-Erichsen Patrick-Erichsen marked this pull request as ready for review June 16, 2025 16:25
@Patrick-Erichsen Patrick-Erichsen requested a review from a team as a code owner June 16, 2025 16:25
@Patrick-Erichsen Patrick-Erichsen requested review from sestinj and removed request for a team June 16, 2025 16:25
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jun 16, 2025
@@ -1,10 +1,17 @@
{
"name": "@continuedev/config-yaml",
"version": "1.0.88",
"version": "1.0.92",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder to publish this new version once we merge

Comment on lines +8 to +14
"exports": {
".": {
"browser": "./dist/browser.js",
"node": "./dist/index.js",
"default": "./dist/index.js"
}
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add this because I updated unrollAssistant to include logic from our new config-yaml/markdown folder. unrollAssistant is included in registryClient, which uses node APIs, so we needed a separate entrypoint for browser envs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! This is something I didn't know about, and had needed this before

Comment on lines +516 to +520
parsedYaml = {
name: rule.name,
version: "1.0.0",
rules: [rule],
};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We map markdown rules to yaml rules for now

Comment on lines 52 to 60
// TODO: What should be required?
export const rulesJsonSchema = z.object({
name: z.string(),
version: z.string(),
author: z.string().optional(),
license: z.string().optional(),
rules: z.record(z.string(), z.string()).optional(),
});

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is where we want to define this, but I'd like to have the types available for use on the hub

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far I'm defining it in a JSON schema here: https://github.com/continuedev/rules-cli/blob/main/internal/validation/schema/rules-schema.json because we'll need it for both CLI and other things. Might not be necessary to define this here. Just making a note to myself here

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Jun 16, 2025
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 16, 2025
Copy link
Contributor

@sestinj sestinj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a few changes to address small bugs, but the design choices here are fine and it's well tested

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 17, 2025
@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Jun 17, 2025
@sestinj sestinj merged commit e310b06 into main Jun 17, 2025
66 of 68 checks passed
@sestinj sestinj deleted the pe/rule-updates-2 branch June 17, 2025 03:35
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Jun 17, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants