Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: packasso #562

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
if: ${{ steps.check-artifact.outputs.exists == 'false' }}
run: |
yarn build
yarn build:rsg
tar -cvf artifact.tar package.json packages/*/target

- name: Save artifact
Expand Down Expand Up @@ -206,7 +207,9 @@ jobs:

- name: Visual tests
if: matrix.node-version == '16'
run: yarn test
run: |
yarn test
yarn test:rsg

- name: Save failure results
if: ${{ failure() }}
Expand Down
46 changes: 24 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
/.idea
/*.iml
/*.log
/node_modules
/packages/*/node_modules
/packages/*/target
# misc

.DS_Store
/.idea

# Yarn berry
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# yarn

# Creds
*.asc
*.key
/.pnp.*
/.yarn/cache
/.yarn/unplugged
/.yarn/install-state.gz
/yarn-error.log

# open-ssl

*.ca
*.crt
*.csr
*.der
*.kdb
*.org
*.p12
*.pem
*.cert
*.rnd
*.ssleay
*.smime

# npm creds
**/.npmrc
**/.yarnrc
**/.pnpmrc
/node_modules
/target
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ enableTelemetry: false

enableGlobalCache: true

enableMessageNames: false

nmSelfReferences: false

nodeLinker: node-modules
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 QIWI
Copyright (c) 2023 QIWI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 14 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"collectCoverage": true,
"collectCoverageFrom": [
"<rootDir>/src/main/[jt]s/**/*.[jt]s?(x)"
],
"coverageDirectory": "<rootDir>/target/coverage",
"coveragePathIgnorePatterns": [
"<rootDir>/node_modules",
"<rootDir>/target"
],
"projects": [
"<rootDir>/packages/desktop-extra/jest.config.json"
]
}
34 changes: 26 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
"packages/*"
],
"scripts": {
"clean": "yarn workspaces foreach --parallel --no-private --interlaced run clean",
"build": "yarn workspaces foreach --parallel --topological-dev --no-private --interlaced run build",
"start": "yarn workspaces foreach --parallel --no-private --interlaced run start",
"test": "yarn workspaces foreach --parallel --no-private --interlaced run test",
"format": "yarn workspaces foreach --parallel --no-private --interlaced run format",
"lint": "yarn workspaces foreach --parallel --no-private --interlaced run lint"
"start:rsg": "yarn workspaces foreach -vip run start:rst",
"build:rsg": "yarn workspaces foreach -vip run build:rsg",
"test:rsg": "yarn workspaces foreach -vip run test:rsg",
"build": "packasso build",
"lint": "packasso lint",
"format": "packasso format",
"test": "packasso test"
},
"resolutions": {
"@types/react": "18.0.18",
Expand All @@ -25,10 +26,27 @@
"type": "git",
"url": "git+https://github.com/qiwi/pijma.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/qiwi/pijma/issues"
},
"homepage": "https://github.com/qiwi/pijma/#readme",
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"devDependencies": {
"@packasso/cli": "0.16.1",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.37",
"@swc/jest": "0.2.24",
"@types/jest": "29.4.0",
"eslint": "8.35.0",
"eslint-config-qiwi": "2.0.9",
"globby-cp": "1.1.3",
"jest": "29.4.3",
"jest-environment-jsdom": "29.4.3",
"prettier": "2.8.4",
"prettier-config-qiwi": "2.0.1",
"rimraf": "4.2.0",
"tsc-esm-fix": "2.20.12",
"typescript": "4.9.5"
},
"license": "MIT"
}
1 change: 0 additions & 1 deletion packages/core/.eslintrc.cjs

This file was deleted.

27 changes: 27 additions & 0 deletions packages/core/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"rules": {
"no-constant-condition": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"react/no-children-prop": "off",
"react/no-find-dom-node": "off",
"sonarjs/cognitive-complexity": "off",
"sonarjs/no-duplicate-string": "off",
"unicorn/no-negated-condition": "off",
"unicorn/no-new-array": "off",
"unicorn/prefer-add-event-listener": "off",
"unicorn/prefer-dom-node-append": "off",
"unicorn/prefer-dom-node-remove": "off",
"unicorn/prefer-logical-operator-over-ternary": "off",
"unicorn/prefer-number-properties": "off",
"unicorn/prefer-optional-catch-binding": "off",
"unicorn/prefer-regexp-test": "off",
"unicorn/prefer-set-has": "off",
"unicorn/prefer-spread": "off",
"unicorn/prefer-string-slice": "off"
},
"extends": "eslint-config-qiwi"
}
2 changes: 2 additions & 0 deletions packages/core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/target
1 change: 0 additions & 1 deletion packages/core/.prettierrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions packages/core/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"prettier-config-qiwi"
4 changes: 0 additions & 4 deletions packages/core/.releaserc.cjs

This file was deleted.

