@blastlauncher/web 0.0.0-stage → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +85 -2
- package/assets/almostnode.mjs +735 -0
- package/assets/blast-sources.json +1 -0
- package/assets/blast-web.js +35 -0
- package/assets/esbuild.mjs +2695 -0
- package/assets/esbuild.wasm +0 -0
- package/dist/browser-bundle.d.ts +54 -0
- package/dist/browser-bundle.js +441 -0
- package/dist/browser-install.d.ts +66 -0
- package/dist/browser-install.js +326 -0
- package/dist/bundle-config.d.ts +10 -0
- package/dist/bundle-config.js +31 -0
- package/dist/bundles.d.ts +29 -0
- package/dist/bundles.js +126 -0
- package/dist/capabilities.d.ts +66 -0
- package/dist/capabilities.js +288 -0
- package/dist/custom-element.d.ts +6 -0
- package/dist/custom-element.js +36 -0
- package/dist/default-renderer.d.ts +27 -0
- package/dist/default-renderer.js +145 -0
- package/dist/default-styles.d.ts +2 -0
- package/dist/default-styles.js +28 -0
- package/dist/extension-files.d.ts +21 -0
- package/dist/extension-files.js +86 -0
- package/dist/handlers.d.ts +18 -0
- package/dist/handlers.js +22 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +17 -0
- package/dist/launch.d.ts +11 -0
- package/dist/launch.js +29 -0
- package/dist/prebuilt.d.ts +24 -0
- package/dist/prebuilt.js +112 -0
- package/dist/render.d.ts +62 -0
- package/dist/render.js +288 -0
- package/dist/runtime-port.d.ts +5 -0
- package/dist/runtime-port.js +8 -0
- package/dist/sandbox.d.ts +25 -0
- package/dist/sandbox.js +71 -0
- package/dist/session.d.ts +77 -0
- package/dist/session.js +520 -0
- package/dist/source.d.ts +16 -0
- package/dist/source.js +42 -0
- package/package.json +33 -4
- package/sandbox/almostnode-full.mjs +19713 -0
- package/sandbox/index.html +1 -0
package/dist/source.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Parses only the source shape accepted by the browser demo. */
|
|
2
|
+
export function parseExtensionSource(value) {
|
|
3
|
+
const source = value.trim();
|
|
4
|
+
if (!source)
|
|
5
|
+
throw new Error("Enter a GitHub extension URL or name");
|
|
6
|
+
if (!source.includes("://")) {
|
|
7
|
+
if (source.includes("/") || source.includes("\\"))
|
|
8
|
+
throw new Error("Extension names cannot contain a path separator");
|
|
9
|
+
return {
|
|
10
|
+
kind: "github",
|
|
11
|
+
owner: "raycast",
|
|
12
|
+
repo: "extensions",
|
|
13
|
+
ref: "main",
|
|
14
|
+
path: `extensions/${source}`,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
let url;
|
|
18
|
+
try {
|
|
19
|
+
url = new URL(source);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
throw new Error("Invalid extension URL");
|
|
23
|
+
}
|
|
24
|
+
if (url.protocol !== "https:" || url.hostname !== "github.com")
|
|
25
|
+
throw new Error("Extension URL must use https://github.com");
|
|
26
|
+
const parts = url.pathname.split("/").filter(Boolean);
|
|
27
|
+
if (parts[2] !== "tree" || parts.length < 5)
|
|
28
|
+
throw new Error("GitHub URL must be /<owner>/<repo>/tree/<ref>/<path>");
|
|
29
|
+
const [owner, repo, , ref, ...path] = parts;
|
|
30
|
+
if (!owner || !repo || !ref || path.length === 0)
|
|
31
|
+
throw new Error("GitHub URL must include an extension path");
|
|
32
|
+
return { kind: "github", owner, repo, ref, path: path.join("/") };
|
|
33
|
+
}
|
|
34
|
+
export function isTextExtension(path) {
|
|
35
|
+
return /\.(?:cjs|css|html?|js|jsx|json|md|mjs|ts|tsx|txt|yaml|yml)$/i.test(path);
|
|
36
|
+
}
|
|
37
|
+
export function canUseLocalFixture(source, enabled) {
|
|
38
|
+
return (
|
|
39
|
+
// Fixtures are keyed by extension name, and only test builds enable them, so
|
|
40
|
+
// any ref may use them (the dev e2e serves its catalog at ref "fixture").
|
|
41
|
+
enabled && source.owner === "raycast" && source.repo === "extensions");
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blastlauncher/web",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
"type": "module",
|
|
4
|
+
"exports": {
|
|
5
|
+
".": {
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"import": "./dist/index.js",
|
|
8
|
+
"default": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@blastlauncher/client-core": "3.0.0-alpha.2",
|
|
13
|
+
"@blastlauncher/protocol": "3.0.0-alpha.2",
|
|
14
|
+
"semver": "7.8.5"
|
|
15
|
+
},
|
|
16
|
+
"version": "3.0.0-alpha.2",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/BlastLauncher/blast.git",
|
|
21
|
+
"directory": "packages/web"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/BlastLauncher/blast#readme",
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=24.20.0"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"schema",
|
|
30
|
+
"LICENSE",
|
|
31
|
+
"README.md",
|
|
32
|
+
"assets",
|
|
33
|
+
"sandbox"
|
|
34
|
+
]
|
|
35
|
+
}
|