@sudobility/subscription_service 1.0.2 → 1.0.4

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 (2) hide show
  1. package/CLAUDE.md +46 -0
  2. package/package.json +1 -1
package/CLAUDE.md CHANGED
@@ -8,6 +8,7 @@ Shared backend library for subscription management using RevenueCat.
8
8
 
9
9
  - **Language**: TypeScript (strict mode)
10
10
  - **Runtime**: Bun
11
+ - **Package Manager**: Bun (do not use npm/yarn/pnpm for installing dependencies)
11
12
  - **Build**: TypeScript compiler (ESM)
12
13
  - **Test**: vitest
13
14
 
@@ -106,3 +107,48 @@ APIs using this library:
106
107
  bun run verify # All checks
107
108
  npm publish # Publish to npm
108
109
  ```
110
+
111
+ ## Workspace Context
112
+
113
+ This project is part of the **ShapeShyft** multi-project workspace at the parent directory. See `../CLAUDE.md` for the full architecture, dependency graph, and build order.
114
+
115
+ ## Downstream Impact
116
+
117
+ | Downstream Consumer | Relationship |
118
+ |---------------------|-------------|
119
+ | `shapeshyft_api` | Direct dependency - uses SubscriptionHelper for entitlement checks |
120
+
121
+ After making changes:
122
+ 1. `bun run verify` in this project (includes tests)
123
+ 2. `npm publish`
124
+ 3. In `shapeshyft_api`: `bun update @sudobility/subscription_service` then rebuild
125
+
126
+ ## Local Dev Workflow
127
+
128
+ ```bash
129
+ # In this project:
130
+ bun link
131
+
132
+ # In shapeshyft_api:
133
+ bun link @sudobility/subscription_service
134
+
135
+ # Rebuild after changes:
136
+ bun run build
137
+
138
+ # When done, unlink:
139
+ bun unlink @sudobility/subscription_service && bun install
140
+ ```
141
+
142
+ ## Pre-Commit Checklist
143
+
144
+ ```bash
145
+ bun run verify # Runs: typecheck -> lint -> test -> build
146
+ ```
147
+
148
+ ## Gotchas
149
+
150
+ - **No peer dependencies** -- this package is fully self-contained (`"peerDependencies": {}`).
151
+ - **RevenueCat API key is a server-side secret** -- never expose it to the client.
152
+ - **`testMode` controls sandbox filtering** -- in production, always pass `false`. Passing `true` includes sandbox purchases with fake entitlements.
153
+ - **`NONE_ENTITLEMENT` is the string `"none"`** -- it is a constant, not null/undefined. Always compare with `NONE_ENTITLEMENT`.
154
+ - **ESM-only output** -- no CJS build.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/subscription_service",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Shared subscription management library using RevenueCat for entitlements",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",