runcloud 0.2.234 → 0.2.236

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.
@@ -3,7 +3,7 @@ import { evaluateCompliance, renderEvaluation } from './appStoreEvaluate.js';
3
3
  const STATUSES = new Set(['pass', 'warning', 'fail', 'info']);
4
4
  const EVIDENCE_REQUIRED = new Set(['pass', 'warning', 'fail']);
5
5
  function activeItems(manifest) {
6
- return manifest.items.filter((item) => !item.deferred && item.resolvedBy !== 'card');
6
+ return manifest.items.filter((item) => !item.deferred && item.resolvedBy !== 'card' && !item.rollout);
7
7
  }
8
8
  export function loadComplianceManifest(path) {
9
9
  const manifestPath = path ?? process.env.NEWLY_APP_STORE_COMPLIANCE_MANIFEST;
@@ -155,7 +155,7 @@ export function evaluateCompliance(manifest, projectDir, options = {}) {
155
155
  const targetPlatforms = dynamicConfig ? ['ios', 'android'] : targetPlatformsFromAppJson(appJson);
156
156
  const items = [];
157
157
  const unresolved = [];
158
- for (const item of activeItems(manifest)) {
158
+ for (const item of activeItems(manifest, options.rollouts)) {
159
159
  if (!targetsItem(item, targetPlatforms)) {
160
160
  items.push(makeItem(item, 'info', `Not targeting ${platformNames(item.platform)}.`, 'app.json target platform detection'));
161
161
  continue;
@@ -206,8 +206,8 @@ export function renderEvaluation(result) {
206
206
  lines.push('', 'JSON shape: { "items": [...deterministic report_compliance rows...], "unresolved": [...] }');
207
207
  return lines.join('\n');
208
208
  }
209
- function activeItems(manifest) {
210
- return manifest.items.filter((item) => !item.deferred && item.resolvedBy !== 'card');
209
+ function activeItems(manifest, rollouts = []) {
210
+ return manifest.items.filter((item) => !item.deferred && item.resolvedBy !== 'card' && (!item.rollout || rollouts.includes(item.rollout)));
211
211
  }
212
212
  function evaluateLocalItem(root, appJson, item) {
213
213
  if (item.id === 'scheme')
@@ -263,6 +263,8 @@ function evaluateLocalItem(root, appJson, item) {
263
263
  return evaluatePrivacyManifest(root, appJson, item);
264
264
  case 'rating_prompt':
265
265
  return evaluateRatingPrompt(root, item);
266
+ case 'release_backend_target':
267
+ return evaluateReleaseBackendTarget(root, item);
266
268
  default:
267
269
  if (STORE_REMINDER_IDS.has(item.id)) {
268
270
  return makeItem(item, 'info', 'Complete this declaration in Google Play Console.', 'Play Console questionnaire');
@@ -312,6 +314,26 @@ function evaluateRestorePurchases(root, item) {
312
314
  return makeItem(item, 'pass', 'Restore purchases flow appears in source.', evidence(restore));
313
315
  return makeItem(item, 'fail', 'IAP APIs found but no restore purchases flow was found.', evidence(iap));
314
316
  }
317
+ const NON_RELEASE_BACKEND = /[a-z0-9]+-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}-dev\.api\.newlyapp\.com|\.api-dev\.newlyapp\.com|\b[a-z0-9-]+\.(?:ngrok(?:-free)?\.(?:app|dev|io)|loca\.lt|trycloudflare\.com)\b|\b10\.0\.2\.2\b/i;
318
+ const RELEASE_ENV_FILES = ['.env', '.env.production', '.env.production.local', '.env.local'];
319
+ const TEST_FILE = /(^|\/)(__tests__|e2e)\/|\.(test|spec)\.[cm]?[jt]sx?$/;
320
+ function evaluateReleaseBackendTarget(root, item) {
321
+ const matches = [
322
+ ...scan(root, NON_RELEASE_BACKEND, { dirs: ['app', 'src', 'components', 'lib', 'app.json'], filter: (match) => !TEST_FILE.test(match.file) }),
323
+ ...scanFiles(root, RELEASE_ENV_FILES, NON_RELEASE_BACKEND),
324
+ ];
325
+ if (!matches.length)
326
+ return makeItem(item, 'pass', 'The release talks to no development backend or tunnel.', `scan: no matches for ${NON_RELEASE_BACKEND.source.slice(0, 60)}…`);
327
+ return makeItem(item, 'fail', 'The release still talks to a development backend or a tunnel. App Review uses the build as it ships, so a dev server that is paused, reset or rate-limited during review leaves the reviewer with an app that cannot load. Deploy the backend to production and point the app at its production address before you submit.', matches.slice(0, 5).map(({ file, line }) => `${file}:${line}`).join('\n'));
328
+ }
329
+ function scanFiles(root, names, regex) {
330
+ return names.flatMap((name) => {
331
+ const content = readText(path.join(root, name));
332
+ if (content == null)
333
+ return [];
334
+ return content.split(/\r?\n/).flatMap((line, index) => (regex.test(line) ? [{ file: name, line: index + 1, text: compact(line) }] : []));
335
+ });
336
+ }
315
337
  function evaluateRatingPrompt(root, item) {
316
338
  const asks = scan(root, /expo-store-review|react-native-in-app-review|requestReview|SKStoreReviewController/);
317
339
  if (asks.length)
@@ -25,6 +25,7 @@ async function post(apiUrl, path, body, token) {
25
25
  method: 'POST',
26
26
  headers: {
27
27
  'content-type': 'application/json',
28
+ origin: new URL(apiUrl).origin,
28
29
  ...(token ? { authorization: `Bearer ${token}` } : {}),
29
30
  },
30
31
  body: JSON.stringify(body),
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = '0.2.234';
1
+ export const CLI_VERSION = '0.2.236';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcloud",
3
- "version": "0.2.234",
3
+ "version": "0.2.236",
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
Binary file