runcloud 0.2.144 → 0.2.146

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.
@@ -89,9 +89,9 @@ const SKIP_DIRS = new Set([
89
89
  'node_modules',
90
90
  'Pods',
91
91
  ]);
92
- export function evaluateCompliance(manifest, projectDir) {
92
+ export function evaluateCompliance(manifest, projectDir, options = {}) {
93
93
  const root = path.resolve(projectDir);
94
- const appJson = readJson(path.join(root, 'app.json'));
94
+ const appJson = asReleased(readJson(path.join(root, 'app.json')), options.iosBundleId);
95
95
  const targetPlatforms = targetPlatformsFromAppJson(appJson);
96
96
  const items = [];
97
97
  const unresolved = [];
@@ -146,8 +146,9 @@ function activeItems(manifest) {
146
146
  return manifest.items.filter((item) => !item.deferred && item.resolvedBy !== 'card');
147
147
  }
148
148
  function evaluateLocalItem(root, appJson, item) {
149
- if (CONFIG_RULES[item.id])
150
- return evaluateConfigItem(appJson, item, CONFIG_RULES[item.id]);
149
+ const rule = CONFIG_RULES[item.id];
150
+ if (rule)
151
+ return evaluateConfigItem(appJson, item, rule);
151
152
  switch (item.id) {
152
153
  case 'hardcoded_secrets':
153
154
  return patternItem(root, item, /sk-[A-Za-z0-9]{20,}|AIza[0-9A-Za-z_-]{30,}|-----BEGIN.*PRIVATE KEY|api[_-]?key\s*[:=]\s*['"][A-Za-z0-9]{16,}/i, 'fail', 'Hardcoded secret-like value found.', 'No secret-like values found.');
@@ -446,6 +447,14 @@ function routePath(root, file) {
446
447
  function evidence(matches) {
447
448
  return matches.slice(0, 5).map((match) => `${match.file}:${match.line}: ${match.text}`).join('\n');
448
449
  }
450
+ function asReleased(appJson, iosBundleId) {
451
+ const expo = getPath(appJson, ['expo']);
452
+ if (!iosBundleId || !expo || typeof expo !== 'object' || Array.isArray(expo))
453
+ return appJson;
454
+ const ios = getPath(expo, ['ios']);
455
+ const iosConfig = ios && typeof ios === 'object' && !Array.isArray(ios) ? ios : {};
456
+ return { ...appJson, expo: { ...expo, ios: { ...iosConfig, bundleIdentifier: iosBundleId } } };
457
+ }
449
458
  function readJson(file) {
450
459
  try {
451
460
  return JSON.parse(readFileSync(file, 'utf8'));
@@ -5,6 +5,11 @@ export function assertDevOnly(env, command) {
5
5
  throw new Error(`\`newly ${command}\` is dev-only from the CLI. Prod ${command} requires the Newly web app (a browser session).`);
6
6
  }
7
7
  }
8
+ export function assertKnownEnv(env, command) {
9
+ if (env !== 'dev' && env !== 'prod') {
10
+ throw new Error(`\`newly ${command}\` --env must be dev or prod (got ${JSON.stringify(env)})`);
11
+ }
12
+ }
8
13
  export function parseDuration(s) {
9
14
  const m = /^(\d+)(s|m|h)$/.exec(s.trim());
10
15
  if (!m)
@@ -128,7 +133,7 @@ export function registerMisc(program) {
128
133
  .option('--project <id>', 'project id')
129
134
  .action(async (opts) => {
130
135
  try {
131
- assertDevOnly(opts.env, 'secrets list');
136
+ assertKnownEnv(opts.env, 'secrets list');
132
137
  const { client, projectId } = makeClient(opts.project);
133
138
  console.log(await listSecrets(client, projectId, opts.env, opts.service));
134
139
  }
@@ -146,7 +151,7 @@ export function registerMisc(program) {
146
151
  .option('--project <id>', 'project id')
147
152
  .action(async (key, value, opts) => {
148
153
  try {
149
- assertDevOnly(opts.env, 'secrets set');
154
+ assertKnownEnv(opts.env, 'secrets set');
150
155
  const { client, projectId } = makeClient(opts.project);
151
156
  await setSecret(client, projectId, opts.env, opts.service, key, value);
152
157
  console.log(`Secret ${key} set for ${opts.service} (${opts.env}). Redeploy to apply.`);
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = '0.2.144';
1
+ export const CLI_VERSION = '0.2.146';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcloud",
3
- "version": "0.2.144",
3
+ "version": "0.2.146",
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