Skip to content

Commit

Permalink
Merge 0a0f0d6 into 1c146ae
Browse files Browse the repository at this point in the history
  • Loading branch information
milosbugarinovic committed Apr 6, 2024
2 parents 1c146ae + 0a0f0d6 commit 14f79f2
Show file tree
Hide file tree
Showing 193 changed files with 22,309 additions and 15,772 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
/!.idea/runConfigurations
/.base-frame-tmp
/coverage
/dist
/lib
/node_modules
/packages
/test/node_modules
/test/dist
*.tsbuildinfo
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ ij_typescript_enforce_trailing_comma = whenmultiline
ij_typescript_use_double_quotes = false
ij_typescript_use_semicolon_after_statement = false
ij_typescript_spaces_within_imports = true

7 changes: 6 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
/.idea
/.semaphore
/coverage
/dist
/lib
/node_modules
/resource
/packages
.*.js
/jest*.config.js
.*.json
package-lock.json
tsconfig*.json
typedoc.json
jest.config*.ts
38 changes: 19 additions & 19 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const namingConvention = () => {
// prettier-ignore
return [
{ selector: ['default'], format: null, modifiers: ['public'], leadingUnderscore: 'forbid' },
{ selector: ['default'], format: ['camelCase'], modifiers: ['protected'], leadingUnderscore: 'require' },
{ selector: ['default'], format: ['camelCase'], modifiers: ['private'], prefix: ['__'] },
{ selector: ['default'], format: null, modifiers: ['public'], leadingUnderscore: 'forbid' },
{ selector: ['default'], format: ['camelCase'], modifiers: ['protected'], leadingUnderscore: 'require' },
{ selector: ['default'], format: ['camelCase'], modifiers: ['private'], prefix: ['__'] },
{ selector: ['accessor'], format: ['camelCase'], modifiers: ['public'], leadingUnderscore: 'forbid' },
{ selector: ['accessor'], format: ['camelCase'], modifiers: ['protected'], leadingUnderscore: 'require' },
{ selector: ['accessor'], format: ['camelCase'], modifiers: ['private'], prefix: ['__'] },
{ selector: ['enum'], format: ['PascalCase'] },
{ selector: ['enumMember'], format: ['UPPER_CASE'] },
{ selector: ['enum'], format: ['PascalCase'] },
{ selector: ['enumMember'], format: ['UPPER_CASE'] },
{ selector: ['classMethod', 'accessor'], format: ['PascalCase'], modifiers: ['public', 'static'] },
{ selector: ['classProperty'], format: ['UPPER_CASE'], modifiers: ['public', 'static'] },
]
]
}

module.exports = {
Expand Down Expand Up @@ -41,24 +41,24 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'ESNext',
project: './tsconfig-eslint.json',
project: './resource/tsconfig/eslint.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'eslint-plugin-import', 'import', 'no-only-tests', 'no-loops', 'jest', 'sort-keys-fix'],
rules: {
// ESLINT
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['**/index'],
message: 'Please use `.../something` instead of ``.../something/index`',
},
],
},
],

// 'no-restricted-imports': [
// 'error',
// {
// patterns: [
// {
// group: ['**/index'],
// message: 'Please use `.../something` instead of ``.../something/index`',
// },
// ],
// },
// ],
'@typescript-eslint/prefer-ts-expect-error': 'off',
'prefer-arrow-callback': 'error',
'no-confusing-arrow': 'error',
'no-constant-condition': 'error',
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set Node.js version
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV
- name: Install Node.js
uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
node-version-file: .nvmrc
cache: "npm"
- run: npm ci
- run: npm run lint
- run: npm run test
- run: npm run test:unit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
/!.idea/runConfigurations
/.base-frame-tmp
/coverage
/dist
/lib
/node_modules
/packages
/test/node_modules
/test/dist
*.tsbuildinfo
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
. "$(dirname "$0")/_/husky.sh"

