Starting ZPT-JS
Asumming you have downloaded ZPT-JS before, move to the directory of ZPT-JS and use the next command to install the dependencies of ZPT-JS and build dist files:
$ npm run init
That command runs a npm install
(install all dependencies) and npm run build-all
(build dist files).
Then use the next command to initialize a HTTP server (port 9000) to serve static files (HTML, CSS, JS and JSON files):
$ npm run http-server
The web of ZPT-JS
Use the next command to initialize a HTTP server (port 9001) to serve static files of the web of ZPT-JS:
$ npm run web
Open http://localhost:9001 with your favourite browser to view the web of ZPT-JS.
Run the next command to initialize both HTTP servers:
$ npm run start
Testing
ZPT-JS uses QUnit as testing framework.
Open http://localhost:9000/test/ with your favourite browser. Be careful: only related to browser test are run! All tests passed using last versions of Mozilla Firefox and Chromium. Perhaps some tests fail using other browsers!
Other scripts
Description of other scripts defined in package.json file:
- version: Creates a file in js/app/version.js containing the version of ZPT-JS.
- updateZPTInDocs: Updates the ZPT version used in ZPT's web with the version in ./dist/zpt-esm.js.
- checkNode: Runs a simple test to check if node version of ZPT-Js works properly.
- build-all-deps-esm: Builds esm versions of dependencies from ./node_modules and put them in ./lib directory. It uses esbuild.
- build-all: Builds different standalone versions of ZPT-JS (esm, esm minified, esm minified gzipped, cjs) and put them in ./dist directory. It uses esbuild too.
- build: Runs build-all-deps-esm and build-all.