-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from rambler-digital-solutions/infra
WIP: chore: add lerna, eslint, prettier, commitlint, size limit, etc
- Loading branch information
Showing
172 changed files
with
15,016 additions
and
12,626 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": ["@rambler-tech/commitlint-config/shared"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": [ | ||
"@rambler-tech/eslint-config/semi", | ||
"@rambler-tech/eslint-config/ts" | ||
], | ||
"rules": { | ||
"max-params": "off", | ||
"new-cap": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags-ignore: | ||
- v* | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: yarn | ||
node-version: '18.x' | ||
- run: yarn | ||
- run: | | ||
git config --global user.email $BOT_EMAIL | ||
git config --global user.name rambler-ui-bot | ||
env: | ||
BOT_EMAIL: ${{ secrets.BOT_EMAIL }} | ||
- run: | | ||
echo "@rambler-tech:registry=https://registry.npmjs.org/" > .npmrc | ||
echo "registry=https://registry.npmjs.org/" >> .npmrc | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- run: yarn build | ||
- run: yarn release | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags-ignore: | ||
- v* | ||
|
||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
# test: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Use Node.js | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# cache: yarn | ||
# node-version: '18.x' | ||
# - run: yarn | ||
# - run: yarn test | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: yarn | ||
node-version: '18.x' | ||
- run: yarn | ||
- run: yarn lint | ||
- run: yarn typecheck | ||
|
||
size: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: yarn | ||
node-version: '18.x' | ||
- run: yarn | ||
- run: yarn sizecheck | ||
|
||
commitlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: yarn | ||
node-version: '18.x' | ||
- run: yarn | ||
- uses: wagoid/commitlint-github-action@v3 | ||
env: | ||
NODE_PATH: ${{ github.workspace }}/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
.DS_Store | ||
node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
lerna-debug.log | ||
coverage | ||
.nyc_output | ||
.vscode | ||
.idea | ||
dist | ||
build | ||
spec.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn commitlint --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"*.{js,ts,tsx}": ["prettier --write", "eslint --fix"], | ||
"*.md": ["prettier --write"], | ||
"!(packages/*/tsconfig).json": ["prettier --write"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"@rambler-tech/prettier-config/semi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"path": "packages/core-v1/dist/index.js", | ||
"limit": "3.8 KB" | ||
}, | ||
{ | ||
"path": "packages/react-v1/dist/index.js", | ||
"limit": "3.5 KB" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) Rambler Internet Holdings LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @type {import('jest').Config} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
moduleDirectories: ['packages', 'node_modules'], | ||
collectCoverage: true, | ||
coverageReporters: ['text'], | ||
moduleNameMapper: { | ||
uuid: require.resolve('uuid'), | ||
}, | ||
// setupFilesAfterEnv: ['./jest.setup.js'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": "independent", | ||
"npmClient": "yarn", | ||
"packages": ["packages/*"], | ||
"command": { | ||
"version": { | ||
"allowBranch": "master", | ||
"conventionalCommits": true, | ||
"createRelease": "github", | ||
"message": "chore(release): publish", | ||
"ignoreChanges": ["**/*.md"] | ||
}, | ||
"publish": { | ||
"yes": true, | ||
"verifyAccess": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,51 @@ | ||
{ | ||
"name": "reflexio", | ||
"private": true, | ||
"description": "Business flow manager, more than just state manager", | ||
"scripts": {}, | ||
"workspaces": [ | ||
"packages/*" | ||
"keywords": [ | ||
"reflexio" | ||
], | ||
"author": "Konstantin Astapov", | ||
"license": "MIT", | ||
"readme": "README.md", | ||
"scripts": { | ||
"build": "lerna exec -- tsc", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"lint": "eslint '**/*.{js,ts,tsx}'", | ||
"format": "prettier --write '**/*.{js,ts,tsx}' && eslint '**/*.{js,ts,tsx}' --fix", | ||
"typecheck": "tsc --noEmit", | ||
"sizecheck": "lerna exec -- tsc && size-limit", | ||
"release": "lerna version && lerna publish from-package", | ||
"prepare": "[ -n \"$CI\" ] && exit 0 || husky install" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/reflexio/reflexio.git" | ||
"url": "git+https://github.com/rambler-digital-solutions/reflexio.git" | ||
}, | ||
"keywords": [ | ||
"reflexio" | ||
], | ||
"author": "Konstantin Astapov", | ||
"license": "MIT", | ||
"private": true, | ||
"devDependencies": { | ||
"@reflexio/reflexio-on-redux": "*", | ||
"@commitlint/cli": "^19.2.1", | ||
"@rambler-tech/commitlint-config": "^0.1.1", | ||
"@rambler-tech/eslint-config": "^0.13.0", | ||
"@rambler-tech/prettier-config": "^0.1.0", | ||
"@rambler-tech/ts-config": "^0.1.1", | ||
"@size-limit/preset-small-lib": "^11.1.2", | ||
"@types/jest": "^29.5.12", | ||
"eslint": "^8.57.0", | ||
"husky": "^9.0.11", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"lerna": "^8.1.2", | ||
"lint-staged": "^15.2.2", | ||
"prettier": "^3.2.5", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"redux": "^4.2.1", | ||
"uuid": "^8.3.2" | ||
} | ||
"react-redux": "^9.1.0", | ||
"redux": "^4", | ||
"size-limit": "^11.1.2", | ||
"ts-jest": "^29.1.2", | ||
"typescript": "^5.4.3" | ||
}, | ||
"workspaces": [ | ||
"packages/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-disable import/no-unused-modules */ | ||
export {Slice} from './lib/Slice'; | ||
export {Bite} from './lib/Bite'; | ||
export {Script} from './lib/Script'; | ||
export {useSystem, type System} from './lib/System'; | ||
export {configureRoot} from './lib/configureRoot'; | ||
export {getTriggerAndStatus, getActionType} from './lib/utils'; | ||
export type { | ||
UpdateOnType, | ||
DispatcherType, | ||
BiteStatusWrap, | ||
ScriptOptsType, | ||
InitArgsType, | ||
WatchArgsType, | ||
} from './lib/types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type {MakeBiteProcessorType, MakeBiteReducerType} from './types'; | ||
|
||
type BiteType = <ITriggers, IState, K extends keyof ITriggers, IRootTrigger>( | ||
reducer: MakeBiteReducerType<ITriggers, IRootTrigger, IState, K>, | ||
processor: MakeBiteProcessorType<ITriggers, IRootTrigger, K>, | ||
) => { | ||
reducer: MakeBiteReducerType<ITriggers, IRootTrigger, IState, K>; | ||
processor: MakeBiteProcessorType<ITriggers, IRootTrigger, K>; | ||
}; | ||
|
||
export const Bite: BiteType = (reducer, processor) => ({reducer, processor}); |
Oops, something went wrong.