Skip to content

Commit

Permalink
refactor: wallet management in features, changes in build system (#2924)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthecat authored Jan 8, 2025
1 parent 6c7a7dd commit 7be1dd0
Show file tree
Hide file tree
Showing 303 changed files with 12,265 additions and 16,839 deletions.
37 changes: 20 additions & 17 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,14 @@ module.exports = {
browser: true,
es6: true,
},
extends: [
'eslint:recommended',
'plugin:import-x/recommended',
'plugin:import-x/errors',
'plugin:import-x/warnings',
'plugin:prettier/recommended',
],
extends: ['eslint:recommended', 'plugin:import-x/recommended', 'plugin:import-x/errors', 'plugin:import-x/warnings'],
plugins: ['prettier', 'import-x', 'unused-imports'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2022,
},
rules: {
'prettier/prettier': 'error',
'sort-imports': ['error', { ignoreDeclarationSort: true }],
// For debugging purpose, too slow for every day usage
// 'import-x/no-cycle': ['error', { maxDepth: Number.Infinity }],
Expand All @@ -43,16 +38,24 @@ module.exports = {
{
alphabetize: { order: 'asc', orderImportKind: 'asc' },
groups: ['builtin', 'external', 'parent', ['sibling', 'index']],
pathGroups: boundaryTypes.map((type) => ({
group: 'parent',
pattern: `@/${type}/**`,
position: 'before',
})),
pathGroups: [
...boundaryTypes.map((type) => ({
group: 'parent',
pattern: `@/${type}/**`,
position: 'before',
})),
{
group: 'external',
pattern: '~config',
position: 'before',
},
],
'newlines-between': 'always',
distinctGroup: false,
},
],

'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'error',
Expand All @@ -66,7 +69,6 @@ module.exports = {

'no-irregular-whitespace': 'off',
'newline-before-return': 'error',
'prettier/prettier': 'error',

'no-restricted-properties': [
'error',
Expand All @@ -83,7 +85,7 @@ module.exports = {
extends: ['plugin:json/recommended'],
},
{
files: ['*.js'],
files: ['*.js', '*.mjs', '*.cjs'],
env: {
node: true,
},
Expand All @@ -97,15 +99,16 @@ module.exports = {
},
},
{
files: ['*.test.ts', '*.test.tsx', 'jest*.js'],
plugins: ['jest-dom'],
extends: ['plugin:jest-dom/recommended'],
files: ['*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx'],
rules: {
'no-restricted-properties': 'off',
},
env: {
jest: true,
},
globals: {
vi: true,
},
},
{
files: ['*.tsx'],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
pnpm stage:sequence
pnpm staging:sequence
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -185,5 +185,5 @@ jobs:
- <b>Linux:</b> ${{ steps.interact_with_storage.outputs.linux_app }}
- <b>MacOS:</b> ${{ steps.interact_with_storage.outputs.macos_app }}
- <b>MacOS_arm:</b> ${{ steps.interact_with_storage.outputs.macos_64_app }}
<b>Stage web:</b> https://spektr-stg.novasama-tech.org/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run unit tests
name: Unit tests

on:
pull_request:
Expand Down Expand Up @@ -27,9 +27,9 @@ jobs:

- name: 📄 Post results
if: always()
uses: im-open/process-jest-test-results@v2.0.6
uses: EnricoMi/publish-unit-test-result-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
results-file: jest-unit-results.json
report-name: 'Jest Unit tests results'
create-status-check: true
files: ./junit.xml
check_name: 'Unit Test Results'
comment_mode: 'changes'
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/install-pnpm/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 22
node-version: 21

- name: ⚙️ Install dependencies
run: pnpm install
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/integration-test/action.yaml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/integration_test_runner.yaml

This file was deleted.

22 changes: 12 additions & 10 deletions .github/workflows/system_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ on:
schedule:
- cron: '0 6 * * *' # 9:00 GMT+3
pull_request:
branches:
- 'test/**'
paths:
- 'tests/**'
- 'tests/system/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -50,32 +52,32 @@ jobs:
PLAYWRIGHT_VERSION=$(node -e "console.log(require('yaml').parse(require('fs').readFileSync('./pnpm-lock.yaml', 'utf8')).importers['.'].devDependencies['@playwright/test'].version)")
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- run: npx playwright install --with-deps
- run: pnpx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Install allurectl
uses: allure-framework/setup-allurectl@v1

- name: Run Playwright tests
if: github.event_name != 'schedule'
run: allurectl watch -- npx playwright test --grep @regress
run: allurectl watch -- pnpx playwright test --grep @regress

- name: Run Playwright tests for schedule event
if: github.event_name == 'schedule'
run: allurectl watch -- npx playwright test --grep @fee-test
run: allurectl watch -- pnpx playwright test --grep @fee-test

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/

publish_report:
name: Publish HTML Report
if: success() || needs.system-tests.result == 'failure'
Expand Down Expand Up @@ -108,14 +110,14 @@ jobs:
run: |
git add .
git commit -m "workflow: add HTML report for run-id ${{ github.run_id }} (attempt: ${{ github.run_attempt }})"
while true; do
git pull --rebase
if [ $? -ne 0 ]; then
echo "Failed to rebase. Please review manually."
exit 1
fi
git push
if [ $? -eq 0 ]; then
echo "Successfully pushed HTML report to repo."
Expand All @@ -125,7 +127,7 @@ jobs:
- name: Output Report URL as Worfklow Annotation
run: |
FULL_HTML_REPORT_URL=https://novasamatech.github.io/spektr-reports/$HTML_REPORT_URL_PATH
echo "::notice title=📋 Published Playwright Test Report::$FULL_HTML_REPORT_URL"
echo "FULL_HTML_REPORT_URL<<EOF" >> $GITHUB_ENV
echo "$FULL_HTML_REPORT_URL" >> $GITHUB_ENV
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.pnp.js

# testing
/.coverage
/coverage
coverage.txt
junit.xml
Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"*.{ts,tsx}": "pnpm types:files globals.d.ts src/main/shared/bridge.ts",
"*.{ts,tsx}": "pnpm types:files globals.d.ts vite-env.d.ts src/main/shared/bridge.ts",
"*.{js,ts,tsx}": "pnpm lint:generic"
}
Loading

0 comments on commit 7be1dd0

Please sign in to comment.