@noodlestan/designer-functions
v0.0.14
Published
A library of functions to load, validate, and manipulate design decisions.
Readme
Designer Decisions - Functions
A library of functions to load, validate, and manipulate design decisions and tokens.

How to use
This library provides APIs for loading and validating schemas and decisions inputs.
See also
- 📖 Guides / Loading and Validating Decisions
- 📖 Models / Decision Types
- 📖 Boilerplates
- 📖 API / @noodlestan/designer-functions
Development
[!IMPORTANT] This library exports both
dist/cjsanddist/esm. Do not removetype: moduleas this (still) breaksts-nodeconsumers.
Make sure you README first.
Build Targets
[!IMPORTANT] Do not add
type: moduleorexportsfields topackage.jsonas this will break Node.js ESM consumers.
This library is packaged for use both in bundlers such as Vite and Astro, as well as Node.js environments (CJS/ESM), and ts-node. For Node.js consumers, even those using import or await import() syntaxes, all imports resolve to the CJS build. This is only possible when the "type": "module" and "exports" fields are both omitted from the library's package.json.
| Consumer | Syntax | Resolves to |
| ------------------- | ------------- | ---------------------------------------- |
| Bundlers | ESM import | module → TS entry point src/index.ts |
| node script.js | CJS require | main → CJS build dist/cjs/index.js |
| node script.mjs | ESM import | main (ignores module) |
| ts-node script.ts | ESM import | main (ignores module) |
Scripts
- $
npm run dev- usesesbuildto watch andtscto emit declarations on rebuild. - $
npm run build- usesesbuildto builddist/cjsandtscto emit declarations. - $
npm run test/npm run test:watch- usesvitest. - $
npm run lint/npm run lint:fix- uses @noodlestan/eslint-config.
MIT License
Copyright (c) 2024 Noodlestan.
Published under a MIT license.
