tsdf 8.0.0-beta.1 → 8.0.0-beta.11

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.
Files changed (57) hide show
  1. package/dist/main.cjs +1860 -0
  2. package/dist/main.d.ts +291 -0
  3. package/dist/main.js +1825 -0
  4. package/package.json +6 -2
  5. package/.eslintignore +0 -3
  6. package/.eslintrc.cjs +0 -119
  7. package/.gitattributes +0 -22
  8. package/.prettierrc +0 -6
  9. package/.vscode/settings.json +0 -3
  10. package/.vscode/tasks.json +0 -35
  11. package/fetch-orquestrator-scenarios.excalidraw +0 -10115
  12. package/scripts/check-if-is-sync.sh +0 -6
  13. package/src/collectionFetchOrquestrator.ts +0 -23
  14. package/src/collectionStore.ts +0 -608
  15. package/src/documentStore.ts +0 -272
  16. package/src/fetchOrquestrator.ts +0 -335
  17. package/src/listQueryStore.ts +0 -1190
  18. package/src/main.ts +0 -22
  19. package/src/storeShared.ts +0 -5
  20. package/src/useEnsureIsLoaded.ts +0 -50
  21. package/src/utils/filterAndMap.ts +0 -20
  22. package/src/utils/getCacheId.ts +0 -19
  23. package/src/utils/hooks.ts +0 -110
  24. package/src/utils/isObject.ts +0 -3
  25. package/src/utils/math.ts +0 -7
  26. package/src/utils/serializableClone.ts +0 -3
  27. package/src/utils/useLatestValue.ts +0 -16
  28. package/test/__snapshots__/listQueryStore.test.ts.snap +0 -146
  29. package/test/__snapshots__/listQueryStoreHooks.test.ts.snap +0 -9
  30. package/test/collectionStore.test.ts +0 -523
  31. package/test/collectionStoreHooks.test.tsx +0 -651
  32. package/test/documentStore.test.ts +0 -183
  33. package/test/documentStoreHooks.test.tsx +0 -857
  34. package/test/fetchOrquestrator.test.ts +0 -913
  35. package/test/listQueryStore.test.ts +0 -1158
  36. package/test/listQueryStoreHooks.test.tsx +0 -662
  37. package/test/listQueryStoreHooks2.test.tsx +0 -483
  38. package/test/listQueryStoreHooksMutations.test.tsx +0 -764
  39. package/test/mocks/fetchMock.ts +0 -296
  40. package/test/mocks/fetchOrquestratorEnv.ts +0 -370
  41. package/test/setup/setup.ts +0 -109
  42. package/test/testHelpers.test.ts +0 -88
  43. package/test/utils/RenderObjValues.tsx +0 -23
  44. package/test/utils/arrayUtils.ts +0 -13
  45. package/test/utils/createDefaultListQueryStore.ts +0 -275
  46. package/test/utils/createOrVariations.ts +0 -48
  47. package/test/utils/dedent.ts +0 -50
  48. package/test/utils/delayCall.ts +0 -25
  49. package/test/utils/math.ts +0 -3
  50. package/test/utils/objectUtils.ts +0 -18
  51. package/test/utils/range.ts +0 -19
  52. package/test/utils/sleep.ts +0 -3
  53. package/test/utils/storeUtils.ts +0 -460
  54. package/tsconfig.json +0 -24
  55. package/tsconfig.prod.json +0 -9
  56. package/tsup.config.ts +0 -12
  57. 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.1",
3
+ "version": "8.0.0-beta.11",
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 --minify --dts",
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
@@ -1,3 +0,0 @@
1
- docs
2
- resources
3
- dist
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
@@ -1,6 +0,0 @@
1
- {
2
- "printWidth": 80,
3
- "semi": true,
4
- "singleQuote": true,
5
- "trailingComma": "all"
6
- }
@@ -1,3 +0,0 @@
1
- {
2
- "typescript.tsdk": "node_modules\\typescript\\lib",
3
- }
@@ -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
- }