@punks/cli 2.3.2 → 2.4.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.
- package/dist/BASELINE_CHANGELOG.md +50 -0
- package/dist/CHANGELOG.md +50 -0
- package/dist/index.js +216 -221
- package/dist/skills/agnostic/cli/dp-cli/SKILL.md +1 -12
- package/dist/skills/agnostic/cli/dp-cli/references/commands.md +22 -18
- package/dist/skills/agnostic/cli/dp-cli/references/post-command-flow.md +15 -19
- package/dist/skills/agnostic/planning/wayfinder/SKILL.md +42 -0
- package/dist/skills/agnostic/quality/review/SKILL.md +89 -0
- package/dist/skills/agnostic/requirements/write-backlog/EXAMPLES.md +22 -0
- package/dist/skills/agnostic/requirements/write-backlog/REFERENCE.md +110 -23
- package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +30 -14
- package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +74 -7
- package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +108 -2
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +29 -3
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +43 -7
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +25 -3
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +63 -14
- package/dist/skills/agnostic/research/parallel-research/SKILL.md +5 -2
- package/dist/skills/frameworks/expo/add-app-clip/SKILL.md +280 -0
- package/dist/skills/frameworks/expo/add-app-clip/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/add-app-clip/references/native-module.md +96 -0
- package/dist/skills/frameworks/expo/building-native-ui/SKILL.md +377 -0
- package/dist/skills/frameworks/expo/building-native-ui/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/animations.md +220 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/controls.md +270 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/form-sheet.md +253 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/gradients.md +106 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/icons.md +213 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/media.md +198 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/route-structure.md +229 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/search.md +248 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/storage.md +121 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/tabs.md +433 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/toolbar-and-headers.md +284 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/visual-effects.md +197 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/webgpu-three.md +605 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/zoom-transitions.md +158 -0
- package/dist/skills/frameworks/expo/eas-simulator/SKILL.md +154 -0
- package/dist/skills/frameworks/expo/eas-simulator/references/controllers.md +67 -0
- package/dist/skills/frameworks/expo/eas-simulator/references/run-your-app.md +185 -0
- package/dist/skills/frameworks/expo/eas-simulator/references/troubleshooting.md +38 -0
- package/dist/skills/frameworks/expo/eas-update-insights/SKILL.md +228 -0
- package/dist/skills/frameworks/expo/eas-update-insights/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/eas-update-insights/references/channel-insights-schema.md +47 -0
- package/dist/skills/frameworks/expo/eas-update-insights/references/update-insights-schema.md +69 -0
- package/dist/skills/frameworks/expo/expo-api-routes/SKILL.md +368 -0
- package/dist/skills/frameworks/expo/expo-api-routes/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-brownfield/SKILL.md +54 -0
- package/dist/skills/frameworks/expo/expo-brownfield/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-brownfield/references/brownfield-integrated.md +526 -0
- package/dist/skills/frameworks/expo/expo-brownfield/references/brownfield-isolated.md +402 -0
- package/dist/skills/frameworks/expo/expo-brownfield/references/comparison.md +63 -0
- package/dist/skills/frameworks/expo/expo-brownfield/references/troubleshooting.md +88 -0
- package/dist/skills/frameworks/expo/expo-cicd-workflows/SKILL.md +92 -0
- package/dist/skills/frameworks/expo/expo-cicd-workflows/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-cicd-workflows/scripts/fetch.js +109 -0
- package/dist/skills/frameworks/expo/expo-cicd-workflows/scripts/package.json +11 -0
- package/dist/skills/frameworks/expo/expo-cicd-workflows/scripts/validate.js +84 -0
- package/dist/skills/frameworks/expo/expo-deployment/SKILL.md +167 -0
- package/dist/skills/frameworks/expo/expo-deployment/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-deployment/references/app-store-metadata.md +497 -0
- package/dist/skills/frameworks/expo/expo-deployment/references/ios-app-store.md +371 -0
- package/dist/skills/frameworks/expo/expo-deployment/references/play-store.md +246 -0
- package/dist/skills/frameworks/expo/expo-deployment/references/testflight.md +58 -0
- package/dist/skills/frameworks/expo/expo-deployment/references/workflows.md +160 -0
- package/dist/skills/frameworks/expo/expo-dev-client/SKILL.md +172 -0
- package/dist/skills/frameworks/expo/expo-dev-client/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-examples/SKILL.md +97 -0
- package/dist/skills/frameworks/expo/expo-examples/references/catalog.md +105 -0
- package/dist/skills/frameworks/expo/expo-module/SKILL.md +141 -0
- package/dist/skills/frameworks/expo/expo-module/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-module/references/config-plugin.md +90 -0
- package/dist/skills/frameworks/expo/expo-module/references/create-expo-module.md +206 -0
- package/dist/skills/frameworks/expo/expo-module/references/lifecycle.md +127 -0
- package/dist/skills/frameworks/expo/expo-module/references/module-config.md +48 -0
- package/dist/skills/frameworks/expo/expo-module/references/native-module.md +286 -0
- package/dist/skills/frameworks/expo/expo-module/references/native-view.md +171 -0
- package/dist/skills/frameworks/expo/expo-observe/SKILL.md +29 -0
- package/dist/skills/frameworks/expo/expo-observe/references/metrics.md +47 -0
- package/dist/skills/frameworks/expo/expo-observe/references/queries.md +342 -0
- package/dist/skills/frameworks/expo/expo-observe/references/setup.md +255 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/SKILL.md +314 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/agents/visual-grader.md +52 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/references/design-rubric.md +45 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/references/runtime-matrix.md +33 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/check-static.sh +64 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/clean-fixture.sh +56 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/generate_viewer.py +450 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/latest-sdk.sh +46 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/make-fixture.sh +95 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/make-workspace.sh +31 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-android.sh +284 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-ios.sh +132 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-web.sh +61 -0
- package/dist/skills/frameworks/expo/expo-tailwind-setup/SKILL.md +480 -0
- package/dist/skills/frameworks/expo/expo-tailwind-setup/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-ui/SKILL.md +47 -0
- package/dist/skills/frameworks/expo/expo-ui/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-ui/references/drop-in-replacements.md +27 -0
- package/dist/skills/frameworks/expo/expo-ui/references/jetpack-compose.md +73 -0
- package/dist/skills/frameworks/expo/expo-ui/references/swift-ui.md +73 -0
- package/dist/skills/frameworks/expo/expo-ui/references/universal.md +73 -0
- package/dist/skills/frameworks/expo/expo-ui/scripts/list-components.js +193 -0
- package/dist/skills/frameworks/expo/native-data-fetching/SKILL.md +505 -0
- package/dist/skills/frameworks/expo/native-data-fetching/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/native-data-fetching/references/expo-router-loaders.md +341 -0
- package/dist/skills/frameworks/expo/upgrading-expo/SKILL.md +134 -0
- package/dist/skills/frameworks/expo/upgrading-expo/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/expo-av-to-audio.md +132 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/expo-av-to-video.md +160 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/native-tabs.md +124 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/new-architecture.md +79 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/react-19.md +79 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/react-compiler.md +59 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/react-navigation-to-expo-router.md +61 -0
- package/dist/skills/frameworks/expo/use-dom/SKILL.md +417 -0
- package/dist/skills/frameworks/expo/use-dom/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/web-to-native/SKILL.md +83 -0
- package/dist/skills/frameworks/expo/web-to-native/references/false-friends.md +119 -0
- package/dist/skills/frameworks/expo/web-to-native/references/native-patterns.md +39 -0
- package/dist/skills/frameworks/expo/web-to-native/references/run-as-goal.md +48 -0
- package/dist/skills/frameworks/expo/web-to-native/references/verify-on-device.md +45 -0
- package/dist/skills/phases/finder-phase/SKILL.md +52 -0
- package/dist/skills/phases/finder-phase/references/frontier-lifecycle.md +70 -0
- package/dist/skills/phases/finder-phase/references/root-routing.md +29 -0
- package/dist/skills/phases/goalify/SKILL.md +10 -7
- package/dist/skills/phases/review-phase/REFERENCE.md +36 -3
- package/dist/skills/phases/review-phase/SKILL.md +18 -11
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Platform-specific iOS UI: `@expo/ui/swift-ui`
|
|
2
|
+
|
|
3
|
+
> **iOS only.** Code that imports from `@expo/ui/swift-ui` will crash on Android with "Unable to get view config" errors. Always place this code in an `.ios.tsx` component file or guard it with `Platform.OS === 'ios'`. `Host` must be imported from `@expo/ui` (the universal root), not from `@expo/ui/swift-ui`.
|
|
4
|
+
|
|
5
|
+
Use this layer only when the universal `@expo/ui` components don't cover what you need on iOS (see `./universal.md` first). This requires a platform-specific tree.
|
|
6
|
+
|
|
7
|
+
### File placement with Expo Router
|
|
8
|
+
|
|
9
|
+
**Do not put `.ios.tsx` files inside `app/` or `src/app/`.** Expo Router does not support platform-extension suffixes for route files and will throw a "no fallback sibling" Render Error.
|
|
10
|
+
|
|
11
|
+
Place platform-specific component files in `components/` (or any directory outside the route tree), then import them from a regular route file:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
src/components/ProfileEditor.ios.tsx ← SwiftUI tree lives here
|
|
15
|
+
src/app/profile-editor.tsx ← regular Expo Router route, imports the component
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`src/app/profile-editor.tsx`:
|
|
19
|
+
```tsx
|
|
20
|
+
import ProfileEditor from '../components/ProfileEditor';
|
|
21
|
+
export default ProfileEditor;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Alternatively, keep everything in one regular route file and branch on `Platform.OS`:
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
// src/app/profile-editor.tsx
|
|
28
|
+
import { Platform } from 'react-native';
|
|
29
|
+
// import SwiftUI components only when on iOS to avoid Android crash
|
|
30
|
+
const SwiftUIForm = Platform.OS === 'ios' ? require('../components/ProfileEditor.ios').default : null;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or more simply, put the `Platform.OS` guard and the SwiftUI import in the same route file (safe because Metro only bundles `.ios.tsx` imports on iOS builds when using platform extensions in `components/`).
|
|
34
|
+
|
|
35
|
+
## Instructions
|
|
36
|
+
|
|
37
|
+
- Expo UI's API mirrors SwiftUI's API. Use SwiftUI knowledge to decide which components or modifiers to use.
|
|
38
|
+
- Components are imported from `@expo/ui/swift-ui`, modifiers from `@expo/ui/swift-ui/modifiers`.
|
|
39
|
+
- **Before writing any code, run the list-components script** to get the exact components and modifiers available in the installed version:
|
|
40
|
+
```bash
|
|
41
|
+
node <skill-root>/scripts/list-components.js <project-path> # names only (compact)
|
|
42
|
+
node <skill-root>/scripts/list-components.js <project-path> --docs # with one-line descriptions
|
|
43
|
+
```
|
|
44
|
+
(`<skill-root>` is the directory containing this `references/` folder.)
|
|
45
|
+
- **The installed package's TypeScript types (`.d.ts`) are the most reliable source of truth** for prop shapes and signatures — read the relevant `{Component}/index.d.ts` from the installed `@expo/ui/swift-ui` package in `node_modules`. Use the docs below as the human-readable reference.
|
|
46
|
+
- When about to use a component, fetch its docs to confirm the API — https://docs.expo.dev/versions/latest/sdk/ui/swift-ui/{component-name}/index.md
|
|
47
|
+
- When unsure about a modifier's API, refer to the docs — https://docs.expo.dev/versions/latest/sdk/ui/swift-ui/modifiers/index.md
|
|
48
|
+
- Every SwiftUI tree must be wrapped in `Host`.
|
|
49
|
+
- `RNHostView` is specifically for embedding RN components inside a SwiftUI tree. Example:
|
|
50
|
+
|
|
51
|
+
```jsx
|
|
52
|
+
import { Host } from "@expo/ui"; // Host always from universal root
|
|
53
|
+
import { VStack, RNHostView } from "@expo/ui/swift-ui"; // platform components from swift-ui
|
|
54
|
+
import { Pressable } from "react-native";
|
|
55
|
+
|
|
56
|
+
<Host matchContents>
|
|
57
|
+
<VStack>
|
|
58
|
+
<RNHostView matchContents>
|
|
59
|
+
// Here, `Pressable` is an RN component so it is wrapped in `RNHostView`.
|
|
60
|
+
<Pressable />
|
|
61
|
+
</RNHostView>
|
|
62
|
+
</VStack>
|
|
63
|
+
</Host>;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- If a required modifier or View is missing in Expo UI, it can be extended via a local Expo module. See: https://docs.expo.dev/guides/expo-ui-swift-ui/extending/index.md. Confirm with the user before extending.
|
|
67
|
+
|
|
68
|
+
## useNativeState
|
|
69
|
+
|
|
70
|
+
`useNativeState` creates observable state that updates synchronously on the UI thread via worklets, enabling immediate native state changes without waiting for a React render cycle. Requires `react-native-worklets` — without it updates still go through React and flickering remains. Best for real-time interactions where synchronous updates matter, e.g. a text field that masks or formats input as the user types.
|
|
71
|
+
|
|
72
|
+
- `ObservableState.value` is readable/writable from worklets; `onChange` fires a worklet listener on state change.
|
|
73
|
+
- Docs — https://docs.expo.dev/versions/latest/sdk/ui/swift-ui/usenativestate/index.md
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Universal `@expo/ui` components
|
|
2
|
+
|
|
3
|
+
> Requires Expo SDK 56+.
|
|
4
|
+
|
|
5
|
+
Universal components are a single-API layer over the platform-native UI toolkits: Jetpack Compose on Android, SwiftUI on iOS, and `react-native-web` / `react-dom` on web. You write one component tree that runs unmodified on all three platforms while keeping a native look and feel — no `.ios.tsx` / `.android.tsx` split.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
Import everything, including `Host`, from the package root (`@expo/ui`). Every tree must be wrapped in `Host`.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { Host, Column, Button, Text } from '@expo/ui';
|
|
13
|
+
|
|
14
|
+
<Host matchContents>
|
|
15
|
+
<Column>
|
|
16
|
+
<Text>Hello</Text>
|
|
17
|
+
<Button onPress={() => alert('Pressed!')}>Press me</Button>
|
|
18
|
+
</Column>
|
|
19
|
+
</Host>;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Components
|
|
23
|
+
|
|
24
|
+
| Category | Components |
|
|
25
|
+
|----------|------------|
|
|
26
|
+
| Container | `Host` (required root wrapper) |
|
|
27
|
+
| Layout | `Column`, `Row`, `Spacer`, `ScrollView` |
|
|
28
|
+
| Display | `Text`, `Icon` |
|
|
29
|
+
| Controls | `Button`, `Switch`, `Checkbox`, `Slider`, `TextInput`, `Picker` |
|
|
30
|
+
| Disclosure & presentation | `BottomSheet`, `Collapsible` |
|
|
31
|
+
| Collections & forms | `List` (with `ListItem`), `FieldGroup` |
|
|
32
|
+
|
|
33
|
+
> **`List` is not suitable for large lists.** Each `ListItem` is a JSX node processed on the JS thread — for large datasets this causes noticeable slowdowns.
|
|
34
|
+
|
|
35
|
+
## TextInput and useNativeState
|
|
36
|
+
|
|
37
|
+
`TextInput` from `@expo/ui` is **not like React Native's TextInput** — its `value` and `selection` props take an `ObservableState` object (from `useNativeState`), not a plain string. This is what enables synchronous, flicker-free updates: when the user types, `onChangeText` runs as a worklet on the UI thread and writes directly to `value` without a React render cycle.
|
|
38
|
+
|
|
39
|
+
Requires `react-native-worklets`. Without it the worklet directive has no effect and flickering remains.
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Host, TextInput, useNativeState } from '@expo/ui';
|
|
43
|
+
import { useCallback } from 'react';
|
|
44
|
+
|
|
45
|
+
export default function MyInput() {
|
|
46
|
+
const text = useNativeState('');
|
|
47
|
+
|
|
48
|
+
const handleChangeText = useCallback((value: string) => {
|
|
49
|
+
'worklet';
|
|
50
|
+
// transform synchronously on the UI thread — no React re-render
|
|
51
|
+
text.value = value === 'Hello' ? 'World' : value;
|
|
52
|
+
}, [text]);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Host matchContents>
|
|
56
|
+
<TextInput value={text} onChangeText={handleChangeText} placeholder="Type here" />
|
|
57
|
+
</Host>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Docs — https://docs.expo.dev/versions/latest/sdk/ui/universal/textinput/index.md
|
|
63
|
+
|
|
64
|
+
## Confirming the API
|
|
65
|
+
|
|
66
|
+
`@expo/ui` is versioned with the Expo SDK (e.g. `56.0.x` for SDK 56) and its API can change between SDK versions, so the **installed package's TypeScript types (`.d.ts`) are the most reliable source of truth** — they match the version in your project, while the docs track latest. Read the relevant component's `.d.ts` from the installed `@expo/ui` package in `node_modules`. Use the docs as the human-readable reference:
|
|
67
|
+
|
|
68
|
+
- Overview — https://docs.expo.dev/versions/latest/sdk/ui/universal/index.md
|
|
69
|
+
- Per component — https://docs.expo.dev/versions/latest/sdk/ui/universal/{component-name}/index.md
|
|
70
|
+
|
|
71
|
+
## When to drop down to a platform-specific layer
|
|
72
|
+
|
|
73
|
+
Choose universal components whenever they cover the requirement. Drop down to `@expo/ui/swift-ui` or `@expo/ui/jetpack-compose` only when the universal API doesn't expose the component, modifier, or platform-specific behavior you need — accepting the per-platform file split that requires. See `./swift-ui.md` and `./jetpack-compose.md`.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* List available @expo/ui components and modifiers installed in a project.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* node list-components.js <project-path> [--docs]
|
|
7
|
+
*
|
|
8
|
+
* --docs Include a one-line JSDoc description per modifier.
|
|
9
|
+
* Omit (default) for a compact names-only list that consumes fewer tokens.
|
|
10
|
+
*
|
|
11
|
+
* Output goes to stdout. Redirect or capture it to inject into an agent prompt.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
|
|
19
|
+
const projectPath = process.argv[2];
|
|
20
|
+
const withDocs = process.argv.includes('--docs');
|
|
21
|
+
|
|
22
|
+
if (!projectPath) {
|
|
23
|
+
console.error('Usage: node list-components.js <project-path> [--docs]');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const pkgRoot = path.join(projectPath, 'node_modules', '@expo', 'ui');
|
|
28
|
+
if (!fs.existsSync(pkgRoot)) {
|
|
29
|
+
console.error(`@expo/ui not found in ${projectPath}/node_modules`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Read installed version from package.json
|
|
34
|
+
let version = 'unknown';
|
|
35
|
+
try {
|
|
36
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(pkgRoot, 'package.json'), 'utf8'));
|
|
37
|
+
version = pkg.version || 'unknown';
|
|
38
|
+
} catch (_) {}
|
|
39
|
+
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Component extraction — parse `export * from './Name'` in an index.d.ts
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// TypeScript type names that are not components — skip anything matching these suffixes
|
|
44
|
+
const TYPE_SUFFIX = /(?:Props|Ref|Handle|Params|Config|Options|Type|Types|Value|Values|Colors|Style|Styles|Event|Events|Alignment|Animation|Spec)$/;
|
|
45
|
+
|
|
46
|
+
function extractComponents(indexFile) {
|
|
47
|
+
if (!fs.existsSync(indexFile)) return [];
|
|
48
|
+
const src = fs.readFileSync(indexFile, 'utf8');
|
|
49
|
+
const names = [];
|
|
50
|
+
for (const line of src.split('\n')) {
|
|
51
|
+
// export * from './ComponentName' or export * from './ComponentName/index'
|
|
52
|
+
const m = line.match(/^export \* from ['"]\.\/([^/'"]+)/);
|
|
53
|
+
if (m) {
|
|
54
|
+
const name = m[1];
|
|
55
|
+
// Skip non-component re-exports (types, utils, state internals)
|
|
56
|
+
if (/^(types|utils|index|State|hooks|colors|layout-types|MaterialSymbols)/.test(name)) continue;
|
|
57
|
+
if (TYPE_SUFFIX.test(name)) continue;
|
|
58
|
+
names.push(name);
|
|
59
|
+
}
|
|
60
|
+
// export { Name, ... } from './Something' — pick up named re-exports too
|
|
61
|
+
const n = line.match(/^export \{([^}]+)\}/);
|
|
62
|
+
if (n) {
|
|
63
|
+
for (const part of n[1].split(',')) {
|
|
64
|
+
// Skip `type Foo` re-exports
|
|
65
|
+
if (/^\s*type\s/.test(part)) continue;
|
|
66
|
+
const id = part.trim().split(/\s+as\s+/)[0].trim();
|
|
67
|
+
if (id && /^[A-Z]/.test(id) && !TYPE_SUFFIX.test(id)) names.push(id);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return [...new Set(names)].sort();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
// Modifier extraction — parse `export declare const/function <name>` in
|
|
76
|
+
// a flat modifiers/index.d.ts, optionally with the preceding JSDoc summary.
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
function extractModifiers(modifiersFile) {
|
|
79
|
+
if (!fs.existsSync(modifiersFile)) return [];
|
|
80
|
+
const src = fs.readFileSync(modifiersFile, 'utf8');
|
|
81
|
+
const lines = src.split('\n');
|
|
82
|
+
const results = [];
|
|
83
|
+
const seen = new Set();
|
|
84
|
+
|
|
85
|
+
for (let i = 0; i < lines.length; i++) {
|
|
86
|
+
const line = lines[i];
|
|
87
|
+
const m = line.match(/^export declare (?:const|function) ([a-zA-Z_][a-zA-Z0-9_]*)/);
|
|
88
|
+
if (!m) continue;
|
|
89
|
+
const name = m[1];
|
|
90
|
+
// Skip type-only helpers and internal symbols
|
|
91
|
+
if (/^(is|filter|create|type|export)/.test(name) && name !== 'frame') continue;
|
|
92
|
+
if (seen.has(name)) continue;
|
|
93
|
+
seen.add(name);
|
|
94
|
+
|
|
95
|
+
if (!withDocs) {
|
|
96
|
+
results.push({ name });
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Find /** that opens the JSDoc block immediately preceding this export,
|
|
101
|
+
// then scan forward through the block for the first plain-prose summary.
|
|
102
|
+
let jsdocStart = -1;
|
|
103
|
+
for (let j = i - 1; j >= 0; j--) {
|
|
104
|
+
const jl = lines[j].trim();
|
|
105
|
+
if (jl === '/**') { jsdocStart = j; break; }
|
|
106
|
+
if (jl !== '' && jl !== '*/' && !jl.startsWith('*')) break;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let summary = '';
|
|
110
|
+
let deprecated = false;
|
|
111
|
+
if (jsdocStart >= 0) {
|
|
112
|
+
let inCodeBlock = false;
|
|
113
|
+
for (let k = jsdocStart + 1; k < i; k++) {
|
|
114
|
+
const kl = lines[k].trim();
|
|
115
|
+
if (kl.startsWith('* ```')) { inCodeBlock = !inCodeBlock; continue; }
|
|
116
|
+
if (inCodeBlock) continue;
|
|
117
|
+
// Check @deprecated anywhere in the block (may appear after @param)
|
|
118
|
+
if (kl.startsWith('* @deprecated')) { deprecated = true; continue; }
|
|
119
|
+
// Extract summary from opening prose only — stop at first non-deprecated tag
|
|
120
|
+
if (!summary) {
|
|
121
|
+
if (kl.startsWith('* @')) continue; // skip tags while looking for prose
|
|
122
|
+
if (kl === '*/' || kl === '/**' || kl === '*') continue;
|
|
123
|
+
if (kl.startsWith('* ')) {
|
|
124
|
+
const text = kl.slice(2).trim();
|
|
125
|
+
if (!text.startsWith('-') && !text.startsWith('<')) {
|
|
126
|
+
summary = text.replace(/\.$/, '');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
results.push({ name, summary, deprecated });
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return results;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
// Format helpers
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
141
|
+
function formatNames(names) {
|
|
142
|
+
return names.join(', ');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function formatModifiers(mods) {
|
|
146
|
+
if (!withDocs) return mods.map(m => m.name).join(', ');
|
|
147
|
+
const lines = [];
|
|
148
|
+
for (const m of mods) {
|
|
149
|
+
const dep = m.deprecated ? ' [deprecated]' : '';
|
|
150
|
+
const desc = m.summary ? ` — ${m.summary}` : '';
|
|
151
|
+
lines.push(` ${m.name}${dep}${desc}`);
|
|
152
|
+
}
|
|
153
|
+
return lines.join('\n');
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
// Main
|
|
158
|
+
// ---------------------------------------------------------------------------
|
|
159
|
+
const buildRoot = path.join(pkgRoot, 'build');
|
|
160
|
+
|
|
161
|
+
// Universal
|
|
162
|
+
const universalComponents = extractComponents(path.join(buildRoot, 'universal', 'index.d.ts'));
|
|
163
|
+
|
|
164
|
+
// Swift-UI (iOS only)
|
|
165
|
+
const swiftuiComponents = extractComponents(path.join(buildRoot, 'swift-ui', 'index.d.ts'));
|
|
166
|
+
const swiftuiModifiers = extractModifiers(path.join(buildRoot, 'swift-ui', 'modifiers', 'index.d.ts'));
|
|
167
|
+
|
|
168
|
+
// Jetpack Compose (Android only)
|
|
169
|
+
const composeComponents = extractComponents(path.join(buildRoot, 'jetpack-compose', 'index.d.ts'));
|
|
170
|
+
const composeModifiers = extractModifiers(path.join(buildRoot, 'jetpack-compose', 'modifiers', 'index.d.ts'));
|
|
171
|
+
|
|
172
|
+
const docsNote = withDocs ? ' (with descriptions)' : ' (names only — run with --docs for descriptions)';
|
|
173
|
+
console.log(`@expo/ui ${version}${docsNote}\n`);
|
|
174
|
+
|
|
175
|
+
console.log(`@expo/ui — universal (iOS + Android + web)`);
|
|
176
|
+
console.log(` Components: ${formatNames(universalComponents)}\n`);
|
|
177
|
+
|
|
178
|
+
console.log(`@expo/ui/swift-ui — iOS ONLY (crashes on Android)`);
|
|
179
|
+
console.log(` Components: ${formatNames(swiftuiComponents)}`);
|
|
180
|
+
if (withDocs) {
|
|
181
|
+
console.log(` Modifiers:\n${formatModifiers(swiftuiModifiers)}`);
|
|
182
|
+
} else {
|
|
183
|
+
console.log(` Modifiers: ${formatModifiers(swiftuiModifiers)}`);
|
|
184
|
+
}
|
|
185
|
+
console.log();
|
|
186
|
+
|
|
187
|
+
console.log(`@expo/ui/jetpack-compose — Android ONLY (crashes on iOS)`);
|
|
188
|
+
console.log(` Components: ${formatNames(composeComponents)}`);
|
|
189
|
+
if (withDocs) {
|
|
190
|
+
console.log(` Modifiers:\n${formatModifiers(composeModifiers)}`);
|
|
191
|
+
} else {
|
|
192
|
+
console.log(` Modifiers: ${formatModifiers(composeModifiers)}`);
|
|
193
|
+
}
|