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(manager): add bun-version manager #29998

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ghislainpiot
Copy link

Changes

This PR adds a new manager : bun-version

Context

The bun manager was already quite complex, so I created a new one. However, if needed, I can try to merge my modifications in it.

Closes #29941

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

lib/modules/manager/bun-version/index.spec.ts Show resolved Hide resolved
lib/modules/manager/bun-version/index.spec.ts Show resolved Hide resolved
lib/modules/manager/bun-version/index.ts Outdated Show resolved Hide resolved
lib/modules/manager/bun-version/index.ts Show resolved Hide resolved

export const defaultConfig = {
fileMatch: ['(^|/)\\.bun-version$'],
versioning: semverVersioning.id,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
versioning: semverVersioning.id,

use the default version of the datasource

});

it('handles no newline at the end', () => {
const res = extractPackageFile('1.1.15');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the standard really require a new line at the end?

Comment on lines +30 to +35
depName: 'Bun',
packageName: 'oven-sh/bun',
currentValue: content.trim(),
datasource: GithubReleasesDatasource.id,
versioning: semverVersioning.id,
extractVersion: '^bun-v(?<version>\\S+)',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
depName: 'Bun',
packageName: 'oven-sh/bun',
currentValue: content.trim(),
datasource: GithubReleasesDatasource.id,
versioning: semverVersioning.id,
extractVersion: '^bun-v(?<version>\\S+)',
depName: 'Bun',
packageName: 'bun',
currentValue: content.trim(),
datasource: NpmDatasource.id,

Let's use the bun npm package that way we get more metadata and no extractVersion is necessary. Further also this prevent failures downstream in case there is a release but not yet a NPM package.
https://www.npmjs.com/package/bun

@@ -0,0 +1,42 @@
import type { Category } from '../../../constants';
import { GithubReleasesDatasource } from '../../datasource/github-releases';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
import { GithubReleasesDatasource } from '../../datasource/github-releases';
import { NpmDatasource } from '../../datasource/npm';

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.

Add support for .bun-version
3 participants