Skip to content

Commit 45605cc

Browse files
samchonclaude
andcommitted
Restructure to pnpm monorepo with typescript/ttsc toolchain
Following the structure of samchon/shopping and samchon/nestia-start#632: - Split the single package into a pnpm workspace with two packages: - packages/backend: NestJS + Prisma server (previous root src/test/prisma) - packages/api: SDK library generated by nestia (previous src/api) - Replace tsc + ts-patch + ts-node + typescript-transform-paths with the ttsc toolchain (TypeScript-Go) and ttsx runner; typia and @ttsc/paths plugins are applied automatically by ttsc - Upgrade to nestia v12 (RC), typia v13, and TypeScript 7 (native), managed through pnpm catalogs in pnpm-workspace.yaml - SDK is now generated directly into packages/api/src and imported from the package root (@ORGANIZATION/PROJECT-api) via workspace protocol; ensure-nestia-exports.cjs keeps root exports stable - IPerformance DTO now defines its own usage interfaces instead of NodeJS.* so the published SDK does not depend on @types/node - Bundle the api package ESM build through rollup with an in-memory ttsc compilation, replacing @rollup/plugin-typescript - Webpack now bundles the ttsc-compiled lib output instead of using ts-loader; obsolete Prisma .node engine copying removed (Prisma 7 is engine-less) and @modelcontextprotocol/sdk added to lazy ignores - Drop eslint (incompatible with the native TypeScript compiler) - Update CI workflows, dependabot config, README and CONTRIBUTING Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1Q5EM6GT2Q89UPrNRKX1z
1 parent 0d5736c commit 45605cc

100 files changed

Lines changed: 6908 additions & 452 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
version: 2
22
updates:
3-
#######################################################
43
- package-ecosystem: 'npm'
54
directory: '/'
65
schedule:
@@ -14,20 +13,20 @@ updates:
1413
- dependency-name: "@prisma/*"
1514
- dependency-name: "prisma"
1615
- dependency-name: "prisma-markdown"
16+
- dependency-name: "tgrid"
1717
- dependency-name: "tstl"
1818
- dependency-name: "typia"
19-
- dependency-name: "tgrid"
2019
- dependency-name: "typescript"
21-
- dependency-name: "typescript-transform-paths"
22-
- dependency-name: "ts-patch"
20+
- dependency-name: "ttsc"
21+
- dependency-name: "@ttsc/*"
2322
groups:
2423
Samchon:
2524
patterns:
2625
- "@nestia/*"
2726
- "nestia"
27+
- "tgrid"
2828
- "tstl"
2929
- "typia"
30-
- "tgrid"
3130
- "prisma-markdown"
3231
NestJS:
3332
patterns:
@@ -39,21 +38,5 @@ updates:
3938
TypeScript:
4039
patterns:
4140
- "typescript"
42-
- "typescript-transform-paths"
43-
- "ts-patch"
44-
#######################################################
45-
- package-ecosystem: 'npm'
46-
directory: '/packages/api'
47-
schedule:
48-
interval: 'daily'
49-
open-pull-requests-limit: 25
50-
versioning-strategy: increase
51-
allow:
52-
- dependency-name: "@nestia/fetcher"
53-
- dependency-name: "typia"
54-
groups:
55-
Samchon:
56-
patterns:
57-
- "@nestia/fetcher"
58-
- "typia"
59-
#######################################################
41+
- "ttsc"
42+
- "@ttsc/*"

.github/workflows/build.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
name: build
22
on:
33
pull_request:
4-
paths:
5-
- 'prisma/**'
6-
- 'src/**'
7-
- 'test/**'
8-
- 'package.json'
4+
push:
5+
branches:
6+
- master
7+
98
jobs:
109
Ubuntu:
1110
runs-on: ubuntu-latest
@@ -20,20 +19,18 @@ jobs:
2019
steps:
2120
- uses: actions/checkout@v4
2221
- uses: actions/setup-node@v4
23-
with:
24-
node-version: 20.x
2522
- uses: pnpm/action-setup@v4
26-
with:
27-
version: 8
28-
29-
- name: Install Backend-Server
23+
24+
- name: Install
3025
run: pnpm install
3126

32-
- name: Compile Backend-Server
33-
run: npm run build
34-
27+
- name: Build
28+
run: pnpm build
29+
3530
- name: Create DB Schema
36-
run: npm run schema postgres root
31+
working-directory: packages/backend
32+
run: pnpm schema postgres root
3733

