generate device-specific projects from reusable host templates
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- embedded-iot
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 1.6k
- フォーク
- 88
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pocket-stack/pocketjs のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
pocket-stack/pocketjs#729 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pocket-stack/pocketjs#725 ·
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
pocket-stack/pocketjs#724 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 62/100
pocket-stack/pocketjs#728 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
pocket-stack/pocketjs#727 ·
pocket-stack/pocketjs の issue をすべて見る
似ている issue
-
kind:defect
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
mux-labs/mux-frontend#1240 ·
メンテナーはふだん 1 日以内に返信
-
area: agents-mcp priority: normal
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
Wait for the IDS correction dialog to settle in the stale-audit test対応中かも @louistrue が今日担当しました。 オープンready
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Hono path parameters with a regex pattern keep the pattern in the OpenAPI path対応中かも @0z5a が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
cloudflare/chanfana#400 ·
メンテナーはふだん 1 日以内に返信