Unverified Commit 5829c3ef authored by Hong Minhee's avatar Hong Minhee
Browse files

Revert "Astro integration"

This reverts the below commits:

5b347b26
e564a8c0

Re-open https://github.com/dahlia/fedify/issues/50
parent 235629d5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@
    "activitypub",
    "aitertools",
    "apidoc",
    "astro",
    "bccs",
    "btos",
    "callouts",
+0 −9
Original line number Diff line number Diff line
@@ -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
@@ -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
@@ -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
+0 −1
Original line number Diff line number Diff line
@@ -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",
+1 −53
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ const packageManagerAvailabilities: Record<PackageManager, boolean> = Object
    ),
  );

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

interface WebFrameworkInitializer {
  command?: [string, ...string[]];
@@ -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"],
+1 −4
Original line number Diff line number Diff line
@@ -90,8 +90,7 @@ project. It will ask you a few questions to set up the project:

 -  JavaScript runtime: [Deno], [Bun], or [Node.js]
 -  Package manager (if Node.js): [npm], [pnpm], or [Yarn]
 -  Web framework: Bare-bones, [Astro] (unless Deno), [Fresh] (if Deno),
    or [Hono]
 -  Web framework: Bare-bones, [Fresh] (if Deno), or [Hono]
 -  Key-value store: In-memory, [Redis], or [Deno KV] (if Deno)
 -  Message queue: In-memory, [Redis], or [Deno KV] (if Deno)

@@ -101,7 +100,6 @@ interactive prompts:
[npm]: https://www.npmjs.com/
[pnpm]: https://pnpm.io/
[Yarn]: https://yarnpkg.com/
[Astro]: https://astro.build/
[Fresh]: https://fresh.deno.dev/
[Hono]: https://hono.dev/
[Redis]: https://redis.io/
@@ -133,7 +131,6 @@ It's ignored if you choose Deno or Bun as the JavaScript runtime.
You can specify the web framework to integrate with Fedify by using
the `-w`/`--web-framework` option.  The available options are:

 -  `astro`: [Astro] (unless Deno)
 -  `fresh`: [Fresh] (if Deno)
 -  `hono`: [Hono]

Loading