Skip to content
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

feat(fvm): Support v3 config file #27216

Closed

Conversation

provokateurin
Copy link

Changes

fvm v3 has a new config file at .fvmrc and uses a slightly different syntax in the config file.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Signed-off-by: provokateurin <kate@provokateurin.de>
lib/modules/manager/fvm/extract.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/fvm/index.ts Outdated Show resolved Hide resolved
lib/modules/manager/fvm/extract.ts Outdated Show resolved Hide resolved
export function extractPackageFile(
content: string,
packageFile: string,
): PackageFileContent | null {
let fvmConfig: FvmConfig;
let fvmConfig: any;
Copy link
Member

Choose a reason for hiding this comment

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

no any! use zod Schema

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, can you elaborate? I have little experience Typescript and none with zod.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

We also have some developer documentation for Zod here:

https://github.com/renovatebot/renovate/blob/main/docs/development/zod.md

@@ -6,6 +6,6 @@ export { extractPackageFile } from './extract';
export const supportedDatasources = [FlutterVersionDatasource.id];

export const defaultConfig = {
fileMatch: ['(^|/)\\.fvm/fvm_config\\.json$'],
fileMatch: ['(^|/)\\.fvm(?:/fvm_config\\.json|rc)$'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Split this in two different regexes for better readability:

Suggested change
fileMatch: ['(^|/)\\.fvm(?:/fvm_config\\.json|rc)$'],
fileMatch: [
'(^|/)\\.fvm/fvm_config\\.json$',
'(^|/)\\.fvmrc$'
],

export function extractPackageFile(
content: string,
packageFile: string,
): PackageFileContent | null {
let fvmConfig: FvmConfig;
let fvmConfig: any;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

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

@viceice @secustor I think we're stuck on zod here. The current fvm doesn't use it, so we aren't really going backwards by not using it for this PR, are we?

@viceice
Copy link
Member

viceice commented Mar 18, 2024

@viceice @secustor I think we're stuck on zod here. The current fvm doesn't use it, so we aren't really going backwards by not using it for this PR, are we?

in current state we're going back because of any usage instead of types.

@provokateurin
Copy link
Author

Sorry I didn't have the time to work on this. I will try to have a look again soon.

@Laennart Laennart mentioned this pull request Apr 25, 2024
6 tasks
@provokateurin
Copy link
Author

#28665 Ok so someone did it already. Thanks @Laennart! (I was about to revive this PR)

@provokateurin provokateurin deleted the feat/fvm/v3-config-file branch May 5, 2024 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants