Skip to content

Commit

Permalink
refactor: replace website with a redirect to docs.deno.com (#1380)
Browse files Browse the repository at this point in the history
Part of migration to use https://docs.deno.com/lint/ instead of
bespoken https://lint.deno.land website.
  • Loading branch information
bartlomieju authored Dec 30, 2024
1 parent 564b828 commit b4994da
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 1,475 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ jobs:
if: contains(matrix.os, 'ubuntu')
run: deno run --allow-run --allow-env ./tools/lint.ts --release

- name: Check if www/static/docs.json is up-to-date
if: contains(matrix.os, 'ubuntu')
run: diff <(./target/release/examples/dlint rules --json) www/static/docs.json

- name: Benchmarks
if: contains(matrix.os, 'ubuntu')
run: deno run -A --quiet benchmarks/benchmarks.ts
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,5 @@ Before submitting, please make sure the following is done:
3. Ensure `cargo test` passes.
4. Format your code with `deno run --allow-run tools/format.ts`
5. Make sure `deno run --allow-run --allow-env tools/lint.ts` passes.
6. If you've added a new rule:
1. Run `cargo build --example dlint --all-features`
2. Update docs by running the generated binary with these arguments
`./target/debug/examples/dlint rules --json > www/static/docs.json`
6. If you've added a new rule, open a PR to
https://github.com/denoland/deno-docs with a documentation for a rule.
3 changes: 0 additions & 3 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"lock": false,
"tasks": {
"update-docs": "cargo run --features=docs --example dlint rules --json > www/static/docs.json"
},
"exclude": [
"target",
"examples",
Expand Down
11 changes: 0 additions & 11 deletions www/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions www/components/Badge.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions www/components/CommonHead.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions www/components/Footer.tsx

This file was deleted.

53 changes: 0 additions & 53 deletions www/components/Header.tsx

This file was deleted.

58 changes: 0 additions & 58 deletions www/components/Rule.tsx

This file was deleted.

23 changes: 0 additions & 23 deletions www/deno.json

This file was deleted.

5 changes: 0 additions & 5 deletions www/dev.ts

This file was deleted.

25 changes: 0 additions & 25 deletions www/fresh.gen.ts

This file was deleted.

Empty file removed www/islands/.gitkeep
Empty file.
40 changes: 30 additions & 10 deletions www/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
/// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
const rulePat = new URLPattern({
pathname: "/rules/:rule",
}, {
ignoreCase: true,
});

import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
Deno.serve((req) => {
const url = new URL(req.url);

import twindPlugin from "$fresh/plugins/twind.ts";
import twindConfig from "./twind.config.ts";
const ruleMatch = rulePat.exec(req.url);
const maybeRule = ruleMatch?.pathname.groups.rule;

await start(manifest, { plugins: [twindPlugin(twindConfig)] });
if (maybeRule) {
return Response.redirect(
`https://docs.deno.com/lint/rules/${maybeRule}`,
301,
);
}

if (url.pathname.startsWith("/ignoring-rules")) {
// TODO(bartlomieju): verify the anchor is not changed or use
// "go" url
return Response.redirect(
`https://docs.deno.com/go/lint-ignore`,
301,
);
}

return Response.redirect(
"https://docs.deno.com/runtime/reference/cli/lint/",
301,
);
});
16 changes: 0 additions & 16 deletions www/routes/_app.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions www/routes/_layout.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions www/routes/ignoring-rules.tsx

This file was deleted.

Loading

0 comments on commit b4994da

Please sign in to comment.