@meadow-studio/platform 0.0.0-stage → 0.1.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 (79) hide show
  1. package/MeadowPlatform.podspec +17 -0
  2. package/Package.swift +23 -0
  3. package/README.md +147 -2
  4. package/android/build.gradle +42 -0
  5. package/android/src/main/AndroidManifest.xml +1 -0
  6. package/android/src/main/java/app/meadow/platform/MeadowAppRatingPlugin.java +38 -0
  7. package/dist/cli/commands.d.ts +74 -0
  8. package/dist/cli/commands.d.ts.map +1 -0
  9. package/dist/cli/commands.js +1062 -0
  10. package/dist/cli/commands.js.map +1 -0
  11. package/dist/cli/config.d.ts +123 -0
  12. package/dist/cli/config.d.ts.map +1 -0
  13. package/dist/cli/config.js +428 -0
  14. package/dist/cli/config.js.map +1 -0
  15. package/dist/cli/meadow.d.ts +8 -0
  16. package/dist/cli/meadow.d.ts.map +1 -0
  17. package/dist/cli/meadow.js +463 -0
  18. package/dist/cli/meadow.js.map +1 -0
  19. package/dist/cli/recipes.d.ts +10 -0
  20. package/dist/cli/recipes.d.ts.map +1 -0
  21. package/dist/cli/recipes.js +575 -0
  22. package/dist/cli/recipes.js.map +1 -0
  23. package/dist/cli/sync.d.ts +14 -0
  24. package/dist/cli/sync.d.ts.map +1 -0
  25. package/dist/cli/sync.js +310 -0
  26. package/dist/cli/sync.js.map +1 -0
  27. package/dist/cli/templates.d.ts +27 -0
  28. package/dist/cli/templates.d.ts.map +1 -0
  29. package/dist/cli/templates.js +1246 -0
  30. package/dist/cli/templates.js.map +1 -0
  31. package/dist/cli/website.d.ts +5 -0
  32. package/dist/cli/website.d.ts.map +1 -0
  33. package/dist/cli/website.js +262 -0
  34. package/dist/cli/website.js.map +1 -0
  35. package/dist/index.d.ts +5 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +5 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/notifications.d.ts +119 -0
  40. package/dist/notifications.d.ts.map +1 -0
  41. package/dist/notifications.js +320 -0
  42. package/dist/notifications.js.map +1 -0
  43. package/dist/platform.d.ts +163 -0
  44. package/dist/platform.d.ts.map +1 -0
  45. package/dist/platform.js +623 -0
  46. package/dist/platform.js.map +1 -0
  47. package/dist/purchases.d.ts +88 -0
  48. package/dist/purchases.d.ts.map +1 -0
  49. package/dist/purchases.js +296 -0
  50. package/dist/purchases.js.map +1 -0
  51. package/dist/ui/app-build.component.d.ts +18 -0
  52. package/dist/ui/app-build.component.d.ts.map +1 -0
  53. package/dist/ui/app-build.component.js +56 -0
  54. package/dist/ui/app-build.component.js.map +1 -0
  55. package/dist/ui/app-build.model.d.ts +11 -0
  56. package/dist/ui/app-build.model.d.ts.map +1 -0
  57. package/dist/ui/app-build.model.js +18 -0
  58. package/dist/ui/app-build.model.js.map +1 -0
  59. package/dist/ui/app-links.component.d.ts +14 -0
  60. package/dist/ui/app-links.component.d.ts.map +1 -0
  61. package/dist/ui/app-links.component.js +77 -0
  62. package/dist/ui/app-links.component.js.map +1 -0
  63. package/dist/ui/app-links.model.d.ts +18 -0
  64. package/dist/ui/app-links.model.d.ts.map +1 -0
  65. package/dist/ui/app-links.model.js +17 -0
  66. package/dist/ui/app-links.model.js.map +1 -0
  67. package/dist/ui/index.d.ts +5 -0
  68. package/dist/ui/index.d.ts.map +1 -0
  69. package/dist/ui/index.js +5 -0
  70. package/dist/ui/index.js.map +1 -0
  71. package/docs/CLI.md +376 -0
  72. package/docs/PLATFORM_GUIDE.md +422 -0
  73. package/docs/POC_FINDINGS.md +218 -0
  74. package/docs/PROJECT_BRIEF.md +501 -0
  75. package/docs/RELEASING.md +49 -0
  76. package/docs/V0.1_PATH.md +310 -0
  77. package/ios/Sources/MeadowPlatformPlugin/MeadowAppRatingPlugin.swift +39 -0
  78. package/package.json +89 -4
  79. package/schema/meadow-config.schema.json +250 -0
