Skip to content

Commit a45711e

Browse files
Reflect 9.0 (#80)
* Enforce 23.1.0 * Remove /ssr and delete /scope * Fix build and commits * Separate public types from sources * Use dist version of the package * Make public types work * Make build work * Fix type-tests resolving * Enforce prior build for code tests * Use vitest * Remove jest * remove jest * Add attw and publint into ci * Fix package issues * Fix type paths * Fix resolved path * Rewrite types for reflect method * Rewrite createReflect types * Bump react * Bump react types * Add another type level edge case * Restore some of the variant types * Restore variant types * generalize bind usage * Make `list` types work * Add JSDoc notation * Use public typings in tests directly * Simplify source typings * Add basic type test for createReflect * Improve types * Enable skipLibCheck in type tests There are a lot of strange stuff in @types/react 🤷 * Improve type inference for callbacks * Add tests for scoped callbacks * Support arbitary callback feature * Add tests for callback in mapItem * Support scopeBind callbacks in mapItem * Document fork api auto-compatibility * Document fork api auto compatibility in `list` * Fix docs view * Add types for fromTag helper * Fix example * implement fromTag * Remove unsued expect error directive * Document `fromTag` * Create types for useUnit config * Fix weird gitignore * Implement `useUnitConfig` field * Do not generate d.mts * Improve wording * fix json formatting * Add more type-tests * Revert to use React.FC type again For some reason, on a real test in Next.js project, the (props: ...) => React.ReactNode type is not compatible in some cases * Add note in the code about type inference
1 parent 31c696a commit a45711e

Some content is hidden

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

45 files changed

+2793
-3549
lines changed

.config/tsconfig.base.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
"compilerOptions": {
3-
"target": "es6",
3+
"target": "ESNext",
44
"module": "es2015",
55
"strict": true,
66
"lib": ["dom", "dom.iterable", "esnext"],
77
"moduleResolution": "node",
88
"allowSyntheticDefaultImports": true,
99
"jsx": "react",
1010
"esModuleInterop": true,
11+
"types": ["vitest/globals"],
1112
"strictNullChecks": true
1213
},
1314
"include": ["../src"],
14-
"exclude": ["../typings", "../**/*.test.tsx"]
15+
"exclude": ["../typings"]
1516
}

.github/workflows/test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ jobs:
2424
- name: Build
2525
run: pnpm build
2626

27-
- name: Build test
28-
run: pnpm test:code:build
29-
3027
- name: Run tests
3128
run: pnpm test
3229
env:
3330
CI: true
31+
- name: Validate package
32+
run: pnpm validate:dist

.gitignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
node_modules
3+
.vscode
34

45
yarn-error.log
56

@@ -12,12 +13,5 @@ yarn-error.log
1213

1314
effector-reflect-*
1415
.idea
15-
core/
16-
./index.*
17-
./ssr.*
18-
./scope.*js
19-
./scope.*map
20-
./scope.d.ts
21-
./reflect.*
2216
docs/.next
2317
docs/out

babel.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"presets": ["@babel/preset-env", "@babel/preset-typescript", "@babel/preset-react"],
2+
"presets": ["@babel/preset-typescript", "@babel/preset-react"],
33
"plugins": ["@babel/plugin-transform-runtime"]
44
}

build.mjs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
import fs from 'node:fs/promises';
2-
1+
/* eslint-disable no-undef */
32
import prettyMs from 'pretty-ms';
43
import { rollup } from 'rollup';
4+
import 'zx/globals';
55

66
import configs from './rollup.config.cjs';
77

8+
await fs.mkdir('./dist', { recursive: true });
9+
10+
await measure(`public-typings → ./dist/`, `copied in`, async () => {
11+
await fs.copyFile('./public-types/reflect.d.ts', './dist/index.d.ts');
12+
13+
// `@effector/reflect/scope` types - this export is deprecated
14+
await fs.copyFile('./public-types/reflect.d.ts', './dist/scope.d.ts');
15+
});
16+
817
for (const config of configs) {
918
await measure(
1019
`${config.input}${config.output.file ?? config.output.dir}`,

dist-test/no-ssr/create-reflect.test.tsx

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

0 commit comments

Comments
 (0)