An NPM package that can be added to a Node.js/NPM codebase as follows:
$ npm add @lionweb/core
It contains:
- several base types
- the LionCore M3, including the
builtins
language - functions for (de-)serialization
The following is a list of links to potential starting points:
- Implementation of the LionCore metametamodel (M3): see the specific README.
- Metamodel-generic/-aspecific code regarding:
- TypeScript type definitions.
- Representation of references.
- Serialization.
- With respect to deserialization:
- Relax deserialization to just skip serialized nodes for which the corresponding M2 data can't be found.
- Fix a bug w.r.t. enumeration literals — deserializing changed the keys of enumeration literals in the language's definition.
- Deserialization doesn't throw on unresolvable references, but warns on the console and returns
null
(which means “unresolved”).
- Export
byIdMap
function, which computes a map id → thing from an array of things with anid
, from the package. - Made
SerializedProperty.value
null
-able, to align with the specification.
- Fix cycle in imports that some bundlers were having trouble with.
- The serializer now also serializes annotations.
- Add support for custom primitive types.
Specifically:
- A new interface type
PrimitiveTypeSerializer
. - A default implementation
DefaultPrimitiveTypeSerializer
of that that's aware of the LionCore built-in primitive types. -
serializeNodes
has an additional argument of typePrimitiveTypeSerializer
with as default value an instance ofDefaultPrimitiveTypeSerializer
.
- A new interface type
- Add support for custom primitive types.
Specifically:
- A new interface type
PrimitiveTypeDeserializer
. - A default implementation
DefaultPrimitiveTypeDeserializer
of that that's aware of the LionCore built-in primitive types. -
deserializeSerializationChunk
has an additional argument of typePrimitiveTypeDeserializer
with as default value an instance ofDefaultPrimitiveTypeDeserializer
.
- A new interface type
- Expose function
inheritsFrom
.
- Add functions
mapValues
andinstantiableClassifiers
. - Add a method
SymbolTable.languageMatching
to look up a language.
- The deserializer now deserializes all nodes in the serialization chunk, not just the root nodes (identified as having
parent
set tonull
). (This fixes issue #145.)- Also:
deserializeChunk
is renamed todeserializeSerializationChunk
for naming consistency, althoughdeserializeChunk
is retained as an alias.
- Also:
- Add a method
metaType
to M3 types, to deduce classifiers' names from. (That fixes issue #143.)
- Add a method
Classifier.metaPointer
.
- Introduce a
isBuiltinNodeConcept
function that checks whether a classifier happens to be theNode
concept built into LionCore. - Add a reference
annotates
toAnnotation
.
- Introduce a type
SymbolTable
to encapsulate lookup of languages' entities and their features.- Provide a naive and a memoising implementation of the
SymbolTable
abstraction, and use the latter in the deserializer to make that (a bit) more performant.
- Provide a naive and a memoising implementation of the
This is the first version corresponding to a release of LionWeb (version: 2023.1) as a whole.
- Remove JSON Schema generation functionality – this wasn't up-to-date at all.
- Implement persistence of annotations on
Node
s, including (de-)serialization. - Added an optional field
resolveInfoFor
to theExtractionFacade
type, to compute the fieldresolveInfo
field of a serialized reference target. The default used is to check whether a node instance implementsINamed
and takes the value of thename
field. -
Breaking change:
serializeLanguage
anddeserializeLanguage
are now "multi-lingual" in the sense that a serialization chunk can contain multipleLanguage
s. As a result, these functions have been renamed to (the plural)serializeLanguages
(with varargs), anddeserializeLanguages
(returningLanguage[]
). - (Bugfix:) Deserialize
Annotation
s. -
Breaking change: Rework ID and key generation in the LionCore
LanguageFactory
. As part of that:- Add
String[s]Mapper
types, aStringsMapper
instancelast
, and functionsconcatenator
andchain
to produce instances of them. - Remove
M3Node.keyed
and the "awkward" key generation in theInstantiationFacade
for the LionCore language. - Remove types
IdGenerator
, andKeyGenerator
and everything related to that. - Expose keys (instead of qualified names) for LionCore M3 and the LionCore built-ins.
- Add
- Add a type
DynamicINamed
and an M3-functionconceptsOf
, primarily for generation purposes. - Move
asText
and ID checking to@lionweb/utilities
. - Expose a helper function
nameSorted
. - Rename
ConceptInterface
→Interface
. - Change names:
ReadModelAPI
→ExtractionFacade
,WriteModelAPI
→InstantiationFacade
. - Change name of
concept
fields toclassifier
, and their types (where applicable) toClassifier
. - Fix
license
field inpackage.json
to"Apache-2.0"
. - Replace all occurrences of "LIon" (with uppercase 'I') with "Lion" (with lowercase 'i').
- Split the
ModelAPI
interface into a read- and write-part:ReadModelAPI
vs.WriteModelAPI
. - Make fixes w.r.t. multi-language models.
- Migrate from Deno to Node.js.
- Implement import of enums in Ecore importer.
No changelog has been kept for previous versions, regardless of whether these were published or not.
Build it from source as follows:
npm run build