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

Feature/desktop embed param #585

Merged
merged 5 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update bin/dump_artifacts to generate stlite-manifest.json
  • Loading branch information
whitphx committed Jul 3, 2023
commit ff9e10b34ed3005292782f9dcaf9c89c2e32f8e9
17 changes: 17 additions & 0 deletions packages/desktop/bin/dump_artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
version as pyodideVersion,
} from "pyodide";
import { parseRequirementsTxt } from "@stlite/common";
import type { DesktopAppManifest } from "../electron/main";

// @ts-ignore
global.fetch = fetch; // The global `fetch()` is necessary for micropip.install() to load the remote packages.
Expand Down Expand Up @@ -306,6 +307,21 @@ async function downloadPyodideBuiltinPackageWheels(
);
}

async function dumpManifest() {
const packageJson = require(path.resolve(__dirname, "../package.json"));
const stliteManifest = packageJson.stlite?.desktop || {};
const manifestData: DesktopAppManifest = {
embed: stliteManifest.embed || false,
};
const manifestPath = path.resolve(__dirname, "../build/stlite-manifest.json");
const manifestDataStr = JSON.stringify(manifestData, null, 2);
console.log(`Dump the manifest file -> ${manifestPath}`);
console.log(manifestDataStr);
await fsPromises.writeFile(manifestPath, manifestDataStr, {
encoding: "utf-8",
});
}

yargs(hideBin(process.argv))
.command(
"* <appHomeDirSource> [packages..]",
Expand Down Expand Up @@ -394,4 +410,5 @@ yargs(hideBin(process.argv))
packages: usedBuiltinPackages,
destDir,
});
await dumpManifest();
});
4 changes: 2 additions & 2 deletions packages/desktop/bin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"target": "ESNext",
"module": "commonjs",
"outDir": ".",
"rootDir": ".",
"rootDir": "..",
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["."],
"include": ["./bin", "./electron"],
"exclude": []
}