create-disposabl-app 0.18.1 → 0.19.1

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 (24) hide show
  1. package/dist/disposabl.js +1 -1
  2. package/dist/index.js +11 -4
  3. package/dist/templates/default/.github/scripts/release.sh +12 -6
  4. package/dist/templates/default/.github/workflows/pipeline.yml +1 -538
  5. package/dist/templates/default/apps/mobile/eas.json +3 -1
  6. package/dist/templates/default/apps/mobile/modules/storefront-observer/README.md +9 -0
  7. package/dist/templates/default/apps/mobile/modules/storefront-observer/expo-module.config.json +1 -0
  8. package/dist/templates/default/apps/mobile/modules/storefront-observer/ios/StorefrontObserver.podspec +15 -0
  9. package/dist/templates/default/apps/mobile/modules/storefront-observer/ios/StorefrontObserverModule.swift +59 -0
  10. package/dist/templates/default/apps/mobile/modules/storefront-observer/package.json +7 -0
  11. package/dist/templates/default/apps/mobile/scripts/play-aab.mjs +61 -15
  12. package/dist/templates/default/apps/mobile/scripts/verify-play-aab.mjs +1 -1
  13. package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.api-keys.tsx +2 -1
  14. package/dist/templates/default/packages/disposabl-kit/client/lib/telemetry-lease.ts +8 -1
  15. package/dist/templates/default/packages/disposabl-kit/client/routes/pricing.tsx +53 -7
  16. package/dist/templates/default/packages/disposabl-kit/mobile/billing/storefront-observer.ts +45 -0
  17. package/dist/templates/default/packages/disposabl-kit/mobile/billing/web-checkout.ts +39 -7
  18. package/dist/templates/default/packages/tests/android-failure-workflow.test.ts +10 -4
  19. package/dist/templates/default/packages/tests/billing-setup-hooks.test.ts +17 -6
  20. package/dist/templates/default/packages/tests/components/mobile-storefront-observer.test.mjs +241 -0
  21. package/dist/templates/default/packages/tests/mobile-storefront-observer.test.ts +22 -0
  22. package/dist/templates/default/packages/tests/package-release.test.ts +121 -0
  23. package/dist/templates/default/packages/tests/ui-telemetry-lease.test.ts +46 -0
  24. package/package.json +1 -1
package/dist/disposabl.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // ../cli/auth.ts
4
4
  import { lock } from "proper-lockfile";
5
5
  // ../cli/package.json
