Commit Graph

14 Commits (development)

Author SHA1 Message Date
Thomas Bouffard f2c2b4cbab
chore(deps-dev): bump vite from 4.5.2 to 5.0.12 (#314)
The vite built complained about an invalid "paths" settings in the root
tsconfig.json file.
It wasn't nested inside a "compilerOptions", so it was useless and this
configuration has been removed.
2024-01-23 10:07:03 +01:00
dependabot[bot] ffc45f1f40
chore(deps-dev): bump vite from 4.4.11 to 4.5.2 (#312) 2024-01-20 17:34:53 +01:00
dependabot[bot] 76f3f2e389
chore(deps-dev): bump vite from 4.4.11 to 4.4.12 (#281) 2023-12-06 03:47:56 +00:00
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 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 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 a2a718b40f
feat(examples): activate the storybook source addon (#75)
This replicates what mxgraph examples previously provided: the source code directly accessible within the example.
It allows copy/paste for reuse in user applications and should improve the adoption.
The code used to manage the controls is easily identifiable and can help highlight certain parts of the example (ContextMenu, RubberBand, ...).

Also bump storybook from 6.4.0 to 6.4.13.
2022-01-25 07:19:17 +01: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
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