Skip to content

Commit

Permalink
chore: remove unused dependency
Browse files Browse the repository at this point in the history
The Astro web-api was no longer needed and was causing dependency issues
  • Loading branch information
bayssmekanique committed Feb 14, 2024
1 parent 0e119af commit 4bdba6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion packages/astro-sst/package.json
Expand Up @@ -50,7 +50,6 @@
"build": "tsc"
},
"dependencies": {
"@astrojs/webapi": "^3.0.0",
"set-cookie-parser": "^2.6.0"
},
"devDependencies": {
Expand Down
5 changes: 0 additions & 5 deletions packages/astro-sst/src/entrypoint.ts
Expand Up @@ -6,17 +6,12 @@ import type {
} from "aws-lambda";
import type { RequestHandler, ResponseMode, ResponseStream } from "./lib/types";
import { NodeApp } from "astro/app/node";
import { polyfill } from "@astrojs/webapi";
import { InternalEvent, convertFrom, convertTo } from "./lib/event-mapper.js";
import { debug } from "./lib/logger.js";
import { RenderOptions } from "astro/app";

const astroMajorVersion = parseInt(ASTRO_VERSION.split(".")[0] ?? 0);

polyfill(globalThis, {
exclude: "window document",
});

declare global {
const awslambda: {
streamifyResponse(handler: RequestHandler): RequestHandler;
Expand Down
6 changes: 3 additions & 3 deletions packages/sst/src/runtime/handlers/node.ts
Expand Up @@ -12,7 +12,6 @@ import { useRuntimeWorkers } from "../workers.js";
import { Colors } from "../../cli/colors.js";
import { Logger } from "../../logger.js";
import { findAbove, findBelow } from "../../util/fs.js";
import { lazy } from "../../util/lazy.js";

export const useNodeHandler = (): RuntimeHandler => {
const rebuildCache: Record<
Expand Down Expand Up @@ -152,7 +151,6 @@ export const useNodeHandler = (): RuntimeHandler => {
if (!ctx) {
const options: BuildOptions = {
entryPoints: [file],
platform: "node",
external: [
...forceExternal,
...(nodejs.install || []),
Expand All @@ -168,7 +166,8 @@ export const useNodeHandler = (): RuntimeHandler => {
...(isESM
? {
format: "esm",
target: isLlrt ? "es2022" : "esnext",
target: isLlrt ? "es2020" : "esnext",
platform: isLlrt ? "browser" : "node",
mainFields: ["module", "main"],
banner: {
js: [
Expand All @@ -183,6 +182,7 @@ export const useNodeHandler = (): RuntimeHandler => {
: {
format: "cjs",
target: "node14",
platform: "node",
banner: nodejs.banner
? {
js: nodejs.banner,
Expand Down

0 comments on commit 4bdba6f

Please sign in to comment.