-
-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: ImUrX <urielfontan2002@gmail.com> Co-authored-by: Uriel <imurx@proton.me>
- Loading branch information
1 parent
e8afb49
commit 73cdc89
Showing
79 changed files
with
7,485 additions
and
688 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,8 @@ | ||
VITE_FIRMWARE_TOOL_URL=https://fw-tool-api.slimevr.io | ||
VITE_FIRMWARE_TOOL_S3_URL=https://fw-tool-bucket.slimevr.io | ||
FIRMWARE_TOOL_SCHEMA_URL=https://fw-tool-api.slimevr.io/api-json | ||
|
||
|
||
# VITE_FIRMWARE_TOOL_URL=http://localhost:3000 | ||
# VITE_FIRMWARE_TOOL_S3_URL=http://localhost:9000 | ||
# FIRMWARE_TOOL_SCHEMA_URL=http://localhost:3000/api-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export default { | ||
'**/*.{ts,tsx}': () => 'tsc -p tsconfig.json --noEmit', | ||
'**/*.{js,jsx,ts,tsx}': 'eslint --max-warnings=0 --cache --fix', | ||
'src/**/*.{js,jsx,ts,tsx}': 'eslint --max-warnings=0 --no-warn-ignored --cache --fix', | ||
'**/*.{js,jsx,ts,tsx,css,md,json}': 'prettier --write', | ||
}; |
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,79 @@ | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import eslint from '@eslint/js'; | ||
import globals from 'globals'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
const compat = new FlatCompat(); | ||
|
||
export const gui = [ | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
...compat.extends('plugin:@dword-design/import-alias/recommended'), | ||
...compat.plugins('eslint-plugin-react-hooks'), | ||
// Add import-alias rule inside compat because plugin doesn't like flat configs | ||
...compat.config({ | ||
rules: { | ||
'@dword-design/import-alias/prefer-alias': [ | ||
'error', | ||
{ | ||
alias: { | ||
'@': './src/', | ||
}, | ||
}, | ||
], | ||
}, | ||
}), | ||
{ | ||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
parser: tseslint.parser, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
globals: { | ||
...globals.browser, | ||
...globals.jest, | ||
}, | ||
}, | ||
files: ['src/**/*.{js,jsx,ts,tsx,json}'], | ||
plugins: { | ||
'@typescript-eslint': tseslint.plugin, | ||
}, | ||
rules: { | ||
'react/react-in-jsx-scope': 'off', | ||
'react/prop-types': 'off', | ||
'spaced-comment': 'error', | ||
quotes: ['error', 'single'], | ||
'no-duplicate-imports': 'error', | ||
'no-inline-styles': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'react/no-unescaped-entities': 'off', | ||
camelcase: 'error', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', | ||
{ | ||
argsIgnorePattern: '^_', | ||
varsIgnorePattern: '^_', | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
typescript: {}, | ||
}, | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
}, | ||
// Global ignore | ||
{ | ||
ignores: ['**/firmware-tool-api/'], | ||
}, | ||
]; | ||
|
||
export default gui; |
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,28 @@ | ||
import { | ||
generateSchemaTypes, | ||
generateReactQueryComponents, | ||
} from '@openapi-codegen/typescript'; | ||
import { defineConfig } from '@openapi-codegen/cli'; | ||
import dotenv from 'dotenv'; | ||
|
||
dotenv.config() | ||
|
||
export default defineConfig({ | ||
firmwareTool: { | ||
from: { | ||
source: 'url', | ||
url: process.env.FIRMWARE_TOOL_SCHEMA_URL ?? 'http://localhost:3000/api-json', | ||
}, | ||
outputDir: 'src/firmware-tool-api', | ||
to: async (context) => { | ||
const filenamePrefix = 'firmwareTool'; | ||
const { schemasFiles } = await generateSchemaTypes(context, { | ||
filenamePrefix, | ||
}); | ||
await generateReactQueryComponents(context, { | ||
filenamePrefix, | ||
schemasFiles, | ||
}); | ||
}, | ||
}, | ||
}); |
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
Oops, something went wrong.