Skip to content

Commit

Permalink
JS: Transform SDK name for cross compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Nov 1, 2024
1 parent 9736f8e commit 6e022a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion applications/system/js_app/packages/fz-sdk/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import json5 from "json5";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const cfwSdkName = "@next-flip/fz-sdk-mntm/";
const ofwSdkName = "@flipperdevices/fz-sdk/";

async function build(config) {
await esbuild.build({
entryPoints: ["./dist/index.js"],
Expand Down Expand Up @@ -74,7 +77,8 @@ async function build(config) {
let outContents = fs.readFileSync(config.output, "utf8");
outContents = "let exports = {};\n" + outContents;

// TODO: Transform CFW SDK name to OFW SDK name so all firmwares understand it
// Transform CFW SDK name to OFW SDK name so all firmwares understand it
outContents = outContents.replaceAll(`require("${cfwSdkName}`, `require("${ofwSdkName}`);

if (config.enforceSdkVersion) {
const version = json5.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8")).version;
Expand Down

0 comments on commit 6e022a6

Please sign in to comment.