0.0.145-COLLAB-177-app.1 • Published 4 years ago

workspace-app v0.0.145-COLLAB-177-app.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

workspace-app

Build Status

nothing yet

Features: - web components - es6 module bundling

Directory Stucture:

- `wc/`
    - this is the top level directory for all your web components
- `js/`
    - This is the top level directory for any included scripts. 
    - These get imported into workspace-app.js 
- `index.html`
    - A testing ground for your components. You can import and display components here.
    - Allowing you to work on your app locally, when you dont have VPN/Internet access
- `entry.html`
  - The entry point for the [polymer build](https://github.com/Polymer/polymer-build) process.
- `wc/workspace-app/workspace-app.html`
  - The top level web component include.

Developing: - Commenting There are a few grepable values that can be left in comments as markers for future work - @TEST means that a test needs to be done - @REVISIT check if the ticket number is finished and turn into a do or issue - @DO means that there is work that needs to happen if you are looking at a file - it can either be done in the course of work or if large can be made into an issue - @description docs are needed, please take a few mins and write some if you are touching this function - @ISSUE A todo that was made into a ticket with AC - @QUESTION Something that needs to be resolved by the team - @yourname usually part of a do or a question, it is directed towards this developer

- Including modules.
    Using Npm You can download any dependency you may need 
- Creating elements   
    Use our [Element Scaffold](https://gh.corp.bitshelter.com/BitShelter/generator-polymer-init-element-scaffold) to create any element you need
- Including elements.
    Bower any [polymer elements or web component](https://beta.webcomponents.org/) you need 
- Building the app
  - in your vodka view navigate to workspace-app/ directory and then
    - `npm run start-vodka` to just build the app
    - `npm run start-vodka-watch` to build and watch the files as you develop.
  - if you are developing locally, not going through vodka
    - `npm run start-local-watch -- --env.apiPort=8010` will get the app running at localhost:9000/ws and will use vodka port 8010 for authorizing api calls. Replace that `8010` with your vodka port number when you're developing.
- Testing
    - `npm run test` will run through the tests in chrome, firefox and safari and immediately close those browsers when it finishes. If you want to keep the browsers open, add the `-p` option. so the full command would be `npm run test -- -p`

Note about importing the app:

Our current practice is to deliver the same bundled app to all browsers. The build process (gulp) accordingly compiles the code down to ES5 to fill out our support matrix. In order for the ES5 app to work with more modern browsers that support ES6 features you must include the custom-elements-es5-adapter. The adapter can be conditionally included in a smarty template in this way, and should be done before using the smarty {spaInclude} function to load the app itself:

<script>if(!window.customElements){ldelim}document.write('<!--');{rdelim}</script>
    <script src="/include/{$smarty.const.JS_INCLUDE_REV}/0/apps/workspace-app/build/bundled/bower_components/webcomponentsjs/custom-elements-es5-adapter.js"></script>
<!--! do not remove -->
{spaInclude src="workspace-app/build/bundled/workspace-app.js"}

This is a project generated by Generator Polymer Init PS App Slug