Skip to content

Commit

Permalink
fix: Types ignore netlify folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ff6347 committed Dec 3, 2024
1 parent b8aa891 commit 5354743
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,26 @@ pnpm-debug.log*

# jetbrains setting folder
.idea/
.netlify/build/[email protected]
.netlify/build/_noop-middleware.mjs
.netlify/build/entry.mjs
.netlify/build/manifest_BBAk5QeF.mjs
.netlify/build/renderers.mjs
.netlify/build/chunks/_@astrojs-ssr-adapter_CvSoi7hX.mjs
.netlify/build/chunks/astro/assets-service_Lr3skfey.mjs
.netlify/build/chunks/astro/server_C4pkSLoS.mjs
.netlify/build/pages/_image.astro.mjs
.netlify/build/pages/index.astro.mjs
.netlify/build/pages/api/package.astro.mjs
.netlify/v1/functions/ssr/ssr.mjs
.netlify/v1/functions/ssr/.netlify/build/_noop-middleware.mjs
.netlify/v1/functions/ssr/.netlify/build/entry.mjs
.netlify/v1/functions/ssr/.netlify/build/manifest_BBAk5QeF.mjs
.netlify/v1/functions/ssr/.netlify/build/renderers.mjs
.netlify/v1/functions/ssr/.netlify/build/chunks/_@astrojs-ssr-adapter_CvSoi7hX.mjs
.netlify/v1/functions/ssr/.netlify/build/chunks/astro/assets-service_Lr3skfey.mjs
.netlify/v1/functions/ssr/.netlify/build/chunks/astro/server_C4pkSLoS.mjs
.netlify/v1/functions/ssr/.netlify/build/pages/_image.astro.mjs
.netlify/v1/functions/ssr/.netlify/build/pages/index.astro.mjs
.netlify/v1/functions/ssr/.netlify/build/pages/api/package.astro.mjs
.netlify/v1/functions/ssr/src/pages/index.astro
14 changes: 6 additions & 8 deletions src/pages/api/package.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Parser } from "tar";
import { Parser, ReadEntry } from "tar";
import JSZip from "jszip";

import type { APIRoute } from "astro";

// Get tarball URL for scoped npm package
const getNpmTarball: (
scope: string,
scope: string | null,
packageName: string,
version?: string,
) => Promise<string> = async (scope, packageName, version = "latest") => {
Expand All @@ -22,10 +22,8 @@ const getNpmTarball: (
return data.dist.tarball;
};

const defaultModules = ["p5", "@ff6347/p5-easing"];

export const GET: APIRoute = async ({ params, request }) => {
const modules = defaultModules;
export const GET: APIRoute = async () => {
const modules = ["p5", "@ff6347/p5-easing"];

const zip = new JSZip();
const moduleContents = await Promise.all(
Expand Down Expand Up @@ -57,9 +55,9 @@ export const GET: APIRoute = async ({ params, request }) => {
await new Promise((resolve, reject) => {
const reader = new Parser();

reader.on("entry", (entry) => {
reader.on("entry", (entry: ReadEntry) => {
let content = "";
entry.on("data", (chunk) => {
entry.on("data", (chunk: Buffer) => {
content += new TextDecoder().decode(chunk);
});
entry.on("end", () => {
Expand Down

0 comments on commit 5354743

Please sign in to comment.