Skip to content

Commit

Permalink
Merge pull request #2348 from ideafast/develop
Browse files Browse the repository at this point in the history
v2.6.0
  • Loading branch information
wsy19961129 authored Jun 11, 2024
2 parents 1a45dd7 + 786029f commit eceec7d
Show file tree
Hide file tree
Showing 266 changed files with 11,976 additions and 35,264 deletions.
34 changes: 34 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const { utils: { getProjects } } = require('@commitlint/config-nx-scopes');

module.exports = {
extends: [
'@commitlint/config-conventional',
'@commitlint/config-nx-scopes'
],
rules: {
'scope-enum': async (ctx) => {
const projectFilter = ({ name }) =>
!name.includes('e2e');
const projectNames = new Set();
(await getProjects(ctx, projectFilter))
.forEach(element => {
projectNames.add(element);
projectNames.add(element.replaceAll('itmat-', ''));
});
return [
2,
'always',
[
...projectNames
]
];
},
'subject-case': [
2,
'always',
[
'sentence-case'
]
]
}
};
10 changes: 7 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@

# Editor configuration, see http://editorconfig.org
root = true

[*.{js,ts,jsx,tsx,json}]
[*]
charset = utf-8
indent_size = 4
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[.yml]
indent_size = 2

[*.md]
max_line_length = off
trim_trailing_whitespace = false
54 changes: 42 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,25 @@ const javascriptRules = {
const typescriptRules = {
...javascriptRules,
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { args: 'after-used', varsIgnorePattern: '^__unused' }],
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-explicit-any': 'warn'
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ args: 'after-used', varsIgnorePattern: '^__unused' }
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/no-misused-promises': 'error'
};

