eoas 2.3.21 → 2.3.22

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.
@@ -57,7 +57,7 @@ class Publish extends core_1.Command {
57
57
  default: 'dist',
58
58
  }),
59
59
  packageRunner: core_1.Flags.string({
60
- description: 'Package runner to use for spawning Expo CLI commands (e.g. npx, bunx, pnpx). Can also be set via EOAS_PACKAGE_RUNNER env var. Defaults to npx.',
60
+ description: 'Package runner to use for spawning Expo CLI commands (e.g. npx, bunx, "pnpm exec"). Can also be set via EOAS_PACKAGE_RUNNER env var. Defaults to npx.',
61
61
  required: false,
62
62
  }),
63
63
  message: core_1.Flags.string({
@@ -193,7 +193,8 @@ class Publish extends core_1.Command {
193
193
  try {
194
194
  const specifiedPlatform = platform === expoConfig_1.RequestedPlatform.All ? [] : ['--platform', platform];
195
195
  const sourcemapArgs = dumpSourcemap ? ['--dump-sourcemap'] : [];
196
- const { stdout } = await (0, spawn_async_1.default)(packageRunner, ['expo', 'export', '--output-dir', outputDir, ...sourcemapArgs, ...specifiedPlatform], {
196
+ const [runnerCommand, runnerArgs] = (0, packageRunner_1.splitPackageRunner)(packageRunner);
197
+ const { stdout } = await (0, spawn_async_1.default)(runnerCommand, [...runnerArgs, 'expo', 'export', '--output-dir', outputDir, ...sourcemapArgs, ...specifiedPlatform], {
197
198
  cwd: projectDir,
198
199
  env: {
199
200
  ...process.env,
@@ -29,8 +29,9 @@ async function getExpoConfigInternalAsync(projectDir, opts = {}) {
29
29
  let exp;
30
30
  if ((0, package_1.isExpoInstalled)(projectDir)) {
31
31
  const runner = (0, packageRunner_1.resolvePackageRunner)(opts.packageRunner, projectDir);
32
+ const [runnerCommand, runnerArgs] = (0, packageRunner_1.splitPackageRunner)(runner);
32
33
  try {
33
- const { stdout } = await (0, spawn_async_1.default)(runner, ['expo', 'config', '--json', ...(opts.isPublicConfig ? ['--type', 'public'] : [])], {
34
+ const { stdout } = await (0, spawn_async_1.default)(runnerCommand, [...runnerArgs, 'expo', 'config', '--json', ...(opts.isPublicConfig ? ['--type', 'public'] : [])], {
34
35
  cwd: projectDir,
35
36
  env: {
36
37
  ...process.env,
@@ -7,6 +7,12 @@
7
7
  * 3. Inferred from packageManager field in package.json
8
8
  * 4. Falls back to 'npx'
9
9
  *
10
- * Supported values: npx, bunx, pnpx, or any other package runner binary.
10
+ * Supported values: npx, bunx, "pnpm exec", or any other package runner
11
+ * binary, optionally followed by subcommand words.
11
12
  */
12
13
  export declare function resolvePackageRunner(explicit?: string, projectDir?: string): string;
14
+ /**
15
+ * Splits a resolved package runner into a spawnable command and its leading
16
+ * arguments (e.g. "pnpm exec" -> ['pnpm', ['exec']]).
17
+ */
18
+ export declare function splitPackageRunner(runner: string): [string, string[]];
@@ -1,19 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolvePackageRunner = void 0;
3
+ exports.splitPackageRunner = exports.resolvePackageRunner = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
6
6
  const path_1 = tslib_1.__importDefault(require("path"));
7
7
  const DEFAULT_PACKAGE_RUNNER = 'npx';
8
- const VALID_RUNNER_RE = /^[a-zA-Z0-9._-]+$/;
8
+ const VALID_RUNNER_RE = /^[a-zA-Z0-9._-]+( [a-zA-Z0-9._-]+)*$/;
9
9
  function assertValidRunner(value, source) {
10
10
  if (!VALID_RUNNER_RE.test(value)) {
11
- throw new Error(`Invalid package runner "${value}" (from ${source}). Expected a simple binary name like npx, bunx or pnpx.`);
11
+ throw new Error(`Invalid package runner "${value}" (from ${source}). Expected a binary name with optional subcommands like npx, bunx or "pnpm exec".`);
12
12
  }
13
13
  }
14
14
  const PACKAGE_MANAGER_RUNNERS = {
15
15
  bun: 'bunx',
16
- pnpm: 'pnpx',
16
+ // pnpm removed the `pnpx` binary in v7. `pnpm exec` runs the project-local
17
+ // Expo CLI with the same local-first semantics as npx and bunx.
18
+ pnpm: 'pnpm exec',
17
19
  yarn: 'npx',
18
20
  npm: 'npx',
19
21
  };
@@ -26,7 +28,8 @@ const PACKAGE_MANAGER_RUNNERS = {
26
28
  * 3. Inferred from packageManager field in package.json
27
29
  * 4. Falls back to 'npx'
28
30
  *
29
- * Supported values: npx, bunx, pnpx, or any other package runner binary.
31
+ * Supported values: npx, bunx, "pnpm exec", or any other package runner
32
+ * binary, optionally followed by subcommand words.
30
33
  */
31
34
  function resolvePackageRunner(explicit, projectDir) {
32
35
  if (explicit) {
@@ -70,3 +73,12 @@ function detectRunnerFromPackageJson(startDir) {
70
73
  }
71
74
  return undefined;
72
75
  }
76
+ /**
77
+ * Splits a resolved package runner into a spawnable command and its leading
78
+ * arguments (e.g. "pnpm exec" -> ['pnpm', ['exec']]).
79
+ */
80
+ function splitPackageRunner(runner) {
81
+ const [command, ...args] = runner.split(' ');
82
+ return [command, args];
83
+ }
84
+ exports.splitPackageRunner = splitPackageRunner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoas",
3
- "version": "2.3.21",
3
+ "version": "2.3.22",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.json",