diff --git a/.changes/README.md b/.changes/README.md new file mode 100644 index 0000000..5c2b35e --- /dev/null +++ b/.changes/README.md @@ -0,0 +1,31 @@ +# Changes + +##### via https://github.com/jbolda/covector + +As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes. + +When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process. + +Use the following format: + +```md +--- +"package-a": patch +"package-b": minor +--- + +Change summary goes here + +``` + +Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed. + +Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/). + +Given a version number MAJOR.MINOR.PATCH, increment the: + +- MAJOR version when you make incompatible API changes, +- MINOR version when you add functionality in a backwards compatible manner, and +- PATCH version when you make backwards compatible bug fixes. + +Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing). diff --git a/.changes/config.json b/.changes/config.json new file mode 100644 index 0000000..5dee6b5 --- /dev/null +++ b/.changes/config.json @@ -0,0 +1,29 @@ +{ + "gitSiteUrl": "https://github.com/fxforge/starfx/", + "additionalBumpTypes": ["housekeeping"], + "changeTags": { + "feat": "New Features", + "enhance": "Enhancements", + "bug": "Bug Fixes", + "deps": "Dependencies", + "internal": "Changes Supporting Development" + }, + "pkgManagers": { + "javascript": { + "version": true, + "getPublishedVersion": { + "use": "fetch:check", + "options": { + "url": "https://registry.npmjs.com/${ pkg.pkg }/${ pkg.pkgFile.version }" + } + }, + "publish": ["npm publish --provenance --access public"] + } + }, + "packages": { + "starfx": { + "path": ".", + "manager": "javascript" + } + } +} diff --git a/.github/workflows/covector-comment-on-forks.yml b/.github/workflows/covector-comment-on-forks.yml new file mode 100644 index 0000000..cd36c50 --- /dev/null +++ b/.github/workflows/covector-comment-on-forks.yml @@ -0,0 +1,26 @@ +name: covector comment + +on: + workflow_run: + workflows: [covector status] + types: + - completed + +# note all other permissions are set to none if not specified +permissions: + # to read the action artifacts + actions: read + # to write the comment + pull-requests: write + +jobs: + download: + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion == 'success' && + (github.event.workflow_run.head_repository.full_name != github.repository || github.actor == 'dependabot[bot]') + steps: + - name: covector status + uses: jbolda/covector/packages/action@covector-v0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + command: "status" diff --git a/.github/workflows/covector-status.yml b/.github/workflows/covector-status.yml new file mode 100644 index 0000000..d460a1e --- /dev/null +++ b/.github/workflows/covector-status.yml @@ -0,0 +1,18 @@ +name: covector status +on: [pull_request] + +jobs: + covector: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 # required for use of git history + - name: covector status + uses: jbolda/covector/packages/action@covector-v0 + id: covector + with: + token: ${{ secrets.GITHUB_TOKEN }} + command: "status" + comment: true diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml new file mode 100644 index 0000000..ae1c4ca --- /dev/null +++ b/.github/workflows/covector-version-or-publish.yml @@ -0,0 +1,70 @@ +name: version or publish + +on: + push: + branches: + - main + +permissions: + # required for npm provenance + id-token: write + # required to create the GitHub Release + contents: write + # required for creating the Version Packages Release + pull-requests: write + +jobs: + version-or-publish: + runs-on: ubuntu-latest + timeout-minutes: 65 + outputs: + change: ${{ steps.covector.outputs.change }} + commandRan: ${{ steps.covector.outputs.commandRan }} + successfulPublish: ${{ steps.covector.outputs.successfulPublish }} + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 # required for use of git history + - uses: actions/setup-node@v6 + with: + node-version: 24.x + - name: install + run: npm ci + + - name: git config + run: | + git config --global user.name "${{ github.event.pusher.name }}" + git config --global user.email "${{ github.event.pusher.email }}" + + - name: build + run: npm run build + + - name: covector version or publish (publish when no change files present) + uses: jbolda/covector/packages/action@covector-v0 + id: covector + with: + token: ${{ secrets.GITHUB_TOKEN }} + command: "version-or-publish" + createRelease: true + recognizeContributors: true + + # We need to run npm again so that `package-lock.json` + # is updated and the package.json is formatted per biome + # if it needs to be before the PR is created + - run: npm install + if: steps.covector.outputs.commandRan == 'version' + - run: npm run lint + if: steps.covector.outputs.commandRan == 'version' + + - name: Create Pull Request With Versions Bumped + id: cpr + uses: peter-evans/create-pull-request@v8 + if: steps.covector.outputs.commandRan == 'version' + with: + draft: true + title: "Publish New Version" + commit-message: "publish new versions" + labels: "version updates" + branch: "release" + body: ${{ steps.covector.outputs.change }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 535a4ea..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: release to npm - -on: - release: - types: [published] - -permissions: - contents: read - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v6 - - name: get version - id: vars - run: echo ::set-output name=version::$(echo ${{github.ref_name}} | sed 's/^v//') - - name: setup node - uses: actions/setup-node@v6 - with: - node-version: 24.x - - name: install - run: npm install - - name: build - run: npm run build - - name: publish - run: npm publish --access=public - working-directory: . - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ae1a9e1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,350 @@ +# Changelog + +## \[0.16.0] + +- Update to `effection` v4. +- `thunk.manage()` API for managing `effecton` resources +- filled out JSDocs for better IDE help + +### Breaking Changes + +- The update to `effection` v4 may bring breaking changes depending on how deeply your effects were built on v3 semantics. See the migration blog post for `effection`. +- removed deprecated `bootup` alias from thunk/query APIs. Use `register()` instead. +- `Instruction` is no longer re-exported from `starfx`; import it directly from `effection`. + +## \[0.15.0] - 2025-09-05 + +- react-redux as optional peerDep (@jbolda, #63) +- examples use repo starfx version (@jbolda, #65) +- scope thunks to allow managing resources (@jbolda, #64) + +## \[0.14.7] - 2025-09-05 + +- react-redux as optional peerDep (@jbolda, #63) +- examples use repo starfx version (@jbolda, #65) +- scope thunks to allow managing resources (@jbolda, #64) + +## \[0.14.6] - 2025-07-08 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.14.5...v0.14.6 + +## \[0.14.5] - 2025-07-08 + +- Refactor matcher for correct predicate and action handling (@VldMrgnn, #62) + +## \[0.14.4] - 2025-06-06 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.14.3...v0.14.4 + +## \[0.14.3] - 2025-06-06 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.14.2...v0.14.3 + +## \[0.14.2] - 2025-06-06 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.14.1...v0.14.2 + +## \[0.14.1] - 2025-06-06 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.14.0...v0.14.1 + +## \[0.14.0] - 2025-06-06 + +- Deno v2 And Imports (@jbolda, #54) +- confirm tests assert when run within an generator function (@jbolda, #55) +- preview package creation on PR (@jbolda, #58) +- deno to node (@neurosnap, #60) +- fix(react): exports entry (@neurosnap, #61) + +## \[0.13.4] - 2024-11-17 + +- feat: add custom transform functions for state persistence (@VldMrgnn, #50) +- feat: support multiple stores registering the same thunk (@VldMrgnn, #51) + +## \[0.13.3] - 2024-10-02 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.13.2...v0.13.3 + +## \[0.13.2] - 2024-08-16 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.13.1...v0.13.2 + +## \[0.13.1] - 2024-08-14 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.13.0...v0.13.1 + +## \[0.13.0] - 2024-07-30 + +- refactor: enhanced thunk registry system (@neurosnap, #44) + +## \[0.12.0] - 2024-05-07 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.11.0...v0.12.0 + +## \[0.11.0] - 2024-04-15 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.10.0...v0.11.0 + +## \[0.10.0] - 2024-03-05 + +- BREAKING CHANGE: `ctx.json` no longer has `.data` property, must use `.value` or `.error` instead + +## \[0.9.0] - 2024-03-04 + +- refactor: simplify api (@neurosnap, #43) +- DEPRECATED: configureStore is now createStore +- BREAKING CHANGE: removed starfx/store + +## \[0.8.0] - 2024-02-23 + +- feat: clear timers (@neurosnap, #41) +- chore: make clearTimers more ergonomic (@neurosnap, #42) +- BREAKING CHANGE: `race` was changed to `raceMap` and we are re-exporting `effection.race` + +## \[0.7.2] - 2024-02-23 + +- Deprecate: `slice.loader` => `slice.loaders` + +## \[0.7.1] - 2024-02-22 + +- Docs (@neurosnap, #39) +- fix: reset loader when task is cancelled (@neurosnap, #40) + +## \[0.7.0] - 2024-02-10 + +- feat: wait for loader (@neurosnap, #37) + +## \[0.6.0] - 2024-02-07 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.5.3...v0.6.0 + +## \[0.5.3] - 2024-02-06 + +- refactor: remove `log` (@neurosnap, #35) +- ecosystem CI tests (@jbolda, #36) +- @jbolda made their first contribution (#36) + +## \[0.5.2] - 2024-01-21 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.5.1...v0.5.2 + +## \[0.5.1] - 2024-01-19 + +- chore: folder/file org cleanup (@neurosnap, #33) + +## \[0.5.0] - 2024-01-18 + +- refactor: rm redux (@neurosnap, #32) + +## \[0.4.1] - 2024-01-11 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.4.0...v0.4.1 + +## \[0.4.0] - 2024-01-10 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.11...v0.4.0 + +## \[0.3.11] - 2024-01-08 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.10...v0.3.11 + +## \[0.3.10] - 2024-01-08 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.9...v0.3.10 + +## \[0.3.9] - 2024-01-03 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.8...v0.3.9 + +## \[0.3.8] - 2024-01-03 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.7...v0.3.8 + +## \[0.3.7] - 2023-12-18 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.6...v0.3.7 + +## \[0.3.6] - 2023-12-18 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.5...v0.3.6 + +## \[0.3.5] - 2023-12-17 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.4...v0.3.5 + +## \[0.3.4] - 2023-12-16 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.3...v0.3.4 + +## \[0.3.3] - 2023-12-14 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.2...v0.3.3 + +## \[0.3.2] - 2023-12-14 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.1...v0.3.2 + +## \[0.3.1] - 2023-12-14 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.3.0...v0.3.1 + +## \[0.3.0] - 2023-12-12 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.2.2...v0.3.0 + +## \[0.2.2] - 2023-12-04 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.2.1...v0.2.2 + +## \[0.2.1] - 2023-12-01 + +- feat(query): thunk and api thunks can simply accept payload (@neurosnap, #29) +- refactor(store): `slice.table` `empty` is now optional (@neurosnap, #28) + +## \[0.2.0] - 2023-12-01 + +- refactor(store): require data and loaders slices (@neurosnap, #24) +- feat(store): `createBatchMdw` for batching store listener events (@neurosnap, #22) +- feat(store): redux-persist replacement (@neurosnap, #21) +- fix(thunk): add `.use` to `CreateActionWithPayload` (@neurosnap, #27) + +## \[0.1.0] - 2023-11-30 + +- refactor(query): middleware naming and supervisor work (@neurosnap, #25) +- feat: thunks dynamic mdw api (@neurosnap, #26) + +## \[0.0.34] - 2023-11-19 + +- refactor(fx): use `call` from `effection` (@neurosnap, #20) + +## \[0.0.33] - 2023-11-10 + +- refactor(redux): custom queue impl (@neurosnap, #19) + +## \[0.0.32] - 2023-10-13 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.31...v0.0.32 + +## \[0.0.31] - 2023-10-13 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.30...v0.0.31 + +## \[0.0.30] - 2023-09-18 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.28...v0.0.30 + +## \[0.0.29] - 2023-09-17 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.27...v0.0.29 + +## \[0.0.28] - 2023-09-17 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.27...v0.0.28 + +## \[0.0.27] - 2023-09-16 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.26...v0.0.27 + +## \[0.0.26] - 2023-09-16 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.25...v0.0.26 + +## \[0.0.25] - 2023-09-16 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.24...v0.0.25 + +## \[0.0.24] - 2023-09-16 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.23...v0.0.24 + +## \[0.0.23] - 2023-09-16 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.22...v0.0.23 + +## \[0.0.22] - 2023-09-16 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.21...v0.0.22 + +## \[0.0.21] - 2023-09-16 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.20...v0.0.21 + +## \[0.0.20] - 2023-09-15 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.19...v0.0.20 + +## \[0.0.19] - 2023-09-12 + +- Obj.update (@VldMrgnn, #16) + +## \[0.0.18] - 2023-09-10 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.17...v0.0.18 + +## \[0.0.17] - 2023-09-10 + +- schema concept (@neurosnap, #13) + +## \[0.0.16] - 2023-08-28 + +- Use redux (@neurosnap, #12) + +## \[0.0.15] - 2023-08-28 + +- Toolkit 2.0 (@neurosnap, #11) + +## \[0.0.14] - 2023-08-27 + +- refactor: `call()` to not be safe (@neurosnap, #9) + +## \[0.0.13] - 2023-07-30 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.12...v0.0.13 + +## \[0.0.12] - 2023-07-30 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.11...v0.0.12 + +## \[0.0.11] - 2023-07-30 + +- fix: event inside takeEvery can trigger same event (@neurosnap, #5) + +## \[0.0.10] - 2023-07-30 + +- fix: ensure compose mdw returns aggregate `Result` (@neurosnap, #6) + +## \[0.0.9] - 2023-07-15 + +- Full diff: https://github.com/fxforge/starfx/compare/v0.0.8...v0.0.9 + +## \[0.0.8] - 2023-07-14 + +- Immutable store proof-of-concept (@neurosnap, #2) + +## \[0.0.7] - 2023-07-11 + +- Full diff: https://github.com/fxforge/starfx/releases/tag/v0.0.7 + +## \[0.0.6] - 2023-07-11 + +- Full diff: https://github.com/fxforge/starfx/releases/tag/v0.0.6 + +## \[0.0.5] - 2023-07-11 + +- Full diff: https://github.com/fxforge/starfx/releases/tag/v0.0.5 + +## \[0.0.4] - 2023-05-21 + +- Full diff: https://github.com/fxforge/starfx/releases/tag/v0.0.4 + +## \[0.0.3] - 2023-05-20 + +- Full diff: https://github.com/fxforge/starfx/releases/tag/v0.0.3 + +## \[0.0.2] - 2023-05-20 + +- Full diff: https://github.com/fxforge/starfx/releases/tag/v0.0.2 + +## \[0.0.1] - 2023-05-20 + +- Full diff: https://github.com/fxforge/starfx/releases/tag/v0.0.1 diff --git a/package-lock.json b/package-lock.json index e6e89d7..6f9d7b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "starfx", - "version": "0.16.0-beta.0", + "version": "0.16.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "starfx", - "version": "0.16.0-beta.0", + "version": "0.16.0", "license": "MIT", "dependencies": { "immer": "^11.1.3", @@ -1013,7 +1013,6 @@ "integrity": "sha512-LNdjOkUDlU1RZb8e1kOIUpN1qQUlzGkEtbVNo53vbrwDg5om6oduhm4SiUaPW5ASTXhAiP0jInWG8Qx9fVlOeQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~6.21.0" } @@ -1024,7 +1023,6 @@ "integrity": "sha512-JeG0rEWak0N6Itr6QUx+X60uQmN+5t3j9r/OVDtWzFXKaj6kD1BwJzOksD0FF6iWxZlbE1kB0q9vtnU2ekqa1Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -1666,7 +1664,6 @@ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -1735,7 +1732,6 @@ "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -1994,7 +1990,6 @@ "integrity": "sha512-gK5GVzDkJK1SI1zwHf32Mqxf2tSJkNx+eYcNly5+nHvWqXUJYUkWBQtKauoESz3ymezAI++ZwT855x5p5eop+Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "~0.25.0", "get-tsconfig": "^4.7.5" @@ -2059,7 +2054,6 @@ "integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", diff --git a/package.json b/package.json index 77c501f..6e0c146 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "starfx", - "version": "0.16.0-beta.0", + "version": "0.16.0", "description": "A micro-mvc framework for react apps", "type": "module", "files": ["/dist"],