diff --git a/package.json b/package.json index 2f783c81..1e60c5e0 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "test": "NODE_ENV=test pnpm test:code && pnpm test:types", "test:code": "jest", - "test:types": "tsc -p ./test-typings", + "test:types": "pnpm build:types && tsc -p ./test-typings", "format": "prettier --write \"./src/**/**.{ts,tsx,js,jsx,json}\"", "lint": "eslint ./", "cleanup": "rm -rf dist && mkdir dist", diff --git a/test-typings/and.ts b/test-typings/and.ts index ebf2d926..45c40bfc 100644 --- a/test-typings/and.ts +++ b/test-typings/and.ts @@ -6,7 +6,7 @@ import { createEvent, createEffect, } from 'effector'; -import { and } from '../src/and'; +import { and } from '../dist/and'; // Returns always store with boolean { diff --git a/test-typings/combine-events.ts b/test-typings/combine-events.ts index cd1bf33d..9259d085 100644 --- a/test-typings/combine-events.ts +++ b/test-typings/combine-events.ts @@ -8,7 +8,7 @@ import { createEffect, sample, } from 'effector'; -import { combineEvents } from '../src/combine-events'; +import { combineEvents } from '../dist/combine-events'; // Check simple combine of different events { diff --git a/test-typings/condition.ts b/test-typings/condition.ts index eaef6259..f0c81ae2 100644 --- a/test-typings/condition.ts +++ b/test-typings/condition.ts @@ -8,7 +8,7 @@ import { Event, Store, } from 'effector'; -import { condition } from '../src/condition'; +import { condition } from '../dist/condition'; // Correct pass type from source to then, else, and if { diff --git a/test-typings/debounce.ts b/test-typings/debounce.ts index 1c201a6d..d38cceb2 100644 --- a/test-typings/debounce.ts +++ b/test-typings/debounce.ts @@ -9,7 +9,7 @@ import { createDomain, fork, } from 'effector'; -import { debounce } from '../src/debounce'; +import { debounce } from '../dist/debounce'; // Returns the same type as source { diff --git a/test-typings/debug.ts b/test-typings/debug.ts index 9901655f..f3cd6e9e 100644 --- a/test-typings/debug.ts +++ b/test-typings/debug.ts @@ -7,7 +7,7 @@ import { type Node, type Scope, } from 'effector'; -import { debug } from '../src/debug'; +import { debug } from '../dist/debug'; // Allows each unit of effector { diff --git a/test-typings/delay.ts b/test-typings/delay.ts index 3ca131f9..b50e2251 100644 --- a/test-typings/delay.ts +++ b/test-typings/delay.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd'; import { Event, createStore, createEvent, createEffect, Store } from 'effector'; -import { delay } from '../src/delay'; +import { delay } from '../dist/delay'; // Check valid type for source { diff --git a/test-typings/either.ts b/test-typings/either.ts index dedc870c..ad5dd0f8 100644 --- a/test-typings/either.ts +++ b/test-typings/either.ts @@ -6,7 +6,7 @@ import { createEvent, createEffect, } from 'effector'; -import { either } from '../src/either'; +import { either } from '../dist/either'; // Returns always store with merged type { diff --git a/test-typings/equals.ts b/test-typings/equals.ts index 128abddc..6625e61a 100644 --- a/test-typings/equals.ts +++ b/test-typings/equals.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd'; import { createStore, Store } from 'effector'; -import { equals } from '../src/equals'; +import { equals } from '../dist/equals'; // Should receive stores with the same type { diff --git a/test-typings/every.ts b/test-typings/every.ts index edb213e8..ab51126f 100644 --- a/test-typings/every.ts +++ b/test-typings/every.ts @@ -1,6 +1,6 @@ import { expectType, expectError } from 'tsd'; import { Store, createStore } from 'effector'; -import { every } from '../src/every'; +import { every } from '../dist/every'; // Check invalid type for number predicate { diff --git a/test-typings/format.ts b/test-typings/format.ts index 207d03f5..95000448 100644 --- a/test-typings/format.ts +++ b/test-typings/format.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd'; import { createStore, Store } from 'effector'; -import { format } from '../src/format'; +import { format } from '../dist/format'; // Allows stores with any value and returns Store { diff --git a/test-typings/in-flight.ts b/test-typings/in-flight.ts index c4ff4942..60a4918d 100644 --- a/test-typings/in-flight.ts +++ b/test-typings/in-flight.ts @@ -6,7 +6,7 @@ import { createEffect, createDomain, } from 'effector'; -import { inFlight } from '../src/in-flight'; +import { inFlight } from '../dist/in-flight'; // Check receive effects { diff --git a/test-typings/interval.ts b/test-typings/interval.ts index ce957091..75b3e274 100644 --- a/test-typings/interval.ts +++ b/test-typings/interval.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd'; import { Event, createStore, Store, createEvent } from 'effector'; -import { interval } from '../src/interval'; +import { interval } from '../dist/interval'; // Only required options with void returns void tick { diff --git a/test-typings/not.ts b/test-typings/not.ts index 9b6e796b..8d2a4b20 100644 --- a/test-typings/not.ts +++ b/test-typings/not.ts @@ -1,6 +1,6 @@ import { createDomain, createEffect, createStore, Store } from 'effector'; import { expectType } from 'tsd'; -import { not } from '../src/not'; +import { not } from '../dist/not'; // Always returns the store { diff --git a/test-typings/once.ts b/test-typings/once.ts index c1f7d211..7438fdb3 100644 --- a/test-typings/once.ts +++ b/test-typings/once.ts @@ -7,7 +7,7 @@ import { createDomain, fork, } from 'effector'; -import { once } from '../src/once'; +import { once } from '../dist/once'; // Supports Event, Effect and Store as an argument { diff --git a/test-typings/or.ts b/test-typings/or.ts index c9f2cc10..10486cab 100644 --- a/test-typings/or.ts +++ b/test-typings/or.ts @@ -6,7 +6,7 @@ import { createEvent, createEffect, } from 'effector'; -import { or } from '../src/or'; +import { or } from '../dist/or'; // Returns always store with boolean { diff --git a/test-typings/pending.ts b/test-typings/pending.ts index 07557b66..c75f25da 100644 --- a/test-typings/pending.ts +++ b/test-typings/pending.ts @@ -6,7 +6,7 @@ import { createEffect, createDomain, } from 'effector'; -import { pending } from '../src/pending'; +import { pending } from '../dist/pending'; // Check receive effects { diff --git a/test-typings/reset.ts b/test-typings/reset.ts index 7b19627e..c254d2bc 100644 --- a/test-typings/reset.ts +++ b/test-typings/reset.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd'; import { createEvent, createEffect, createStore } from 'effector'; -import { reset } from '../src/reset'; +import { reset } from '../dist/reset'; import type { Event } from 'effector'; diff --git a/test-typings/reshape.ts b/test-typings/reshape.ts index f21a25e1..f026a27f 100644 --- a/test-typings/reshape.ts +++ b/test-typings/reshape.ts @@ -8,7 +8,7 @@ import { createEffect, createDomain, } from 'effector'; -import { reshape } from '../src/reshape'; +import { reshape } from '../dist/reshape'; // Reshapes store with string { diff --git a/test-typings/snapshot.ts b/test-typings/snapshot.ts index a5c17c45..8b2218b0 100644 --- a/test-typings/snapshot.ts +++ b/test-typings/snapshot.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd'; import { Store, createStore, createEvent, createEffect } from 'effector'; -import { snapshot } from '../src/snapshot'; +import { snapshot } from '../dist/snapshot'; // Check invalid type for source { diff --git a/test-typings/some.ts b/test-typings/some.ts index 03f17d20..2ec863dc 100644 --- a/test-typings/some.ts +++ b/test-typings/some.ts @@ -1,6 +1,6 @@ import { expectType, expectError } from 'tsd'; import { Store, createStore } from 'effector'; -import { some } from '../src/some'; +import { some } from '../dist/some'; // Check invalid type for number predicate { diff --git a/test-typings/split-map.ts b/test-typings/split-map.ts index 625b1322..1894292a 100644 --- a/test-typings/split-map.ts +++ b/test-typings/split-map.ts @@ -7,7 +7,7 @@ import { createEffect, sample, } from 'effector'; -import { splitMap } from '../src/split-map'; +import { splitMap } from '../dist/split-map'; // partial destructuring throws an error #71 { diff --git a/test-typings/spread.ts b/test-typings/spread.ts index 540f85ac..617d8fa2 100644 --- a/test-typings/spread.ts +++ b/test-typings/spread.ts @@ -8,7 +8,7 @@ import { createEffect, sample, } from 'effector'; -import { spread } from '../src/spread'; +import { spread } from '../dist/spread'; { const $source = createStore({ first: '', last: '' }); diff --git a/test-typings/status.ts b/test-typings/status.ts index 68f0f9f1..e9371e7c 100644 --- a/test-typings/status.ts +++ b/test-typings/status.ts @@ -6,7 +6,7 @@ import { createEvent, createDomain, } from 'effector'; -import { status, EffectState } from '../src/status'; +import { status, EffectState } from '../dist/status'; // Check that accepts only effect { diff --git a/test-typings/throttle.ts b/test-typings/throttle.ts index 9db4df59..88b054b2 100644 --- a/test-typings/throttle.ts +++ b/test-typings/throttle.ts @@ -7,7 +7,7 @@ import { createEvent, createEffect, } from 'effector'; -import { throttle } from '../src/throttle'; +import { throttle } from '../dist/throttle'; // Returns the same type as source { diff --git a/test-typings/time.ts b/test-typings/time.ts index 556d4c36..b2b9e3ef 100644 --- a/test-typings/time.ts +++ b/test-typings/time.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd'; import { Store, createStore, createEvent, createEffect, createDomain } from 'effector'; -import { time } from '../src/time'; +import { time } from '../dist/time'; // Returns correct default Store value { diff --git a/test-typings/tsconfig.json b/test-typings/tsconfig.json index b8179e35..7bdf79bb 100644 --- a/test-typings/tsconfig.json +++ b/test-typings/tsconfig.json @@ -14,5 +14,7 @@ "strict": true, "strictNullChecks": true, "skipLibCheck": true, - } + }, + "include": ["./*.ts"], + "exclude": ["node_modules", "../src/**/*"] }