Skip to content

Commit

Permalink
fix(npm): don't set default versioning (#26927)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice authored Jan 29, 2024
1 parent 9bd0bf1 commit eb782cc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 0 additions & 2 deletions lib/modules/manager/bun/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Category } from '../../../constants';
import { GithubTagsDatasource } from '../../datasource/github-tags';
import { NpmDatasource } from '../../datasource/npm';
import * as npmVersioning from '../../versioning/npm';

export { updateArtifacts } from './artifacts';
export { extractAllPackageFiles } from './extract';
Expand All @@ -12,7 +11,6 @@ export const supportsLockFileMaintenance = true;

export const defaultConfig = {
fileMatch: ['(^|/)bun\\.lockb$'],
versioning: npmVersioning.id,
digest: {
prBodyDefinitions: {
Change:
Expand Down
10 changes: 10 additions & 0 deletions lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts engine
"depType": "engines",
"packageName": "microsoft/vscode",
"prettyDepType": "engine",
"versioning": "npm",
},
],
"extractedConstraints": {
Expand Down Expand Up @@ -170,6 +171,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np
"pinDigests": false,
"prettyDepType": "dependency",
"sourceUrl": "https://github.com/owner/c",
"versioning": "npm",
},
{
"currentValue": "github:owner/d#a7g3eaf",
Expand All @@ -189,6 +191,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np
"packageName": "owner/e",
"prettyDepType": "dependency",
"sourceUrl": "https://github.com/owner/e",
"versioning": "npm",
},
{
"currentRawValue": "owner/f#v2.0.0",
Expand All @@ -201,6 +204,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np
"pinDigests": false,
"prettyDepType": "dependency",
"sourceUrl": "https://github.com/owner/f",
"versioning": "npm",
},
{
"currentValue": "gitlab:owner/g#v1.0.0",
Expand Down Expand Up @@ -241,6 +245,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np
"packageName": "owner/k",
"prettyDepType": "dependency",
"sourceUrl": "https://github.com/owner/k",
"versioning": "npm",
},
{
"currentDigest": "abcdef0",
Expand All @@ -253,6 +258,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np
"packageName": "owner/l",
"prettyDepType": "dependency",
"sourceUrl": "https://github.com/owner/l",
"versioning": "npm",
},
{
"currentRawValue": "https://github.com/owner/m.git#v1.0.0",
Expand All @@ -265,6 +271,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np
"pinDigests": false,
"prettyDepType": "dependency",
"sourceUrl": "https://github.com/owner/m",
"versioning": "npm",
},
{
"currentRawValue": "git+https://github.com/owner/n#v2.0.0",
Expand All @@ -277,6 +284,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np
"pinDigests": false,
"prettyDepType": "dependency",
"sourceUrl": "https://github.com/owner/n",
"versioning": "npm",
},
{
"currentRawValue": "[email protected]:owner/o.git#v2.0.0",
Expand All @@ -289,6 +297,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np
"pinDigests": false,
"prettyDepType": "dependency",
"sourceUrl": "https://github.com/owner/o",
"versioning": "npm",
},
{
"currentRawValue": "Owner/P.git#v2.0.0",
Expand All @@ -301,6 +310,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np
"pinDigests": false,
"prettyDepType": "dependency",
"sourceUrl": "https://github.com/Owner/P",
"versioning": "npm",
},
],
"extractedConstraints": {},
Expand Down
10 changes: 9 additions & 1 deletion lib/modules/manager/npm/extract/common/dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import { regEx } from '../../../../../util/regex';
import { GithubTagsDatasource } from '../../../../datasource/github-tags';
import { NodeVersionDatasource } from '../../../../datasource/node-version';
import { NpmDatasource } from '../../../../datasource/npm';
import { api, isValid, isVersion } from '../../../../versioning/npm';
import {
api,
isValid,
isVersion,
id as npmVersioningId,
} from '../../../../versioning/npm';
import type { PackageDependency } from '../../../types';

const RE_REPOSITORY_GITHUB_SSH_FORMAT = regEx(
Expand Down Expand Up @@ -56,6 +61,7 @@ export function extractDependency(
} else if (depName === 'vscode') {
dep.datasource = GithubTagsDatasource.id;
dep.packageName = 'microsoft/vscode';
dep.versioning = npmVersioningId;
} else {
dep.skipReason = 'unknown-engines';
}
Expand Down Expand Up @@ -161,6 +167,7 @@ export function extractDependency(
dep.currentRawValue = dep.currentValue;
dep.currentValue = depRefPart;
dep.datasource = GithubTagsDatasource.id;
dep.versioning = npmVersioningId;
dep.packageName = githubOwnerRepo;
dep.pinDigests = false;
} else if (
Expand All @@ -171,6 +178,7 @@ export function extractDependency(
dep.currentValue = null;
dep.currentDigest = depRefPart;
dep.datasource = GithubTagsDatasource.id;
dep.versioning = npmVersioningId;
dep.packageName = githubOwnerRepo;
} else {
dep.skipReason = 'unversioned-reference';
Expand Down
2 changes: 0 additions & 2 deletions lib/modules/manager/npm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Category } from '../../../constants';
import { GithubTagsDatasource } from '../../datasource/github-tags';
import { NodeVersionDatasource } from '../../datasource/node-version';
import { NpmDatasource } from '../../datasource/npm';
import * as npmVersioning from '../../versioning/npm';

export { detectGlobalConfig } from './detect';
export { extractAllPackageFiles } from './extract';
Expand All @@ -17,7 +16,6 @@ export const supportsLockFileMaintenance = true;

export const defaultConfig = {
fileMatch: ['(^|/)package\\.json$'],
versioning: npmVersioning.id,
digest: {
prBodyDefinitions: {
Change:
Expand Down

0 comments on commit eb782cc

Please sign in to comment.