Skip to content

Commit

Permalink
fix(git): avoid reading files concurrently
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Nov 2, 2023
1 parent 6e0a76e commit ff430fc
Show file tree
Hide file tree
Showing 13 changed files with 241 additions and 278 deletions.
31 changes: 31 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 14 additions & 22 deletions lib/__snapshots__/file_test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,51 +1,43 @@
export const snapshot = {};

snapshot[`writeAll > direct import 1`] = `
'import { VERSION } from "https://deno.land/std@0.204.0/version.ts";
import { createGraph } from "https://deno.land/x/deno_graph@0.59.1/mod.ts";
'import { VERSION } from "https://deno.land/std@0.205.0/version.ts";
import { createGraph } from "https://deno.land/x/deno_graph@0.59.2/mod.ts";
import { emojify } from "npm:node-emoji@2.1.0";
import { noop } from "./lib.ts";
'
import { noop } from "./lib.ts";'
`;

snapshot[`writeAll > direct import 2`] = `
'import { VERSION } from "https://deno.land/std@0.204.0/version.ts";
export const noop = () => {};
'
'import { VERSION } from "https://deno.land/std@0.205.0/version.ts";
export const noop = () => {};'
`;

snapshot[`writeAll > import map 1`] = `
'{
"imports": {
"std/": "https://deno.land/std@0.200.0/",
"deno_graph": "https://deno.land/x/deno_graph@0.59.1/mod.ts",
"deno_graph": "https://deno.land/x/deno_graph@0.59.2/mod.ts",
"node-emoji": "npm:node-emoji@2.1.0",
"/": "./"
}
}'
`;

snapshot[`writeAll > import map 2`] = `
'import { VERSION } from "https://deno.land/std@0.204.0/version.ts";
export const noop = () => {};
'
'import { VERSION } from "https://deno.land/std@0.205.0/version.ts";
export const noop = () => {};'
`;

snapshot[`writeAll > import map with no resolve 1`] = `
'import {} from "https://deno.land/std@0.204.0/version.ts";
'
`;
snapshot[`writeAll > import map with no resolve 1`] = `'import {} from "https://deno.land/std@0.205.0/version.ts";'`;

snapshot[`writeAll > unversioned specifiers 1`] = `
'import { VERSION } from "https://deno.land/std@0.204.0/version.ts";
import { createGraph } from "https://deno.land/x/deno_graph@0.59.1/mod.ts";
'import { VERSION } from "https://deno.land/std@0.205.0/version.ts";
import { createGraph } from "https://deno.land/x/deno_graph@0.59.2/mod.ts";
import { emojify } from "npm:node-emoji@2.1.0";
import { noop } from "./lib.ts";
'
import { noop } from "./lib.ts";'
`;

snapshot[`writeAll > unversioned specifiers 2`] = `
'import { VERSION } from "https://deno.land/std@0.204.0/version.ts";
export const noop = () => {};
'
'import { VERSION } from "https://deno.land/std@0.205.0/version.ts";
export const noop = () => {};'
`;
40 changes: 0 additions & 40 deletions lib/__snapshots__/git_test.ts.snap

This file was deleted.

73 changes: 23 additions & 50 deletions lib/__snapshots__/update_test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,64 @@ export const snapshot = {};
snapshot[`_create > https://deno.land/std 1`] = `
{
code: {
span: undefined,
span: {},
specifier: "https://deno.land/std@0.1.0/version.ts",
},
name: "deno.land/std",
path: "/version.ts",
specifier: {
from: "https://deno.land/std@0.1.0/version.ts",
to: "https://deno.land/std@0.204.0/version.ts",
to: "https://deno.land/std@0.205.0/version.ts",
},
version: {
from: "0.1.0",
to: "0.204.0",
to: "0.205.0",
},
}
`;

snapshot[`_create > https://deno.land/std - unversioned 1`] = `
{
code: {
span: undefined,
span: {},
specifier: "https://deno.land/std/version.ts",
},
name: "deno.land/std",
path: "/version.ts",
specifier: {
from: "https://deno.land/std/version.ts",
to: "https://deno.land/std@0.204.0/version.ts",
to: "https://deno.land/std@0.205.0/version.ts",
},
version: {
from: undefined,
to: "0.204.0",
to: "0.205.0",
},
}
`;

snapshot[`_create > https://deno.land/x/deno_graph 1`] = `
{
code: {
span: undefined,
span: {},
specifier: "https://deno.land/x/deno_graph@0.1.0/mod.ts",
},
name: "deno.land/x/deno_graph",
path: "/mod.ts",
specifier: {
from: "https://deno.land/x/deno_graph@0.1.0/mod.ts",
to: "https://deno.land/x/deno_graph@0.59.1/mod.ts",
to: "https://deno.land/x/deno_graph@0.59.2/mod.ts",
},
version: {
from: "0.1.0",
to: "0.59.1",
to: "0.59.2",
},
}
`;

