Our state of the art Gantt chart


Post by nickmurr »

I have a requirement to have all assets (required for build) in one folder in the root.
But structure, presented in example doesn't fit for my project.
The reason is, that the application is deployed in a docker container, and the current structure of gantt examples will create some issues because of folder structure.

Is there a way instead this:

{
  "scripts": {
    "builder": "node ../../../_shared/scripts/build.js",
  },
  "dependencies": {
     "bryntum-gantt": "file:../../../../build",
     "bryntum-react-shared": "file:../../_shared/build",
     "bryntum-resources": "file:../../../_shared"
  },
  "devDependencies": {
    "babel-preset-react-app": "file:../../_scripts/babel-preset-react-app-patch"
  }
}

Maybe you have an example of similar structure of project
Thank you!

Make gantt work like this:

{
  "scripts": {
    "builder": "node ./assets/_shared/scripts/build.js",
  },
  "dependencies": {
     "bryntum-gantt": "file:./assets/build",
     "bryntum-react-shared": "file:./assets/_shared/build",
     "bryntum-resources": "file:./assets/_shared"
  },
  "devDependencies": {
    "babel-preset-react-app": "file./assets/_scripts/babel-preset-react-app-patch"
  }
}

Post by saki »

I have tried to put all build files in basic example directory and it worked. I have created bryntum subdirectory to keep the thing separate and I've put all dependencies there. The resulting folder structure is:

Screen Shot 2021-02-26 at 19.02.11.png
Screen Shot 2021-02-26 at 19.02.11.png (84.13 KiB) Viewed 476 times

I'm attaching zip with the modified basic react demo. To make it working:

  1. download and unzip
  2. copy content of build directory to basic/bryntum/build
  3. run npm i && npm run build in basic/bryntum/wrapper
  4. run npm i && npm run build in root of the example basic

You probably only need build and wrapper subdirectories; resources are only needed for the example header.

package.json is modified too to reflect the new paths. It's attached.

I hope it'll work for you; let us know please.

Attachments
package.json
(1.56 KiB) Downloaded 72 times
basic.zip
(5.39 MiB) Downloaded 70 times

Post by nickmurr »

Thanks a lot @saki!
It works.

Also I modified package.json file - changed postinstall script and added preinstall:

 "scripts": {
    "guide": "npm run builder guide gantt react",
    "start": "cross-env NODE_OPTIONS='--max-old-space-size=8192' react-scripts start",
    "build": "cross-env NODE_OPTIONS='--max-old-space-size=8192' react-scripts build || npm run guide",
    "test": "cross-env NODE_OPTIONS='--max-old-space-size=8192' react-scripts test",
    "eject": "cross-env NODE_OPTIONS='--max-old-space-size=8192' react-scripts eject",
    "preinstall": "cd bryntum/wrapper && npm i && npm run build",
    "postinstall": "cd bryntum/wrapper && npm install"
  }
``` 

It means that starting working with current structure and especially creating docker container much more easier

1. download and unzip
2. copy content of build directory to basic/bryntum/build
3. run npm i
Attachments
gantt.zip
simplified
(5.47 MiB) Downloaded 66 times

Post Reply