* Added tz column * Updated hasura permissions on new table * Added new dependencies for working with timezones * Added SetupTimeZone component * Bumped spacetime-informal to use their types * Extracted timezone computation into helper, added useMemo hook * Re-added spacetime types
MetaGame Design System User Guide
This was bootstrapped using TSDX. Modified README for MetaGame usage below:
Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.
This TSDX setup is meant for developing React components (not apps!) that can be published to NPM. If you’re looking to build an app, you should use
create-react-app,razzle,nextjs,gatsby, orreact-static.
If you’re new to TypeScript and React, checkout this handy cheatsheet
Commands
TSDX scaffolds your new library inside /src.
The recommended workflow is to run TSDX in one terminal:
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.
Then run storybook:
Storybook
Run inside another terminal:
yarn storybook
This loads the stories from ./stories.
NOTE: Stories should reference the components as if using the library, similar to the example playground. This means importing from the root project directory. This has been aliased in the tsconfig and the storybook webpack config as a helper.
To run tests, use yarn test.
Jest
Jest tests are set up to run with npm test or yarn test. This runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.
Folder Structure
/.storybook # Storybook configuration
/__tests__ # Test Files
foo.test.tsx
/src
index.tsx # Entry Point
theme.ts # Default Theme
GlobalStyle.ts # CSS Reset and Emotion Global Styles
/stories # Storybook files
Foo.stories.tsx
package.json
tsconfig.json
Rollup
TSDX uses Rollup v1.x as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.
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.