Skip to content

Commit

Permalink
refactor: migrate package (#3)
Browse files Browse the repository at this point in the history
* refactor: migrate package

* chore(deps): bump version technology-studio-forks/markdown-embed-code@v1.1.4

* chore: upgrade checkout action to v3


---------

Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
rostislav-simonik and github-actions authored Aug 3, 2023
1 parent 654bfcb commit cdf5067
Show file tree
Hide file tree
Showing 56 changed files with 6,316 additions and 4,864 deletions.
1 change: 1 addition & 0 deletions .boilerplate-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fbb58dd35ba36ecc8dad791268120463b53a6815
6 changes: 4 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
packages/**/node_modules/**
packages/**/lib/**
commitlint.config.js
jest.config.js
lib
release.config.js
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
"txo-typescript",
"plugin:jest/recommended"
],
"parser": "@typescript-eslint/parser"
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": [
"./tsconfig.json",
"./__tests__/tsconfig.json"
]
}
}
21 changes: 21 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Code style'

on:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version-file: '.nvmrc'
- run: yarn install --frozen-lockfile
- run: yarn lint
17 changes: 17 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Ensure semantic PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release
on:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version-file: '.nvmrc'
- run: yarn install --frozen-lockfile
- run: yarn test --coverage
- uses: codecov/codecov-action@v3
- run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELASE_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SEMANTIC_RELEASE_SLACK_WEBHOOK }}
13 changes: 13 additions & 0 deletions .github/workflows/resolve-yarn-lock-caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Resolve yarn.lock

on:
issue_comment:
types: [created]

jobs:
resolve-yarn-lock-on-comment:
if: contains(github.event.comment.body, '/resolve yarn.lock')
uses: technology-studio/github-workflows/.github/workflows/resolve-yarn-lock.yml@main
with:
pr-number: ${{ github.event.issue.number }}
repo: ${{ github.repository }}
6 changes: 3 additions & 3 deletions .github/workflows/sync-code-in-readme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Embed code in README
name: Embed code in README (test)

on:
push:
Expand All @@ -12,11 +12,11 @@ jobs:
embed-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- uses: technology-studio-forks/markdown-embed-code@v1.1.0
- uses: technology-studio-forks/markdown-embed-code@v1.1.4
with:
markdown: "README.md"
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Test'

on:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version-file: '.nvmrc'
- run: yarn install --frozen-lockfile
- run: yarn test --coverage
- uses: codecov/codecov-action@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# node.js
#
node_modules/
.eslintcache
npm-debug.log
yarn-error.log
lib
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-push → .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn git-hook
yarn commitlint --edit "${1}"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn git-hook
yarn git-hook
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit || exec < /dev/tty && yarn cz --hook > /dev/null 2>&1 || true
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,jsx,ts,tsx}": "eslint --cache --format=node_modules/eslint-formatter-pretty --ext .ts,.tsx"
}
3 changes: 3 additions & 0 deletions .ncurc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dep": "dev,prod,peer"
}
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**
!/src/
!/src/**/*
!/lib/
!/lib/**/*
!/*.md
!/package.json
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/fermium
lts/*
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--runInBand", "--coverage", "false"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
}
3 changes: 2 additions & 1 deletion __tests__/Config/LogConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ configManager.update({
loggerConfigMap: {
[ConsoleLogger.LOGGER_KEY]: {
writeLog: ConsoleLogger.writeLog,
nodeEnvironmentList: ['production', 'development'],
nodeEnvironmentList: ['production', 'development', 'test'],
},
// [ReactotronLogger.LOGGER_KEY]: {
// writeLog: ReactotronLogger.writeLog,
// nodeEnvironmentList: ['development'],
// },
},
payloadProcessor: () => (payload: Record<string, unknown>) => JSON.stringify(payload, null, 2),
defaultLevelForNodeEnvironmentMap: {
production: Level.ERROR,
development: Level.INFO,
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions __tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig-base.json",
"compilerOptions": {
},
"include": [
"./**/*.ts"
]
}
File renamed without changes.
19 changes: 19 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @Author: Rostislav Simonik <rostislav.simonik@technologystudio.sk>
* @Date: 2022-08-21T12:08:59+02:00
* @Copyright: Technology Studio
**/

const automaticCommitPattern = /^chore\(release\):.*\[skip ci]/

const commitlintConfig = {
extends: [
'@commitlint/config-conventional',
],

ignores: [
commitMsg => automaticCommitPattern.test(commitMsg),
],
}

module.exports = commitlintConfig
36 changes: 36 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* @Author: Rostislav Simonik <rostislav.simonik@technologystudio.sk>
* @Date: 2021-05-15T12:05:47+02:00
* @Copyright: Technology Studio
**/

const { pathsToModuleNameMapper } = require('ts-jest')
const { compilerOptions } = require('./tsconfig.json');

const { defaults } = require('jest-config');

module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: [
'<rootDir>/__tests__/Tests/**/?(*.)(spec|test).ts'
],
transformIgnorePatterns: [
'/node_modules/(?!@txo).+\\.js$'
],
testPathIgnorePatterns: [
'/node_modules/'
],
setupFiles: [
'<rootDir>/__tests__/Setup.ts'
],
moduleFileExtensions: [
...defaults.moduleFileExtensions,
],
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: './tsconfig.json'
}]
},
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths , { prefix: '<rootDir>/' } ),
}
Loading

0 comments on commit cdf5067

Please sign in to comment.