generate device-specific projects from reusable host templates
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- embedded-iot
Direzione di ricerca
Start by reading the existing ESP-IDF pocket.host.json flow mentioned in the issue, then trace how host configuration is consumed and validated during builds. The issue proposes a project-generation workflow but does not identify implementation files or settle its design; clarify the scope and expected interfaces with maintainers before starting. Done would mean device projects can reuse a versioned host while owning validated device-specific configuration.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
I understand that PocketJS already separates application projects from the
framework and SDK reasonably well. An application can have its own manifest,
source tree, and build output while depending on PocketJS as a package.
The remaining coupling is on the host side. Hosts still tend to be maintained
as device-specific implementations or profiles. This is especially visible for
embedded devices, where every product may have a different screen resolution,
pixel format, color configuration, framebuffer layout, and input device.
I would like to propose a project-generation workflow that applies the same
kind of separation to hosts: reuse a host implementation from the SDK, but
keep the device-specific host configuration and product integration in a
separate project.
The desired workflow is:
select an existing host
↓
generate a new device project
├── depend on a released PocketJS SDK
├── reuse the selected host implementation
├── define device-specific parameters locally
└── build and maintain the device independently
Motivation and concrete use case
I encountered this issue while considering a new host for an embedded Linux
device using a framebuffer at /dev/fb0 and input events from
/dev/input/eventX. The general host mechanism is reusable, but the actual
products are not identical boards with a standard configuration. Each product
can have its own display and input parameters.
For an embedded Linux product, the project may need to define the framebuffer
resolution, stride, pixel format, channel order, color depth, refresh policy,
input device path, key or touch mapping, coordinate range, and timing. These
values are not properties of Linux fbdev or evdev as a generic host; they are
facts of the particular product.
In a real product, the team usually wants to maintain a project for one
specific device. It does not want to fork, modify, and version the entire
PocketJS SDK because one device has different hardware parameters.
For example, two devices may use the same host implementation but have
different:
- logical and physical viewport sizes;
- raster density;
- refresh rate or tick frequency;
- pixel format or framebuffer layout;
- input mapping;
- touch coordinate limits;
- memory or storage constraints;
- device-specific build and packaging settings.
With the current coupling, changing one of these values may require modifying a
host profile or host source inside the PocketJS repository. If several devices
need different values, the product team may end up maintaining multiple
PocketJS SDK copies or forks. This increases upgrade cost and makes it
difficult to keep fixes and security updates synchronized.
There are two different use cases here:
- Adapting a popular, already-defined product. If the target is a commonly
purchased device with a stable hardware profile, maintaining a device-specific
host in the current repository can be a reasonable workflow. - Developing a new embedded product. If the team owns the hardware or is
building several product variants, the parameters are part of the product
project and change independently of the SDK. Requiring those parameters to
live in the PocketJS repository makes this workflow unnecessarily costly.
The second case is particularly important for embedded Linux development. The
community may more often adapt software to popular existing products, while a
commercial embedded project may face a collection of new products whose
screens and input hardware are all different.
The important boundary should be:
- PocketJS SDK: reusable runtime, framework APIs, host implementation, build
contracts, and validation logic. - Device project: one device's profile, parameters, native integration,
packaging, and product-specific code.
Proposed workflow
A command such as the following could create a device project from an existing
host:
pocket create-device my-device --host esp-idf
# or
pocket create-device my-device --host linux-fbdev
# or a generic embedded Linux host using fbdev + evdev
pocket create-device my-device --host linux-fbdev-evdev
The generated project would:
- depend on
@pocketjs/frameworkor the corresponding PocketJS SDK package; - select a host implementation or host template;
- contain a device-owned profile/configuration file;
- validate that profile against the host's supported contract;
- pass the resolved device parameters into the host build;
- build an application package and/or device firmware from the project;
- allow the SDK version to be upgraded through normal dependency management.
For example, the generated project might contain:
my-device/
package.json
pocket.json
pocket.device.json
src/
native/
build/
pocket.device.json would describe the device-specific facts, while the host
would provide the implementation and the supported configuration schema.
The ESP-IDF pocket.host.json flow appears to be a useful direction for this
model. It already demonstrates that a host can consume an external profile
instead of requiring every device profile to live in the SDK repository. The
same model would be useful for an embedded Linux host: the SDK could provide
the fbdev/evdev host implementation, while the generated project would own the
product's display and input profile.
Requirements
- A host should be reusable by multiple device projects.
- Device parameters should be owned by the generated project rather than
hard-coded in the SDK. - The generated project should depend on a versioned PocketJS SDK package.
- The project should not need to copy or fork the complete PocketJS repository.
- Host and device configuration should have a versioned schema and clear
validation errors. - Parameters that affect compilation, resource baking, package admission, or
host ABI should be validated during the build. - Runtime-only settings may remain in the native host configuration where
appropriate. - SDK upgrades should be possible without replacing or manually merging the
whole device project. - Multiple device projects should be able to use the same host and different
profiles in parallel.
Expected benefit
This would make PocketJS more suitable for new embedded products and custom
hardware. A product team could maintain a small, device-specific repository
while consuming PocketJS as an SDK dependency. Host fixes and framework
features could be upgraded through SDK versions, while device configuration and
native product integration would remain under the product team's ownership.
This would also avoid creating a separate PocketJS SDK fork for every device
that differs only in host parameters.
- Lingua principale
- TypeScript
- Stelle
- 1.6k
- Fork
- 88
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pocket-stack/pocketjs
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
pocket-stack/pocketjs#729 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pocket-stack/pocketjs#725 ·
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
pocket-stack/pocketjs#724 ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 62/100
pocket-stack/pocketjs#728 ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
pocket-stack/pocketjs#727 ·
Tutte le issue di pocket-stack/pocketjs
Issue simili
-
kind:defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
mux-labs/mux-frontend#1240 ·
I maintainer di solito rispondono entro 1 giorno
-
area: agents-mcp priority: normal
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Wait for the IDS correction dialog to settle in the stale-audit testForse già presa @louistrue l’ha presa oggi. Apertaready
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Hono path parameters with a regex pattern keep the pattern in the OpenAPI pathForse già presa @0z5a l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
cloudflare/chanfana#400 ·
I maintainer di solito rispondono entro 1 giorno