10.1.0 • Published 4 years ago
@keg-hub/keg-core v10.1.0
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 cdinto your tap's directory, then runyarn setup- The tap you generated will have installed
keg-coreas 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 anenvsproperty in thekegobject 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.jsonor an app config by using the form:<tap|core>.<package|config>.<some_property>- so the
tap.package.licensewill evaluate to the value of thelicenseproperty in your tap'spackage.json
- so the
- 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
getKegEnvsfunction fromkeg-core/core/scripts/js/getKegEnvs- learn more here
- then, just use them into your tool's replacement plugin
Architecture
Store
10.1.0
4 years ago
10.0.1
4 years ago
10.0.0
4 years ago
9.5.0
4 years ago
9.4.0
4 years ago
9.3.1
4 years ago
9.3.0
4 years ago
9.1.0
5 years ago
9.0.1
5 years ago
9.0.0
5 years ago
8.2.1
5 years ago
8.3.0
5 years ago
8.2.0
5 years ago
8.1.2
5 years ago
8.1.0
5 years ago
8.1.1
5 years ago
8.0.0
5 years ago
7.0.0
5 years ago
6.3.0
5 years ago
6.2.1
5 years ago
6.2.0
5 years ago
6.1.0
5 years ago
6.0.0
5 years ago
5.0.1
5 years ago
4.0.0
5 years ago
0.2.2
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago