Skip to content

Commit

Permalink
refactor: refactor project structure for url friendly imports
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar committed Aug 7, 2020
1 parent dd1de10 commit 8b5fbdd
Show file tree
Hide file tree
Showing 225 changed files with 550 additions and 591 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ jobs:
run: deno -V

- name: Run command test's
run: deno test packages/command/test/command --unstable --allow-env && deno test packages/command/test/option && deno test packages/command/test/type
run: deno test command/test/command --allow-env --unstable && deno test command/test/option && deno test command/test/type

- name: Run flags test's
run: deno test packages/flags
run: deno test flags

- name: Run keycode test's
run: deno test packages/keycode
run: deno test keycode

- name: Run prompt test's
run: deno test packages/prompt --unstable
run: deno test prompt --unstable

- name: Run table test's
run: deno test packages/table
run: deno test table
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@

<p align="center">
<b>Command line framework for Deno</b></br>
<sub>>_ A collection of modules for creating interactive command line tools.<sub>
<sub>>_ A collection of modules for creating interactive command line tools.</sub>
</p>

<p align="center" style="color: #856404; background-color: #fff3cd; border-color: #ffeeba; padding: .75rem 1.25rem; margin-bottom: 1rem; border-radius: .25rem;">
<b>WARNING:</b> This project is still under development. Not all features are fully implemented and it's possible to get some breaking changes if you upgrade to a newer version. If you find a bug or have a feature request feel free to create an issue.
</p>

## Packages
## Modules

* **[ansi-escape](packages/ansi-escape/):** Show, hide and move cli cursor, erase output and scroll window.
* **[ansi-escape](ansi-escape/):** Show, hide and move cli cursor, erase output and scroll window.

* **[command](packages/command/):** Create flexible command line interfaces with type checking, auto generated help and out of the box support for shell completions (inspired by [node.js's](http://nodejs.org) [commander.js](https://github.com/tj/commander.js/blob/master/Readme.md)).
* **[command](command/):** Create flexible command line interfaces with type checking, auto generated help and out of the box support for shell completions (inspired by [node.js's](http://nodejs.org) [commander.js](https://github.com/tj/commander.js/blob/master/Readme.md)).

* **[flags](packages/flags/):** Parse command line arguments.
* **[flags](flags/):** Parse command line arguments.

* **[keycode](packages/keycode/):** Parse ANSI key codes.
* **[keycode](keycode/):** Parse ANSI key codes.

* **[prompt](packages/prompt/):** Create interactive prompts like: checkbox, confirm, input, number, select, etc...
* **[prompt](prompt/):** Create interactive prompts like: checkbox, confirm, input, number, select, etc...

* **[table](packages/table/):** Create cli table's with border, padding, nested table's, etc...
* **[table](table/):** Create cli table's with border, padding, nested table's, etc...
1 change: 0 additions & 1 deletion ansi-escape.ts

This file was deleted.

8 changes: 4 additions & 4 deletions packages/ansi-escape/README.md → ansi-escape/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
</p>

<p align="center">
<b>Control cli cursor, erase output and scroll window.</b></br>
<sub>>_ Used by cliffy's <a href="../prompt/">prompt</a> module<sub>
<b>Control cli cursor, erase output and scroll window.</b><br>
<sub>>_ Used by cliffy's <a href="../prompt/">prompt</a> module</sub>
</p>

## Usage

```typescript
#!/usr/bin/env -S deno run

import { AnsiEscape } from 'https://deno.land/x/cliffy/ansi-escape.ts';
import { AnsiEscape } from 'https://deno.land/x/cliffy/ansi-escape/mod.ts';

AnsiEscape.from( Deno.stdout )
// Hide cursor:
Expand All @@ -51,4 +51,4 @@ AnsiEscape.from( Deno.stdout )

## License

[MIT](../../LICENSE)
[MIT](../LICENSE)
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { encode } from 'https://deno.land/std@0.63.0/encoding/utf8.ts';
import { cursor, erase, image, ImageOptions, link, scroll } from './csi.ts';

export class AnsiEscape {
Expand All @@ -12,7 +11,7 @@ export class AnsiEscape {

/** Write to file. */
public write( code: string ): this {
this.file.writeSync( encode( code ) );
this.file.writeSync( new TextEncoder().encode( code ) );
return this;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/ansi-escape/lib/csi.ts → ansi-escape/csi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as base64 from 'https://deno.land/x/base64@v0.2.0/mod.ts';
import { encodeBase64 } from './deps.ts';

export const ESC = '\x1B';
export const CSI = `${ ESC }[`;
Expand Down Expand Up @@ -126,5 +126,5 @@ export const image = ( buffer: Uint8Array, options?: ImageOptions ) => {
ret += ';preserveAspectRatio=0';
}

return ret + ':' + base64.fromUint8Array( buffer ) + BEL;
return ret + ':' + encodeBase64( buffer ) + BEL;
};
3 changes: 3 additions & 0 deletions ansi-escape/deps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export {
encode as encodeBase64
} from 'https://deno.land/std@0.63.0/encoding/base64.ts';
2 changes: 2 additions & 0 deletions ansi-escape/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './csi.ts';
export * from './ansi-escape.ts';
1 change: 0 additions & 1 deletion command.ts

This file was deleted.

Loading

0 comments on commit 8b5fbdd

Please sign in to comment.