snapshot[`_create > npm:node-emoji 1`] = `
{
code: {
span: undefined,
span: {},
specifier: "npm:node-emoji@1.0.0",
},
name: "node-emoji",
Expand All @@ -79,7 +79,7 @@ snapshot[`_create > npm:node-emoji 1`] = `
snapshot[`_create > npm:node-emoji - unversioned 1`] = `
{
code: {
span: undefined,
span: {},
specifier: "npm:node-emoji",
},
name: "node-emoji",
Expand Down Expand Up @@ -114,11 +114,11 @@ snapshot[`collect > direct import 1`] = `
path: "/version.ts",
specifier: {
from: "https://deno.land/std@0.200.0/version.ts",
to: "https://deno.land/std@0.204.0/version.ts",
to: "https://deno.land/std@0.205.0/version.ts",
},
version: {
from: "0.200.0",
to: "0.204.0",
to: "0.205.0",
},
}
`;
Expand All @@ -142,11 +142,11 @@ snapshot[`collect > direct import 2`] = `
path: "/mod.ts",
specifier: {
from: "https://deno.land/x/deno_graph@0.50.0/mod.ts",
to: "https://deno.land/x/deno_graph@0.59.1/mod.ts",
to: "https://deno.land/x/deno_graph@0.59.2/mod.ts",
},
version: {
from: "0.50.0",
to: "0.59.1",
to: "0.59.2",
},
}
`;
Expand Down Expand Up @@ -198,11 +198,11 @@ snapshot[`collect > direct import 4`] = `
path: "/version.ts",
specifier: {
from: "https://deno.land/std@0.200.0/version.ts",
to: "https://deno.land/std@0.204.0/version.ts",
to: "https://deno.land/std@0.205.0/version.ts",
},
version: {
from: "0.200.0",
to: "0.204.0",
to: "0.205.0",
},
}
`;
Expand All @@ -226,11 +226,11 @@ snapshot[`collect > import map 1`] = `
path: "/version.ts",
specifier: {
from: "https://deno.land/std@0.200.0/version.ts",
to: "https://deno.land/std@0.204.0/version.ts",
to: "https://deno.land/std@0.205.0/version.ts",
},
version: {
from: "0.200.0",
to: "0.204.0",
to: "0.205.0",
},
}
`;
Expand All @@ -254,11 +254,11 @@ snapshot[`collect > import map 2`] = `
path: "/mod.ts",
specifier: {
from: "https://deno.land/x/deno_graph@0.50.0/mod.ts",
to: "https://deno.land/x/deno_graph@0.59.1/mod.ts",
to: "https://deno.land/x/deno_graph@0.59.2/mod.ts",
},
version: {
from: "0.50.0",
to: "0.59.1",
to: "0.59.2",
},
}
`;
Expand Down Expand Up @@ -310,38 +310,11 @@ snapshot[`collect > import map 4`] = `
path: "/version.ts",
specifier: {
from: "https://deno.land/std@0.200.0/version.ts",
to: "https://deno.land/std@0.204.0/version.ts",
to: "https://deno.land/std@0.205.0/version.ts",
},
version: {
from: "0.200.0",
to: "0.204.0",
to: "0.205.0",
},
}
`;

snapshot[`applyToModule > https://deno.land/x/deno_graph 1`] = `
'import { VERSION } from "https://deno.land/std@0.200.0/version.ts";
import { createGraph } from "https://deno.land/x/deno_graph@0.59.1/mod.ts";
import { emojify } from "npm:node-emoji@1.0.0";
import { noop } from "./lib.ts";
'
`;

snapshot[`applyToModule > npm:node-emoji 1`] = `
'import { VERSION } from "https://deno.land/std@0.200.0/version.ts";
import { createGraph } from "https://deno.land/x/deno_graph@0.50.0/mod.ts";
import { emojify } from "npm:node-emoji@2.1.0";
import { noop } from "./lib.ts";
'
`;

snapshot[`applyToImportMap > deno_graph 1`] = `
'{
"imports": {
"std/": "https://deno.land/std@0.200.0/",
"deno_graph": "https://deno.land/x/deno_graph@0.59.1/mod.ts",
"node-emoji": "npm:node-emoji@1.0.0",
"/": "./"
}
}'
`;
Loading

0 comments on commit ff430fc

Please sign in to comment.