Skip to content

Commit

Permalink
Merge pull request #29 from rambler-digital-solutions/typescript
Browse files Browse the repository at this point in the history
feat: rewrite with typescript
  • Loading branch information
andrepolischuk committed Apr 15, 2024
2 parents c7ed7c0 + 905211e commit 26753c6
Show file tree
Hide file tree
Showing 64 changed files with 11,724 additions and 27,170 deletions.
6 changes: 0 additions & 6 deletions .babelrc

This file was deleted.

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"]
}
39 changes: 0 additions & 39 deletions .eslintrc

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@rambler-tech/eslint-config", "@rambler-tech/eslint-config/ts"]
}
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
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 build
- run: yarn release
env:
GITHUB_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
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
.DS_Store
node_modules
lib
*.log
npm-debug.log
yarn-error.log
coverage
.nyc_output
.vscode
dist
deploy
public
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}": ["prettier --write", "eslint --fix"],
"*.css": ["prettier --write", "stylelint --fix"],
"*.json": ["prettier --write"]
}
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

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"
7 changes: 0 additions & 7 deletions .size-limit

This file was deleted.

41 changes: 41 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
function modifyWebpackConfig(config) {
config.module.rules.push({
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1
}
},
'postcss-loader'
]
})

return config
}
module.exports = [
{
name: 'The size of the Mediator with Embed layout',
limit: '10.1 KB',
path: 'dist/index.js',
import: '{createMediator, EmbedLayout}',
modifyWebpackConfig
},
{
name: 'The size of the Mediator with Overlay layout',
limit: '10.2 KB',
path: 'dist/index.js',
import: '{createMediator, OverlayLayout}',
modifyWebpackConfig
},
{
name: 'The size of the Consumer',
limit: '7.3 KB',
path: 'dist/index.js',
import: '{registerIFrame}',
modifyWebpackConfig
}
]
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@rambler-tech/stylelint-config"]
}
Loading

0 comments on commit 26753c6

Please sign in to comment.