Skip to content

Commit

Permalink
Revert "Astro integration"
Browse files Browse the repository at this point in the history
This reverts the below commits:

5b347b2
e564a8c

Re-open #50
  • Loading branch information
dahlia committed Jul 24, 2024
1 parent 235629d commit 48e1a70
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 244 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"activitypub",
"aitertools",
"apidoc",
"astro",
"bccs",
"btos",
"callouts",
Expand Down
9 changes: 0 additions & 9 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,6 @@ To be released.
the `getAuthenticatedDocumentLoader()` function, which can be used to
allow fetching private network addresses.

- Added `@fedify/fedify/x/astro` module for integrating with [Astro]
middleware. [[#50]]

- Added `createMiddleware()` function.
- Added `createFetchOptions()` function.
- Added `ContextDataFactory` type.

- Added `fedify init` subcommand. [[#105]]

- Added more log messages using the [LogTape] library. Currently the below
Expand All @@ -147,7 +140,6 @@ To be released.

[@fedify/cli]: https://www.npmjs.com/package/@fedify/cli
[#6]: https://github.com/dahlia/fedify/issues/6
[#50]: https://github.com/dahlia/fedify/issues/50
[#53]: https://github.com/dahlia/fedify/issues/53
[#66]: https://github.com/dahlia/fedify/issues/66
[#70]: https://github.com/dahlia/fedify/issues/70
Expand All @@ -157,7 +149,6 @@ To be released.
[#104]: https://github.com/dahlia/fedify/issues/104
[#105]: https://github.com/dahlia/fedify/issues/105
[#107]: https://github.com/dahlia/fedify/issues/107
[Astro]: https://astro.build/


Version 0.11.3
Expand Down
1 change: 0 additions & 1 deletion cli/import_map.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"uri-template-router": "npm:uri-template-router@^0.0.16",
"url-template": "npm:url-template@^3.1.1",
"@fedify/fedify/sig": "../src/./sig/mod.ts",
"@fedify/fedify/x/astro": "../src/./x/astro.ts",
"@cliffy/ansi": "jsr:@cliffy/ansi@1.0.0-rc.4",
"@cliffy/command": "jsr:@cliffy/command@1.0.0-rc.4",
"@cliffy/prompt": "jsr:@cliffy/prompt@1.0.0-rc.4",
Expand Down
54 changes: 1 addition & 53 deletions cli/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const packageManagerAvailabilities: Record<PackageManager, boolean> = Object
),
);

type WebFramework = "astro" | "fresh" | "hono";
type WebFramework = "fresh" | "hono";

interface WebFrameworkInitializer {
command?: [string, ...string[]];
Expand All @@ -91,58 +91,6 @@ interface WebFrameworkDescription {
}

const webFrameworks: Record<WebFramework, WebFrameworkDescription> = {
astro: {
label: "Astro",
runtimes: ["bun", "node"],
init: (runtime, pm) => ({
command: [
runtime === "bun" ? "bun" : pm,
"create",
"astro@^4.8.0",
...(pm === "npm" ? ["--"] : []),
"--skip-houston",
"--typescript=strict",
"--no-install",
"--no-git",
".",
],
federationFile: "src/federation.ts",
files: {
"src/middleware.ts": `\
import type { MiddlewareHandler } from "astro";
import { createMiddleware } from "@fedify/fedify/x/astro";
import federation from "./federation";
export const onRequest: MiddlewareHandler = createMiddleware(
federation,
(astroContext) => undefined,
);
`,
"astro.config.mjs": `\
import { defineConfig } from "astro/config";
// https://astro.build/config
export default defineConfig({
output: "server"
});
`,
},
instruction: `
To start the server, run the following command:
${
colors.bold.green(
runtime === "bun" ? "bun dev" : `${pm} run dev`,
)
}
Then, try look up an actor from your server:
${colors.bold.green("fedify lookup http://localhost:4321/users/john")}
`,
}),
},
fresh: {
label: "Fresh",
runtimes: ["deno"],
Expand Down
32 changes: 0 additions & 32 deletions docs/manual/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,6 @@ Fedify is designed to be used together with web frameworks. This document
explains how to integrate Fedify with web frameworks.


Astro
-----

*This API is available since Fedify 0.12.0.*

[Astro] is a web framework for content-driven websites. Fedify has
the `@fedify/fedify/x/astro` module that provides a middleware to integrate
Fedify with Astro. Put the following code in your *src/middleware.ts* file:

~~~~ typescript
import type { MiddlewareHandler } from "astro";
import { createFederation } from "@fedify/fedify";
import { createMiddleware } from "@fedify/fedify/x/astro";

const federation = createFederation<string>({
// Omitted for brevity; see the related section for details.
});

export const onRequest: MiddlewareHandler = createMiddleware(
federation,
(astroContext) => "context data",
);
~~~~

> [!NOTE]
>
> Astro integration requires [on-demand server rendering][1].
[Astro]: https://astro.build/
[1]: https://docs.astro.build/en/guides/server-side-rendering/


Hono
----

Expand Down
1 change: 0 additions & 1 deletion src/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"./sig": "./sig/mod.ts",
"./vocab": "./vocab/mod.ts",
"./webfinger": "./webfinger/mod.ts",
"./x/astro": "./x/astro.ts",
"./x/denokv": "./x/denokv.ts",
"./x/fresh": "./x/fresh.ts",
"./x/hono": "./x/hono.ts"
Expand Down
147 changes: 0 additions & 147 deletions src/x/astro.ts

This file was deleted.

0 comments on commit 48e1a70

Please sign in to comment.