Add js sdk changes

With type declarations and various missing parts added by Willy-JL
This commit is contained in:
MX
2024-11-05 09:49:46 +03:00
parent 8a2cf4dc3d
commit 79caf7bf72
19 changed files with 378 additions and 26 deletions

View File

@@ -1,11 +1,15 @@
# Flipper Zero JavaScript SDK Wizard
# Flipper Unleashed Firmware JavaScript SDK Wizard
This package contains an interactive wizard that lets you scaffold a JavaScript
application for Flipper Zero.
application for Flipper Zero using the Custom Unleashed Firmware JS SDK.
This is a fork of the [Official Flipper Zero JS SDK Wizard](https://www.npmjs.com/package/@flipperdevices/create-fz-app),
configured to use the [Unleashed FW JavaScript SDK]((https://www.npmjs.com/package/@darkflippers/fz-sdk-ul)) instead.
No other changes are included.
## Getting started
Create your application using the interactive wizard:
```shell
npx @flipperdevices/create-fz-app@latest
npx @darkflippers/create-fz-app-ul@latest
```
Then, enter the directory with your application and launch it:

View File

@@ -1,10 +1,15 @@
{
"name": "@flipperdevices/create-fz-app",
"version": "0.1.0",
"description": "Template package for JS apps Flipper Zero",
"name": "@darkflippers/create-fz-app-ul",
"version": "0.1.1",
"description": "Template package for JS apps for Flipper Zero using Unleashed Firmware JS SDK",
"bin": "index.js",
"type": "module",
"keywords": [
"unleashed",
"unleashed firmware",
"ul",
"darkflippers",
"flipper cfw js",
"flipper",
"flipper zero"
],
@@ -12,7 +17,7 @@
"license": "GPL-3.0-only",
"repository": {
"type": "git",
"url": "git+https://github.com/flipperdevices/flipperzero-firmware.git",
"url": "git+https://github.com/DarkFlippers/unleashed-firmware.git",
"directory": "applications/system/js_app/packages/create-fz-app"
},
"dependencies": {

View File

@@ -1,9 +1,9 @@
// import modules
// caution: `eventLoop` HAS to be imported before `gui`, and `gui` HAS to be
// imported before any `gui` submodules.
import * as eventLoop from "@flipperdevices/fz-sdk/event_loop";
import * as gui from "@flipperdevices/fz-sdk/gui";
import * as dialog from "@flipperdevices/fz-sdk/gui/dialog";
import * as eventLoop from "@darkflippers/fz-sdk-ul/event_loop";
import * as gui from "@darkflippers/fz-sdk-ul/gui";
import * as dialog from "@darkflippers/fz-sdk-ul/gui/dialog";
// a common pattern is to declare all the views that your app uses on one object
const views = {

View File

@@ -2,11 +2,11 @@
"name": "<app_name>",
"version": "1.0.0",
"scripts": {
"build": "tsc && node node_modules/@flipperdevices/fz-sdk/sdk.js build",
"start": "npm run build && node node_modules/@flipperdevices/fz-sdk/sdk.js upload"
"build": "tsc && node node_modules/@darkflippers/fz-sdk-ul/sdk.js build",
"start": "npm run build && node node_modules/@darkflippers/fz-sdk-ul/sdk.js upload"
},
"devDependencies": {
"@flipperdevices/fz-sdk": "^0.1",
"@darkflippers/fz-sdk-ul": "^0.1",
"typescript": "^5.6.3"
}
}

View File

@@ -5,13 +5,14 @@
"module": "CommonJS",
"noLib": true,
"target": "ES2015",
"types": [],
},
"files": [
"./node_modules/@flipperdevices/fz-sdk/global.d.ts",
"./node_modules/@darkflippers/fz-sdk-ul/global.d.ts",
],
"include": [
"./**/*.ts",
"./**/*.js"
"./**/*.js",
],
"exclude": [
"./node_modules/**/*",