runcloud 0.2.158 → 0.2.160

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.
@@ -0,0 +1,27 @@
1
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { extractSnapshot } from './archive.js';
4
+ export async function scaffoldBackend(client, dir) {
5
+ const template = await client.getBinary('/newly_backend/backend_template');
6
+ await extractSnapshot(template, dir);
7
+ excludeBackendFromAppTypecheck(dir);
8
+ }
9
+ const EXPO_BASE_EXCLUDE = ['node_modules', 'babel.config.js', 'metro.config.js', 'jest.config.js', 'android', 'ios'];
10
+ function excludeBackendFromAppTypecheck(dir) {
11
+ const path = join(dir, 'tsconfig.json');
12
+ if (!existsSync(path))
13
+ return;
14
+ let config;
15
+ try {
16
+ config = JSON.parse(readFileSync(path, 'utf8'));
17
+ }
18
+ catch {
19
+ console.log('Add "backend" to "exclude" in tsconfig.json so the app typecheck skips the backend.');
20
+ return;
21
+ }
22
+ const exclude = Array.isArray(config.exclude) ? config.exclude : EXPO_BASE_EXCLUDE;
23
+ if (exclude.includes('backend'))
24
+ return;
25
+ config.exclude = [...exclude, 'backend'];
26
+ writeFileSync(path, `${JSON.stringify(config, null, 2)}\n`);
27
+ }
@@ -2,7 +2,7 @@ import { existsSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { ApiClient, ApiError, friendlyApiError } from '../api.js';
4
4
  import { requireCredentials, writeProjectLink } from '../config.js';
5
- import { extractSnapshot } from '../archive.js';
5
+ import { scaffoldBackend } from '../backendTemplate.js';
6
6
  function assertNotManagedSession() {
7
7
  const managedSessionProjectId = process.env['NEWLY_PROJECT_ID'];
8
8
  if (!managedSessionProjectId)
@@ -25,8 +25,7 @@ export async function runCreate(client, dir, opts) {
25
25
  pulledAt: new Date().toISOString(),
26
26
  });
27
27
  try {
28
- const tar = await client.getBinary('/newly_backend/backend_template');
29
- await extractSnapshot(tar, dir);
28
+ await scaffoldBackend(client, dir);
30
29
  }
31
30
  catch (e) {
32
31
  const msg = e instanceof Error ? e.message : String(e);
@@ -1,14 +1,13 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { ApiClient, friendlyApiError } from '../api.js';
4
- import { extractSnapshot } from '../archive.js';
4
+ import { scaffoldBackend } from '../backendTemplate.js';
5
5
  import { requireCredentials, resolveProject } from '../config.js';
6
6
  export async function runInit(client, dir, projectId) {
7
7
  if (existsSync(join(dir, 'backend'))) {
8
8
  throw new Error('A `backend/` directory already exists here. Use `newly deploy --env dev` to deploy it.');
9
9
  }
10
- const template = await client.getBinary('/newly_backend/backend_template');
11
- await extractSnapshot(template, dir);
10
+ await scaffoldBackend(client, dir);
12
11
  console.log(`Initialized Newly Backend for project ${projectId}. ` +
13
12
  'Run `newly deploy --env dev` to provision the project database and deploy the services.');
14
13
  }
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = '0.2.158';
1
+ export const CLI_VERSION = '0.2.160';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcloud",
3
- "version": "0.2.158",
3
+ "version": "0.2.160",
4
4
  "description": "Create and control run.cloud remote mobile simulators and cloud sandboxes",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
Binary file
@@ -6,7 +6,7 @@ description: Operate run.cloud iOS simulator and Android emulator sessions with
6
6
  # Operate run.cloud Mobile Sessions
7
7
 
8
8
  Use the `runcloud` CLI for terminal workflows, `@run-cloud/sdk` for TypeScript,
9
- and `@runcloud/ui` for React embeds.
9
+ and `@run-cloud/ui` for React embeds.
10
10
 
11
11
  ## Authenticate
12
12
 
@@ -195,7 +195,7 @@ unavailable, report that requirement instead of guessing a public URL.
195
195
 
196
196
  ## Embed a Session
197
197
 
198
- - Use `RemoteControl` from `@runcloud/ui` with the signed session URL.
198
+ - Use `RemoteControl` from `@run-cloud/ui` with the signed session URL.
199
199
  - Its ref exposes promise-based `interact` and convenience methods matching the
200
200
  SDK controls, plus `accessibilityTree`. Handle `onInteractionResult` for
201
201
  inspectable acknowledgements and `onAccessibilityResult` for tree reads.
Binary file