Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] add build, separate lib and website #57

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

easingthemes
Copy link

Hi,
Thanks for this great project.
I'm trying to build a piano learning app for my kid, and this project works great for that purpose.
I plan to add some functionality, but before that I think that basic structure should be changed to allow easier collaboration:

  1. Separate Website from Library
  2. Ideally Library should have it's own repo
  3. Add CI/CD
  • automated npm build and publishing
  • automated website build and deploy
  1. Add sourcemaps for debugging/local so there is no need to use non-minified files.
  2. Add watch/livereload for local development
  3. Remove minified files from git

Currently the only thing not clear for me is if

const DEBUG_PATH = "synthetizer/worklet_system/worklet_processor.js";

in https://github.com/spessasus/SpessaSynth/blob/master/src/website/js/manager/manager.js#L125
is really needed. Since this require the whole library to be served. And if sourcemaps are added is this still needed?

# Conflicts:
#	package.json
#	src/website/lib/worklet_processor.min.js
#	src/website/minified/demo_main.min.js
#	src/website/minified/local_main.min.js
# Conflicts:
#	src/spessasynth_lib/synthetizer/worklet_processor.min.js
#	src/website/minified/demo_main.min.js
#	src/website/minified/local_main.min.js
#	src/website/minified/style.min.css
@easingthemes easingthemes marked this pull request as draft October 6, 2024 18:09
@easingthemes
Copy link
Author

Idea:

  • Create npm org spessasynth to have all packages under one namespace @spessasynth

Separate repo vs monorepo:

  • create repo (spessasus/spessasynth_lib) and npm package @spessasynth/lib
  • use package in SpessaSynth, remove library source code from this repo
  • or re structure current repo to monorepo and still use npm package @spessasynth/lib

Why:

  • Because currently website is a set of very useful components not just simple example
  • Maintaining library require instant update of the website
  • If separate npm package is used, then website can be updated independently since library version is controlled.

@spessasus
Copy link
Owner

Idea:

* Create npm org `spessasynth` to have all packages under one namespace `@spessasynth`

Separate repo vs monorepo:

* create repo (spessasus/spessasynth_lib) and npm package `@spessasynth/lib`

* use package in `SpessaSynth`, remove library source code from this repo

* or re structure current repo to monorepo and still use npm package `@spessasynth/lib`

Why:

* Because currently `website` is a set of very useful components not just simple example

* Maintaining library require instant update of the website

* If separate npm package is used, then website can be updated independently since library version is controlled.

Hi,

First of all, thanks for the compliments : )

About splitting up the packages:
website is not a part of the library or an example. It never was. In fact, spessasynth was just the website at the start, I then separated the audio components into a folder called spessasynth_lib and then later made it an npm package. So the website probably won't ever be an npm package, as it's simply not designed to be. It's a standalone app meant to be a MIDI player and synthesizer that's powerful and easy to use. The components are really tightly integrated, so using them for a different purpose is very hard. Not to mention that they are not documented (why would they be?)

About spessasynth_lib repo:
I do actually have a repo (private) for the lib with an automated shell script for publishing:

#!/bin/bash
cd "$(dirname "$0")"
# copy over the lib
rm -rf package
mkdir package
cp -r ../SpessaSynth/src/spessasynth_lib/* package
cp index.js package
cp package.json package

cd package/synthetizer/worklet_system
chmod +x minify_processor.sh
./minify_processor.sh
cd ../../../

ls
chmod +x copy_version.sh
./copy_version.sh

echo "Adding types.d"

# create types
npx --verbose -p typescript tsc package/*.js --declaration --allowJs --target ES6 --emitDeclarationOnly --outDir package/@types

cd "$(dirname "$0")"
cd package
ls
echo "publishing"
npm publish

I just run it after I commit and the npm package gets updated. Same thing with releases.

@spessasus
Copy link
Owner

So, about website, which components do you consider useful? For example, settings or localeManager won't be really useful outside this specific app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants