@axonpack/preview 0.0.0-stage → 0.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 +13 -0
- package/LICENSE +21 -0
- package/README.md +118 -2
- package/android/build.gradle +21 -0
- package/android/consumer-rules.pro +3 -0
- package/android/src/main/java/expo/modules/axonpackpreview/AxonpackPreviewModule.kt +72 -0
- package/android/src/main/java/expo/modules/axonpackpreview/BundleLoaderOverride.kt +41 -0
- package/android/src/main/java/expo/modules/axonpackpreview/HermesHeader.kt +24 -0
- package/android/src/main/java/expo/modules/axonpackpreview/PreviewPackage.kt +76 -0
- package/android/src/main/java/expo/modules/axonpackpreview/PreviewState.kt +295 -0
- package/app.plugin.js +112 -0
- package/bin/preview.js +2 -0
- package/build/cli.cjs +1465 -0
- package/build/cli.d.ts +3 -0
- package/build/cli.d.ts.map +1 -0
- package/build/cli.js +164 -0
- package/build/cli.js.map +1 -0
- package/build/components/preview-list/preview-list.component.d.ts +13 -0
- package/build/components/preview-list/preview-list.component.d.ts.map +1 -0
- package/build/components/preview-list/preview-list.component.js +316 -0
- package/build/components/preview-list/preview-list.component.js.map +1 -0
- package/build/components/preview-list/preview-list.types.d.ts +59 -0
- package/build/components/preview-list/preview-list.types.d.ts.map +1 -0
- package/build/components/preview-list/preview-list.types.js +2 -0
- package/build/components/preview-list/preview-list.types.js.map +1 -0
- package/build/components/preview-provider/preview-provider.component.d.ts +12 -0
- package/build/components/preview-provider/preview-provider.component.d.ts.map +1 -0
- package/build/components/preview-provider/preview-provider.component.js +19 -0
- package/build/components/preview-provider/preview-provider.component.js.map +1 -0
- package/build/constants/dev-preview-servers/dev-preview-servers.const.d.ts +26 -0
- package/build/constants/dev-preview-servers/dev-preview-servers.const.d.ts.map +1 -0
- package/build/constants/dev-preview-servers/dev-preview-servers.const.js +9 -0
- package/build/constants/dev-preview-servers/dev-preview-servers.const.js.map +1 -0
- package/build/constants/preview-list/theme.const.d.ts +5 -0
- package/build/constants/preview-list/theme.const.d.ts.map +1 -0
- package/build/constants/preview-list/theme.const.js +65 -0
- package/build/constants/preview-list/theme.const.js.map +1 -0
- package/build/index.d.ts +24 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +16 -0
- package/build/index.js.map +1 -0
- package/build/services/cli/config.service.d.ts +13 -0
- package/build/services/cli/config.service.d.ts.map +1 -0
- package/build/services/cli/config.service.js +39 -0
- package/build/services/cli/config.service.js.map +1 -0
- package/build/services/cli/project.service.d.ts +25 -0
- package/build/services/cli/project.service.d.ts.map +1 -0
- package/build/services/cli/project.service.js +81 -0
- package/build/services/cli/project.service.js.map +1 -0
- package/build/services/cli/title.service.d.ts +15 -0
- package/build/services/cli/title.service.d.ts.map +1 -0
- package/build/services/cli/title.service.js +24 -0
- package/build/services/cli/title.service.js.map +1 -0
- package/build/services/dev-preview-servers/discover.service.d.ts +14 -0
- package/build/services/dev-preview-servers/discover.service.d.ts.map +1 -0
- package/build/services/dev-preview-servers/discover.service.js +106 -0
- package/build/services/dev-preview-servers/discover.service.js.map +1 -0
- package/build/services/native/build-info.service.d.ts +11 -0
- package/build/services/native/build-info.service.d.ts.map +1 -0
- package/build/services/native/build-info.service.js +18 -0
- package/build/services/native/build-info.service.js.map +1 -0
- package/build/services/native/native.service.d.ts +24 -0
- package/build/services/native/native.service.d.ts.map +1 -0
- package/build/services/native/native.service.js +13 -0
- package/build/services/native/native.service.js.map +1 -0
- package/build/services/previews/download.service.d.ts +14 -0
- package/build/services/previews/download.service.d.ts.map +1 -0
- package/build/services/previews/download.service.js +66 -0
- package/build/services/previews/download.service.js.map +1 -0
- package/build/services/previews/local-previews.service.d.ts +25 -0
- package/build/services/previews/local-previews.service.d.ts.map +1 -0
- package/build/services/previews/local-previews.service.js +50 -0
- package/build/services/previews/local-previews.service.js.map +1 -0
- package/build/services/previews/reload.service.d.ts +6 -0
- package/build/services/previews/reload.service.d.ts.map +1 -0
- package/build/services/previews/reload.service.js +13 -0
- package/build/services/previews/reload.service.js.map +1 -0
- package/build/services/previews/remote.service.d.ts +11 -0
- package/build/services/previews/remote.service.d.ts.map +1 -0
- package/build/services/previews/remote.service.js +34 -0
- package/build/services/previews/remote.service.js.map +1 -0
- package/build/services/previews/select.service.d.ts +11 -0
- package/build/services/previews/select.service.d.ts.map +1 -0
- package/build/services/previews/select.service.js +25 -0
- package/build/services/previews/select.service.js.map +1 -0
- package/build/services/previews/use-preview.service.d.ts +21 -0
- package/build/services/previews/use-preview.service.d.ts.map +1 -0
- package/build/services/previews/use-preview.service.js +24 -0
- package/build/services/previews/use-preview.service.js.map +1 -0
- package/build/services/previews/use-running.service.d.ts +4 -0
- package/build/services/previews/use-running.service.d.ts.map +1 -0
- package/build/services/previews/use-running.service.js +21 -0
- package/build/services/previews/use-running.service.js.map +1 -0
- package/build/services/publish/bundle.service.d.ts +11 -0
- package/build/services/publish/bundle.service.d.ts.map +1 -0
- package/build/services/publish/bundle.service.js +46 -0
- package/build/services/publish/bundle.service.js.map +1 -0
- package/build/services/publish/commands.service.d.ts +23 -0
- package/build/services/publish/commands.service.d.ts.map +1 -0
- package/build/services/publish/commands.service.js +130 -0
- package/build/services/publish/commands.service.js.map +1 -0
- package/build/services/publish/eas-env.service.d.ts +9 -0
- package/build/services/publish/eas-env.service.d.ts.map +1 -0
- package/build/services/publish/eas-env.service.js +49 -0
- package/build/services/publish/eas-env.service.js.map +1 -0
- package/build/services/registry/registry.service.d.ts +27 -0
- package/build/services/registry/registry.service.d.ts.map +1 -0
- package/build/services/registry/registry.service.js +89 -0
- package/build/services/registry/registry.service.js.map +1 -0
- package/build/services/s3/s3.service.d.ts +59 -0
- package/build/services/s3/s3.service.d.ts.map +1 -0
- package/build/services/s3/s3.service.js +154 -0
- package/build/services/s3/s3.service.js.map +1 -0
- package/build/services/start/start.service.d.ts +48 -0
- package/build/services/start/start.service.d.ts.map +1 -0
- package/build/services/start/start.service.js +172 -0
- package/build/services/start/start.service.js.map +1 -0
- package/build/stores/dev-preview-servers/dev-preview-servers.store.d.ts +21 -0
- package/build/stores/dev-preview-servers/dev-preview-servers.store.d.ts.map +1 -0
- package/build/stores/dev-preview-servers/dev-preview-servers.store.js +91 -0
- package/build/stores/dev-preview-servers/dev-preview-servers.store.js.map +1 -0
- package/build/stores/previews/previews.store.d.ts +36 -0
- package/build/stores/previews/previews.store.d.ts.map +1 -0
- package/build/stores/previews/previews.store.js +134 -0
- package/build/stores/previews/previews.store.js.map +1 -0
- package/build/utils/config/config.util.d.ts +39 -0
- package/build/utils/config/config.util.d.ts.map +1 -0
- package/build/utils/config/config.util.js +24 -0
- package/build/utils/config/config.util.js.map +1 -0
- package/build/utils/config/expo-config.util.d.ts +30 -0
- package/build/utils/config/expo-config.util.d.ts.map +1 -0
- package/build/utils/config/expo-config.util.js +43 -0
- package/build/utils/config/expo-config.util.js.map +1 -0
- package/build/utils/dev-preview-servers/merge-servers.util.d.ts +47 -0
- package/build/utils/dev-preview-servers/merge-servers.util.d.ts.map +1 -0
- package/build/utils/dev-preview-servers/merge-servers.util.js +37 -0
- package/build/utils/dev-preview-servers/merge-servers.util.js.map +1 -0
- package/build/utils/preview-list/theme.util.d.ts +5 -0
- package/build/utils/preview-list/theme.util.d.ts.map +1 -0
- package/build/utils/preview-list/theme.util.js +12 -0
- package/build/utils/preview-list/theme.util.js.map +1 -0
- package/build/utils/previews/layout.util.d.ts +89 -0
- package/build/utils/previews/layout.util.d.ts.map +1 -0
- package/build/utils/previews/layout.util.js +30 -0
- package/build/utils/previews/layout.util.js.map +1 -0
- package/build/utils/previews/preview-items.util.d.ts +23 -0
- package/build/utils/previews/preview-items.util.d.ts.map +1 -0
- package/build/utils/previews/preview-items.util.js +39 -0
- package/build/utils/previews/preview-items.util.js.map +1 -0
- package/build/utils/previews/preview-title.util.d.ts +2 -0
- package/build/utils/previews/preview-title.util.d.ts.map +1 -0
- package/build/utils/previews/preview-title.util.js +6 -0
- package/build/utils/previews/preview-title.util.js.map +1 -0
- package/build/utils/previews/running.util.d.ts +23 -0
- package/build/utils/previews/running.util.d.ts.map +1 -0
- package/build/utils/previews/running.util.js +23 -0
- package/build/utils/previews/running.util.js.map +1 -0
- package/build/utils/publish/changelog.util.d.ts +5 -0
- package/build/utils/publish/changelog.util.d.ts.map +1 -0
- package/build/utils/publish/changelog.util.js +19 -0
- package/build/utils/publish/changelog.util.js.map +1 -0
- package/build/utils/publish/indexes.util.d.ts +12 -0
- package/build/utils/publish/indexes.util.d.ts.map +1 -0
- package/build/utils/publish/indexes.util.js +52 -0
- package/build/utils/publish/indexes.util.js.map +1 -0
- package/build/utils/s3/sigv4.util.d.ts +24 -0
- package/build/utils/s3/sigv4.util.d.ts.map +1 -0
- package/build/utils/s3/sigv4.util.js +67 -0
- package/build/utils/s3/sigv4.util.js.map +1 -0
- package/expo-module.config.json +10 -0
- package/ios/AxonpackPreview.podspec +30 -0
- package/ios/AxonpackPreviewModule.swift +55 -0
- package/ios/PreviewReactDelegateHandler.swift +147 -0
- package/ios/PreviewState.swift +236 -0
- package/notes/README.md +36 -0
- package/notes/bundles.md +35 -0
- package/notes/dev-preview-servers.md +67 -0
- package/notes/distribution.md +138 -0
- package/notes/native-loader.md +56 -0
- package/notes/storage.md +145 -0
- package/notes/testing.md +97 -0
- package/package.json +107 -4
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { PreviewStatus } from "../../utils/previews/preview-items.util";
|
|
2
|
+
export type PreviewListFonts = {
|
|
3
|
+
/** Font family names, as registered in your app. Each falls back to the system font. */
|
|
4
|
+
regular?: string;
|
|
5
|
+
medium?: string;
|
|
6
|
+
bold?: string;
|
|
7
|
+
};
|
|
8
|
+
export type PreviewListTheme = {
|
|
9
|
+
/** "auto" follows the device appearance. Default "auto". */
|
|
10
|
+
mode: "auto" | "light" | "dark";
|
|
11
|
+
background: string;
|
|
12
|
+
card: string;
|
|
13
|
+
/** Behind the changelog and the progress track. */
|
|
14
|
+
surface: string;
|
|
15
|
+
border: string;
|
|
16
|
+
title: string;
|
|
17
|
+
text: string;
|
|
18
|
+
/** Quiet text: branch, author, date, size. */
|
|
19
|
+
muted: string;
|
|
20
|
+
primary: string;
|
|
21
|
+
primaryText: string;
|
|
22
|
+
danger: string;
|
|
23
|
+
warning: string;
|
|
24
|
+
success: string;
|
|
25
|
+
/** Card corner radius. Buttons scale from it. Default 14. */
|
|
26
|
+
radius: number;
|
|
27
|
+
fonts: PreviewListFonts;
|
|
28
|
+
};
|
|
29
|
+
export type PreviewListLabels = {
|
|
30
|
+
title: string;
|
|
31
|
+
/** What is running now. */
|
|
32
|
+
running: string;
|
|
33
|
+
base: string;
|
|
34
|
+
backToBase: string;
|
|
35
|
+
/** Shown in a debug build while a preview runs, since Metro is not used then. */
|
|
36
|
+
metroBypassed: string;
|
|
37
|
+
refresh: string;
|
|
38
|
+
empty: string;
|
|
39
|
+
noBuildKey: string;
|
|
40
|
+
download: string;
|
|
41
|
+
switchTo: string;
|
|
42
|
+
update: string;
|
|
43
|
+
delete: string;
|
|
44
|
+
status: Record<PreviewStatus, string>;
|
|
45
|
+
incompatibleTitle: string;
|
|
46
|
+
incompatibleHint: string;
|
|
47
|
+
deleteAll: string;
|
|
48
|
+
devPreviewServersTitle: string;
|
|
49
|
+
devPreviewServersHint: string;
|
|
50
|
+
noDevPreviewServers: string;
|
|
51
|
+
/** In place of the servers, when the build has no slug baked in by the config plugin. */
|
|
52
|
+
noBuildSlug: string;
|
|
53
|
+
stopDevPreviewServer: string;
|
|
54
|
+
/** After the title in the header line, for a dev preview server. */
|
|
55
|
+
localSuffix: string;
|
|
56
|
+
localIncompatible: string;
|
|
57
|
+
localUnknownBuild: string;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=preview-list.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-list.types.d.ts","sourceRoot":"","sources":["../../../src/components/preview-list/preview-list.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yFAAyF;IACzF,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-list.types.js","sourceRoot":"","sources":["../../../src/components/preview-list/preview-list.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PreviewStatus } from \"../../utils/previews/preview-items.util\";\n\nexport type PreviewListFonts = {\n /** Font family names, as registered in your app. Each falls back to the system font. */\n regular?: string;\n medium?: string;\n bold?: string;\n};\n\nexport type PreviewListTheme = {\n /** \"auto\" follows the device appearance. Default \"auto\". */\n mode: \"auto\" | \"light\" | \"dark\";\n background: string;\n card: string;\n /** Behind the changelog and the progress track. */\n surface: string;\n border: string;\n title: string;\n text: string;\n /** Quiet text: branch, author, date, size. */\n muted: string;\n primary: string;\n primaryText: string;\n danger: string;\n warning: string;\n success: string;\n /** Card corner radius. Buttons scale from it. Default 14. */\n radius: number;\n fonts: PreviewListFonts;\n};\n\nexport type PreviewListLabels = {\n title: string;\n /** What is running now. */\n running: string;\n base: string;\n backToBase: string;\n /** Shown in a debug build while a preview runs, since Metro is not used then. */\n metroBypassed: string;\n refresh: string;\n empty: string;\n noBuildKey: string;\n download: string;\n switchTo: string;\n update: string;\n delete: string;\n status: Record<PreviewStatus, string>;\n incompatibleTitle: string;\n incompatibleHint: string;\n deleteAll: string;\n devPreviewServersTitle: string;\n devPreviewServersHint: string;\n noDevPreviewServers: string;\n /** In place of the servers, when the build has no slug baked in by the config plugin. */\n noBuildSlug: string;\n stopDevPreviewServer: string;\n /** After the title in the header line, for a dev preview server. */\n localSuffix: string;\n localIncompatible: string;\n localUnknownBuild: string;\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { PreviewConfig } from "../../utils/config/config.util";
|
|
3
|
+
export declare const ConfigContext: import("react").Context<PreviewConfig | null>;
|
|
4
|
+
/**
|
|
5
|
+
* Put it near the root. Once mounted it tells the native side this start worked (the crash
|
|
6
|
+
* fallback waits for that), and with `enabled` it reads the downloads and the bucket's list.
|
|
7
|
+
*/
|
|
8
|
+
export declare function PreviewProvider(props: {
|
|
9
|
+
config: PreviewConfig;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}): import("react").FunctionComponentElement<import("react").ProviderProps<PreviewConfig | null>>;
|
|
12
|
+
//# sourceMappingURL=preview-provider.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-provider.component.d.ts","sourceRoot":"","sources":["../../../src/components/preview-provider/preview-provider.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAIpE,eAAO,MAAM,aAAa,+CAA4C,CAAC;AAEvE;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,iGASA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createContext, createElement as h, useEffect, } from "react";
|
|
2
|
+
import { markLaunched } from "../../services/native/native.service";
|
|
3
|
+
import { previewsStore } from "../../stores/previews/previews.store";
|
|
4
|
+
export const ConfigContext = createContext(null);
|
|
5
|
+
/**
|
|
6
|
+
* Put it near the root. Once mounted it tells the native side this start worked (the crash
|
|
7
|
+
* fallback waits for that), and with `enabled` it reads the downloads and the bucket's list.
|
|
8
|
+
*/
|
|
9
|
+
export function PreviewProvider(props) {
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
markLaunched();
|
|
12
|
+
}, []);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (props.config.enabled)
|
|
15
|
+
previewsStore.refresh(props.config).catch(() => undefined);
|
|
16
|
+
}, [props.config]);
|
|
17
|
+
return h(ConfigContext.Provider, { value: props.config }, props.children);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=preview-provider.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-provider.component.js","sourceRoot":"","sources":["../../../src/components/preview-provider/preview-provider.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,aAAa,IAAI,CAAC,EAClB,SAAS,GAEV,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAG/B;IACC,SAAS,CAAC,GAAG,EAAE;QACb,YAAY,EAAE,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO;YACtB,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["import {\n createContext,\n createElement as h,\n useEffect,\n type ReactNode,\n} from \"react\";\n\nimport type { PreviewConfig } from \"../../utils/config/config.util\";\nimport { markLaunched } from \"../../services/native/native.service\";\nimport { previewsStore } from \"../../stores/previews/previews.store\";\n\nexport const ConfigContext = createContext<PreviewConfig | null>(null);\n\n/**\n * Put it near the root. Once mounted it tells the native side this start worked (the crash\n * fallback waits for that), and with `enabled` it reads the downloads and the bucket's list.\n */\nexport function PreviewProvider(props: {\n config: PreviewConfig;\n children?: ReactNode;\n}) {\n useEffect(() => {\n markLaunched();\n }, []);\n useEffect(() => {\n if (props.config.enabled)\n previewsStore.refresh(props.config).catch(() => undefined);\n }, [props.config]);\n return h(ConfigContext.Provider, { value: props.config }, props.children);\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Compatibility, Platform } from "../../utils/previews/layout.util";
|
|
2
|
+
/** Where the registry listens on the developer's computer. */
|
|
3
|
+
export declare const DEFAULT_REGISTRY_PORT = 19150;
|
|
4
|
+
/** Ports `preview start` picks from, and the app probes for plain `expo start` servers. */
|
|
5
|
+
export declare const DEFAULT_PORT_RANGE: [number, number];
|
|
6
|
+
/** A heartbeat is sent this often, and a server missing for TTL is dropped. */
|
|
7
|
+
export declare const HEARTBEAT_MS = 5000;
|
|
8
|
+
export declare const SERVER_TTL_MS = 15000;
|
|
9
|
+
/** What `preview start` tells the registry about the Metro it runs. */
|
|
10
|
+
export type RegisteredServer = {
|
|
11
|
+
/** Unique per run, so a restarted server on the same port is a new entry. */
|
|
12
|
+
id: string;
|
|
13
|
+
port: number;
|
|
14
|
+
title: string;
|
|
15
|
+
branch: string;
|
|
16
|
+
worktree: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
name: string;
|
|
19
|
+
iosBundleIdentifier?: string;
|
|
20
|
+
androidPackage?: string;
|
|
21
|
+
compatibility: Compatibility;
|
|
22
|
+
/** The build key per platform, as `publish` would make it. */
|
|
23
|
+
keys: Partial<Record<Platform, string>>;
|
|
24
|
+
startedAt: string;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=dev-preview-servers.const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-preview-servers.const.d.ts","sourceRoot":"","sources":["../../../src/constants/dev-preview-servers/dev-preview-servers.const.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAEhF,8DAA8D;AAC9D,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAE3C,2FAA2F;AAC3F,eAAO,MAAM,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAgB,CAAC;AAEjE,+EAA+E;AAC/E,eAAO,MAAM,YAAY,OAAO,CAAC;AACjC,eAAO,MAAM,aAAa,QAAQ,CAAC;AAEnC,uEAAuE;AACvE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,aAAa,CAAC;IAC7B,8DAA8D;IAC9D,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Shapes and defaults shared by `preview start`, its registry and the app.
|
|
2
|
+
/** Where the registry listens on the developer's computer. */
|
|
3
|
+
export const DEFAULT_REGISTRY_PORT = 19150;
|
|
4
|
+
/** Ports `preview start` picks from, and the app probes for plain `expo start` servers. */
|
|
5
|
+
export const DEFAULT_PORT_RANGE = [8081, 8099];
|
|
6
|
+
/** A heartbeat is sent this often, and a server missing for TTL is dropped. */
|
|
7
|
+
export const HEARTBEAT_MS = 5000;
|
|
8
|
+
export const SERVER_TTL_MS = 15000;
|
|
9
|
+
//# sourceMappingURL=dev-preview-servers.const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-preview-servers.const.js","sourceRoot":"","sources":["../../../src/constants/dev-preview-servers/dev-preview-servers.const.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAI3E,8DAA8D;AAC9D,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE3C,2FAA2F;AAC3F,MAAM,CAAC,MAAM,kBAAkB,GAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAEjE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AACjC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC","sourcesContent":["// Shapes and defaults shared by `preview start`, its registry and the app.\n\nimport type { Compatibility, Platform } from \"../../utils/previews/layout.util\";\n\n/** Where the registry listens on the developer's computer. */\nexport const DEFAULT_REGISTRY_PORT = 19150;\n\n/** Ports `preview start` picks from, and the app probes for plain `expo start` servers. */\nexport const DEFAULT_PORT_RANGE: [number, number] = [8081, 8099];\n\n/** A heartbeat is sent this often, and a server missing for TTL is dropped. */\nexport const HEARTBEAT_MS = 5000;\nexport const SERVER_TTL_MS = 15000;\n\n/** What `preview start` tells the registry about the Metro it runs. */\nexport type RegisteredServer = {\n /** Unique per run, so a restarted server on the same port is a new entry. */\n id: string;\n port: number;\n title: string;\n branch: string;\n worktree: string;\n slug: string;\n name: string;\n iosBundleIdentifier?: string;\n androidPackage?: string;\n compatibility: Compatibility;\n /** The build key per platform, as `publish` would make it. */\n keys: Partial<Record<Platform, string>>;\n startedAt: string;\n};\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PreviewListLabels, PreviewListTheme } from "../../components/preview-list/preview-list.types";
|
|
2
|
+
export declare const LIGHT_THEME: PreviewListTheme;
|
|
3
|
+
export declare const DARK_THEME: PreviewListTheme;
|
|
4
|
+
export declare const DEFAULT_LABELS: PreviewListLabels;
|
|
5
|
+
//# sourceMappingURL=theme.const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.const.d.ts","sourceRoot":"","sources":["../../../src/constants/preview-list/theme.const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,kDAAkD,CAAC;AAE1D,eAAO,MAAM,WAAW,EAAE,gBAgBzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,gBAaxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,iBAsC5B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export const LIGHT_THEME = {
|
|
2
|
+
mode: "auto",
|
|
3
|
+
background: "#f4f6fa",
|
|
4
|
+
card: "#ffffff",
|
|
5
|
+
surface: "#eef1f6",
|
|
6
|
+
border: "#e4e8f0",
|
|
7
|
+
title: "#0f172a",
|
|
8
|
+
text: "#334155",
|
|
9
|
+
muted: "#64748b",
|
|
10
|
+
primary: "#2563eb",
|
|
11
|
+
primaryText: "#ffffff",
|
|
12
|
+
danger: "#dc2626",
|
|
13
|
+
warning: "#d97706",
|
|
14
|
+
success: "#16a34a",
|
|
15
|
+
radius: 14,
|
|
16
|
+
fonts: {},
|
|
17
|
+
};
|
|
18
|
+
export const DARK_THEME = {
|
|
19
|
+
...LIGHT_THEME,
|
|
20
|
+
background: "#12151f",
|
|
21
|
+
card: "#1c2130",
|
|
22
|
+
surface: "#262c3d",
|
|
23
|
+
border: "#323a4f",
|
|
24
|
+
title: "#f8fafc",
|
|
25
|
+
text: "#cbd5e1",
|
|
26
|
+
muted: "#94a3b8",
|
|
27
|
+
primary: "#5b8def",
|
|
28
|
+
danger: "#f87171",
|
|
29
|
+
warning: "#fbbf24",
|
|
30
|
+
success: "#4ade80",
|
|
31
|
+
};
|
|
32
|
+
export const DEFAULT_LABELS = {
|
|
33
|
+
title: "Previews",
|
|
34
|
+
running: "Running",
|
|
35
|
+
base: "Embedded bundle",
|
|
36
|
+
backToBase: "Back to base",
|
|
37
|
+
metroBypassed: "Debug build: Metro is not used while a preview runs. Go back to base to load from Metro again.",
|
|
38
|
+
refresh: "Refresh",
|
|
39
|
+
empty: "No previews published for this build yet.",
|
|
40
|
+
noBuildKey: "This build has no compatibility key, so it cannot list previews. Add the config plugin and rebuild.",
|
|
41
|
+
download: "Download",
|
|
42
|
+
switchTo: "Switch",
|
|
43
|
+
update: "Update",
|
|
44
|
+
delete: "Delete",
|
|
45
|
+
status: {
|
|
46
|
+
available: "Not downloaded",
|
|
47
|
+
downloading: "Downloading",
|
|
48
|
+
downloaded: "Downloaded",
|
|
49
|
+
"update-available": "Update available",
|
|
50
|
+
unpublished: "Unpublished",
|
|
51
|
+
broken: "Broken: it stopped while starting",
|
|
52
|
+
},
|
|
53
|
+
incompatibleTitle: "Incompatible",
|
|
54
|
+
incompatibleHint: "Made for another native build. They can't run on this one.",
|
|
55
|
+
deleteAll: "Delete all",
|
|
56
|
+
devPreviewServersTitle: "Dev preview servers",
|
|
57
|
+
devPreviewServersHint: "Metro servers for this app on your computer. Debug builds only.",
|
|
58
|
+
noDevPreviewServers: "No Metro server found. Start one with npx preview start.",
|
|
59
|
+
noBuildSlug: "This build has no app slug, so it cannot tell its servers from other apps'. Add the config plugin and rebuild.",
|
|
60
|
+
stopDevPreviewServer: "Stop using dev preview server",
|
|
61
|
+
localSuffix: "local",
|
|
62
|
+
localIncompatible: "Made for another native build",
|
|
63
|
+
localUnknownBuild: "Native build unknown",
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=theme.const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.const.js","sourceRoot":"","sources":["../../../src/constants/preview-list/theme.const.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,WAAW,GAAqB;IAC3C,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,SAAS;IACrB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAqB;IAC1C,GAAG,WAAW;IACd,UAAU,EAAE,SAAS;IACrB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,iBAAiB;IACvB,UAAU,EAAE,cAAc;IAC1B,aAAa,EACX,gGAAgG;IAClG,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,2CAA2C;IAClD,UAAU,EACR,qGAAqG;IACvG,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE;QACN,SAAS,EAAE,gBAAgB;QAC3B,WAAW,EAAE,aAAa;QAC1B,UAAU,EAAE,YAAY;QACxB,kBAAkB,EAAE,kBAAkB;QACtC,WAAW,EAAE,aAAa;QAC1B,MAAM,EAAE,mCAAmC;KAC5C;IACD,iBAAiB,EAAE,cAAc;IACjC,gBAAgB,EACd,4DAA4D;IAC9D,SAAS,EAAE,YAAY;IACvB,sBAAsB,EAAE,qBAAqB;IAC7C,qBAAqB,EACnB,iEAAiE;IACnE,mBAAmB,EACjB,0DAA0D;IAC5D,WAAW,EACT,gHAAgH;IAClH,oBAAoB,EAAE,+BAA+B;IACrD,WAAW,EAAE,OAAO;IACpB,iBAAiB,EAAE,+BAA+B;IAClD,iBAAiB,EAAE,sBAAsB;CAC1C,CAAC","sourcesContent":["import type {\n PreviewListLabels,\n PreviewListTheme,\n} from \"../../components/preview-list/preview-list.types\";\n\nexport const LIGHT_THEME: PreviewListTheme = {\n mode: \"auto\",\n background: \"#f4f6fa\",\n card: \"#ffffff\",\n surface: \"#eef1f6\",\n border: \"#e4e8f0\",\n title: \"#0f172a\",\n text: \"#334155\",\n muted: \"#64748b\",\n primary: \"#2563eb\",\n primaryText: \"#ffffff\",\n danger: \"#dc2626\",\n warning: \"#d97706\",\n success: \"#16a34a\",\n radius: 14,\n fonts: {},\n};\n\nexport const DARK_THEME: PreviewListTheme = {\n ...LIGHT_THEME,\n background: \"#12151f\",\n card: \"#1c2130\",\n surface: \"#262c3d\",\n border: \"#323a4f\",\n title: \"#f8fafc\",\n text: \"#cbd5e1\",\n muted: \"#94a3b8\",\n primary: \"#5b8def\",\n danger: \"#f87171\",\n warning: \"#fbbf24\",\n success: \"#4ade80\",\n};\n\nexport const DEFAULT_LABELS: PreviewListLabels = {\n title: \"Previews\",\n running: \"Running\",\n base: \"Embedded bundle\",\n backToBase: \"Back to base\",\n metroBypassed:\n \"Debug build: Metro is not used while a preview runs. Go back to base to load from Metro again.\",\n refresh: \"Refresh\",\n empty: \"No previews published for this build yet.\",\n noBuildKey:\n \"This build has no compatibility key, so it cannot list previews. Add the config plugin and rebuild.\",\n download: \"Download\",\n switchTo: \"Switch\",\n update: \"Update\",\n delete: \"Delete\",\n status: {\n available: \"Not downloaded\",\n downloading: \"Downloading\",\n downloaded: \"Downloaded\",\n \"update-available\": \"Update available\",\n unpublished: \"Unpublished\",\n broken: \"Broken: it stopped while starting\",\n },\n incompatibleTitle: \"Incompatible\",\n incompatibleHint:\n \"Made for another native build. They can't run on this one.\",\n deleteAll: \"Delete all\",\n devPreviewServersTitle: \"Dev preview servers\",\n devPreviewServersHint:\n \"Metro servers for this app on your computer. Debug builds only.\",\n noDevPreviewServers:\n \"No Metro server found. Start one with npx preview start.\",\n noBuildSlug:\n \"This build has no app slug, so it cannot tell its servers from other apps'. Add the config plugin and rebuild.\",\n stopDevPreviewServer: \"Stop using dev preview server\",\n localSuffix: \"local\",\n localIncompatible: \"Made for another native build\",\n localUnknownBuild: \"Native build unknown\",\n};\n"]}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { buildCompatibility, buildKey, buildSlug, } from "./services/native/build-info.service";
|
|
2
|
+
export { previewTitle } from "./utils/previews/preview-title.util";
|
|
3
|
+
export { reload } from "./services/previews/reload.service";
|
|
4
|
+
export { previewBundlePath, selectPreview, } from "./services/previews/select.service";
|
|
5
|
+
export { markLaunched } from "./services/native/native.service";
|
|
6
|
+
export type { PreviewConfig } from "./utils/config/config.util";
|
|
7
|
+
export { previewsStore, usePreviewsState, } from "./stores/previews/previews.store";
|
|
8
|
+
export type { PreviewsState } from "./stores/previews/previews.store";
|
|
9
|
+
export { previewItems } from "./utils/previews/preview-items.util";
|
|
10
|
+
export type { PreviewItem, PreviewStatus, } from "./utils/previews/preview-items.util";
|
|
11
|
+
export { PreviewProvider } from "./components/preview-provider/preview-provider.component";
|
|
12
|
+
export { usePreview } from "./services/previews/use-preview.service";
|
|
13
|
+
export { runningNow } from "./utils/previews/running.util";
|
|
14
|
+
export type { Running } from "./utils/previews/running.util";
|
|
15
|
+
export { useRunning } from "./services/previews/use-running.service";
|
|
16
|
+
export { PreviewList } from "./components/preview-list/preview-list.component";
|
|
17
|
+
export type { PreviewListProps } from "./components/preview-list/preview-list.component";
|
|
18
|
+
export type { PreviewListLabels, PreviewListTheme, PreviewListFonts, } from "./components/preview-list/preview-list.types";
|
|
19
|
+
export { DEFAULT_LABELS, DARK_THEME, LIGHT_THEME, } from "./constants/preview-list/theme.const";
|
|
20
|
+
export { resolveTheme } from "./utils/preview-list/theme.util";
|
|
21
|
+
export { devPreviewServersStore, useDevPreviewServersState, } from "./stores/dev-preview-servers/dev-preview-servers.store";
|
|
22
|
+
export type { DevPreviewServersState } from "./stores/dev-preview-servers/dev-preview-servers.store";
|
|
23
|
+
export type { DevPreviewServer } from "./utils/dev-preview-servers/merge-servers.util";
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,SAAS,GACV,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,aAAa,GACd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACL,aAAa,EACb,gBAAgB,GACjB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,YAAY,EACV,WAAW,EACX,aAAa,GACd,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,YAAY,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAC/E,YAAY,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACzF,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,cAAc,EACd,UAAU,EACV,WAAW,GACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,wDAAwD,CAAC;AAChE,YAAY,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AACrG,YAAY,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { buildCompatibility, buildKey, buildSlug, } from "./services/native/build-info.service";
|
|
2
|
+
export { previewTitle } from "./utils/previews/preview-title.util";
|
|
3
|
+
export { reload } from "./services/previews/reload.service";
|
|
4
|
+
export { previewBundlePath, selectPreview, } from "./services/previews/select.service";
|
|
5
|
+
export { markLaunched } from "./services/native/native.service";
|
|
6
|
+
export { previewsStore, usePreviewsState, } from "./stores/previews/previews.store";
|
|
7
|
+
export { previewItems } from "./utils/previews/preview-items.util";
|
|
8
|
+
export { PreviewProvider } from "./components/preview-provider/preview-provider.component";
|
|
9
|
+
export { usePreview } from "./services/previews/use-preview.service";
|
|
10
|
+
export { runningNow } from "./utils/previews/running.util";
|
|
11
|
+
export { useRunning } from "./services/previews/use-running.service";
|
|
12
|
+
export { PreviewList } from "./components/preview-list/preview-list.component";
|
|
13
|
+
export { DEFAULT_LABELS, DARK_THEME, LIGHT_THEME, } from "./constants/preview-list/theme.const";
|
|
14
|
+
export { resolveTheme } from "./utils/preview-list/theme.util";
|
|
15
|
+
export { devPreviewServersStore, useDevPreviewServersState, } from "./stores/dev-preview-servers/dev-preview-servers.store";
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,SAAS,GACV,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,aAAa,GACd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,EACL,aAAa,EACb,gBAAgB,GACjB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAKnE,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAO/E,OAAO,EACL,cAAc,EACd,UAAU,EACV,WAAW,GACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,wDAAwD,CAAC","sourcesContent":["export {\n buildCompatibility,\n buildKey,\n buildSlug,\n} from \"./services/native/build-info.service\";\nexport { previewTitle } from \"./utils/previews/preview-title.util\";\nexport { reload } from \"./services/previews/reload.service\";\nexport {\n previewBundlePath,\n selectPreview,\n} from \"./services/previews/select.service\";\nexport { markLaunched } from \"./services/native/native.service\";\nexport type { PreviewConfig } from \"./utils/config/config.util\";\nexport {\n previewsStore,\n usePreviewsState,\n} from \"./stores/previews/previews.store\";\nexport type { PreviewsState } from \"./stores/previews/previews.store\";\nexport { previewItems } from \"./utils/previews/preview-items.util\";\nexport type {\n PreviewItem,\n PreviewStatus,\n} from \"./utils/previews/preview-items.util\";\nexport { PreviewProvider } from \"./components/preview-provider/preview-provider.component\";\nexport { usePreview } from \"./services/previews/use-preview.service\";\nexport { runningNow } from \"./utils/previews/running.util\";\nexport type { Running } from \"./utils/previews/running.util\";\nexport { useRunning } from \"./services/previews/use-running.service\";\nexport { PreviewList } from \"./components/preview-list/preview-list.component\";\nexport type { PreviewListProps } from \"./components/preview-list/preview-list.component\";\nexport type {\n PreviewListLabels,\n PreviewListTheme,\n PreviewListFonts,\n} from \"./components/preview-list/preview-list.types\";\nexport {\n DEFAULT_LABELS,\n DARK_THEME,\n LIGHT_THEME,\n} from \"./constants/preview-list/theme.const\";\nexport { resolveTheme } from \"./utils/preview-list/theme.util\";\nexport {\n devPreviewServersStore,\n useDevPreviewServersState,\n} from \"./stores/dev-preview-servers/dev-preview-servers.store\";\nexport type { DevPreviewServersState } from \"./stores/dev-preview-servers/dev-preview-servers.store\";\nexport type { DevPreviewServer } from \"./utils/dev-preview-servers/merge-servers.util\";\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { S3Config } from "../s3/s3.service";
|
|
2
|
+
export declare const ENV: {
|
|
3
|
+
readonly url: "PREVIEW_S3_URL";
|
|
4
|
+
readonly accessKeyId: "PREVIEW_S3_ACCESS_KEY_ID";
|
|
5
|
+
readonly secretAccessKey: "PREVIEW_S3_SECRET_ACCESS_KEY";
|
|
6
|
+
readonly region: "PREVIEW_S3_REGION";
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Reads where to publish and the write key from the environment, then the env files Expo loads
|
|
10
|
+
* for a release build. The environment wins, so CI needs no file. Nothing else is read.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readConfig(projectRoot: string, env?: Record<string, string | undefined>): S3Config;
|
|
13
|
+
//# sourceMappingURL=config.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.service.d.ts","sourceRoot":"","sources":["../../../src/services/cli/config.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,QAAQ,EAAkB,MAAM,kBAAkB,CAAC;AAG5E,eAAO,MAAM,GAAG;;;;;CAKN,CAAC;AAiBX;;;GAGG;AACH,wBAAgB,UAAU,CACxB,WAAW,EAAE,MAAM,EACnB,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,QAAQ,CAkBV"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { DEFAULT_REGION, parseBucketUrl } from "../s3/s3.service";
|
|
3
|
+
import { appRequire } from "./project.service";
|
|
4
|
+
export const ENV = {
|
|
5
|
+
url: "PREVIEW_S3_URL",
|
|
6
|
+
accessKeyId: "PREVIEW_S3_ACCESS_KEY_ID",
|
|
7
|
+
secretAccessKey: "PREVIEW_S3_SECRET_ACCESS_KEY",
|
|
8
|
+
region: "PREVIEW_S3_REGION",
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The `.env*` files the release bundle sees, read by the app's own `@expo/env`.
|
|
12
|
+
* `export:embed --dev false` loads them in mode `production`, so this picks the same files, in the
|
|
13
|
+
* same order, with the same expansion. `EXPO_NO_DOTENV` turns them off here too.
|
|
14
|
+
*/
|
|
15
|
+
const expoEnvFiles = (projectRoot, env) => appRequire(projectRoot)("@expo/env").parseProjectEnv(projectRoot, {
|
|
16
|
+
mode: "production",
|
|
17
|
+
silent: true,
|
|
18
|
+
systemEnv: env,
|
|
19
|
+
}).env;
|
|
20
|
+
/**
|
|
21
|
+
* Reads where to publish and the write key from the environment, then the env files Expo loads
|
|
22
|
+
* for a release build. The environment wins, so CI needs no file. Nothing else is read.
|
|
23
|
+
*/
|
|
24
|
+
export function readConfig(projectRoot, env = process.env) {
|
|
25
|
+
env = { ...expoEnvFiles(projectRoot, env), ...env };
|
|
26
|
+
const missing = [ENV.url, ENV.accessKeyId, ENV.secretAccessKey].filter((name) => !env[name]);
|
|
27
|
+
if (missing.length > 0) {
|
|
28
|
+
throw new Error(`Set ${missing.join(", ")} in the environment (CI secrets), or locally in ${join(projectRoot, ".env.local")}. Any env file Expo loads for a release build works, but keep the write key out of a committed .env.`);
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
...parseBucketUrl(env[ENV.url]),
|
|
32
|
+
region: env[ENV.region] || DEFAULT_REGION,
|
|
33
|
+
credentials: {
|
|
34
|
+
accessKeyId: env[ENV.accessKeyId],
|
|
35
|
+
secretAccessKey: env[ENV.secretAccessKey],
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=config.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.service.js","sourceRoot":"","sources":["../../../src/services/cli/config.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAY,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,GAAG,EAAE,gBAAgB;IACrB,WAAW,EAAE,0BAA0B;IACvC,eAAe,EAAE,8BAA8B;IAC/C,MAAM,EAAE,mBAAmB;CACnB,CAAC;AAEX;;;;GAIG;AACH,MAAM,YAAY,GAAG,CACnB,WAAmB,EACnB,GAAuC,EACf,EAAE,CAC1B,UAAU,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,eAAe,CAAC,WAAW,EAAE;IAChE,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,GAAG;CACf,CAAC,CAAC,GAAG,CAAC;AAET;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,WAAmB,EACnB,MAA0C,OAAO,CAAC,GAAG;IAErD,GAAG,GAAG,EAAE,GAAG,YAAY,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC;IACpD,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,MAAM,CACpE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CACrB,CAAC;IACF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,mDAAmD,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,sGAAsG,CAClN,CAAC;IACJ,CAAC;IACD,OAAO;QACL,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;QAChC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,cAAc;QACzC,WAAW,EAAE;YACX,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,WAAW,CAAE;YAClC,eAAe,EAAE,GAAG,CAAC,GAAG,CAAC,eAAe,CAAE;SAC3C;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { join } from \"node:path\";\n\nimport { DEFAULT_REGION, S3Config, parseBucketUrl } from \"../s3/s3.service\";\nimport { appRequire } from \"./project.service\";\n\nexport const ENV = {\n url: \"PREVIEW_S3_URL\",\n accessKeyId: \"PREVIEW_S3_ACCESS_KEY_ID\",\n secretAccessKey: \"PREVIEW_S3_SECRET_ACCESS_KEY\",\n region: \"PREVIEW_S3_REGION\",\n} as const;\n\n/**\n * The `.env*` files the release bundle sees, read by the app's own `@expo/env`.\n * `export:embed --dev false` loads them in mode `production`, so this picks the same files, in the\n * same order, with the same expansion. `EXPO_NO_DOTENV` turns them off here too.\n */\nconst expoEnvFiles = (\n projectRoot: string,\n env: Record<string, string | undefined>,\n): Record<string, string> =>\n appRequire(projectRoot)(\"@expo/env\").parseProjectEnv(projectRoot, {\n mode: \"production\",\n silent: true,\n systemEnv: env,\n }).env;\n\n/**\n * Reads where to publish and the write key from the environment, then the env files Expo loads\n * for a release build. The environment wins, so CI needs no file. Nothing else is read.\n */\nexport function readConfig(\n projectRoot: string,\n env: Record<string, string | undefined> = process.env,\n): S3Config {\n env = { ...expoEnvFiles(projectRoot, env), ...env };\n const missing = [ENV.url, ENV.accessKeyId, ENV.secretAccessKey].filter(\n (name) => !env[name],\n );\n if (missing.length > 0) {\n throw new Error(\n `Set ${missing.join(\", \")} in the environment (CI secrets), or locally in ${join(projectRoot, \".env.local\")}. Any env file Expo loads for a release build works, but keep the write key out of a committed .env.`,\n );\n }\n return {\n ...parseBucketUrl(env[ENV.url]!),\n region: env[ENV.region] || DEFAULT_REGION,\n credentials: {\n accessKeyId: env[ENV.accessKeyId]!,\n secretAccessKey: env[ENV.secretAccessKey]!,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Platform } from "../../utils/previews/layout.util";
|
|
2
|
+
import type { AppConfig } from "../../utils/config/expo-config.util";
|
|
3
|
+
export declare const appRequire: (projectRoot: string) => NodeJS.Require;
|
|
4
|
+
/** The app's Expo config, as the build sees it. */
|
|
5
|
+
export declare function appConfig(projectRoot: string): AppConfig;
|
|
6
|
+
export declare function fingerprint(projectRoot: string, platform: Platform): Promise<string>;
|
|
7
|
+
/**
|
|
8
|
+
* A CI checkout of a pull request is a detached HEAD, where git names no branch ("HEAD"). GitHub
|
|
9
|
+
* gives the branch in GITHUB_HEAD_REF; without it, the preview id stands in, else nothing.
|
|
10
|
+
*/
|
|
11
|
+
export declare function gitInfo(projectRoot: string, { id, env, }?: {
|
|
12
|
+
id?: string;
|
|
13
|
+
env?: Record<string, string | undefined>;
|
|
14
|
+
}): {
|
|
15
|
+
branch: string;
|
|
16
|
+
commit: string;
|
|
17
|
+
author: string;
|
|
18
|
+
};
|
|
19
|
+
/** The git worktree the project is in, so a list can say which checkout a server runs from. */
|
|
20
|
+
export declare const gitTopLevel: (projectRoot: string) => string | null;
|
|
21
|
+
/** The repo's default branch: what origin/HEAD points at, else main or master if one exists. */
|
|
22
|
+
export declare function defaultBase(projectRoot: string): string | null;
|
|
23
|
+
/** The commit subjects on this branch since it left the base branch. Empty when there are none. */
|
|
24
|
+
export declare function changelogSince(projectRoot: string, base: string | null): string;
|
|
25
|
+
//# sourceMappingURL=project.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.service.d.ts","sourceRoot":"","sources":["../../../src/services/cli/project.service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAgBrE,eAAO,MAAM,UAAU,GAAI,aAAa,MAAM,mBAK7C,CAAC;AAEF,mDAAmD;AACnD,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAGxD;AAED,wBAAsB,WAAW,CAC/B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED;;;GAGG;AACH,wBAAgB,OAAO,CACrB,WAAW,EAAE,MAAM,EACnB,EACE,EAAE,EACF,GAAiB,GAClB,GAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CAAO;;;;EAWlE;AAED,+FAA+F;AAC/F,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,KAAG,MAAM,GAAG,IACP,CAAC;AAErD,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAY9D;AAED,mGAAmG;AACnG,wBAAgB,cAAc,CAC5B,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GAAG,IAAI,GAClB,MAAM,CAUR"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { changelogFromSubjects } from "../../utils/publish/changelog.util";
|
|
5
|
+
const git = (cwd, args) => {
|
|
6
|
+
try {
|
|
7
|
+
return execFileSync("git", args, {
|
|
8
|
+
cwd,
|
|
9
|
+
encoding: "utf8",
|
|
10
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
11
|
+
}).trim();
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
// The copies the app's own `expo` uses, so the fingerprint and version match what its native build
|
|
18
|
+
// used. They are dependencies of `expo`, not of the app, so they are resolved from there.
|
|
19
|
+
export const appRequire = (projectRoot) => {
|
|
20
|
+
const expo = createRequire(join(projectRoot, "package.json")).resolve("expo/package.json");
|
|
21
|
+
return createRequire(expo);
|
|
22
|
+
};
|
|
23
|
+
/** The app's Expo config, as the build sees it. */
|
|
24
|
+
export function appConfig(projectRoot) {
|
|
25
|
+
const { getConfig } = appRequire(projectRoot)("@expo/config");
|
|
26
|
+
return getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;
|
|
27
|
+
}
|
|
28
|
+
export async function fingerprint(projectRoot, platform) {
|
|
29
|
+
const { createFingerprintAsync } = appRequire(projectRoot)("@expo/fingerprint");
|
|
30
|
+
const result = await createFingerprintAsync(projectRoot, {
|
|
31
|
+
platforms: [platform],
|
|
32
|
+
silent: true,
|
|
33
|
+
});
|
|
34
|
+
return result.hash;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A CI checkout of a pull request is a detached HEAD, where git names no branch ("HEAD"). GitHub
|
|
38
|
+
* gives the branch in GITHUB_HEAD_REF; without it, the preview id stands in, else nothing.
|
|
39
|
+
*/
|
|
40
|
+
export function gitInfo(projectRoot, { id, env = process.env, } = {}) {
|
|
41
|
+
const ref = git(projectRoot, ["rev-parse", "--abbrev-ref", "HEAD"]) ?? "";
|
|
42
|
+
return {
|
|
43
|
+
branch: ref === "HEAD" ? env.GITHUB_HEAD_REF || id || "" : ref,
|
|
44
|
+
commit: git(projectRoot, ["rev-parse", "--short", "HEAD"]) ?? "",
|
|
45
|
+
author: git(projectRoot, ["log", "-1", "--format=%an"]) ??
|
|
46
|
+
git(projectRoot, ["config", "user.name"]) ??
|
|
47
|
+
"",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** The git worktree the project is in, so a list can say which checkout a server runs from. */
|
|
51
|
+
export const gitTopLevel = (projectRoot) => git(projectRoot, ["rev-parse", "--show-toplevel"]);
|
|
52
|
+
/** The repo's default branch: what origin/HEAD points at, else main or master if one exists. */
|
|
53
|
+
export function defaultBase(projectRoot) {
|
|
54
|
+
const head = git(projectRoot, [
|
|
55
|
+
"symbolic-ref",
|
|
56
|
+
"--short",
|
|
57
|
+
"refs/remotes/origin/HEAD",
|
|
58
|
+
]);
|
|
59
|
+
if (head)
|
|
60
|
+
return head;
|
|
61
|
+
for (const name of ["main", "master"]) {
|
|
62
|
+
if (git(projectRoot, ["rev-parse", "--verify", "--quiet", name]) !== null)
|
|
63
|
+
return name;
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
/** The commit subjects on this branch since it left the base branch. Empty when there are none. */
|
|
68
|
+
export function changelogSince(projectRoot, base) {
|
|
69
|
+
if (!base)
|
|
70
|
+
return "";
|
|
71
|
+
const forkPoint = git(projectRoot, ["merge-base", "HEAD", base]);
|
|
72
|
+
if (!forkPoint)
|
|
73
|
+
return "";
|
|
74
|
+
const subjects = git(projectRoot, [
|
|
75
|
+
"log",
|
|
76
|
+
"--format=%s",
|
|
77
|
+
`${forkPoint}..HEAD`,
|
|
78
|
+
]);
|
|
79
|
+
return changelogFromSubjects(subjects ? subjects.split("\n") : []);
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=project.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.service.js","sourceRoot":"","sources":["../../../src/services/cli/project.service.ts"],"names":[],"mappings":"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","sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport { createRequire } from \"node:module\";\nimport { join } from \"node:path\";\n\nimport type { Platform } from \"../../utils/previews/layout.util\";\nimport { changelogFromSubjects } from \"../../utils/publish/changelog.util\";\nimport type { AppConfig } from \"../../utils/config/expo-config.util\";\n\nconst git = (cwd: string, args: string[]): string | null => {\n try {\n return execFileSync(\"git\", args, {\n cwd,\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n }).trim();\n } catch {\n return null;\n }\n};\n\n// The copies the app's own `expo` uses, so the fingerprint and version match what its native build\n// used. They are dependencies of `expo`, not of the app, so they are resolved from there.\nexport const appRequire = (projectRoot: string) => {\n const expo = createRequire(join(projectRoot, \"package.json\")).resolve(\n \"expo/package.json\",\n );\n return createRequire(expo);\n};\n\n/** The app's Expo config, as the build sees it. */\nexport function appConfig(projectRoot: string): AppConfig {\n const { getConfig } = appRequire(projectRoot)(\"@expo/config\");\n return getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n}\n\nexport async function fingerprint(\n projectRoot: string,\n platform: Platform,\n): Promise<string> {\n const { createFingerprintAsync } =\n appRequire(projectRoot)(\"@expo/fingerprint\");\n const result = await createFingerprintAsync(projectRoot, {\n platforms: [platform],\n silent: true,\n });\n return result.hash as string;\n}\n\n/**\n * A CI checkout of a pull request is a detached HEAD, where git names no branch (\"HEAD\"). GitHub\n * gives the branch in GITHUB_HEAD_REF; without it, the preview id stands in, else nothing.\n */\nexport function gitInfo(\n projectRoot: string,\n {\n id,\n env = process.env,\n }: { id?: string; env?: Record<string, string | undefined> } = {},\n) {\n const ref = git(projectRoot, [\"rev-parse\", \"--abbrev-ref\", \"HEAD\"]) ?? \"\";\n return {\n branch: ref === \"HEAD\" ? env.GITHUB_HEAD_REF || id || \"\" : ref,\n commit: git(projectRoot, [\"rev-parse\", \"--short\", \"HEAD\"]) ?? \"\",\n author:\n git(projectRoot, [\"log\", \"-1\", \"--format=%an\"]) ??\n git(projectRoot, [\"config\", \"user.name\"]) ??\n \"\",\n };\n}\n\n/** The git worktree the project is in, so a list can say which checkout a server runs from. */\nexport const gitTopLevel = (projectRoot: string): string | null =>\n git(projectRoot, [\"rev-parse\", \"--show-toplevel\"]);\n\n/** The repo's default branch: what origin/HEAD points at, else main or master if one exists. */\nexport function defaultBase(projectRoot: string): string | null {\n const head = git(projectRoot, [\n \"symbolic-ref\",\n \"--short\",\n \"refs/remotes/origin/HEAD\",\n ]);\n if (head) return head;\n for (const name of [\"main\", \"master\"]) {\n if (git(projectRoot, [\"rev-parse\", \"--verify\", \"--quiet\", name]) !== null)\n return name;\n }\n return null;\n}\n\n/** The commit subjects on this branch since it left the base branch. Empty when there are none. */\nexport function changelogSince(\n projectRoot: string,\n base: string | null,\n): string {\n if (!base) return \"\";\n const forkPoint = git(projectRoot, [\"merge-base\", \"HEAD\", base]);\n if (!forkPoint) return \"\";\n const subjects = git(projectRoot, [\n \"log\",\n \"--format=%s\",\n `${forkPoint}..HEAD`,\n ]);\n return changelogFromSubjects(subjects ? subjects.split(\"\\n\") : []);\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The name the app's list shows. `--title` wins; otherwise a terminal gets an editable prompt
|
|
3
|
+
* prefilled with the default, and CI or an AI agent (no TTY) gets the default with no prompt.
|
|
4
|
+
*/
|
|
5
|
+
export declare function askTitle(options: {
|
|
6
|
+
given?: string;
|
|
7
|
+
fallback: string;
|
|
8
|
+
input?: NodeJS.ReadableStream & {
|
|
9
|
+
isTTY?: boolean;
|
|
10
|
+
};
|
|
11
|
+
output?: NodeJS.WritableStream & {
|
|
12
|
+
isTTY?: boolean;
|
|
13
|
+
};
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
//# sourceMappingURL=title.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.service.d.ts","sourceRoot":"","sources":["../../../src/services/cli/title.service.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC,cAAc,GAAG;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,GAAG;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACtD,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBlB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createInterface } from "node:readline";
|
|
2
|
+
/**
|
|
3
|
+
* The name the app's list shows. `--title` wins; otherwise a terminal gets an editable prompt
|
|
4
|
+
* prefilled with the default, and CI or an AI agent (no TTY) gets the default with no prompt.
|
|
5
|
+
*/
|
|
6
|
+
export async function askTitle(options) {
|
|
7
|
+
const input = options.input ?? process.stdin;
|
|
8
|
+
const output = options.output ?? process.stdout;
|
|
9
|
+
if (options.given)
|
|
10
|
+
return options.given;
|
|
11
|
+
if (!input.isTTY || !output.isTTY)
|
|
12
|
+
return options.fallback;
|
|
13
|
+
const rl = createInterface({ input, output });
|
|
14
|
+
try {
|
|
15
|
+
const answer = new Promise((resolve) => rl.question("Name in the app: ", resolve));
|
|
16
|
+
// Written after the question so it lands in the line being edited, where Enter accepts it.
|
|
17
|
+
rl.write(options.fallback);
|
|
18
|
+
return (await answer).trim() || options.fallback;
|
|
19
|
+
}
|
|
20
|
+
finally {
|
|
21
|
+
rl.close();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=title.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.service.js","sourceRoot":"","sources":["../../../src/services/cli/title.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAK9B;IACC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAChD,IAAI,OAAO,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC,KAAK,CAAC;IACxC,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC,QAAQ,CAAC;IAC3D,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE,CAC7C,EAAE,CAAC,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAC1C,CAAC;QACF,2FAA2F;QAC3F,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3B,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,OAAO,CAAC,QAAQ,CAAC;IACnD,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC","sourcesContent":["import { createInterface } from \"node:readline\";\n\n/**\n * The name the app's list shows. `--title` wins; otherwise a terminal gets an editable prompt\n * prefilled with the default, and CI or an AI agent (no TTY) gets the default with no prompt.\n */\nexport async function askTitle(options: {\n given?: string;\n fallback: string;\n input?: NodeJS.ReadableStream & { isTTY?: boolean };\n output?: NodeJS.WritableStream & { isTTY?: boolean };\n}): Promise<string> {\n const input = options.input ?? process.stdin;\n const output = options.output ?? process.stdout;\n if (options.given) return options.given;\n if (!input.isTTY || !output.isTTY) return options.fallback;\n const rl = createInterface({ input, output });\n try {\n const answer = new Promise<string>((resolve) =>\n rl.question(\"Name in the app: \", resolve),\n );\n // Written after the question so it lands in the line being edited, where Enter accepts it.\n rl.write(options.fallback);\n return (await answer).trim() || options.fallback;\n } finally {\n rl.close();\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Platform } from "../../utils/previews/layout.util";
|
|
2
|
+
import { type RegisteredServer } from "../../constants/dev-preview-servers/dev-preview-servers.const";
|
|
3
|
+
import type { ScannedServer } from "../../utils/dev-preview-servers/merge-servers.util";
|
|
4
|
+
/**
|
|
5
|
+
* Where to look. On Android, 10.0.2.2 is the computer as the emulator sees it, so plain servers
|
|
6
|
+
* are found there without an `adb reverse` per port.
|
|
7
|
+
*/
|
|
8
|
+
export declare function candidateHosts(): string[];
|
|
9
|
+
/** One look: every Metro in the range on the candidate hosts, plus the registry. */
|
|
10
|
+
export declare function discover(platform: Platform): Promise<{
|
|
11
|
+
registry: RegisteredServer[];
|
|
12
|
+
scanned: ScannedServer[];
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=discover.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.service.d.ts","sourceRoot":"","sources":["../../../src/services/dev-preview-servers/discover.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,+DAA+D,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC;AA6ExF;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAIzC;AAOD,oFAAoF;AACpF,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC;IAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAAC,OAAO,EAAE,aAAa,EAAE,CAAA;CAAE,CAAC,CAkCrE"}
|