Commit Graph

58 Commits (b6c2c3b56b3568c9c2bfe7c595877e576a56ec06)

Author SHA1 Message Date
Thomas Bouffard d9b85945f8
chore: use npm workspaces (#273)
`maxGraph` was using `lerna` v4 to build and only used its "build
workspaces" support, not the "publishing" support as we only published a
single package and it is done manually, without using `lerna`.
The support for packages in `lerna` was removed in version 7. See
https://github.com/lerna/lerna/releases/tag/7.0.0 and
https://lerna.js.org/docs/legacy-package-management.
So, start using npm workspaces as we don't need to manage the publishing
of several packages for now.

This will allow to do more reproducible builds by locking dependencies
with a `package-lock.json` file. This didn't work well with `lerna` v4
and had been disabled.
2023-12-04 03:25:41 +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 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 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 6fe7f7fde0
chore: force usage of a recent @types/node version (#143)
Use a recent version of `@types/node` that works with TypeScript 4.9,
older versions have types issues.
2022-11-22 07:03:48 +01:00
Thomas Bouffard aeea27dcc8
chore(deps): bump typescript from 4.8.3 to 4.9.3 (#139)
Also bump typedoc 0.23.15 to 0.23.21 to get TS 4.9 support.
2022-11-20 17:23:46 +01:00
Anatoliy Mayorov 41c5e468ed chore: add missing eslint deps 2022-10-29 22:49:23 +03:00
Анатолий Майоров 3527a77eb6
chore: configure eslint (#123)
Added `eslint` to project and configured it. The fixes will be applied later.
```
Found 1855 problems (709 errors, 1146 warnings) 🙈 
628 errors and 291 warnings potentially fixable with the `--fix` option.
```
2022-10-23 09:41:41 +02:00
Anatoliy Mayorov b62eb538f7 deps: bump typescript to 4.8.3, fix Dictionary typings
When running `generate-types` script in core package
there is typescript error TS2345 in src/util/Dictionary.ts,
added changes to fix it.

- Moved types IdentityObject and IdentityFunction to types.ts
- Renamed const FIELD_NAME to IDENTITY_FIELD_NAME and
moved it to util/Constants.ts
- Set Cell and CellOverlay to implement IdentityObject
2022-09-24 14:20:53 +03: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
Thomas Bouffard 14f5815149 chore(storybook): fix server start and warnings
Remove the extra NODE_OPTIONS in storybook server start script that generated an
error.
Remove cross-env devDependency which is then not used anymore.
Fix storybook deprecation warning (static dirs)
2022-01-19 21:13:05 +01:00
Thomas Bouffard fb7819f92a
chore: fix build error and introduce a build github workflow (#71)
Fix imports that are not respecting the case of the filenames.

The build often has errors and they are only detected after a developer pull the `development` branch on their local machine.
To early catch build failures, add a GitHub workflow that runs a build command.
2022-01-14 06:17:38 +01: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
Dave Morrissey bd70a74074 workarounds for node 17 2021-11-27 17:51:03 +11:00
Dave Morrissey c9753a2691 update packages and remove circular dependancies 2021-11-27 17:17:08 +11:00
Junsik Shim bdc50a9f48 Refactored everything... 2021-09-07 18:07:27 +09:00
Junsik Shim 1d05e161c9 - Add css support in storybook.
- Add icons to mxgraph.
- Convert some examples to storybook.
2021-04-24 21:30:30 +09:00
Junsik Shim 1b0f3d6b9e - Restructure into a monorepo.
- Add Storybook to packages.
- Remove circular dependencies.
2021-04-15 13:12:12 +09:00
Jon Gadsden a0a7dbbb83
Update links to point to jsGraph 2021-02-09 14:04:40 +00:00
davidjgraph 81dcd5cc86 4.2.2 release 2020-10-28 16:11:03 +00:00
David Benson [draw.io] 273779f744 4.2.1 release 2020-10-28 14:58:34 +00:00
alderg aa11697fbd 4.2.0 release 2020-06-19 12:31:34 +00:00
alderg 25a2da3d75 4.1.1 release 2020-03-31 14:07:32 +00:00
alderg c73f7a00cb 4.1.0 release 2020-01-24 13:32:03 +00:00
davidjgraph 51382db430 4.0.6 release 2019-11-08 14:59:37 +00:00
Gaudenz Alder 44fb5af106 4.0.5 release 2019-10-17 08:36:14 +00:00
David Benson 91c87f32d9 4.0.4 release 2019-08-20 16:53:06 +00:00
David Benson 12621211ee 4.0.3 release 2019-07-26 16:09:51 +00:00
Gaudenz Alder 47c035808a 4.0.2 release 2019-07-15 10:46:53 +00:00
Gaudenz Alder 7bb0ef2877 4.0.1 release 2019-07-02 06:45:58 +00:00
Gaudenz Alder 33911ed7e0 4.0.0 release 2019-03-11 12:35:15 +00:00
Gaudenz Alder 62bca567b0 3.9.12 release 2018-12-14 11:54:12 +00:00
David Benson 55d6851cb4 3.9.11 release 2018-11-06 11:46:01 +00:00
Gaudenz Alder 4f680fe27e 3.9.10 release 2018-10-08 12:01:08 +00:00
Gaudenz Alder d5c1345ec9 3.9.9 release 2018-09-21 08:36:59 +00:00
David Benson bc595336f9 3.9.8 release 2018-07-06 13:52:46 +00:00
David Benson 7af5a44c5b
Merge pull request #195 from mehyaa/patch-1
Removed unnecessary dependency
2018-06-22 16:06:15 +01:00
David Benson f4ec51f704 3.9.7 release 2018-06-22 14:18:02 +00:00
Gaudenz Alder e7f3573c91 3.9.6 release 2018-05-31 06:15:25 +00:00
Gaudenz Alder 641f6cca66 3.9.5 release 2018-05-24 09:27:17 +00:00
Gaudenz Alder e6a6ed657d 3.9.4 release 2018-05-17 07:19:42 +00:00
mehyaa 4c19075ffe
Update package.json
No need to "load-grunt-parent-tasks", the grunt task will run on publishes only.
2018-05-14 10:38:44 +03:00
David Benson 02112de29a 3.9.3 release 2018-03-05 17:18:28 +00:00
Gaudenz Alder 5862280aa4 3.9.2 release 2018-02-28 22:01:56 +00:00
Gaudenz Alder dd54a4dc85 3.9.1 release 2018-01-27 00:40:48 +00:00
mehyaa 33707aa7df
Fix npm package install error
Prepare dist folder before publishing the package to npm registry and publish it.
2018-01-25 16:51:42 +03:00
Gaudenz Alder ec3d5af0ee 3.9.0 release 2018-01-19 15:30:59 +00:00
David Benson 3a05b1a3b6
Update package.json
Corrected postinstall
2017-12-14 13:54:29 +00:00