npx --no-install 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
#!/bin/bash
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
5 changes: 4 additions & 1 deletion .ncurc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"reject": ["typescript"]
"reject": [
"semantic-release",
"date-fns"
]
}
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.15.0
v20.11.1
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.idea
/.semaphore
/coverage
/dist
/lib
/node_modules
/resource
Expand Down
7 changes: 6 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
[
"@semantic-release/git",
{
"assets": ["lib/", "package.json", "package-lock.json", "CHANGELOG.md"],
"assets": [
"dist/",
"package.json",
"package-lock.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
Expand Down
4 changes: 2 additions & 2 deletions .semaphore/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ blocks:
- git remote rm origin
- git remote add origin https://$GH_USER:$GH_TOKEN@github.com/beecode-rs/msh-util.git
- git checkout tags/v$VERSION -b tmp-alpha-branch
- docker build -f .docker/Dockerfile -t bc-msh-util-deploy .
- docker run --rm -e CI bc-msh-util-deploy sh -c "npm config set '//registry.npmjs.org/:_authToken' $NPM_TOKEN && npm run bump-version $VERSION-alpha && npm publish --access public -tag alpha && git tag v$VERSION-alpha && git push origin --tags"
- docker build -f ./resource/docker/Dockerfile -t bc-msh-util-deploy .
- docker run --rm -e CI bc-msh-util-deploy sh -c "npm config set '//registry.npmjs.org/:_authToken' $NPM_TOKEN && npm run npm-bump-version $VERSION-alpha && npm publish --access public -tag alpha && git tag v$VERSION-alpha && git push origin --tags"
skip:
when: branch != 'main'
2 changes: 1 addition & 1 deletion .semaphore/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ blocks:
- git remote rm origin
- git remote add origin https://$GH_USER:$GH_TOKEN@github.com/beecode-rs/msh-util.git
- git checkout tags/v$VERSION -b tmp-prod-branch
- docker build -f .docker/Dockerfile -t bc-msh-util-deploy .
- docker build -f ./resource/docker/Dockerfile -t bc-msh-util-deploy .
- docker run --rm -e CI bc-msh-util-deploy sh -c "npm config set '//registry.npmjs.org/:_authToken' $NPM_TOKEN && npm publish --access public && git tag v$VERSION-prod && git push origin --tags"
skip:
when: branch != 'main'
6 changes: 3 additions & 3 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ blocks:
commands:
- checkout
- echo $DOCKER_PASSWORD | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker build -f .docker/Dockerfile -t bc-msh-util .
- docker build -f ./resource/docker/Dockerfile -t bc-msh-util .
- docker save -o bc-msh-util.tar bc-msh-util
- cache store bc-msh-util-docker-image-$SEMAPHORE_GIT_SHA bc-msh-util.tar

Expand All @@ -29,7 +29,7 @@ blocks:
- checkout
- cache restore bc-msh-util-docker-image-$SEMAPHORE_GIT_SHA
- docker load -i bc-msh-util.tar
- docker run --rm -e CODECOV_TOKEN bc-msh-util sh -c 'npm run test:unit:coverage && npm run test:unit:coverage:publish'
- docker run --rm -e CODECOV_TOKEN bc-msh-util sh -c 'npm run test-coverage-unit && npm run test-coverage-unit-publish'

- name: Bump Version
task:
Expand All @@ -43,7 +43,7 @@ blocks:
- docker load -i bc-msh-util.tar
- touch version.txt
- sudo chown -R packer:packer version.txt
- docker run --rm -v ./version.txt:/usr/app/version.txt -e GH_TOKEN -e NPM_TOKEN -e GH_USER -e CI bc-msh-util npm run semantic-release
- docker run --rm -v ./version.txt:/usr/app/version.txt -e GH_TOKEN -e NPM_TOKEN -e GH_USER -e CI bc-msh-util npm run npm-semantic-release
- cat version.txt
- cache store bc-msh-util-version-$SEMAPHORE_GIT_SHA version.txt
skip:
Expand Down
29 changes: 29 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const tsConfig = require('./resource/tsconfig/esm.json')

module.exports = function (api) {
api.cache(true)

const ignore = ['node_modules', ...(tsConfig.exclude ?? [])]
const plugins = [
[
'@babel/plugin-transform-modules-commonjs',
{
strictMode: true,
},
],
[
'@babel/plugin-proposal-decorators',
{
version: '2023-11',
},
],
]

const presets = ['@babel/preset-env', '@babel/preset-typescript']

return {
plugins,
presets,
ignore
}
}
6 changes: 0 additions & 6 deletions jest-int.config.js

This file was deleted.

6 changes: 0 additions & 6 deletions jest-unit.config.js

This file was deleted.

10 changes: 10 additions & 0 deletions jest.config.int.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @ts-expect-error
import sharedConfig from './jest.config.ts'
import type { JestConfigWithTsJest } from 'ts-jest'

const jestConfig: JestConfigWithTsJest = {
...sharedConfig,
testMatch: ['**/__tests__/*.(spec|test).[jt]s?(x)'],
}

export default jestConfig
16 changes: 0 additions & 16 deletions jest.config.js

This file was deleted.

18 changes: 18 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { JestConfigWithTsJest } from 'ts-jest'

const jestConfig: JestConfigWithTsJest = {
clearMocks: true,
maxConcurrency: 1,
moduleNameMapper: {
'^#src$': '<rootDir>/src',
'^#src/(.*)$': '<rootDir>/src/$1',
},
preset: 'ts-jest/presets/default-esm',
setupFilesAfterEnv: ['jest-extended/all', '<rootDir>/src/__tests__/index-jest-setup.ts'],
testEnvironment: 'node',
testMatch: ['<rootDir>/src/**/*.(spec|test).[jt]s?(x)'],
testPathIgnorePatterns: ['/node_modules/'],
transform: {},
}

export default jestConfig
10 changes: 10 additions & 0 deletions jest.config.unit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @ts-expect-error
import sharedConfig from './jest.config'
import type { JestConfigWithTsJest } from 'ts-jest'

const jestConfig: JestConfigWithTsJest = {
...sharedConfig,
testPathIgnorePatterns: [...(sharedConfig.testPathIgnorePatterns ?? []), '/__tests__/'],
}

export default jestConfig
3 changes: 3 additions & 0 deletions lib.util.iml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/coverage" />
<excludeFolder url="file://$MODULE_DIR$/lib" />
<excludeFolder url="file://$MODULE_DIR$/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/packages" />
<excludeFolder url="file://$MODULE_DIR$/.husky/_" />
<excludeFolder url="file://$MODULE_DIR$/dist" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
Expand Down
23 changes: 0 additions & 23 deletions lib/array-util.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion lib/array-util.d.ts.map

This file was deleted.

30 changes: 0 additions & 30 deletions lib/array-util.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/array-util.js.map

This file was deleted.

0 comments on commit 14f79f2

Please sign in to comment.