Skip to content

Commit

Permalink
Merge pull request #11 from lambdalisue/support-jsr
Browse files Browse the repository at this point in the history
Support jsr
  • Loading branch information
lambdalisue authored Apr 6, 2024
2 parents e349d27 + fb6c3f0 commit 348ac18
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 74 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: jsr

env:
DENO_VERSION: 1.x

on:
push:
tags:
- "v*"

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
- name: Publish
run: |
deno run -A jsr:@david/[email protected]
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ on:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
Expand All @@ -30,11 +31,14 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
- name: Test
run: |
deno task test
timeout-minutes: 5
- name: JSR publish (dry-run)
run: |
deno publish --dry-run
50 changes: 0 additions & 50 deletions .github/workflows/udd.yml

This file was deleted.

18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# itertools

[![deno land](http://img.shields.io/badge/available%20on-deno.land/x-lightgrey.svg?logo=deno)](https://deno.land/x/itertools)
[![jsr](https://img.shields.io/jsr/v/%40lambdalisue/itertools?logo=javascript&logoColor=white)](https://jsr.io/@lambdalisue/itertools)
[![denoland](https://img.shields.io/github/v/release/lambdalisue/deno-itertools?logo=deno&label=denoland)](https://github.com/lambdalisue/deno-itertools/releases)
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/itertools/mod.ts)
[![Test](https://github.com/lambdalisue/deno-itertools/actions/workflows/test.yml/badge.svg)](https://github.com/lambdalisue/deno-itertools/actions/workflows/test.yml)

A TypeScript port of Python's awesome [itertools][itertools] standard library.
A TypeScript port of Python's awesome [itertools] standard library.

This is an standalone version of [nvie/itertools.js][nvie/itertools.js] for
using under the [Deno][deno] environment.
This is an standalone version of [nvie/itertools.js] for using under the [Deno]
environment.

[deno]: https://deno.land/
[Deno]: https://deno.land/
[itertools]: https://docs.python.org/3/library/itertools.html
[more-itertools]: https://pypi.org/project/more-itertools/
[nvie/itertools.js]: https://github.com/nvie/itertools.js

## Example

```typescript
import { enumerate } from "https://deno.land/x/itertools/mod.ts";
import { enumerate } from "https://deno.land/x/itertools@$MODULE_VERSION/mod.ts";

console.log([...enumerate(["hello", "world"])]);
// [0, 'hello'], [1, 'world']
```

This module provides more functions ported from Python's builtin functions,
[itertools][itertools], [more-itertools][more-itertools], and more. In other
words, all functions provided by the original
[nvie/itertools.js][nvie/itertools.js].
[itertools], [more-itertools], and more. In other words, all functions provided
by the original [nvie/itertools.js].

See
[API documentation](https://doc.deno.land/https/deno.land/x/itertools/mod.ts)
Expand Down
6 changes: 3 additions & 3 deletions builtins.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertThrows } from "https://deno.land/[email protected]/testing/asserts.ts";
import { describe, it } from "https://deno.land/[email protected]/testing/bdd.ts";
import { expect } from "https://deno.land/x/[email protected]/mod.ts";
import { assertThrows } from "@std/assert";
import { describe, it } from "@std/testing/bdd";
import { expect } from "@std/expect";
import {
all,
any,
Expand Down
4 changes: 2 additions & 2 deletions custom.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it } from "https://deno.land/[email protected]/testing/bdd.ts";
import { expect } from "https://deno.land/x/[email protected]/mod.ts";
import { describe, it } from "@std/testing/bdd";
import { expect } from "@std/expect";
import { compact, compactObject, flatmap } from "./custom.ts";
import { repeat } from "./itertools.ts";

Expand Down
15 changes: 11 additions & 4 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"lock": false,
"name": "@lambdalisue/itertools",
"version": "0.0.0",
"exports": "./mod.ts",
"tasks": {
"test": "deno test --unstable -A --parallel",
"check": "deno check --unstable $(find . -name '*.ts')",
"upgrade": "deno run -A https://deno.land/x/udd/main.ts $(find . -name '*.ts')"
"test": "deno test -A --parallel --doc --shuffle",
"check": "deno check **/*.ts"
},
"imports": {
"@std/assert": "jsr:@std/assert@^0.221.0",
"@std/expect": "jsr:@std/expect@^0.221.0",
"@std/testing": "jsr:@std/testing@^0.221.0",
"https://deno.land/x/itertools@$MODULE_VERSION/": "./"
}
}
4 changes: 2 additions & 2 deletions itertools.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it } from "https://deno.land/[email protected]/testing/bdd.ts";
import { expect } from "https://deno.land/x/[email protected]/mod.ts";
import { describe, it } from "@std/testing/bdd";
import { expect } from "@std/expect";
import { all, iter, range } from "./builtins.ts";
import {
chain,
Expand Down
4 changes: 2 additions & 2 deletions more-itertools.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it } from "https://deno.land/[email protected]/testing/bdd.ts";
import { expect } from "https://deno.land/x/[email protected]/mod.ts";
import { describe, it } from "@std/testing/bdd";
import { expect } from "@std/expect";
import { range } from "./builtins.ts";
import { first } from "./custom.ts";
import {
Expand Down

0 comments on commit 348ac18

Please sign in to comment.