fastevent 1.1.3 → 2.0.0

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/dist/devTools.js +2 -2
  2. package/dist/devTools.js.map +1 -1
  3. package/dist/devTools.mjs +2 -2
  4. package/dist/devTools.mjs.map +1 -1
  5. package/dist/index.d.mts +285 -53
  6. package/dist/index.d.ts +285 -53
  7. package/dist/index.js +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +1 -1
  10. package/dist/index.mjs.map +1 -1
  11. package/package.json +64 -50
  12. package/readme.md +517 -50
  13. package/.changeset/README.md +0 -8
  14. package/.changeset/config.json +0 -11
  15. package/.github/workflows/publish.yaml +0 -50
  16. package/.prettierrc.js +0 -20
  17. package/.vscode/launch.json +0 -20
  18. package/.vscode/settings.json +0 -18
  19. package/CHANGELOG.md +0 -60
  20. package/LICENSE +0 -21
  21. package/bench.png +0 -0
  22. package/dist/devTools.d.mts +0 -543
  23. package/dist/devTools.d.ts +0 -543
  24. package/example/README.md +0 -54
  25. package/example/eslint.config.js +0 -28
  26. package/example/index.html +0 -13
  27. package/example/package.json +0 -29
  28. package/example/pnpm-lock.yaml +0 -2047
  29. package/example/public/vite.svg +0 -1
  30. package/example/src/App.css +0 -42
  31. package/example/src/App.tsx +0 -60
  32. package/example/src/assets/react.svg +0 -1
  33. package/example/src/index.css +0 -68
  34. package/example/src/main.tsx +0 -10
  35. package/example/src/myEvent.ts +0 -32
  36. package/example/src/vite-env.d.ts +0 -1
  37. package/example/tsconfig.app.json +0 -26
  38. package/example/tsconfig.json +0 -7
  39. package/example/tsconfig.node.json +0 -24
  40. package/example/vite.config.ts +0 -7
  41. package/packages/native/index.ts +0 -1
  42. package/packages/turbo/.zig-cache/h/271c82d991949fd7788fd5451f0ca834.txt +0 -0
  43. package/packages/turbo/.zig-cache/h/timestamp +0 -0
  44. package/packages/turbo/.zig-cache/o/ebd7ddab8ffe003267120d598aecce68/dependencies.zig +0 -2
  45. package/packages/turbo/.zig-cache/z/c8114b040daa461a9e2eabd0357554a4 +0 -0
  46. package/packages/turbo/build.zig +0 -60
  47. package/packages/turbo/examples/basic.zig +0 -107
  48. package/packages/turbo/src/event.zig +0 -251
  49. package/packages/turbo/src/index.zig +0 -70
  50. package/packages/turbo/src/scope.zig +0 -104
  51. package/packages/turbo/src/types.zig +0 -88
  52. package/packages/turbo/src/utils.zig +0 -171
  53. package/readme_cn.md +0 -491
  54. package/src/__benchmarks__/index.ts +0 -3
  55. package/src/__benchmarks__/multi-level.ts +0 -40
  56. package/src/__benchmarks__/sample.ts +0 -40
  57. package/src/__benchmarks__/wildcard.ts +0 -41
  58. package/src/__tests__/emit.test.ts +0 -106
  59. package/src/__tests__/emitAsync.test.ts +0 -64
  60. package/src/__tests__/isPathMatched.test.ts +0 -205
  61. package/src/__tests__/many.test.ts +0 -22
  62. package/src/__tests__/meta.test.ts +0 -28
  63. package/src/__tests__/off.test.ts +0 -214
  64. package/src/__tests__/onany.test.ts +0 -212
  65. package/src/__tests__/once.test.ts +0 -70
  66. package/src/__tests__/retain.test.ts +0 -66
  67. package/src/__tests__/scope.test.ts +0 -110
  68. package/src/__tests__/types.test.ts +0 -145
  69. package/src/__tests__/waitFor.test.ts +0 -116
  70. package/src/__tests__/wildcard.test.ts +0 -185
  71. package/src/devTools.ts +0 -166
  72. package/src/event.ts +0 -741
  73. package/src/index.ts +0 -3
  74. package/src/scope.ts +0 -130
  75. package/src/types.ts +0 -66
  76. package/src/utils/WeakObjectMap.ts +0 -64
  77. package/src/utils/isPathMatched.ts +0 -40
  78. package/src/utils/removeItem.ts +0 -16
  79. package/tsconfig.json +0 -104
  80. package/tsup.config.ts +0 -30
