Skip to content

Commit 2335712

Browse files
author
Capacitor+ Bot
committed
chore: sync upstream PR ionic-team#8244 from @dynst
2 parents 4c7c126 + eebb778 commit 2335712

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+427
-392
lines changed

cli/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
"engines": {
3030
"node": ">=22.0.0"
3131
},
32+
"type": "module",
3233
"main": "dist/index.js",
3334
"types": "dist/declarations.d.ts",
35+
"exports": {
36+
"types": "dist/declarations.d.ts",
37+
"default": "dist/index.js"
38+
},
3439
"bin": {
3540
"capacitor": "./bin/capacitor",
3641
"cap": "./bin/capacitor"

cli/src/android/add.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { pathExists, writeFile } from 'fs-extra';
22
import { homedir } from 'os';
33
import { join } from 'path';
44

5-
import c from '../colors';
6-
import { runTask } from '../common';
7-
import type { Config } from '../definitions';
8-
import { runCommand } from '../util/subprocess';
9-
import { extractTemplate } from '../util/template';
5+
import c from '../colors.js';
6+
import { runTask } from '../common.js';
7+
import type { Config } from '../definitions.js';
8+
import { runCommand } from '../util/subprocess.js';
9+
import { extractTemplate } from '../util/template.js';
1010

1111
export async function addAndroid(config: Config): Promise<void> {
1212
await runTask(`Adding native android project in ${c.strong(config.android.platformDir)}`, async () => {

cli/src/android/build.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { join } from 'path';
22

3-
import c from '../colors';
4-
import { runTask } from '../common';
5-
import type { Config } from '../definitions';
6-
import { logSuccess } from '../log';
7-
import type { BuildCommandOptions } from '../tasks/build';
8-
import { runCommand } from '../util/subprocess';
3+
import c from '../colors.js';
4+
import { runTask } from '../common.js';
5+
import type { Config } from '../definitions.js';
6+
import { logSuccess } from '../log.js';
7+
import type { BuildCommandOptions } from '../tasks/build.js';
8+
import { runCommand } from '../util/subprocess.js';
99

1010
export async function buildAndroid(config: Config, buildOptions: BuildCommandOptions): Promise<void> {
1111
const releaseType = buildOptions.androidreleasetype ?? 'AAB';

cli/src/android/common.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { copy, remove, mkdirp, readFile, pathExists, writeFile } from 'fs-extra';
22
import { join, resolve } from 'path';
33

4-
import { checkCapacitorPlatform } from '../common';
5-
import { getIncompatibleCordovaPlugins } from '../cordova';
6-
import type { Config } from '../definitions';
7-
import { PluginType, getPluginPlatform } from '../plugin';
8-
import type { Plugin } from '../plugin';
9-
import { convertToUnixPath } from '../util/fs';
4+
import { checkCapacitorPlatform } from '../common.js';
5+
import { getIncompatibleCordovaPlugins } from '../cordova.js';
6+
import type { Config } from '../definitions.js';
7+
import { PluginType, getPluginPlatform } from '../plugin.js';
8+
import type { Plugin } from '../plugin.js';
9+
import { convertToUnixPath } from '../util/fs.js';
1010

1111
export async function checkAndroidPackage(config: Config): Promise<string | null> {
1212
return checkCapacitorPlatform(config, 'android');

cli/src/android/doctor.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { pathExists, readFile } from 'fs-extra';
22
import { join, extname, parse } from 'path';
33

4-
import c from '../colors';
5-
import { check } from '../common';
6-
import type { Config } from '../definitions';
7-
import { fatal, isFatal } from '../errors';
8-
import { logSuccess } from '../log';
9-
import { readdirp } from '../util/fs';
10-
import { readXML } from '../util/xml';
4+
import c from '../colors.js';
5+
import { check } from '../common.js';
6+
import type { Config } from '../definitions.js';
7+
import { fatal, isFatal } from '../errors.js';
8+
import { logSuccess } from '../log.js';
9+
import { readdirp } from '../util/fs.js';
10+
import { readXML } from '../util/xml.js';
1111

1212
export async function doctorAndroid(config: Config): Promise<void> {
1313
try {

cli/src/android/open.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import Debug from 'debug';
22
import { pathExists } from 'fs-extra';
33
import open from 'open';
44

5-
import c from '../colors';
6-
import type { Config } from '../definitions';
7-
import { logger } from '../log';
5+
import c from '../colors.js';
6+
import type { Config } from '../definitions.js';
7+
import { logger } from '../log.js';
88

99
const debug = Debug('capacitor:android:open');
1010

cli/src/android/run.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import Debug from 'debug';
22
import { resolve } from 'path';
33

4-
import c from '../colors';
5-
import { parseApkNameFromFlavor, promptForPlatformTarget, runTask } from '../common';
6-
import type { Config } from '../definitions';
7-
import type { RunCommandOptions } from '../tasks/run';
8-
import { runNativeRun, getPlatformTargets } from '../util/native-run';
9-
import { runCommand } from '../util/subprocess';
4+
import c from '../colors.js';
5+
import { parseApkNameFromFlavor, promptForPlatformTarget, runTask } from '../common.js';
6+
import type { Config } from '../definitions.js';
7+
import type { RunCommandOptions } from '../tasks/run.js';
8+
import { runNativeRun, getPlatformTargets } from '../util/native-run.js';
9+
import { runCommand } from '../util/subprocess.js';
1010

1111
const debug = Debug('capacitor:android:run');
1212

cli/src/android/update.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import Debug from 'debug';
22
import { copy, remove, pathExists, readFile, writeFile, writeJSON } from 'fs-extra';
33
import { dirname, extname, join, relative, resolve } from 'path';
44

5-
import c from '../colors';
6-
import { checkPlatformVersions, runTask } from '../common';
7-
import { checkPluginDependencies, handleCordovaPluginsJS, writeCordovaAndroidManifest } from '../cordova';
8-
import type { Config } from '../definitions';
9-
import { fatal } from '../errors';
5+
import c from '../colors.js';
6+
import { checkPlatformVersions, runTask } from '../common.js';
7+
import { checkPluginDependencies, handleCordovaPluginsJS, writeCordovaAndroidManifest } from '../cordova.js';
8+
import type { Config } from '../definitions.js';
9+
import { fatal } from '../errors.js';
1010
import {
1111
PluginType,
1212
getAllElements,
@@ -16,14 +16,14 @@ import {
1616
getPluginType,
1717
getPlugins,
1818
printPlugins,
19-
} from '../plugin';
20-
import type { Plugin } from '../plugin';
21-
import { copy as copyTask } from '../tasks/copy';
22-
import { readdirp, convertToUnixPath } from '../util/fs';
23-
import { resolveNode } from '../util/node';
24-
import { extractTemplate } from '../util/template';
25-
26-
import { getAndroidPlugins } from './common';
19+
} from '../plugin.js';
20+
import type { Plugin } from '../plugin.js';
21+
import { copy as copyTask } from '../tasks/copy.js';
22+
import { readdirp, convertToUnixPath } from '../util/fs.js';
23+
import { resolveNode } from '../util/node.js';
24+
import { extractTemplate } from '../util/template.js';
25+
26+
import { getAndroidPlugins } from './common.js';
2727

2828
const platform = 'android';
2929
const debug = Debug('capacitor:android:update');

cli/src/common.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { prettyPath } from '@ionic/utils-terminal';
22
import { readJSON, pathExists } from 'fs-extra';
33
import { dirname, join } from 'path';
44

5-
import c from './colors';
6-
import type { Config, PackageJson } from './definitions';
7-
import { fatal } from './errors';
8-
import { output, logger } from './log';
9-
import { getPlugins } from './plugin';
10-
import { findNXMonorepoRoot, isNXMonorepo } from './util/monorepotools';
11-
import { resolveNode } from './util/node';
12-
import { runCommand } from './util/subprocess';
5+
import c from './colors.js';
6+
import type { Config, PackageJson } from './definitions.js';
7+
import { fatal } from './errors.js';
8+
import { output, logger } from './log.js';
9+
import { getPlugins } from './plugin.js';
10+
import { findNXMonorepoRoot, isNXMonorepo } from './util/monorepotools.js';
11+
import { resolveNode } from './util/node.js';
12+
import { runCommand } from './util/subprocess.js';
1313

1414
export type CheckFunction = () => Promise<string | null>;
1515

cli/src/config.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import Debug from 'debug';
22
import { pathExists, readFile, readJSON, writeFile, writeJSON } from 'fs-extra';
33
import { dirname, extname, join, relative, resolve } from 'path';
44

5-
import c from './colors';
6-
import { parseApkNameFromFlavor } from './common';
5+
import c from './colors.js';
6+
import { parseApkNameFromFlavor } from './common.js';
77
import type {
88
AndroidConfig,
99
AppConfig,
@@ -13,16 +13,16 @@ import type {
1313
IOSConfig,
1414
WebConfig,
1515
XcodeExportMethod,
16-
} from './definitions';
17-
import { OS } from './definitions';
18-
import { fatal, isFatal } from './errors';
19-
import { logger } from './log';
20-
import { tryFn } from './util/fn';
21-
import { formatJSObject } from './util/js';
22-
import { findNXMonorepoRoot, isNXMonorepo } from './util/monorepotools';
23-
import { requireTS, resolveNode } from './util/node';
24-
import { lazy } from './util/promise';
25-
import { getCommandOutput } from './util/subprocess';
16+
} from './definitions.js';
17+
import { OS } from './definitions.js';
18+
import { fatal, isFatal } from './errors.js';
19+
import { logger } from './log.js';
20+
import { tryFn } from './util/fn.js';
21+
import { formatJSObject } from './util/js.js';
22+
import { findNXMonorepoRoot, isNXMonorepo } from './util/monorepotools.js';
23+
import { requireTS, resolveNode } from './util/node.js';
24+
import { lazy } from './util/promise.js';
25+
import { getCommandOutput } from './util/subprocess.js';
2626

2727
const debug = Debug('capacitor:config');
2828

@@ -371,7 +371,7 @@ async function determineAndroidStudioPath(os: OS): Promise<string> {
371371
case OS.Mac:
372372
return '/Applications/Android Studio.app';
373373
case OS.Windows: {
374-
const { runCommand } = await import('./util/subprocess');
374+
const { runCommand } = await import('./util/subprocess.js');
375375

376376
let p = 'C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe';
377377

0 commit comments

Comments
 (0)