Skip to content

Commit

Permalink
changed api import name
Browse files Browse the repository at this point in the history
  • Loading branch information
anmho committed Jan 30, 2024
1 parent e3bb575 commit 1f49fc7
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 24 deletions.
1 change: 1 addition & 0 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Serverless aws-nodejs-typescript template",
"main": "serverless.ts",
"scripts": {
"dev": "sls offline --noPrependStageInUrl",
"test": "echo \"Error: no test specified\" && exit 1"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/functions/hello/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
awsLambdaRequestHandler,
CreateAWSLambdaContextOptions,
} from "@trpc/server/adapters/aws-lambda";
import { appRouter, createTRPCContext } from "@zotmeal/test";
import { appRouter, createTRPCContext } from "@acme/api";
import { APIGatewayProxyEventV2 } from "aws-lambda";

const createContext = ({
Expand Down
1 change: 1 addition & 0 deletions packages/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# `@zotmeal/test`
1 change: 1 addition & 0 deletions packages/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./src";
29 changes: 9 additions & 20 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
{
"name": "@acme/api",
"version": "0.1.0",
"version": "0.0.0",
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts"
},
"license": "MIT",
"scripts": {
"clean": "rm -rf .turbo node_modules",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint .",
"typecheck": "tsc --noEmit"
"dev": "echo 'Add dev script here'",
"build": "echo 'Add build script here'",
"test": "echo 'Add test script here'",
"lint": "echo 'Add lint script here'"
},
"dependencies": {
"@acme/validators": "workspace:^0.1.0",
"@acme/db": "workspace:^",
"@acme/eslint-config": "workspace:^",
"@acme/tsconfig": "workspace:^",
"@acme/validators": "workspace:^",
"@trpc/server": "11.0.0-next-beta.236",
"axios": "^1.6.7",
"superjson": "2.2.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@acme/eslint-config": "workspace:^0.2.0",
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"eslint": "^8.56.0",
"prettier": "^3.1.1",
"typescript": "^5.3.3"
},
"eslintConfig": {
"root": true,
"extends": [
Expand Down
5 changes: 4 additions & 1 deletion packages/api/src/router/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export const postRouter = createTRPCRouter({
.mutation(({ ctx, input }) => {
// return ctx.db.insert(schema.post).values(input);
return ctx.db.post.create({
data: input,
data: {
title: input.title,
content: input.content,
},
});
}),

Expand Down
3 changes: 1 addition & 2 deletions packages/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "@acme/tsconfig/base.json",
"extends": ["@acme/tsconfig/base.json"],
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
},
"include": ["src"],
"exclude": ["node_modules"]
}

0 comments on commit 1f49fc7

Please sign in to comment.