Awesome
Source code of TheSpace official app.
Development
Install Tools
- Elm v0.19 https://guide.elm-lang.org/install/
- Node/NPM (recent version) https://docs.npmjs.com/cli/v8/configuring-npm/install
Install project development dependencies
npm install --only-dev
Auto reload dev server
make dev-server
or, in debug mode
make debug-server
Notes
- tmp build elmapp to
src/Native/elmapp.js
(in .gitignore) - default host using
0.0.0.0:8000
for mobile testing convenience - for production server,
127.0.0.1
is whitelisted
Env Management (production/staging/development)
Switch env
cp src/Env/(Production|Staging|Development).env src/Env.elm
Backup current env
make backup-env
This will back up src/Env.elm
to src/Env.bak
.
Restore backup env
make restore-env
This will restore src/Env.bak
to src/Env.elm
, and use src/Env/Development.env
if src/Env.bak
not exists.
Release
Production Release
make prod
Staging Release
make stag
These commands will:
- backup current env
- switch to production/staging env
- compile current Elm code with
--optimize
flag tosrc/Native/elmappesm.js
(ES6 Module). - bundle
elmappesm.js
with js files tocurrent/(prod|stag)/app.js
- uglify and minify
current/(prod|stag)/app.js
tocurrent/(prod|stag)/app.min.js
- generate
current/(prod|stag)/index.html
using MD5 checksum ofapp.min.js
as version(?v=version
) - remove
current/(prod|stag)/app.js
andsrc/Native/elmappesm.js
- restore backed up env