10.1.0 • Published 2 years ago

@keg-hub/keg-core v10.1.0

Weekly downloads
25
License
MIT
Repository
github
Last release
2 years ago

Keg Core

Overview

The keg is a platform for developing cross-platform react apps. It comes preconfigured to target both web and mobile, and it contains a collection of utilities for simplifying development, including:

  • built-in routing and navigation
  • a reducer based on the relational data model
  • dynamic theming via re-theme
  • cross platform persistent storage

Tap usage

  • To start, first setup the keg-cli
  • Next, use the cli to generate a tap: keg gn tap
  • cd into your tap's directory, then run yarn setup
  • The tap you generated will have installed keg-core as a dependency
  • Read more about tap-development here

Defining Environment Variables

  • Within your tap's config file (e.g. tap.js, tap.json), you can define an envs property in the keg object like this:
module.exports = {
  ...,
  keg: {
    ...
    envs: {
      'process.env.FOO': 'bar',
      SOME_API_KEY: getAPIKey()
      'process.env.TAP_LICENSE': 'tap.package.license'
    }
  }
}

And these will be replaced in your code, so that you can use them like this:

const myFunction () {
  makeAPICall(SOME_API_KEY)
  console.log('Foo', process.env.FOO)
  console.log('This tap uses the license', process.env.TAP_LICENSE)
}
  • you can define dynamic envs that pull data from a package.json or an app config by using the form: <tap|core>.<package|config>.<some_property>
    • so the tap.package.license will evaluate to the value of the license property in your tap's package.json
  • every env is automatically stringified

Running with webpack / expo

  • These envs are automatically replaced for you at build time

Running with other build tools

  • If you use a different bundler, like rollup, you can still use these envs by importing the getKegEnvs function from keg-core/core/scripts/js/getKegEnvs
  • then, just use them into your tool's replacement plugin

Architecture

Store

10.1.0

2 years ago

10.0.1

2 years ago

10.0.0

2 years ago

9.5.0

3 years ago

9.4.0

3 years ago

9.3.1

3 years ago

9.3.0

3 years ago

9.1.0

3 years ago

9.0.1

3 years ago

9.0.0

3 years ago

8.2.1

3 years ago

8.3.0

3 years ago

8.2.0

3 years ago

8.1.2

3 years ago

8.1.0

3 years ago

8.1.1

3 years ago

8.0.0

3 years ago

7.0.0

3 years ago

6.3.0

4 years ago

6.2.1

4 years ago

6.2.0

4 years ago

6.1.0

4 years ago

6.0.0

4 years ago

5.0.1

4 years ago

4.0.0

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago