@cplieger/actions 1.0.0 → 1.0.1

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 (80) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/jsr.json +8 -12
  4. package/package.json +7 -9
  5. package/src/__test-helpers__/action-test-setup.ts +34 -0
  6. package/src/api-idempotency.test.ts +163 -0
  7. package/src/api.test.ts +96 -0
  8. package/src/api.ts +0 -0
  9. package/src/cleanup.test.ts +102 -0
  10. package/src/cleanup.ts +0 -0
  11. package/src/configure-api.test.ts +219 -0
  12. package/src/cross-action-coordination.test.ts +176 -0
  13. package/src/cross-action-races-extra.test.ts +231 -0
  14. package/src/cross-action-races.test.ts +213 -0
  15. package/src/cross-action-scope-serial.test.ts +121 -0
  16. package/src/debounce.test.ts +121 -0
  17. package/src/debounce.ts +0 -0
  18. package/src/define-helpers.ts +0 -0
  19. package/src/define.property.test.ts +133 -0
  20. package/src/define.test.ts +476 -0
  21. package/src/define.ts +0 -0
  22. package/src/dispatch-callbacks.test.ts +141 -0
  23. package/src/dispatch-options.test.ts +197 -0
  24. package/src/edge-cases.test.ts +81 -0
  25. package/src/error.test.ts +268 -0
  26. package/src/error.ts +0 -0
  27. package/src/index.ts +0 -0
  28. package/src/leak-stress.test.ts +117 -0
  29. package/src/loading.test.ts +146 -0
  30. package/src/loading.ts +0 -0
  31. package/src/new-features.test.ts +246 -0
  32. package/src/notifier.ts +0 -0
  33. package/src/poll.test.ts +385 -0
  34. package/src/poll.ts +0 -0
  35. package/src/primitive-edge-cases.test.ts +105 -0
  36. package/src/primitive-interactions.test.ts +112 -0
  37. package/src/primitives.test.ts +215 -0
  38. package/src/race-dedupe-cancel.test.ts +88 -0
  39. package/src/redteam.test.ts +254 -0
  40. package/src/redteam2.test.ts +337 -0
  41. package/src/redteam3.test.ts +454 -0
  42. package/src/registry.test.ts +271 -0
  43. package/src/registry.ts +0 -0
  44. package/src/retry-network-delay.test.ts +155 -0
  45. package/src/retry.ts +0 -0
  46. package/src/transport.test.ts +139 -0
  47. package/src/transport.ts +0 -0
  48. package/src/types.ts +0 -0
  49. package/.editorconfig +0 -19
  50. package/.htmlvalidate.json +0 -28
  51. package/.stylelintrc.json +0 -67
  52. package/dist/src/api.d.ts +0 -56
  53. package/dist/src/api.js +0 -158
  54. package/dist/src/cleanup.d.ts +0 -11
  55. package/dist/src/cleanup.js +0 -63
  56. package/dist/src/debounce.d.ts +0 -28
  57. package/dist/src/debounce.js +0 -91
  58. package/dist/src/define-helpers.d.ts +0 -20
  59. package/dist/src/define-helpers.js +0 -83
  60. package/dist/src/define.d.ts +0 -14
  61. package/dist/src/define.js +0 -627
  62. package/dist/src/error.d.ts +0 -42
  63. package/dist/src/error.js +0 -174
  64. package/dist/src/index.d.ts +0 -17
  65. package/dist/src/index.js +0 -22
  66. package/dist/src/loading.d.ts +0 -15
  67. package/dist/src/loading.js +0 -114
  68. package/dist/src/notifier.d.ts +0 -21
  69. package/dist/src/notifier.js +0 -21
  70. package/dist/src/poll.d.ts +0 -23
  71. package/dist/src/poll.js +0 -120
  72. package/dist/src/registry.d.ts +0 -18
  73. package/dist/src/registry.js +0 -210
  74. package/dist/src/retry.d.ts +0 -9
  75. package/dist/src/retry.js +0 -78
  76. package/dist/src/transport.d.ts +0 -46
  77. package/dist/src/transport.js +0 -70
  78. package/dist/src/types.d.ts +0 -157
  79. package/dist/src/types.js +0 -7
  80. package/eslint.config.base.mjs +0 -186
