Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Commit 74a52f5

Browse files
committed
fix: nx setup
1 parent 9e79750 commit 74a52f5

File tree

8 files changed

+1332
-598
lines changed

8 files changed

+1332
-598
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ yarn-error.log*
3232
# Documentation here: https://yarnpkg.com/features/zero-installs
3333
!.yarn/cache
3434
#.pnp.*
35+
36+
.nx/cache

nx.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3+
"targetDefaults": {
4+
"build": {
5+
"dependsOn": ["^build"],
6+
"cache": true
7+
}
8+
}
9+
}

package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"author": "SeungHwan-Lee <[email protected]>",
1919
"license": "MIT",
2020
"scripts": {
21-
"build": "turbo build",
21+
"build": "nx run-many -t build",
2222
"prepare": "husky install",
2323
"format": "npm run format:eslint && npm run format:prettier",
2424
"format:eslint": "eslint \"**/*.{js,ts}\" --fix",
@@ -29,20 +29,20 @@
2929
"typescript": "5.3.3"
3030
},
3131
"devDependencies": {
32-
"@typescript-eslint/eslint-plugin": "^6.15.0",
33-
"@typescript-eslint/parser": "^6.15.0",
34-
"eslint": "^8.56.0",
32+
"@typescript-eslint/eslint-plugin": "^7.6.0",
33+
"@typescript-eslint/parser": "^7.6.0",
34+
"eslint": "^8.57.0",
3535
"eslint-config-prettier": "^9.1.0",
3636
"eslint-plugin-import": "^2.29.1",
37-
"eslint-plugin-prettier": "^5.1.1",
38-
"eslint-plugin-simple-import-sort": "^10.0.0",
39-
"husky": "^8.0.3",
40-
"lint-staged": "^15.2.0",
41-
"prettier": "^3.1.1",
37+
"eslint-plugin-prettier": "^5.1.3",
38+
"eslint-plugin-simple-import-sort": "^12.0.0",
39+
"husky": "^9.0.11",
40+
"lint-staged": "^15.2.2",
41+
"prettier": "^3.2.5",
4242
"tslib": "^2.6.2",
43-
"turbo": "^1.11.2",
44-
"typescript": "5.3.3",
45-
"vite": "^5.0.12"
43+
"typescript": "5.4.5",
44+
"vite": "^5.2.8",
45+
"nx": "18.2.4"
4646
},
4747
"lint-staged": {
4848
"**/*.{js,ts}": [

packages/go/package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@
3939
"build": "vite build"
4040
},
4141
"devDependencies": {
42-
"@rollup/plugin-typescript": "^11.1.5",
43-
"rollup-plugin-visualizer": "^5.11.0",
44-
"ts-patch": "^3.1.1",
42+
"@rollup/plugin-typescript": "^11.1.6",
43+
"rollup-plugin-visualizer": "^5.12.0",
4544
"tslib": "^2.6.2",
46-
"typescript": "5.3.3",
47-
"typescript-transform-paths": "^3.4.6",
48-
"vite": "^5.0.12",
49-
"vite-tsconfig-paths": "^4.2.2"
45+
"typescript": "5.4.5",
46+
"vite": "^5.2.8",
47+
"vite-plugin-dts": "^3.8.2",
48+
"vite-tsconfig-paths": "^4.3.2"
5049
}
5150
}

packages/go/src/go.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ export type CO = CoroutineCreator;
3131
type GoReturnType<
3232
F extends AnyCallback,
3333
R extends ReturnType<F> = ReturnType<F>,
34-
> = R extends Promise<any>
35-
? Awaited<R>
36-
: R extends Iterator<any, infer IR> | Generator<any, infer IR>
37-
? IR
38-
: R extends AsyncIterator<any, infer AIR> | AsyncGenerator<any, infer AIR>
39-
? Awaited<AIR>
40-
: R;
34+
> =
35+
R extends Promise<any>
36+
? Awaited<R>
37+
: R extends Iterator<any, infer IR> | Generator<any, infer IR>
38+
? IR
39+
: R extends AsyncIterator<any, infer AIR> | AsyncGenerator<any, infer AIR>
40+
? Awaited<AIR>
41+
: R;
4142

4243
export function go<F extends AnyCallback>(
4344
callback: F,

packages/go/vite.config.ts

+3-16
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { readFileSync } from 'node:fs';
33

44
import typescript from '@rollup/plugin-typescript';
55
import { visualizer } from 'rollup-plugin-visualizer';
6-
import tspCompiler from 'ts-patch/compiler';
76
import { defineConfig } from 'vite';
7+
import dts from 'vite-plugin-dts';
88
import tsconfigPaths from 'vite-tsconfig-paths';
99

1010
const pkg = JSON.parse(readFileSync('package.json', { encoding: 'utf8' }));
@@ -35,21 +35,8 @@ export default defineConfig(({ command }) => {
3535
plugins: [
3636
tsconfigPaths(),
3737
visualizer({ filename: './dist/stats.html' }),
38-
isBuild &&
39-
typescript({
40-
typescript: tspCompiler,
41-
noEmitOnError: true,
42-
compilerOptions: {
43-
declaration: true,
44-
outDir: './dist',
45-
plugins: [
46-
{
47-
transform: 'typescript-transform-paths',
48-
afterDeclarations: true,
49-
},
50-
],
51-
},
52-
}),
38+
dts(),
39+
isBuild && typescript({ noEmitOnError: true }),
5340
].filter(Boolean),
5441
server: {
5542
open: true,

0 commit comments

Comments
 (0)