@@ -0,0 +1,501 @@
1
+ # Meadow Platform — Project Brief
2
+
3
+ ## Purpose
4
+
5
+ Meadow Platform is a private internal platform for building, shipping, and maintaining a growing portfolio of small mobile apps.
6
+
7
+ There are already 15+ planned apps, and more are expected over time.
8
+
9
+ The motivation comes primarily from building Stay Light. Developing the core product was only part of the work required to make the app release-ready. A significant amount of time was spent repeatedly solving infrastructure and release problems such as:
10
+
11
+ - RevenueCat integration
12
+ - Analytics
13
+ - Native iOS/Android configuration
14
+ - App Store and Google Play configuration
15
+ - Privacy and GDPR considerations
16
+ - Store metadata
17
+ - Screenshots and marketing assets
18
+ - Build configuration
19
+ - Testing
20
+ - Release preparation
21
+
22
+ Meadow Platform exists to make this work reusable, standardized, and increasingly automated.
23
+
24
+ The core principle is:
25
+
26
+ > Never solve the same generic app infrastructure problem twice.
27
+
28
+ ## Overall Architecture
29
+
30
+ Apps may conceptually use three layers:
31
+
32
+ ```text
33
+ Meadow Design
34
+ ↓
35
+ Meadow Platform
36
+ ↓
37
+ Individual App
38
+ ```
39
+
40
+ Or:
41
+
42
+ ```text
43
+ Meadow Design → How apps look
44
+ Meadow Platform → How apps work and get shipped
45
+ App → The unique product/domain logic
46
+ ```
47
+
48
+ Meadow Design and Meadow Platform are separate concerns.
49
+
50
+ Meadow Design is an optional reusable design system. It is not part of the generated platform
51
+ foundation, and applications such as 24h Pushups can own a completely different visual language.
52
+
53
+ Meadow Platform provides reusable application infrastructure, integrations, configuration, tooling,
54
+ and release guardrails, with further automation added only when real release work proves its value.
55
+
56
+ Individual apps should contain as little generic infrastructure as reasonably possible.
57
+
58
+ ## Repository Strategy
59
+
60
+ Meadow Platform and Meadow Design live as independent projects in the same private repository. They
61
+ have separate package manifests, builds, tests, and ownership boundaries. Meadow Design remains
62
+ optional for every application; the platform does not depend on it.
63
+
64
+ Individual apps live in their own repositories. Each repository keeps the mobile app at its root
65
+ and a separate, app-owned `website/` project for its public app reference, support, and legal pages.
66
+ This keeps the app and site together for review and release work without making the website a
67
+ platform runtime dependency. A planned base domain can give each app a subdomain; hosting and domain
68
+ ownership remain outside the CLI.
69
+
70
+ Example:
71
+
72
+ ```text
73
+ meadow-platform/
74
+ platform/
75
+ design/
76
+
77
+ stay-light/
78
+ 24h-pushups/
79
+ media-archive/
80
+ swipe-for-dinner/
81
+ ...
82
+ ```
83
+
84
+ Meadow Platform should initially be distributed as ONE dependency:
85
+
86
+ ```text
87
+ @meadow-studio/platform
88
+ ```
89
+
90
+ Do NOT prematurely split the platform into many packages such as:
91
+
92
+ ```text
93
+ @meadow/analytics
94
+ @meadow/purchases
95
+ @meadow/privacy
96
+ @meadow/storage
97
+ ```
98
+
99
+ Internal modularization is encouraged, but externally the platform should remain one dependency until there is a concrete reason to split it.
100
+
101
+ This keeps dependency management and versioning simple across many apps.
102
+
103
+ ## Privacy / Ownership
104
+
105
+ `@meadow-studio/platform` is a public npm package so new app repositories can install it and run CI
106
+ without per-repository credentials. The source repository may remain private, but everything in
107
+ the published package can be downloaded and inspected. Applications pin exact npm versions.
108
+
109
+ Secrets must NEVER be included in Meadow Platform.
110
+
111
+ Examples:
112
+
113
+ - RevenueCat credentials
114
+ - Firebase credentials/secrets
115
+ - App Store credentials
116
+ - Google Play credentials
117
+ - Signing credentials
118
+
119
+ App/environment-specific configuration must be supplied externally.
120
+
121
+ ## Versioning
122
+
123
+ Meadow Platform is versioned independently from applications.
124
+
125
+ Example:
126
+
127
+ ```text
128
+ @meadow-studio/platform 0.1.0
129
+ ```
130
+
131
+ Applications should be able to stay on known working platform versions and upgrade intentionally.
132
+
133
+ During early development, prefer explicit/pinned versions rather than automatically accepting platform upgrades.
134
+
135
+ Use semantic versioning:
136
+
137
+ ```text
138
+ PATCH → backwards-compatible bug fix
139
+ MINOR → backwards-compatible functionality
140
+ MAJOR → breaking platform API change
141
+ ```
142
+
143
+ The platform should maintain a deliberately small public API.
144
+
145
+ Avoid exposing implementation details of third-party services.
146
+
147
+ For example, applications should ideally use:
148
+
149
+ ```ts
150
+ purchases.isPremium();
151
+ ```
152
+
153
+ rather than directly depending on:
154
+
155
+ ```ts
156
+ RevenueCatCustomerInfo.entitlements.active[...]
157
+ ```
158
+
159
+ Similarly:
160
+
161
+ ```ts
162
+ analytics.track('challenge_created');
163
+ ```
164
+
165
+ rather than importing and using Firebase throughout application code.
166
+
167
+ This allows underlying providers to change without requiring large migrations across every app.
168
+
169
+ ## Technology Context
170
+
171
+ The current shared app foundation uses:
172
+
173
+ - Angular 22
174
+ - Capacitor 8
175
+ - TypeScript
176
+ - Firebase Analytics and Crashlytics
177
+
178
+ Ionic and Meadow Design are app-owned choices, not Meadow Platform dependencies.
179
+
180
+ Stay Light is the first major reference application.
181
+
182
+ 24h Pushups is the first POC consumer of Meadow Platform.
183
+
184
+ ## Development Philosophy
185
+
186
+ Do NOT attempt to design the entire platform upfront.
187
+
188
+ Meadow Platform should grow organically from actual repeated needs discovered while building applications.
189
+
190
+ The intended progression is:
191
+
192
+ ```text
193
+ Stay Light
194
+ ↓
195
+ Extract proven generic patterns
196
+ ↓
197
+ Meadow Platform v0.1
198
+ ↓
199
+ 24h Pushups
200
+ ↓
201
+ Discover repeated infrastructure/problems
202
+ ↓
203
+ Meadow Platform v0.2
204
+ ↓
205
+ App #3
206
+ ↓
207
+ Meadow Platform v0.3
208
+ ↓
209
+ ...
210
+ ↓
211
+ 15+ apps
212
+ ```
213
+
214
+ Stay Light acts as a donor/reference implementation.
215
+
216
+ Do not blindly copy Stay Light architecture into Meadow Platform.
217
+
218
+ Whenever code is considered for extraction, ask:
219
+
220
+ > Is this genuinely generic application infrastructure, or is this Stay Light-specific product logic?
221
+
222
+ Only generic concerns belong in Meadow Platform.
223
+
224
+ ## Original MVP
225
+
226
+ This section records the intentionally small v0.1 boundary that established the package before the
227
+ current CLI foundation existed. See [PLATFORM_GUIDE.md](PLATFORM_GUIDE.md) for current capabilities.
228
+
229
+ The first goal is NOT:
230
+
231
+ > Automate everything required to ship an app.
232
+
233
+ The first goal is:
234
+
235
+ > Prove that the second app can reuse infrastructure instead of rebuilding it.
236
+
237
+ Initial candidates include:
238
+
239
+ ### App configuration
240
+
241
+ Provide a typed central configuration mechanism.
242
+
243
+ Conceptually:
244
+
245
+ ```ts
246
+ provideMeadowPlatform({
247
+ app: {
248
+ name: '24h Pushups',
249
+ supportEmail: '...',
250
+ privacyUrl: '...'
251
+ },
252
+
253
+ analytics: {
254
+ enabled: true
255
+ },
256
+
257
+ purchases: {
258
+ enabled: true,
259
+ entitlement: 'premium'
260
+ }
261
+ });
262
+ ```
263
+
264
+ Exact APIs are not finalized.
265
+
266
+ Do not treat examples in this document as immutable API requirements.
267
+
268
+ ### Analytics
269
+
270
+ Extract/generalize the proven analytics approach from Stay Light.
271
+
272
+ Applications should interact with a Meadow abstraction rather than Firebase directly.
273
+
274
+ Conceptually:
275
+
276
+ ```ts
277
+ analytics.track('challenge_created');
278
+ ```
279
+
280
+ The implementation may initially use Firebase.
281
+
282
+ ### Purchases
283
+
284
+ Generalize the RevenueCat integration proven in Stay Light.
285
+
286
+ Meadow Platform should eventually encapsulate concerns such as:
287
+
288
+ - initialization
289
+ - entitlement state
290
+ - premium state
291
+ - purchases
292
+ - restore purchases
293
+ - customer info
294
+ - errors
295
+ - synchronization
296
+
297
+ Applications should not need intimate knowledge of RevenueCat APIs.
298
+
299
+ Conceptually:
300
+
301
+ ```ts
302
+ purchases.isPremium();
303
+ purchases.purchase(...);
304
+ purchases.restore();
305
+ ```
306
+
307
+ Do not prematurely move application-specific premium UI into the platform.
308
+
309
+ Meadow Design/application code can remain responsible for UI until a genuinely reusable pattern emerges.
310
+
311
+ ### App Information
312
+
313
+ Provide simple generic access to information such as:
314
+
315
+ - application version
316
+ - build number
317
+ - platform
318
+
319
+ This can later be used by About pages, diagnostics, feedback, etc.
320
+
321
+ ### Environment / Configuration
322
+
323
+ Establish a consistent mechanism for supplying app-specific and environment-specific configuration.
324
+
325
+ Meadow Platform itself must not contain application secrets.
326
+
327
+ ## Explicitly NOT v0.1
328
+
329
+ This section records the original v0.1 boundary. The create-app CLI, screenshot automation, and
330
+ release checks were later explicitly requested and are implemented as the v0.2 tooling direction.
331
+
332
+ The create-app CLI, screenshot testing, and release checks were later implemented after explicit
333
+ product requirements established their value.
334
+
335
+ The following remain outside the current platform unless real app work proves the need:
336
+
337
+ - App Store upload automation
338
+ - Google Play upload automation
339
+ - privacy policy generator
340
+ - GDPR generator
341
+ - Supabase abstraction
342
+ - storage abstraction
343
+ - feedback backend
344
+ - feature flag framework
345
+ - release dashboard
346
+ - complex plugin architecture
347
+
348
+ These should only be introduced when actual application development demonstrates the need.
349
+
350
+ Avoid platform-building for hypothetical future requirements.
351
+
352
+ ## Current and future tooling direction
353
+
354
+ Meadow Platform has expanded beyond runtime infrastructure into developer tooling. The current entry
355
+ points are:
356
+
357
+ ```text
358
+ meadow new media-archive
359
+ meadow init
360
+ ```
361
+
362
+ The developer can create a complete foundation or conservatively add the Meadow control plane to a
363
+ supported existing app. Core app metadata, devices, RevenueCat and Supabase setup can be configured,
364
+ and local data or local notifications can be added after creation. A generated repository includes Angular, Capacitor,
365
+ Firebase dependencies, native projects, tests, screenshot comparison, CI, and release guardrails.
366
+
367
+ Additional proven capability recipes may eventually include cloud sync or other
368
+ infrastructure that appears repeatedly across real applications.
369
+
370
+ The result is a release-oriented starting point rather than a blank application. Further tooling
371
+ should be added only when real app work demonstrates that it removes repeated effort.
372
+
373
+ ## Release automation direction
374
+
375
+ One of the largest goals remains reducing the work between:
376
+
377
+ ```text
378
+ "The product works"
379
+ ```
380
+
381
+ and:
382
+
383
+ ```text
384
+ "The product is released."
385
+ ```
386
+
387
+ The current release gate is:
388
+
389
+ ```text
390
+ meadow release-check
391
+ ```
392
+
393
+ It currently combines configuration diagnostics with formatting, linting, unit tests, production
394
+ web builds, screenshot comparisons, and selected native builds. Generated app CI runs the same
395
+ categories on pull requests.
396
+
397
+ The generated release checklist and configuration also cover:
398
+
399
+ - successful production builds
400
+ - application icons
401
+ - splash assets
402
+ - bundle/application identifiers
403
+ - version numbers
404
+ - privacy configuration
405
+ - RevenueCat configuration
406
+ - production analytics configuration
407
+ - store metadata
408
+ - support/privacy URLs
409
+ - native manifests
410
+ - tests
411
+ - development URLs accidentally included in production
412
+ - other release prerequisites
413
+
414
+ Meadow Platform does not currently submit an app to either store. Future automation may assist with:
415
+
416
+ - App Store screenshot layouts
417
+ - Google Play screenshot layouts
418
+ - store metadata
419
+ - privacy questionnaires/checklists
420
+ - App Store Connect uploads
421
+ - Google Play uploads
422
+ - TestFlight/internal testing releases
423
+
424
+ Implement these only when a concrete app release proves the workflow and the automation saves
425
+ meaningful repeated work.
426
+
427
+ ## App creation model
428
+
429
+ Creating an app is now configuration plus domain development. `meadow new` collects app identity,
430
+ store links, platforms, orientation, devices, and optional service choices, then writes validated
431
+ `meadow.config.json` metadata and the complete repository foundation. The version 2 configuration is
432
+ the source of truth for durable project intent; `meadow sync` deterministically updates Meadow-owned web,
433
+ native, dependency, testing, and runtime configuration, while `meadow sync --check` prevents drift in
434
+ CI.
435
+
436
+ The configuration schema is versioned and exported by `@meadow-studio/platform`. Before the first external
437
+ consumer, prefer a clean current contract over compatibility layers. Extend the schema deliberately
438
+ when a proven capability needs persistent project metadata; do not put secrets in it or turn it
439
+ into a speculative feature catalogue.
440
+
441
+ ## Success Criteria
442
+
443
+ The long-term goal is:
444
+
445
+ > Go from an app idea to a release-ready Angular/Capacitor foundation in under an hour.
446
+
447
+ At that point development should immediately focus on the functionality that makes the application unique.
448
+
449
+ Likewise, once an application becomes feature-complete, getting it into App Store / Google Play should be a reproducible process rather than another project.
450
+
451
+ ## Important Engineering Principles
452
+
453
+ When working on Meadow Platform:
454
+
455
+ 1. Prefer proven requirements over hypothetical requirements.
456
+ 2. Keep the public API small.
457
+ 3. Hide third-party implementation details.
458
+ 4. Prefer configuration over duplicated implementation.
459
+ 5. Do not prematurely create abstractions.
460
+ 6. Do not prematurely split the platform into multiple packages.
461
+ 7. Keep application-specific UI and domain logic outside the platform.
462
+ 8. Never include secrets.
463
+ 9. Preserve backwards compatibility where practical.
464
+ 10. Prefer boring, maintainable solutions over clever framework machinery.
465
+ 11. Optimize for a solo developer maintaining 15+ relatively small apps.
466
+ 12. Every platform feature should save meaningful work in multiple applications.
467
+ 13. A feature being reusable in theory is not sufficient reason to add it.
468
+ 14. Stay Light is a reference implementation, not the architecture specification.
469
+ 15. 24h Pushups should be used as the first real validation of whether the abstractions are useful.
470
+
471
+ ## Current State
472
+
473
+ Meadow Platform is currently version `0.1.0` and has three working surfaces:
474
+
475
+ - the `meadow` CLI for app creation and existing-app adoption, capability recipes, integration setup,
476
+ diagnostics, versioning, and release checks;
477
+ - the public `@meadow-studio/platform` Angular/Capacitor runtime with app configuration, app information,
478
+ consent-gated Firebase analytics and crash reporting, provider-neutral native purchases, and
479
+ native app-rating and local-notification behavior; and
480
+ - the optional `@meadow-studio/platform/ui` entry point for small infrastructure-oriented components.
481
+
482
+ Generated apps use the Angular 22 and Capacitor 8 baseline and receive web, iOS, Android, unit,
483
+ visual, CI, and release foundations. The package release gate validates version consistency, unit
484
+ tests, the packed contents, and installation/type-check/runtime behavior in a clean consumer.
485
+
486
+ Not every installed provider is a complete runtime capability. Firebase observability has a
487
+ Meadow-owned consent and delivery boundary, RevenueCat sits behind a Meadow-owned purchase API, and
488
+ local notifications sit behind a Meadow-owned permission, scheduling, and tap-action API.
489
+ A Meadow-owned Supabase abstraction remains a future vertical slice. The
490
+ [platform guide](PLATFORM_GUIDE.md) is the canonical current capability map.
491
+
492
+ Continue incrementally. Do not introduce large architectural changes or dependencies without a
493
+ concrete repeated need from real applications.
494
+
495
+ ## North Star
496
+
497
+ Meadow Platform should make each subsequent app easier to build than the previous one.
498
+
499
+ If building Meadow Platform begins delaying application development more than it accelerates it, the platform is becoming too complex.
500
+
501
+ The applications drive the platform — not the other way around.
@@ -0,0 +1,49 @@
1
+ # Releasing Meadow Platform
2
+
3
+ `@meadow-studio/platform` is published as a public npm package. Each app pins an exact version and
4
+ commits its lockfile. App installation and CI need no Meadow package credentials or access to the
5
+ private source repository. The published package contents are public, so inspect the tarball before
6
+ each release and keep all credentials and app-specific configuration out of it.
7
+
8
+ ## Prepare
9
+
10
+ From `platform/`, check the current version and run the release gate:
11
+
12
+ ```sh
13
+ npm run version:check
14
+ npm run release:check
15
+ ```
16
+
17
+ Use `npm run version:set -- patch`, `minor`, `major`, or an exact `x.y.z` value when a new version
18
+ is needed, then rerun the gate. The release gate builds and tests the package, installs its actual
19
+ tarball in a clean consumer, verifies package contents, and checks for whitespace errors. Review
20
+ the `npm pack --dry-run` file list before publishing; files listed in `package.json` are available
21
+ to anyone after publication. Never include secrets or app-specific Firebase files.
22
+
23
+ ## Publish
24
+
25
+ The publisher needs an npm account with publish rights in the `@meadow-studio` scope and npm's required
26
+ publishing authentication. Once the reviewed version is ready:
27
+
28
+ ```sh
29
+ npm publish --access public
30
+ ```
31
+
32
+ `publishConfig` also fixes public access and the npm registry in the package manifest. The
33
+ `prepublishOnly` script reruns the release gate. npm versions are immutable; publish a new version
34
+ for every subsequent release. Keep the source repository private if desired, knowing that the
35
+ published tarball is public.
36
+
37
+ ## Consume and upgrade
38
+
39
+ Generated apps use an exact dependency, for example:
40
+
41
+ ```json
42
+ "@meadow-studio/platform": "0.1.0"
43
+ ```
44
+
45
+ Run `npm install` and commit the app manifest and lockfile. `meadow new` and `meadow init` also
46
+ accept `--platform-spec file:/absolute/path/to/platform` for local development before the npm
47
+ release exists. Replace that temporary spec with a published version and regenerate the lockfile
48
+ before relying on independent app CI. To upgrade, change the exact version, install, and run the
49
+ app checks and native builds.