0.0.1 • Published 10 months ago

custodio v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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

  • add docs
  • update playground
  • 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.

0.0.1

10 months ago

0.0.0

10 months ago