Skip to content

Everything around codegen - the one bundler plugin that turns your frontend code into magic.

License

Notifications You must be signed in to change notification settings

FlorianRappl/codegen-js

Repository files navigation

codegen

codegen-js

Explore the possibilities with Codegen and elevate your development experience with seamless bundling and code generation! 🚀

Codegen is a powerful tool for enabling bundling superpowers through advanced plugins and mechanisms. This repository contains all the libraries, plugins, and utilities you need to integrate code generation seamlessly into your development workflows.

Whether you're using modern bundlers like Webpack, rspack, esbuild, Vite, Rollup, or Parcel, or looking for integration with editors like Visual Studio Code, an integration exists.

Features

  • Bundler Plugins:

  • Editor Plugins:

    • Convenience plugins for editor integration.
    • Editor-specific tooling, including VS Code.
  • Ease of Use:

    • Focused on simplifying code generation in diverse environments.
    • Extensible and customizable for various project needs.
    • Bundler agnostic - easily swap bundlers.

Installation

The plugins for each bundler or editor can be installed via npm, pnpm, or yarn. Below is an example for the Webpack plugin:

npm install parcel-codegen-loader --save-dev

Replace parcel-codegen-loader with the specific plugin for your bundler or editor as needed.

Usage

Bundler Plugins

  1. Add the plugin to your bundler configuration.
  2. Configure it as needed to fit your project requirements.
  3. Benefit from dynamic code generation tailored to your build process.

Example for Webpack:

module.exports = {
  module: {
    rules: [
      {
        test: /\.codegen$/i,
        use: [
          {
            loader: 'parcel-codegen-loader',
          },
        ],
      },
    ],
  },
};

Editor Plugins

Follow the instructions in the relevant plugin documentation for integrating with your editor.

Example for VS Code:

  1. Install the plugin from the marketplace.
  2. Configure the workspace settings to recognize code generation configurations.

Documentation

Detailed documentation and examples can be found at dev.to.

Additional resources are provided in the README.md of the respective plugin or library within this repository.

Contributing

We welcome contributions! Please follow the steps below to get started:

  1. Fork the repository.
  2. Clone the repository locally.
  3. Install dependencies using npm install.
  4. Make your changes and submit a pull request - target the develop branch.

Please ensure that all contributions follow our Code of Conduct and Contributing Guidelines.

License

This project is licensed under the MIT License. See the LICENSE file for details.