38-
- name: Test Backend-Server
39-
run: npm run test -- --reset true --simultaneous 16
34+
- name: Test
35+
working-directory: packages/backend
36+
run: pnpm test --reset true --simultaneous 16

.github/workflows/dependabot-automerge.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
types: [opened, synchronize]
77
paths:
88
- "package.json"
9+
- "pnpm-workspace.yaml"
910
- "packages/api/package.json"
11+
- "packages/backend/package.json"
1012
jobs:
1113
build-and-merge:
1214
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ bin/
22
dist/
33
lib/
44
node_modules/
5-
prisma/migrations
6-
prisma/schema/migrations
7-
src/prisma
5+
packages/backend/prisma/migrations
6+
packages/backend/prisma/schema/migrations
7+
packages/backend/src/prisma
88

99
*.DS_Store
1010
package-lock.json
11-
pnpm-lock.yaml
1211
swagger.json
1312
openai.json
14-
.npmrc
13+
.npmrc
14+
*.log

.prettierignore

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
dist
2-
bin
3-
lib
4-
5-
node_modules
6-
packages
7-
src/api/functional
8-
src/api/module.ts
1+
bin/
2+
dist/
3+
lib/
4+
node_modules/
95

6+
packages/api/src/functional
7+
packages/backend/src/prisma
108
README.md
11-
tsconfig.json

.vscode/launch.json

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
11
{
2-
// Use IntelliSense to learn about possible Node.js debug attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"type": "node",
9-
"request": "launch",
10-
"name": "JavaScript Test using SourceMap",
11-
"program": "${workspaceRoot}/test/index.ts",
12-
"cwd": "${workspaceRoot}",
13-
"args": [
14-
//----
15-
// Unable to reset DB in debugging mode.
16-
//----
17-
// Therefore, reset DB first by running
18-
// `npm run reset-for-debugging` command,
19-
// and run debugging mode later.
20-
//----
21-
"--reset", "false",
22-
//----
23-
// You can run specific test functions
24-
//----
25-
// "--include", "something",
26-
// "--exclude", "nothing",
27-
],
28-
"outFiles": ["${workspaceRoot}/bin/**/*.js"],
29-
}
30-
]
31-
}
2+
// Use IntelliSense to learn about possible Node.js debug attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Backend Test",
11+
"runtimeExecutable": "pnpm",
12+
"runtimeArgs": ["ttsx", "--project", "test/tsconfig.json", "test/index.ts"],
13+
"cwd": "${workspaceRoot}/packages/backend",
14+
"args": [
15+
//----
16+
// You can run specific test functions
17+
//
18+
// If you want to include or exclude multiple words,
19+
// then separate them with space character
20+
//----
21+
// "--include", "some-words-to-include",
22+
// "--exclude", "some-word another-word",
23+
],
24+
}
25+
]
26+
}

.vscode/settings.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
22
"editor.tabSize": 2,
33
"editor.formatOnSave": true,
4-
"[javascript][typescript]": {
5-
"editor.defaultFormatter": "esbenp.prettier-vscode",
6-
"editor.codeActionsOnSave": {
7-
"source.fixAll.eslint": "explicit"
8-
}
4+
"[javascript][typescript][json]": {
5+
"editor.defaultFormatter": "esbenp.prettier-vscode"
96
},
107
"[prisma]": {
118
"editor.defaultFormatter": "Prisma.prisma",
129
},
13-
}
10+
}

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ I always welcome your suggestion. When you publishing a suggestion, then please
2727

2828
## Contributing Code
2929
### Test your code
30-
Before sending a pull request, please test your new code. You type the command `npm run build &&& npm run test`, then compiling your code and test-automation will be all processed.
30+
Before sending a pull request, please test your new code. You type the command `pnpm build && pnpm test`, then compiling your code and test-automation will be all processed.
3131

3232
```bash
3333
# COMPILE
34-
npm run build
34+
pnpm build
3535

3636
# DO TEST
37-
npm run test
37+
pnpm test
3838
```
3939

4040
If you succeeded to compile, but failed to pass the test-automation, then *debug* the test-automation module. I've configured the `.vscode/launch.json`. You just run the `VSCode` and click the `Start Debugging` button or press `F5` key. By the *debugging*, find the reason why the *test* is failed and fix it.

0 commit comments

Comments
 (0)