6
- var version = "0.18.1";
6
+ var version = "0.19.1";
7
7
  var package_default = {
8
8
  name: "@disposabl/cli",
9
9
  version,
package/dist/index.js CHANGED
@@ -1563,7 +1563,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
1563
1563
  import { Command, CommanderError } from "commander";
1564
1564
  import * as p2 from "@clack/prompts";
1565
1565
  // package.json
1566
- var version = "0.18.1";
1566
+ var version = "0.19.1";
1567
1567
 
1568
1568
  // ../cli/telemetry.ts
1569
1569
  var import_proper_lockfile2 = __toESM(require_proper_lockfile(), 1);
@@ -9137,7 +9137,11 @@ import { existsSync } from "node:fs";
9137
9137
  import { readFile as readFile3, rm as rm3, writeFile as writeFile3 } from "node:fs/promises";
9138
9138
  import { join as join3, sep } from "node:path";
9139
9139
  var nativeBillingPath = join3("packages", "disposabl-kit", "mobile", "billing") + sep;
9140
- var nativeBillingTest = join3("packages", "tests", "native-billing.test.ts");
9140
+ var nativeBillingTests = [
9141
+ join3("packages", "tests", "native-billing.test.ts"),
9142
+ join3("packages", "tests", "mobile-storefront-observer.test.ts"),
9143
+ join3("packages", "tests", "components", "mobile-storefront-observer.test.mjs")
9144
+ ];
9141
9145
  var purchasesPackage = "react-native-purchases";
9142
9146
  var purchasesPackages = [purchasesPackage, "react-native-purchases-ui"];
9143
9147
  var dependencyFields = [
@@ -9192,7 +9196,8 @@ async function omitMobilePayments(root) {
9192
9196
  const source = await readFile3(path, "utf8");
9193
9197
  await writeFile3(path, source.replace(/^[ \t]*\/\/ payments:start\r?\n[\s\S]*?^[ \t]*\/\/ payments:end\r?\n/gm, "").replace(/^[ \t]*\{\/\* payments:start \*\/\}\r?\n[\s\S]*?^[ \t]*\{\/\* payments:end \*\/\}\r?\n/gm, ""));
9194
9198
  await rm3(join3(root, nativeBillingPath), { recursive: true, force: true });
9195
- await rm3(join3(root, nativeBillingTest), { force: true });
9199
+ for (const path of nativeBillingTests)
9200
+ await rm3(join3(root, path), { force: true });
9196
9201
  }
9197
9202
 
9198
9203
  // ../disposabl-kit/android-architectures.ts
@@ -9287,6 +9292,8 @@ For Disposabl development and delivery, read [.agents/skills/disposabl-app/SKILL
9287
9292
  await rm4(join4(tests, entry));
9288
9293
  }
9289
9294
  if (!folders.includes("apps/mobile")) {
9295
+ for (const path of nativeBillingTests)
9296
+ await rm4(join4(destination, path), { force: true });
9290
9297
  await rm4(join4(tests, "helpers/mobile-simulator"), {
9291
9298
  recursive: true,
9292
9299
  force: true
@@ -9613,7 +9620,7 @@ async function reconfigureApp(template, directory, version, options) {
9613
9620
  }
9614
9621
  }
9615
9622
  for (const path of oldFiles) {
9616
- if (nextFiles.has(path) || !(path.startsWith(nativeBillingPath) || path === nativeBillingTest || disableAuth && authStarterPaths.some((authPath) => path === authPath || path.startsWith(authPath + sep2))))
9623
+ if (nextFiles.has(path) || !(path.startsWith(nativeBillingPath) || nativeBillingTests.includes(path) || disableAuth && authStarterPaths.some((authPath) => path === authPath || path.startsWith(authPath + sep2))))
9617
9624
  continue;
9618
9625
  const current = await safeRead(directory, path);
9619
9626
  if (!current)
@@ -8,15 +8,21 @@ platform=$PACKAGE
8
8
  bun run generate
9
9
  bun run --cwd "packages/$PACKAGE" typecheck
10
10
  name=$(node -p "require('./packages/$PACKAGE/package.json').name")
11
- if ! previous=$(npm view "$name" version 2>/dev/null); then
12
- node .github/scripts/disposabl.mjs report "$platform" blocked 'Publish the package once and configure npm trusted publishing.'
13
- exit 0
14
- fi
15
11
  node .github/scripts/disposabl.mjs report "$platform" building
16
12
  if GITHUB_TOKEN="$GH_TOKEN" npm_config_workspaces_update=false bun run --cwd "packages/$PACKAGE" release; then
17
13
  version=$(node -p "require('./packages/$PACKAGE/package.json').version")
18
- [[ "$version" != *development* ]] || version=$previous
19
- PUBLISHED_VERSION=$(npm view "$name@$version" version)
14
+ # semantic-release may succeed without a new release. Verify latest in that
15
+ # case, but never require a public version before attempting OIDC publication.
16
+ published="$name@$version"
17
+ [[ "$version" != *development* ]] || published=$name
18
+ if ! PUBLISHED_VERSION=$(npm view "$published" version); then
19
+ node .github/scripts/disposabl.mjs report "$platform" failed 'Release finished, but npm availability could not be verified; check the registry lookup error.'
20
+ exit 1
21
+ fi
22
+ if [[ -z "$PUBLISHED_VERSION" || ( "$published" != "$name" && "$PUBLISHED_VERSION" != "$version" ) ]]; then
23
+ node .github/scripts/disposabl.mjs report "$platform" failed 'npm returned no matching published version.'
24
+ exit 1
25
+ fi
20
26
  export PUBLISHED_VERSION
21
27
  node .github/scripts/disposabl.mjs report "$platform" ready
22
28
  else