module.exports = {
root: true,
env: { es6: true },
parserOptions: {
ecmaVersion: 2022,
tsconfigRootDir: __dirname,
EXPERIMENTAL_useProjectService: true,
warnOnUnsupportedTypeScriptVersion: false,
project: [
'./tsconfig.eslint.json',
'./packages/*-e2e/tsconfig.json',
Expand All @@ -55,28 +65,48 @@ module.exports = {
]
},
ignorePatterns: ['**/*', '!**/*.json', '!**/*.js', '!**/*.ts', '!scripts', '!tools', '!.vscode'],
plugins: ['@nx', 'json', 'import'],
plugins: ['@nx'],
overrides: [
{
files: ['*.ts', '*.tsx'],
files: ['*.ts', '*.tsx', '*.mts'],
extends: ['plugin:@nx/typescript'],
rules: typescriptRules,
parserOptions: {
project: [
'./tsconfig.eslint.json'
]
}
},
{
files: ['*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx'],
extends: ['plugin:@nx/typescript'],
rules: typescriptRules
rules: {
...typescriptRules,
'@typescript-eslint/no-explicit-any': 'warn'
},
parserOptions: {
project: [
'./tsconfig.eslint.json'
]
}
},
{
files: ['*.js', '*.jsx'],
extends: ['plugin:@nx/javascript'],
rules: javascriptRules
},
{
files: ['*.spec.ts', '*.spec.tsx', '*.spec.js', '*.spec.jsx'],
env: {
jest: true
},
rules: {}
files: ['*.mjs'],
extends: ['plugin:@nx/javascript'],
rules: javascriptRules,
parserOptions: {
sourceType: 'module'
}
},
{
files: ['*.json'],
extends: ['plugin:json/recommended'],
parser: 'jsonc-eslint-parser',
extends: ['plugin:jsonc/recommended-with-json'],
rules: jsonRules
}
]
Expand Down
6 changes: 3 additions & 3 deletions .gitguardian.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
paths-ignore:
- "**/*.test.*"
- "**/*.sample.json"
paths-ignore:
- "**/*.test.*"
- "**/*.sample.json"
44 changes: 22 additions & 22 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
target-branch: "develop"
labels:
- "dependencies"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "develop"
labels:
- "actions"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
target-branch: "develop"
labels:
- "docker"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
target-branch: "develop"
labels:
- "dependencies"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "develop"
labels:
- "actions"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
target-branch: "develop"
labels:
- "docker"
180 changes: 90 additions & 90 deletions .github/workflows/99_ci.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
name: Test and Build CI

on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [20.x]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: master
error-on-no-successful-workflow: true

- run: |
echo "Nx base: ${{ env.NX_BASE }}"
echo "Git head: ${{ env.NX_HEAD }}"
- name: Using Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: yarn

- name: Disable TCP/UDP Offloading
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo ethtool -K eth0 tx off rx off
exit 0
elif [ "$RUNNER_OS" == "macOS" ]; then
sudo sysctl -w net.link.generic.system.hwcksum_tx=0
sudo sysctl -w net.link.generic.system.hwcksum_rx=0
exit 0
else
echo "$RUNNER_OS not supported"
exit 0
fi
- name: Installing dependencies
run: |
yarn install --network-timeout 1000000 --forzen-lockfile
- name: Checking for lint
run: |
yarn run nx affected --target=lint --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
- name: Building packages
run: |
yarn run nx affected --target=build --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --parallel=1
- name: Running unit tests
run: |
yarn run nx affected --target=test --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --parallel=1
env:
CI: true

# email_test:
# runs-on: itmat
# strategy:
# matrix:
# node: [10.x, 12.x]
# steps:
# - uses: actions/checkout@v1
# - name: Using Node.js ${{ matrix.node }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node }}
# - name: Installing dependencies
# run: yarn install
# - name: Checking for lint
# run: yarn run lint
# - name: Building packages
# run: yarn run build
# - name: Running unit tests
# run: yarn run test
# env:
# CI: true
# TEST_SMTP_CRED: ${{ secrets.TEST_SMTP_CRED }}
# TEST_SMTP_USERNAME: ${{ secrets.TEST_SMTP_USERNAME }}
# TEST_RECEIVER_EMAIL_ADDR: ${{ secrets.TEST_RECEIVER_EMAIL_ADDR }}
name: Test and Build CI

on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [20.x]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: master
error-on-no-successful-workflow: true

- run: |
echo "Nx base: ${{ env.NX_BASE }}"
echo "Git head: ${{ env.NX_HEAD }}"
- name: Using Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: yarn

- name: Disable TCP/UDP Offloading
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo ethtool -K eth0 tx off rx off
exit 0
elif [ "$RUNNER_OS" == "macOS" ]; then
sudo sysctl -w net.link.generic.system.hwcksum_tx=0
sudo sysctl -w net.link.generic.system.hwcksum_rx=0
exit 0
else
echo "$RUNNER_OS not supported"
exit 0
fi
- name: Installing dependencies
run: |
yarn install --network-timeout 1000000 --forzen-lockfile
- name: Checking for lint
run: |
yarn run nx affected --target=lint --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
- name: Building packages
run: |
yarn run nx affected --target=build --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --parallel=1
- name: Running unit tests
run: |
yarn run nx affected --target=test --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --parallel=1
env:
CI: true

# email_test:
# runs-on: itmat
# strategy:
# matrix:
# node: [10.x, 12.x]
# steps:
# - uses: actions/checkout@v1
# - name: Using Node.js ${{ matrix.node }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node }}
# - name: Installing dependencies
# run: yarn install
# - name: Checking for lint
# run: yarn run lint
# - name: Building packages
# run: yarn run build
# - name: Running unit tests
# run: yarn run test
# env:
# CI: true
# TEST_SMTP_CRED: ${{ secrets.TEST_SMTP_CRED }}
# TEST_SMTP_USERNAME: ${{ secrets.TEST_SMTP_USERNAME }}
# TEST_RECEIVER_EMAIL_ADDR: ${{ secrets.TEST_RECEIVER_EMAIL_ADDR }}
Loading

0 comments on commit eceec7d

Please sign in to comment.