Skip to content

Commit

Permalink
remove the need to build shared pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
horacioh committed Feb 23, 2023
1 parent d522dd3 commit 8e729d2
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 18 deletions.
3 changes: 2 additions & 1 deletion frontend/app/tsconfig.json
Expand Up @@ -17,7 +17,8 @@
"isolatedModules": true,
"paths": {
"@components/*": ["./src/components/*"],
"@app/*": ["./src/*"]
"@app/*": ["./src/*"],
"@mintter/shared/*": ["../shared/src/*"]
}
},
"typedocOptions": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/gateway/package.json
Expand Up @@ -6,7 +6,7 @@
"dev": "concurrently --kill-others --kill-others-on-fail -n POSTCSS,NEXT -c bgGreen,bgMagenta 'pnpm dev:styles' 'pnpm dev:front'",
"dev:styles": "nodemon css-props-generator.js",
"dev:front": "next dev",
"build": "cd ../.. && pnpm shared:build && cd frontend/gateway && pnpm build:styles && pnpm build:front",
"build": "pnpm build:styles && pnpm build:front",
"build:styles": "node css-props-generator.js",
"build:front": "next build",
"lint": "next lint",
Expand Down
18 changes: 9 additions & 9 deletions frontend/gateway/pages/api/mintter-well-known.ts
@@ -1,19 +1,19 @@
import { getPeerInfo, listAccounts } from "@mintter/shared"
import { NextRequest, NextResponse } from "next/server"
import { transport } from "../../client"
import {getPeerInfo, listAccounts} from '@mintter/shared'
import {NextRequest, NextResponse} from 'next/server'
import {transport} from '../../client'

export default async function handler(req: NextRequest, res:NextResponse) {
console.log('Attempting to handle well known request')
const accts = await listAccounts(undefined, undefined, transport)
export default async function handler(req: NextRequest, res: NextResponse) {
console.log('Attempting to handle well known request')
const accts = await listAccounts(undefined, undefined, transport)
const firstAcct = accts.accounts[0]
if (!firstAcct) throw new Error('Nope')
const acctId = firstAcct.id
const device = firstAcct.devices[0 ]
const device = firstAcct.devices[0]
if (!device) throw new Error('Nope')
const peerInfo = await getPeerInfo(device, transport)
const wellKnown = {
account_id: acctId,
addresses: peerInfo.addrs
addresses: peerInfo.addrs,
}

// const test = {
Expand All @@ -27,4 +27,4 @@ console.log('Attempting to handle well known request')

res.headers.set('Content-Type', 'application/json')
return new Response(JSON.stringify(wellKnown))
}
}
2 changes: 1 addition & 1 deletion frontend/gateway/styles/custom-props.css
@@ -1,4 +1,4 @@
/* VARIABLES GENERATED WITH TAILWIND CONFIG ON 2/17/2023.
/* VARIABLES GENERATED WITH TAILWIND CONFIG ON 2/23/2023.
Tokens location: ./tailwind.config.js */

:root {
Expand Down
5 changes: 4 additions & 1 deletion frontend/gateway/tsconfig.json
Expand Up @@ -15,7 +15,10 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
"incremental": true,
"paths": {
"@mintter/shared/*": ["../shared/src/*"]
}
},
"include": [
"next-env.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion frontend/shared/package.json
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"dev": "tsc -w",
"build": "tsc ",
"build": "exit 0;",
"test": "vitest --run",
"test:watch": "vitest --watch",
"lint": "pnpm lint:prettier && pnpm lint:eslint",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -17,12 +17,12 @@
"shared:dev": "pnpm --filter='@mintter/shared' dev",
"shared:build": "pnpm --filter='@mintter/shared' build",
"shared:test": "pnpm --filter='@mintter/shared' test",
"app:dev": "pnpm --parallel --filter='@mintter/shared' --filter='@mintter/app' dev",
"app:build": "pnpm shared:build && pnpm --filter='@mintter/app' build",
"app:dev": "pnpm --filter='@mintter/app' dev",
"app:build": "pnpm --filter='@mintter/app' build",
"app:test": "pnpm --filter='@mintter/app' test",
"tauri:dev": "cd desktop/app && cargo tauri dev",
"gw:dev": "pnpm --parallel --filter='@mintter/shared' --filter='@mintter/gateway' dev",
"gw:build": "pnpm shared:build && pnpm --filter='@mintter/gateway' build",
"gw:dev": "pnpm --filter='@mintter/gateway' dev",
"gw:build": "pnpm --filter='@mintter/gateway' build",
"gw:test": "pnpm --filter='@mintter/gateway' test",
"gw:start": "pnpm --filter='@mintter/gateway' start"
},
Expand Down

0 comments on commit 8e729d2

Please sign in to comment.