Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: Feat/refactor #1

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
508 changes: 507 additions & 1 deletion .editorconfig

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run type-check
- run: npm test
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"printWidth": 150,
"trailingComma": "none"
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ Each requests requires its own class:
import { BaseRequest, type ResponseContract, JsonResponse } from '@hank-it/ui/service/requests'

export class GetCustomersRequest extends BaseRequest {
method(): string {
public method(): string {
return 'GET'
}

url(): string {
public url(): string {
return '/api/v1/customers'
}

protected getResponse() {
public getResponse() {
return new JsonResponse
}
}
Expand Down Expand Up @@ -143,7 +143,7 @@ new GetCustomersRequest()
#### Posting json data
``` typescript
// This is the json content for the request
const content = new JsonContent({
const content = new JsonBody({
email: "username",
password: "password",
})
Expand All @@ -165,7 +165,7 @@ export interface AuthPayload {
password: string,
}

export class AuthJsonContent extends JsonContent {
export class AuthJsonContent extends JsonBody {
public constructor(protected data: AuthPayload) {}
}

Expand Down Expand Up @@ -203,7 +203,7 @@ You may use any request to upload files:
const file = ref()

function submit() {
const content = new FormDataContent({
const content = new FormDataBody({
file: file.value.files[0],
})

Expand Down
15 changes: 15 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginVue from 'eslint-plugin-vue';

import {
defineConfigWithVueTs,
vueTsConfigs,
} from '@vue/eslint-config-typescript'

export default defineConfigWithVueTs(
eslint.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/recommended'],
vueTsConfigs.recommended,
)
Loading