4 changes: 4 additions & 0 deletions packages/core/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"cmd": "yarn",
"changelog": "changelog"
}
21 changes: 21 additions & 0 deletions packages/core/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 QIWI

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.
92 changes: 54 additions & 38 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,13 @@
{
"name": "@qiwi/pijma-core",
"version": "0.0.0",
"type": "module",
"main": "./target/es5/index.js",
"module": "./target/es6/index.js",
"types": "./target/dts/index.d.ts",
"exports": {
".": {
"types": "./target/dts/index.d.ts",
"import": "./target/es6/index.js",
"require": "./target/es5/index.js"
}
},
"license": "MIT",
"publishConfig": {
"access": "public"
},
"scripts": {
"clean": "rimraf target node_modules",
"build": "concurrently 'npm:build:*'",
"build:es5": "cd src/main && swc ts -d ../../target/es5 --config-file ../../swc.es5.json && cd ../.. && tsc-esm-fix --target=target/es5 --fillBlank",
"build:es6": "cd src/main && swc ts -d ../../target/es6 --config-file ../../swc.es6.json && cd ../.. && tsc-esm-fix --target=target/es6 --fillBlank",
"build:dts": "tsc --project tsconfig.dts.json",
"format": "eslint --fix src && prettier --loglevel silent --write src",
"lint": "eslint src"
},
"files": [
"target/dts/**/*",
"target/es5/**/*",
"target/es6/**/*"
"packasso": [
"@packasso/dev-ts",
"@packasso/dev-license",
"@packasso/build-ts-swc",
"@packasso/style-eslint",
"@packasso/style-prettier",
"@packasso/release-zx-semrel"
],
"dependencies": {
"@emotion/core": "^11.0.0",
Expand All @@ -55,24 +34,35 @@
"react-dom": ">=16.14.0"
},
"devDependencies": {
"@packasso/build-ts-swc": "0.17.2",
"@packasso/cli": "0.16.1",
"@packasso/dev-license": "0.10.1",
"@packasso/dev-ts": "0.17.1",
"@packasso/release-zx-semrel": "0.16.1",
"@packasso/style-eslint": "0.1.1",
"@packasso/style-prettier": "0.1.1",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.37",
"@swc/helpers": "0.4.14",
"@types/react": "18.0.18",
"@types/react-dom": "18.0.6",
"concurrently": "7.4.0",
"concurrently": "7.6.0",
"css-loader": "6.7.1",
"eslint": "8.23.0",
"eslint-config-qiwi": "1.17.6",
"fast-glob": "3.2.11",
"eslint": "8.35.0",
"eslint-config-qiwi": "2.0.9",
"file-loader": "6.2.0",
"prettier": "2.7.1",
"prettier-config-qiwi": "1.7.2",
"globby-cp": "1.1.3",
"prettier": "2.8.4",
"prettier-config-qiwi": "2.0.1",
"react": "18.2.0",
"react-docgen-typescript": "patch:react-docgen-typescript@npm%3A2.2.2#~/.yarn/patches/react-docgen-typescript-npm-2.2.2-afb9698a32.patch",
"react-dom": "18.2.0",
"react-styleguidist": "12.0.0",
"rimraf": "4.2.0",
"style-loader": "3.3.1",
"tsc-esm-fix": "2.20.4",
"typescript": "4.8.2",
"webpack": "5.74.0"
"tsc-esm-fix": "2.20.12",
"typescript": "4.9.5",
"webpack": "5.75.0"
},
"repository": {
"type": "git",
Expand All @@ -81,5 +71,31 @@
"bugs": {
"url": "https://github.com/qiwi/pijma/issues"
},
"homepage": "https://github.com/qiwi/pijma/#readme"
"homepage": "https://github.com/qiwi/pijma/#readme",
"scripts": {
"build": "packasso build",
"lint": "packasso lint",
"format": "packasso format"
},
"license": "MIT",
"type": "module",
"main": "./target/cjs/index.cjs",
"module": "./target/esm/index.mjs",
"types": "./target/dts/index.d.ts",
"exports": {
".": {
"require": "./target/cjs/index.cjs",
"import": "./target/esm/index.mjs",
"types": "./target/dts/index.d.ts"
},
"./package.json": "./package.json"
},
"files": [
"target/cjs/**/*",
"target/esm/**/*",
"target/dts/**/*"
],
"publishConfig": {
"access": "public"
}
}
6 changes: 4 additions & 2 deletions packages/core/src/main/ts/code-field/CodeFieldControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,24 @@ export class CodeFieldControl extends Component<
private onFieldKeyDown: (index: number) => KeyboardEventHandler =
(index) => (e) => {
switch (e.key) {
case 'ArrowLeft':
case 'ArrowLeft': {
e.preventDefault()
const prev = this.state.refs[index - 1]
if (prev && prev.current) {
this.preventBlur = true
prev.current.focus()
}
break
case 'ArrowRight':
}
case 'ArrowRight': {
e.preventDefault()
const next = this.state.refs[index + 1]
if (next && next.current) {
this.preventBlur = true
next.current.focus()
}
break
}
case 'Backspace':
if (this.props.value[index] === '') {
const prev = this.state.refs[index - 1]
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/main/ts/input/ContentInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export const ContentInput = forwardRef<HTMLInputElement, ContentInputProps>(
pl: props.pl ? props.pl : 4,
py: 3,
r: `${props.nort || props.norl ? '0' : '10px'} ${
props.nort || props.norr ? '0' : '10px'} ${
props.norb || props.norr ? '0' : '10px'} ${
props.nort || props.norr ? '0' : '10px'
} ${props.norb || props.norr ? '0' : '10px'} ${
props.norb || props.norl ? '0' : '10px'
}`,
b: 'none',
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/main/ts/inview.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import { InView } from 'react-intersection-observer'

export { InView }
export { InView } from 'react-intersection-observer'
4 changes: 1 addition & 3 deletions packages/core/src/main/ts/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import MarkdownToJSX from 'markdown-to-jsx'

export { MarkdownToJSX }
export { default as MarkdownToJSX } from 'markdown-to-jsx'
Loading