Skip to content

Commit

Permalink
feat: let there be state machine
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Feb 18, 2021
1 parent 11ac4f9 commit 442d1f4
Show file tree
Hide file tree
Showing 12 changed files with 998 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"@typescript-eslint/no-shadow": "off",
"react-hooks/exhaustive-deps": "error",
"import/no-named-as-default": "off",
"prefer-object-spread": "off"
"prefer-object-spread": "off",
"arrow-body-style": "off"
},
"overrides": [
{
Expand Down
11 changes: 11 additions & 0 deletions packages/machine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @chakra-ui/machine

A Quick description of the component

## Installation

```sh
yarn add @chakra-ui/machine
# or
npm i @chakra-ui/machine
```
10 changes: 10 additions & 0 deletions packages/machine/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
collectCoverageFrom: ["tests/**/*.{ts,tsx,js,jsx}"],
transform: {
".(ts|tsx)$": "ts-jest/dist",
},
transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"],
setupFilesAfterEnv: ["@testing-library/jest-dom/extend-expect"],
}
62 changes: 62 additions & 0 deletions packages/machine/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "@chakra-ui/machine",
"version": "1.0.0",
"description": "A minial implementation of xstate with some more features missing in xstate-fsm",
"keywords": [
"theme",
"theming",
"ui mode",
"ui"
],
"author": "Segun Adebayo <sage@adebayosegun.com>",
"homepage": "https://github.com/chakra-ui/chakra-ui#readme",
"license": "MIT",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"typings": "dist/types/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"require": "./dist/cjs/index.js",
"default": "./dist/esm/index.js"
}
},
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/chakra-ui/chakra-ui.git"
},
"bugs": {
"url": "https://github.com/chakra-ui/chakra-ui/issues"
},
"scripts": {
"prebuild": "rimraf dist",
"start": "nodemon --watch src --exec yarn build -e ts,tsx",
"build": "concurrently yarn:build:*",
"test": "jest --env=jsdom --passWithNoTests",
"lint": "concurrently yarn:lint:*",
"version": "yarn build",
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps",
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps",
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
"test:cov": "yarn test --coverage",
"lint:src": "eslint src --ext .ts,.tsx --config ../../.eslintrc",
"lint:types": "tsc --noEmit"
},
"dependencies": {
"nanoid": "3.1.20",
"valtio": "0.7.0"
},
"peerDependencies": {
"react": ">=16.8.6"
},
"devDependencies": {
"react": "^17.0.1"
}
}
2 changes: 2 additions & 0 deletions packages/machine/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./use-machine"
export * from "./machine"
Loading

0 comments on commit 442d1f4

Please sign in to comment.