Skip to content

Commit

Permalink
feat: initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
Qu4k committed Aug 25, 2020
0 parents commit b419fd0
Show file tree
Hide file tree
Showing 11 changed files with 1,355 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
21 changes: 21 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: check

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Setup latest deno version
uses: denolib/setup-deno@v2
with:
deno-version: v1.x

- name: Run deno fmt
run: deno fmt --check

- name: Run deno lint
run: deno lint --unstable
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: release

on:
push:
tags:
- "*.*.*"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# OS files
.DS_Store
.cache

# IDE
.vscode
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020-present the denosaurs team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# wait

[![Tags](https://img.shields.io/github/release/denosaurs/wait)](https://github.com/denosaurs/wait/releases)
[![CI Status](https://img.shields.io/github/workflow/status/denosaurs/wait/check)](https://github.com/denosaurs/wait/actions)
[![License](https://img.shields.io/github/license/denosaurs/wait)](https://github.com/denosaurs/wait/blob/master/LICENSE)

```typescript
import { wait } from "https://deno.land/x/wait/mod.ts";

const spinner = wait("Loading mesozoic").start();

setTimeout(() => {
spinner.color = "yellow";
spinner.text = "Loading meteorite";
}, 1000);

setTimeout(() => {
spinner.succeed("Started human race");
}, 2000);
```

## other

### contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt and commit messages are done following Conventional Commits spec.

### licence

Copyright 2020-present, the denosaurs team. All rights reserved. MIT license.
4 changes: 4 additions & 0 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * as colors from "https://deno.land/[email protected]/fmt/colors.ts";
export { encode, decode } from "https://deno.land/[email protected]/encoding/utf8.ts";
export * as tty from "https://deno.land/x/[email protected]/mod.ts";
export { onExit } from "https://deno.land/x/[email protected]/mod.ts";
12 changes: 12 additions & 0 deletions examples/hello.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { wait } from "../mod.ts";

const spinner = wait("Loading mesozoic").start();

setTimeout(() => {
spinner.color = "yellow";
spinner.text = "Loading meteorite";
}, 1000);

setTimeout(() => {
spinner.succeed("Started human race");
}, 2000);
25 changes: 25 additions & 0 deletions log_symbols.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { colors } from "./deps.ts";

let supported = Deno.build.os !== "windows";

if ((await Deno.permissions.query({ name: "env" })).state === "granted") {
supported = supported ||
!!Deno.env.get("CI") ||
Deno.env.get("TERM") === "xterm-256color";
}

const main = {
info: colors.blue("ℹ"),
success: colors.green("✔"),
warning: colors.yellow("⚠"),
error: colors.red("✖"),
};

const fallbacks = {
info: colors.blue("i"),
success: colors.green("√"),
warning: colors.yellow("‼"),
error: colors.red("×"),
};

export const symbols = supported ? main : fallbacks;
Loading

0 comments on commit b419fd0

Please sign in to comment.