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

chore: switch to JSR-oriented codebase #4650

Merged
merged 15 commits into from
Apr 29, 2024
  •  
  •  
  •  
25 changes: 4 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
fail-fast: false
matrix:
deno:
- v1.x
# TODO(kt3k): Enable this after CLI v1.43.0 released
# - v1.x
- canary
os:
- ubuntu-latest
Expand Down Expand Up @@ -65,16 +66,6 @@ jobs:
with:
name: ${{ matrix.os }}-${{ matrix.deno }}

- name: Release if version change
if: |
matrix.os == 'ubuntu-latest' &&
github.repository == 'denoland/deno_std' &&
github.ref == 'refs/heads/main'
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.DENOBOT_PAT }}
run: ./_tools/release/03_release.ts

lint:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
Expand Down Expand Up @@ -147,7 +138,7 @@ jobs:

- name: Rebuild Wasm and verify it hasn't changed
if: success() && steps.source.outputs.modified == 'true'
run: deno task --cwd ${{ matrix.module }} wasmbuild --check
run: deno task --cwd ${{ matrix.module }} --config deno.json wasmbuild --check

publish-dry-run:
runs-on: ubuntu-latest
Expand All @@ -165,13 +156,5 @@ jobs:
with:
deno-version: canary

- name: Convert to workspace
run: deno run -A ./_tools/convert_to_workspace.ts

- name: Test
# TODO(kt3k): remove doc-test task when the below issue resolved
# https://github.com/denoland/deno/issues/23430
run: deno task test && deno task doc-test

- name: Publish (dry run)
run: deno publish --allow-dirty --dry-run
run: deno publish --dry-run
7 changes: 2 additions & 5 deletions .github/workflows/workspace_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ jobs:
with:
deno-version: canary

- name: Convert to workspace
run: deno run -A ./_tools/convert_to_workspace.ts

- name: Format
run: deno fmt
run: deno fmt --check

- name: Test
run: deno task test

- name: Publish to JSR
run: deno publish --allow-dirty
run: deno publish
48 changes: 8 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,69 +12,37 @@ High-quality APIs for [Deno](https://deno.com/) and the web. Use fearlessly.
## Get Started

```ts
import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts";
import { copy } from "@std/fs/copy";

await copy("./foo", "./bar");
```

See [here](#recommended-usage) for recommended usage patterns.

## Documentation

Check out the documentation [here](https://deno.land/std?doc).

## Recommended Usage

1. Include the version of the library in the import specifier.

Good:
```ts
import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts";
import { copy } from "jsr:@std/fs@0.224.0/copy";
```

1. Only import modules that you require.

Bad (when using only one function):
```ts
import * as fs from "https://deno.land/std@$STD_VERSION/fs/mod.ts";
import * as fs from "@std/fs";
```

Good (when using only one function):
```ts
import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts";
import { copy } from "@std/fs/copy";
```

Good (when using multiple functions):
```ts
import * as fs from "https://deno.land/std@$STD_VERSION/fs/mod.ts";
```

1. Do not import symbols with a name _prefixed_ by an underscore (they're not
intended for public use).

Bad:
```ts, ignore
import { _format } from "https://deno.land/std@$STD_VERSION/path/_common/format.ts";
```

1. Do not import modules with a directory or filename _prefixed_ by an
underscore (they're not intended for public use).

Bad:
```ts, ignore
import { createLPS } from "https://deno.land/std@$STD_VERSION/streams/_common.ts";
```

Good:
```ts
import { TextLineStream } from "https://deno.land/std@$STD_VERSION/streams/text_line_stream.ts";
```

1. Do not import test modules or test data.

Bad:
```ts
import { test } from "https://deno.land/std@$STD_VERSION/front_matter/test.ts";
import * as fs from "@std/fs";
```

## Packages
Expand Down Expand Up @@ -183,10 +151,10 @@ every new version of the Deno CLI (including patch versions).

## Badge

[![Built with the Deno Standard Library](./badge.svg)](https://deno.land/std)
[![Built with the Deno Standard Library](./badge.svg)](https://jsr.io/@std)

```html
<a href="https://deno.land/std">
<a href="https://jsr.io/@std">
<img
width="135"
height="20"
Expand All @@ -197,5 +165,5 @@ every new version of the Deno CLI (including patch versions).
```

```md
[![Built with the Deno Standard Library](https://raw.githubusercontent.com/denoland/deno_std/main/badge.svg)](https://deno.land/std)
[![Built with the Deno Standard Library](https://raw.githubusercontent.com/denoland/deno_std/main/badge.svg)](https://jsr.io/@std)
```
2 changes: 2 additions & 0 deletions _tools/check_circular_package_dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
} from "@deno/graph";

/**
* TODO(kt3k): This script stopped working after JSR migration. Enable this script.
*
* Checks for circular dependencies in the std packages.
*
* Usage: deno run -A _tools/check_circular_package_dependencies.ts
Expand Down
2 changes: 2 additions & 0 deletions _tools/check_deprecation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
/**
* TODO(kt3k): This stopped working after JSR migration. Enable this check.
*
* Checks whether all deprecated tags have a message.
*
* @example
Expand Down
123 changes: 0 additions & 123 deletions _tools/check_doc_imports.ts

This file was deleted.

Loading