@@ -1,186 +0,0 @@
1
- // Strict typed-linting config.
2
- // References:
3
- // https://typescript-eslint.io/users/configs/#strict-type-checked
4
- // https://typescript-eslint.io/users/configs/#stylistic-type-checked
5
- // https://typescript-eslint.io/getting-started/typed-linting
6
-
7
- import js from "@eslint/js";
8
- import tseslint from "typescript-eslint";
9
-
10
- export default [
11
- // 1. Ignore generated/build outputs and configs that don't need linting.
12
- {
13
- ignores: [
14
- // Dependencies (any depth)
15
- "**/node_modules/**",
16
- // Build output / generated bundles (TS->JS, CSS bundles, etc.)
17
- "**/static/**",
18
- "**/dist/**",
19
- "**/build/**",
20
- "**/.next/**",
21
- "**/.cache/**",
22
- "**/coverage/**",
23
- // Minified / generated source
24
- "**/*.min.*",
25
- "**/*.gen.ts",
26
- "**/*.gen.js",
27
- "**/wire/*.gen.ts",
28
- // Test fixtures that aren't real code
29
- "**/test-stubs/**",
30
- "**/__mocks__/**",
31
- ],
32
- },
33
- // 2. Strictest official preset combination (typed linting required).
34
- js.configs.recommended,
35
- ...tseslint.configs.strictTypeChecked,
36
- ...tseslint.configs.stylisticTypeChecked,
37
-
38
- // 3. Project setup — projectService auto-discovers tsconfig per file.
39
- {
40
- languageOptions: {
41
- ecmaVersion: 2024,
42
- sourceType: "module",
43
- parserOptions: {
44
- projectService: {
45
- allowDefaultProject: ["*.test.ts", "*.property.test.ts", "fc-strict-setup.ts"],
46
- maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 20,
47
- },
48
- tsconfigRootDir: import.meta.dirname,
49
- },
50
- globals: {
51
- // Browser
52
- window: "readonly",
53
- document: "readonly",
54
- navigator: "readonly",
55
- console: "readonly",
56
- fetch: "readonly",
57
- URL: "readonly",
58
- URLSearchParams: "readonly",
59
- setTimeout: "readonly",
60
- clearTimeout: "readonly",
61
- setInterval: "readonly",
62
- clearInterval: "readonly",
63
- requestAnimationFrame: "readonly",
64
- cancelAnimationFrame: "readonly",
65
- queueMicrotask: "readonly",
66
- WebSocket: "readonly",
67
- EventSource: "readonly",
68
- AbortController: "readonly",
69
- Headers: "readonly",
70
- Request: "readonly",
71
- Response: "readonly",
72
- FormData: "readonly",
73
- Blob: "readonly",
74
- File: "readonly",
75
- FileReader: "readonly",
76
- IntersectionObserver: "readonly",
77
- MutationObserver: "readonly",
78
- ResizeObserver: "readonly",
79
- CustomEvent: "readonly",
80
- Event: "readonly",
81
- EventTarget: "readonly",
82
- TextEncoder: "readonly",
83
- TextDecoder: "readonly",
84
- crypto: "readonly",
85
- btoa: "readonly",
86
- atob: "readonly",
87
- // Service Worker
88
- self: "readonly",
89
- ServiceWorkerGlobalScope: "readonly",
90
- clients: "readonly",
91
- // Test runner globals (vitest auto-injected)
92
- describe: "readonly",
93
- it: "readonly",
94
- test: "readonly",
95
- expect: "readonly",
96
- beforeAll: "readonly",
97
- beforeEach: "readonly",
98
- afterAll: "readonly",
99
- afterEach: "readonly",
100
- vi: "readonly",
101
- },
102
- },
103
- rules: {
104
- // Allow `_`-prefixed unused names.
105
- "@typescript-eslint/no-unused-vars": [
106
- "error",
107
- {
108
- argsIgnorePattern: "^_",
109
- varsIgnorePattern: "^_",
110
- caughtErrorsIgnorePattern: "^_",
111
- destructuredArrayIgnorePattern: "^_",
112
- ignoreRestSiblings: true,
113
- },
114
- ],
115
- // Enforce `import type {...}` for types.
116
- "@typescript-eslint/consistent-type-imports": [
117
- "error",
118
- { prefer: "type-imports", fixStyle: "inline-type-imports" },
119
- ],
120
- // Discourage `any`, prefer `unknown`.
121
- "@typescript-eslint/no-explicit-any": "error",
122
- // Avoid silent fall-through bugs in async event handlers.
123
- "@typescript-eslint/no-misused-promises": [
124
- "error",
125
- { checksVoidReturn: { attributes: false } },
126
- ],
127
- // Prefer literal numeric/string template parts (catches accidental coercion).
128
- "@typescript-eslint/restrict-template-expressions": [
129
- "error",
130
- { allowNumber: true, allowBoolean: true, allowNullish: false },
131
- ],
132
- // Console policy.
133
- "no-console": ["warn", { allow: ["warn", "error"] }],
134
- // Equality: enforce strict ===.
135
- eqeqeq: ["error", "always", { null: "ignore" }],
136
- curly: ["error", "all"],
137
- "no-var": "error",
138
- "prefer-const": "error",
139
- "no-throw-literal": "error",
140
- },
141
- },
142
-
143
- // 4. Tests: typed but with relaxed rules (tests deliberately break invariants).
144
- {
145
- files: [
146
- "**/*.test.ts",
147
- "**/*.fuzz.test.ts",
148
- "**/*.property.test.ts",
149
- "**/test-helpers/**",
150
- "**/__mocks__/**",
151
- ],
152
- rules: {
153
- "@typescript-eslint/no-non-null-assertion": "off",
154
- "@typescript-eslint/no-explicit-any": "off",
155
- "@typescript-eslint/no-unsafe-assignment": "off",
156
- "@typescript-eslint/no-unsafe-member-access": "off",
157
- "@typescript-eslint/no-unsafe-call": "off",
158
- "@typescript-eslint/no-unsafe-argument": "off",
159
- "@typescript-eslint/no-unsafe-return": "off",
160
- "@typescript-eslint/no-extraneous-class": "off",
161
- "@typescript-eslint/no-unnecessary-condition": "off",
162
- "@typescript-eslint/no-misused-spread": "off",
163
- "@typescript-eslint/unbound-method": "off",
164
- "@typescript-eslint/require-await": "off",
165
- "no-console": "off",
166
- },
167
- },
168
-
169
- // 5. Generated and config files + tests: drop type-checked rules.
170
- {
171
- files: [
172
- "**/*.gen.ts",
173
- "**/wire/*.ts",
174
- "vitest.config.ts",
175
- "*.config.ts",
176
- "*.config.mjs",
177
- "*.config.js",
178
- "**/*.test.ts",
179
- "**/*.fuzz.test.ts",
180
- "**/*.property.test.ts",
181
- "fc-strict-setup.ts",
182
- "test-stubs/**",
183
- ],
184
- ...tseslint.configs.disableTypeChecked,
185
- },
186
- ];