Skip to content

Commit 3b211e2

Browse files
chore: finalize package release workflow
1 parent 1a4a68f commit 3b211e2

17 files changed

Lines changed: 223 additions & 230 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
with:
3636
node-version: 24
3737
cache: pnpm
38-
cache-dependency-path: examples/pokemon/pnpm-lock.yaml
38+
cache-dependency-path: |
39+
pnpm-lock.yaml
40+
examples/pokemon/pnpm-lock.yaml
41+
- run: pnpm --dir ../.. install --frozen-lockfile
42+
- run: pnpm --dir ../.. build
3943
- run: pnpm install --frozen-lockfile
4044
- run: pnpm check

NOTICE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
This package incubates the Machine work proposed in Effect PR #6429.
2-
31
Portions are adapted from the Effect project, which is distributed under the
42
MIT License. See https://github.com/Effect-TS/effect and the source history for
53
authorship and provenance.

README.md

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
Schema-first state machines and statecharts for Effect.
44

5-
This package is the external home for the Machine API proposed in
6-
[Effect PR #6429](https://github.com/Effect-TS/effect/pull/6429). During
7-
incubation this repository is the canonical implementation; the synchronization
8-
tool keeps the Effect PR mechanically aligned without maintaining a second
9-
implementation.
10-
115
> Early-release software: APIs may change, and releases are coupled to an exact
126
> Effect beta.
137
@@ -395,49 +389,18 @@ pnpm check
395389
```
396390

397391
Individual commands are available for `build`, `test`, `test:types`,
398-
`typecheck`, `format:check`, `test:consumer`, `test:sync`, `sync:check`, and
399-
`pack:check`. Runtime tests use `@effect/vitest`; type tests use TSTyche and
400-
TypeScript 6.0.3. The consumer check packs the package, imports all public
401-
entrypoints, and compiles a strict TypeScript consumer with
402-
`skipLibCheck: false`.
403-
404-
## Synchronizing Effect PR #6429
405-
406-
Make logic changes here first and run `pnpm check`. Then generate the mapped
407-
production files, runtime tests, and type tests into a writable Effect checkout:
408-
409-
```sh
410-
pnpm sync:effect -- /path/to/effect
411-
```
412-
413-
The explicit mapping covers only the eight production files and six test files.
414-
It rewrites package imports to Effect repository-relative `.ts` imports and
415-
restores Effect's private `PipeInspectableProto` boundary. It never copies
416-
package metadata, documentation, release files, or changesets.
417-
418-
Check an existing checkout without writing:
419-
420-
```sh
421-
pnpm sync:effect -- --check /path/to/effect
422-
```
423-
424-
Check mode exits non-zero on any drift. `pnpm test:sync` exercises generation,
425-
a clean check, and drift detection in a disposable temporary directory. Never
426-
generate into a checkout with work you have not reviewed. After generation,
427-
inspect the Effect diff and run its targeted machine, reactivity, cluster, and
428-
type-test validations followed by `pnpm check`.
429-
430-
The current source reference is branch `sandro/state-charts` in the Effect
431-
repository. Exact dependency pins and the sync check are the proof boundary;
432-
vendoring the rest of Effect is intentionally unnecessary.
392+
`typecheck`, `format:check`, `test:consumer`, and `pack:check`. Runtime tests use
393+
`@effect/vitest`; type tests use TSTyche and TypeScript 6.0.3. The consumer check
394+
packs the package, imports all public entrypoints, and compiles a strict
395+
TypeScript consumer with `skipLibCheck: false`.
433396

434397
## Examples
435398

436399
The [Pokémon statechart example](./examples/pokemon) is a standalone React and
437400
Vite project demonstrating compound and parallel states, state-scoped invokes,
438-
invoked child statecharts, typed emissions, and Atom reactivity. It installs the
439-
published package from npm, so its dependency graph, lockfile, build, and CI job
440-
are isolated from this library package.
401+
invoked child statecharts, typed emissions, and Atom reactivity. It uses a local
402+
`file:` dependency on this package while retaining an isolated dependency graph,
403+
lockfile, build, and CI job.
441404

442405
## Releases
443406

examples/pokemon/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
A standalone React and Vite application demonstrating parent, child, parallel,
44
and invoked Effect machines with a live PokéAPI integration.
55

6-
This project intentionally installs `@typeonce/effect-machine@0.1.0` from npm.
7-
It does not use the repository's local source or a workspace dependency.
6+
This project installs `@typeonce/effect-machine` from the repository root
7+
through a local `file:` dependency. It keeps an independent lockfile and
8+
dependency graph while validating the current library build.
89

910
```sh
1011
pnpm install --frozen-lockfile

examples/pokemon/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@typeonce/effect-machine-example-pokemon",
33
"version": "0.0.0",
44
"private": true,
5-
"description": "Pokémon statechart example using the published @typeonce/effect-machine package",
5+
"description": "Pokémon statechart example using the local @typeonce/effect-machine package",
66
"type": "module",
77
"scripts": {
88
"dev": "vite",
@@ -13,7 +13,7 @@
1313
"dependencies": {
1414
"@effect/atom-react": "4.0.0-beta.102",
1515
"@tanstack/react-router": "1.170.18",
16-
"@typeonce/effect-machine": "0.1.0",
16+
"@typeonce/effect-machine": "file:../..",
1717
"effect": "4.0.0-beta.102",
1818
"react": "19.2.7",
1919
"react-dom": "19.2.7",

examples/pokemon/pnpm-lock.yaml

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/pokemon/pnpm-workspace.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ packages:
44
overrides:
55
effect: 4.0.0-beta.102
66
"@effect/atom-react": 4.0.0-beta.102
7-
"@typeonce/effect-machine": 0.1.0
87

98
minimumReleaseAge: 1440
109
minimumReleaseAgeExclude:
1110
- effect@4.0.0-beta.102
1211
- "@effect/atom-react@4.0.0-beta.102"
13-
- "@typeonce/effect-machine"
1412
- vite@8.1.5
1513
- "@vitejs/plugin-react@6.0.4"

examples/pokemon/src/machine.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Atom } from "effect/unstable/reactivity"
44
import { AtomMachine } from "@typeonce/effect-machine/reactivity"
55
import { ReplaceMachine } from "./machines/replace.ts"
66
import { SelectionMachine } from "./machines/selection.ts"
7-
import { Pokemon, PokemonService } from "./pokemon.ts"
7+
import { Pokemon, PokemonService, ReplaceInTeam } from "./pokemon.ts"
88

99
class ActiveTeam extends Schema.TaggedClass<ActiveTeam>("ActiveTeam")("ActiveTeam", {
1010
team: Schema.Array(Pokemon)
@@ -17,7 +17,7 @@ export const ReplaceChild = Machine.child("replace", ReplaceMachine)
1717

1818
const machine = Machine.make({
1919
states: States.states,
20-
events: [...SelectionMachine.emits, ...ReplaceMachine.emits],
20+
events: [ReplaceInTeam],
2121
initial: Effect.fn(function* () {
2222
const pk = yield* PokemonService
2323
const team = yield* pk.getRandomTeam()

examples/pokemon/src/machines/replace.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Effect, Schema } from "effect"
22
import { Machine } from "@typeonce/effect-machine"
3-
import { Pokemon, PokemonService } from "../pokemon.ts"
3+
import { Pokemon, PokemonService, ReplaceInTeam } from "../pokemon.ts"
44

55
class Idle extends Schema.TaggedClass<Idle>("Idle")("Idle", {}) {}
66

@@ -18,13 +18,6 @@ class Replaced extends Schema.TaggedClass<Replaced>("Replaced")("Replaced", {
1818
pokemon: Pokemon
1919
}) {}
2020

21-
/** Emits */
22-
23-
class ReplaceInTeam extends Schema.TaggedClass<ReplaceInTeam>("ReplaceInTeam")("ReplaceInTeam", {
24-
id: Pokemon.fields.id,
25-
pokemon: Pokemon
26-
}) {}
27-
2821
const ReplaceWithRandomMachine = Machine.invoke({
2922
id: "replaceWithRandom",
3023
src: () =>

examples/pokemon/src/machines/selection.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Effect, Option, Schema } from "effect"
22
import { Machine } from "@typeonce/effect-machine"
3-
import { Pokemon, PokemonService } from "../pokemon.ts"
3+
import { Pokemon, PokemonService, ReplaceInTeam } from "../pokemon.ts"
44

55
class Form extends Schema.TaggedClass<Form>("Form")("Form", {}) {}
66

@@ -42,13 +42,6 @@ class ReplacePokemon extends Schema.TaggedClass<ReplacePokemon>("ReplacePokemon"
4242
id: Pokemon.fields.id
4343
}) {}
4444

45-
/** Emits */
46-
47-
class ReplaceInTeam extends Schema.TaggedClass<ReplaceInTeam>("ReplaceInTeam")("ReplaceInTeam", {
48-
id: Pokemon.fields.id,
49-
pokemon: Pokemon
50-
}) {}
51-
5245
const SearchMachine = ({ searchText }: { searchText: string }) =>
5346
Machine.invoke({
5447
id: "search",

0 commit comments

Comments
 (0)