0.1.103 • Published 11 months ago

@decentral.games/ice-helper v0.1.103

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

ICE-Helper

Library Usage

This library is intended to make database schemas and other conventions consistent between repos. You can import the library into your codebase like so:

import { DataHelper } from '@decentral.games/ice-helper';

Then, you can initialize a dataHelper instance by providing a Redis and MongoDB connection string.

const dataHelper = new DataHelper(
  process.env.REDIS_CONNECTION_STRING,
  process.env.DB_CONNECTION_STRING
);

The DataHelper instance gives you access to Mongoose controllers for each MongoDB collection (ex. dataHelper.UserAddressesController...) along with various other methods defined in src/dataHelper.ts.

Reference

TODO

Commands

TSDX scaffolds your new library inside /src.

To run TSDX, use:

npm start # or yarn start

This builds to /dist and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.

To do a one-off build, use npm run build or yarn build.

To run tests, use npm test or yarn test.

Configuration

Code quality is set up for you with prettier, husky, and lint-staged. Adjust the respective fields in package.json accordingly.

Jest

Jest tests are set up to run with npm test or yarn test.

Bundle Analysis

size-limit is set up to calculate the real cost of your library with npm run size and visualize the bundle with npm run analyze.

Setup Files

This is the folder structure we set up for you:

/src
  index.tsx       # EDIT THIS
/test
  blah.test.tsx   # EDIT THIS
.gitignore
package.json
README.md         # EDIT THIS
tsconfig.json

Rollup

TSDX uses Rollup as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.

TypeScript

tsconfig.json is set up to interpret dom and esnext types, as well as react for jsx. Adjust according to your needs.

Continuous Integration

GitHub Actions

Two actions are added by default:

  • main which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
  • size which comments cost comparison of your library on every pull request using size-limit

Optimizations

Please see the main tsdx optimizations docs. In particular, know that you can take advantage of development-only optimizations:

// ./types/index.d.ts
declare var __DEV__: boolean;

// inside your code...
if (__DEV__) {
  console.log('foo');
}

You can also choose to install and use invariant and warning functions.

Module Formats

CJS, ESModules, and UMD module formats are supported.

The appropriate paths are configured in package.json and dist/index.js accordingly. Please report if any issues are found.

Named Exports

Per Palmer Group guidelines, always use named exports. Code split inside your React app instead of your React library.

Including Styles

There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.

For vanilla CSS, you can include it at the root directory and add it to the files section in your package.json, so that it can be imported separately by your users and run through their bundler's loader.

Publishing to NPM

We recommend using np.

0.1.98

11 months ago

0.1.99

11 months ago

0.1.103

11 months ago

0.1.102

11 months ago

0.1.101

11 months ago

0.1.100

11 months ago

0.1.96

11 months ago

0.1.97

11 months ago

0.1.90

11 months ago

0.1.91

11 months ago

0.1.92

11 months ago

0.1.93

11 months ago

0.1.95

11 months ago

0.1.85

11 months ago

0.1.86

11 months ago

0.1.87

11 months ago

0.1.88

11 months ago

0.1.89

11 months ago

0.1.80

12 months ago

0.1.81

12 months ago

0.1.82

12 months ago

0.1.83

12 months ago

0.1.84

12 months ago

0.1.75

1 year ago

0.1.76

1 year ago

0.1.77

1 year ago

0.1.78

12 months ago

0.1.79

12 months ago

0.1.74

1 year ago

0.1.70

1 year ago

0.1.71

1 year ago

0.1.72

1 year ago

0.1.73

1 year ago

0.1.69

1 year ago

0.1.66

1 year ago

0.1.67

1 year ago

0.1.68

1 year ago

0.1.57

1 year ago

0.1.58

1 year ago

0.1.59

1 year ago

0.1.63

1 year ago

0.1.64

1 year ago

0.1.65

1 year ago

0.1.60

1 year ago

0.1.61

1 year ago

0.1.62

1 year ago

0.1.32

1 year ago

0.1.56

1 year ago

0.1.34

1 year ago

0.1.36

1 year ago

0.1.50

1 year ago

0.1.49

1 year ago

0.1.27

2 years ago

0.1.28

2 years ago

0.1.41

1 year ago

0.1.42

1 year ago

0.1.43

1 year ago

0.1.44

1 year ago

0.1.45

1 year ago

0.1.46

1 year ago

0.1.47

1 year ago

0.1.48

1 year ago

0.1.26

2 years ago

0.1.40

1 year ago

0.1.38

1 year ago

0.1.39

1 year ago

0.1.20

2 years ago

0.1.21

2 years ago

0.1.22

2 years ago

0.1.23

2 years ago

0.1.24

2 years ago

0.1.25

2 years ago

0.1.16

2 years ago

0.1.17

2 years ago

0.1.18

2 years ago

0.1.19

2 years ago

0.1.10

2 years ago

0.1.11

2 years ago

0.1.12

2 years ago

0.1.14

2 years ago

0.1.15

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago