bpmnServer / bpmn-server

BPMN 2.0 server for Node.js , providing modeling, execution, persistence and monitoring for Workflow. along with sample UI. Intended to be developers workbench for BPMN 2.0
MIT License
186 stars 48 forks source link

Remove .js and .js.map file #149

Closed linonetwo closed 11 months ago

linonetwo commented 11 months ago

I'm confused by the style of this repo, can you remove those generated file? They belong to /dist , and should be git ignored, so I don't have to commit and clone them.

Also, Can you publish the docs to a github page? If the doc is generated from source, maybe this should be done in github action, and not commit to the master branch.

kstan79 commented 11 months ago

Im agree it, I'm notice there is outDir='./dist' in tsconfig however the build file (.js) remain side by side with .ts.

The source code need tidy at many places like separate build into dist, and remove too much console log, in fact documentation need more proper organize too. I think the founder aware all this and he just need more time.

ralphhanna commented 11 months ago

Already fixed in new release for bpmn-server tsconfig.json:

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "lib": [ "es6" ],
    "sourceMap": true,
    "declaration": true,
    "rootDir": "./src",
    "outDir": "./dist"
  },

I am not sure we can this with the webApp folder since its an express app, but still investigating...

Can you please in more details what do you mean by:

Also, Can you publish the docs to a github page? If the doc is generated from source, maybe this should be done in github action, and not commit to the master branch.

ralphhanna commented 11 months ago

I am not convinced that is an improvement in the case of a Web App bpmn-web using express.

Any thoughts?

kstan79 commented 11 months ago

I think this is 2 topics

  1. Keep src in source and build into dist I believe is ok cause most of the project I involve using framework like nestjs and nuxtjs doing that. I feel convenient

  2. Store web app sample project in bpmn-server library: I feel this is the one create the problem. When I first try this project I'm confused will the folder structure and sample source code import './'

You above comment seems also come from issue put web app into repo (correct me if I'm wrong)

My suggestion is:

  1. Remove webapp folder and keep library as pure npm library (since you prefer to keep this project independent from framework)
  2. Prepare Sample project externally, with example method like: a. Separate git repo (1 pure express, 1 nestjs, 1 loopback and etc) b. Use cli tools generate project, using tools like template engine .eta
linonetwo commented 11 months ago

The usage of pug files , and start it by running index.ts , are legacy usage. In modern web dev, we are using tsx file, and start-up is taken care of by nestjs/nuxtjs/modern.dev/create-react-app.

But we don't have so much time to refactor them, so have to keep this usage. But trust me (or GPT4), not mixing dist and src is a right choice to improve DX, otherwise potential contributors will be scared.

linonetwo commented 11 months ago

Another advantage is it will make this 100% ts, so people know this is a modern project. 截屏2023-12-21 12 33 19

ralphhanna commented 11 months ago

Here is what I am thinking:

  1. Ship (git repo) only ts files , no compiler output
  2. Keep current structure all files under /src
  3. Use ts-node for setup/cli/app etc.
  4. But when develop use we use /src for output as well:

    "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "lib": [ "es6" ],
    "sourceMap": true,
    "declaration": false,
    "incremental": true,
    "allowJs": false,
    "rootDir": "./src",
    //  "outDir": "./dist"
    },
    "include": [
    "./src"
    
    ],
    "exclude": [
    "node_modules" , "./dist" , "./webApp"
    ]
    }

    So, no copying of files and allow user to change pug files without recompile

To test this I have created a branch no-dist under bpmn-web.

Thanks

linonetwo commented 11 months ago

Oh, I understand you feel slow when have to copy file during dev. Can we just use ts-node for dev, so no need to compile and copy?

linonetwo commented 11 months ago

Also, do you mean this repo or bpmn-web repo? If is bpmn-web, we can discuss there.

ralphhanna commented 11 months ago

Yes, was talking about bpmn-web. for bpmn-server, already done closing this one.