Skip to content

Commit

Permalink
Merge pull request #37 from drashland/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
ebebbington authored Jul 14, 2020
2 parents 4bfc571 + 69f72f5 commit cc5e0d5
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bumper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
update-dep:
strategy:
matrix:
deno: ["1.1.1"]
deno: ["1.2.0"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
deno: ["1.1.1"]
deno: ["1.2.0"]
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -28,7 +28,7 @@ jobs:
linting:
strategy:
matrix:
deno: ["1.1.0"]
deno: ["1.2.0"]
# Doesn't need to be checked in all OS
runs-on: ubuntu-latest

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ Information on fmt
- Name: fmt
- Description: Cannot retrieve descriptions for std modules
- deno.land Link: https://deno.land/std@0.60.0/fmt
- deno.land Link: https://deno.land/std@0.61.0/fmt
- GitHub Repository: https://github.com/denoland/deno/tree/master/std/fmt
- Import Statement: import * as fmt from "https://deno.land/std@0.60.0/fmt";
- Latest Version: 0.60.0
- Import Statement: import * as fmt from "https://deno.land/std@0.61.0/fmt";
- Latest Version: 0.61.0
```

Expand All @@ -97,7 +97,7 @@ export { Drash } from "https://deno.land/x/drash@v1.0.0/mod.ts"; // out of date

import * as fs from "https://deno.land/std@0.53.0/fs/mod.ts"; // out of date

import * as colors from "https://deno.land/std@0.60.0/fmt/colors.ts"; // up to date
import * as colors from "https://deno.land/std@0.61.0/fmt/colors.ts"; // up to date

export { fs, colors }
```
Expand All @@ -112,7 +112,7 @@ Now we want to check if any of our dependencies need updating, but we don't want
$ dmm check
...
drash can be updated from v1.0.0 to v1.0.7
fs can be updated from 0.53.0 to 0.60.0
fs can be updated from 0.53.0 to 0.61.0
...
```

Expand All @@ -124,7 +124,7 @@ Lets update our dependencies as some are out of date:
$ dmm update
...
drash was updated from v1.0.0 to v1.0.7
fs was updated from 0.53.0 to 0.60.0
fs was updated from 0.53.0 to 0.61.0
...
```

Expand All @@ -133,9 +133,9 @@ Now lets check the `deps.ts` file, and you will notice the versions have been mo
```typescript
export { Drash } from "https://deno.land/x/drash@v1.0.7/mod.ts"; // was out of date

import * as fs from "https://deno.land/std@0.60.0/fs/mod.ts"; // was out of date
import * as fs from "https://deno.land/std@0.61.0/fs/mod.ts"; // was out of date

import * as colors from "https://deno.land/std@0.60.0/fmt/colors.ts";
import * as colors from "https://deno.land/std@0.61.0/fmt/colors.ts";

export { fs, colors }
```
Expand Down
4 changes: 2 additions & 2 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as colours from "https://deno.land/std@0.60.0/fmt/colors.ts";
import * as colours from "https://deno.land/std@0.61.0/fmt/colors.ts";
export { colours };

export { assertEquals } from "https://deno.land/std@0.60.0/testing/asserts.ts";
export { assertEquals } from "https://deno.land/std@0.61.0/testing/asserts.ts";
2 changes: 1 addition & 1 deletion src/services/module_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class ModuleService {
const importVersionRegex = /(v)?[0-9].+[0-9].+[0-9]/g;
const importVersionRegexResult = dep.match(importVersionRegex);
const importedVersion: string = importVersionRegexResult !== null &&
importVersionRegexResult.length > 0
importVersionRegexResult.length > 0
? importVersionRegexResult[0]
: "";
if (!importedVersion) {
Expand Down
4 changes: 2 additions & 2 deletions tests/up-to-date-deps/deps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Drash } from "https://deno.land/x/drash@v1.0.7/mod.ts"; // up to date

import * as fs from "https://deno.land/std@0.60.0/fs/mod.ts"; // up to date
import * as fs from "https://deno.land/std@0.61.0/fs/mod.ts"; // up to date

import * as colors from "https://deno.land/std@0.60.0/fmt/colors.ts"; // up to date
import * as colors from "https://deno.land/std@0.61.0/fmt/colors.ts"; // up to date

export { Drash, fs, colors };
4 changes: 2 additions & 2 deletions tests/up-to-date-deps/original_deps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Drash } from "https://deno.land/x/drash@v1.0.7/mod.ts"; // up to date

import * as fs from "https://deno.land/std@0.60.0/fs/mod.ts"; // up to date
import * as fs from "https://deno.land/std@0.61.0/fs/mod.ts"; // up to date

import * as colors from "https://deno.land/std@0.60.0/fmt/colors.ts"; // up to date
import * as colors from "https://deno.land/std@0.61.0/fmt/colors.ts"; // up to date

export { Drash, fs, colors };
35 changes: 18 additions & 17 deletions tests/update_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ Deno.test({
const stdout = new TextDecoder("utf-8").decode(output);
const error = await p.stderrOutput();
const stderr = new TextDecoder("utf-8").decode(error);
const expected = "Gathering facts...\n" +
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("fs was updated from 0.53.0 to 0.61.0") + "\n";
assertEquals(
stdout,
"Gathering facts...\n" +
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("fs was updated from 0.53.0 to 0.60.0") + "\n",
expected,
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -74,7 +75,7 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@0.60.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@0.61.0/fs") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
});
Expand Down Expand Up @@ -156,8 +157,8 @@ Deno.test({
"Gathering facts...\n" +
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("fs was updated from 0.53.0 to 0.60.0") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.60.0") + "\n",
colours.green("fs was updated from 0.53.0 to 0.61.0") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.61.0") + "\n",
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -169,8 +170,8 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@0.60.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@v0.60.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("std@0.61.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@v0.61.0/fmt") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
});
Expand Down Expand Up @@ -251,8 +252,8 @@ Deno.test({
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("drash was updated from v1.0.0 to v1.0.7") + "\n" +
colours.green("fs was updated from 0.53.0 to 0.60.0") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.60.0") + "\n",
colours.green("fs was updated from 0.53.0 to 0.61.0") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.61.0") + "\n",
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -264,8 +265,8 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@0.60.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@v0.60.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("std@0.61.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@v0.61.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("drash@v1.0.7") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
Expand Down Expand Up @@ -439,7 +440,7 @@ Deno.test({
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("drash was updated from v1.0.0 to v1.0.7") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.60.0") + "\n",
colours.green("fmt was updated from v0.53.0 to v0.61.0") + "\n",
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -451,7 +452,7 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@v0.60.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("std@v0.61.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("drash@v1.0.7") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
Expand Down Expand Up @@ -488,7 +489,7 @@ Deno.test({
"Gathering facts...\n" +
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("fs was updated from 0.53.0 to 0.60.0") + "\n",
colours.green("fs was updated from 0.53.0 to 0.61.0") + "\n",
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -500,7 +501,7 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@0.60.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@0.61.0/fs") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
});

0 comments on commit cc5e0d5

Please sign in to comment.