@lionweb/utilities v0.6.12
The utilities package
An NPM package that can be added to a Node.js/NPM codebase as follows:
$ npm add @lionweb/utilitiesIt contains utilities on top of the core package, such as:
- Diagram generation (PlantUML and Mermaid) from an M2.
- “Textualization”, i.e. render a serialization chunk as text.
- Sort the contents of a serialization chunk as much as possible, for the sake of comparing serialization chunks.
- Compute metrics for a serialization chunk (also relative to a given M2).
- Infer a (partial) M2 from a serialization chunk.
- Generation of TypeScript type definitions from an M2.
Changelog
0.6.9 - not yet officially released
- Make
withoutAnnotationsnot modify the original serialization chunk. - (Use the
littoral-templatespackage for textualization — of M2s, so far. This is a technical change, not a functional one, except for maybe some extra whitespace.) - Add reference utilities that all return
ReferenceValueobjects:referenceValues(<source node>, <extraction facade>): all references within the given scope.incomingReferences(<target node(s)>, <search scope>, <extraction facade>): all (unique) references coming into the given target node(s) from the search scope.referencesToOutOfScopeNodes(<scope>, <extraction facade>)all reference targets that are not in the given scope.
0.6.8
- Add a
withoutAnnotationsfunction that removes all annotations, and all their descendants, from a serialization chunk. - The
inferLanguagesFromSerializationChunkfunction now detects whether a property is optional fromnullvalues in the serialization.
0.6.7
- (Depend on
@lionweb/coreversion 0.6.7.)
0.6.6
- (Depend on
@lionweb/coreversion 0.6.6.)
0.6.5
- TS types generator now generates 1 file per language. The generator also has several fixes, and assumes that the generated code will be embedded in an ES6 module.
0.6.4
- Rename
inferLanguagesFromChunk→inferLanguagesFromSerializationChunk(for consistency). - Extend the functionality of the
measuremetrics function.
0.6.3
- Add a
inferLanguagesFromChunkfunction that infers a language from a serialization chunk. - Renaming for consistency and clarity:
readChunk→readSerializationChunktryLoad[All]AsLanguages→tryRead[All]AsLanguages
tryReadAllAsLanguagescombines all serialization chunks (that are the result of serializingLanguages) into one before attempting to deserialize, in order to have cross-language references resolve.
0.6.2
- Add a function
measurethat computes metrics on a serialization chunk.
0.6.1
- Improve PlantUML and Mermaid diagram generation:
- Primitive types now rendered as classes marked as "<>".
- Concepts or Annotations that extend the "Node" concept built into LionCore don't show that.
- Optional (single-valued) features are now shown with a question mark (
?) directly after the type, instead of being marked as "<>". - Fix/add support for annotations.
- Remove all Ecore functionality (=issue #121)
0.6.0
- Add support for annotations in diagram generation (PlantUML and Mermaid), and textualization.
- Remove the
shortenedSerializationChunkfunction, as it isn't used, nor very useful compared to the sorting and textualization. - Breaking name changes: rename
asText→languageAsText,shortenedSerialization→shortenedSerializationChunk,sortedSerialization→sortedSerializationChunk. - Expose an
isSerializedLanguagesfunction. - Expose an
orderedSerializationChunkfunction that aligns the JSON key-value pairs in a serialization chunk according to the specification of the serialization format. That means that key-value pairs appear in precisely the same order as they do in the specification, and that missing key-value pairs are put in and get their default values. - Expose a generic textual syntax for serialization chunks, through the
genericTreeAsTextfunction. This function is optionally language-aware: by providing an array ofLanguages as its second argument, it will try and look upLanguageEntityandFeaturenames instead of rendering their keys.
0.5.0
This is the first version corresponding to a release of LionWeb (version: 2023.1) as a whole.
- Update for the presence of annotations on a(ny)
Node. - Move the
readChunkfunction from@lionweb/clito@lionweb/utilities. - Also generate TypeScript type definitions for
Annotations. - Sort everything in
sortedSerialization. - Extend textual syntax for "multi-linguality".
- Implement textual syntax for
Annotations. - Breaking change: Change ID generation to hashing (
hasherfunction). - (Make small, cosmetic fix in
asTextfunction.) - Add a function
tsTypesForLanguagethat generates TypeScript types. - Receive
asTextand ID checking from@lionweb/core.
No changelog has been kept for previous versions, regardless of whether these were published or not.
Development
Build it from source as follows:
npm run build7 months ago
1 year ago
11 months ago
12 months ago
9 months ago
1 year ago
8 months ago
8 months ago
8 months ago
11 months ago
9 months ago
11 months ago
1 year ago
8 months ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago