Skip to content

Latest commit

 

History

History
72 lines (38 loc) · 2.62 KB

DEVELOPING.md

File metadata and controls

72 lines (38 loc) · 2.62 KB

Developing

Setting up development environment

You will start by forking the XYZ repository.

Development dependencies

The minimum requirements are:

  • Git
  • Node.js (version 18 and above)

The executables git and node should be in your PATH.

To install the Node.js dependencies run

npm install

Please check the full list of dependencies as defined in the package.json

ESBuild

The MAPP and MAPP.UI library must be build with esbuild prior to launching the host.

npx esbuild ./lib/mapp.mjs ./lib/ui.mjs --bundle --minify --tree-shaking=false --sourcemap --format=iife --outdir=./public/js/lib

The build command is stored in the package.json as _build script.

npm run _build

ESBuild must also be used to compile the CSS supporting the MAPP and MAPP.UI elements.

npx esbuild --bundle public/css/_mapp.css --outfile=public/css/mapp.css

npx esbuild --bundle public/css/_ui.css --outfile=public/css/ui.css --loader:.svg=dataurl

ESLint

The codebase makes use of the eslint package to ensure that our code adhere to different rules and coding guidelines. To run eslint you will need to have the development packages installed. You can ensure they are installed by running npm install in the root of the xyz directory.

To run the lint you can execute npx eslint . in the root of the application. This will show any issues there are with the codebase. You can also add the flag --fix to the command to allow eslint to fix any issues it may find.

eslint command

npx esbuild .

eslint command with fix

npx esbuild . --fix

There are other extensions you can use in your editor to get on the fly error highlighting where any rules are broken. Please look into what eslint supports in your environment.

version.js hash

The mapp module object holds a hash of the latest release commit which can be generated by executing the version.js script in the root.

The version script will complete by executing the ESBuild process.

node version.js

Express

Express.js will be installed by npm as a development dependency. You can run a zero config instance by loading the express.js script in your node runtime.

node express.js

The default port is 3000. You can access the mapp interface on http://localhost:3000/ in your browser.

Please refer to the Getting Started wiki page for the next steps in regards to workspace configuration and environment variables.