Skip to content

Commit

Permalink
Fix: Data URL entrypoints (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnauorriols authored Oct 22, 2024
1 parent bd19482 commit 51c3243
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ jobs:
project: happy-rat-64
root: action/tests
entrypoint: always_exclude_node_modules/main.ts
- name: data URL entrypoint
uses: ./
with:
project: happy-rat-64
root: action/tests
entrypoint: "data:,Deno.serve(() => new Response())"
2 changes: 1 addition & 1 deletion action/deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ async function parseEntrypoint(entrypoint, root, diagnosticName = "entrypoint")
return entrypointSpecifier;
}
function isURL(entrypoint) {
return entrypoint.startsWith("https://") || entrypoint.startsWith("http://") || entrypoint.startsWith("file://");
return entrypoint.startsWith("https://") || entrypoint.startsWith("http://") || entrypoint.startsWith("file://") || entrypoint.startsWith("data:") || entrypoint.startsWith("jsr:") || entrypoint.startsWith("npm:");
}
function delay(ms, options = {}) {
const { signal, persistent } = options;
Expand Down
5 changes: 4 additions & 1 deletion src/utils/entrypoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@ export async function parseEntrypoint(
export function isURL(entrypoint: string): boolean {
return entrypoint.startsWith("https://") ||
entrypoint.startsWith("http://") ||
entrypoint.startsWith("file://");
entrypoint.startsWith("file://") ||
entrypoint.startsWith("data:") ||
entrypoint.startsWith("jsr:") ||
entrypoint.startsWith("npm:");
}

0 comments on commit 51c3243

Please sign in to comment.