Skip to content

Commit

Permalink
Merge pull request #1 from rambler-digital-solutions/infra
Browse files Browse the repository at this point in the history
WIP: chore: add lerna, eslint, prettier, commitlint, size limit, etc
  • Loading branch information
asapovk authored Apr 2, 2024
2 parents 0418709 + 2b58d83 commit 645122f
Show file tree
Hide file tree
Showing 118 changed files with 7,050 additions and 5,918 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@rambler-tech/commitlint-config/shared"]
}
12 changes: 12 additions & 0 deletions .editorconfig
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
62 changes: 0 additions & 62 deletions .eslintrc

This file was deleted.

6 changes: 6 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"@rambler-tech/eslint-config/semi",
"@rambler-tech/eslint-config/ts"
]
}
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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 }}

pages:
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 docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: public
67 changes: 67 additions & 0 deletions .github/workflows/test.yml
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
10 changes: 9 additions & 1 deletion .gitignore
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.*
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
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
4 changes: 4 additions & 0 deletions .husky/pre-commit
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
5 changes: 5 additions & 0 deletions .lintstagedrc.json
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"]
}
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@rambler-tech/prettier-config/semi"
10 changes: 10 additions & 0 deletions .size-limit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"path": "packages/core-v1/dist/index.js",
"limit": "1 KB"
},
{
"path": "packages/react-v1/dist/index.js",
"limit": "1 KB"
}
]
21 changes: 21 additions & 0 deletions LICENSE
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.
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
moduleDirectories: ['packages', 'node_modules'],
collectCoverage: true,
coverageReporters: ['text'],
// setupFilesAfterEnv: ['./jest.setup.js']
};
22 changes: 22 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "independent",
"npmClient": "yarn",
"packages": [
"packages/core-v1",
"packages/react-v1",
"packages/ssr"
],
"command": {
"version": {
"allowBranch": "master",
"conventionalCommits": true,
"createRelease": "github",
"message": "chore(release): publish",
"ignoreChanges": ["**/*.md"]
},
"publish": {
"yes": true,
"verifyAccess": false
}
}
}
57 changes: 41 additions & 16 deletions package.json
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"
}
"redux": "^4",
"size-limit": "^11.1.2",
"ts-jest": "^29.1.2",
"typescript": "^5.4.3"
},
"workspaces": [
"packages/core-v1",
"packages/react-v1",
"packages/ssr"
]
}
7 changes: 7 additions & 0 deletions packages/core-v1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-disable import/no-unused-modules */
export {Slice} from './lib/Slice';
export {Bite} from './lib/Bite';
export {useSystem} from './lib/System';
export {configureRoot} from './lib/configureRoot';
export type {UpdateOnType, DispatcherType} from './lib/types';
export {getTriggerAndStatus, getActionType} from './lib/utils';
Loading

0 comments on commit 645122f

Please sign in to comment.