Skip to content

Commit dabe94d

Browse files
author
thorwebdev
committed
chore: move all imports to import_map.
1 parent 8c2255a commit dabe94d

File tree

10 files changed

+27
-26
lines changed

10 files changed

+27
-26
lines changed

Diff for: supabase/functions/cloudflare-turnstile/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// https://deno.land/manual/getting_started/setup_your_environment
33
// This enables autocomplete, go to definition, etc.
44

5-
import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
5+
import { serve } from "std/server";
66
import { corsHeaders } from "../_shared/cors.ts";
77

88
console.log("Hello from Cloudflare Trunstile!");

Diff for: supabase/functions/discord-bot/index.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
// Sift is a small routing library that abstracts away details like starting a
66
// listener on a port, and provides a simple function (serve) that has an API
77
// to invoke a function for a specific path.
8-
import {
9-
json,
10-
serve,
11-
validateRequest,
12-
} from "https://deno.land/x/[email protected]/mod.ts";
8+
import { json, serve, validateRequest } from "sift";
139
// TweetNaCl is a cryptography library that we use to verify requests
1410
// from Discord.
1511
import nacl from "https://cdn.skypack.dev/[email protected]?dts";

Diff for: supabase/functions/hello/index.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22
// https://deno.land/manual/getting_started/setup_your_environment
33
// This enables autocomplete, go to definition, etc.
44

5-
import { serve } from "https://deno.land/std@0.131.0/http/server.ts"
5+
import { serve } from "std/server";
66

7-
console.log("Hello from Functions!")
7+
console.log("Hello from Functions!");
88

99
serve(async (req) => {
10-
const { name } = await req.json()
10+
const { name } = await req.json();
1111
const data = {
1212
message: `Hello ${name}!`,
13-
}
13+
};
1414

15-
return new Response(
16-
JSON.stringify(data),
17-
{ headers: { "Content-Type": "application/json" } },
18-
)
19-
})
15+
return new Response(JSON.stringify(data), {
16+
headers: { "Content-Type": "application/json" },
17+
});
18+
});
2019

2120
// To invoke:
2221
// curl -i --location --request POST 'http://localhost:54321/functions/v1/' \

Diff for: supabase/functions/import_map.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"imports": {
3-
"stripe": "https://esm.sh/[email protected]?target=deno"
3+
"og_edge": "https://deno.land/x/[email protected]/mod.ts",
4+
"grammy": "https://deno.land/x/[email protected]/mod.ts",
5+
"react": "https://esm.sh/[email protected]",
6+
"std/server": "https://deno.land/[email protected]/http/server.ts",
7+
"stripe": "https://esm.sh/[email protected]?target=deno",
8+
"sift": "https://deno.land/x/[email protected]/mod.ts",
9+
"@supabase/supabase-js": "https://esm.sh/@supabase/[email protected]"
410
}
511
}

Diff for: supabase/functions/og-image-storage-cdn/handler.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from "https://esm.sh/react@18.2.0";
2-
import { ImageResponse } from "https://deno.land/x/og_edge@0.0.4/mod.ts";
3-
import { createClient } from "https://esm.sh/@supabase/supabase-js@2";
1+
import React from "react";
2+
import { ImageResponse } from "og_edge";
3+
import { createClient } from "@supabase/supabase-js";
44

55
const STORAGE_URL =
66
"https://bljghubhkofddfrezkhn.supabase.co/storage/v1/object/public/images/edgy-images/";

Diff for: supabase/functions/og-image-storage-cdn/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// https://deno.land/manual/getting_started/setup_your_environment
33
// This enables autocomplete, go to definition, etc.
44

5-
import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
5+
import { serve } from "std/server";
66
import handler from "./handler.tsx";
77

88
console.log("Hello from og-image-storage-cdn Function!");

Diff for: supabase/functions/og-image/handler.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from "https://esm.sh/react@18.2.0";
2-
import { ImageResponse } from "https://deno.land/x/og_edge@0.0.4/mod.ts";
1+
import React from "react";
2+
import { ImageResponse } from "og_edge";
33

44
export default function handler(req: Request) {
55
return new ImageResponse(

Diff for: supabase/functions/og-image/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// https://deno.land/manual/getting_started/setup_your_environment
33
// This enables autocomplete, go to definition, etc.
44

5-
import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
5+
import { serve } from "std/server";
66
import handler from "./handler.tsx";
77

88
console.log("Hello from og-image Function!");

Diff for: supabase/functions/stripe-webhook/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// https://deno.land/manual/getting_started/setup_your_environment
33
// This enables autocomplete, go to definition, etc.
44

5-
import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
5+
import { serve } from "std/server";
66

77
// Import via bare specifier thanks to the import_map.json file.
88
import Stripe from "stripe";

Diff for: supabase/functions/telegram-bot/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// https://deno.land/manual/getting_started/setup_your_environment
33
// This enables autocomplete, go to definition, etc.
44

5-
import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
5+
import { serve } from "std/server";
66

77
console.log(`Function "telegram-bot" up and running!`);
88

9-
import { Bot, webhookCallback } from "https://deno.land/x/grammy@v1.8.3/mod.ts";
9+
import { Bot, webhookCallback } from "grammy";
1010

1111
const bot = new Bot(Deno.env.get("BOT_TOKEN") || "");
1212

0 commit comments

Comments
 (0)