create-proto 0.8.1 → 0.8.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-proto",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Scaffold a new Proto prototype: `npm create proto@latest myapp`. Describe a screen, watch your prototype run natively on iPhone — designer-first, paired with Claude Code.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"fs-extra": "^11.2.0",
|
|
46
46
|
"qrcode-terminal": "^0.12.0",
|
|
47
47
|
"validate-npm-package-name": "^5.0.1",
|
|
48
|
-
"@sherizan/proto-cli": "^0.8.
|
|
48
|
+
"@sherizan/proto-cli": "^0.8.18"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/fs-extra": "^11.0.4",
|
package/template/AGENTS.md
CHANGED
|
@@ -101,7 +101,7 @@ The `prototo` MCP server connects while the preview runs. (Under Codex it appear
|
|
|
101
101
|
- Keyless APIs: Open-Meteo, REST Countries, Open Library, PokéAPI, Art Institute of Chicago, TheMealDB, Wikipedia REST. A key goes in `proto.config.js`, nowhere else.
|
|
102
102
|
|
|
103
103
|
## Sharing
|
|
104
|
-
A published link (`prototo.app/p/<token>`) runs the prototype natively in the free Prototo iPhone app, with everything above: gestures, haptics, glass, motion, live data. Build what the designer asks; nothing needs dumbing down. Limits: only native modules Prototo bundles (`npx proto add` tells you), and the project must be on the current Prototo runtime. If a command says it's older, run `npx proto upgrade` (never Expo or npm commands for this)
|
|
104
|
+
A published link (`prototo.app/p/<token>`) runs the prototype natively in the free Prototo iPhone app, with everything above: gestures, haptics, glass, motion, live data. Build what the designer asks; nothing needs dumbing down. Limits: only native modules Prototo bundles (`npx proto add` tells you), and the project must be on the current Prototo runtime. If a command says it's older, run `npx proto upgrade`, then `npx proto share` (never Expo or npm commands for this); the existing link opens on the new app. The designer can also do this themselves: open the project in Prototo Desktop and click Publish.
|
|
105
105
|
|
|
106
106
|
## Rules
|
|
107
107
|
- Read a file, then make targeted edits; don't rewrite whole files for small changes.
|
package/template/app/_layout.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Stack } from 'expo-router';
|
|
2
2
|
import TouchDots from '../components/proto/touch-dots';
|
|
3
|
+
import config from '../proto.config';
|
|
3
4
|
|
|
4
5
|
export default function RootLayout() {
|
|
5
6
|
return (
|
|
@@ -10,7 +11,7 @@ export default function RootLayout() {
|
|
|
10
11
|
<Stack.Screen
|
|
11
12
|
name="index"
|
|
12
13
|
options={{
|
|
13
|
-
title:
|
|
14
|
+
title: config.name,
|
|
14
15
|
headerLargeTitle: true,
|
|
15
16
|
}}
|
|
16
17
|
/>
|
|
@@ -46,7 +46,8 @@ export function Screen({ scrollable = true, gradient, children }: ScreenProps) {
|
|
|
46
46
|
return (
|
|
47
47
|
<ScrollView
|
|
48
48
|
style={{ flex: 1, backgroundColor: theme.surface.primary }}
|
|
49
|
-
|
|
49
|
+
// With a wash the content box fills the viewport so the gradient reaches the bottom edge.
|
|
50
|
+
contentContainerStyle={{ padding, gap: padding, flexGrow: washColor ? 1 : undefined }}
|
|
50
51
|
contentInsetAdjustmentBehavior="automatic"
|
|
51
52
|
>
|
|
52
53
|
{wash}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useEffect,
|
|
2
|
-
import {
|
|
1
|
+
import { useEffect, type ReactNode } from 'react';
|
|
2
|
+
import { SymbolView } from 'expo-symbols';
|
|
3
3
|
import * as Clipboard from 'expo-clipboard';
|
|
4
4
|
import * as Haptics from 'expo-haptics';
|
|
5
5
|
import {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
withTiming,
|
|
11
11
|
Easing,
|
|
12
12
|
} from '../components/proto/gestures';
|
|
13
|
-
import { Screen, Stack, Text, Card, Divider, Lottie } from '../components/proto';
|
|
13
|
+
import { Screen, Stack, Row, Text, Card, Button, Divider, Lottie, useAccent } from '../components/proto';
|
|
14
14
|
|
|
15
15
|
// Prototo Desktop sets EXPO_PUBLIC_PROTO_DESKTOP=1 when it runs `proto start`
|
|
16
16
|
// (Metro inlines it at bundle time). In the desktop the terminal sits beside
|
|
@@ -19,18 +19,9 @@ import { Screen, Stack, Text, Card, Divider, Lottie } from '../components/proto'
|
|
|
19
19
|
const IN_DESKTOP = process.env.EXPO_PUBLIC_PROTO_DESKTOP === '1';
|
|
20
20
|
|
|
21
21
|
const EXAMPLES = [
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: 'Native feel',
|
|
28
|
-
prompt: 'Add a liquid glass tab bar with Home, Search, Profile',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
label: 'A quick change',
|
|
32
|
-
prompt: 'Make the background sunset orange',
|
|
33
|
-
},
|
|
22
|
+
{ label: 'From Figma', prompt: 'Use Figma MCP and design this screen for me [figma link]' },
|
|
23
|
+
{ label: 'Native feel', prompt: 'Add a liquid glass tab bar with Home, Search, Profile' },
|
|
24
|
+
{ label: 'A quick change', prompt: 'Make the background sunset orange' },
|
|
34
25
|
];
|
|
35
26
|
|
|
36
27
|
function Enter({ delay, children }: { delay: number; children: ReactNode }) {
|
|
@@ -52,60 +43,58 @@ function Enter({ delay, children }: { delay: number; children: ReactNode }) {
|
|
|
52
43
|
}
|
|
53
44
|
|
|
54
45
|
function ExampleCard({ example }: { example: (typeof EXAMPLES)[number] }) {
|
|
55
|
-
const
|
|
46
|
+
const accent = useAccent();
|
|
56
47
|
|
|
57
48
|
const handleCopy = async () => {
|
|
58
49
|
await Clipboard.setStringAsync(example.prompt);
|
|
59
50
|
await Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
|
60
|
-
setCopied(true);
|
|
61
|
-
setTimeout(() => setCopied(false), 1500);
|
|
62
51
|
};
|
|
63
52
|
|
|
64
53
|
return (
|
|
65
|
-
<Card padding={
|
|
66
|
-
<
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
54
|
+
<Card glass padding={16}>
|
|
55
|
+
<Row gap={14} align="center">
|
|
56
|
+
<SymbolView name="text.bubble" size={22} tintColor={accent} />
|
|
57
|
+
<Stack gap={2} style={{ flex: 1 }}>
|
|
58
|
+
<Text size="label" color="accent">
|
|
59
|
+
{example.label}
|
|
60
|
+
</Text>
|
|
61
|
+
<Text size="body">{`“${example.prompt}”`}</Text>
|
|
62
|
+
</Stack>
|
|
71
63
|
{IN_DESKTOP ? null : (
|
|
72
|
-
<
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
</Text>
|
|
76
|
-
</Pressable>
|
|
64
|
+
<Row>
|
|
65
|
+
<Button label="Copy" variant="ghost" onPress={() => void handleCopy()} />
|
|
66
|
+
</Row>
|
|
77
67
|
)}
|
|
78
|
-
</
|
|
68
|
+
</Row>
|
|
79
69
|
</Card>
|
|
80
70
|
);
|
|
81
71
|
}
|
|
82
72
|
|
|
83
73
|
export default function Home() {
|
|
84
74
|
return (
|
|
85
|
-
<Screen scrollable>
|
|
75
|
+
<Screen scrollable gradient>
|
|
86
76
|
<Stack gap={24}>
|
|
87
77
|
<Enter delay={0}>
|
|
88
|
-
<Lottie
|
|
89
|
-
source={require('../assets/lottie/logo-prototo.json')}
|
|
90
|
-
style={{ width: 56, height: 56, alignSelf: 'center' }}
|
|
91
|
-
/>
|
|
92
|
-
</Enter>
|
|
93
|
-
|
|
94
|
-
<Enter delay={80}>
|
|
95
78
|
<Card glass padding={24}>
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
79
|
+
<Row gap={16} align="center">
|
|
80
|
+
<Lottie
|
|
81
|
+
source={require('../assets/lottie/logo-prototo.json')}
|
|
82
|
+
style={{ width: 48, height: 48 }}
|
|
83
|
+
/>
|
|
84
|
+
<Stack gap={4} style={{ flex: 1 }}>
|
|
85
|
+
<Text size="headline">You're in.</Text>
|
|
86
|
+
<Text size="body" color="secondary">
|
|
87
|
+
{IN_DESKTOP
|
|
88
|
+
? 'Describe a screen in the terminal beside this preview. It appears here as it builds.'
|
|
89
|
+
: `In a terminal: cd {{APP_NAME}} && claude (or codex). Then paste a prompt below.`}
|
|
90
|
+
</Text>
|
|
91
|
+
</Stack>
|
|
92
|
+
</Row>
|
|
104
93
|
</Card>
|
|
105
94
|
</Enter>
|
|
106
95
|
|
|
107
|
-
<Enter delay={
|
|
108
|
-
<Stack gap={
|
|
96
|
+
<Enter delay={120}>
|
|
97
|
+
<Stack gap={10}>
|
|
109
98
|
<Text size="label" color="secondary">
|
|
110
99
|
Try one of these
|
|
111
100
|
</Text>
|
|
@@ -116,7 +105,7 @@ export default function Home() {
|
|
|
116
105
|
</Enter>
|
|
117
106
|
|
|
118
107
|
<Enter delay={240}>
|
|
119
|
-
<Stack gap={
|
|
108
|
+
<Stack gap={12}>
|
|
120
109
|
<Divider />
|
|
121
110
|
<Text size="caption" color="secondary">
|
|
122
111
|
Each prompt builds on the last. Prototo reads DESIGN.md before every change.
|