Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Lugovkin committed Apr 5, 2022
0 parents commit 96857bf
Show file tree
Hide file tree
Showing 514 changed files with 19,460 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .docker/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
server {
listen 80;
charset utf-8;

root /usr/share/nginx/root;

location / {
add_header Cache-Control no-cache always;
}
}
13 changes: 13 additions & 0 deletions .docker/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
IFS=', ' read -r -a addr_array <<< "$SERVER_ADDRR"

for element in "${addr_array[@]}"
do
SSH_CMD="ssh -o StrictHostKeyChecking=no gitlab-runner@${element}"
$SSH_CMD docker login $CI_REGISTRY -u gitlab-ci-token -p $CI_JOB_TOKEN
$SSH_CMD docker pull $IMAGE || exit 1
$SSH_CMD docker rm -f $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME || echo nothing to remove
$SSH_CMD docker run -d --name $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME -p $DEPLOY_PORT:80 -h "\$HOSTNAME" --restart=always $IMAGE

$SSH_CMD '[ `docker images | grep kit | wc -l` -gt 15 ] && docker rmi `docker images -a -q | tail -n +10` || echo "OK"'
done
22 changes: 22 additions & 0 deletions .docker/storybook.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:12 as build

ARG UI_KIT_TYPE

RUN node --version

COPY . /opt/ui-kit
WORKDIR /opt/ui-kit

RUN echo "registry=${NpmProxyUrl}" >> .npmrc

RUN npm ci
RUN npm run init
RUN npx lerna run build --scope @city/ui-kit-core
RUN npx lerna run build-storybook --scope @city/$UI_KIT_TYPE

FROM nginx:1.18.0

ARG UI_KIT_TYPE

COPY --from=build /opt/ui-kit/packages/$UI_KIT_TYPE/storybook-static /usr/share/nginx/root/
COPY .docker/default.conf /etc/nginx/conf.d/
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "@city/eslint-config",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "ignoreRestSiblings": true }],
"@typescript-eslint/explicit-function-return-type": "warn"
}
}
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
**/node_modules
**/.pnp
.pnp.js

# testing
**/coverage

# production
**/dist
**/storybook-static

# misc
**/.vscode
**/.DS_Store
**/.env.local
**/.env.development.local
**/.env.test.local
**/.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

/.idea

