lynx-community / lynx-community/lynxtron-examples

Metadata: declare Lynxtron requirement via package.json → example-metadata.json

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2
Forks
1
Avg merge
16h 59m
Merged PRs (30d)
45

Description

Background

go-web PR #61 adds an "Open in ..." panel that reads a new top-level field on example-metadata.json:

{
  "name": "examples/cool-3d-demo",
  "version": "0.2.5",
  "reactLynxVersion": "0.120.0",
  "nativeFramework": "lynxtron",   // ← new, optional
  "templateFiles": [
    { "name": "main", "file": "dist/main.lynx.bundle" }
  ]
}

Semantics: nativeFramework declares which native framework this bundle requires at runtime. Absent = no dependency, universally compatible with any Lynx-compatible host (Lynx Explorer, Lynxtron Go, Sparkling, ...). Present = only that host can execute the bundle; go-web hides the "scan QR with Lynx Explorer" tab and only surfaces the corresponding deep-link entry.

This is distinct from build-time framework versions (reactLynxVersion, vueLynxVersion) — those describe how the source was compiled and are already baked into the bundle. nativeFramework describes what the host must provide.

Where the field should come from

Today, example/scripts/prepare-examples.js generates example-metadata.json by scanning the npm tarball for *.lynx.bundle files. It does not read anything Lynxtron-specific.

Proposal — declare the field in the example package's own package.json:

// packages/cool-3d-demo/package.json
{
  "name": "@lynxtron-example/cool-3d-demo",
  "version": "0.2.5",
  "go": {
    "nativeFramework": "lynxtron"
  }
}

Then update prepare-examples.js to lift pkg.go?.nativeFramework into the generated metadata (see PR #61 for the consumer side).

Ask

  • Agree on the field name and location (pkg.go.nativeFramework vs. some other convention).
  • Decide whether every Lynxtron example package should set it explicitly, or whether the field can be inferred (e.g. from the @lynxtron-example/* scope).
  • Update the example package template / publishing docs so authors set it as they publish.

Happy to open the corresponding PR on prepare-examples.js once we agree.

/cc @huxpro

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with example/scripts/prepare-examples.js and inspect how it scans npm tarballs into example-metadata.json. Review the example package template and publishing documentation, then resolve the proposed pkg.go.nativeFramework convention and whether inference is needed. Done means the agreed metadata field is propagated and author guidance is updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.