mliebelt / pgn-parser

Javascript library to allow reading of a PGN (Portable Game Notation) chess game notation, and providing the result as JSON.
Apache License 2.0
66 stars 21 forks source link

Define better file structure for project #78

Open mliebelt opened 3 years ago

mliebelt commented 3 years ago

The project files have grown lately, and we have to rethink how things should be organized:

The current status is not ok, there are too many files in a distribution.

MichaelLeeHobbs commented 3 years ago

Maybe next week I can provide some input on this as we are finalizing our node/browser package. I know there are tools to do what you want but your package is much smaller than most. Maybe just restructure for now and thing about splitting latter.

mliebelt commented 3 years ago

That may all be ... From time to time you have to cleanup, and I think now is the time to do it. There is no pressure, because (in my opinion) the parser is more or less feature complete, so it is ok to restructure it a little bit. I think having only one file at the end is not flexible enough, but 3 (parse, split, clean) may be appropriate.

And if you have some experience in doing this, well! I would else use the experience of my PgnViewerJS, but of course much smaller.

MichaelLeeHobbs commented 3 years ago

I was planning to take a look at PgnViewerJS this weekend. For something like that I would typically containerize it. Then you'd literally have a single command to run, something like docker run -dp 80:80 mliebelt/pgn-viewer. This leads to things like running it on a Synology NAS https://www.synology.com/en-us/dsm/packages/Docker with ease. But yes, I can help. I'm really DevOps which is just a fancy word to say I know way to much about a lot of things but not enough about most of them. Jack of many, master of none.

mliebelt commented 3 years ago

By switching to Typescript and following some of the normal rules there, the file and directory structure is mostly done:

pgn-parser
  bin - for build and other scripts
  doc - for documentation
  lib - contains at the end the files generated, that are then used in the library. 
         Currently the only files included in the package published then (besides README.md and LICENSE)
  node_modules
  src - the Typescript source files, and generated `pgn_parser.js`.
  test - the Typescript test files
  CHANGELOG.md, LICENSE, package.json, package-lock.json, README.md, tsconfig.json are all regular 
        and ok. The 2 example files are (at most) part of the documentation.

The README.md has to shortened again, grown too much lately. Sections to shorten: