Skip to content

Commit 8b0e31d

Browse files
authored
Merge pull request #106 from nestdotland/dev
0.3.2
2 parents 7d55765 + 4703b59 commit 8b0e31d

File tree

8 files changed

+45
-45
lines changed

8 files changed

+45
-45
lines changed

Drakefile.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { desc, run, sh, task } from "https://x.nest.land/drake@1.4.4/mod.ts";
22
import { version } from "./src/version.ts";
33

4+
const encoder = new TextEncoder();
5+
46
desc("Run tests.");
57
task("test", [], async function () {
68
await sh(
@@ -57,9 +59,12 @@ task("dry-ship", ["link", "dry-publish"]);
5759
desc("Ship eggs to nest.land.");
5860
task("ship", ["link", "publish"]);
5961

60-
task("get-version", [], function () {
62+
task("get-version", [], async function () {
6163
console.log(`Eggs version: ${version}`);
62-
console.log(`::set-env name=EGGS_VERSION::${version}`);
64+
const env = encoder.encode(`\nEGGS_VERSION=${version}\n`);
65+
const GITHUB_ENV = Deno.env.get("GITHUB_ENV");
66+
if (!GITHUB_ENV) throw new Error("Unable to get Github env");
67+
await Deno.writeFile(GITHUB_ENV, env, { append: true });
6368
});
6469

6570
task("setup-github-actions", [], async function () {
@@ -68,21 +73,6 @@ task("setup-github-actions", [], async function () {
6873
});
6974
await process.status();
7075
process.close();
71-
72-
switch (Deno.build.os) {
73-
case "windows":
74-
console.log("::add-path::C:\\Users\\runneradmin\\.deno\\bin");
75-
break;
76-
case "linux":
77-
console.log("::add-path::/home/runner/.deno/bin");
78-
console.log("::set-env name=SHELL::/bin/bash");
79-
break;
80-
case "darwin":
81-
console.log("::add-path::/Users/runner/.deno/bin");
82-
break;
83-
default:
84-
break;
85-
}
8676
});
8777

8878
desc("Development tools. Should ideally be run before each commit.");

deps.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,37 @@ export {
99
join,
1010
relative,
1111
resolve,
12-
} from "https://x.nest.land/std@0.74.0/path/mod.ts";
12+
} from "https://x.nest.land/std@0.75.0/path/mod.ts";
1313

1414
export {
1515
exists,
1616
existsSync,
1717
expandGlob,
1818
expandGlobSync,
1919
walkSync,
20-
} from "https://x.nest.land/std@0.74.0/fs/mod.ts";
20+
} from "https://x.nest.land/std@0.75.0/fs/mod.ts";
2121

22-
export * as log from "https://x.nest.land/std@0.74.0/log/mod.ts";
22+
export * as log from "https://x.nest.land/std@0.75.0/log/mod.ts";
2323

24-
export { LogRecord } from "https://x.nest.land/std@0.74.0/log/logger.ts";
24+
export { LogRecord } from "https://x.nest.land/std@0.75.0/log/logger.ts";
2525

26-
export type { LevelName } from "https://x.nest.land/std@0.74.0/log/levels.ts";
27-
export { LogLevels } from "https://x.nest.land/std@0.74.0/log/levels.ts";
26+
export type { LevelName } from "https://x.nest.land/std@0.75.0/log/levels.ts";
27+
export { LogLevels } from "https://x.nest.land/std@0.75.0/log/levels.ts";
2828

29-
export { BaseHandler } from "https://x.nest.land/std@0.74.0/log/handlers.ts";
29+
export { BaseHandler } from "https://x.nest.land/std@0.75.0/log/handlers.ts";
3030

31-
export * from "https://x.nest.land/std@0.74.0/fmt/colors.ts";
31+
export * from "https://x.nest.land/std@0.75.0/fmt/colors.ts";
3232

3333
export {
3434
assert,
3535
assertEquals,
3636
assertMatch,
37-
} from "https://x.nest.land/std@0.74.0/testing/asserts.ts";
37+
} from "https://x.nest.land/std@0.75.0/testing/asserts.ts";
3838

3939
export {
4040
parse as parseYaml,
4141
stringify as stringifyYaml,
42-
} from "https://x.nest.land/std@0.74.0/encoding/yaml.ts";
42+
} from "https://x.nest.land/std@0.75.0/encoding/yaml.ts";
4343

4444
/**************** cliffy ****************/
4545
export {
@@ -68,13 +68,15 @@ export * as base64 from "https://denopkg.com/chiefbiiko/base64@v0.2.0/mod.ts";
6868

6969
/**************** hatcher ****************/
7070
export {
71-
getLatestVersion,
71+
latestVersion,
7272
NestLand,
7373
parseURL,
7474
UpdateNotifier,
75-
} from "https://x.nest.land/hatcher@0.9.2/mod.ts";
75+
} from "https://x.nest.land/hatcher@0.10.1/mod.ts";
7676

77-
export { install as installHatcher } from "https://x.nest.land/hatcher@0.9.2/lib/cli.ts";
77+
export { isVersionUnstable } from "https://x.nest.land/hatcher@0.10.1/lib/utilities/utils.ts";
78+
79+
export { install as installHatcher } from "https://x.nest.land/hatcher@0.10.1/lib/cli.ts";
7880

7981
/**************** analyzer ****************/
8082
export type { DependencyTree } from "https://x.nest.land/analyzer@0.0.6/deno/tree.ts";

src/api/module_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Deno.test({
1717
],
1818
});
1919

