tsdf 8.0.0-beta.1 → 8.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs +1846 -0
- package/dist/main.d.ts +291 -0
- package/dist/main.js +1811 -0
- package/package.json +6 -2
- package/.eslintignore +0 -3
- package/.eslintrc.cjs +0 -119
- package/.gitattributes +0 -22
- package/.prettierrc +0 -6
- package/.vscode/settings.json +0 -3
- package/.vscode/tasks.json +0 -35
- package/fetch-orquestrator-scenarios.excalidraw +0 -10115
- package/scripts/check-if-is-sync.sh +0 -6
- package/src/collectionFetchOrquestrator.ts +0 -23
- package/src/collectionStore.ts +0 -608
- package/src/documentStore.ts +0 -272
- package/src/fetchOrquestrator.ts +0 -335
- package/src/listQueryStore.ts +0 -1190
- package/src/main.ts +0 -22
- package/src/storeShared.ts +0 -5
- package/src/useEnsureIsLoaded.ts +0 -50
- package/src/utils/filterAndMap.ts +0 -20
- package/src/utils/getCacheId.ts +0 -19
- package/src/utils/hooks.ts +0 -110
- package/src/utils/isObject.ts +0 -3
- package/src/utils/math.ts +0 -7
- package/src/utils/serializableClone.ts +0 -3
- package/src/utils/useLatestValue.ts +0 -16
- package/test/__snapshots__/listQueryStore.test.ts.snap +0 -146
- package/test/__snapshots__/listQueryStoreHooks.test.ts.snap +0 -9
- package/test/collectionStore.test.ts +0 -523
- package/test/collectionStoreHooks.test.tsx +0 -651
- package/test/documentStore.test.ts +0 -183
- package/test/documentStoreHooks.test.tsx +0 -857
- package/test/fetchOrquestrator.test.ts +0 -913
- package/test/listQueryStore.test.ts +0 -1158
- package/test/listQueryStoreHooks.test.tsx +0 -662
- package/test/listQueryStoreHooks2.test.tsx +0 -483
- package/test/listQueryStoreHooksMutations.test.tsx +0 -764
- package/test/mocks/fetchMock.ts +0 -296
- package/test/mocks/fetchOrquestratorEnv.ts +0 -370
- package/test/setup/setup.ts +0 -109
- package/test/testHelpers.test.ts +0 -88
- package/test/utils/RenderObjValues.tsx +0 -23
- package/test/utils/arrayUtils.ts +0 -13
- package/test/utils/createDefaultListQueryStore.ts +0 -275
- package/test/utils/createOrVariations.ts +0 -48
- package/test/utils/dedent.ts +0 -50
- package/test/utils/delayCall.ts +0 -25
- package/test/utils/math.ts +0 -3
- package/test/utils/objectUtils.ts +0 -18
- package/test/utils/range.ts +0 -19
- package/test/utils/sleep.ts +0 -3
- package/test/utils/storeUtils.ts +0 -460
- package/tsconfig.json +0 -24
- package/tsconfig.prod.json +0 -9
- package/tsup.config.ts +0 -12
- package/vitest.config.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsdf",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.10",
|
|
4
4
|
"description": "A data fetching solution based on t-state",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Lucas Santos",
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
"require": "./dist/main.cjs"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
18
21
|
"sideEffects": false,
|
|
19
22
|
"engines": {
|
|
20
23
|
"node": ">=16.0.0"
|
|
@@ -28,7 +31,7 @@
|
|
|
28
31
|
"tsc:watch": "tsc -p tsconfig.prod.json --watch",
|
|
29
32
|
"test:run": "vitest run",
|
|
30
33
|
"build": "pnpm test:run && pnpm lint && pnpm build:no-test",
|
|
31
|
-
"build:no-test": "tsup --
|
|
34
|
+
"build:no-test": "tsup --dts",
|
|
32
35
|
"npm-publish": "./scripts/check-if-is-sync.sh && pnpm build && npm publish"
|
|
33
36
|
},
|
|
34
37
|
"devDependencies": {
|
|
@@ -61,6 +64,7 @@
|
|
|
61
64
|
},
|
|
62
65
|
"dependencies": {
|
|
63
66
|
"immer": "^9.0.17",
|
|
67
|
+
"klona": "^2.0.6",
|
|
64
68
|
"mitt": "^3.0.0",
|
|
65
69
|
"t-state": "^7.5.1"
|
|
66
70
|
},
|
package/.eslintignore
DELETED
package/.eslintrc.cjs
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
const isCI = process.env.CI === 'true';
|
|
2
|
-
|
|
3
|
-
const OFF = 0;
|
|
4
|
-
const WARN = 1;
|
|
5
|
-
const ERROR = 2;
|
|
6
|
-
const ERROR_IN_CI = isCI ? ERROR : WARN;
|
|
7
|
-
const ERROR_IN_CI_ONLY = isCI ? ERROR : 0;
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
parser: '@typescript-eslint/parser',
|
|
11
|
-
parserOptions: {
|
|
12
|
-
project: './tsconfig.json',
|
|
13
|
-
createDefaultProgram: true,
|
|
14
|
-
ecmaVersion: 8,
|
|
15
|
-
ecmaFeatures: {
|
|
16
|
-
jsx: true,
|
|
17
|
-
},
|
|
18
|
-
useJSXTextNode: true,
|
|
19
|
-
sourceType: 'module',
|
|
20
|
-
},
|
|
21
|
-
env: {
|
|
22
|
-
browser: true,
|
|
23
|
-
},
|
|
24
|
-
plugins: ['@typescript-eslint', '@lucasols/extended-lint', 'vitest'],
|
|
25
|
-
|
|
26
|
-
rules: {
|
|
27
|
-
'no-warning-comments': [ERROR_IN_CI, { terms: ['FIX:'] }],
|
|
28
|
-
'@lucasols/extended-lint/no-warning-comments': [
|
|
29
|
-
ERROR_IN_CI_ONLY,
|
|
30
|
-
{ terms: ['FIX-LATER:', 'FIXLATER:'] },
|
|
31
|
-
],
|
|
32
|
-
'no-constant-binary-expression': ERROR_IN_CI,
|
|
33
|
-
'object-shorthand': ERROR_IN_CI,
|
|
34
|
-
'no-useless-rename': ERROR_IN_CI,
|
|
35
|
-
'no-param-reassign': ERROR_IN_CI,
|
|
36
|
-
'prefer-template': ERROR_IN_CI,
|
|
37
|
-
'prefer-const': [ERROR_IN_CI, { destructuring: 'all' }],
|
|
38
|
-
|
|
39
|
-
'no-prototype-builtins': OFF,
|
|
40
|
-
'no-inner-declarations': OFF,
|
|
41
|
-
'no-undef': OFF,
|
|
42
|
-
'no-console': [ERROR_IN_CI, { allow: ['warn', 'error', 'info'] }],
|
|
43
|
-
'no-restricted-imports': [
|
|
44
|
-
ERROR_IN_CI,
|
|
45
|
-
{
|
|
46
|
-
patterns: [
|
|
47
|
-
{
|
|
48
|
-
group: ['*.test'],
|
|
49
|
-
message: 'Do not import test files',
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
'no-restricted-syntax': [
|
|
55
|
-
ERROR_IN_CI_ONLY,
|
|
56
|
-
{
|
|
57
|
-
selector:
|
|
58
|
-
'CallExpression[callee.property.name="only"]',
|
|
59
|
-
message: 'No test.only',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
selector:
|
|
63
|
-
'CallExpression[callee.property.name="todo"]',
|
|
64
|
-
message: 'No test.todo',
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
'no-implicit-coercion': [
|
|
68
|
-
ERROR_IN_CI,
|
|
69
|
-
{ disallowTemplateShorthand: true, allow: ['!!'] },
|
|
70
|
-
],
|
|
71
|
-
|
|
72
|
-
/* typescript */
|
|
73
|
-
'@typescript-eslint/no-unnecessary-condition': ERROR_IN_CI,
|
|
74
|
-
'@typescript-eslint/naming-convention': [
|
|
75
|
-
'error',
|
|
76
|
-
{
|
|
77
|
-
selector: 'typeLike',
|
|
78
|
-
format: ['PascalCase'],
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
'@typescript-eslint/no-throw-literal': ERROR_IN_CI,
|
|
82
|
-
'@typescript-eslint/no-unused-expressions': ERROR_IN_CI,
|
|
83
|
-
'@typescript-eslint/no-unused-vars': [
|
|
84
|
-
ERROR_IN_CI,
|
|
85
|
-
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
|
|
86
|
-
],
|
|
87
|
-
'@typescript-eslint/no-shadow': [
|
|
88
|
-
ERROR_IN_CI,
|
|
89
|
-
{ ignoreOnInitialization: true, allow: ['expect'] },
|
|
90
|
-
],
|
|
91
|
-
'@typescript-eslint/ban-types': [
|
|
92
|
-
ERROR_IN_CI,
|
|
93
|
-
{
|
|
94
|
-
types: {
|
|
95
|
-
Error: 'Dont use error type',
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
|
|
100
|
-
'@typescript-eslint/no-non-null-assertion': OFF,
|
|
101
|
-
'@typescript-eslint/no-empty-function': OFF,
|
|
102
|
-
'@typescript-eslint/no-explicit-any': OFF,
|
|
103
|
-
'@typescript-eslint/no-floating-promises': OFF,
|
|
104
|
-
'@typescript-eslint/no-unsafe-assignment': OFF,
|
|
105
|
-
'@typescript-eslint/no-misused-promises': OFF,
|
|
106
|
-
'@typescript-eslint/restrict-template-expressions': OFF,
|
|
107
|
-
'@typescript-eslint/unbound-method': OFF,
|
|
108
|
-
|
|
109
|
-
/* vitest */
|
|
110
|
-
'vitest/expect-expect': ERROR_IN_CI_ONLY,
|
|
111
|
-
'vitest/no-identical-title': ERROR_IN_CI,
|
|
112
|
-
},
|
|
113
|
-
extends: [
|
|
114
|
-
'eslint:recommended',
|
|
115
|
-
'plugin:@typescript-eslint/recommended',
|
|
116
|
-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
117
|
-
'plugin:react-hooks/recommended',
|
|
118
|
-
],
|
|
119
|
-
};
|
package/.gitattributes
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Auto detect text files and perform LF normalization
|
|
2
|
-
* text eol=lf
|
|
3
|
-
|
|
4
|
-
# Custom for Visual Studio
|
|
5
|
-
*.cs diff=csharp
|
|
6
|
-
|
|
7
|
-
# Standard to msysgit
|
|
8
|
-
*.doc diff=astextplain
|
|
9
|
-
*.DOC diff=astextplain
|
|
10
|
-
*.docx diff=astextplain
|
|
11
|
-
*.DOCX diff=astextplain
|
|
12
|
-
*.dot diff=astextplain
|
|
13
|
-
*.DOT diff=astextplain
|
|
14
|
-
*.pdf diff=astextplain
|
|
15
|
-
*.PDF diff=astextplain
|
|
16
|
-
*.rtf diff=astextplain
|
|
17
|
-
*.RTF diff=astextplain
|
|
18
|
-
|
|
19
|
-
# Denote all files that are truly binary and should not be modified.
|
|
20
|
-
*.png binary
|
|
21
|
-
*.jpg binary
|
|
22
|
-
*.ico binary
|
package/.prettierrc
DELETED
package/.vscode/settings.json
DELETED
package/.vscode/tasks.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
3
|
-
// for the documentation about the tasks.json format
|
|
4
|
-
"version": "2.0.0",
|
|
5
|
-
"tasks": [
|
|
6
|
-
{
|
|
7
|
-
"type": "npm",
|
|
8
|
-
"script": "npm-publish",
|
|
9
|
-
"label": "publish package",
|
|
10
|
-
"problemMatcher": [],
|
|
11
|
-
"presentation": {
|
|
12
|
-
"clear": true
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"type": "npm",
|
|
17
|
-
"script": "test",
|
|
18
|
-
"label": "run tests",
|
|
19
|
-
"problemMatcher": [],
|
|
20
|
-
"presentation": {
|
|
21
|
-
"clear": true
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"type": "npm",
|
|
26
|
-
"script": "eslint",
|
|
27
|
-
"problemMatcher": ["$eslint-stylish"],
|
|
28
|
-
"label": "eslint",
|
|
29
|
-
"detail": "CI=true eslint --ext .jsx,.js,.ts,.tsx src/ test/",
|
|
30
|
-
"presentation": {
|
|
31
|
-
"clear": true
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
}
|