**/generated
**/generated/*

.npmrc
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require("@city/prettier-config"),
};
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@city/stylelint-config-sass"]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Citymobil 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.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Monorepo for `@city/ui-kit` and `@city/ui-kit-mobile` packages

## Usage
[Desktop ui-kit docs](./packages/ui-kit/README.md)

Mobile ui-kit docs is currently unavailable

## Develop
To install dependencies run
```sh
npm run init
```

To run storybook in developer mode
```sh
npm run dev:desktop
```
or
```sh
npm run dev:mobile
```

## Disclaimer

All information and source code are provided AS-IS, without express or implied warranties.
Use of the source code or parts of it is at your sole discretion and risk.
Citymobil LLC takes reasonable measures to ensure the relevance of the information posted in this repository, but it does not assume responsibility for maintaining or updating this repository or its parts outside the framework established by the company independently and without notifying third parties.

Вся информация и исходный код предоставляются в исходном виде, без явно выраженных или подразумеваемых гарантий. Использование исходного кода или его части осуществляются исключительно по вашему усмотрению и на ваш риск. Компания ООО "Ситимобил" принимает разумные меры для обеспечения актуальности информации, размещенной в данном репозитории, но она не принимает на себя ответственности за поддержку или актуализацию данного репозитория или его частей вне рамок, устанавливаемых компанией самостоятельно и без уведомления третьих лиц.
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "5.0.0-alpha.13"
}
75 changes: 75 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"name": "root",
"private": true,
"devDependencies": {
"@city/eslint-config": "^1.10.3-alpha.1",
"@city/prettier-config": "^1.10.3-alpha.1",
"@city/stylelint-config-sass": "^1.10.3-alpha.1",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-typescript": "^8.2.1",
"@rollup/plugin-url": "^6.0.0",
"@storybook/addon-actions": "^6.2.1",
"@storybook/addon-controls": "^6.2.1",
"@storybook/addon-docs": "^6.4.14",
"@storybook/addon-knobs": "^6.2.1",
"@storybook/addon-links": "^6.2.1",
"@storybook/addon-storysource": "^6.2.1",
"@storybook/addon-toolbars": "^6.2.1",
"@storybook/addons": "^6.2.1",
"@storybook/react": "^6.4.14",
"@svgr/rollup": "^5.5.0",
"@svgr/webpack": "^5.5.0",
"@types/inquirer": "^8.2.0",
"@types/lodash.debounce": "^4.0.6",
"@types/react": "^17.0.14",
"@types/react-dom": "^17.0.9",
"@typescript-eslint/eslint-plugin": "^5.12.0",
"camelcase": "^6.3.0",
"concurrently": "^6.2.0",
"css-loader": "^5.2.7",
"eslint": "^8.9.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"fs-extra": "^10.0.0",
"lerna": "^4.0.0",
"postcss": "^8.4.6",
"postcss-import": "^14.0.2",
"prettier": "^2.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rollup": "^2.53.1",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-smart-asset": "^2.1.2",
"sass": "^1.39.0",
"sass-loader": "^10.2.0",
"storybook": "^6.2.1",
"style-loader": "^2.0.0",
"stylelint": "^14.5.0",
"typescript": "^4.5.5",
"url-loader": "^4.1.1"
},
"dependencies": {},
"scripts": {
"init": "npx lerna bootstrap --hoist --strict",
"build": "npx lerna run build --stream",
"dev:desktop": "npx lerna run storybook --scope @city/ui-kit-core --scope @city/ui-kit --parallel --stream",
"dev:mobile": "npx lerna run storybook --scope @city/ui-kit-core --scope @city/ui-kit-mobile --parallel --stream",
"build:common": "npx lerna run build --scope @city/ui-kit-core",
"build:desktop": "npm run build:common && npx lerna run build --scope @city/ui-kit",
"build:mobile": "npm run build:common && npx lerna run build --scope @city/ui-kit-mobile",
"lint": "npx lerna run lint --parallel --no-bail",
"lint:fix": "npx lerna run lint:fix --parallel --no-bail",
"stylelint": "npx lerna run stylelint --parallel --no-bail",
"stylelint:fix": "npx lerna run stylelint:fix --parallel --no-bail",
"tsc": "npx lerna run tsc --parallel --no-bail",
"lintAll": "npx lerna run lintAll --no-bail --parallel"
}
}
2 changes: 2 additions & 0 deletions packages/ui-kit-core/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
src/generated
3 changes: 3 additions & 0 deletions packages/ui-kit-core/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["../../.eslintrc.json"]
}
4 changes: 4 additions & 0 deletions packages/ui-kit-core/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["../../.stylelintrc.json"],
"ignoreFiles": ["**/generated/*"]
}
21 changes: 21 additions & 0 deletions packages/ui-kit-core/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Citymobil 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.
2 changes: 2 additions & 0 deletions packages/ui-kit-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# UNDER CONSTRUCTION

38 changes: 38 additions & 0 deletions packages/ui-kit-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"private": false,
"name": "@city/ui-kit-core",
"version": "5.0.0-alpha.13",
"description": "",
"module": "./dist/index.js",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"scripts": {
"storybook": "npm run gen-themes && rollup -c --watch",
"lint": "eslint './src/**/*.{ts,tsx}'",
"lint:fix": "eslint './src/**/*.{ts,tsx}' --fix",
"stylelint": "stylelint './src/**/*.{scss,css}'",
"stylelint:fix": "stylelint './src/**/*.{scss,css}' --fix",
"tsc": "tsc --project tsconfig.json",
"lintAll": "concurrently --kill-others-on-fail \"npm:lint\" \"npm:tsc\" \"npm:stylelint\"",
"gen-themes": "./tools/themes-generator.js",
"prebuild": "node tools/prebuild.js",
"copyFiles": "node tools/copyFiles.js",
"build": "npm run prebuild && npm run gen-themes && rollup -c && npm run copyFiles"
},
"author": "",
"license": "ISC",
"devDependencies": {
"concurrently": "^6.2.0",
"eslint": "^8.9.0",
"rollup": "^2.53.1",
"stylelint": "^14.5.0",
"typescript": "^4.5.5"
},
"peerDependencies": {
"@popperjs/core": "^2.10.1",
"classnames": "^2.3.1",
"react": "^16 || ^17",
"react-dom": "^16 || ^17",
"react-popper": "^2.2.5"
}
}
25 changes: 25 additions & 0 deletions packages/ui-kit-core/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import typescript from '@rollup/plugin-typescript'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import postcss from 'rollup-plugin-postcss'
import postcssImport from 'postcss-import'
import pkg from './package.json'

export default {
input: 'src/index.ts',
output: {
dir: 'dist',
format: 'esm',
sourcemap: false,
},
plugins: [
resolve(),
commonjs(),
typescript({ exclude: 'src/storybook/*' }),
postcss({
extract: true,
plugins: [postcssImport()],
}),
],
external: [...Object.keys(pkg.peerDependencies)],
}
5 changes: 5 additions & 0 deletions packages/ui-kit-core/src/components/Modals/ModalContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React, { FC } from 'react'

import styles from './Modals.module.scss'

export const ModalContainer: FC = ({ children }) => <div className={styles.wrapper}>{children}</div>
Loading

0 comments on commit 96857bf

Please sign in to comment.