0.0.5 • Published 1 year ago
@krulod/sorcerer v0.0.5
@krulod/sorcerer
An opinionated utility for building and testing packages.
Usage
Install:
$ pnpm add -D @krulod/sorcerer
Setup tsconfig.json
:
{
"compilerOptions": {
"strict": true,
"target": "esnext",
"module": "esnext",
"lib": ["esnext", "dom"],
"moduleResolution": "node",
"experimentalDecorators": true,
"declaration": true,
"outDir": "dist"
},
"files": ["./index.ts"]
}
Write some modules and export them from index.ts
:
// index.ts
export * from './src/sum'
Create a distribution directory dist
:
$ pnpm sorcerer build
Write some tests:
// test/sum.test.ts
import {test, assert} from '@krulod/sorcerer'
import {sum} from '../src/sum.ts'
test('sum', {
'natural numbers': () => {
assert.is(sum(1, 2), 3)
},
})
Run tests:
$ pnpm sorcerer test
Incrementally rebuild and rerun tests whenever files change:
$ pnpm sorcerer dev
Limitations
- neither extensible nor configurable, probably won't suit your needs
- tests are only ran in Node
Used in
- so far nowhere
License
GNU Affero General Public License v3.0 or later