Skip to content

Commit

Permalink
fix: dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dineug committed Dec 23, 2023
1 parent a1a0fdf commit e023e34
Show file tree
Hide file tree
Showing 18 changed files with 642 additions and 539 deletions.
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions .gitattributes

This file was deleted.

4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.14.2
6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

2 changes: 1 addition & 1 deletion go.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"editor.tabSize": 2,
"editor.tabCompletion": "on",
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
"lint": "eslint \"**/*.{js,ts}\""
},
"resolutions": {
"typescript": "5.1.6"
"typescript": "5.3.3"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-prettier": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.3",
"prettier": "^2.8.8",
"tslib": "^2.6.1",
"turbo": "^1.10.12",
"typescript": "5.1.6",
"vite": "^4.4.9"
"lint-staged": "^15.2.0",
"prettier": "^3.1.1",
"tslib": "^2.6.2",
"turbo": "^1.11.2",
"typescript": "5.3.3",
"vite": "^5.0.10"
},
"lint-staged": {
"**/*.{js,ts}": [
Expand Down
18 changes: 9 additions & 9 deletions packages/go/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.7",
"description": "Promise Extension Library",
"type": "module",
"main": "./dist/go.umd.cjs",
"main": "./dist/go.min.js",
"module": "./dist/go.js",
"types": "./dist/index.d.ts",
"exports": {
Expand All @@ -12,7 +12,7 @@
"types": "./dist/index.d.ts",
"default": "./dist/go.js"
},
"require": "./dist/go.umd.cjs"
"require": "./dist/go.min.js"
}
},
"files": [
Expand Down Expand Up @@ -42,13 +42,13 @@
"build": "vite build"
},
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.2",
"rollup-plugin-visualizer": "^5.9.2",
"ts-patch": "^3.0.2",
"tslib": "^2.6.1",
"typescript": "5.1.6",
"@rollup/plugin-typescript": "^11.1.5",
"rollup-plugin-visualizer": "^5.11.0",
"ts-patch": "^3.1.1",
"tslib": "^2.6.2",
"typescript": "5.3.3",
"typescript-transform-paths": "^3.4.6",
"vite": "^4.4.9",
"vite-tsconfig-paths": "^4.2.0"
"vite": "^5.0.10",
"vite-tsconfig-paths": "^4.2.2"
}
}
4 changes: 2 additions & 2 deletions packages/go/src/buffers/limitBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export class LimitBuffer<T = any> implements ChannelBuffer<T> {
this.#config.trailing
? this.#queue.pop()
: this.#config.leading
? this.#queue.shift()
: this.#queue.pop();
? this.#queue.shift()
: this.#queue.pop();
}
}
}
22 changes: 11 additions & 11 deletions packages/go/src/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export type CO = CoroutineCreator;

type GoReturnType<
F extends AnyCallback,
R extends ReturnType<F> = ReturnType<F>
R extends ReturnType<F> = ReturnType<F>,
> = R extends Promise<any>
? Awaited<R>
: R extends Iterator<any, infer IR> | Generator<any, infer IR>
? IR
: R extends AsyncIterator<any, infer AIR> | AsyncGenerator<any, infer AIR>
? Awaited<AIR>
: R;
? IR
: R extends AsyncIterator<any, infer AIR> | AsyncGenerator<any, infer AIR>
? Awaited<AIR>
: R;

export function go<F extends AnyCallback>(
callback: F,
Expand Down Expand Up @@ -107,10 +107,10 @@ function toNext(value: any) {
return isPromiseLike(value)
? value
: isIterator(value)
? go(() => value)
: isFunction(value)
? go(value)
: isArray(value)
? value.map(value => go(() => value))
: Promise.resolve();
? go(() => value)
: isFunction(value)
? go(value)
: isArray(value)
? value.map(value => go(() => value))
: Promise.resolve();
}
2 changes: 1 addition & 1 deletion packages/go/src/operators/debounce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { take } from '@/operators/take';

export const debounce = <
T = any,
F extends (value: T) => any = (value: T) => any
F extends (value: T) => any = (value: T) => any,
>(
channel: Channel<T>,
callback: F,
Expand Down
4 changes: 2 additions & 2 deletions packages/go/src/operators/race.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const race = <T extends RaceRecord>(record: T) =>
isPromise(entry)
? entry.then(toResolve(key)).catch(reject)
: isPromiseLike(entry)
? entry.then(toResolve(key))
: toResolve(key)(entry);
? entry.then(toResolve(key))
: toResolve(key)(entry);
}
});
2 changes: 1 addition & 1 deletion packages/go/src/operators/takeLatest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { take } from '@/operators/take';

export const takeLatest = <
T = any,
F extends (value: T) => any = (value: T) => any
F extends (value: T) => any = (value: T) => any,
>(
channel: Channel<T>,
callback: F
Expand Down
2 changes: 1 addition & 1 deletion packages/go/src/operators/takeLeading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { take } from '@/operators/take';

export const takeLeading = <
T = any,
F extends (value: T) => any = (value: T) => any
F extends (value: T) => any = (value: T) => any,
>(
channel: Channel<T>,
callback: F
Expand Down
2 changes: 1 addition & 1 deletion packages/go/src/operators/throttle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const defaultConfig: Required<ThrottleConfig> = {

export const throttle = <
T = any,
F extends (value: T) => any = (value: T) => any
F extends (value: T) => any = (value: T) => any,
>(
channel: Channel<T>,
callback: F,
Expand Down
3 changes: 1 addition & 2 deletions packages/go/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"@/*": ["src/*"]
}
},
"include": ["src"],
"exclude": ["node_modules"]
"include": ["src"]
}
70 changes: 37 additions & 33 deletions packages/go/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { readFileSync } from 'node:fs';

import typescript from '@rollup/plugin-typescript';
import { visualizer } from 'rollup-plugin-visualizer';
// @ts-ignore
import tspCompiler from 'ts-patch/compiler';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
Expand All @@ -17,39 +16,44 @@ const banner = `/*!
* @license ${pkg.license}
*/`;

export default defineConfig({
build: {
lib: {
entry: './src/index.ts',
name: pkg.name,
fileName: 'go',
formats: ['es', 'umd'],
},
rollupOptions: {
output: {
banner,
export default defineConfig(({ command }) => {
const isBuild = command === 'build';

return {
build: {
lib: {
entry: './src/index.ts',
name: pkg.name,
fileName: format => (format === 'es' ? 'go.js' : 'go.min.js'),
formats: ['es', 'umd'],
},
rollupOptions: {
output: {
banner,
},
},
},
},
plugins: [
tsconfigPaths(),
visualizer({ filename: './dist/stats.html' }),
typescript({
typescript: tspCompiler,
noEmitOnError: true,
compilerOptions: {
declaration: true,
outDir: './dist',
plugins: [
{
transform: 'typescript-transform-paths',
afterDeclarations: true,
plugins: [
tsconfigPaths(),
visualizer({ filename: './dist/stats.html' }),
isBuild &&
typescript({
typescript: tspCompiler,
noEmitOnError: true,
compilerOptions: {
declaration: true,
outDir: './dist',
plugins: [
{
transform: 'typescript-transform-paths',
afterDeclarations: true,
},
],
},
],
},
}),
],
server: {
open: true,
},
}),
].filter(Boolean),
server: {
open: true,
},
};
});
Loading

0 comments on commit e023e34

Please sign in to comment.