@@ -1,50 +0,0 @@
1
- name: Publish Package
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
-
8
- permissions:
9
- pull-requests: write
10
- contents: write
11
- id-token: write
12
-
13
- concurrency: ${{ github.workflow }}-${{ github.ref }}
14
-
15
- jobs:
16
- build-and-publish:
17
- runs-on: ubuntu-latest
18
-
19
- steps:
20
- - name: Checkout Repo
21
- uses: actions/checkout@v4
22
-
23
- - uses: pnpm/action-setup@v4
24
-
25
- - name: Setup Node.js environment
26
- uses: actions/setup-node@v4
27
- with:
28
- node-version: 20
29
- cache: pnpm
30
-
31
- - name: Install pnpm
32
- run: npm install -g pnpm
33
-
34
- # 安装依赖
35
- - name: Install dependencies
36
- run: pnpm install --no-frozen-lockfile
37
-
38
- - name: Create Release Pull Request or Publish to npm
39
- id: changesets
40
- uses: changesets/action@v1
41
- with:
42
- # This expects you to have a script called release which does a build for your packages and calls changeset publish
43
- publish: pnpm release
44
- env:
45
- # this doesn't work but semantic-release works
46
- # see https://github.com/sonofmagic/npm-lib-rollup-template/blob/main/.github/workflows/release.yml#L46
47
- # NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
48
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
50
- npm_config_registry: https://registry.npmjs.org
package/.prettierrc.js DELETED
@@ -1,20 +0,0 @@
1
- module.exports = {
2
- // 每行末尾不添加分号
3
- semi: true,
4
- // 字符串使用单引号
5
- singleQuote: true,
6
- // tab缩进长度,默认为2
7
- tabWidth: 4,
8
- // 对象中打印空格
9
- bracketSpacing: true,
10
- // 文末自动添加空格等结尾
11
- endOfLine: 'auto',
12
- // 换行长度,默认80
13
- printWidth: 180,
14
- // 多行后面打印逗号
15
- trailingComma: 'all',
16
- // 箭头函数总是加小括号
17
- arrowParens: 'always',
18
- // 換行 保留??
19
- proseWrap: 'preserve',
20
- };
@@ -1,20 +0,0 @@
1
- {
2
- // 使用 IntelliSense 了解相关属性。
3
- // 悬停以查看现有属性的描述。
4
- // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "type": "node",
9
- "request": "launch",
10
- "name": "Benchmark",
11
- "skipFiles": [
12
- "<node_internals>/**"
13
- ],
14
- "program": "${workspaceFolder}\\src\\__benchmarks__\\index.js",
15
- "outFiles": [
16
- "${workspaceFolder}/**/*.js"
17
- ]
18
- }
19
- ]
20
- }
@@ -1,18 +0,0 @@
1
- {
2
- "terminal.integrated.persistentSessionReviveProcess": "onExitAndWindowClose",
3
- "files.exclude": {
4
- "**/.git": true,
5
- "**/.svn": true,
6
- "**/.hg": true,
7
- "**/CVS": true,
8
- "**/.DS_Store": true,
9
- "**/Thumbs.db": true,
10
- "**/node_modules": false
11
- },
12
- "editor.tabSize": 4,
13
- "editor.insertSpaces": true,
14
- "editor.detectIndentation": false,
15
- "editor.formatOnSave": true,
16
- "prettier.tabWidth": 4,
17
- "oxlint.enable": true
18
- }
package/CHANGELOG.md DELETED
@@ -1,60 +0,0 @@
1
- # fastevent
2
-
3
- ## 1.1.3
4
-
5
- ### Patch Changes
6
-
7
- - 028475b: feat: 更改使用 interface FastEventMessage 以方便扩展
8
-
9
- ## 1.1.2
10
-
11
- ### Patch Changes
12
-
13
- - f650dd3: feat: 增加 Context 泛型参数,用来为侦听器指定 this
14
-
15
- ## 1.1.1
16
-
17
- ### Patch Changes
18
-
19
- - c93387f: feat: 新增加了 fastevent/devtools 功能,可以导入在`Redux Dev Tools`查看事件,用于调试。
20
- feat: 新增加了 debug 选项,用于调试时使用。
21
- feat: 增加了 onExecuteListener 选项,在每次执行侦听器后执行,仅当 debug=true 时有效
22
- feat: 增加了 onClearListener 选项,在清空侦听器时执行
23
- fix: 修改了类型提示错误
24
-
25
- ## 1.1.0
26
-
27
- ### Minor Changes
28
-
29
- - 02ffb88: 修改事件侦听器的接收为 FastEventMessage
30
-
31
- ## 1.0.4
32
-
33
- ### Patch Changes
34
-
35
- - 3cf1e87: 更新 meta 泛型参数的位置
36
-
37
- ## 1.0.3
38
-
39
- ### Patch Changes
40
-
41
- - 0c54b10: 调整 onAny 侦听器的执行优先级
42
-
43
- ## 1.0.2
44
-
45
- ### Patch Changes
46
-
47
- - 02c6d3e: fix scope.on error
48
-
49
- ## 1.0.1
50
-
51
- ### Patch Changes
52
-
53
- - b7d21e2: add prepend option for on
54
- - 8807aaa: update scope on options
55
-
56
- ## 1.0.0
57
-
58
- ### Major Changes
59
-
60
- - b8b8c13: first release
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 zhangfisher
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/bench.png DELETED
Binary file