Skip to content

Commit

Permalink
Include all resources in desktop app and export Builder (#1771)
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin authored Dec 19, 2024
1 parent 81a0607 commit 5ba0cd9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
54 changes: 26 additions & 28 deletions development/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,37 +787,35 @@ class Builder {
build.files[`/${filename}`] = new BuildFile(absolutePath);
}

if (this.mode !== "desktop") {
for (const [filename, absolutePath] of recursiveReadDirectory(
this.docsRoot
)) {
if (!filename.endsWith(".md")) {
continue;
}
const extensionSlug = filename.split(".")[0];
const file = new DocsFile(absolutePath, extensionSlug);
extensionsWithDocs.add(extensionSlug);
build.files[`/${extensionSlug}.html`] = file;
for (const [filename, absolutePath] of recursiveReadDirectory(
this.docsRoot
)) {
if (!filename.endsWith(".md")) {
continue;
}
const extensionSlug = filename.split(".")[0];
const file = new DocsFile(absolutePath, extensionSlug);
extensionsWithDocs.add(extensionSlug);
build.files[`/${extensionSlug}.html`] = file;
}

const scratchblocksPath = pathUtil.join(
__dirname,
"../node_modules/@turbowarp/scratchblocks/build/scratchblocks.min.js"
);
build.files["/docs-internal/scratchblocks.js"] = new BuildFile(
scratchblocksPath
);
const scratchblocksPath = pathUtil.join(
__dirname,
"../node_modules/@turbowarp/scratchblocks/build/scratchblocks.min.js"
);
build.files["/docs-internal/scratchblocks.js"] = new BuildFile(
scratchblocksPath
);

build.files["/index.html"] = new HomepageFile(
extensionFiles,
extensionImages,
featuredExtensionSlugs,
extensionsWithDocs,
samples,
this.mode
);
build.files["/sitemap.xml"] = new SitemapFile(build);
}
build.files["/index.html"] = new HomepageFile(
extensionFiles,
extensionImages,
featuredExtensionSlugs,
extensionsWithDocs,
samples,
this.mode
);
build.files["/sitemap.xml"] = new SitemapFile(build);

build.files["/generated-metadata/extensions-v0.json"] =
new JSONMetadataFile(
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@turbowarp/extensions",
"version": "0.0.1",
"description": "Unsandboxed extensions for TurboWarp",
"exports": {
"./builder": "./development/builder.js"
},
"scripts": {
"start": "node development/server.js",
"dev": "node development/server.js",
Expand Down

0 comments on commit 5ba0cd9

Please sign in to comment.