Skip to content

Commit

Permalink
refactor: replace path class with jsr:@david/path (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Sep 9, 2024
1 parent 0c1cc7b commit e486644
Show file tree
Hide file tree
Showing 15 changed files with 216 additions and 2,490 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ 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 All @@ -26,6 +23,8 @@ jobs:

- name: Install deno
uses: denoland/setup-deno@v1
with:
deno-version: canary

- uses: dprint/[email protected]
if: runner.os == 'Linux'
Expand All @@ -48,11 +47,22 @@ jobs:
- 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:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: cd npm && npm publish

jsr:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install deno
uses: denoland/setup-deno@v1
with:
deno-version: canary
- name: Publish to JSR on tag
run: deno run -A jsr:@david/[email protected]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ pb.with(() => {

## Path API

The path API offers an immutable [`Path`](https://jsr.io/@david/dax/doc/~/Path) class, which is a similar concept to Rust's `PathBuf` struct.
The path API offers an immutable [`Path`](https://jsr.io/@david/path/doc/~/Path) class via [`jsr:@david/path`](https://jsr.io/@david/path), which is a similar concept to Rust's `PathBuf` struct.

```ts
// create a `Path`
Expand Down Expand Up @@ -659,7 +659,7 @@ const pathStringFileUrl = $.path("file:///tmp"); // converts to /tmp
const pathImportMeta = $.path(import.meta); // the path for the current module
```

There are a lot of helper methods here, so check the [documentation on Path](https://jsr.io/@david/dax/doc/~/Path) for more details.
There are a lot of helper methods here, so check the [documentation on Path](https://jsr.io/@david/path/doc/~/Path) for more details.

## Helper functions

Expand Down
19 changes: 10 additions & 9 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@david/dax",
"version": "0.0.0",
"nodeModulesDir": false,
"nodeModulesDir": "none",
"tasks": {
"test": "deno test -A",
"wasmbuild": "deno run -A https://deno.land/x/[email protected]/main.ts --sync --out ./src/lib"
Expand Down Expand Up @@ -32,14 +32,15 @@
],
"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/which@^0.4.1",
"@deno/dnt": "jsr:@deno/dnt@~0.41.3",
"@david/path": "jsr:@david/[email protected]",
"@std/assert": "jsr:@std/assert@1",
"@std/fmt": "jsr:@std/fmt@1",
"@std/fs": "jsr:@std/fs@1",
"@std/io": "jsr:@std/[email protected]",
"@std/path": "jsr:@std/path@1",
"@std/streams": "jsr:@std/[email protected]",
"which": "jsr:@david/which@~0.4.1",
"which_runtime": "jsr:@david/[email protected]"
}
}
Loading

0 comments on commit e486644

Please sign in to comment.