20-
const maze_generator = new Module({
20+
const mazeGenerator = new Module({
2121
name: "maze_generator",
2222
owner: "TheWizardBear",
2323
description: "A module for generating mazes",
@@ -30,6 +30,6 @@ Deno.test({
3030
});
3131

3232
assertEquals(eggs.getLatestVersion(), "0.1.9-rc1");
33-
assertEquals(maze_generator.getLatestVersion(), "0.1.0-alpha.0");
33+
assertEquals(mazeGenerator.getLatestVersion(), "0.1.0-alpha.0");
3434
},
3535
});

src/commands/info.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ import {
99
green,
1010
italic,
1111
log,
12+
magenta,
1213
parseURL,
1314
red,
1415
resolve,
1516
rgb24,
17+
yellow,
1618
} from "../../deps.ts";
1719
import type { DefaultOptions } from "../commands.ts";
1820
import { version } from "../version.ts";
@@ -29,6 +31,8 @@ const format = {
2931
denoLand: cyan("deno.land"),
3032
github: blue("github.com"),
3133
denopkgCom: green("denopkg.com"),
34+
skypack: magenta("cdn.skypack.dev"),
35+
jspm: yellow("jspm.dev"),
3236
};
3337

3438
/** Info Command. */
@@ -154,6 +158,12 @@ function beautifyDependency(dep: string) {
154158
formatVersion(version)
155159
} ${formatPath(relativePath)}`;
156160

161+
case "cdn.skypack.dev":
162+
return `${format.skypack} ${bold(name)} ${formatVersion(version)}`;
163+
164+
case "jspm.dev":
165+
return `${format.jspm} ${bold(name)} ${formatVersion(version)}`;
166+
157167
default:
158168
return dep;
159169
}

src/commands/publish.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
globToRegExp,
1111
gray,
1212
green,
13+
isVersionUnstable,
1314
italic,
1415
join,
1516
log,
@@ -98,10 +99,6 @@ async function deprecationWarnings(config: Config) {
9899
// no deprecated feature for the time being :)
99100
}
100101

101-
function isVersionUnstable(v: string) {
102-
return !((semver.major(v) === 0) || semver.prerelease(v));
103-
}
104-
105102
function gatherOptions(
106103
options: Options,
107104
name?: string,

src/commands/update.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
Command,
3-
getLatestVersion,
43
green,
4+
latestVersion,
55
log,
66
parseURL,
77
semver,
@@ -76,7 +76,7 @@ export async function update(
7676
}
7777

7878
// Get latest release
79-
const latestRelease = await getLatestVersion(registry, name, owner);
79+
const latestRelease = await latestVersion(registry, name, owner);
8080

8181
// Basic safety net
8282

src/commands/upgrade.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import { setupLog } from "../utilities/log.ts";
77
export async function upgrade(options: DefaultOptions) {
88
await setupLog(options.debug);
99

10-
const newVersion = await NestLand.getLatestVersion("eggs");
10+
const newVersion = await NestLand.latestVersion("eggs");
11+
if (!newVersion) {
12+
log.error("Could not retrieve latest version.");
13+
return;
14+
}
1115
if (semver.eq(newVersion, version)) {
1216
log.info("You are already using the latest CLI version!");
1317
return;
@@ -18,11 +22,8 @@ export async function upgrade(options: DefaultOptions) {
1822
"deno",
1923
"install",
2024
"--unstable",
21-
"-A",
22-
"-f",
23-
"-n",
24-
"eggs",
25-
`https://x.nest.land/eggs@${newVersion}/mod.ts`,
25+
"-Afq",
26+
`https://x.nest.land/eggs@${newVersion}/eggs.ts`,
2627
],
2728
stdout: "piped",
2829
stderr: "piped",

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version = "0.3.1";
1+
export const version = "0.3.2";

0 commit comments

Comments
 (0)