@lowdefy/shell 0.0.0-experimental-20261019052246
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/LICENSE +201 -0
- package/README.md +308 -0
- package/app/(t0,t1,t2,t3,t4)/[...path].js +38 -0
- package/app/(t0,t1,t2,t3,t4)/_layout.js +48 -0
- package/app/(t0,t1,t2,t3,t4)/index.js +38 -0
- package/app/+native-intent.js +30 -0
- package/app/_layout.js +33 -0
- package/app.config.ts +168 -0
- package/applyShellPlugins.js +43 -0
- package/authCallbackIntentFilters.js +46 -0
- package/babel.config.js +25 -0
- package/checkShellConfig.js +145 -0
- package/checkShellPlugins.js +74 -0
- package/getPrivacyManifest.js +39 -0
- package/metro.config.js +73 -0
- package/native-fingerprint.json +12 -0
- package/package.json +130 -0
- package/profiles.js +274 -0
- package/readShellConfig.js +36 -0
- package/resolveShellPlugins.js +109 -0
- package/runtimeVersion.js +105 -0
- package/scripts/checkReleaseBundle.mjs +358 -0
- package/scripts/createDayjsLocales.mjs +67 -0
- package/scripts/createShellAssets.mjs +54 -0
- package/scripts/createShellVersion.mjs +83 -0
- package/scripts/createTypeManifest.mjs +205 -0
- package/shell.dev.json +11 -0
- package/shellVariant.js +111 -0
- package/src/ShellContext.js +32 -0
- package/src/actions/CopyToClipboard.js +29 -0
- package/src/actions/CopyToClipboard.test.js +33 -0
- package/src/actions/GeolocationCurrentPosition.js +55 -0
- package/src/actions/GeolocationCurrentPosition.test.js +66 -0
- package/src/actions/GetLocalStorage.js +36 -0
- package/src/actions/RemoveLocalStorage.js +31 -0
- package/src/actions/ScrollTo.js +66 -0
- package/src/actions/ScrollTo.test.js +83 -0
- package/src/actions/SetFocus.js +33 -0
- package/src/actions/SetFocus.test.js +49 -0
- package/src/actions/SetLocalStorage.js +34 -0
- package/src/actions/localStorage.test.js +68 -0
- package/src/actions/measureInScrollView.js +36 -0
- package/src/actions/nativeActions.js +41 -0
- package/src/auth/AuthButton.js +44 -0
- package/src/auth/AuthGate.js +57 -0
- package/src/auth/AuthLink.js +43 -0
- package/src/auth/LockScreen.js +67 -0
- package/src/auth/LockScreen.test.js +37 -0
- package/src/auth/SignInScreen.js +256 -0
- package/src/auth/SignInScreen.test.js +182 -0
- package/src/auth/createAppAuth.js +306 -0
- package/src/auth/createAppAuth.test.js +414 -0
- package/src/auth/createAuthApi.js +99 -0
- package/src/auth/createAuthApi.test.js +135 -0
- package/src/auth/createCoreAuth.js +96 -0
- package/src/auth/createCoreAuth.test.js +188 -0
- package/src/auth/createSessionStores.js +45 -0
- package/src/auth/createTokenStore.js +103 -0
- package/src/auth/createTokenStore.test.js +116 -0
- package/src/auth/getAuthSettings.js +24 -0
- package/src/auth/getAuthView.js +39 -0
- package/src/auth/getAuthView.test.js +52 -0
- package/src/auth/getSheetReturnUrl.js +35 -0
- package/src/auth/getTokenStoreOptions.js +46 -0
- package/src/auth/isBackgroundShell.js +26 -0
- package/src/auth/isSheetReturnLink.js +35 -0
- package/src/auth/parseQuery.js +39 -0
- package/src/auth/purgeAppData.js +45 -0
- package/src/auth/shouldLock.js +26 -0
- package/src/auth/signInWithSheet.js +97 -0
- package/src/auth/signInWithSheet.test.js +205 -0
- package/src/auth/styles.js +78 -0
- package/src/auth/unregisterPushToken.js +21 -0
- package/src/auth/usesBiometricUnlock.js +23 -0
- package/src/auth/watchSession.js +47 -0
- package/src/auth/withoutCookies.js +26 -0
- package/src/cache/createSqliteCacheStore.js +113 -0
- package/src/cache/createSqliteCacheStore.test.js +93 -0
- package/src/cache/getCacheKey.js +25 -0
- package/src/cache/getLastCacheKeyName.js +22 -0
- package/src/components/AppProvider.js +90 -0
- package/src/components/Frame.js +116 -0
- package/src/components/Frame.test.js +101 -0
- package/src/components/LoadingScreen.js +35 -0
- package/src/components/MenuButton.js +108 -0
- package/src/components/MenuButton.test.js +51 -0
- package/src/components/MessageScreen.js +51 -0
- package/src/components/NavigationTheme.js +33 -0
- package/src/components/NoConnectionBanner.js +51 -0
- package/src/components/NoConnectionBanner.test.js +73 -0
- package/src/components/OtherPageScreen.js +56 -0
- package/src/components/PageScreen.js +244 -0
- package/src/components/PageScreen.test.js +492 -0
- package/src/components/ShellRoot.js +34 -0
- package/src/components/ShellRoot.test.js +62 -0
- package/src/components/ShellThemeProvider.js +45 -0
- package/src/components/SwitchToTab.js +36 -0
- package/src/components/SwitchToTab.test.js +63 -0
- package/src/components/TabIconImages.js +72 -0
- package/src/components/UpdateScreen.js +36 -0
- package/src/components/getNavigationTheme.js +44 -0
- package/src/components/getNavigationTheme.test.js +41 -0
- package/src/components/styles.js +50 -0
- package/src/components/useSurfaceTokens.js +47 -0
- package/src/config/getAppApiBase.js +31 -0
- package/src/config/getShellConfig.js +35 -0
- package/src/config/getShellConfig.test.js +80 -0
- package/src/createShellApp.js +105 -0
- package/src/dev/DevShell.js +228 -0
- package/src/dev/DevShell.test.js +233 -0
- package/src/dev/connect/ConfirmSheet.js +71 -0
- package/src/dev/connect/ConnectScreen.js +117 -0
- package/src/dev/connect/QrScanner.js +89 -0
- package/src/dev/connection/createDevShellConfig.js +47 -0
- package/src/dev/connection/createDevTransport.js +51 -0
- package/src/dev/connection/createDevTransport.test.js +87 -0
- package/src/dev/connection/createServerList.js +48 -0
- package/src/dev/connection/isLoopbackHost.js +25 -0
- package/src/dev/connection/pairedShellApp.test.js +104 -0
- package/src/dev/connection/parseDevLink.js +66 -0
- package/src/dev/connection/parseDevLink.test.js +97 -0
- package/src/dev/connection/parseQuery.js +33 -0
- package/src/dev/connection/parseServerInput.js +40 -0
- package/src/dev/connection/parseServerUrl.js +45 -0
- package/src/dev/devStyles.js +97 -0
- package/src/dev/index.js +21 -0
- package/src/dev/inject/createDeviceInjections.js +185 -0
- package/src/dev/inject/createDeviceInjections.test.js +208 -0
- package/src/dev/inject/createOfflineFetch.js +35 -0
- package/src/dev/inject/createOfflineFetch.test.js +68 -0
- package/src/dev/menu/BlockGallery.js +33 -0
- package/src/dev/menu/DevMenu.js +121 -0
- package/src/dev/menu/createLogBuffer.js +83 -0
- package/src/dev/menu/watchShake.js +52 -0
- package/src/dev/menu/watchShake.test.js +61 -0
- package/src/dev/recorder/createNativeRecorder.js +204 -0
- package/src/dev/recorder/createNativeRecorder.test.js +307 -0
- package/src/dev/redirectDevLink.js +30 -0
- package/src/dev/redirectDevLink.test.js +49 -0
- package/src/dev/steps/createStepRunner.js +184 -0
- package/src/dev/steps/createStepRunner.test.js +262 -0
- package/src/dev/steps/findBlock.js +78 -0
- package/src/dev/steps/isContextSettled.js +37 -0
- package/src/dev/steps/waitForSettle.js +39 -0
- package/src/dev/steps/waitUntil.js +40 -0
- package/src/dev/tab/DevTabClient.js +97 -0
- package/src/dev/tab/answerEval.js +39 -0
- package/src/dev/tab/answerInspect.js +45 -0
- package/src/dev/tab/answerLoadState.js +50 -0
- package/src/dev/tab/createDevTabClient.js +277 -0
- package/src/dev/tab/createDevTabClient.test.js +314 -0
- package/src/dev/tab/devClientMarker.js +22 -0
- package/src/dev/tab/devClientMarker.test.js +23 -0
- package/src/dev/tab/findPageContext.js +43 -0
- package/src/dev/tab/getShownPage.js +42 -0
- package/src/dev/tab/readEventStream.js +68 -0
- package/src/dev/tab/reloadApp.js +42 -0
- package/src/dev/tab/reloadApp.test.js +115 -0
- package/src/device/injected.js +60 -0
- package/src/device/injected.test.js +39 -0
- package/src/host/createDeviceStore.js +32 -0
- package/src/host/createMemoryStore.js +32 -0
- package/src/host/createNetworkStatus.js +94 -0
- package/src/host/createNetworkStatus.test.js +94 -0
- package/src/host/createRouterAdapter.js +33 -0
- package/src/host/createShellFetch.js +60 -0
- package/src/host/createShellFetch.test.js +150 -0
- package/src/host/createShellGlobals.js +62 -0
- package/src/host/createShellHost.js +73 -0
- package/src/host/createShellHost.test.js +36 -0
- package/src/host/getOrigin.js +26 -0
- package/src/host/isOnline.js +22 -0
- package/src/host/networkStatus.js +24 -0
- package/src/host/withShellHeader.js +25 -0
- package/src/host/withShellHeader.test.js +28 -0
- package/src/js/evaluateJsEntries.js +43 -0
- package/src/js/evaluateJsEntries.test.js +48 -0
- package/src/locale/createShellLocale.js +112 -0
- package/src/locale/createShellLocale.test.js +74 -0
- package/src/locale/dayjsLocales.js +165 -0
- package/src/locale/getDeviceLocales.js +23 -0
- package/src/locale/loadDayjsLocale.js +32 -0
- package/src/locale/resolveActiveLocale.js +46 -0
- package/src/locale/resolveActiveLocale.test.js +40 -0
- package/src/navigation/SlotContext.js +24 -0
- package/src/navigation/frameSlots.js +27 -0
- package/src/navigation/getFrame.js +30 -0
- package/src/navigation/getInitialScreenOptions.js +63 -0
- package/src/navigation/getInitialScreenOptions.test.js +66 -0
- package/src/navigation/getPresentation.js +28 -0
- package/src/navigation/getSlotRootPath.js +27 -0
- package/src/navigation/getStackOptions.js +185 -0
- package/src/navigation/getTabHref.js +45 -0
- package/src/navigation/getTabIcons.js +43 -0
- package/src/navigation/isPageUnderHeader.js +46 -0
- package/src/navigation/navigation.test.js +342 -0
- package/src/navigation/toRouterHref.js +29 -0
- package/src/plugins/appTypes.js +28 -0
- package/src/plugins/prefixTypes.js +28 -0
- package/src/plugins/shellPlugins.json +14 -0
- package/src/plugins/typeManifest.js +649 -0
- package/src/plugins/types.js +61 -0
- package/src/plugins/types.test.js +173 -0
- package/src/polyfills/installGetRandomValues.js +28 -0
- package/src/session/createAppSession.js +318 -0
- package/src/session/createAppSession.test.js +359 -0
- package/src/session/getPageView.js +59 -0
- package/src/session/getPageView.test.js +137 -0
- package/src/sync/encodePagePath.js +27 -0
- package/src/sync/fetchPage.js +49 -0
- package/src/sync/fetchRoot.js +38 -0
- package/src/sync/fetchUser.js +28 -0
- package/src/sync/runLimited.js +36 -0
- package/src/sync/toRootConfig.js +35 -0
- package/src/test/createFakeNetwork.js +40 -0
- package/src/test/createFakeSecureStore.js +40 -0
- package/src/test/createFakeServer.js +98 -0
- package/src/test/createMemoryCacheStore.js +59 -0
- package/src/test/expoImage.js +38 -0
- package/src/test/expoSpeechRecognition.js +31 -0
- package/src/test/expoUi.js +55 -0
- package/src/test/expoUiBottomSheet.js +64 -0
- package/src/test/expoUiDateTimePicker.js +26 -0
- package/src/test/expoUiMenu.js +46 -0
- package/src/test/expoUiSegmentedControl.js +47 -0
- package/src/test/expoUiSwiftUi.js +62 -0
- package/src/test/expoUiSwiftUiModifiers.js +23 -0
- package/src/test/expoWebBrowser.js +23 -0
- package/src/test/fixtures.js +98 -0
- package/src/test/renderPageScreen.js +109 -0
- package/src/types/checkTypeSet.js +39 -0
- package/src/types/collectPageTypes.js +49 -0
- package/src/types/collectPageTypes.test.js +90 -0
- package/src/types/findMissingPageTypes.js +40 -0
- package/src/version/compareVersions.js +38 -0
- package/src/version/isShellTooOld.js +30 -0
- package/src/version/shellVersion.js +21 -0
- package/src/version/shellVersion.test.js +32 -0
- package/withExcludedNativeModules.js +93 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { Pressable, Text, View } from 'react-native';
|
|
19
|
+
|
|
20
|
+
// Stand-ins for the @expo/ui SwiftUI views the blocks use, which need native modules Jest does not
|
|
21
|
+
// have. ContextMenu draws its trigger, and its items as pressable buttons with the props the
|
|
22
|
+
// block passes, so a test can press an item.
|
|
23
|
+
|
|
24
|
+
function Host({ children, colorScheme, testID }) {
|
|
25
|
+
return (
|
|
26
|
+
<View colorScheme={colorScheme} testID={testID}>
|
|
27
|
+
{children}
|
|
28
|
+
</View>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function Slot({ children }) {
|
|
33
|
+
return <>{children}</>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function ContextMenu({ children }) {
|
|
37
|
+
return <View testID="expo-ui-context-menu">{children}</View>;
|
|
38
|
+
}
|
|
39
|
+
ContextMenu.Items = function Items({ children }) {
|
|
40
|
+
return <View testID="expo-ui-context-menu-items">{children}</View>;
|
|
41
|
+
};
|
|
42
|
+
ContextMenu.Trigger = Slot;
|
|
43
|
+
ContextMenu.Preview = Slot;
|
|
44
|
+
|
|
45
|
+
function Button({ label, onPress, role, systemImage }) {
|
|
46
|
+
return (
|
|
47
|
+
<Pressable
|
|
48
|
+
onPress={onPress}
|
|
49
|
+
role={role}
|
|
50
|
+
systemImage={systemImage}
|
|
51
|
+
testID={`expo-ui-button-${label}`}
|
|
52
|
+
>
|
|
53
|
+
<Text>{label}</Text>
|
|
54
|
+
</Pressable>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function RNHostView({ children }) {
|
|
59
|
+
return children;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { Button, ContextMenu, Host, RNHostView };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// A stand-in for @expo/ui's SwiftUI modifiers, which reach the ExpoUI native module Jest does not
|
|
18
|
+
// have: each modifier is its name and params, so a test reads what a block asked SwiftUI for.
|
|
19
|
+
function font(params) {
|
|
20
|
+
return { $type: 'font', ...params };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { font };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { jest } from '@jest/globals';
|
|
18
|
+
|
|
19
|
+
// A stand-in for expo-web-browser, whose in-app browser needs a native module Jest does not have.
|
|
20
|
+
// A test reads the addresses a block opened from openBrowserAsync's calls.
|
|
21
|
+
const openBrowserAsync = jest.fn(async () => ({ type: 'dismiss' }));
|
|
22
|
+
|
|
23
|
+
export { openBrowserAsync };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const typeManifest = {
|
|
18
|
+
actions: {
|
|
19
|
+
SetState: { package: '@lowdefy/actions-core', version: 7 },
|
|
20
|
+
},
|
|
21
|
+
blocks: {
|
|
22
|
+
Box: { package: '@lowdefy/blocks-native', version: 7 },
|
|
23
|
+
Screen: { package: '@lowdefy/blocks-native', version: 7 },
|
|
24
|
+
Title: { package: '@lowdefy/blocks-native', version: 7 },
|
|
25
|
+
},
|
|
26
|
+
operators: {
|
|
27
|
+
_state: { package: '@lowdefy/operators-js', version: 7 },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const shell = { version: '7.4.0', typeManifest };
|
|
32
|
+
|
|
33
|
+
const typeSets = {
|
|
34
|
+
carried: {
|
|
35
|
+
actions: [{ type: 'SetState', package: '@lowdefy/actions-core', version: 7 }],
|
|
36
|
+
blocks: [
|
|
37
|
+
{ type: 'Screen', package: '@lowdefy/blocks-native', version: 7 },
|
|
38
|
+
{ type: 'Title', package: '@lowdefy/blocks-native', version: 7 },
|
|
39
|
+
],
|
|
40
|
+
operators: [{ type: '_state', package: '@lowdefy/operators-js', version: 7 }],
|
|
41
|
+
},
|
|
42
|
+
newBlock: {
|
|
43
|
+
actions: [],
|
|
44
|
+
blocks: [
|
|
45
|
+
{ type: 'Screen', package: '@lowdefy/blocks-native', version: 7 },
|
|
46
|
+
{ type: 'Map', package: '@lowdefy/blocks-native', version: 7 },
|
|
47
|
+
],
|
|
48
|
+
operators: [],
|
|
49
|
+
},
|
|
50
|
+
nextMajor: {
|
|
51
|
+
actions: [],
|
|
52
|
+
blocks: [{ type: 'Title', package: '@lowdefy/blocks-native', version: 8 }],
|
|
53
|
+
operators: [],
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
function createPage(pageId, title = pageId) {
|
|
58
|
+
return {
|
|
59
|
+
id: `page:${pageId}`,
|
|
60
|
+
pageId,
|
|
61
|
+
blockId: pageId,
|
|
62
|
+
type: 'Screen',
|
|
63
|
+
properties: { title },
|
|
64
|
+
slots: { content: { blocks: [{ id: `block:${pageId}:t:0`, blockId: 't', type: 'Title' }] } },
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function createRoot({ buildId = 'build-1', minShellVersion = null, pageIndex, ...rest } = {}) {
|
|
69
|
+
return {
|
|
70
|
+
events: {},
|
|
71
|
+
homePageId: 'today',
|
|
72
|
+
lowdefyApp: { slug: 'field', buildId },
|
|
73
|
+
lowdefyGlobal: {},
|
|
74
|
+
menus: {
|
|
75
|
+
tabs: [
|
|
76
|
+
{ pageId: 'today', title: 'Today' },
|
|
77
|
+
{ pageId: 'jobs', title: 'Jobs' },
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
minShellVersion,
|
|
81
|
+
pageIndex: pageIndex ?? [
|
|
82
|
+
{ path: 'today', pageId: 'today', hash: 'h-today-1', typesKey: 'carried' },
|
|
83
|
+
{ path: 'jobs', pageId: 'jobs', hash: 'h-jobs-1', typesKey: 'carried' },
|
|
84
|
+
{ path: 'jobs/{job_id}', pageId: 'job', hash: 'h-job-1', typesKey: 'carried' },
|
|
85
|
+
],
|
|
86
|
+
typeSets,
|
|
87
|
+
theme: { light: {}, dark: {} },
|
|
88
|
+
...rest,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function createPages(paths) {
|
|
93
|
+
return Object.fromEntries(
|
|
94
|
+
paths.map(([path, pageId, etag]) => [path, { pageConfig: createPage(pageId), etag }])
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export { createPage, createPages, createRoot, shell, typeManifest, typeSets };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { jest } from '@jest/globals';
|
|
19
|
+
import { render } from '@testing-library/react-native';
|
|
20
|
+
|
|
21
|
+
import createAppSession from '../session/createAppSession.js';
|
|
22
|
+
import createCoreAuth from '../auth/createCoreAuth.js';
|
|
23
|
+
import createFakeServer from './createFakeServer.js';
|
|
24
|
+
import createMemoryCacheStore from './createMemoryCacheStore.js';
|
|
25
|
+
import createMemoryStore from '../host/createMemoryStore.js';
|
|
26
|
+
import createShellGlobals from '../host/createShellGlobals.js';
|
|
27
|
+
import createShellLocale from '../locale/createShellLocale.js';
|
|
28
|
+
import PageScreen from '../components/PageScreen.js';
|
|
29
|
+
import ShellContext from '../ShellContext.js';
|
|
30
|
+
import ShellThemeProvider from '../components/ShellThemeProvider.js';
|
|
31
|
+
import { shell } from './fixtures.js';
|
|
32
|
+
|
|
33
|
+
const apiBase = 'https://field.example.com';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Renders a PageScreen at `path` as the shell does: one app's session synced with a fake server
|
|
37
|
+
* holding `root` and `pages` ({ [path]: { pageConfig, etag } }), its host with the shell's
|
|
38
|
+
* globals over in-memory stores, its locale, and the shell's theme provider. The test file mocks
|
|
39
|
+
* expo-router.
|
|
40
|
+
*/
|
|
41
|
+
async function renderPageScreen({
|
|
42
|
+
beforeRender = () => undefined,
|
|
43
|
+
deviceLocales = ['en-US'],
|
|
44
|
+
pages,
|
|
45
|
+
path,
|
|
46
|
+
query,
|
|
47
|
+
root,
|
|
48
|
+
}) {
|
|
49
|
+
const server = createFakeServer({ root, rootEtag: '"r1"', pages });
|
|
50
|
+
const session = createAppSession({
|
|
51
|
+
apiBase,
|
|
52
|
+
app: { id: 'field' },
|
|
53
|
+
cacheStore: createMemoryCacheStore(),
|
|
54
|
+
fetch: server.fetch,
|
|
55
|
+
kv: createMemoryStore(),
|
|
56
|
+
tokenStore: { get: () => null },
|
|
57
|
+
});
|
|
58
|
+
await session.start();
|
|
59
|
+
const storage = createMemoryStore();
|
|
60
|
+
const clipboard = { setString: jest.fn(async () => undefined) };
|
|
61
|
+
const globals = createShellGlobals({
|
|
62
|
+
assign: jest.fn(),
|
|
63
|
+
clipboard,
|
|
64
|
+
fetch: server.fetch,
|
|
65
|
+
getInstanceId: session.getCurrentInstanceId,
|
|
66
|
+
getPath: session.getCurrentPath,
|
|
67
|
+
origin: apiBase,
|
|
68
|
+
storage,
|
|
69
|
+
});
|
|
70
|
+
const host = {
|
|
71
|
+
authTransport: 'bearer',
|
|
72
|
+
fetch: server.fetch,
|
|
73
|
+
globals,
|
|
74
|
+
onBuildChanged: jest.fn(),
|
|
75
|
+
onCallerChanged: jest.fn(),
|
|
76
|
+
router: { back: jest.fn(), push: jest.fn(), replace: jest.fn() },
|
|
77
|
+
sessionStorage: createMemoryStore(),
|
|
78
|
+
storage,
|
|
79
|
+
streamFetch: server.fetch,
|
|
80
|
+
tokenStore: { get: () => null, set: jest.fn(), clear: jest.fn() },
|
|
81
|
+
WebSocket: jest.fn(),
|
|
82
|
+
websocketUrl: (apiPath) => apiPath.replace(/^http/, 'ws'),
|
|
83
|
+
};
|
|
84
|
+
const locale = createShellLocale({
|
|
85
|
+
getDeviceLocales: () => deviceLocales,
|
|
86
|
+
globals,
|
|
87
|
+
session,
|
|
88
|
+
storage,
|
|
89
|
+
});
|
|
90
|
+
const auth = {
|
|
91
|
+
coreAuth: createCoreAuth({
|
|
92
|
+
apiBase,
|
|
93
|
+
fetch: server.fetch,
|
|
94
|
+
getSession: () => session,
|
|
95
|
+
tokenStore: host.tokenStore,
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
beforeRender({ session });
|
|
99
|
+
await render(
|
|
100
|
+
<ShellContext.Provider value={{ auth, host, locale, session, shell }}>
|
|
101
|
+
<ShellThemeProvider>
|
|
102
|
+
<PageScreen path={path} query={query} />
|
|
103
|
+
</ShellThemeProvider>
|
|
104
|
+
</ShellContext.Provider>
|
|
105
|
+
);
|
|
106
|
+
return { clipboard, host, locale, server, session, storage };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export default renderPageScreen;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const CATEGORIES = ['actions', 'blocks', 'operators'];
|
|
18
|
+
|
|
19
|
+
// The types of a page's type set (from the mobile root) this shell cannot render: each one the
|
|
20
|
+
// manifest lacks, or carries from another package or another major version of it. A page renders
|
|
21
|
+
// only when this is empty.
|
|
22
|
+
function checkTypeSet({ manifest, typeSet }) {
|
|
23
|
+
const missing = [];
|
|
24
|
+
CATEGORIES.forEach((category) => {
|
|
25
|
+
(typeSet[category] ?? []).forEach((needed) => {
|
|
26
|
+
const carried = manifest[category]?.[needed.type];
|
|
27
|
+
if (
|
|
28
|
+
carried === undefined ||
|
|
29
|
+
carried.package !== needed.package ||
|
|
30
|
+
carried.version !== needed.version
|
|
31
|
+
) {
|
|
32
|
+
missing.push({ category, ...needed });
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
return missing;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default checkTypeSet;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { serializer, type } from '@lowdefy/helpers';
|
|
18
|
+
|
|
19
|
+
function collectEventActions({ events, actions }) {
|
|
20
|
+
Object.values(events ?? {}).forEach((event) => {
|
|
21
|
+
[...(event?.try ?? []), ...(event?.catch ?? [])].forEach((action) => {
|
|
22
|
+
if (type.isString(action?.type)) actions.add(action.type);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function collectBlock({ block, blocks, actions }) {
|
|
28
|
+
if (type.isString(block.type)) blocks.add(block.type);
|
|
29
|
+
collectEventActions({ events: block.events, actions });
|
|
30
|
+
Object.values(block.slots ?? {}).forEach((slot) => {
|
|
31
|
+
(slot.blocks ?? []).forEach((child) => collectBlock({ block: child, blocks, actions }));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// The block and action types a page uses, read from its config. The dev server builds pages on
|
|
36
|
+
// demand and sends no type set, so a dev shell checks a page's types when the page arrives, by
|
|
37
|
+
// name only: a dev shell runs the same Lowdefy version as the dev server. Page config arrives
|
|
38
|
+
// serialized (arrays as `{ '~arr': [...] }`), so it is deserialized before it is walked.
|
|
39
|
+
function collectPageTypes(pageConfig) {
|
|
40
|
+
const blocks = new Set();
|
|
41
|
+
const actions = new Set();
|
|
42
|
+
collectBlock({ block: serializer.deserialize(pageConfig), blocks, actions });
|
|
43
|
+
return {
|
|
44
|
+
blocks: [...blocks].sort(),
|
|
45
|
+
actions: [...actions].sort(),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default collectPageTypes;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import collectPageTypes from './collectPageTypes.js';
|
|
18
|
+
|
|
19
|
+
const page = {
|
|
20
|
+
id: 'page:today',
|
|
21
|
+
type: 'Screen',
|
|
22
|
+
slots: {
|
|
23
|
+
content: {
|
|
24
|
+
blocks: [
|
|
25
|
+
{
|
|
26
|
+
id: 'block:today:tap:0',
|
|
27
|
+
type: 'Button',
|
|
28
|
+
events: {
|
|
29
|
+
onClick: {
|
|
30
|
+
try: [{ id: 'go', type: 'Link', params: 'detail' }],
|
|
31
|
+
catch: [{ id: 'failed', type: 'SetState', params: {} }],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'block:today:box:0',
|
|
37
|
+
type: 'Box',
|
|
38
|
+
slots: { content: { blocks: [{ id: 'block:today:text:0', type: 'Paragraph' }] } },
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const expected = {
|
|
46
|
+
blocks: ['Box', 'Button', 'Paragraph', 'Screen'],
|
|
47
|
+
actions: ['Link', 'SetState'],
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
test('collectPageTypes reads the block and action types of a page', () => {
|
|
51
|
+
expect(collectPageTypes(page)).toEqual(expected);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// The dev server sends page config serialized: an array that carries a config key comes as
|
|
55
|
+
// { '~arr': [...], '~k': key }.
|
|
56
|
+
test('collectPageTypes reads a serialized page as the dev server sends it', () => {
|
|
57
|
+
const serialized = {
|
|
58
|
+
id: 'page:today',
|
|
59
|
+
type: 'Screen',
|
|
60
|
+
slots: {
|
|
61
|
+
content: {
|
|
62
|
+
blocks: {
|
|
63
|
+
'~arr': [
|
|
64
|
+
{
|
|
65
|
+
id: 'block:today:tap:0',
|
|
66
|
+
type: 'Button',
|
|
67
|
+
events: {
|
|
68
|
+
onClick: {
|
|
69
|
+
try: { '~arr': [{ id: 'go', type: 'Link', params: 'detail' }], '~k': 'k2' },
|
|
70
|
+
catch: { '~arr': [{ id: 'failed', type: 'SetState', params: {} }], '~k': 'k3' },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'block:today:box:0',
|
|
76
|
+
type: 'Box',
|
|
77
|
+
slots: {
|
|
78
|
+
content: {
|
|
79
|
+
blocks: { '~arr': [{ id: 'block:today:text:0', type: 'Paragraph' }], '~k': 'k4' },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
'~k': 'k1',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
expect(collectPageTypes(serialized)).toEqual(expected);
|
|
90
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import checkTypeSet from './checkTypeSet.js';
|
|
18
|
+
import collectPageTypes from './collectPageTypes.js';
|
|
19
|
+
|
|
20
|
+
// The types a page needs that this shell lacks. A production root lists the page's type set under
|
|
21
|
+
// its typesKey; a dev root lists none, so the page's own config is read when it has arrived.
|
|
22
|
+
function findMissingPageTypes({ entry, manifest, page, root }) {
|
|
23
|
+
if (entry.typesKey !== undefined) {
|
|
24
|
+
return checkTypeSet({ manifest, typeSet: root.typeSets[entry.typesKey] ?? {} });
|
|
25
|
+
}
|
|
26
|
+
if (page === undefined) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
const used = collectPageTypes(page.pageConfig);
|
|
30
|
+
return [
|
|
31
|
+
...used.blocks
|
|
32
|
+
.filter((name) => manifest.blocks[name] === undefined)
|
|
33
|
+
.map((name) => ({ category: 'blocks', type: name })),
|
|
34
|
+
...used.actions
|
|
35
|
+
.filter((name) => manifest.actions[name] === undefined)
|
|
36
|
+
.map((name) => ({ category: 'actions', type: name })),
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default findMissingPageTypes;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
function parseVersion(version) {
|
|
18
|
+
const [major = 0, minor = 0, patch = 0] = String(version)
|
|
19
|
+
.split('-')[0]
|
|
20
|
+
.split('.')
|
|
21
|
+
.map((part) => Number.parseInt(part, 10) || 0);
|
|
22
|
+
return [major, minor, patch];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Compares two release versions ("7.4.0") by major, minor and patch: below 0 when a is older than
|
|
26
|
+
// b, 0 when they match, above 0 when a is newer. A prerelease suffix is ignored.
|
|
27
|
+
function compareVersions(a, b) {
|
|
28
|
+
const partsA = parseVersion(a);
|
|
29
|
+
const partsB = parseVersion(b);
|
|
30
|
+
for (let i = 0; i < 3; i += 1) {
|
|
31
|
+
if (partsA[i] !== partsB[i]) {
|
|
32
|
+
return partsA[i] - partsB[i];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default compareVersions;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { type } from '@lowdefy/helpers';
|
|
18
|
+
|
|
19
|
+
import compareVersions from './compareVersions.js';
|
|
20
|
+
|
|
21
|
+
// mobile.minShellVersion blocks every page of an app on a shell older than it: it is for security
|
|
22
|
+
// fixes a server cannot work around.
|
|
23
|
+
function isShellTooOld({ minShellVersion, shellVersion }) {
|
|
24
|
+
if (type.isNone(minShellVersion)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return compareVersions(shellVersion, minShellVersion) < 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default isShellTooOld;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Generated by scripts/createShellVersion.mjs from package.json. Do not edit.
|
|
18
|
+
|
|
19
|
+
const shellVersion = '0.0.0-experimental-20261019052246';
|
|
20
|
+
|
|
21
|
+
export default shellVersion;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { execFileSync } from 'child_process';
|
|
18
|
+
import path from 'path';
|
|
19
|
+
|
|
20
|
+
import shellPackage from '../../package.json';
|
|
21
|
+
import shellVersion from './shellVersion.js';
|
|
22
|
+
|
|
23
|
+
// The committed version the bundle carries must be the package's: run
|
|
24
|
+
// `pnpm --filter=@lowdefy/shell shell-version` after changing it. `pnpm release:version` does.
|
|
25
|
+
test('src/version/shellVersion.js matches the @lowdefy/shell package version', () => {
|
|
26
|
+
expect(shellVersion).toBe(shellPackage.version);
|
|
27
|
+
expect(
|
|
28
|
+
execFileSync(process.execPath, [path.join(__dirname, '../../scripts/createShellVersion.mjs')], {
|
|
29
|
+
encoding: 'utf8',
|
|
30
|
+
})
|
|
31
|
+
).toBe(shellVersion);
|
|
32
|
+
});
|