Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include all resources in desktop app and export Builder #1771

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading