1.0.1 • Published 5 years ago

@caldera-digital/core v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Caldera Digital Platform 🏕

All open source libraries and projects from the Caldera team. All documentation is accessible on the documentation website or through React Cosmos.

Getting Started

git clone https://github.com/caldera-digital/platform.git

cd platform

npm install typescript@3.5.3 -g

# Only if you want to serve functions locally
npm install firebase-tools@7.2.4 -g

# Installs deps and builds all packages and projects
yarn bootstrap

yarn <PROJECT-YOU-WANT-TO-RUN>:dev

Recommended Environment

  1. VSCode
  2. Install VSCode Live Share
  3. ZSH
  4. Install NVM
  5. Make sure to install and run the correct version of node when developing on this project
nvm install lts/dubnium
nvm alias default lts/dubnium

## If you need to switch back to it
nvm use
  1. Use HomeBrew
  2. Use yarn
brew install yarn

Feel free to use any terminal. However, if pair programming with LiveShare you will need to use the integrated VSCode terminal.

Coding Standards with VSCode

You do not have to use VSCode in order to develop on this project, but it is highly recommended. Before we begin, please install the following plugins:

  1. EditorConfig
  2. ESLint
  3. Prettier
  4. Code Spell Checker

There are workspace settings for this repo located in .vscode/settings.json that will format all files you create or edit on save according to the rules defined in .prettierrc, .editorconfig, and .eslintrc files. There is also a running list of spell check exceptions. You can override these settings with your user settings if needed.

If you need to add a global variable, insert it into the .eslintrc file. Sometimes you need to break the rules for some of the lines of code. If you need to do that you can right click on the broken rules in the code and disable that rule for that line. It's helpful to disable the rule for the line of code so others can see why it's needed.

Workspaces

There is a workspace available for each project located in .vscode/caldera-platform.code-workspace. It is helpful to run this so you can receive topical search results that ignore built files or test coverage directories. It also changes your title bar color so you can easily find this project compared to other coding windows you have open.

Adding Firebase Secrets

In order to add secrets to a Firebase project you need to be logged in and authorized to do so by the project. All of this is done though the cli with the following command:

# Cannot use uppercase!
firebase functions:config:set stripe.testsecret="your-test-secret-key"

# Deploy your updates
firebase deploy --only functions

You can then get to it in your cloud functions like so:

import { config } from 'firebase-functions'

const secret = config().stripe.testsecret