-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from novasamatech/tech/refactor
Remove Next.js, Yarn, Jest
- Loading branch information
Showing
262 changed files
with
25,063 additions
and
11,508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM node:lts-buster-slim | ||
|
||
WORKDIR /app | ||
COPY . . | ||
COPY .docker/entrypoint.sh /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/entrypoint.sh | ||
|
||
ARG PUBLIC_BOT_API_URL | ||
ARG PUBLIC_BOT_ADDRESS | ||
ARG PUBLIC_WEB_APP_ADDRESS | ||
ARG PUBLIC_WEB_APP_URL | ||
ARG PUBLIC_WIDGET_SECRET | ||
ARG PUBLIC_SECURE_LOCAL_STORAGE_DISABLED_KEYS | ||
|
||
RUN npm ci --no-audit | ||
RUN npm run build | ||
|
||
CMD ["entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
tab_width = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
const fs = require('node:fs'); | ||
const path = require('node:path'); | ||
|
||
const prettierConfig = fs.readFileSync('./.prettierrc', 'utf8'); | ||
const prettierOptions = JSON.parse(prettierConfig); | ||
const checkI18n = process.env.I18N === 'true'; | ||
const localesDir = './src/common/utils/locales'; | ||
const enLocalePath = path.resolve(localesDir, 'en.json'); | ||
|
||
/** | ||
* @type {import('eslint').Linter.Config} | ||
*/ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
browser: true, | ||
node: true, | ||
}, | ||
globals: { | ||
JSX: 'readonly', | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:import/recommended', | ||
'plugin:import/errors', | ||
'plugin:import/warnings', | ||
'prettier', | ||
], | ||
plugins: ['prettier', 'import'], | ||
parserOptions: { ecmaVersion: 2022 }, | ||
settings: { | ||
react: { version: 'detect' }, | ||
'import/resolver': { | ||
typescript: {}, | ||
}, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
extends: ['plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended'], | ||
rules: { | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/consistent-type-imports': [ | ||
'error', | ||
{ | ||
prefer: 'type-imports', | ||
fixStyle: 'inline-type-imports', | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.json'], | ||
plugins: ['json'], | ||
}, | ||
{ | ||
files: [`${localesDir}/*.json`], | ||
plugins: ['plugin:i18n-json/recommended'], | ||
extends: ['plugin:i18next/recommended'], | ||
rules: { | ||
'i18n-json/identical-keys': ['error', { filePath: enLocalePath }], | ||
'i18n-json/identical-placeholders': ['error', { filePath: enLocalePath }], | ||
'i18next/no-literal-string': [ | ||
checkI18n ? 'error' : 'off', | ||
{ | ||
mode: 'jsx-text-only', | ||
'should-validate-template': true, | ||
'jsx-attributes': { | ||
include: ['alt', 'aria-label', 'title', 'placeholder', 'label', 'description'], | ||
exclude: ['data-testid', 'className'], | ||
}, | ||
callees: { | ||
exclude: ['Error', 'log', 'warn'], | ||
}, | ||
words: { | ||
exclude: ['[0-9!-/:-@[-`{-~]+', '[A-Z_-]+'], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
rules: { | ||
'import/order': [ | ||
'error', | ||
{ | ||
alphabetize: { order: 'asc' }, | ||
groups: ['type', 'builtin', 'external', 'parent', ['sibling', 'index']], | ||
'newlines-between': 'always', | ||
pathGroups: [ | ||
{ group: 'external', pattern: 'react**', position: 'before' }, | ||
{ group: 'external', pattern: '@remix-run/**', position: 'before' }, | ||
{ group: 'external', pattern: '@polkadot/**', position: 'before' }, | ||
{ group: 'sibling', pattern: '@/**', position: 'before' }, | ||
], | ||
pathGroupsExcludedImportTypes: [], | ||
}, | ||
], | ||
'sort-imports': ['error', { ignoreDeclarationSort: true }], | ||
|
||
'newline-before-return': 'error', | ||
'prettier/prettier': ['error', prettierOptions], | ||
'react/no-array-index-key': 'warn', | ||
'react/display-name': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
'react/jsx-sort-props': ['error', { callbacksLast: true, noSortAlphabetically: true }], | ||
'react/function-component-definition': 'off', | ||
}, | ||
ignorePatterns: ['.vscode', '.idea', 'coverage', 'node_modules', 'package.json'], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,16 +15,16 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
run: npm ci --no-audit | ||
|
||
- name: Type checking | ||
run: npm run typecheck | ||
|
||
- name: Linting | ||
run: npm run lint | ||
|
||
- name: Run test | ||
run: yarn test | ||
|
||
- name: 📄 Post results | ||
if: always() | ||
uses: im-open/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
results-file: jest-unit-results.json | ||
report-name: 'Jest Unit tests results' | ||
create-status-check: true | ||
run: npm run test:ci | ||
|
||
- name: Post results | ||
uses: davelosert/vitest-coverage-report-action@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,22 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# IDE | ||
.idea | ||
.vscode | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
jest-unit-results.json | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
# logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
.env | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# temp files | ||
vite.config.ts.timestamp* | ||
|
||
# project directories | ||
coverage | ||
build | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npm run precommit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
version: '3' | ||
services: | ||
app: | ||
build: | ||
dockerfile: ./docker/Dockerfile | ||
build: | ||
dockerfile: .docker/Dockerfile | ||
context: . | ||
ports: | ||
- 3000:3000 | ||
volumes: | ||
- .:/app | ||
- /app/node_modules | ||
- /app/node_modules |
Oops, something went wrong.