Simple Graphviz library for TypeScript.
MIT License
Bot releases are visible (Hide)
#1003 24f4174
Thanks @dependabot! - build(deps-dev): bump vite from 5.1.3 to 5.2.8
#1004 fabb8c8
Thanks @kamiazya! - Fix documentation build failed
Updated dependencies [24f4174
, fabb8c8
]:
Published by github-actions[bot] 7 months ago
#1004 fabb8c8
Thanks @kamiazya! - Fix documentation build failed
Updated dependencies [24f4174
, fabb8c8
]:
Published by github-actions[bot] 7 months ago
#1003 24f4174
Thanks @dependabot! - build(deps-dev): bump vite from 5.1.3 to 5.2.8
#1004 fabb8c8
Thanks @kamiazya! - Fix documentation build failed
Updated dependencies [24f4174
, fabb8c8
]:
Published by github-actions[bot] 7 months ago
Published by github-actions[bot] 7 months ago
#1003 24f4174
Thanks @dependabot! - build(deps-dev): bump vite from 5.1.3 to 5.2.8
#1004 fabb8c8
Thanks @kamiazya! - Fix documentation build failed
Updated dependencies [24f4174
, fabb8c8
]:
Published by github-actions[bot] 7 months ago
#1003 24f4174
Thanks @dependabot! - build(deps-dev): bump vite from 5.1.3 to 5.2.8
#1004 fabb8c8
Thanks @kamiazya! - Fix documentation build failed
Updated dependencies [24f4174
, fabb8c8
]:
Published by github-actions[bot] 7 months ago
#967 cb5517a
Thanks @dependabot! - build(deps-dev): bump webpack from 5.90.2 to 5.90.3
#971 0589b4f
Thanks @dependabot! - build(deps): bump actions/download-artifact from 4.1.3 to 4.1.4
#979 5ce6b59
Thanks @dependabot! - build(deps): bump actions/upload-artifact from 3.1.0 to 4.3.1
#980 122336b
Thanks @dependabot! - build(deps): bump ossf/scorecard-action from 2.1.2 to 2.3.1
#981 b5f36fa
Thanks @dependabot! - build(deps): bump github/codeql-action from 2.2.4 to 3.24.6
#982 c55f2d0
Thanks @dependabot! - build(deps): bump actions/checkout from 3.1.0 to 4.1.1
#986 81a50ff
Thanks @dependabot! - build(deps): bump actions/dependency-review-action from 2.5.1 to 4.1.3
#993 a16f047
Thanks @kamiazya! - Remove pegjs devDependencies
#993 a16f047
Thanks @kamiazya! - ## Some changes
Updated dependencies [cb5517a
, 0589b4f
, 5ce6b59
, 122336b
, b5f36fa
, c55f2d0
, 81a50ff
, 391e98e
, a16f047
, a16f047
]:
Published by github-actions[bot] 7 months ago
#992 391e98e
Thanks @kamiazya! - ## @ts-graphviz/react
integrate with ts-graphviz monorepo
@ts-graphviz/react
repository and integrated it into the monorepo.prop-types
as a dependency.
prop-types
is removed because TypeScript can cover the same functionality.react-dom
to peerDependencies
for streamlined dependency management.
import { Digraph, Node, Edge, render } from "@ts-graphviz/react";
const dot = render(
<Digraph>
<Node
id="A"
label={
<dot:table>
<dot:tr>
<dot:td>left</dot:td>
<dot:td>right</dot:td>
</dot:tr>
</dot:table>
}
/>
</Digraph>
);
renderHTMLLike
functionThe renderHTMLLike
function is introduced for rendering HTML-like labels.
import { renderHTMLLike } from "@ts-graphviz/react";
const htmlLike = renderHTMLLike(
<dot:table>
<dot:tr>
<dot:td>left</dot:td>
<dot:td>right</dot:td>
</dot:tr>
</dot:table>
);
Added the provenance
flag in package.json
for enhanced publishing traceability.
Enhanced TypeScript support and type definitions, including moving types to @ts-graphviz/common
.
@ts-graphviz/common
.Refactor JSX syntax for better compatibility and custom JSX-like syntax for HTMLLike.
Published by github-actions[bot] 7 months ago
#967 cb5517a
Thanks @dependabot! - build(deps-dev): bump webpack from 5.90.2 to 5.90.3
#971 0589b4f
Thanks @dependabot! - build(deps): bump actions/download-artifact from 4.1.3 to 4.1.4
#979 5ce6b59
Thanks @dependabot! - build(deps): bump actions/upload-artifact from 3.1.0 to 4.3.1
#980 122336b
Thanks @dependabot! - build(deps): bump ossf/scorecard-action from 2.1.2 to 2.3.1
#981 b5f36fa
Thanks @dependabot! - build(deps): bump github/codeql-action from 2.2.4 to 3.24.6
#982 c55f2d0
Thanks @dependabot! - build(deps): bump actions/checkout from 3.1.0 to 4.1.1
#986 81a50ff
Thanks @dependabot! - build(deps): bump actions/dependency-review-action from 2.5.1 to 4.1.3
#993 a16f047
Thanks @kamiazya! - ## Some changes
Updated dependencies [cb5517a
, 0589b4f
, 5ce6b59
, 122336b
, b5f36fa
, c55f2d0
, 81a50ff
, 391e98e
, a16f047
, a16f047
]:
Published by github-actions[bot] 7 months ago
#967 cb5517a
Thanks @dependabot! - build(deps-dev): bump webpack from 5.90.2 to 5.90.3
#971 0589b4f
Thanks @dependabot! - build(deps): bump actions/download-artifact from 4.1.3 to 4.1.4
#979 5ce6b59
Thanks @dependabot! - build(deps): bump actions/upload-artifact from 3.1.0 to 4.3.1
#980 122336b
Thanks @dependabot! - build(deps): bump ossf/scorecard-action from 2.1.2 to 2.3.1
#981 b5f36fa
Thanks @dependabot! - build(deps): bump github/codeql-action from 2.2.4 to 3.24.6
#982 c55f2d0
Thanks @dependabot! - build(deps): bump actions/checkout from 3.1.0 to 4.1.1
#986 81a50ff
Thanks @dependabot! - build(deps): bump actions/dependency-review-action from 2.5.1 to 4.1.3
#993 a16f047
Thanks @kamiazya! - ## Some changes
Published by github-actions[bot] 7 months ago
#967 cb5517a
Thanks @dependabot! - build(deps-dev): bump webpack from 5.90.2 to 5.90.3
#971 0589b4f
Thanks @dependabot! - build(deps): bump actions/download-artifact from 4.1.3 to 4.1.4
#979 5ce6b59
Thanks @dependabot! - build(deps): bump actions/upload-artifact from 3.1.0 to 4.3.1
#980 122336b
Thanks @dependabot! - build(deps): bump ossf/scorecard-action from 2.1.2 to 2.3.1
#981 b5f36fa
Thanks @dependabot! - build(deps): bump github/codeql-action from 2.2.4 to 3.24.6
#982 c55f2d0
Thanks @dependabot! - build(deps): bump actions/checkout from 3.1.0 to 4.1.1
#986 81a50ff
Thanks @dependabot! - build(deps): bump actions/dependency-review-action from 2.5.1 to 4.1.3
#993 a16f047
Thanks @kamiazya! - ## Some changes
Updated dependencies [cb5517a
, 0589b4f
, 5ce6b59
, 122336b
, b5f36fa
, c55f2d0
, 81a50ff
, 391e98e
, a16f047
, a16f047
]:
Published by github-actions[bot] 7 months ago
#967 cb5517a
Thanks @dependabot! - build(deps-dev): bump webpack from 5.90.2 to 5.90.3
#971 0589b4f
Thanks @dependabot! - build(deps): bump actions/download-artifact from 4.1.3 to 4.1.4
#979 5ce6b59
Thanks @dependabot! - build(deps): bump actions/upload-artifact from 3.1.0 to 4.3.1
#980 122336b
Thanks @dependabot! - build(deps): bump ossf/scorecard-action from 2.1.2 to 2.3.1
#981 b5f36fa
Thanks @dependabot! - build(deps): bump github/codeql-action from 2.2.4 to 3.24.6
#982 c55f2d0
Thanks @dependabot! - build(deps): bump actions/checkout from 3.1.0 to 4.1.1
#986 81a50ff
Thanks @dependabot! - build(deps): bump actions/dependency-review-action from 2.5.1 to 4.1.3
#993 a16f047
Thanks @kamiazya! - ## Some changes
Updated dependencies [cb5517a
, 0589b4f
, 5ce6b59
, 122336b
, b5f36fa
, c55f2d0
, 81a50ff
, 391e98e
, a16f047
, a16f047
]:
Published by github-actions[bot] 8 months ago
#956 1e4f57a
Thanks @kamiazya! - # ts-graphviz v2
We are introducing a major version upgrade to ts-graphviz to ensure better performance, security, and compatibility with the latest improvements in the JavaScript ecosystem. With this upgrade, we will no longer support Node.js 14 & 16, which has reached its End-of-Life (EOL), and set the new minimum guaranteed version to Node.js 18.
This major version upgrade is necessary due to the following reasons:
Breaking Change: Dropping support for Node.js 14 & 16 is considered a breaking change, which requires a major version upgrade according to semantic versioning principles.
Improved Stability and Performance: By focusing on LTS versions, we can provide a library that benefits from the stability, long-term support, and performance improvements provided by newer Node.js versions.
Security: Ensuring that our library is compatible with the latest supported Node.js versions helps to minimize potential security vulnerabilities.
To help our users understand our approach to Node.js version support, we have established a clear Node.js Version Support Policy for ts-graphviz.
We encourage our users to update their projects to the latest LTS version of Node.js to ensure the best performance, security, and compatibility with ts-graphviz.
ts-graphviz is a TypeScript library designed to create, manipulate, and render Graphviz DOT language graphs.
It is built around several key concepts that make it modular, extensible, and easy to use:
TypeScript-First Design & Type Definitions: ts-graphviz is designed with TypeScript as its primary language, providing strong typing and ensuring seamless integration with TypeScript projects. This enables users to leverage the full power of TypeScript's type system and tooling while working with Graphviz graphs. The library includes comprehensive type definitions for DOT language elements, making it easier to work with Graphviz elements in a type-safe manner.
Object-Oriented API: ts-graphviz provides an object-oriented API for creating and manipulating graph elements like graphs, nodes, and edges. This enables users to work with complex graph structures intuitively and efficiently.
Modular Design[New in v2]: The library is split into multiple packages, each serving a specific purpose. This modular design allows users to pick and choose the functionality they need, resulting in improved maintainability and flexibility.
AST Support: ts-graphviz includes a module for processing DOT language at the Abstract Syntax Tree (AST) level. This feature allows users to parse and generate DOT language while preserving its structure, making it easier to manipulate and transform graphs programmatically.
Runtime Adapter: The library provides adapter functions that enable users to execute Graphviz commands across different runtime environments, such as Node.js and Deno. These adapter functions serve as a wrapper, allowing for seamless integration with various platforms.
Extensibility: ts-graphviz has been designed with extensibility in mind, allowing users to extend its functionality with custom implementations for specific use cases.
Multi-Paradigm Support: ts-graphviz is designed to accommodate various programming paradigms, such as Object-Oriented Programming, Declarative Programming, and Functional Programming. This ensures that users can choose the programming style that best suits their needs and preferences, making it adaptable and versatile across different use cases and development approaches.
By combining these key concepts, ts-graphviz aims to provide a powerful and user-friendly tool for working with Graphviz DOT language in TypeScript projects.
The purpose of package splitting and monorepo-ization in the ts-graphviz v2 is to achieve the following objectives:
Overall, package splitting and monorepo-ization aim to create a more robust, maintainable, and user-friendly library that better serves the needs of the ts-graphviz community.
In v2 of ts-graphviz, the library functionality will be split into several packages. The packages to be split are as follows:
To ensure that existing users are not affected, the ts-graphviz package will remain available. This change will result in a clear division of functionality and will improve the scalability and maintainability of the project. However, users of previous versions and users who wish to use the library without extending it will be able to continue to use the ts-graphviz package as is.
Please note that while we strive to maintain compatibility, there might be some minor differences or limitations in the compatibility package compared to the original ts-graphviz library. It is essential to review the documentation and update your code accordingly if needed, but only when you decide to migrate to the new package structure.
Package | Summary | Description |
---|---|---|
ts-graphviz | Graphviz library for TypeScript | The main package that serves as the entry point for users. It provides a high-level API for creating, manipulating, and rendering Graphviz DOT language graphs. |
@ts-graphviz/common | Graphviz Types and Utilities | Contains type information related to DOT language attributes, attribute values, and models. |
@ts-graphviz/ast | Graphviz AST(Abstract Syntax Tree) Utilities | Includes the module for processing DOT language at the AST (Abstract Syntax Tree) level. |
@ts-graphviz/core | Graphviz Models for Object-Oriented Programming | Comprises the implementation of models and functions provided to users. |
@ts-graphviz/adapter | Graphviz Runtime adapters for Cross Platform | Handles runtime-dependent processing, such as input/output processing and Renderer implementations for different environments. |
Starting with the upcoming release, ts-graphviz will no longer support Node.js 14 & 16, which has reached its End-of-Life (EOL). The new minimum guaranteed version will be Node.js 18. This decision allows us to focus on providing a secure and up-to-date library while minimizing the maintenance burden of supporting outdated versions.
To minimize disruption for our users, we have established a clear Node.js Version Support Policy for our library. This policy helps users understand our approach to Node.js version support and what to expect when using our library.
We encourage our users to update their projects to the latest LTS version of Node.js to ensure the best performance, security, and compatibility with ts-graphviz.
Our goal is to provide a stable and secure library for our users while keeping up with improvements in the JavaScript ecosystem. To achieve this, we have established the following Node.js version support policy for ts-graphviz:
Minimum Guaranteed Version: We guarantee support for the latest Node.js version that has entered Long-Term Support (LTS) at the time of a major release of our library. This ensures that our library benefits from the stability and long-term support provided by LTS versions.
End-of-Life (EOL) Policy: We will cease support for Node.js versions when they reach their EOL, as defined by the Node.js release schedule. This helps us focus on providing a secure and up-to-date library while minimizing the maintenance burden of supporting outdated versions.
Version Support Communication: We will communicate our Node.js version support policy in our library's documentation and release notes. When a new major version is released or when a Node.js version enters EOL, we will inform our users through release notes, blog posts, or other relevant channels.
Migration Guides : When introducing breaking changes due to Node.js version support updates, we will provide migration guides to help our users transition their projects to the new requirements smoothly.
To migrate to the new Node.js version support policy, follow these steps:
node -v
By following these steps, you can migrate your project to the latest LTS version of Node.js and ensure compatibility with ts-graphviz.
AttributeKeyDict
type to Attribute.keys
typeAttributeKeyDict
was deprecated in v1, so it was removed in v2.
Please modify to use Attribute.keys
.
- import { AttributeKeyDict } from 'ts-graphviz';
+ import { Attribute } from '@ts-graphviz/common';
- const foo: AttributeKeyDict = ...;
+ const foo: Attribute.keys = ...;
ts-graphviz/adapter
to @ts-graphviz/adapter
To migrate from the ts-graphviz/adapter
module to the @ts-graphviz/adapter
module, follow these steps:
Update Import Statements: Update import statements in your code to use the new module name.
- import { } from 'ts-graphviz/adapter';
+ import { } from '@ts-graphviz/adapter';
Update Package.json: Update the ts-graphviz
dependency in your package.json
file to use the new version of the @ts-graphviz/adapter
module.
- "ts-graphviz": "^1.0.0",
+ "ts-graphviz": "^2.0.0",
+ "@ts-graphviz/adapter": "^2.0.0",
Update Code References: Search your codebase for any references to the ts-graphviz/adapter
module and update them to use the new module name.
- import { } from 'ts-graphviz/adapter';
+ import { } from '@ts-graphviz/adapter';
ts-graphviz/ast
to @ts-graphviz/ast
To migrate from the ts-graphviz/adapter
module to the @ts-graphviz/adapter
module, follow these steps:
Update Import Statements: Update import statements in your code to use the new module name.
- import { } from 'ts-graphviz/ast';
+ import { } from '@ts-graphviz/ast';
Update Package.json: Update the ts-graphviz
dependency in your package.json
file to use the new version of the @ts-graphviz/ast
module.
- "ts-graphviz": "^1.0.0",
+ "ts-graphviz": "^2.0.0",
+ "@ts-graphviz/ast": "^2.0.0",
Update Code References: Search your codebase for any references to the ts-graphviz/ast
module and update them to use the new module name.
- import { } from 'ts-graphviz/ast';
+ import { } from '@ts-graphviz/ast';
Common types moves to @ts-graphviz/common
in v2.0.0.
If you have extended the type system, you need to update the import path.
-import { $keywords } from 'ts-graphviz';
+import { $keywords } from '@ts-graphviz/common';
-import { toFile } from 'ts-graphviz/adapter';
+import { toFile } from '@ts-graphviz/adapter';
-// 1. Declare the 'ts-graphviz/adapter' module.
-declare module 'ts-graphviz/adapter' {
+// 1. Declare the '@ts-graphviz/adapter' module.
+declare module '@ts-graphviz/adapter' {
export namespace Layout {
// 2. Define the $values interface in the Layout namespace.
// 3. Inherit from $keywords<'my-custom-algorithm'> and specify the name of the new layout engine in <...>.
export interface $values extends $keywords<'my-custom-algorithm'> {}
}
export namespace Format {
// 4. Define the $values interface in the Format namespace.
// 5. Inherit from $keywords<'mp4'> and specify the name of the new output format in <...>.
export interface $values extends $keywords<'mp4'> {}
}
}
toFile('digraph { a -> b }', '/path/to/file', {
layout: 'my-custom-algorithm',
format: 'mp4',
});
- import { digraph, toDot, attribute as _, $keywords } from 'ts-graphviz';
+ import { $keywords } from '@ts-graphviz'/common;
+ import { digraph, toDot, attribute as _ } from 'ts-graphviz';
-// 1. Declare the 'ts-graphviz' module.
-declare module 'ts-graphviz' {
+// 1. Declare the '@ts-graphviz/common' module.
+declare module '@ts-graphviz/common' {
export namespace GraphAttributeKey {
// 2. Define the $values interface in the GraphAttributeKey namespace.
// 3. Inherit from $keywords<'hoge'> and specify the name of the new attribute in <...>.
export interface $values extends $keywords<'hoge'> {}
}
export namespace Attribute {
// 4. Define the $keys interface in the Attribute namespace.
// 5. Inherit from $keywords<'hoge'> and specify the name of the new attribute in <...>.
export interface $keys extends $keywords<'hoge'> {}
// 6. Define the $types interface in the Attribute namespace.
// 7. Specify the new attribute in the key and define its corresponding value in the value.
export interface $types {
hoge: string;
}
}
}
console.log(
toDot(
digraph((g) => {
g.set(_.hoge, 'fuga');
}),
),
);
Migration from yarn v1 to pnpm has been done for package management.
To enhance the development experience, the build tool has been changed from rollup to vite, and the test suite from jest to vitest. This was done because jest lacked standard support for monorepo integration and TypeScript, requiring the installation of additional plugins. However, vite and vitest handle these challenges more elegantly, providing a smoother and more efficient development workflow.
The release flow has been updated to use the changeset tool to manage changes and releases.
This tool allows for a more streamlined and automated release process, making it easier to manage versioning and changelogs across multiple packages within the monorepo.
The linter and formatter have been updated to use biome, respectively.
This change was made to ensure consistent code style and formatting across the entire codebase, making it easier to maintain and contribute to the project.
@microsoft/api-extractor
specification used internally in the d.ts file rollup.#966 d579034
Thanks @dependabot! - build(deps-dev): bump vite-plugin-dts from 3.7.2 to 3.7.3
#970 54f4565
Thanks @dependabot! - build(deps-dev): bump @types/node from 20.11.20 to 20.11.24
Updated dependencies [d579034
, 54f4565
, 1e4f57a
]:
Published by github-actions[bot] 8 months ago
#956 1e4f57a
Thanks @kamiazya! - # ts-graphviz v2
We are introducing a major version upgrade to ts-graphviz to ensure better performance, security, and compatibility with the latest improvements in the JavaScript ecosystem. With this upgrade, we will no longer support Node.js 14 & 16, which has reached its End-of-Life (EOL), and set the new minimum guaranteed version to Node.js 18.
This major version upgrade is necessary due to the following reasons:
Breaking Change: Dropping support for Node.js 14 & 16 is considered a breaking change, which requires a major version upgrade according to semantic versioning principles.
Improved Stability and Performance: By focusing on LTS versions, we can provide a library that benefits from the stability, long-term support, and performance improvements provided by newer Node.js versions.
Security: Ensuring that our library is compatible with the latest supported Node.js versions helps to minimize potential security vulnerabilities.
To help our users understand our approach to Node.js version support, we have established a clear Node.js Version Support Policy for ts-graphviz.
We encourage our users to update their projects to the latest LTS version of Node.js to ensure the best performance, security, and compatibility with ts-graphviz.
ts-graphviz is a TypeScript library designed to create, manipulate, and render Graphviz DOT language graphs.
It is built around several key concepts that make it modular, extensible, and easy to use:
TypeScript-First Design & Type Definitions: ts-graphviz is designed with TypeScript as its primary language, providing strong typing and ensuring seamless integration with TypeScript projects. This enables users to leverage the full power of TypeScript's type system and tooling while working with Graphviz graphs. The library includes comprehensive type definitions for DOT language elements, making it easier to work with Graphviz elements in a type-safe manner.
Object-Oriented API: ts-graphviz provides an object-oriented API for creating and manipulating graph elements like graphs, nodes, and edges. This enables users to work with complex graph structures intuitively and efficiently.
Modular Design[New in v2]: The library is split into multiple packages, each serving a specific purpose. This modular design allows users to pick and choose the functionality they need, resulting in improved maintainability and flexibility.
AST Support: ts-graphviz includes a module for processing DOT language at the Abstract Syntax Tree (AST) level. This feature allows users to parse and generate DOT language while preserving its structure, making it easier to manipulate and transform graphs programmatically.
Runtime Adapter: The library provides adapter functions that enable users to execute Graphviz commands across different runtime environments, such as Node.js and Deno. These adapter functions serve as a wrapper, allowing for seamless integration with various platforms.
Extensibility: ts-graphviz has been designed with extensibility in mind, allowing users to extend its functionality with custom implementations for specific use cases.
Multi-Paradigm Support: ts-graphviz is designed to accommodate various programming paradigms, such as Object-Oriented Programming, Declarative Programming, and Functional Programming. This ensures that users can choose the programming style that best suits their needs and preferences, making it adaptable and versatile across different use cases and development approaches.
By combining these key concepts, ts-graphviz aims to provide a powerful and user-friendly tool for working with Graphviz DOT language in TypeScript projects.
The purpose of package splitting and monorepo-ization in the ts-graphviz v2 is to achieve the following objectives:
Overall, package splitting and monorepo-ization aim to create a more robust, maintainable, and user-friendly library that better serves the needs of the ts-graphviz community.
In v2 of ts-graphviz, the library functionality will be split into several packages. The packages to be split are as follows:
To ensure that existing users are not affected, the ts-graphviz package will remain available. This change will result in a clear division of functionality and will improve the scalability and maintainability of the project. However, users of previous versions and users who wish to use the library without extending it will be able to continue to use the ts-graphviz package as is.
Please note that while we strive to maintain compatibility, there might be some minor differences or limitations in the compatibility package compared to the original ts-graphviz library. It is essential to review the documentation and update your code accordingly if needed, but only when you decide to migrate to the new package structure.
Package | Summary | Description |
---|---|---|
ts-graphviz | Graphviz library for TypeScript | The main package that serves as the entry point for users. It provides a high-level API for creating, manipulating, and rendering Graphviz DOT language graphs. |
@ts-graphviz/common | Graphviz Types and Utilities | Contains type information related to DOT language attributes, attribute values, and models. |
@ts-graphviz/ast | Graphviz AST(Abstract Syntax Tree) Utilities | Includes the module for processing DOT language at the AST (Abstract Syntax Tree) level. |
@ts-graphviz/core | Graphviz Models for Object-Oriented Programming | Comprises the implementation of models and functions provided to users. |
@ts-graphviz/adapter | Graphviz Runtime adapters for Cross Platform | Handles runtime-dependent processing, such as input/output processing and Renderer implementations for different environments. |
Starting with the upcoming release, ts-graphviz will no longer support Node.js 14 & 16, which has reached its End-of-Life (EOL). The new minimum guaranteed version will be Node.js 18. This decision allows us to focus on providing a secure and up-to-date library while minimizing the maintenance burden of supporting outdated versions.
To minimize disruption for our users, we have established a clear Node.js Version Support Policy for our library. This policy helps users understand our approach to Node.js version support and what to expect when using our library.
We encourage our users to update their projects to the latest LTS version of Node.js to ensure the best performance, security, and compatibility with ts-graphviz.
Our goal is to provide a stable and secure library for our users while keeping up with improvements in the JavaScript ecosystem. To achieve this, we have established the following Node.js version support policy for ts-graphviz:
Minimum Guaranteed Version: We guarantee support for the latest Node.js version that has entered Long-Term Support (LTS) at the time of a major release of our library. This ensures that our library benefits from the stability and long-term support provided by LTS versions.
End-of-Life (EOL) Policy: We will cease support for Node.js versions when they reach their EOL, as defined by the Node.js release schedule. This helps us focus on providing a secure and up-to-date library while minimizing the maintenance burden of supporting outdated versions.
Version Support Communication: We will communicate our Node.js version support policy in our library's documentation and release notes. When a new major version is released or when a Node.js version enters EOL, we will inform our users through release notes, blog posts, or other relevant channels.
Migration Guides : When introducing breaking changes due to Node.js version support updates, we will provide migration guides to help our users transition their projects to the new requirements smoothly.
To migrate to the new Node.js version support policy, follow these steps:
node -v
By following these steps, you can migrate your project to the latest LTS version of Node.js and ensure compatibility with ts-graphviz.
AttributeKeyDict
type to Attribute.keys
typeAttributeKeyDict
was deprecated in v1, so it was removed in v2.
Please modify to use Attribute.keys
.
- import { AttributeKeyDict } from 'ts-graphviz';
+ import { Attribute } from '@ts-graphviz/common';
- const foo: AttributeKeyDict = ...;
+ const foo: Attribute.keys = ...;
ts-graphviz/adapter
to @ts-graphviz/adapter
To migrate from the ts-graphviz/adapter
module to the @ts-graphviz/adapter
module, follow these steps:
Update Import Statements: Update import statements in your code to use the new module name.
- import { } from 'ts-graphviz/adapter';
+ import { } from '@ts-graphviz/adapter';
Update Package.json: Update the ts-graphviz
dependency in your package.json
file to use the new version of the @ts-graphviz/adapter
module.
- "ts-graphviz": "^1.0.0",
+ "ts-graphviz": "^2.0.0",
+ "@ts-graphviz/adapter": "^2.0.0",
Update Code References: Search your codebase for any references to the ts-graphviz/adapter
module and update them to use the new module name.
- import { } from 'ts-graphviz/adapter';
+ import { } from '@ts-graphviz/adapter';
ts-graphviz/ast
to @ts-graphviz/ast
To migrate from the ts-graphviz/adapter
module to the @ts-graphviz/adapter
module, follow these steps:
Update Import Statements: Update import statements in your code to use the new module name.
- import { } from 'ts-graphviz/ast';
+ import { } from '@ts-graphviz/ast';
Update Package.json: Update the ts-graphviz
dependency in your package.json
file to use the new version of the @ts-graphviz/ast
module.
- "ts-graphviz": "^1.0.0",
+ "ts-graphviz": "^2.0.0",
+ "@ts-graphviz/ast": "^2.0.0",
Update Code References: Search your codebase for any references to the ts-graphviz/ast
module and update them to use the new module name.
- import { } from 'ts-graphviz/ast';
+ import { } from '@ts-graphviz/ast';
Common types moves to @ts-graphviz/common
in v2.0.0.
If you have extended the type system, you need to update the import path.
-import { $keywords } from 'ts-graphviz';
+import { $keywords } from '@ts-graphviz/common';
-import { toFile } from 'ts-graphviz/adapter';
+import { toFile } from '@ts-graphviz/adapter';
-// 1. Declare the 'ts-graphviz/adapter' module.
-declare module 'ts-graphviz/adapter' {
+// 1. Declare the '@ts-graphviz/adapter' module.
+declare module '@ts-graphviz/adapter' {
export namespace Layout {
// 2. Define the $values interface in the Layout namespace.
// 3. Inherit from $keywords<'my-custom-algorithm'> and specify the name of the new layout engine in <...>.
export interface $values extends $keywords<'my-custom-algorithm'> {}
}
export namespace Format {
// 4. Define the $values interface in the Format namespace.
// 5. Inherit from $keywords<'mp4'> and specify the name of the new output format in <...>.
export interface $values extends $keywords<'mp4'> {}
}
}
toFile('digraph { a -> b }', '/path/to/file', {
layout: 'my-custom-algorithm',
format: 'mp4',
});
- import { digraph, toDot, attribute as _, $keywords } from 'ts-graphviz';
+ import { $keywords } from '@ts-graphviz'/common;
+ import { digraph, toDot, attribute as _ } from 'ts-graphviz';
-// 1. Declare the 'ts-graphviz' module.
-declare module 'ts-graphviz' {
+// 1. Declare the '@ts-graphviz/common' module.
+declare module '@ts-graphviz/common' {
export namespace GraphAttributeKey {
// 2. Define the $values interface in the GraphAttributeKey namespace.
// 3. Inherit from $keywords<'hoge'> and specify the name of the new attribute in <...>.
export interface $values extends $keywords<'hoge'> {}
}
export namespace Attribute {
// 4. Define the $keys interface in the Attribute namespace.
// 5. Inherit from $keywords<'hoge'> and specify the name of the new attribute in <...>.
export interface $keys extends $keywords<'hoge'> {}
// 6. Define the $types interface in the Attribute namespace.
// 7. Specify the new attribute in the key and define its corresponding value in the value.
export interface $types {
hoge: string;
}
}
}
console.log(
toDot(
digraph((g) => {
g.set(_.hoge, 'fuga');
}),
),
);
Migration from yarn v1 to pnpm has been done for package management.
To enhance the development experience, the build tool has been changed from rollup to vite, and the test suite from jest to vitest. This was done because jest lacked standard support for monorepo integration and TypeScript, requiring the installation of additional plugins. However, vite and vitest handle these challenges more elegantly, providing a smoother and more efficient development workflow.
The release flow has been updated to use the changeset tool to manage changes and releases.
This tool allows for a more streamlined and automated release process, making it easier to manage versioning and changelogs across multiple packages within the monorepo.
The linter and formatter have been updated to use biome, respectively.
This change was made to ensure consistent code style and formatting across the entire codebase, making it easier to maintain and contribute to the project.
@microsoft/api-extractor
specification used internally in the d.ts file rollup.#966 d579034
Thanks @dependabot! - build(deps-dev): bump vite-plugin-dts from 3.7.2 to 3.7.3
#970 54f4565
Thanks @dependabot! - build(deps-dev): bump @types/node from 20.11.20 to 20.11.24
Updated dependencies [d579034
, 54f4565
, 1e4f57a
]:
Published by github-actions[bot] 8 months ago
#956 1e4f57a
Thanks @kamiazya! - # ts-graphviz v2
We are introducing a major version upgrade to ts-graphviz to ensure better performance, security, and compatibility with the latest improvements in the JavaScript ecosystem. With this upgrade, we will no longer support Node.js 14 & 16, which has reached its End-of-Life (EOL), and set the new minimum guaranteed version to Node.js 18.
This major version upgrade is necessary due to the following reasons:
Breaking Change: Dropping support for Node.js 14 & 16 is considered a breaking change, which requires a major version upgrade according to semantic versioning principles.
Improved Stability and Performance: By focusing on LTS versions, we can provide a library that benefits from the stability, long-term support, and performance improvements provided by newer Node.js versions.
Security: Ensuring that our library is compatible with the latest supported Node.js versions helps to minimize potential security vulnerabilities.
To help our users understand our approach to Node.js version support, we have established a clear Node.js Version Support Policy for ts-graphviz.
We encourage our users to update their projects to the latest LTS version of Node.js to ensure the best performance, security, and compatibility with ts-graphviz.
ts-graphviz is a TypeScript library designed to create, manipulate, and render Graphviz DOT language graphs.
It is built around several key concepts that make it modular, extensible, and easy to use:
TypeScript-First Design & Type Definitions: ts-graphviz is designed with TypeScript as its primary language, providing strong typing and ensuring seamless integration with TypeScript projects. This enables users to leverage the full power of TypeScript's type system and tooling while working with Graphviz graphs. The library includes comprehensive type definitions for DOT language elements, making it easier to work with Graphviz elements in a type-safe manner.
Object-Oriented API: ts-graphviz provides an object-oriented API for creating and manipulating graph elements like graphs, nodes, and edges. This enables users to work with complex graph structures intuitively and efficiently.
Modular Design[New in v2]: The library is split into multiple packages, each serving a specific purpose. This modular design allows users to pick and choose the functionality they need, resulting in improved maintainability and flexibility.
AST Support: ts-graphviz includes a module for processing DOT language at the Abstract Syntax Tree (AST) level. This feature allows users to parse and generate DOT language while preserving its structure, making it easier to manipulate and transform graphs programmatically.
Runtime Adapter: The library provides adapter functions that enable users to execute Graphviz commands across different runtime environments, such as Node.js and Deno. These adapter functions serve as a wrapper, allowing for seamless integration with various platforms.
Extensibility: ts-graphviz has been designed with extensibility in mind, allowing users to extend its functionality with custom implementations for specific use cases.
Multi-Paradigm Support: ts-graphviz is designed to accommodate various programming paradigms, such as Object-Oriented Programming, Declarative Programming, and Functional Programming. This ensures that users can choose the programming style that best suits their needs and preferences, making it adaptable and versatile across different use cases and development approaches.
By combining these key concepts, ts-graphviz aims to provide a powerful and user-friendly tool for working with Graphviz DOT language in TypeScript projects.
The purpose of package splitting and monorepo-ization in the ts-graphviz v2 is to achieve the following objectives:
Overall, package splitting and monorepo-ization aim to create a more robust, maintainable, and user-friendly library that better serves the needs of the ts-graphviz community.
In v2 of ts-graphviz, the library functionality will be split into several packages. The packages to be split are as follows:
To ensure that existing users are not affected, the ts-graphviz package will remain available. This change will result in a clear division of functionality and will improve the scalability and maintainability of the project. However, users of previous versions and users who wish to use the library without extending it will be able to continue to use the ts-graphviz package as is.
Please note that while we strive to maintain compatibility, there might be some minor differences or limitations in the compatibility package compared to the original ts-graphviz library. It is essential to review the documentation and update your code accordingly if needed, but only when you decide to migrate to the new package structure.
Package | Summary | Description |
---|---|---|
ts-graphviz | Graphviz library for TypeScript | The main package that serves as the entry point for users. It provides a high-level API for creating, manipulating, and rendering Graphviz DOT language graphs. |
@ts-graphviz/common | Graphviz Types and Utilities | Contains type information related to DOT language attributes, attribute values, and models. |
@ts-graphviz/ast | Graphviz AST(Abstract Syntax Tree) Utilities | Includes the module for processing DOT language at the AST (Abstract Syntax Tree) level. |
@ts-graphviz/core | Graphviz Models for Object-Oriented Programming | Comprises the implementation of models and functions provided to users. |
@ts-graphviz/adapter | Graphviz Runtime adapters for Cross Platform | Handles runtime-dependent processing, such as input/output processing and Renderer implementations for different environments. |
Starting with the upcoming release, ts-graphviz will no longer support Node.js 14 & 16, which has reached its End-of-Life (EOL). The new minimum guaranteed version will be Node.js 18. This decision allows us to focus on providing a secure and up-to-date library while minimizing the maintenance burden of supporting outdated versions.
To minimize disruption for our users, we have established a clear Node.js Version Support Policy for our library. This policy helps users understand our approach to Node.js version support and what to expect when using our library.
We encourage our users to update their projects to the latest LTS version of Node.js to ensure the best performance, security, and compatibility with ts-graphviz.
Our goal is to provide a stable and secure library for our users while keeping up with improvements in the JavaScript ecosystem. To achieve this, we have established the following Node.js version support policy for ts-graphviz:
Minimum Guaranteed Version: We guarantee support for the latest Node.js version that has entered Long-Term Support (LTS) at the time of a major release of our library. This ensures that our library benefits from the stability and long-term support provided by LTS versions.
End-of-Life (EOL) Policy: We will cease support for Node.js versions when they reach their EOL, as defined by the Node.js release schedule. This helps us focus on providing a secure and up-to-date library while minimizing the maintenance burden of supporting outdated versions.
Version Support Communication: We will communicate our Node.js version support policy in our library's documentation and release notes. When a new major version is released or when a Node.js version enters EOL, we will inform our users through release notes, blog posts, or other relevant channels.
Migration Guides : When introducing breaking changes due to Node.js version support updates, we will provide migration guides to help our users transition their projects to the new requirements smoothly.
To migrate to the new Node.js version support policy, follow these steps:
node -v
By following these steps, you can migrate your project to the latest LTS version of Node.js and ensure compatibility with ts-graphviz.
AttributeKeyDict
type to Attribute.keys
typeAttributeKeyDict
was deprecated in v1, so it was removed in v2.
Please modify to use Attribute.keys
.
- import { AttributeKeyDict } from 'ts-graphviz';
+ import { Attribute } from '@ts-graphviz/common';
- const foo: AttributeKeyDict = ...;
+ const foo: Attribute.keys = ...;
ts-graphviz/adapter
to @ts-graphviz/adapter
To migrate from the ts-graphviz/adapter
module to the @ts-graphviz/adapter
module, follow these steps:
Update Import Statements: Update import statements in your code to use the new module name.
- import { } from 'ts-graphviz/adapter';
+ import { } from '@ts-graphviz/adapter';
Update Package.json: Update the ts-graphviz
dependency in your package.json
file to use the new version of the @ts-graphviz/adapter
module.
- "ts-graphviz": "^1.0.0",
+ "ts-graphviz": "^2.0.0",
+ "@ts-graphviz/adapter": "^2.0.0",
Update Code References: Search your codebase for any references to the ts-graphviz/adapter
module and update them to use the new module name.
- import { } from 'ts-graphviz/adapter';
+ import { } from '@ts-graphviz/adapter';
ts-graphviz/ast
to @ts-graphviz/ast
To migrate from the ts-graphviz/adapter
module to the @ts-graphviz/adapter
module, follow these steps:
Update Import Statements: Update import statements in your code to use the new module name.
- import { } from 'ts-graphviz/ast';
+ import { } from '@ts-graphviz/ast';
Update Package.json: Update the ts-graphviz
dependency in your package.json
file to use the new version of the @ts-graphviz/ast
module.
- "ts-graphviz": "^1.0.0",
+ "ts-graphviz": "^2.0.0",
+ "@ts-graphviz/ast": "^2.0.0",
Update Code References: Search your codebase for any references to the ts-graphviz/ast
module and update them to use the new module name.
- import { } from 'ts-graphviz/ast';
+ import { } from '@ts-graphviz/ast';
Common types moves to @ts-graphviz/common
in v2.0.0.
If you have extended the type system, you need to update the import path.
-import { $keywords } from 'ts-graphviz';
+import { $keywords } from '@ts-graphviz/common';
-import { toFile } from 'ts-graphviz/adapter';
+import { toFile } from '@ts-graphviz/adapter';
-// 1. Declare the 'ts-graphviz/adapter' module.
-declare module 'ts-graphviz/adapter' {
+// 1. Declare the '@ts-graphviz/adapter' module.
+declare module '@ts-graphviz/adapter' {
export namespace Layout {
// 2. Define the $values interface in the Layout namespace.
// 3. Inherit from $keywords<'my-custom-algorithm'> and specify the name of the new layout engine in <...>.
export interface $values extends $keywords<'my-custom-algorithm'> {}
}
export namespace Format {
// 4. Define the $values interface in the Format namespace.
// 5. Inherit from $keywords<'mp4'> and specify the name of the new output format in <...>.
export interface $values extends $keywords<'mp4'> {}
}
}
toFile('digraph { a -> b }', '/path/to/file', {
layout: 'my-custom-algorithm',
format: 'mp4',
});
- import { digraph, toDot, attribute as _, $keywords } from 'ts-graphviz';
+ import { $keywords } from '@ts-graphviz'/common;
+ import { digraph, toDot, attribute as _ } from 'ts-graphviz';
-// 1. Declare the 'ts-graphviz' module.
-declare module 'ts-graphviz' {
+// 1. Declare the '@ts-graphviz/common' module.
+declare module '@ts-graphviz/common' {
export namespace GraphAttributeKey {
// 2. Define the $values interface in the GraphAttributeKey namespace.
// 3. Inherit from $keywords<'hoge'> and specify the name of the new attribute in <...>.
export interface $values extends $keywords<'hoge'> {}
}
export namespace Attribute {
// 4. Define the $keys interface in the Attribute namespace.
// 5. Inherit from $keywords<'hoge'> and specify the name of the new attribute in <...>.
export interface $keys extends $keywords<'hoge'> {}
// 6. Define the $types interface in the Attribute namespace.
// 7. Specify the new attribute in the key and define its corresponding value in the value.
export interface $types {
hoge: string;
}
}
}
console.log(
toDot(
digraph((g) => {
g.set(_.hoge, 'fuga');
}),
),
);
Migration from yarn v1 to pnpm has been done for package management.
To enhance the development experience, the build tool has been changed from rollup to vite, and the test suite from jest to vitest. This was done because jest lacked standard support for monorepo integration and TypeScript, requiring the installation of additional plugins. However, vite and vitest handle these challenges more elegantly, providing a smoother and more efficient development workflow.
The release flow has been updated to use the changeset tool to manage changes and releases.
This tool allows for a more streamlined and automated release process, making it easier to manage versioning and changelogs across multiple packages within the monorepo.
The linter and formatter have been updated to use biome, respectively.
This change was made to ensure consistent code style and formatting across the entire codebase, making it easier to maintain and contribute to the project.
@microsoft/api-extractor
specification used internally in the d.ts file rollup.#966 d579034
Thanks @dependabot! - build(deps-dev): bump vite-plugin-dts from 3.7.2 to 3.7.3
#970 54f4565
Thanks @dependabot! - build(deps-dev): bump @types/node from 20.11.20 to 20.11.24
Published by github-actions[bot] 8 months ago
#956 1e4f57a
Thanks @kamiazya! - # ts-graphviz v2
We are introducing a major version upgrade to ts-graphviz to ensure better performance, security, and compatibility with the latest improvements in the JavaScript ecosystem. With this upgrade, we will no longer support Node.js 14 & 16, which has reached its End-of-Life (EOL), and set the new minimum guaranteed version to Node.js 18.
This major version upgrade is necessary due to the following reasons:
Breaking Change: Dropping support for Node.js 14 & 16 is considered a breaking change, which requires a major version upgrade according to semantic versioning principles.
Improved Stability and Performance: By focusing on LTS versions, we can provide a library that benefits from the stability, long-term support, and performance improvements provided by newer Node.js versions.
Security: Ensuring that our library is compatible with the latest supported Node.js versions helps to minimize potential security vulnerabilities.
To help our users understand our approach to Node.js version support, we have established a clear Node.js Version Support Policy for ts-graphviz.
We encourage our users to update their projects to the latest LTS version of Node.js to ensure the best performance, security, and compatibility with ts-graphviz.
ts-graphviz is a TypeScript library designed to create, manipulate, and render Graphviz DOT language graphs.
It is built around several key concepts that make it modular, extensible, and easy to use:
TypeScript-First Design & Type Definitions: ts-graphviz is designed with TypeScript as its primary language, providing strong typing and ensuring seamless integration with TypeScript projects. This enables users to leverage the full power of TypeScript's type system and tooling while working with Graphviz graphs. The library includes comprehensive type definitions for DOT language elements, making it easier to work with Graphviz elements in a type-safe manner.
Object-Oriented API: ts-graphviz provides an object-oriented API for creating and manipulating graph elements like graphs, nodes, and edges. This enables users to work with complex graph structures intuitively and efficiently.
Modular Design[New in v2]: The library is split into multiple packages, each serving a specific purpose. This modular design allows users to pick and choose the functionality they need, resulting in improved maintainability and flexibility.
AST Support: ts-graphviz includes a module for processing DOT language at the Abstract Syntax Tree (AST) level. This feature allows users to parse and generate DOT language while preserving its structure, making it easier to manipulate and transform graphs programmatically.
Runtime Adapter: The library provides adapter functions that enable users to execute Graphviz commands across different runtime environments, such as Node.js and Deno. These adapter functions serve as a wrapper, allowing for seamless integration with various platforms.
Extensibility: ts-graphviz has been designed with extensibility in mind, allowing users to extend its functionality with custom implementations for specific use cases.
Multi-Paradigm Support: ts-graphviz is designed to accommodate various programming paradigms, such as Object-Oriented Programming, Declarative Programming, and Functional Programming. This ensures that users can choose the programming style that best suits their needs and preferences, making it adaptable and versatile across different use cases and development approaches.
By combining these key concepts, ts-graphviz aims to provide a powerful and user-friendly tool for working with Graphviz DOT language in TypeScript projects.
The purpose of package splitting and monorepo-ization in the ts-graphviz v2 is to achieve the following objectives:
Overall, package splitting and monorepo-ization aim to create a more robust, maintainable, and user-friendly library that better serves the needs of the ts-graphviz community.
In v2 of ts-graphviz, the library functionality will be split into several packages. The packages to be split are as follows:
To ensure that existing users are not affected, the ts-graphviz package will remain available. This change will result in a clear division of functionality and will improve the scalability and maintainability of the project. However, users of previous versions and users who wish to use the library without extending it will be able to continue to use the ts-graphviz package as is.
Please note that while we strive to maintain compatibility, there might be some minor differences or limitations in the compatibility package compared to the original ts-graphviz library. It is essential to review the documentation and update your code accordingly if needed, but only when you decide to migrate to the new package structure.
Package | Summary | Description |
---|---|---|
ts-graphviz | Graphviz library for TypeScript | The main package that serves as the entry point for users. It provides a high-level API for creating, manipulating, and rendering Graphviz DOT language graphs. |
@ts-graphviz/common | Graphviz Types and Utilities | Contains type information related to DOT language attributes, attribute values, and models. |
@ts-graphviz/ast | Graphviz AST(Abstract Syntax Tree) Utilities | Includes the module for processing DOT language at the AST (Abstract Syntax Tree) level. |
@ts-graphviz/core | Graphviz Models for Object-Oriented Programming | Comprises the implementation of models and functions provided to users. |
@ts-graphviz/adapter | Graphviz Runtime adapters for Cross Platform | Handles runtime-dependent processing, such as input/output processing and Renderer implementations for different environments. |
Starting with the upcoming release, ts-graphviz will no longer support Node.js 14 & 16, which has reached its End-of-Life (EOL). The new minimum guaranteed version will be Node.js 18. This decision allows us to focus on providing a secure and up-to-date library while minimizing the maintenance burden of supporting outdated versions.
To minimize disruption for our users, we have established a clear Node.js Version Support Policy for our library. This policy helps users understand our approach to Node.js version support and what to expect when using our library.
We encourage our users to update their projects to the latest LTS version of Node.js to ensure the best performance, security, and compatibility with ts-graphviz.
Our goal is to provide a stable and secure library for our users while keeping up with improvements in the JavaScript ecosystem. To achieve this, we have established the following Node.js version support policy for ts-graphviz:
Minimum Guaranteed Version: We guarantee support for the latest Node.js version that has entered Long-Term Support (LTS) at the time of a major release of our library. This ensures that our library benefits from the stability and long-term support provided by LTS versions.
End-of-Life (EOL) Policy: We will cease support for Node.js versions when they reach their EOL, as defined by the Node.js release schedule. This helps us focus on providing a secure and up-to-date library while minimizing the maintenance burden of supporting outdated versions.
Version Support Communication: We will communicate our Node.js version support policy in our library's documentation and release notes. When a new major version is released or when a Node.js version enters EOL, we will inform our users through release notes, blog posts, or other relevant channels.
Migration Guides : When introducing breaking changes due to Node.js version support updates, we will provide migration guides to help our users transition their projects to the new requirements smoothly.
To migrate to the new Node.js version support policy, follow these steps:
node -v
By following these steps, you can migrate your project to the latest LTS version of Node.js and ensure compatibility with ts-graphviz.
AttributeKeyDict
type to Attribute.keys
typeAttributeKeyDict
was deprecated in v1, so it was removed in v2.
Please modify to use Attribute.keys
.
- import { AttributeKeyDict } from 'ts-graphviz';
+ import { Attribute } from '@ts-graphviz/common';
- const foo: AttributeKeyDict = ...;
+ const foo: Attribute.keys = ...;
ts-graphviz/adapter
to @ts-graphviz/adapter
To migrate from the ts-graphviz/adapter
module to the @ts-graphviz/adapter
module, follow these steps:
Update Import Statements: Update import statements in your code to use the new module name.
- import { } from 'ts-graphviz/adapter';
+ import { } from '@ts-graphviz/adapter';
Update Package.json: Update the ts-graphviz
dependency in your package.json
file to use the new version of the @ts-graphviz/adapter
module.
- "ts-graphviz": "^1.0.0",
+ "ts-graphviz": "^2.0.0",
+ "@ts-graphviz/adapter": "^2.0.0",
Update Code References: Search your codebase for any references to the ts-graphviz/adapter
module and update them to use the new module name.
- import { } from 'ts-graphviz/adapter';
+ import { } from '@ts-graphviz/adapter';
ts-graphviz/ast
to @ts-graphviz/ast
To migrate from the ts-graphviz/adapter
module to the @ts-graphviz/adapter
module, follow these steps:
Update Import Statements: Update import statements in your code to use the new module name.
- import { } from 'ts-graphviz/ast';
+ import { } from '@ts-graphviz/ast';
Update Package.json: Update the ts-graphviz
dependency in your package.json
file to use the new version of the @ts-graphviz/ast
module.
- "ts-graphviz": "^1.0.0",
+ "ts-graphviz": "^2.0.0",
+ "@ts-graphviz/ast": "^2.0.0",
Update Code References: Search your codebase for any references to the ts-graphviz/ast
module and update them to use the new module name.
- import { } from 'ts-graphviz/ast';
+ import { } from '@ts-graphviz/ast';
Common types moves to @ts-graphviz/common
in v2.0.0.
If you have extended the type system, you need to update the import path.
-import { $keywords } from 'ts-graphviz';
+import { $keywords } from '@ts-graphviz/common';
-import { toFile } from 'ts-graphviz/adapter';
+import { toFile } from '@ts-graphviz/adapter';
-// 1. Declare the 'ts-graphviz/adapter' module.
-declare module 'ts-graphviz/adapter' {
+// 1. Declare the '@ts-graphviz/adapter' module.
+declare module '@ts-graphviz/adapter' {
export namespace Layout {
// 2. Define the $values interface in the Layout namespace.
// 3. Inherit from $keywords<'my-custom-algorithm'> and specify the name of the new layout engine in <...>.
export interface $values extends $keywords<'my-custom-algorithm'> {}
}
export namespace Format {
// 4. Define the $values interface in the Format namespace.
// 5. Inherit from $keywords<'mp4'> and specify the name of the new output format in <...>.
export interface $values extends $keywords<'mp4'> {}
}
}
toFile('digraph { a -> b }', '/path/to/file', {
layout: 'my-custom-algorithm',
format: 'mp4',
});
- import { digraph, toDot, attribute as _, $keywords } from 'ts-graphviz';
+ import { $keywords } from '@ts-graphviz'/common;
+ import { digraph, toDot, attribute as _ } from 'ts-graphviz';
-// 1. Declare the 'ts-graphviz' module.
-declare module 'ts-graphviz' {
+// 1. Declare the '@ts-graphviz/common' module.
+declare module '@ts-graphviz/common' {
export namespace GraphAttributeKey {
// 2. Define the $values interface in the GraphAttributeKey namespace.
// 3. Inherit from $keywords<'hoge'> and specify the name of the new attribute in <...>.
export interface $values extends $keywords<'hoge'> {}
}
export namespace Attribute {
// 4. Define the $keys interface in the Attribute namespace.
// 5. Inherit from $keywords<'hoge'> and specify the name of the new attribute in <...>.
export interface $keys extends $keywords<'hoge'> {}
// 6. Define the $types interface in the Attribute namespace.
// 7. Specify the new attribute in the key and define its corresponding value in the value.
export interface $types {
hoge: string;
}
}
}
console.log(
toDot(
digraph((g) => {
g.set(_.hoge, 'fuga');
}),
),
);
Migration from yarn v1 to pnpm has been done for package management.
To enhance the development experience, the build tool has been changed from rollup to vite, and the test suite from jest to vitest. This was done because jest lacked standard support for monorepo integration and TypeScript, requiring the installation of additional plugins. However, vite and vitest handle these challenges more elegantly, providing a smoother and more efficient development workflow.
The release flow has been updated to use the changeset tool to manage changes and releases.
This tool allows for a more streamlined and automated release process, making it easier to manage versioning and changelogs across multiple packages within the monorepo.
The linter and formatter have been updated to use biome, respectively.
This change was made to ensure consistent code style and formatting across the entire codebase, making it easier to maintain and contribute to the project.
@microsoft/api-extractor
specification used internally in the d.ts file rollup.#966 d579034
Thanks @dependabot! - build(deps-dev): bump vite-plugin-dts from 3.7.2 to 3.7.3
#970 54f4565
Thanks @dependabot! - build(deps-dev): bump @types/node from 20.11.20 to 20.11.24
Updated dependencies [d579034
, 54f4565
, 1e4f57a
]:
Published by github-actions[bot] 8 months ago
#956 1e4f57a
Thanks @kamiazya! - # ts-graphviz v2
We are introducing a major version upgrade to ts-graphviz to ensure better performance, security, and compatibility with the latest improvements in the JavaScript ecosystem. With this upgrade, we will no longer support Node.js 14 & 16, which has reached its End-of-Life (EOL), and set the new minimum guaranteed version to Node.js 18.
This major version upgrade is necessary due to the following reasons:
Breaking Change: Dropping support for Node.js 14 & 16 is considered a breaking change, which requires a major version upgrade according to semantic versioning principles.
Improved Stability and Performance: By focusing on LTS versions, we can provide a library that benefits from the stability, long-term support, and performance improvements provided by newer Node.js versions.
Security: Ensuring that our library is compatible with the latest supported Node.js versions helps to minimize potential security vulnerabilities.
To help our users understand our approach to Node.js version support, we have established a clear Node.js Version Support Policy for ts-graphviz.
We encourage our users to update their projects to the latest LTS version of Node.js to ensure the best performance, security, and compatibility with ts-graphviz.
ts-graphviz is a TypeScript library designed to create, manipulate, and render Graphviz DOT language graphs.
It is built around several key concepts that make it modular, extensible, and easy to use:
TypeScript-First Design & Type Definitions: ts-graphviz is designed with TypeScript as its primary language, providing strong typing and ensuring seamless integration with TypeScript projects. This enables users to leverage the full power of TypeScript's type system and tooling while working with Graphviz graphs. The library includes comprehensive type definitions for DOT language elements, making it easier to work with Graphviz elements in a type-safe manner.
Object-Oriented API: ts-graphviz provides an object-oriented API for creating and manipulating graph elements like graphs, nodes, and edges. This enables users to work with complex graph structures intuitively and efficiently.
Modular Design[New in v2]: The library is split into multiple packages, each serving a specific purpose. This modular design allows users to pick and choose the functionality they need, resulting in improved maintainability and flexibility.
AST Support: ts-graphviz includes a module for processing DOT language at the Abstract Syntax Tree (AST) level. This feature allows users to parse and generate DOT language while preserving its structure, making it easier to manipulate and transform graphs programmatically.
Runtime Adapter: The library provides adapter functions that enable users to execute Graphviz commands across different runtime environments, such as Node.js and Deno. These adapter functions serve as a wrapper, allowing for seamless integration with various platforms.
Extensibility: ts-graphviz has been designed with extensibility in mind, allowing users to extend its functionality with custom implementations for specific use cases.
Multi-Paradigm Support: ts-graphviz is designed to accommodate various programming paradigms, such as Object-Oriented Programming, Declarative Programming, and Functional Programming. This ensures that users can choose the programming style that best suits their needs and preferences, making it adaptable and versatile across different use cases and development approaches.
By combining these key concepts, ts-graphviz aims to provide a powerful and user-friendly tool for working with Graphviz DOT language in TypeScript projects.
The purpose of package splitting and monorepo-ization in the ts-graphviz v2 is to achieve the following objectives:
Overall, package splitting and monorepo-ization aim to create a more robust, maintainable, and user-friendly library that better serves the needs of the ts-graphviz community.
In v2 of ts-graphviz, the library functionality will be split into several packages. The packages to be split are as follows:
To ensure that existing users are not affected, the ts-graphviz package will remain available. This change will result in a clear division of functionality and will improve the scalability and maintainability of the project. However, users of previous versions and users who wish to use the library without extending it will be able to continue to use the ts-graphviz package as is.
Please note that while we strive to maintain compatibility, there might be some minor differences or limitations in the compatibility package compared to the original ts-graphviz library. It is essential to review the documentation and update your code accordingly if needed, but only when you decide to migrate to the new package structure.
Package | Summary | Description |
---|---|---|
ts-graphviz | Graphviz library for TypeScript | The main package that serves as the entry point for users. It provides a high-level API for creating, manipulating, and rendering Graphviz DOT language graphs. |
@ts-graphviz/common | Graphviz Types and Utilities | Contains type information related to DOT language attributes, attribute values, and models. |
@ts-graphviz/ast | Graphviz AST(Abstract Syntax Tree) Utilities | Includes the module for processing DOT language at the AST (Abstract Syntax Tree) level. |
@ts-graphviz/core | Graphviz Models for Object-Oriented Programming | Comprises the implementation of models and functions provided to users. |
@ts-graphviz/adapter | Graphviz Runtime adapters for Cross Platform | Handles runtime-dependent processing, such as input/output processing and Renderer implementations for different environments. |
Starting with the upcoming release, ts-graphviz will no longer support Node.js 14 & 16, which has reached its End-of-Life (EOL). The new minimum guaranteed version will be Node.js 18. This decision allows us to focus on providing a secure and up-to-date library while minimizing the maintenance burden of supporting outdated versions.
To minimize disruption for our users, we have established a clear Node.js Version Support Policy for our library. This policy helps users understand our approach to Node.js version support and what to expect when using our library.
We encourage our users to update their projects to the latest LTS version of Node.js to ensure the best performance, security, and compatibility with ts-graphviz.
Our goal is to provide a stable and secure library for our users while keeping up with improvements in the JavaScript ecosystem. To achieve this, we have established the following Node.js version support policy for ts-graphviz:
Minimum Guaranteed Version: We guarantee support for the latest Node.js version that has entered Long-Term Support (LTS) at the time of a major release of our library. This ensures that our library benefits from the stability and long-term support provided by LTS versions.
End-of-Life (EOL) Policy: We will cease support for Node.js versions when they reach their EOL, as defined by the Node.js release schedule. This helps us focus on providing a secure and up-to-date library while minimizing the maintenance burden of supporting outdated versions.
Version Support Communication: We will communicate our Node.js version support policy in our library's documentation and release notes. When a new major version is released or when a Node.js version enters EOL, we will inform our users through release notes, blog posts, or other relevant channels.
Migration Guides : When introducing breaking changes due to Node.js version support updates, we will provide migration guides to help our users transition their projects to the new requirements smoothly.
To migrate to the new Node.js version support policy, follow these steps:
node -v
By following these steps, you can migrate your project to the latest LTS version of Node.js and ensure compatibility with ts-graphviz.
AttributeKeyDict
type to Attribute.keys
typeAttributeKeyDict
was deprecated in v1, so it was removed in v2.
Please modify to use Attribute.keys
.
- import { AttributeKeyDict } from 'ts-graphviz';
+ import { Attribute } from '@ts-graphviz/common';
- const foo: AttributeKeyDict = ...;
+ const foo: Attribute.keys = ...;
ts-graphviz/adapter
to @ts-graphviz/adapter
To migrate from the ts-graphviz/adapter
module to the @ts-graphviz/adapter
module, follow these steps:
Update Import Statements: Update import statements in your code to use the new module name.
- import { } from 'ts-graphviz/adapter';
+ import { } from '@ts-graphviz/adapter';
Update Package.json: Update the ts-graphviz
dependency in your package.json
file to use the new version of the @ts-graphviz/adapter
module.
- "ts-graphviz": "^1.0.0",
+ "ts-graphviz": "^2.0.0",
+ "@ts-graphviz/adapter": "^2.0.0",
Update Code References: Search your codebase for any references to the ts-graphviz/adapter
module and update them to use the new module name.
- import { } from 'ts-graphviz/adapter';
+ import { } from '@ts-graphviz/adapter';
ts-graphviz/ast
to @ts-graphviz/ast
To migrate from the ts-graphviz/adapter
module to the @ts-graphviz/adapter
module, follow these steps:
Update Import Statements: Update import statements in your code to use the new module name.
- import { } from 'ts-graphviz/ast';
+ import { } from '@ts-graphviz/ast';
Update Package.json: Update the ts-graphviz
dependency in your package.json
file to use the new version of the @ts-graphviz/ast
module.
- "ts-graphviz": "^1.0.0",
+ "ts-graphviz": "^2.0.0",
+ "@ts-graphviz/ast": "^2.0.0",
Update Code References: Search your codebase for any references to the ts-graphviz/ast
module and update them to use the new module name.
- import { } from 'ts-graphviz/ast';
+ import { } from '@ts-graphviz/ast';
Common types moves to @ts-graphviz/common
in v2.0.0.
If you have extended the type system, you need to update the import path.
-import { $keywords } from 'ts-graphviz';
+import { $keywords } from '@ts-graphviz/common';
-import { toFile } from 'ts-graphviz/adapter';
+import { toFile } from '@ts-graphviz/adapter';
-// 1. Declare the 'ts-graphviz/adapter' module.
-declare module 'ts-graphviz/adapter' {
+// 1. Declare the '@ts-graphviz/adapter' module.
+declare module '@ts-graphviz/adapter' {
export namespace Layout {
// 2. Define the $values interface in the Layout namespace.
// 3. Inherit from $keywords<'my-custom-algorithm'> and specify the name of the new layout engine in <...>.
export interface $values extends $keywords<'my-custom-algorithm'> {}
}
export namespace Format {
// 4. Define the $values interface in the Format namespace.
// 5. Inherit from $keywords<'mp4'> and specify the name of the new output format in <...>.
export interface $values extends $keywords<'mp4'> {}
}
}
toFile('digraph { a -> b }', '/path/to/file', {
layout: 'my-custom-algorithm',
format: 'mp4',
});
- import { digraph, toDot, attribute as _, $keywords } from 'ts-graphviz';
+ import { $keywords } from '@ts-graphviz'/common;
+ import { digraph, toDot, attribute as _ } from 'ts-graphviz';
-// 1. Declare the 'ts-graphviz' module.
-declare module 'ts-graphviz' {
+// 1. Declare the '@ts-graphviz/common' module.
+declare module '@ts-graphviz/common' {
export namespace GraphAttributeKey {
// 2. Define the $values interface in the GraphAttributeKey namespace.
// 3. Inherit from $keywords<'hoge'> and specify the name of the new attribute in <...>.
export interface $values extends $keywords<'hoge'> {}
}
export namespace Attribute {
// 4. Define the $keys interface in the Attribute namespace.
// 5. Inherit from $keywords<'hoge'> and specify the name of the new attribute in <...>.
export interface $keys extends $keywords<'hoge'> {}
// 6. Define the $types interface in the Attribute namespace.
// 7. Specify the new attribute in the key and define its corresponding value in the value.
export interface $types {
hoge: string;
}
}
}
console.log(
toDot(
digraph((g) => {
g.set(_.hoge, 'fuga');
}),
),
);
Migration from yarn v1 to pnpm has been done for package management.
To enhance the development experience, the build tool has been changed from rollup to vite, and the test suite from jest to vitest. This was done because jest lacked standard support for monorepo integration and TypeScript, requiring the installation of additional plugins. However, vite and vitest handle these challenges more elegantly, providing a smoother and more efficient development workflow.
The release flow has been updated to use the changeset tool to manage changes and releases.
This tool allows for a more streamlined and automated release process, making it easier to manage versioning and changelogs across multiple packages within the monorepo.
The linter and formatter have been updated to use biome, respectively.
This change was made to ensure consistent code style and formatting across the entire codebase, making it easier to maintain and contribute to the project.
@microsoft/api-extractor
specification used internally in the d.ts file rollup.#966 d579034
Thanks @dependabot! - build(deps-dev): bump vite-plugin-dts from 3.7.2 to 3.7.3
#970 54f4565
Thanks @dependabot! - build(deps-dev): bump @types/node from 20.11.20 to 20.11.24
Updated dependencies [d579034
, 54f4565
, 1e4f57a
]:
Published by github-actions[bot] 8 months ago
Full Changelog: https://github.com/ts-graphviz/ts-graphviz/compare/v1.8.1...v1.8.2
Available as part of the Tidelift Subscription.
The maintainers of ts-graphviz and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open-source dependencies you use to build your applications.
Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.
Published by github-actions[bot] over 1 year ago
Special thanks for @cloud-on-prem 🎉
Published by github-actions[bot] over 1 year ago