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

@beyond-js/code-bundle

v1.0.2

Published

Code bundle for Beyond.js

Downloads

15

Readme

BeyondJS Code Bundle

Overview

The BeyondJS Code Bundle is a versatile and powerful bundle designed to handle multiple processors, making it ideal for projects that require the integration of different technologies. This bundle supports a wide range of processors, allowing you to encapsulate various technologies within your application.

Features

  • Multi-Processor Support: Seamlessly integrates TypeScript, JavaScript, JSX, Sass, Less, SCSS, Svelte, Vue, and MDX.
  • Independent Style Bundles: CSS processors like Sass and Less generate independent bundles of styles (bundle-name.css).
  • Template Support: Allows for templating within the bundle to enhance modularity and reusability.

Configuration

The configuration for the Code Bundle is defined in your module's module.json file. Below is an example configuration:

{
	"name": "my-code-bundle",
	"platforms": ["web"],
	"code": {
		"ts": {
			"path": "ts",
			"files": "*"
		},
		"scss": {
			"path": "scss",
			"files": "*"
		}
	}
}

Key Properties

  • bundles: Specifies the list of bundles in the module.
  • name: The name of the bundle.
  • type: The type of bundle, which should be set to code for this configuration.
  • platforms: Specifies the platforms the bundle supports.
  • code: Contains configuration details specific to the code bundle.
    • processors: Lists the processors supported by the bundle.

Processors

The Code Bundle supports the following processors, each handling different file types and technologies:

  • TypeScript (ts): Compiles TypeScript files.
  • JavaScript (js): Handles standard JavaScript files.
  • JSX (jsx): Processes JSX files, typically used with React.
  • Less (less): Compiles Less files into CSS.
  • SCSS (scss): Compiles SCSS files into CSS.
  • Svelte (svelte): Compiles Svelte components.
  • Vue (vue): Compiles Vue components.
  • MDX (mdx): Processes MDX files, which allow you to write JSX in Markdown.

Independent Style Bundles

When using CSS processors like Sass, Less, or SCSS, the Code Bundle generates an independent style bundle named bundle-name.css. This approach ensures that your styles are modular and can be independently managed, improving the maintainability and scalability of your application.

Example

Here is a basic example of how to set up a module with the Code Bundle in BeyondJS:

  1. Create a module.json file in your module directory with the following content:

    ```json
    {
    "name": "my-code-bundle",
    "platforms": ["web"],
    "code": {
    	"ts": {
    		"path": "ts",
    		"files": "*"
    	},
    	"scss": {
    		"path": "scss",
    		"files": "*"
    	}
    }

    }```

  2. Add your source files to the appropriate directories for each processor.

  3. Build your project to see the generated JavaScript and CSS bundles.