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

feat: add devbox and regenerate devcontainer #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 0 additions & 2 deletions .env.development

This file was deleted.

26 changes: 26 additions & 0 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"packages": ["[email protected]"],
"shell": {
"init_hook": [
"npm set prefix ~/.npm-global",
"npm install -g [email protected]",
"export PATH=~/.npm-global/bin:$PATH",
"pnpm install"
],
"scripts": {
"dev": "pnpm run dev",
"build": "pnpm run build",
"analyze": "pnpm run analyze",
"generate:api": "pnpm run generate:api",
"release:alpha": [
"git checkout main",
"git pull",
"pnpm run release",
"git checkout alpha",
"git merge main",
"git push --follow-tags origin main alpha",
"git checkout @{-2}"
]
}
}
}
70 changes: 70 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"lockfile_version": "1",
"packages": {
"[email protected]": {
"last_modified": "2024-02-10T18:15:24Z",
"plugin_version": "0.0.2",
"resolved": "github:NixOS/nixpkgs/10b813040df67c4039086db0f6eaf65c536886c6#nodejs_21",
"source": "devbox-search",
"version": "21.6.1",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/042c4932zidpg21dh9g078m29bbnknzx-nodejs-21.6.1",
"default": true
},
{
"name": "libv8",
"path": "/nix/store/hlsafi3g7vkhgwfghhgbww86mzz9qhsh-nodejs-21.6.1-libv8"
}
],
"store_path": "/nix/store/042c4932zidpg21dh9g078m29bbnknzx-nodejs-21.6.1"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/i4imnyanc4qr07sp1f6zw8j8rhj9cpzz-nodejs-21.6.1",
"default": true
},
{
"name": "libv8",
"path": "/nix/store/w5qiqw4ahjbqm76mn330ap79pangd9ji-nodejs-21.6.1-libv8"
}
],
"store_path": "/nix/store/i4imnyanc4qr07sp1f6zw8j8rhj9cpzz-nodejs-21.6.1"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/qzkawpmfp6i39jpvj0nga8xfh8dlbzkx-nodejs-21.6.1",
"default": true
},
{
"name": "libv8",
"path": "/nix/store/n8jjlhmk3ym2jfpiwz4chiihadwwq5ic-nodejs-21.6.1-libv8"
}
],
"store_path": "/nix/store/qzkawpmfp6i39jpvj0nga8xfh8dlbzkx-nodejs-21.6.1"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/r9yac8ggvbp5f1wwfnr2jq82ikd5l12y-nodejs-21.6.1",
"default": true
},
{
"name": "libv8",
"path": "/nix/store/iyxijvqs6cga8drmzhswxlfnqlx12bh1-nodejs-21.6.1-libv8"
}
],
"store_path": "/nix/store/r9yac8ggvbp5f1wwfnr2jq82ikd5l12y-nodejs-21.6.1"
}
}
}
}
}
2 changes: 1 addition & 1 deletion orval.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default defineConfig({
},
},
input: {
target: 'https://demo-api.dwarvesf.com/swagger/doc.json',
target: 'https://openrouter-api.dwarvesf.com/api/v1/openapi.json',
validation: false,
},
hooks: {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
"@radix-ui/react-dropdown-menu": "^2.0.4",
"@reach/auto-id": "^0.18.0",
"@tailwindcss/forms": "^0.5.4",
"chess.js": "1.0.0-beta.6",
"classnames": "^2.3.2",
"glob": "^10.3.3",
"isomorphic-unfetch": "^4.0.2",
"mitt": "^3.0.1",
"next": "13.4.4",
"nprogress": "^0.2.0",
"react": "18.2.0",
"react-chessboard": "^4.2.3",
"react-dom": "18.2.0",
"react-hook-form": "^7.41.1",
"react-hot-toast": "^2.4.0",
Expand Down
100 changes: 99 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 5 additions & 15 deletions src/api/auth/auth.msw.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
/**
* Generated by orval v6.17.0 🍺
* Do not edit manually.
* Swagger API
* This is a swagger for API.
* OpenAPI spec version: 1.0
* FE-23 OpenAI API
* OpenAPI spec version: 1.0.0
*/
import { rest } from 'msw'
import { faker } from '@faker-js/faker'

export const getLoginMock = () => ({
data: {
accessToken: (() => faker.string.nanoid())(),
email: (() => '[email protected]')(),
id: (() => 2)(),
username: faker.random.word(),
accessToken: (() => faker.string.nanoid())(),
},
})

export const getSignupMock = () => ({ data: { message: faker.random.word() } })

export const getAuthMSW = () => [
rest.post('*/portal/auth/login', (_req, res, ctx) => {
rest.post('*/auth/login', (_req, res, ctx) => {
return res(
ctx.delay(1000),
ctx.status(200, 'Mocked status'),
ctx.json(getLoginMock()),
)
}),
rest.post('*/portal/auth/signup', (_req, res, ctx) => {
return res(
ctx.delay(1000),
ctx.status(200, 'Mocked status'),
ctx.json(getSignupMock()),
)
}),
]
31 changes: 6 additions & 25 deletions src/api/auth/auth.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,21 @@
/**
* Generated by orval v6.17.0 🍺
* Do not edit manually.
* Swagger API
* This is a swagger for API.
* OpenAPI spec version: 1.0
* FE-23 OpenAI API
* OpenAPI spec version: 1.0.0
*/
import type {
LoginResponse,
LoginRequest,
MessageResponse,
SignupRequest,
} from '../model'
import type { LoginResponse, LoginRequest } from '../model'
import { requester } from '../mutator/requester'

/**
* Login to portal by email
* @summary Login to portal
* Login to by Discord username (listed on Google Sheets)
* @summary Login
*/
export const login = (loginRequest: LoginRequest) => {
return requester<LoginResponse>({
url: `/portal/auth/login`,
url: `/auth/login`,
method: 'post',
headers: { 'Content-Type': 'application/json' },
data: loginRequest,
})
}

/**
* Signup
* @summary Signup
*/
export const signup = (signupRequest: SignupRequest) => {
return requester<MessageResponse>({
url: `/portal/auth/signup`,
method: 'post',
headers: { 'Content-Type': 'application/json' },
data: signupRequest,
})
}
Loading
Loading