refactor: adopt module system from effect-smol#746
Conversation
…bmodules) Agent-Logs-Url: https://github.com/effect-app/libs/sessions/371677a9-cd42-4d66-8e2d-0adf2da862df Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
|
@copilot 4 should not be needed. Why would the module extensions not activate? Should we add them loaded into Option module wrapper so they auto load on import * as Option from "effect-app/Option" ? |
|
@copilot fox checks |
… revert Option.value workarounds Agent-Logs-Url: https://github.com/effect-app/libs/sessions/1d56ee50-d3a9-4a84-bbe0-4d034a977447 Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
The root cause was that Fixed in 49d42bb by adding |
Agent-Logs-Url: https://github.com/effect-app/libs/sessions/230e0782-b314-4ded-9974-2c77701bb91e Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
Fixed in 2ce9c1a. The CI was failing with |
|
@copilot don't import anything from any root barrel "effect-app", "effect", "@effect-app/*". |
|
@copilot force running with pnpm 10 and undo the pnpm lock changes etc |
Agent-Logs-Url: https://github.com/effect-app/libs/sessions/77e4c9d1-b1d8-4240-a155-6ff6cc6c2369 Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
Done in 0d20c39. All root barrel imports have been replaced with specific submodule imports:
|
Agent-Logs-Url: https://github.com/effect-app/libs/sessions/b9f915de-e0b2-4fb2-b852-4f689aea20f5 Co-authored-by: patroza <42661+patroza@users.noreply.github.com>
Adopts the module system pattern from effect-smol:
Changes
1. No barrel imports from any root package index
Replaced all barrel imports from
"effect-app","effect", and"@effect-app/*"root indices with specific submodule imports throughout packages/infra, packages/vue, packages/vue-components, packages/effect-app, and packages/cli.2. Use
import * as X from "package/Module"styleEach module namespace is now imported directly from its submodule path:
import * as Effect from "effect-app/Effect",import * as Context from "effect-app/Context",import * as S from "effect-app/Schema", etc.import * as Cause from "effect/Cause",import * as Exit from "effect/Exit",import * as Data from "effect/Data", etc.flow,pipe,identity) imported from"effect/Function"(not the"effect"root barrel)@effect-app/vuebarrel replaced with specific submodules:/mutate,/lib,/makeClient,/makeContext,/makeIntl3. Remove barrel
export * from "effect"from effect-app indexThe
export * from "effect"barrel inpackages/effect-app/src/index.tshas been removed.4. Auto-load module augmentations via submodule entry points
packages/effect-app/src/Option.tsincludesimport "./builtin.js"so that thedeclare module "effect/Option"augmentations (e.g.None<A>.value) activate automatically whenever a file doesimport * as Option from "effect-app/Option", without requiring the barrel index to be loaded first.5. Fix duplicate imports
Several files had duplicate imports of the same module with different aliases (e.g.,
import * as Schema from "effect/Schema"andimport * as S from "effect/Schema"). Consolidated these into single imports.Stats