Highlights
Added new CLI helper commands to create each element of the libmodulor 4-layer architecture faster : CreateApp, CreateUC, CreateProduct, CreateTarget.
Check them out with npx libmodulor --help (or pnpm libmodulor --help within a project with libmodulor installed).
Simplified settings management : moved to more and better defaults so you don't have to provide any settings when creating new product targets (see Create a target).
Simplified testing : replaced SimpleAppTesterConfigurator by NodeAppTesterConfigurator including the necessary bindings to have tests working out of the box (see Test an app). The GenerateAppsTests CLI command now generates a default Configurator.ts if it does not exist yet.
Moved all the targets of a product into a dedicated targets dir so they are not mixed with other types of directories you might have in a product (e.g. specific utilities, implementations, etc.).
See all the changes here : https://github.com/c100k/libmodulor/compare/v0.25.0...master
Highlights
- Added use case summary in the auto-generated app docs : In addition to the existing mermaid diagram, there is now a summary of the lifecyle, input and output in a dedicated table
- Improved the
Filedata type- Changed the property
pathtourito conform to theFormDataspec (this is a breaking change) - Simplified the declaration by inlining the accepted types via
acceptinstead oftype.allowed(this is also a breaking change) - Added
maxSizeInBytesandminSizeInBytesfor size validation
- Changed the property
- Added
getConstraintsForHumanto format constraints for the end user in the targets. For instance :- For
FreeTextShort, it displaysMax length: 150🇬🇧 when present - For
File, it displaysMax size: 8MB - Accepted types: application/png, application/jpg🇬🇧 when present - Applied to the
react-native-pureandreact-native-webtargets (seeUCFormFieldHelp.tsx)
- For
See all the changes here : https://github.com/c100k/libmodulor/compare/v0.24.0...master
Highlights
- Introduced
babel,viteplugins andwebpackloader => https://libmodulor.c100k.eu/docs/guides/bundle-target - Introduced the
node-stricli-clitarget using @bloomberg'sstriclilibrary - Introduced the
Playgroundexample, runnable locally, to play with all the features oflibmodulor=> https://libmodulor.c100k.eu/docs/examples/Playground - Improved apps testing by making sure non-english languages are fully translated
- Improved apps testing performance by optimizing use cases testing using the
streamtransport - Introduced
de🇩🇪 andes🇪🇸 locales (see them in action in thePlayground)
Some breaking changes but at the very low level. If your apps break, just follow the TypeScript errors and you should be good to go.
Also bumped React versions for the infamous React2Shell vulnerability.
See all the changes here : https://github.com/c100k/libmodulor/compare/v0.23.0...master
See all the changes here : https://github.com/c100k/libmodulor/compare/v0.22.0...master
Added
- Add
verboseoption toCreateProject:pnpm libmodulor CreateProject --outPath ~/Downloads --projectName libmodulor-test --verbose - Add stream ability to
LLMManager - Introduce stream output to use cases : set
transportType: 'stream'inucd.def.httpand send partial output in yourServerMainso your clients can start showing data before the processing is done - Use stream from client to server
- Add
FakeClockManagerandFakeLLMManagertostd: they are now centralized so they can be reused by all the apps instead of duplicating them - Handle targets without fetch stream capabilities
- Stream responses in cli targets
- Add ability to abort UC execution
BREAKING
- Infer UC input field type without explicit generic when using
UCmethods likeinputField,reqVal0,rVal0,rValArr: simply fix the TypeScript errors by removing the generic (e.guc.reqVal<DateISO8601>('from')=>uc.reqVal('from')) - Change
UCInputField.setValuetoUCInputField.setVal,UCInputField.addVal,UCInputField.rmVal: simply fix the TypeScript errors by replacingsetValueto the appropriate method. Also,UCInputFieldChangeOperatorhas been removed as it became useless. If you created customUCFormfield controls, you need to call the appropriate method to set the value in the field.
Added
- Add overrides to
rVal0to avoid non null assertion
Fixed
- Display expected falsy values in violation
Misc
- Expose
TGitSSHURLConstraints
Added
- Add ability to stream data in
ShellCommandExecutor - Stream output with color when using the
TestAppcommand - Check app sources before executing the test in
TestApp: this allows to spot errors earlier and avoid cryptic exec errors when the sources are not valid (don't forget to re-generate the tests withpnpm libmodulor GenerateAppsTestsand use--updateSnapshotsthe next time you callTestApp --appName YourApp)
Misc
- Add the
Toolboxapp toexamples(for docs) - Expose
UC_POLICY_FILE_NAME_EXTandUC_POLICY_FILE_NAME_SUFFIXin the convention - Move
examples/embeddedtoexamples/standalone - Add the
GeocodeAddressUCD toToolbox(for docs) - Add the
MyRunningMapapp toexamples(for docs) - Harmonize
examplesapps testing
BREAKING
- Introduce
Initializable.initSync(): useful for contexts where async is not available (e.g. Cloudflare workers initialization) => To address, simply add the method in the concerned implementations. You can leave it empty, re-use the same logic as your existinginit()if its core is not async, or copy it and adapt it to make it sync. If you want to forbid its usage, usethrow new NotCallableError<this>('initSync', 'init', 'async-only'); - Introduce
ServerManager.mountSync(): useful for contexts where async is not available (e.g. Cloudflare workers initialization) => To address, simply add the method in the concerned implementations. You can leave it empty, re-use the same logic as your existingmount()if its core is not async, or copy it and adapt it to make it sync. If you want to forbid its usage, usethrow new NotCallableError<this>('mountSync', 'mount', 'async-only'); - Change
uc_data_store_ucs_dataset_namedefault value fromuse-casestouc_executions: if you relied on the default value and want to keep it, explicitly setuc_data_store_ucs_dataset_namein your settings. If you want the new name, rename your existing collection to the new name - Make
UCDataStorecompliant withInitializable: renameinstalltoinit, addinitSyncand renameinitTxtostartTx
Added
- Introduce
target/edge-worker-hono-serverto be able to deploy easily on Cloudflare Workers - Introduce
NotAvailableErrorfor better semantics and more meaningful error messages - Introduce
NotImplementedErrorfor better semantics and more meaningful error messages - Init
i18nManagerinMCPServerBooterandNodeCoreCLIManager: you can remove any initialization made before executing those
Fixed
- Update
UCOutputBuildertotal when removing
Misc
- Extract server targets functions for better reusability
Misc
- Adjust
CreateProjectbiome config
Misc
- Switch to
react-jsx(instead ofreact) : the targets relying on React now usereact/jsx-runtimeinstead of the legacyReact.createElement - Upgrade to
biome2.0.0 - Reduce usage of
useLiteralKeys
BREAKING
- Make
target/react-native-pureandtarget/react-web-purecomponents stylable : by using the new<StyleContextProvider style={...style} />you can customize how the elements render inside<UCPanel />. You can even userenderFormFieldControlto customize the form controls rendered according to the field (e.g. name, type, etc.)
BREAKING
- Make
pnpm(in replacement ofyarn) the default package manager innpx libmodulor CreateProject
Added
- In
LLMManager, allow to pass theapiKeydirectly in the request. It precedes the settings value defined at the implementation level - In
target/react, add optionalclassNameto stylable components - In
target/web, handle use case input field initial value - Add
Embeddeduse case examples in the docs
- Introduce
useActionfor react targets : it's a use case agnostic way of invoking an action
Fixed
- Disable TypeScript incremental when analyzing app sources in automated test
Added
- Introduce
target/node-hono-serverallowing you to expose a server using Hono in addition to the existing implementations based on express and next.js
Misc
- Upgrade
examples/supertraderto rnreact-native@0.79.xandexpo@53.x
BREAKING
- Upgrade to inversify 7 : In addition to bumping the dependency, checkout the migration guide and this discussion
- In
FSManager, add ability totouchfile fromArrayBuffer: If you have a custom implementation, handle the new generic and handle both type of content
Added
- Introduce
ServerRequestHandler: Used inNodeExpressServerManagerand all the upcoming server targets, it contains everything needed to execute a use case on a server. You can use it to implement your own server (e.g.Fastifyand so on) - Introduce
NextJSServerManagerandNextJSAPIRouteHandler: Used to execute use cases within a Next.js route handler
Fixed
- Handle body with only one file in
target/node-express-server
Misc
- Showcase empty state and usage of more daisyUI components (e.g. loaders) in
examples/supertrader - Replace
pathbyparentPathinNodeFSManager - Prefix internal server error in dev mode
- Write uc input file instead of cp when in memory
- Create server tmp dir at startup if not present
Fixed
- Ajust
appPathinyarn libmodulor TestAppcommand
BREAKING
- Remove
ContainerPrinter: It was using internals of inversify v6. These internals are not present anymore in v7 and the maintainers were not convinced about adding something to list the bindings of a container. In prevision of the upgrade to v7, unfortunately, we remove it to keep things simple - Upgrade to express 5 : Unless you extended
NodeExpressServerManagerand did some special stuff, this should be transparent to you. Except bumping the version to5.1.0, there should be nothing to do. Otherwise, check the excellent migration guide
Fixed
- Return early when parent data type validation is not ok
- Adjust the
npx libmodulor CreateProjectcommand
Misc
- Analyze the web bundle of
examples/supertrader((cd examples/supertrader && yarn build:analyze:web)) - Include data-types tables in
llms.txt - Update UC input field when forcing the value in
rInput(e.g. boolean set to false or array set to empty)
Added
- Introduce
UCOutputFieldValueFragmentintarget/reactandUCOutputFieldValueintarget/react-(native|web)-pureto display uc values using thefmt()method of each data type.TBoolean.fmt()has been adapted to display✔️whentrue, instead oftrue|falsewhich are not very user friendly in a UI - Introduce
Yeardata type
Fixed
- Adjust
fmtofTHostPortandTTimestamp(they shouldn't be formatted as numbers) andtNameofTEmbeddedObject
Misc
- Update
examples/supertraderto showcase type semantics and displaying UC output fields according to the definition - In
target/react, makeuseUCORreturn aPart0always set : you can remove all the now obsolete patterns likeif (listItemsPart0),listItemsPart0 &&,listItemsPart0?.,listItemsPart0!.in your React components relying onuseUCOR. Also expose the function signatures used byuseUCanduseUCORto make them easily passable as children props - List base and final data types directly in the documentation => https://libmodulor.c100k.eu/docs/references/data-types
BREAKING
- Move
bindServertolibmodulor/node-express. The following dependencies (jose) are now optional. You can remove them if you're usinglibmodulor/nodeelements in non server targets likecli - Upgrade to
fast-checkv4 : Re-generate your tests withyarn libmodulor GenerateAppsTeststo get the changes adapted to this version
Misc
- Make
buffer,fast-checkandvitestdeps optional : basic uses oflibmodulordo not require them (see https://libmodulor.c100k.eu/docs/examples/Basic as an example). You can remove them if you're not using the automated tests - Add
ListOrdersUCDandCancelOrderUCDtoexamples/supertraderto showcase data fetching, aggregate building, sensitive use cases, test flows, etc. - Remove linter config from examples (linting from repo root folder)
- Use
debuginstead oftraceinConsoleLogger
BREAKING
- Move
NodeExpressServerManagerto a dedicated export (libmodulor/node=>libmodulor/node-express). The following dependencies (cookie-parser,express,express-fileuploadandhelmet) are now optional. You can remove them if you're usinglibmodulor/nodeelements in non server targets likecli - Do not enforce
dtandpoliciesfolders in app src : place everything that is not*UCDand*ServerMainintolibthe way you prefer - Check app src folder contents : it must contain only the elements allowed by the spec (Re-generate your tests with
yarn libmodulor GenerateAppsTeststo enforce the new rule)
Misc
- Introduce new "Basic" example showing all the primitives in action in one single
.tsfile - Move
examples/libmodulor-tutotoexamples/supertrader - Add
llms.txtto docs at https://libmodulor.c100k.eu/llms.txt
Added
- Make
npx libmodulor CreateProjectmore generic : you can now customize theinitialCommit(default ischore: initial commit), thepkgManagerBin(default isyarn, works withnpm,pnpm,bun, etc.), thescmBin(default isgit)
Fixed
- Derandomize UC input before snapshotting in tests : after the upgrade to TS 5.8, snapshotting a UC including a File as input would break as a new
stateproperty has appeared with a dynamiclastModifiedproperty
Misc
- Move the documentation with concepts, examples, guides and references to https://libmodulor.c100k.eu
Fixed
- Create project with the latest version
BREAKING
- Extract common react elements on web and rn, renaming some of the props : check the new props names and the new
validateFormFieldto simplify your overrides - Remove
helperfrom the exports map : it makes no sense to expose it as it is an executable (seenpx libmodulorbelow)
Added
- Introduce the
npx libmodulor CreateProjectcommand - Introduce
selectto targetreact-web-pure: it now renders an HTMLselectwhen the UC input fieldhasOptions()
Misc
- Bump
reactto19.0.0 - Add a new "Style the web Target" tutorial step showing how to use
tailwindcssanddaisyUIto provide custom components
BREAKING
- Replace
.jsby.tsforProductManifest
Added
- Introduce a 3rd implementation of
LLMManager(OllamaLLMManager) to run models locally - Introduce
LLMManagerwith 2 implementations (MistralAILLMManagerandOpenAILLMManager)
Misc
- Simplify the signature of
UCDef.ext.http.transformremoving the genericTreturn - Add JSDocs and comments for a better in-place documentation (i.e. in .d.ts files)
- Add the Tutorial code in the repo at
examples/libmodulor-tutoand add a new "Expose a rn Target" step
feat(target): introduce react-native-pure
To help with the creation of specific targets, we've added a new one : react-native-pure. It's as simple as react-web-pure, with no specific UI style. It's a good starting point to take inspiration to create your own GUI target, with your own style.
Misc
- Introduced Guides in docs for more advanced scenarios (e.g. Create a target) (#10)
- Improved the docs for a better readability (#10)
feat(uc): introduce alternate mounting point
Added a new property UCDef.ext.http.mountAlsoAt to be able to define path aliases. See the comment below to understand why.
/**
* The path on which the use case should also mounted at
*
* This is typically used when the mounting point is changed and you want to maintain a "legacy" endpoint for clients having
* a different release cycle than the server (e.g. a mobile app), who are still calling the old endpoint.
*/
mountAlsoAt?: UCHTTPMountingPoint[];feat(uc): add id to fields in UCOutputReader
The UCOutputReader automatically builds a fields list based on the UCDef.io.o fields and order. Although being a technical value, it's sometimes useful to get the id as a field as well as all the other fields explicitly defined. Hence the addition of id to the fields list.
It's finally here ! Very first version of the library with all the primitives discussed in the documentation.
Check it out, play with it, break it, have fun !
Note that the code is not available yet on GitHub but it will be very soon.
First release with the documentation and a stub entrypoint.