create-100x-mobile 0.6.8 → 0.6.9
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/commands/new.js
CHANGED
|
@@ -130,7 +130,7 @@ function buildTemplateFiles(projectName, expoVersion, backend, instantAuthMode =
|
|
|
130
130
|
: [["lib/instant.ts", (0, instantLib_1.instantLibTemplate)()]]),
|
|
131
131
|
// Hooks
|
|
132
132
|
["hooks/useFrameworkReady.ts", (0, useFrameworkReady_1.useFrameworkReadyTemplate)()],
|
|
133
|
-
["instant.schema.ts", (0, instantSchema_1.instantSchemaTemplate)()],
|
|
133
|
+
["instant.schema.ts", (0, instantSchema_1.instantSchemaTemplate)((0, scaffold_1.isCloudflareInstantAuthMode)(instantAuthMode))],
|
|
134
134
|
...cloudflareFiles,
|
|
135
135
|
]
|
|
136
136
|
: [
|
|
@@ -5,9 +5,36 @@ exports.instantSchemaTemplate = instantSchemaTemplate;
|
|
|
5
5
|
* Generates an `instant.schema.ts` file in the project root.
|
|
6
6
|
* The instant-cli requires this file to exist in the root for
|
|
7
7
|
* `npx instant-cli push` to register entities on the backend.
|
|
8
|
+
*
|
|
9
|
+
* This file MUST be self-contained — instant-cli evaluates it in
|
|
10
|
+
* Node.js, so it cannot import from lib/instant.ts (which pulls
|
|
11
|
+
* in react-native-get-random-values and other native modules).
|
|
8
12
|
*/
|
|
9
|
-
function instantSchemaTemplate() {
|
|
10
|
-
|
|
13
|
+
function instantSchemaTemplate(includeCloudflare = false) {
|
|
14
|
+
const cloudflareEntity = includeCloudflare
|
|
15
|
+
? `
|
|
16
|
+
cloudflareObjects: i.entity({
|
|
17
|
+
uploadId: i.string().indexed(),
|
|
18
|
+
key: i.string(),
|
|
19
|
+
ownerId: i.string().indexed(),
|
|
20
|
+
fileName: i.string(),
|
|
21
|
+
contentType: i.string(),
|
|
22
|
+
size: i.number(),
|
|
23
|
+
workerUrl: i.string(),
|
|
24
|
+
createdAt: i.number().indexed(),
|
|
25
|
+
}),`
|
|
26
|
+
: "";
|
|
27
|
+
return `import { i } from "@instantdb/react-native";
|
|
28
|
+
|
|
29
|
+
const schema = i.schema({
|
|
30
|
+
entities: {
|
|
31
|
+
todos: i.entity({
|
|
32
|
+
text: i.string(),
|
|
33
|
+
completed: i.boolean(),
|
|
34
|
+
createdAt: i.number().indexed(),
|
|
35
|
+
}),${cloudflareEntity}
|
|
36
|
+
},
|
|
37
|
+
});
|
|
11
38
|
|
|
12
39
|
export default schema;
|
|
13
40
|
`;
|