Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jul 9, 2022
0 parents commit b9a68ce
Show file tree
Hide file tree
Showing 19 changed files with 1,181 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
3 changes: 3 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
max_width = 80
tab_spaces = 2
edition = "2021"
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"deno.enable": true,
"deno.lint": false
}
198 changes: 198 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[workspace]
members = [
"rs_lib",
]
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) 2022 David Sherret

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.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# ax

**Note:** This is very early stages. Just started working on it. A lot is not tested and won't work.

An automation toolkit for Deno inspired by [zx](https://github.com/google/zx).

Differences:

1. No globals or custom CLI command to execute—import into a script then use `deno run -A your_script.ts`.
1. Cross platform shell to help the code work on Windows.
- Uses [deno_task_shell](https://github.com/denoland/deno_task_shell)'s parser.
- This is very early stages, so I only have simple commands working at the moment and no cross platform commands.
- This also means you will be able to use `cd` like so if you wanted (not implemented, but trivial to implement):
```ts
await $`cd someDir`;
await $`pwd`.inherit(); // outputs a directory containing "someDir"
```

## Example

```ts
// note: this is not published yet...
import $ from "https://deno.land/x/ax@{VERSION_GOES_HERE}/mod.ts";
const result = await $`deno eval 'console.log(5);'`;
console.log(result.stdout.trim()); // 5
// runs the script showing stdout and stderr
await $`deno run my_script.ts`.inherit();
await $.sleep(1000);
await $.which("deno"); // path to deno executable
await $.withRetries({
count: 5,
delay: 5_000,
action: async () => {
await $`cargo publish`;
},
});
// re-export of deno_std's path
$.path.basename("./deno/std/path/mod.ts"); // mod.ts
// re-export of deno_std's fs
for await (const file of $.fs.expandGlob("**/*.ts")) {
console.log(file);
}
```
5 changes: 5 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tasks": {
"wasmbuild": "deno run -A https://deno.land/x/[email protected]/main.ts"
}
}
19 changes: 19 additions & 0 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"exec": {
"associations": "**/*.rs",
"rustfmt": "rustfmt"
},
"includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json,md,toml,rs}"],
"excludes": [
"**/node_modules",
"**/*-lock.json",
"**/target"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.69.5.wasm",
"https://plugins.dprint.dev/json-0.15.3.wasm",
"https://plugins.dprint.dev/markdown-0.13.3.wasm",
"https://plugins.dprint.dev/toml-0.5.4.wasm",
"https://plugins.dprint.dev/exec-0.3.1.json@9351b67ec7a6b58a69201c2834cba38cb3d191080aefc6422fb1320f03c8fc4d"
]
}
Loading

0 comments on commit b9a68ce

Please sign in to comment.