Skip to content

Commit

Permalink
Refresh onto JSR (#3)
Browse files Browse the repository at this point in the history
* Remove Deno specific imports, publish to JSR

* Update README

* Update version and readme more

* Update for outdated type reference

* Ok looks like we're looking forward towards Deno 2.0
  • Loading branch information
danopia authored Sep 8, 2024
1 parent 300d9cc commit ed31895
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 77 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deno-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
strategy:
matrix:
deno-version:
- v1.20
- v1.25
- v1.45
- canary
fail-fast: false # run each branch to completion

Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/jsr-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish
on:
push:
branches:
- main
paths:
- src/jsr.json

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4
- run: npx jsr publish
66 changes: 0 additions & 66 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
8 changes: 7 additions & 1 deletion src/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
This module is a Deno-friendly port
of [observables-with-streams](https://github.com/surma/observables-with-streams).

Published to `jsr.io` as `@cloudydeno/stream-observables`.
Read more about [using packages](https://jsr.io/docs/using-packages).

Published to `/x/` as `stream_observables`.
Import from `https://deno.land/x/[email protected]/`.

Subset of original README below:

# Observables with Streams
Expand All @@ -14,7 +20,7 @@ The goal of this library is to implement observables making as much use of the p
## Example

```typescript
import * as ows from "https://deno.land/x/stream_observables/mod.ts";
import * as ows from "jsr:@cloudydeno/stream-observables@^1.4.0";

console.log('Tap Enter to add energy!');
ows.merge(
Expand Down
5 changes: 5 additions & 0 deletions src/jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@cloudydeno/stream-observables",
"version": "1.4.0",
"exports": "./mod.ts"
}
2 changes: 1 addition & 1 deletion src/sources/external.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type NextFunc<T> = (v: T | typeof EOF) => void;
*
* @typeparam T Type of items to be emitted by the observable.
*/
export function external<T>(cancel?: ReadableStreamErrorCallback) {
export function external<T>(cancel?: UnderlyingSourceCancelCallback) {
let next: NextFunc<T>;
const observable = new ReadableStream<T>(
{
Expand Down
3 changes: 0 additions & 3 deletions src/sources/from-deno-reader.ts

This file was deleted.

4 changes: 1 addition & 3 deletions src/sources/from-iterable.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export {
readableStreamFromIterable as fromIterable,
} from "https://deno.land/[email protected]/streams/readable_stream_from_iterable.ts";
export const fromIterable = ReadableStream.from;
1 change: 0 additions & 1 deletion src/sources/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

export * from "./external.ts";
export * from "./from-async-function.ts";
export * from "./from-deno-reader.ts";
export * from "./from-event.ts";
export * from "./from-generator.ts";
export * from "./from-iterable.ts";
Expand Down

0 comments on commit ed31895

Please sign in to comment.