glass-app-manager
Version:
Informatica's Glass Framework CLI for bootstrapping
100 lines (82 loc) • 4.27 kB
Markdown
# Droplets
## Initial Setup
It’s highly recommended to use [Node Version Manager](https://github.com/creationix/nvm) to manage your installed versions of Node. Aside from it making it easier to update Node, it also helps to reduce permissions issues when installing global packages.
### Requirements
* Node ~8.0.0 (with nvm run `nvm install 8 && nvm use 8 && nvm alias default 8`)
* npm ~6.0.0 (to update run `npm install -g npm`)
### Change npm’s default registry to Informatica internal registry
```bash
npm config set always-auth true
npm config set email "USERNAME@informatica.com"
npm config set registry http://infamvn:8081/nexus/content/groups/npmJs_GRP/
```
### Workspace setup
Sync `//droplets/core` to your perforce workspace and then run:
```bash
cd path/to/droplets/core
npm i
```
## IDE Setup
We recommend using [Visual Studio Code](https://code.visualstudio.com/), but [WebStorm](https://www.jetbrains.com/webstorm/) may work as well.
### Useful VSCode Plugins
* [Auto Close Tag - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag)
* [Bracket Pair Colorizer - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer)
* [EditorConfig for VS Code - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)
* [ESLint - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
* [Flow Language Support - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=flowtype.flow-for-vscode)
* [Path Autocomplete - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ionutvmi.path-autocomplete)
* [Perforce for VS Code - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=slevesque.perforce)
* [PostCSS syntax - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ricard.PostCSS)
* [Prettier - Code formatter - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
### VSCode Settings
When VSCode sees Flowtype definitions in your JS, it tries to parse it as TypeScript. Add this setting to your workspace settings to allow it to parse Flowtypes:
```json
"flow.useNPMPackagedFlow": true,
"javascript.validate.enable": false
```
### Perforce Integration
```json
"perforce.client": "YOURWORKSPACENAME",
"perforce.editOnFileSave": true,
"perforce.editOnFileModified": true,
"perforce.addOnFileCreate": true,
"perforce.deleteOnFileDelete": true,
```
## Start Styleguidist
```bash
cd path/to/droplets/core
npm run styleguide
```
## Running Unit Tests
Coverage reports will be generated under `//droplets/coverage/` after running the following command:
```bash
cd path/to/droplets/core
npm run test
```
## Linking Droplets For Local Development
### Set up a symbolic link from your local copy of droplets-core to the consuming app’s node_modules folder
```bash
cd path/to/droplets/core
npm i
npm link
cd path/to/consuming/app
npm i
npm link @informatica/droplets-core
```
### Rebuild droplets-core whenever you make changes
```bash
# Complete build
npm run build
# Build just JavaScript changes
npm run build:js
# Build just theme changes
npm run build:themes
```
### Warnings
Whenever you run `npm install`, your link will get deleted and you'll have to run `npm link @informatica/droplets-core` again.
## Build Gotchas
* I'm seeing weird errors when I build where NPM says it can't find packages
1. Delete `//droplets/package-lock.json` and run `npm install`
2. If the problem still persists the run: `npm cache clean -f`
* I'm seeing 'SyntaxError: missing ) after argument list' when trying to build the Playground with the following command: node --max_old_space_size=8192 ./node_modules/.bin/parcel playground/index.html --out-dir .playground-tmp
1. If you are using Windows, Windows has an issue with running scripts with '.bin' in the path. Use 'node --max_old_space_size=8192 ./node_modules/parcel/bin/cli.js playground/index.html --out-dir .playground-tmp' instead