Lever-age / frontend

Leverage user facing frontend
GNU Affero General Public License v3.0
1 stars 6 forks source link

Complete scaffolding with index.html/index.js example #75

Closed lottspot closed 7 years ago

lottspot commented 7 years ago

This scaffolding lends itself to a workflow where each page is mapped to a different JS module. The module for that page is then expected to export a single function which accepts a single argument, that argument being the core module. The specific steps for adding a page with executing JS code:

  1. Create ${pageName}.html under the src/html directory
  2. Create a matching module for ${pageName}.html under src/js. This module should export a function which accepts the core object as an argument (see index.js for an example).
  3. Map the page name to the module within src/js/entrypoint.js using the entrypointMap object (see entrypointMap in entrypoint.js for an example).
  4. Add the JS source module to the build under JS_SRCS in the Makefile
  5. Add the HTML file destination path to the build under BUILD_FILES in the Makefile
lottspot commented 7 years ago

what do y'all think of this workflow @modpluz @crsmyz

modpluz commented 7 years ago

lgtm 👍

I've got a question not related to this PR. With regards to travis build job, wouldn't make already do what the commands after line #480 does? Redundancy perhaps?