Skip to content

Commit 348ac18

Browse files
authored
Merge pull request #11 from lambdalisue/support-jsr
Support jsr
2 parents e349d27 + fb6c3f0 commit 348ac18

File tree

9 files changed

+62
-74
lines changed

9 files changed

+62
-74
lines changed

.github/workflows/jsr.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: jsr
2+
3+
env:
4+
DENO_VERSION: 1.x
5+
6+
on:
7+
push:
8+
tags:
9+
- "v*"
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
jobs:
16+
publish:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- uses: denoland/setup-deno@v1
23+
with:
24+
deno-version: ${{ env.DENO_VERSION }}
25+
- name: Publish
26+
run: |
27+
deno run -A jsr:@david/[email protected]

.github/workflows/test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ on:
1010
branches:
1111
- main
1212
pull_request:
13+
workflow_dispatch:
1314

1415
jobs:
1516
check:
1617
runs-on: ubuntu-latest
1718
steps:
18-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1920
- uses: denoland/setup-deno@v1
2021
with:
2122
deno-version: ${{ env.DENO_VERSION }}
@@ -30,11 +31,14 @@ jobs:
3031
test:
3132
runs-on: ubuntu-latest
3233
steps:
33-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3435
- uses: denoland/setup-deno@v1
3536
with:
3637
deno-version: ${{ env.DENO_VERSION }}
3738
- name: Test
3839
run: |
3940
deno task test
4041
timeout-minutes: 5
42+
- name: JSR publish (dry-run)
43+
run: |
44+
deno publish --dry-run

.github/workflows/udd.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
# itertools
22

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

7-
A TypeScript port of Python's awesome [itertools][itertools] standard library.
8+
A TypeScript port of Python's awesome [itertools] standard library.
89

9-
This is an standalone version of [nvie/itertools.js][nvie/itertools.js] for
10-
using under the [Deno][deno] environment.
10+
This is an standalone version of [nvie/itertools.js] for using under the [Deno]
11+
environment.
1112

12-
[deno]: https://deno.land/
13+
[Deno]: https://deno.land/
1314
[itertools]: https://docs.python.org/3/library/itertools.html
1415
[more-itertools]: https://pypi.org/project/more-itertools/
1516
[nvie/itertools.js]: https://github.com/nvie/itertools.js
1617

1718
## Example
1819

1920
```typescript
20-
import { enumerate } from "https://deno.land/x/itertools/mod.ts";
21+
import { enumerate } from "https://deno.land/x/itertools@$MODULE_VERSION/mod.ts";
2122

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

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

3131
See
3232
[API documentation](https://doc.deno.land/https/deno.land/x/itertools/mod.ts)

builtins.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { assertThrows } from "https://deno.land/[email protected]/testing/asserts.ts";
2-
import { describe, it } from "https://deno.land/[email protected]/testing/bdd.ts";
3-
import { expect } from "https://deno.land/x/[email protected]/mod.ts";
1+
import { assertThrows } from "@std/assert";
2+
import { describe, it } from "@std/testing/bdd";
3+
import { expect } from "@std/expect";
44
import {
55
all,
66
any,

custom.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { describe, it } from "https://deno.land/[email protected]/testing/bdd.ts";
2-
import { expect } from "https://deno.land/x/[email protected]/mod.ts";
1+
import { describe, it } from "@std/testing/bdd";
2+
import { expect } from "@std/expect";
33
import { compact, compactObject, flatmap } from "./custom.ts";
44
import { repeat } from "./itertools.ts";
55

deno.jsonc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
2-
"lock": false,
2+
"name": "@lambdalisue/itertools",
3+
"version": "0.0.0",
4+
"exports": "./mod.ts",
35
"tasks": {
4-
"test": "deno test --unstable -A --parallel",
5-
"check": "deno check --unstable $(find . -name '*.ts')",
6-
"upgrade": "deno run -A https://deno.land/x/udd/main.ts $(find . -name '*.ts')"
6+
"test": "deno test -A --parallel --doc --shuffle",
7+
"check": "deno check **/*.ts"
8+
},
9+
"imports": {
10+
"@std/assert": "jsr:@std/assert@^0.221.0",
11+
"@std/expect": "jsr:@std/expect@^0.221.0",
12+
"@std/testing": "jsr:@std/testing@^0.221.0",
13+
"https://deno.land/x/itertools@$MODULE_VERSION/": "./"
714
}
815
}

itertools.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { describe, it } from "https://deno.land/[email protected]/testing/bdd.ts";
2-
import { expect } from "https://deno.land/x/[email protected]/mod.ts";
1+
import { describe, it } from "@std/testing/bdd";
2+
import { expect } from "@std/expect";
33
import { all, iter, range } from "./builtins.ts";
44
import {
55
chain,

more-itertools.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { describe, it } from "https://deno.land/[email protected]/testing/bdd.ts";
2-
import { expect } from "https://deno.land/x/[email protected]/mod.ts";
1+
import { describe, it } from "@std/testing/bdd";
2+
import { expect } from "@std/expect";
33
import { range } from "./builtins.ts";
44
import { first } from "./custom.ts";
55
import {

0 commit comments

Comments
 (0)