custodio
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

custodio

npm version npm downloads Github Actions Codecov

Builder-agnostic plugin to allow restricting import patterns in certain parts of your code-base.

Usage

Install package:

# npm
npm install custodio
import { dirname } from 'node:path'
import { CustodioPlugin } from 'custodio'

const build = await rollup({
  input: 'entry.js',
  plugins: [
    CustodioPlugin.rollup({
      cwd: dirname(import.meta.url),
      include: [/src\/*/],
      patterns: [
        [/^node:.*/], // disallows all node imports
        ['@nuxt/kit', 'Importing from @nuxt kit is not allowed in your src/ directory'] // custom error message
      ]
    }),
  ],
})

🚧 TODO

  • [x] add docs
  • [x] update playground
  • [x] push to GitHub
  • [ ] migrate to unjs/

💻 Development

  • Clone this repository
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Made with ❤️

Published under MIT License.

/custodio/

    Package Sidebar

    Install

    npm i custodio

    Weekly Downloads

    0

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    6.48 kB

    Total Files

    5

    Last publish

    Collaborators

    • danielroe