Skip to content

Commit

Permalink
Merge pull request #106 from nestdotland/dev
Browse files Browse the repository at this point in the history
0.3.2
  • Loading branch information
SteelAlloy authored Nov 2, 2020
2 parents 7d55765 + 4703b59 commit 8b0e31d
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 45 deletions.
24 changes: 7 additions & 17 deletions Drakefile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { desc, run, sh, task } from "https://x.nest.land/[email protected]/mod.ts";
import { version } from "./src/version.ts";

const encoder = new TextEncoder();

desc("Run tests.");
task("test", [], async function () {
await sh(
Expand Down Expand Up @@ -57,9 +59,12 @@ task("dry-ship", ["link", "dry-publish"]);
desc("Ship eggs to nest.land.");
task("ship", ["link", "publish"]);

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

task("setup-github-actions", [], async function () {
Expand All @@ -68,21 +73,6 @@ task("setup-github-actions", [], async function () {
});
await process.status();
process.close();

switch (Deno.build.os) {
case "windows":
console.log("::add-path::C:\\Users\\runneradmin\\.deno\\bin");
break;
case "linux":
console.log("::add-path::/home/runner/.deno/bin");
console.log("::set-env name=SHELL::/bin/bash");
break;
case "darwin":
console.log("::add-path::/Users/runner/.deno/bin");
break;
default:
break;
}
});

desc("Development tools. Should ideally be run before each commit.");
Expand Down
28 changes: 15 additions & 13 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@ export {
join,
relative,
resolve,
} from "https://x.nest.land/std@0.74.0/path/mod.ts";
} from "https://x.nest.land/std@0.75.0/path/mod.ts";

export {
exists,
existsSync,
expandGlob,
expandGlobSync,
walkSync,
} from "https://x.nest.land/std@0.74.0/fs/mod.ts";
} from "https://x.nest.land/std@0.75.0/fs/mod.ts";

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

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

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

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

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

export {
assert,
assertEquals,
assertMatch,
} from "https://x.nest.land/std@0.74.0/testing/asserts.ts";
} from "https://x.nest.land/std@0.75.0/testing/asserts.ts";

export {
parse as parseYaml,
stringify as stringifyYaml,
} from "https://x.nest.land/std@0.74.0/encoding/yaml.ts";
} from "https://x.nest.land/std@0.75.0/encoding/yaml.ts";

/**************** cliffy ****************/
export {
Expand Down Expand Up @@ -68,13 +68,15 @@ export * as base64 from "https://denopkg.com/chiefbiiko/[email protected]/mod.ts";

/**************** hatcher ****************/
export {
getLatestVersion,
latestVersion,
NestLand,
parseURL,
UpdateNotifier,
} from "https://x.nest.land/hatcher@0.9.2/mod.ts";
} from "https://x.nest.land/hatcher@0.10.1/mod.ts";

export { install as installHatcher } from "https://x.nest.land/[email protected]/lib/cli.ts";
export { isVersionUnstable } from "https://x.nest.land/[email protected]/lib/utilities/utils.ts";

export { install as installHatcher } from "https://x.nest.land/[email protected]/lib/cli.ts";

/**************** analyzer ****************/
export type { DependencyTree } from "https://x.nest.land/[email protected]/deno/tree.ts";
Expand Down
4 changes: 2 additions & 2 deletions src/api/module_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Deno.test({
],
});

const maze_generator = new Module({
const mazeGenerator = new Module({
name: "maze_generator",
owner: "TheWizardBear",
description: "A module for generating mazes",
Expand All @@ -30,6 +30,6 @@ Deno.test({
});

assertEquals(eggs.getLatestVersion(), "0.1.9-rc1");
assertEquals(maze_generator.getLatestVersion(), "0.1.0-alpha.0");
assertEquals(mazeGenerator.getLatestVersion(), "0.1.0-alpha.0");
},
});
10 changes: 10 additions & 0 deletions src/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import {
green,
italic,
log,
magenta,
parseURL,
red,
resolve,
rgb24,
yellow,
} from "../../deps.ts";
import type { DefaultOptions } from "../commands.ts";
import { version } from "../version.ts";
Expand All @@ -29,6 +31,8 @@ const format = {
denoLand: cyan("deno.land"),
github: blue("github.com"),
denopkgCom: green("denopkg.com"),
skypack: magenta("cdn.skypack.dev"),
jspm: yellow("jspm.dev"),
};

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

case "cdn.skypack.dev":
return `${format.skypack} ${bold(name)} ${formatVersion(version)}`;

case "jspm.dev":
return `${format.jspm} ${bold(name)} ${formatVersion(version)}`;

default:
return dep;
}
Expand Down
5 changes: 1 addition & 4 deletions src/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
globToRegExp,
gray,
green,
isVersionUnstable,
italic,
join,
log,
Expand Down Expand Up @@ -98,10 +99,6 @@ async function deprecationWarnings(config: Config) {
// no deprecated feature for the time being :)
}

function isVersionUnstable(v: string) {
return !((semver.major(v) === 0) || semver.prerelease(v));
}

function gatherOptions(
options: Options,
name?: string,
Expand Down
4 changes: 2 additions & 2 deletions src/commands/update.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
Command,
getLatestVersion,
green,
latestVersion,
log,
parseURL,
semver,
Expand Down Expand Up @@ -76,7 +76,7 @@ export async function update(
}

// Get latest release
const latestRelease = await getLatestVersion(registry, name, owner);
const latestRelease = await latestVersion(registry, name, owner);

// Basic safety net

Expand Down
13 changes: 7 additions & 6 deletions src/commands/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import { setupLog } from "../utilities/log.ts";
export async function upgrade(options: DefaultOptions) {
await setupLog(options.debug);

const newVersion = await NestLand.getLatestVersion("eggs");
const newVersion = await NestLand.latestVersion("eggs");
if (!newVersion) {
log.error("Could not retrieve latest version.");
return;
}
if (semver.eq(newVersion, version)) {
log.info("You are already using the latest CLI version!");
return;
Expand All @@ -18,11 +22,8 @@ export async function upgrade(options: DefaultOptions) {
"deno",
"install",
"--unstable",
"-A",
"-f",
"-n",
"eggs",
`https://x.nest.land/eggs@${newVersion}/mod.ts`,
"-Afq",
`https://x.nest.land/eggs@${newVersion}/eggs.ts`,
],
stdout: "piped",
stderr: "piped",
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "0.3.1";
export const version = "0.3.2";

0 comments on commit 8b0e31d

Please sign in to comment.