pyscript / pyscript/docs

detail how to deliver both JS and Python assets needed by a project

Open
#172 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17
Forks
20
PR merge metrics
No merged PRs in 30d

Description

From discord:

https://discord.com/channels/972017612454232116/972020206538997822/1344294149922230364

For example, perhaps the README for my wheel should say:

To use libfoo in pyscript, you will need to declare the following in your pyscript.toml:

packages = ["libfoo@2.0.1"]
[js.modules]
"https://cdn.pyscript.com/serve-files-from-wheels/pypi/libfoo@2.0.1/subpath/shim.js" = "libfooshim"

that's how we basically use 3rd party and there's nothing wrong in there ... .js stuff gotta be published on .js places, .py and wheels stuff gotta be published on .py places ... so you publish your wheel and you publish on npm your wheel module ... you sync versioning between the two, you use one out of dozen CDN providers for your JS that ends up in the config. https://esm.run/ would be my suggestion as it's provided by JSDelivr which is likely the most used CDN out there on the web ... it automatically packages your stuff as ESM too so your config would look like:

packages = ["libfoo@2.0.1"]

[js_modules.main]
"https://esm.run/libfoo@2.0.1" = "libfooshim"

and ... that's it? 🤔

Contributor guide

Open the contributing guide

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 the linked Discord discussion and the README/configuration example quoted in the issue. Determine the supported way to publish and reference the JavaScript and Python assets, then document the resulting workflow and versioning expectations in the appropriate project documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.