Code Monkey home page Code Monkey logo

buildkarium's Introduction

cover npm version npm downloads bundle License

Buildkarium

๐Ÿงฑ An enchanting JavaScript build ecosystem!

๐Ÿ“ฆ Optimized bundler

Robust rollup based bundler that supports typescript and generates commonjs and module formats + type declarations.

๐Ÿช„ Automated config

Automagically infer build config and entries from package.json.

๐Ÿ“ Bundleless build

Integration with mimikra for generating bundleless dists with file-to-file transpilation.

โœจ Passive watcher

Stub dist once using dynot and you can try and link your project without needing to watch and rebuild during development.

โœ Typiqus Generator

Integration with typiqus.

๐Ÿ›ก๏ธ Secure builds

Automatically check for various build issues such as potential missing and unused dependencies and fail CI.

CLI output also includes output size and exports for quick inspection.

โš™๏ธ Usage

๐Ÿ“„ Create src/index.ts:

export const log = (...args) => { console.log(...args) }

๐Ÿ”„ Update package.json:

{
  "type": "module",
  "exports": {
    ".": {
      "import": "./dist/index.mjs",
      "require": "./dist/index.cjs"
    }
  },
  "main": "./dist/index.cjs",
  "types": "./dist/index.d.ts",
  "files": [
    "dist"
  ]
}

๐Ÿ”จ Build with buildkarium:

npx buildkarium

โœ… Configuration is automatically inferred from fields in package.json mapped to src/ directory. For more control, continue with the next section.

โš™๏ธ Configuration

๐Ÿ“„ Create karium.config.ts:

export default {
  entries: [
    './src/index'
  ]
}

โœ… You can either use the buildkarium key in package.json or create a karium.config.{js,ts,json} file to specify the configuration.

โœ… See options here. ๐Ÿ“š

๐Ÿ’ก Example:

import { defineBuildConfig } from 'buildkarium'

export default defineBuildConfig({
    // If entries is not provided, will be automatically inferred from package.json
    entries: [
        // default
        './src/index',
        // mkdist builder transpiles file-to-file keeping original sources structure
        {
            builder: 'mimikra',
            input: './src/package/components/',
            outDir: './build/components'
        },
    ],

    // Change outDir, default is 'dist'
    outDir: 'build',

    // Generates .d.ts declaration file
    declaration: true,
})

๐ŸŒฑ Development

  • ๐Ÿ™ Clone this repository
  • ๐Ÿ”ง Enable Corepack using corepack enable (use npm i -g corepack for Node.js < 16.10)
  • ๐Ÿ“ฆ Install dependencies using nyxi
  • ๐Ÿƒ Run interactive tests using nyxr dev

๐Ÿ“œ License

MIT - Made with ๐Ÿ’ž

buildkarium's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.