@ankhorage/navigator 2.0.2 → 3.1.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/CHANGELOG.md +14 -0
- package/README.md +139 -4
- package/dist/cli/commands/catalog.d.ts +4 -0
- package/dist/cli/commands/catalog.d.ts.map +1 -0
- package/dist/cli/commands/catalog.js +76 -0
- package/dist/cli/commands/catalog.js.map +1 -0
- package/dist/cli/commands/examples/generate.d.ts +4 -0
- package/dist/cli/commands/examples/generate.d.ts.map +1 -0
- package/dist/cli/commands/examples/generate.js +36 -0
- package/dist/cli/commands/examples/generate.js.map +1 -0
- package/dist/cli/commands/examples/verify.d.ts +4 -0
- package/dist/cli/commands/examples/verify.d.ts.map +1 -0
- package/dist/cli/commands/examples/verify.js +48 -0
- package/dist/cli/commands/examples/verify.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +4 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +55 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/plan.d.ts +4 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +35 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +4 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +63 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +4 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +51 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/createCliProvider.d.ts +28 -0
- package/dist/cli/createCliProvider.d.ts.map +1 -0
- package/dist/cli/createCliProvider.js +63 -0
- package/dist/cli/createCliProvider.js.map +1 -0
- package/dist/features/catalog/adapters/inbound/getNavigatorCatalog.d.ts +4 -0
- package/dist/features/catalog/adapters/inbound/getNavigatorCatalog.d.ts.map +1 -0
- package/dist/features/catalog/adapters/inbound/getNavigatorCatalog.js +11 -0
- package/dist/features/catalog/adapters/inbound/getNavigatorCatalog.js.map +1 -0
- package/dist/features/catalog/adapters/inbound/getNavigatorExampleCatalog.d.ts +4 -0
- package/dist/features/catalog/adapters/inbound/getNavigatorExampleCatalog.d.ts.map +1 -0
- package/dist/features/catalog/adapters/inbound/getNavigatorExampleCatalog.js +40 -0
- package/dist/features/catalog/adapters/inbound/getNavigatorExampleCatalog.js.map +1 -0
- package/dist/features/catalog/domain/createCoreNavigatorExamples.d.ts +4 -0
- package/dist/features/catalog/domain/createCoreNavigatorExamples.d.ts.map +1 -0
- package/dist/features/catalog/domain/createCoreNavigatorExamples.js +52 -0
- package/dist/features/catalog/domain/createCoreNavigatorExamples.js.map +1 -0
- package/dist/features/catalog/domain/createCustomNavigatorExamples.d.ts +4 -0
- package/dist/features/catalog/domain/createCustomNavigatorExamples.d.ts.map +1 -0
- package/dist/features/catalog/domain/createCustomNavigatorExamples.js +46 -0
- package/dist/features/catalog/domain/createCustomNavigatorExamples.js.map +1 -0
- package/dist/features/catalog/domain/createDrawerNavigatorExamples.d.ts +4 -0
- package/dist/features/catalog/domain/createDrawerNavigatorExamples.d.ts.map +1 -0
- package/dist/features/catalog/domain/createDrawerNavigatorExamples.js +102 -0
- package/dist/features/catalog/domain/createDrawerNavigatorExamples.js.map +1 -0
- package/dist/features/catalog/domain/createExampleScreenRoute.d.ts +11 -0
- package/dist/features/catalog/domain/createExampleScreenRoute.d.ts.map +1 -0
- package/dist/features/catalog/domain/createExampleScreenRoute.js +15 -0
- package/dist/features/catalog/domain/createExampleScreenRoute.js.map +1 -0
- package/dist/features/catalog/domain/createNavigatorCatalog.d.ts +10 -0
- package/dist/features/catalog/domain/createNavigatorCatalog.d.ts.map +1 -0
- package/dist/features/catalog/domain/createNavigatorCatalog.js +198 -0
- package/dist/features/catalog/domain/createNavigatorCatalog.js.map +1 -0
- package/dist/features/catalog/domain/createNavigatorExampleDefinitions.d.ts +4 -0
- package/dist/features/catalog/domain/createNavigatorExampleDefinitions.d.ts.map +1 -0
- package/dist/features/catalog/domain/createNavigatorExampleDefinitions.js +16 -0
- package/dist/features/catalog/domain/createNavigatorExampleDefinitions.js.map +1 -0
- package/dist/features/catalog/domain/createNavigatorPresetCatalog.d.ts +4 -0
- package/dist/features/catalog/domain/createNavigatorPresetCatalog.d.ts.map +1 -0
- package/dist/features/catalog/domain/createNavigatorPresetCatalog.js +68 -0
- package/dist/features/catalog/domain/createNavigatorPresetCatalog.js.map +1 -0
- package/dist/features/catalog/domain/createSplitViewNavigatorExamples.d.ts +4 -0
- package/dist/features/catalog/domain/createSplitViewNavigatorExamples.d.ts.map +1 -0
- package/dist/features/catalog/domain/createSplitViewNavigatorExamples.js +61 -0
- package/dist/features/catalog/domain/createSplitViewNavigatorExamples.js.map +1 -0
- package/dist/features/catalog/domain/createTabsNavigatorExamples.d.ts +4 -0
- package/dist/features/catalog/domain/createTabsNavigatorExamples.d.ts.map +1 -0
- package/dist/features/catalog/domain/createTabsNavigatorExamples.js +102 -0
- package/dist/features/catalog/domain/createTabsNavigatorExamples.js.map +1 -0
- package/dist/features/custom/application/resolveCustomNavigatorAdapterPlan.d.ts.map +1 -1
- package/dist/features/custom/application/resolveCustomNavigatorAdapterPlan.js +4 -3
- package/dist/features/custom/application/resolveCustomNavigatorAdapterPlan.js.map +1 -1
- package/dist/features/custom/domain/addCustomNavigatorDiagnostics.d.ts.map +1 -1
- package/dist/features/custom/domain/addCustomNavigatorDiagnostics.js +4 -2
- package/dist/features/custom/domain/addCustomNavigatorDiagnostics.js.map +1 -1
- package/dist/features/split-view/adapters/outbound/generateSplitViewLayoutFile.js +2 -1
- package/dist/features/split-view/adapters/outbound/generateSplitViewLayoutFile.js.map +1 -1
- package/dist/features/split-view/application/resolveSplitViewAdapterPlan.d.ts.map +1 -1
- package/dist/features/split-view/application/resolveSplitViewAdapterPlan.js +6 -1
- package/dist/features/split-view/application/resolveSplitViewAdapterPlan.js.map +1 -1
- package/dist/features/split-view/domain/addSplitViewDiagnostics.d.ts +1 -1
- package/dist/features/split-view/domain/addSplitViewDiagnostics.d.ts.map +1 -1
- package/dist/features/split-view/domain/addSplitViewDiagnostics.js +7 -14
- package/dist/features/split-view/domain/addSplitViewDiagnostics.js.map +1 -1
- package/dist/features/stack/application/createStackAdapter.d.ts.map +1 -1
- package/dist/features/stack/application/createStackAdapter.js +46 -30
- package/dist/features/stack/application/createStackAdapter.js.map +1 -1
- package/dist/features/stack/domain/addExperimentalStackDiagnostics.d.ts.map +1 -1
- package/dist/features/stack/domain/addExperimentalStackDiagnostics.js +12 -2
- package/dist/features/stack/domain/addExperimentalStackDiagnostics.js.map +1 -1
- package/dist/features/stack/domain/addStackAdapterDiagnostics.d.ts.map +1 -1
- package/dist/features/stack/domain/addStackAdapterDiagnostics.js +5 -2
- package/dist/features/stack/domain/addStackAdapterDiagnostics.js.map +1 -1
- package/dist/features/tabs/adapters/inbound/{CustomTabsLayout.d.ts → HeadlessTabsLayout.d.ts} +12 -12
- package/dist/features/tabs/adapters/inbound/HeadlessTabsLayout.d.ts.map +1 -0
- package/dist/features/tabs/adapters/inbound/{CustomTabsLayout.js → HeadlessTabsLayout.js} +2 -2
- package/dist/features/tabs/adapters/inbound/HeadlessTabsLayout.js.map +1 -0
- package/dist/features/tabs/adapters/outbound/generateTabsLayoutFile.js +17 -13
- package/dist/features/tabs/adapters/outbound/generateTabsLayoutFile.js.map +1 -1
- package/dist/features/tabs/application/createTabsAdapter.d.ts.map +1 -1
- package/dist/features/tabs/application/createTabsAdapter.js +9 -4
- package/dist/features/tabs/application/createTabsAdapter.js.map +1 -1
- package/dist/features/tabs/application/resolveTabsNavigatorPlan.js +12 -12
- package/dist/features/tabs/application/resolveTabsNavigatorPlan.js.map +1 -1
- package/dist/features/tabs/domain/addTabsAdapterDiagnostics.d.ts.map +1 -1
- package/dist/features/tabs/domain/addTabsAdapterDiagnostics.js +12 -9
- package/dist/features/tabs/domain/addTabsAdapterDiagnostics.js.map +1 -1
- package/dist/features/tabs/domain/resolveHeadlessTabsPresentation.d.ts +4 -0
- package/dist/features/tabs/domain/resolveHeadlessTabsPresentation.d.ts.map +1 -0
- package/dist/features/tabs/domain/{resolveCustomTabsPresentation.js → resolveHeadlessTabsPresentation.js} +3 -3
- package/dist/features/tabs/domain/resolveHeadlessTabsPresentation.js.map +1 -0
- package/dist/features/tabs/tabs.d.ts +1 -1
- package/dist/features/tabs/tabs.d.ts.map +1 -1
- package/dist/features/tabs/tabs.js +1 -1
- package/dist/features/tabs/tabs.js.map +1 -1
- package/dist/navigator.d.ts +12 -2
- package/dist/navigator.d.ts.map +1 -1
- package/dist/navigator.js +10 -2
- package/dist/navigator.js.map +1 -1
- package/dist/types/navigatorCli.d.ts +25 -0
- package/dist/types/navigatorCli.d.ts.map +1 -0
- package/dist/types/navigatorCli.js +2 -0
- package/dist/types/navigatorCli.js.map +1 -0
- package/dist/types/navigatorExamples.d.ts +40 -0
- package/dist/types/navigatorExamples.d.ts.map +1 -0
- package/dist/types/navigatorExamples.js +2 -0
- package/dist/types/navigatorExamples.js.map +1 -0
- package/dist/types/navigatorVerification.d.ts +13 -0
- package/dist/types/navigatorVerification.d.ts.map +1 -0
- package/dist/types/navigatorVerification.js +2 -0
- package/dist/types/navigatorVerification.js.map +1 -0
- package/dist/utils/NAVIGATOR_PACKAGE_METADATA.d.ts +4 -100
- package/dist/utils/NAVIGATOR_PACKAGE_METADATA.d.ts.map +1 -1
- package/dist/utils/NAVIGATOR_PACKAGE_METADATA.js +6 -80
- package/dist/utils/NAVIGATOR_PACKAGE_METADATA.js.map +1 -1
- package/dist/utils/NAVIGATOR_ROUTER_POLICY.d.ts +9 -0
- package/dist/utils/NAVIGATOR_ROUTER_POLICY.d.ts.map +1 -0
- package/dist/utils/NAVIGATOR_ROUTER_POLICY.js +9 -0
- package/dist/utils/NAVIGATOR_ROUTER_POLICY.js.map +1 -0
- package/dist/utils/assertNavigatorCliOptions.d.ts +4 -0
- package/dist/utils/assertNavigatorCliOptions.d.ts.map +1 -0
- package/dist/utils/assertNavigatorCliOptions.js +46 -0
- package/dist/utils/assertNavigatorCliOptions.js.map +1 -0
- package/dist/utils/createNavigatorExamplePlan.d.ts +5 -0
- package/dist/utils/createNavigatorExamplePlan.d.ts.map +1 -0
- package/dist/utils/createNavigatorExamplePlan.js +15 -0
- package/dist/utils/createNavigatorExamplePlan.js.map +1 -0
- package/dist/utils/createNavigatorExampleScaffold.d.ts +5 -0
- package/dist/utils/createNavigatorExampleScaffold.d.ts.map +1 -0
- package/dist/utils/createNavigatorExampleScaffold.js +170 -0
- package/dist/utils/createNavigatorExampleScaffold.js.map +1 -0
- package/dist/utils/createNavigatorExampleScreenFiles.d.ts +5 -0
- package/dist/utils/createNavigatorExampleScreenFiles.d.ts.map +1 -0
- package/dist/utils/createNavigatorExampleScreenFiles.js +256 -0
- package/dist/utils/createNavigatorExampleScreenFiles.js.map +1 -0
- package/dist/utils/createNavigatorPlan.d.ts.map +1 -1
- package/dist/utils/createNavigatorPlan.js +46 -6
- package/dist/utils/createNavigatorPlan.js.map +1 -1
- package/dist/utils/generateNavigator.d.ts +4 -0
- package/dist/utils/generateNavigator.d.ts.map +1 -0
- package/dist/utils/{generateNavigatorFiles.js → generateNavigator.js} +33 -35
- package/dist/utils/generateNavigator.js.map +1 -0
- package/dist/utils/generateNavigatorExamples.d.ts +4 -0
- package/dist/utils/generateNavigatorExamples.d.ts.map +1 -0
- package/dist/utils/generateNavigatorExamples.js +75 -0
- package/dist/utils/generateNavigatorExamples.js.map +1 -0
- package/dist/utils/isNavigatorExampleId.d.ts +4 -0
- package/dist/utils/isNavigatorExampleId.d.ts.map +1 -0
- package/dist/utils/isNavigatorExampleId.js +6 -0
- package/dist/utils/isNavigatorExampleId.js.map +1 -0
- package/dist/utils/isNavigatorGenerationBindings.d.ts +4 -0
- package/dist/utils/isNavigatorGenerationBindings.d.ts.map +1 -0
- package/dist/utils/isNavigatorGenerationBindings.js +32 -0
- package/dist/utils/isNavigatorGenerationBindings.js.map +1 -0
- package/dist/utils/loadCustomNavigatorRegistryAsync.d.ts +4 -0
- package/dist/utils/loadCustomNavigatorRegistryAsync.d.ts.map +1 -0
- package/dist/utils/loadCustomNavigatorRegistryAsync.js +21 -0
- package/dist/utils/loadCustomNavigatorRegistryAsync.js.map +1 -0
- package/dist/utils/loadNavigatorCliInputAsync.d.ts +12 -0
- package/dist/utils/loadNavigatorCliInputAsync.d.ts.map +1 -0
- package/dist/utils/loadNavigatorCliInputAsync.js +52 -0
- package/dist/utils/loadNavigatorCliInputAsync.js.map +1 -0
- package/dist/utils/parseNavigatorCliOptions.d.ts +4 -0
- package/dist/utils/parseNavigatorCliOptions.d.ts.map +1 -0
- package/dist/utils/parseNavigatorCliOptions.js +73 -0
- package/dist/utils/parseNavigatorCliOptions.js.map +1 -0
- package/dist/utils/readNavigatorCliJsonAsync.d.ts +3 -0
- package/dist/utils/readNavigatorCliJsonAsync.d.ts.map +1 -0
- package/dist/utils/readNavigatorCliJsonAsync.js +8 -0
- package/dist/utils/readNavigatorCliJsonAsync.js.map +1 -0
- package/dist/utils/renderNavigatorExampleReadme.d.ts +4 -0
- package/dist/utils/renderNavigatorExampleReadme.d.ts.map +1 -0
- package/dist/utils/renderNavigatorExampleReadme.js +42 -0
- package/dist/utils/renderNavigatorExampleReadme.js.map +1 -0
- package/dist/utils/renderNavigatorExamplesIndex.d.ts +4 -0
- package/dist/utils/renderNavigatorExamplesIndex.d.ts.map +1 -0
- package/dist/utils/renderNavigatorExamplesIndex.js +30 -0
- package/dist/utils/renderNavigatorExamplesIndex.js.map +1 -0
- package/dist/utils/reportNavigatorCliResult.d.ts +5 -0
- package/dist/utils/reportNavigatorCliResult.d.ts.map +1 -0
- package/dist/utils/reportNavigatorCliResult.js +20 -0
- package/dist/utils/reportNavigatorCliResult.js.map +1 -0
- package/dist/utils/resolveNavigatorDependencies.d.ts +4 -0
- package/dist/utils/resolveNavigatorDependencies.d.ts.map +1 -0
- package/dist/utils/resolveNavigatorDependencies.js +87 -0
- package/dist/utils/resolveNavigatorDependencies.js.map +1 -0
- package/dist/utils/resolveNavigatorPreset.js +6 -6
- package/dist/utils/resolveNavigatorPreset.js.map +1 -1
- package/dist/utils/validateNavigator.d.ts +4 -0
- package/dist/utils/validateNavigator.d.ts.map +1 -0
- package/dist/utils/validateNavigator.js +22 -0
- package/dist/utils/validateNavigator.js.map +1 -0
- package/dist/utils/validateNavigatorBindings.d.ts +4 -0
- package/dist/utils/validateNavigatorBindings.d.ts.map +1 -0
- package/dist/utils/validateNavigatorBindings.js +105 -0
- package/dist/utils/validateNavigatorBindings.js.map +1 -0
- package/dist/utils/verifyNavigator.d.ts +5 -0
- package/dist/utils/verifyNavigator.d.ts.map +1 -0
- package/dist/utils/verifyNavigator.js +55 -0
- package/dist/utils/verifyNavigator.js.map +1 -0
- package/dist/utils/verifyNavigatorExamplesAsync.d.ts +4 -0
- package/dist/utils/verifyNavigatorExamplesAsync.d.ts.map +1 -0
- package/dist/utils/verifyNavigatorExamplesAsync.js +64 -0
- package/dist/utils/verifyNavigatorExamplesAsync.js.map +1 -0
- package/dist/utils/writeNavigatorGeneratedFilesAsync.d.ts +4 -0
- package/dist/utils/writeNavigatorGeneratedFilesAsync.d.ts.map +1 -0
- package/dist/utils/writeNavigatorGeneratedFilesAsync.js +25 -0
- package/dist/utils/writeNavigatorGeneratedFilesAsync.js.map +1 -0
- package/package.json +61 -7
- package/dist/features/tabs/adapters/inbound/CustomTabsLayout.d.ts.map +0 -1
- package/dist/features/tabs/adapters/inbound/CustomTabsLayout.js.map +0 -1
- package/dist/features/tabs/domain/resolveCustomTabsPresentation.d.ts +0 -4
- package/dist/features/tabs/domain/resolveCustomTabsPresentation.d.ts.map +0 -1
- package/dist/features/tabs/domain/resolveCustomTabsPresentation.js.map +0 -1
- package/dist/utils/generateNavigatorFiles.d.ts +0 -4
- package/dist/utils/generateNavigatorFiles.d.ts.map +0 -1
- package/dist/utils/generateNavigatorFiles.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ankhorage/navigator
|
|
2
2
|
|
|
3
|
+
## 3.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 04eaaa6: Add a public standalone example catalog, CLI generation and verification commands, 22 isolated root Expo apps, and catalog-derived cross-platform acceptance.
|
|
8
|
+
|
|
9
|
+
## 3.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- aad62a1: Add the standalone Catalog → Validate → Plan → Generate → Verify library and Ankh CLI workflow with package-owned capability metadata, structured dependency and diagnostic results, and explicit verification layers.
|
|
14
|
+
|
|
15
|
+
Adopt the Contracts 12 Navigator taxonomy: remove Navigator-owned flows, rename the former custom Tabs implementation to headless, keep custom Tabs presentation and registered custom navigator topology distinct, and rename root-stack presets to their structural stack forms without compatibility aliases.
|
|
16
|
+
|
|
3
17
|
## 2.0.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,9 +3,143 @@
|
|
|
3
3
|
|
|
4
4
|
# NAVIGATOR
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
|
-
Standalone Navigator capability
|
|
8
|
+
Standalone manifest-driven Navigator capability for cataloging, validating, planning, generating, and verifying Expo Router navigation.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
### Catalog → Validate → Plan → Generate → Verify
|
|
13
|
+
|
|
14
|
+
Navigator consumes only an `AppNavigatorManifest`, narrow module bindings, and target context.
|
|
15
|
+
It never needs the complete `AppManifest`, themes, secrets, infrastructure, deployment data, or
|
|
16
|
+
Studio state. `@ankhorage/contracts/navigator` owns structural parsing; Navigator owns semantic
|
|
17
|
+
target validation, capability metadata, planning, generation, and Navigator-specific evidence.
|
|
18
|
+
|
|
19
|
+
The taxonomy stays orthogonal:
|
|
20
|
+
|
|
21
|
+
| Dimension | Examples |
|
|
22
|
+
| -------------- | ---------------------------------------------------------------------- |
|
|
23
|
+
| Topology | Slot, Stack, Tabs, Drawer, Split View, registered Custom |
|
|
24
|
+
| Implementation | native, JavaScript, headless, experimental |
|
|
25
|
+
| Presentation | bottom, top, rail, sidebar, adaptive, custom, two-column, three-column |
|
|
26
|
+
| Preset | `drawer`, `stack-tabs`, `stack-tabs-stack`, `drawer-tabs-stack` |
|
|
27
|
+
|
|
28
|
+
Tabs are always Tabs; top and bottom are presentations. `drawer` is a complete root preset with
|
|
29
|
+
direct routes. Presets resolve to ordinary recursive manifest input. Navigator has no flow field:
|
|
30
|
+
onboarding, survey, setup, checkout, and authentication are app-owned routes, nested navigators,
|
|
31
|
+
guards, and state. For example, `stack-tabs-stack` can represent a neutral pre-main sequence
|
|
32
|
+
followed by Tabs whose branches own Stacks without encoding application semantics.
|
|
33
|
+
|
|
34
|
+
The programmatic example below returns stable relative files and contents, dependency
|
|
35
|
+
requirements, diagnostics, support, the resolved plan, and capability IDs. It performs no writes.
|
|
36
|
+
To materialize the same contract into an Expo app, save the manifest and bindings as JSON and run:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
ankh navigator catalog
|
|
40
|
+
ankh navigator validate --manifest navigator.json --bindings navigator.bindings.json --platform web --expo-router-version "$EXPO_ROUTER_VERSION"
|
|
41
|
+
ankh navigator plan --manifest navigator.json --platform web --expo-router-version "$EXPO_ROUTER_VERSION" --json
|
|
42
|
+
ankh navigator generate --manifest navigator.json --bindings navigator.bindings.json --platform web --expo-router-version "$EXPO_ROUTER_VERSION" --target ./my-app
|
|
43
|
+
ankh navigator verify --manifest navigator.json --bindings navigator.bindings.json --platform web --expo-router-version "$EXPO_ROUTER_VERSION"
|
|
44
|
+
bun --cwd ./my-app expo start
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Human-readable output is the default; `--json` emits the stable versioned envelope. Generation
|
|
48
|
+
requires an explicit target. Custom navigator registries are executable consumer modules passed
|
|
49
|
+
with `--custom-navigators`; screen, guard, icon-resolver, and custom Tabs-presentation bindings
|
|
50
|
+
remain narrow JSON module/symbol records.
|
|
51
|
+
|
|
52
|
+
Navigator also publishes a deterministic catalog of 22 standalone applications under the
|
|
53
|
+
repository-root `examples/<stable-example-id>/` directories:
|
|
54
|
+
|
|
55
|
+
`drawer`, `drawer-split-view`, `drawer-stack`, `drawer-tabs`, `drawer-tabs-stack`,
|
|
56
|
+
`drawer-tabs-top`, `registered-custom`, `slot`, `split-view-three-column`,
|
|
57
|
+
`split-view-two-column`, `stack`, `stack-drawer`, `stack-drawer-stack`, `stack-drawer-tabs`,
|
|
58
|
+
`stack-drawer-tabs-stack`, `stack-tabs`, `stack-tabs-stack`, `stack-tabs-top`, `tabs`,
|
|
59
|
+
`tabs-bottom-tabs-top`, `tabs-split-view`, and `tabs-stack`.
|
|
60
|
+
|
|
61
|
+
Generate or compare one app with `--id`, or omit it for the complete catalog:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
ankh navigator examples generate --target .
|
|
65
|
+
ankh navigator examples verify --target .
|
|
66
|
+
ankh navigator examples generate --id drawer --target .
|
|
67
|
+
ankh navigator examples verify --id drawer --target . --json
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Each example owns its manifest, narrow bindings, package metadata, and lockfile and uses only
|
|
71
|
+
registry dependencies. Repository acceptance extends deterministic CLI verification with fresh
|
|
72
|
+
frozen installs, strict typechecks, the Devtools-managed examples lint configuration, every
|
|
73
|
+
supported or testing-only Expo export target, and browser runtime checks:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
bun run examples:acceptance
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Capability metadata separates `support`, `stability`, and each verification layer. Experimental
|
|
80
|
+
Stack and iOS Split View are testing-only. A non-iOS Slot fallback is explicitly not Split View.
|
|
81
|
+
The checked-in catalog does not turn the existence of a plan into runtime evidence: CI executes
|
|
82
|
+
install, export, and browser acceptance independently. Simulator and physical-device claims stay
|
|
83
|
+
unverified until those native environments record evidence.
|
|
84
|
+
|
|
85
|
+
Studio and future composers read `getNavigatorCatalog()` and `getNavigatorExampleCatalog()`,
|
|
86
|
+
author `manifest.navigator`, and invoke this same lifecycle. They do not own a second capability
|
|
87
|
+
or examples table.
|
|
88
|
+
|
|
89
|
+
Source: `docs/readme-usage.ts`
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import type {
|
|
93
|
+
AppNavigatorManifest,
|
|
94
|
+
NavigatorGenerationBindings,
|
|
95
|
+
} from '@ankhorage/contracts/navigator';
|
|
96
|
+
import expoRouterPackage from 'expo-router/package.json';
|
|
97
|
+
|
|
98
|
+
import {
|
|
99
|
+
createNavigatorPlan,
|
|
100
|
+
generateNavigator,
|
|
101
|
+
getNavigatorCatalog,
|
|
102
|
+
getNavigatorExampleCatalog,
|
|
103
|
+
validateNavigator,
|
|
104
|
+
verifyNavigator,
|
|
105
|
+
} from '@ankhorage/navigator';
|
|
106
|
+
|
|
107
|
+
const manifest = {
|
|
108
|
+
type: 'drawer',
|
|
109
|
+
initialRouteName: 'index',
|
|
110
|
+
routes: [
|
|
111
|
+
{ name: 'index', label: 'Home', screenId: 'home' },
|
|
112
|
+
{ name: 'settings', label: 'Settings', screenId: 'settings' },
|
|
113
|
+
],
|
|
114
|
+
} as const satisfies AppNavigatorManifest;
|
|
115
|
+
|
|
116
|
+
const bindings = {
|
|
117
|
+
screens: {
|
|
118
|
+
home: { module: '@/screens/HomeScreen', exportName: 'HomeScreen' },
|
|
119
|
+
settings: { module: '@/screens/SettingsScreen', exportName: 'SettingsScreen' },
|
|
120
|
+
},
|
|
121
|
+
guards: {},
|
|
122
|
+
} as const satisfies NavigatorGenerationBindings;
|
|
123
|
+
|
|
124
|
+
const target = {
|
|
125
|
+
platform: 'web',
|
|
126
|
+
expoRouterVersion: expoRouterPackage.version,
|
|
127
|
+
} as const;
|
|
128
|
+
|
|
129
|
+
const diagnostics = validateNavigator(manifest, bindings, target);
|
|
130
|
+
const plan = createNavigatorPlan(manifest, target);
|
|
131
|
+
const generation = generateNavigator(plan, bindings);
|
|
132
|
+
const verification = verifyNavigator(plan, bindings);
|
|
133
|
+
|
|
134
|
+
console.log({
|
|
135
|
+
catalog: getNavigatorCatalog(),
|
|
136
|
+
examples: getNavigatorExampleCatalog(),
|
|
137
|
+
diagnostics,
|
|
138
|
+
plan,
|
|
139
|
+
generation,
|
|
140
|
+
verification,
|
|
141
|
+
});
|
|
142
|
+
```
|
|
9
143
|
|
|
10
144
|
## Generated documentation
|
|
11
145
|
|
|
@@ -15,7 +149,8 @@ Standalone Navigator capability with topology configured independently from plat
|
|
|
15
149
|
- [Architecture overview](././paradox/diagrams/architecture-overview.mmd)
|
|
16
150
|
- [Module relationships](././paradox/diagrams/module-relationships.mmd)
|
|
17
151
|
- [Export graph](././paradox/diagrams/export-graph.mmd)
|
|
18
|
-
- [CustomTabsLayout sequence](././paradox/diagrams/sequences/custom-tabs-layout.mmd)
|
|
19
152
|
- [defineCustomNavigatorRegistry sequence](././paradox/diagrams/sequences/define-custom-navigator-registry.mmd)
|
|
20
|
-
- [
|
|
153
|
+
- [HeadlessTabsLayout sequence](././paradox/diagrams/sequences/headless-tabs-layout.mmd)
|
|
154
|
+
- [isNavigatorGenerationBindings sequence](././paradox/diagrams/sequences/is-navigator-generation-bindings.mmd)
|
|
155
|
+
- [resolveHeadlessTabsPresentation sequence](././paradox/diagrams/sequences/resolve-headless-tabs-presentation.mmd)
|
|
21
156
|
- [resolveTabsNavigatorPlan sequence](././paradox/diagrams/sequences/resolve-tabs-navigator-plan.mmd)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NavigatorCliExecution, NavigatorCliRunResult } from '../../types/navigatorCli';
|
|
2
|
+
/*** List or inspect the package-owned capability and preset catalog. */
|
|
3
|
+
export declare function catalog(input: NavigatorCliExecution): NavigatorCliRunResult;
|
|
4
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/catalog.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAK7F,wEAAwE;AACxE,wBAAgB,OAAO,CAAC,KAAK,EAAE,qBAAqB,GAAG,qBAAqB,CAiB3E"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { getNavigatorCatalog } from '../../features/catalog/adapters/inbound/getNavigatorCatalog';
|
|
2
|
+
import { assertNavigatorCliOptions } from '../../utils/assertNavigatorCliOptions';
|
|
3
|
+
import { parseNavigatorCliOptions } from '../../utils/parseNavigatorCliOptions';
|
|
4
|
+
import { reportNavigatorCliResult } from '../../utils/reportNavigatorCliResult';
|
|
5
|
+
/*** List or inspect the package-owned capability and preset catalog. */
|
|
6
|
+
export function catalog(input) {
|
|
7
|
+
try {
|
|
8
|
+
const options = parseNavigatorCliOptions(input.argv);
|
|
9
|
+
assertNavigatorCliOptions(options, [], ['id', 'kind']);
|
|
10
|
+
const catalog = getNavigatorCatalog();
|
|
11
|
+
const selection = selectCatalog(catalog, options.id, options.kind);
|
|
12
|
+
return reportNavigatorCliResult(input, options.format, 'navigator.catalog', selection.data, selection.diagnostics, renderCatalog(selection.data));
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return reportInputFailure(input, error);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/*** Select an unambiguous catalog entry or a filtered listing. */
|
|
19
|
+
function selectCatalog(catalog, id, kind) {
|
|
20
|
+
const capabilities = catalog.capabilities.filter((entry) => entry.id === id);
|
|
21
|
+
const presets = catalog.presets.filter((entry) => entry.id === id);
|
|
22
|
+
const matches = kind === 'capability'
|
|
23
|
+
? capabilities
|
|
24
|
+
: kind === 'preset'
|
|
25
|
+
? presets
|
|
26
|
+
: [...capabilities, ...presets];
|
|
27
|
+
const listing = kind === 'capability' ? catalog.capabilities : kind === 'preset' ? catalog.presets : catalog;
|
|
28
|
+
if (id === undefined)
|
|
29
|
+
return { data: listing, diagnostics: [] };
|
|
30
|
+
if (matches.length === 1)
|
|
31
|
+
return { data: matches[0], diagnostics: [] };
|
|
32
|
+
const ambiguous = matches.length > 1;
|
|
33
|
+
return {
|
|
34
|
+
data: undefined,
|
|
35
|
+
diagnostics: [
|
|
36
|
+
{
|
|
37
|
+
code: ambiguous ? 'ambiguous-catalog-entry' : 'unknown-catalog-entry',
|
|
38
|
+
severity: 'error',
|
|
39
|
+
path: '/id',
|
|
40
|
+
message: ambiguous
|
|
41
|
+
? `Catalog id ${JSON.stringify(id)} names both a capability and a preset; add --kind.`
|
|
42
|
+
: `No capability or preset is registered as ${JSON.stringify(id)}.`,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/*** Render compact human catalog output without creating a second metadata table. */
|
|
48
|
+
function renderCatalog(value) {
|
|
49
|
+
if (value === undefined)
|
|
50
|
+
return [];
|
|
51
|
+
if (typeof value !== 'object' || value === null)
|
|
52
|
+
return [JSON.stringify(value)];
|
|
53
|
+
if ('capabilities' in value && 'presets' in value) {
|
|
54
|
+
const catalog = getNavigatorCatalog();
|
|
55
|
+
return [
|
|
56
|
+
'Navigator capabilities',
|
|
57
|
+
...catalog.capabilities.map(({ id, targets }) => `- ${id}: ${targets.map(({ platform, support }) => `${platform}=${support}`).join(', ')}`),
|
|
58
|
+
'Navigator presets',
|
|
59
|
+
...catalog.presets.map(({ id, description }) => `- ${id}: ${description}`),
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
return [JSON.stringify(value, null, 2)];
|
|
63
|
+
}
|
|
64
|
+
/*** Report deterministic option and input failures. */
|
|
65
|
+
function reportInputFailure(input, error) {
|
|
66
|
+
const format = input.argv.includes('--json') ? 'json' : 'human';
|
|
67
|
+
return reportNavigatorCliResult(input, format, 'navigator.catalog', null, [
|
|
68
|
+
{
|
|
69
|
+
code: 'invalid-cli-input',
|
|
70
|
+
severity: 'error',
|
|
71
|
+
path: '',
|
|
72
|
+
message: error instanceof Error ? error.message : 'Invalid catalog input.',
|
|
73
|
+
},
|
|
74
|
+
], [], true);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/cli/commands/catalog.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AAElG,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,wEAAwE;AACxE,MAAM,UAAU,OAAO,CAAC,KAA4B;IAClD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrD,yBAAyB,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACnE,OAAO,wBAAwB,CAC7B,KAAK,EACL,OAAO,CAAC,MAAM,EACd,mBAAmB,EACnB,SAAS,CAAC,IAAI,EACd,SAAS,CAAC,WAAW,EACrB,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAC9B,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,kEAAkE;AAClE,SAAS,aAAa,CACpB,OAA+C,EAC/C,EAAs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7B,KAAK,EACL,MAAM,EACN,mBAAmB,EACnB,IAAI,EACJ;QACE;YACE,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB;SAC3E;KACF,EACD,EAAE,EACF,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NavigatorCliExecution, NavigatorCliRunResult } from '../../../types/navigatorCli';
|
|
2
|
+
/*** Generate one or every standalone example below a root examples directory. */
|
|
3
|
+
export declare function generate(input: NavigatorCliExecution): Promise<NavigatorCliRunResult>;
|
|
4
|
+
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/examples/generate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAShG,iFAAiF;AACjF,wBAAsB,QAAQ,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAyB3F"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { assertNavigatorCliOptions } from '../../../utils/assertNavigatorCliOptions';
|
|
2
|
+
import { generateNavigatorExamples } from '../../../utils/generateNavigatorExamples';
|
|
3
|
+
import { isNavigatorExampleId } from '../../../utils/isNavigatorExampleId';
|
|
4
|
+
import { parseNavigatorCliOptions } from '../../../utils/parseNavigatorCliOptions';
|
|
5
|
+
import { reportNavigatorCliResult } from '../../../utils/reportNavigatorCliResult';
|
|
6
|
+
import { writeNavigatorGeneratedFilesAsync } from '../../../utils/writeNavigatorGeneratedFilesAsync';
|
|
7
|
+
/*** Generate one or every standalone example below a root examples directory. */
|
|
8
|
+
export async function generate(input) {
|
|
9
|
+
try {
|
|
10
|
+
const options = parseNavigatorCliOptions(input.argv);
|
|
11
|
+
assertNavigatorCliOptions(options, ['targetDirectory'], ['id', 'targetDirectory']);
|
|
12
|
+
if (options.id !== undefined && !isNavigatorExampleId(options.id)) {
|
|
13
|
+
throw new Error(`Unknown Navigator example ${JSON.stringify(options.id)}.`);
|
|
14
|
+
}
|
|
15
|
+
if (options.targetDirectory === undefined)
|
|
16
|
+
throw new Error('Target directory is required.');
|
|
17
|
+
const result = generateNavigatorExamples(options.id);
|
|
18
|
+
const written = await writeNavigatorGeneratedFilesAsync(options.targetDirectory, input.cwd, result.files);
|
|
19
|
+
return reportNavigatorCliResult(input, options.format, 'navigator.examples.generate', { ...result, written }, [], [`Examples: ${result.examples.length}`, `Written files: ${written.length}`]);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return reportFailure(input, error);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/*** Report deterministic example-generation input or write failures. */
|
|
26
|
+
function reportFailure(input, error) {
|
|
27
|
+
return reportNavigatorCliResult(input, input.argv.includes('--json') ? 'json' : 'human', 'navigator.examples.generate', null, [
|
|
28
|
+
{
|
|
29
|
+
code: 'invalid-example-input',
|
|
30
|
+
severity: 'error',
|
|
31
|
+
path: '',
|
|
32
|
+
message: error instanceof Error ? error.message : 'Invalid example generation input.',
|
|
33
|
+
},
|
|
34
|
+
], [], true);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../src/cli/commands/examples/generate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EA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AACH,CAAC;AAED,wEAAwE;AACxE,SAAS,aAAa,CAAC,KAA4B,EAAE,KAAc;IACjE,OAAO,wBAAwB,CAC7B,KAAK,EACL,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAChD,6BAA6B,EAC7B,IAAI,EACJ;QACE;YACE,IAAI,EAAE,uBAAuB;YAC7B,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mCAAmC;SACtF;KACF,EACD,EAAE,EACF,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NavigatorCliExecution, NavigatorCliRunResult } from '../../../types/navigatorCli';
|
|
2
|
+
/*** Verify one or every root example against deterministic generation and lockfile ownership. */
|
|
3
|
+
export declare function verify(input: NavigatorCliExecution): Promise<NavigatorCliRunResult>;
|
|
4
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/examples/verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAQhG,iGAAiG;AACjG,wBAAsB,MAAM,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAsCzF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { assertNavigatorCliOptions } from '../../../utils/assertNavigatorCliOptions';
|
|
2
|
+
import { isNavigatorExampleId } from '../../../utils/isNavigatorExampleId';
|
|
3
|
+
import { parseNavigatorCliOptions } from '../../../utils/parseNavigatorCliOptions';
|
|
4
|
+
import { reportNavigatorCliResult } from '../../../utils/reportNavigatorCliResult';
|
|
5
|
+
import { verifyNavigatorExamplesAsync } from '../../../utils/verifyNavigatorExamplesAsync';
|
|
6
|
+
/*** Verify one or every root example against deterministic generation and lockfile ownership. */
|
|
7
|
+
export async function verify(input) {
|
|
8
|
+
try {
|
|
9
|
+
const options = parseNavigatorCliOptions(input.argv);
|
|
10
|
+
assertNavigatorCliOptions(options, ['targetDirectory'], ['id', 'targetDirectory']);
|
|
11
|
+
if (options.id !== undefined && !isNavigatorExampleId(options.id)) {
|
|
12
|
+
throw new Error(`Unknown Navigator example ${JSON.stringify(options.id)}.`);
|
|
13
|
+
}
|
|
14
|
+
if (options.targetDirectory === undefined)
|
|
15
|
+
throw new Error('Target directory is required.');
|
|
16
|
+
const result = await verifyNavigatorExamplesAsync(options.targetDirectory, input.cwd, options.id);
|
|
17
|
+
const stale = result.examples.filter(({ current }) => !current);
|
|
18
|
+
return reportNavigatorCliResult(input, options.format, 'navigator.examples.verify', result, stale.length === 0
|
|
19
|
+
? []
|
|
20
|
+
: [
|
|
21
|
+
{
|
|
22
|
+
code: 'stale-examples',
|
|
23
|
+
severity: 'error',
|
|
24
|
+
path: '/examples',
|
|
25
|
+
message: `${stale.length} Navigator example(s) are missing or stale.`,
|
|
26
|
+
},
|
|
27
|
+
], [
|
|
28
|
+
`Examples: ${result.examples.length}`,
|
|
29
|
+
`Current: ${result.examples.length - stale.length}`,
|
|
30
|
+
`Stale: ${stale.length}`,
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return reportFailure(input, error);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/*** Report deterministic example-verification input or filesystem failures. */
|
|
38
|
+
function reportFailure(input, error) {
|
|
39
|
+
return reportNavigatorCliResult(input, input.argv.includes('--json') ? 'json' : 'human', 'navigator.examples.verify', null, [
|
|
40
|
+
{
|
|
41
|
+
code: 'invalid-example-input',
|
|
42
|
+
severity: 'error',
|
|
43
|
+
path: '',
|
|
44
|
+
message: error instanceof Error ? error.message : 'Invalid example verification input.',
|
|
45
|
+
},
|
|
46
|
+
], [], true);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=verify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../../src/cli/commands/examples/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAE3F,iGAAiG;AACjG,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,KAA4B;IACvD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrD,yBAAyB,CAAC,OAAO,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC;QACnF,IAAI,OAAO,CAAC,EAAE,KAAK,SAAS,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;YAClE,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9E,CAAC;QACD,IAAI,OAAO,CAAC,eAAe,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC5F,MAAM,MAAM,GAAuC,MAAM,4BAA4B,CACnF,OAAO,CAAC,eAAe,EACvB,KAAK,CAAC,GAAG,EACT,OAAO,CAAC,EAAE,CACX,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM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|
2
|
+
/*** Generate one structured Navigator file set and write it below an explicit target. */
|
|
3
|
+
export declare function generate(input: NavigatorCliExecution): Promise<NavigatorCliRunResult>;
|
|
4
|
+
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAS7F,yFAAyF;AACzF,wBAAsB,QAAQ,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA4C3F"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { assertNavigatorCliOptions } from '../../utils/assertNavigatorCliOptions';
|
|
2
|
+
import { createNavigatorPlan } from '../../utils/createNavigatorPlan';
|
|
3
|
+
import { generateNavigator } from '../../utils/generateNavigator';
|
|
4
|
+
import { loadNavigatorCliInputAsync } from '../../utils/loadNavigatorCliInputAsync';
|
|
5
|
+
import { parseNavigatorCliOptions } from '../../utils/parseNavigatorCliOptions';
|
|
6
|
+
import { reportNavigatorCliResult } from '../../utils/reportNavigatorCliResult';
|
|
7
|
+
import { writeNavigatorGeneratedFilesAsync } from '../../utils/writeNavigatorGeneratedFilesAsync';
|
|
8
|
+
/*** Generate one structured Navigator file set and write it below an explicit target. */
|
|
9
|
+
export async function generate(input) {
|
|
10
|
+
try {
|
|
11
|
+
const options = parseNavigatorCliOptions(input.argv);
|
|
12
|
+
assertNavigatorCliOptions(options, ['manifestPath', 'bindingsPath', 'targetDirectory', 'platform', 'expoRouterVersion'], [
|
|
13
|
+
'manifestPath',
|
|
14
|
+
'bindingsPath',
|
|
15
|
+
'customNavigatorsPath',
|
|
16
|
+
'targetDirectory',
|
|
17
|
+
'platform',
|
|
18
|
+
'expoRouterVersion',
|
|
19
|
+
'responsiveSize',
|
|
20
|
+
'rootDirectory',
|
|
21
|
+
'includeScreenFiles',
|
|
22
|
+
]);
|
|
23
|
+
const loaded = await loadNavigatorCliInputAsync(options, input.cwd, true);
|
|
24
|
+
if (loaded.bindings === undefined || options.targetDirectory === undefined) {
|
|
25
|
+
throw new Error('Bindings and target directory are required for generation.');
|
|
26
|
+
}
|
|
27
|
+
const plan = createNavigatorPlan(loaded.manifest, loaded.planOptions);
|
|
28
|
+
const result = generateNavigator(plan, loaded.bindings, loaded.generationOptions);
|
|
29
|
+
const hasErrors = result.diagnostics.some(({ severity }) => severity === 'error');
|
|
30
|
+
const written = hasErrors
|
|
31
|
+
? []
|
|
32
|
+
: await writeNavigatorGeneratedFilesAsync(options.targetDirectory, input.cwd, result.files);
|
|
33
|
+
return reportNavigatorCliResult(input, options.format, 'navigator.generate', { ...result, written }, result.diagnostics, [
|
|
34
|
+
`Support: ${result.support}`,
|
|
35
|
+
`Capabilities: ${result.capabilityIds.join(', ') || 'none'}`,
|
|
36
|
+
`Generated files: ${result.files.length}`,
|
|
37
|
+
`Written files: ${written.length}`,
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return reportInputFailure(input, error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/*** Report deterministic Generate-stage input or write failures. */
|
|
45
|
+
function reportInputFailure(input, error) {
|
|
46
|
+
return reportNavigatorCliResult(input, input.argv.includes('--json') ? 'json' : 'human', 'navigator.generate', null, [
|
|
47
|
+
{
|
|
48
|
+
code: 'invalid-cli-input',
|
|
49
|
+
severity: 'error',
|
|
50
|
+
path: '',
|
|
51
|
+
message: error instanceof Error ? error.message : 'Invalid generation input.',
|
|
52
|
+
},
|
|
53
|
+
], [], true);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,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,4 @@
|
|
|
1
|
+
import type { NavigatorCliExecution, NavigatorCliRunResult } from '../../types/navigatorCli';
|
|
2
|
+
/*** Resolve and print one deterministic Navigator plan and its dependency requirements. */
|
|
3
|
+
export declare function plan(input: NavigatorCliExecution): Promise<NavigatorCliRunResult>;
|
|
4
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAO7F,2FAA2F;AAC3F,wBAAsB,IAAI,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA4BvF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { assertNavigatorCliOptions } from '../../utils/assertNavigatorCliOptions';
|
|
2
|
+
import { createNavigatorPlan } from '../../utils/createNavigatorPlan';
|
|
3
|
+
import { loadNavigatorCliInputAsync } from '../../utils/loadNavigatorCliInputAsync';
|
|
4
|
+
import { parseNavigatorCliOptions } from '../../utils/parseNavigatorCliOptions';
|
|
5
|
+
import { reportNavigatorCliResult } from '../../utils/reportNavigatorCliResult';
|
|
6
|
+
/*** Resolve and print one deterministic Navigator plan and its dependency requirements. */
|
|
7
|
+
export async function plan(input) {
|
|
8
|
+
try {
|
|
9
|
+
const options = parseNavigatorCliOptions(input.argv);
|
|
10
|
+
assertNavigatorCliOptions(options, ['manifestPath', 'platform', 'expoRouterVersion'], ['manifestPath', 'customNavigatorsPath', 'platform', 'expoRouterVersion', 'responsiveSize']);
|
|
11
|
+
const loaded = await loadNavigatorCliInputAsync(options, input.cwd, false);
|
|
12
|
+
const plan = createNavigatorPlan(loaded.manifest, loaded.planOptions);
|
|
13
|
+
return reportNavigatorCliResult(input, options.format, 'navigator.plan', plan, plan.diagnostics, [
|
|
14
|
+
`Support: ${plan.support}`,
|
|
15
|
+
`Capabilities: ${plan.capabilityIds.join(', ') || 'none'}`,
|
|
16
|
+
'Dependencies:',
|
|
17
|
+
...plan.dependencies.map(({ packageName, versionRange }) => `- ${packageName}: ${versionRange}`),
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
return reportInputFailure(input, error);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/*** Report deterministic Plan-stage input failures. */
|
|
25
|
+
function reportInputFailure(input, error) {
|
|
26
|
+
return reportNavigatorCliResult(input, input.argv.includes('--json') ? 'json' : 'human', 'navigator.plan', null, [
|
|
27
|
+
{
|
|
28
|
+
code: 'invalid-cli-input',
|
|
29
|
+
severity: 'error',
|
|
30
|
+
path: '',
|
|
31
|
+
message: error instanceof Error ? error.message : 'Invalid planning input.',
|
|
32
|
+
},
|
|
33
|
+
], [], true);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../src/cli/commands/plan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,2FAA2F;AAC3F,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,KAA4B;IACrD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrD,yBAAyB,CACvB,OAAO,EACP,CAAC,cAAc,EAAE,UAAU,EAAE,mBAAmB,CAAC,EACjD,CAAC,cAAc,EAAE,sBAAsB,EA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
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NavigatorCliExecution, NavigatorCliRunResult } from '../../types/navigatorCli';
|
|
2
|
+
/*** Structurally and semantically validate a manifest and narrow bindings without writes. */
|
|
3
|
+
export declare function validate(input: NavigatorCliExecution): Promise<NavigatorCliRunResult>;
|
|
4
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAQ7F,6FAA6F;AAC7F,wBAAsB,QAAQ,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuC3F"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { assertNavigatorCliOptions } from '../../utils/assertNavigatorCliOptions';
|
|
2
|
+
import { loadCustomNavigatorRegistryAsync } from '../../utils/loadCustomNavigatorRegistryAsync';
|
|
3
|
+
import { parseNavigatorCliOptions } from '../../utils/parseNavigatorCliOptions';
|
|
4
|
+
import { readNavigatorCliJsonAsync } from '../../utils/readNavigatorCliJsonAsync';
|
|
5
|
+
import { reportNavigatorCliResult } from '../../utils/reportNavigatorCliResult';
|
|
6
|
+
import { validateNavigator } from '../../utils/validateNavigator';
|
|
7
|
+
/*** Structurally and semantically validate a manifest and narrow bindings without writes. */
|
|
8
|
+
export async function validate(input) {
|
|
9
|
+
try {
|
|
10
|
+
const options = parseNavigatorCliOptions(input.argv);
|
|
11
|
+
assertNavigatorCliOptions(options, ['manifestPath', 'bindingsPath', 'platform', 'expoRouterVersion'], [
|
|
12
|
+
'manifestPath',
|
|
13
|
+
'bindingsPath',
|
|
14
|
+
'customNavigatorsPath',
|
|
15
|
+
'platform',
|
|
16
|
+
'expoRouterVersion',
|
|
17
|
+
'responsiveSize',
|
|
18
|
+
'rootDirectory',
|
|
19
|
+
'includeScreenFiles',
|
|
20
|
+
]);
|
|
21
|
+
const { manifestPath, bindingsPath } = options;
|
|
22
|
+
if (manifestPath === undefined || bindingsPath === undefined) {
|
|
23
|
+
throw new Error('Manifest and bindings paths are required for validation.');
|
|
24
|
+
}
|
|
25
|
+
const manifest = await readNavigatorCliJsonAsync(manifestPath, input.cwd);
|
|
26
|
+
const bindings = await readNavigatorCliJsonAsync(bindingsPath, input.cwd);
|
|
27
|
+
const planOptions = await createPlanOptions(options, input.cwd);
|
|
28
|
+
const diagnostics = validateNavigator(manifest, bindings, planOptions, {
|
|
29
|
+
includeScreenFiles: options.includeScreenFiles,
|
|
30
|
+
...(options.rootDirectory === undefined ? {} : { rootDirectory: options.rootDirectory }),
|
|
31
|
+
});
|
|
32
|
+
return reportNavigatorCliResult(input, options.format, 'navigator.validate', { valid: !diagnostics.some(({ severity }) => severity === 'error') }, diagnostics, [diagnostics.length === 0 ? 'Navigator input is valid.' : 'Navigator input has diagnostics.']);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return reportInputFailure(input, error);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/*** Resolve target context and an optional executable custom-navigator registry. */
|
|
39
|
+
async function createPlanOptions(options, cwd) {
|
|
40
|
+
const { platform, expoRouterVersion } = options;
|
|
41
|
+
if (platform === undefined || expoRouterVersion === undefined) {
|
|
42
|
+
throw new Error('Platform and Expo Router version are required for validation.');
|
|
43
|
+
}
|
|
44
|
+
const customNavigators = await loadCustomNavigatorRegistryAsync(options.customNavigatorsPath, cwd);
|
|
45
|
+
return {
|
|
46
|
+
platform,
|
|
47
|
+
expoRouterVersion,
|
|
48
|
+
...(options.responsiveSize === undefined ? {} : { responsiveSize: options.responsiveSize }),
|
|
49
|
+
...(customNavigators === undefined ? {} : { customNavigators }),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/*** Report file, JSON, registry, and option failures separately from navigator diagnostics. */
|
|
53
|
+
function reportInputFailure(input, error) {
|
|
54
|
+
return reportNavigatorCliResult(input, input.argv.includes('--json') ? 'json' : 'human', 'navigator.validate', null, [
|
|
55
|
+
{
|
|
56
|
+
code: 'invalid-cli-input',
|
|
57
|
+
severity: 'error',
|
|
58
|
+
path: '',
|
|
59
|
+
message: error instanceof Error ? error.message : 'Invalid validation input.',
|
|
60
|
+
},
|
|
61
|
+
], [], true);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/cli/commands/validate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,KAA4B;IACzD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrD,yBAAyB,CACvB,OAAO,EACP,CAAC,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,mBAAmB,CAAC,EACjE;YACE,cAAc;YACd,cAAc;YACd,sBAAsB;YACtB,UAAU;YACV,mBAAmB;YACnB,gBAAgB;YAChB,eAAe;YACf,oBAAoB;SACrB,CACF,CAAC;QACF,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;QAC/C,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC7D,MAAM,IAAI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C9D,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IACD,MAAM,gBAAgB,GAAG,MAAM,gCAAgC,CAC7D,OAAO,CAAC,oBAAoB,EAC5B,GAAG,CACJ,CAAC;IACF,OAAO;QACL,QAAQ;QACR,iBAAiB;QACjB,GAAG,CAAC,OAAO,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;QAC3F,GAAG,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC;KAChE,CAAC;AACJ,CAAC;AAED,+FAA+F;AAC/F,SAAS,kBAAkB,CAAC,KAA4B,EAAE,KAAc;IACtE,OAAO,wBAAwB,CAC7B,KAAK,EACL,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAChD,oBAAoB,EACpB,IAAI,EACJ;QACE;YACE,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,2BAA2B;SAC9E;KACF,EACD,EAAE,EACF,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NavigatorCliExecution, NavigatorCliRunResult } from '../../types/navigatorCli';
|
|
2
|
+
/*** Verify Navigator-owned structural and deterministic generation evidence without writes. */
|
|
3
|
+
export declare function verify(input: NavigatorCliExecution): Promise<NavigatorCliRunResult>;
|
|
4
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAS7F,+FAA+F;AAC/F,wBAAsB,MAAM,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAmCzF"}
|