create-disposabl-app 0.20.5 → 0.20.7
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.
package/dist/disposabl.js
CHANGED
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.20.
|
|
1566
|
+
var version = "0.20.7";
|
|
1567
1567
|
|
|
1568
1568
|
// ../cli/telemetry.ts
|
|
1569
1569
|
var import_proper_lockfile2 = __toESM(require_proper_lockfile(), 1);
|
|
@@ -9523,6 +9523,22 @@ async function safeRead(root, path) {
|
|
|
9523
9523
|
}
|
|
9524
9524
|
return readFile5(target);
|
|
9525
9525
|
}
|
|
9526
|
+
function sameStarterFile(path, left, right) {
|
|
9527
|
+
if (left.equals(right))
|
|
9528
|
+
return true;
|
|
9529
|
+
if (path !== "turbo.json")
|
|
9530
|
+
return false;
|
|
9531
|
+
const tokens = (value) => {
|
|
9532
|
+
const text = value.toString("utf8");
|
|
9533
|
+
JSON.parse(text);
|
|
9534
|
+
return text.replace(/"(?:\\.|[^"\\])*"|[\x20\t\r\n]+/g, (part) => part.startsWith('"') ? part : "");
|
|
9535
|
+
};
|
|
9536
|
+
try {
|
|
9537
|
+
return tokens(left) === tokens(right);
|
|
9538
|
+
} catch {
|
|
9539
|
+
return false;
|
|
9540
|
+
}
|
|
9541
|
+
}
|
|
9526
9542
|
async function reconfigureApp(template, directory, version, options) {
|
|
9527
9543
|
const configPath = "disposabl.json";
|
|
9528
9544
|
const raw = await safeRead(directory, configPath);
|
|
@@ -9612,17 +9628,17 @@ async function reconfigureApp(template, directory, version, options) {
|
|
|
9612
9628
|
return;
|
|
9613
9629
|
throw error;
|
|
9614
9630
|
});
|
|
9615
|
-
if (prior
|
|
9631
|
+
if (prior && sameStarterFile(path, prior, next))
|
|
9616
9632
|
continue;
|
|
9617
9633
|
if (!current) {
|
|
9618
9634
|
if (prior)
|
|
9619
9635
|
throw new Error(`Cannot reconfigure: ${path} was removed or customized. Restore the matching starter file and retry.`);
|
|
9620
9636
|
changes.push({ path, content: next });
|
|
9621
|
-
} else if (current
|
|
9637
|
+
} else if (sameStarterFile(path, current, next))
|
|
9622
9638
|
continue;
|
|
9623
9639
|
else if (!prior)
|
|
9624
9640
|
continue;
|
|
9625
|
-
else if (current
|
|
9641
|
+
else if (sameStarterFile(path, current, prior))
|
|
9626
9642
|
changes.push({ path, content: next });
|
|
9627
9643
|
else {
|
|
9628
9644
|
const merged = basename2(path) === "package.json" ? mergePurchasesManifest(prior, next, current) : undefined;
|
|
@@ -3,23 +3,17 @@
|
|
|
3
3
|
Generated with the pinned Hey API generator from `packages/backend/generated/openapi.json`.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
import { client,
|
|
6
|
+
import { client, usersCurrent } from "@disposabl/sdk";
|
|
7
7
|
|
|
8
8
|
client.setConfig({
|
|
9
9
|
baseUrl: "https://your-deployment.convex.site",
|
|
10
10
|
auth: process.env.DISPOSABL_API_KEY,
|
|
11
11
|
throwOnError: true,
|
|
12
12
|
});
|
|
13
|
-
const { data:
|
|
14
|
-
body: { name: "My app", platforms: ["web", "api"] },
|
|
15
|
-
});
|
|
16
|
-
const { data: page } = await appsList({
|
|
17
|
-
query: { paginationOpts: { numItems: 20, cursor: null } },
|
|
18
|
-
});
|
|
19
|
-
const { data: app } = await appsGet({ query: { appId: created!.appId } });
|
|
13
|
+
const { data: user } = await usersCurrent();
|
|
20
14
|
```
|
|
21
15
|
|
|
22
|
-
|
|
16
|
+
With Authentication enabled, create API keys at `/dashboard/api-keys`. Keep server integration keys on the server. The API also accepts OAuth tokens issued through its MCP authorization server.
|
|
23
17
|
|
|
24
18
|
Run `bun run generate` in `packages/backend`, then `bun run generate` here to update the typed operations. Query parameters use JSON encoding. The backend refuses incompatible contract regeneration without `--accept-breaking`; review that diff before accepting a major contract version.
|
|
25
19
|
|
|
@@ -28,7 +22,7 @@ Run `bun run generate` in `packages/backend`, then `bun run generate` here to up
|
|
|
28
22
|
The SDK sends no analytics by itself. An application can explicitly wrap calls and forward the approved operation name and outcome to its own analytics project:
|
|
29
23
|
|
|
30
24
|
```ts
|
|
31
|
-
import {
|
|
25
|
+
import { usersCurrent, createSdkAnalytics } from "@disposabl/sdk";
|
|
32
26
|
|
|
33
27
|
const analytics = createSdkAnalytics({
|
|
34
28
|
enabled: true, // defaults to true; set false to opt out
|
|
@@ -37,7 +31,7 @@ const analytics = createSdkAnalytics({
|
|
|
37
31
|
posthog.capture("sdk_operation", { operation, outcome });
|
|
38
32
|
},
|
|
39
33
|
});
|
|
40
|
-
const result = await analytics.track("
|
|
34
|
+
const result = await analytics.track("usersCurrent", () => usersCurrent());
|
|
41
35
|
```
|
|
42
36
|
|
|
43
37
|
Supply your own initialized `posthog` (or another sink); the SDK includes no project key or transport. Set `e2e: true` for E2E builds; `E2E_TELEMETRY_DISABLED=1` also disables capture in Node. Capture failures are ignored. Use field-style responses (the default) or `throwOnError: true` so the wrapper can detect failures. The wrapper cannot detect errors hidden by `responseStyle: "data"`. Only wrapped calls emit events. These owner-configured events are separate from any Disposabl platform usage telemetry; avoid enabling PostHog autocapture or sending request content in the sink.
|