Skip to content

Commit

Permalink
refactor(deps-edn): use autoReplace (#5910)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Apr 8, 2020
1 parent b34018b commit 05a1178
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 52 deletions.
12 changes: 0 additions & 12 deletions lib/manager/deps-edn/__snapshots__/extract.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,84 +7,72 @@ Object {
"currentValue": "0.1.2",
"datasource": "clojure",
"depName": "persistent-sorted-set:persistent-sorted-set",
"fileReplacePosition": 53,
"registryUrls": Array [],
},
Object {
"currentValue": "1.9.0",
"datasource": "clojure",
"depName": "org.clojure:clojure",
"fileReplacePosition": 147,
"registryUrls": Array [],
},
Object {
"currentValue": "1.10.0",
"datasource": "clojure",
"depName": "org.clojure:clojure",
"fileReplacePosition": 241,
"registryUrls": Array [],
},
Object {
"currentValue": "1.10.520",
"datasource": "clojure",
"depName": "org.clojure:clojurescript",
"fileReplacePosition": 389,
"registryUrls": Array [],
},
Object {
"currentValue": "0.2.11",
"datasource": "clojure",
"depName": "org.clojure:tools.namespace",
"fileReplacePosition": 451,
"registryUrls": Array [],
},
Object {
"currentValue": "1.10.520",
"datasource": "clojure",
"depName": "org.clojure:clojurescript",
"fileReplacePosition": 584,
"registryUrls": Array [],
},
Object {
"currentValue": "0.0-389",
"datasource": "clojure",
"depName": "lambdaisland:kaocha",
"fileReplacePosition": 644,
"registryUrls": Array [],
},
Object {
"currentValue": "0.0-21",
"datasource": "clojure",
"depName": "lambdaisland:kaocha-cljs",
"fileReplacePosition": 703,
"registryUrls": Array [],
},
Object {
"currentValue": "0.21.1",
"datasource": "clojure",
"depName": "cider:cider-nrepl",
"fileReplacePosition": 810,
"registryUrls": Array [],
},
Object {
"currentValue": "0.6.0",
"datasource": "clojure",
"depName": "nrepl:nrepl",
"fileReplacePosition": 870,
"registryUrls": Array [],
},
Object {
"currentValue": "0.2.11",
"datasource": "clojure",
"depName": "org.clojure:tools.namespace",
"fileReplacePosition": 929,
"registryUrls": Array [],
},
Object {
"currentValue": "0.9.5703",
"datasource": "clojure",
"depName": "com.datomic:datomic-free",
"fileReplacePosition": 1141,
"registryUrls": Array [],
},
],
Expand Down
4 changes: 0 additions & 4 deletions lib/manager/deps-edn/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ export function extractPackageFile(content: string): PackageFile {
let offset = 0;
while (match) {
const [wholeSubstr, depName, currentValue] = match;
const fileReplacePosition =
offset + match.index + wholeSubstr.indexOf(currentValue);

offset += match.index + wholeSubstr.length;
rest = content.slice(offset);
match = regex.exec(rest);
Expand All @@ -22,7 +19,6 @@ export function extractPackageFile(content: string): PackageFile {
datasource: datasourceClojure.id,
depName: expandDepName(depName),
currentValue,
fileReplacePosition,
registryUrls: [],
});
}
Expand Down
5 changes: 3 additions & 2 deletions lib/manager/deps-edn/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as mavenVersioning from '../../versioning/maven';
import { extractPackageFile } from './extract';
import { updateDependency } from './update';

export { extractPackageFile, updateDependency };
export { extractPackageFile };

export const autoReplace = true;

export const defaultConfig = {
fileMatch: ['(^|/)deps\\.edn$'],
Expand Down
25 changes: 0 additions & 25 deletions lib/manager/deps-edn/update.spec.ts

This file was deleted.

9 changes: 0 additions & 9 deletions lib/manager/deps-edn/update.ts

This file was deleted.

0 comments on commit 05a1178

Please sign in to comment.