npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pyscript/core

v0.5.12

Published

PyScript

Downloads

35,846

Readme

@pyscript/core

We have moved and renamed previous core module as polyscript, which is the base module used in here to build up PyScript Next, now hosted in this folder.

Documentation

Please read core documentation to know more about this project.

Development

Clone this repository then run npm install within its folder.

Use npm run build to create all artifacts and dist files.

Use npm run server to test locally, via the http://localhost:8080/tests/ url, smoke tests or to test manually anything you'd like to check.

Artifacts

There are two main artifacts in this project:

  • stdlib and its content, where src/stdlib/pyscript.js exposes as object literal all the Python content within the folder (recursively)
  • plugins and its content, where src/plugins.js exposes all available dynamic imports, able to instrument the bundler to create files a part within the dist/ folder, so that by default core remains as small as possible

Accordingly, whenever a file contains this warning at its first line, please do not change such file directly before submitting a merge request, as that file will be overwritten at the next npm run build command, either here or in CI:

// ⚠️ This file is an artifact: DO NOT MODIFY

Running tests

Before running the tests, we need to create a tests environment first. To do so run the following command from the root folder of the project:

make setup

This will create a tests environment [in the root of the project, named ./env]and install all the dependencies needed to run the tests.

After the command has completed and the tests environment has been created, you can run the integration tests with the following command:

make test-integration

pyscript python package

The pyscript package available in Python lives in the folder src/stdlib/pyscript/.

All Python files will be embedded automatically whenever npm run build happens and reflected into the src/stdlib/pyscript.js file.

It is core responsibility to ensure those files will be available through the Filesystem in either the main thread, or any worker.

JS plugins

While community or third party plugins don't need to be part of this repository and can be added just importing @pyscript/core as module, there are a few plugins that we would like to make available by default and these are considered core plugins.

To add a core plugin to this project you can define your plugin entry-point and name in the src/plugins folder (see the error.js example) and create, if necessary, a folder with the same name where extra files or dependencies can be added.

The build command will bring plugins by name as artifact so that the bundler can create ad-hoc files within the dist/ folder.