Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: publish to jsr #261

Merged
merged 6 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
if: |
github.event_name == 'push' ||
!startsWith(github.event.pull_request.head.label, 'dsherret:')
permissions:
contents: read
id-token: write
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
Expand Down Expand Up @@ -44,6 +47,10 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- name: npm build
run: deno run -A ./scripts/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}

- name: Publish to JSR on tag
if: runner.os == 'Linux'
run: deno run -A jsr:@david/[email protected]
- name: npm publish
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux'
env:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/target
.vscode
deno.lock
npm
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,26 @@ Cross-platform shell tools for Deno and Node.js inspired by [zx](https://github.
1. Good for application code in addition to use as a shell script replacement.
1. Named after my cat.

## Install

Deno:

```sh
# or skip and import directly from `jsr:@david/dax@<version>`
deno add @david/dax
```

Node:

```sh
npm install dax-sh
```

## Executing commands

```ts
#!/usr/bin/env -S deno run --allow-all
import $ from "https://deno.land/x/dax/mod.ts";
import $ from "@david/dax"; // "dax-sh" in Node

// run a command
await $`echo 5`; // outputs: 5
Expand All @@ -40,8 +55,6 @@ await Promise.all([
]);
```

Note: Above instructions are for Deno. For Node.js, install via `npm install --save-dev dax-sh` then import via `import $ from "dax-sh";`.

### Getting output

Get the stdout of a command (makes stdout "quiet"):
Expand Down
24 changes: 22 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"lock": false,
"name": "@david/dax",
"version": "0.0.0",
"tasks": {
"test": "deno test -A",
"wasmbuild": "deno run -A https://deno.land/x/[email protected]/main.ts --sync --out ./src/lib"
Expand All @@ -18,7 +19,26 @@
}
},
"exclude": [
".gitattributes",
".gitignore",
".github",
".rustfmt.toml",
".vscode",
"Cargo.toml",
"Cargo.lock",
"npm/",
"target/"
]
],
"exports": "./mod.ts",
"imports": {
"@deno/dnt": "jsr:@deno/dnt@^0.41.1",
"@std/assert": "jsr:@std/assert@^0.221.0",
"@std/fmt": "jsr:@std/fmt@^0.221.0",
"@std/fs": "jsr:@std/[email protected]",
"@std/io": "jsr:@std/[email protected]",
"@std/path": "jsr:@std/[email protected]",
"@std/streams": "jsr:@std/[email protected]",
"which": "jsr:@david/[email protected]",
"which_runtime": "jsr:@david/[email protected]"
}
}
Loading