From 5ba0cd93d369f8a910ff7ebf1cf2ba222596d603 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Thu, 19 Dec 2024 14:00:23 -0600 Subject: [PATCH] Include all resources in desktop app and export Builder (#1771) --- development/builder.js | 54 ++++++++++++++++++++---------------------- package.json | 3 +++ 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/development/builder.js b/development/builder.js index 0a91fab6b5..ad2f7835cd 100644 --- a/development/builder.js +++ b/development/builder.js @@ -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( diff --git a/package.json b/package.json index cd6f33fc37..e406b18253 100644 --- a/package.json +++ b/package.json @@ -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",