@tnventures/modelgenerator-react-runtime
v0.1.21
Published
React runtime for ModelGenerator — shared components, hooks, view models, validators (PersonalId / BusinessId / PostalCode / IBAN / …), user-rights, and wizard-session plumbing consumed by generated .g.tsx code.
Maintainers
Readme
@tnventures/modelgenerator-react-runtime
React runtime consumed by code generated with ModelGenerator.
Provides the shared components, hooks, view models, validators, user-rights,
and wizard-session plumbing that generated .g.tsx code binds to at import
time.
Install
npm install @tnventures/modelgenerator-react-runtimePeer dependencies (must be installed by the host app):
npm install react react-bootstrap mobx-react-liteWhat's in the box
Import via subpath — no barrel index:
| Subpath | What lives there |
|---|---|
| @tnventures/modelgenerator-react-runtime/components/* | Shared React components (form controls, list layouts, dialogs) |
| @tnventures/modelgenerator-react-runtime/hooks/* | React hooks used by generated view code |
| @tnventures/modelgenerator-react-runtime/styles/* | CSS the components pull in |
| @tnventures/modelgenerator-react-runtime/ui/* | Higher-level UI shells (pagination, wizard steps) |
| @tnventures/modelgenerator-react-runtime/userRights/* | User + role context, permission helpers |
| @tnventures/modelgenerator-react-runtime/utils/* | Logger, AuthenticationReply, StringUtility, formatDate |
| @tnventures/modelgenerator-react-runtime/validator/* | Validator.validatePersonalId / validateBusinessId / validatePostalCode / validateEmail / validatePhone / validateBankAccount / validateCreditCard — per-country (FI, SE, …) |
| @tnventures/modelgenerator-react-runtime/viewModels/* | BaseViewModel, LocaleStore |
| @tnventures/modelgenerator-react-runtime/wizards/* | Wizard session helpers |
Example — validating a Finnish personal ID
import { Validator } from '@tnventures/modelgenerator-react-runtime/validator/Validator';
const reply = Validator.validatePersonalId('040884-921D', 'FI');
if (reply.ok) {
console.log(reply.validatedValue); // canonical form
} else {
console.error(reply.errorMessage);
}Versioning
Pre-1.0: the public API surface may still change without a major bump. Once stable, semver applies as usual.
License
MIT — see LICENSE.
