Commit Graph

24 Commits (development)

Author SHA1 Message Date
Thomas Bouffard b6c2c3b56b chore(release): prepare version 0.7.0 2024-01-20 17:19:53 +01:00
Thomas Bouffard 5ddc8f5af2
feat: declare exports in package.json (#306)
It lets use `moduleResolution=bundler` in TypeScript applications.
In particular, it lets use it with Storybook and ts-example in this
repository.
2024-01-18 07:44:23 +01:00
Thomas Bouffard 7544da2da3 chore(release): prepare version 0.6.0
Also improve the release procedure.
2023-12-22 08:26:38 +01:00
Thomas Bouffard 8d6f0e107c
test: execute tests serially to speed up test execution (#284)
By default, `jest` runs tests in parallel. However, with the current
configuration of `ts-jest`, all workers run `tsc` in parallel, which is
very slow and consumes a lot of resources. This is what takes the
longest.
By running `jest` serially, `tsc` runs before starting the first test,
then all subsequent tests run faster. This will probably be improved by
customizing the configuration of `jest` or with future versions of
`ts-jest`.
2023-12-10 10:22:07 +01:00
Thomas Bouffard 9463e1e21e chore(release): prepare version 0.5.0
Also improve the documentation of the release procedure.
2023-12-07 16:57:36 +01:00
Thomas Bouffard 17f31fcc5c
chore: clean before pack (#270)
This simplifies the release procedure. No manual cleaning is required,
this reduces the risk of errors.
2023-12-03 21:50:14 +01:00
Thomas Bouffard ac48ea0d86
chore!: only include ESM in the npm package (#266)
Get rid of the UMD bundle: not pratical, not minimified so not ready for
production, nor for reuse.
This lets remove the webpack build which was not used anymore.

- core build: everything is done with tsc and simplify pack
- remove webpack configuration
- Move typedoc in the package where it is used (make it easier to detect
usage)
- remove unused dependencies: 
  - better-docs (use typedoc instead)
  - webpack loaders (css, file, style, url)
  - babel
  - circular-dependency-plugin (webpack plugin)
  - webpack
  - cross-env
- core build: tsc only

BREAKING CHANGE: the UMD bundle is no more provided in the npm package
2023-12-03 16:51:40 +01:00
Thomas Bouffard b008f46be5 chore(release): prepare version 0.4.1 2023-10-30 07:36:17 +01:00
Thomas Bouffard fe7f1a8123
chore: migrate to storybook v7 (#230)
- Migrate the existing stories to work with storybook v7.
- Use the `vite` builder. The startup time decrease from 40 seconds
(best time with v6) to 1 second (worst time with v7)
- Webpack is no more used, `vite` now manages everything
- Add support for writing stories in TypeScript. It also detect existing
import errors in the existing stories written in JS
- Migrate the Toolbar story to TypeScript to demonstrate it works. As
part of the migration, fix how CellStyle is set in the story (easily
detected thanks to types checking)
- Detect wrong imports in stories and fix them
- The storybook mini-site can be built (previously the build always
failed and storybook could only be used in development mode)
- Add support for Node 18

Other changes
- core: simplify the "dev" script:
- There is no need to invoke webpack as the UMD bundle is no longer used
by stories.
- Instead, call `tsc` watch which is faster, so code changes are visible
faster in stories
- "Build" GitHub workflow:
- Build storybook mini-site and attach all examples as artifact to help
reviewing Pull Requests
- Lint at the end, this is more important to check the build and
examples first
2023-10-12 23:41:37 +02:00
Thomas Bouffard 3758ac4dce
chore: review private property in package.json files (#244)
Remove versioning for private packages are they are not supposed to be
consumed outside the project.
Explicitly mark public packages.
2023-09-15 12:31:22 +02:00
Thomas Bouffard e175937f02 chore(release): prepare version 0.4.0 2023-09-14 15:10:05 +02:00
Thomas Bouffard 92759df232
feat: include default css and images in the npm package (#225)
Providing these resources simplify the `maxGraph` integration.

Use the default CSS in ts-example to illustrate how to override defaults
Initiate a documentation to start guiding users.
2023-07-13 12:25:10 +02:00
Thomas Bouffard c422ca35ee chore(release): prepare version 0.3.0 2023-07-07 12:19:14 +02:00
Thomas Bouffard 4a79be5499
docs: add keywords in package.json (#216)
For the `@maxgraph/core` package.
2023-07-07 07:39:30 +02:00
Thomas Bouffard 452698660b chore(release): prepare version 0.2.1 2023-06-08 17:03:33 +02:00
Thomas Bouffard 487e4b767e chore(release): prepare version 0.2.0 2023-05-22 16:17:25 +02:00
Thomas Bouffard 0b4df83923
chore: fix TS2365 build errors (#186)
In the core package, TypeScript v5 is resolved instead of TypeScript v4.
As a workaround, declares TypeScript v4 in `package.json`.
2023-04-04 09:17:39 +02:00
Thomas Bouffard ed2ae41428
refactor(docs): move all docs sources to a dedicated docs package (#168)
Keep the former mxGraph documentation to allow a later documentation
migration.
Remove both the former mxGraph and the new maxGraph API docs as they can
be generated.
Remove the former mxGraph examples home page as it has been replaced by
Storybook.

Update the configuration to generate the maxGraph API docs
  - remove jsdoc resources as it is not used anymore
- configure the core package to generate the API docs in the docs
package
- add a GitHub workflow to ensure we can generate the API docs without
errors
2023-01-09 16:03:52 +01:00
Thomas Bouffard b7a322b36f
fix: CellOverlay constructor use all parameters to set properties (#159)
The `align` and `verticalAlign` values passed to the constructor weren't
set, so the overlay position was always set to
the default one.

The `align` and `verticalAlign` properties are now using the AlignValue
and VAlignValue types respectively instead of
defining inline types. This improves the consistent in the whole code.

To demonstrate the fix, the Overlays story now set 'align' and
'verticalAlign' randomly.


Also introduce `jest` to test the fix and the whole
implementation of the changed method. Types check support is provided by
`ts-jest`. As maxGraph uses a lot of browser objects, also setup
`jest-jsdom-environment`.
2022-12-16 16:51:51 +01:00
Thomas Bouffard 893ad44ff2
chore: improve the configuration to build the npm package (#87)
Root and all package.json files
  - Fix license, version and authors
  - Remove the non-relevant .npmignore file at the project. It was designed for mxgraph, the whole directory structure
  changed, and we don't plan to publish the root package

`core` package
  - Generate type definition and javascript files for ESM output
    - dedicated folder for `esm` and `types` in the `dist` folder to clearly separate concerns
    - exported in the package.json
  - Add npm script for `npm pack` configuration
  - Drop the `postinstall` npm script that built the `core` bundle. It would have been run when the package is installed
  in dependent projects at dependencies install. And it would have failed as it tries to build the project from TypeScript
  sources that are not available in the npm package.

fix: ConstraintHandler now loads image as everywhere else in the code using `Client.imageBasePath`
Using import doesn't work as the image is not available in the npm package. It generated error like this in ViteJS
project:
Failed to resolve import "../../../images/point.gif" from "../core/dist/esm/view/handler/ConstraintHandler.js". Does the file exist?
This gif import had been introduced to make `Anchors.stories.js` retrieve the gif file. Configuring `imageBasePath` as
already done in other stories fixes the issue.

Don't export EditorCodec and StylesheetCodec as they generate errors.
This is a temporary solution to avoid error in dependent project (at least, with ViteJS projects).
2022-07-05 08:08:25 +02:00
Thomas Bouffard 443ebf7a52
chore: GitHub workflow generates TypeScript declarations (#80)
This ensures we don't have type errors in the code.

Update tsconfig to only include source TS files.
Previous configuration prevented to run the type generation twice.
The generated d.ts files were considered as source files, so we got file override errors.

Add a dedicated npm script to generate scripts.
We cannot directly call the tsc or lerna commands on the macOS GH actions runner, so introduce the script.
2022-04-03 13:09:24 +02:00
Dave Morrissey 413796ad32
Finish converting core to ts, JSDoc conversion, consistency+convention changes, example bugfixes (#70)
* reorganised directories; removed mx prefix

* reduced directory hierarchies; removed mx prefix; type fixes

* convert remaining javascript to ts

* fix/add types

* add type defs

* type updates; moved codecs to where they're used

* reorganise constants into enums+type additions

* removed "Function:" and "Variable:" prefixes from comments, as they aren't needed in JSDoc

* removed "Function:", "Variable:" and "Class:" prefixes from comments, as they aren't needed in JSDoc

* removed "Function:" prefixes from comments, as they aren't needed in JSDoc

* minor changes

* convert code example blocks to markdown

* module casing updates

* converted parameter function documentation to JSDoc

* documentation+type updates

* removed react subdir (for now)

* reorganised various `utils` functions into different files

* type updates/bugfixes/workarounds

* rename Rubberband and CellEditor to be *Handler to match the other plugins

* move codec classes to where they're used to reduce cyclic dependencies

* move codec classes to where they're used to reduce cyclic dependencies

* type updates/reorganize layout file structure

* renamed various files for consistency

* import fixes

* renamed GraphHandler SelectionHander and various fixes

* convert EventObject parameters to objects

* add basic better-docs config

* update better-docs config

* bugfix for shared variables in Graph persisting across instances

* fixed accessing handlers in examples; renamed Model to GraphModel

* fixed accessing handlers in examples; renamed Model to GraphModel

* restored selection model

* bugfix

* renamed getModel to getDataModel

* changed to use graph.batchUpdate() to reduce lines of code

* changed to use graph.batchUpdate() to reduce lines of code

* finished annotations+added TypeDoc

* convert remaining Cell[] instances to CellArray

* convert NaturalDocs links to JSDoc
2022-01-08 12:49:35 +11:00
Junsik Shim bdc50a9f48 Refactored everything... 2021-09-07 18:07:27 +09:00
Junsik Shim 1b0f3d6b9e - Restructure into a monorepo.
- Add Storybook to packages.
- Remove circular dependencies.
2021-04-15 13:12:12 +09:00