@react-native/community-cli-plugin 0.82.0-nightly-20250727-df3f0967b → 0.82.0-nightly-20250729-e17e3e3f3
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.
- package/dist/commands/bundle/assetCatalogIOS.js +1 -1
- package/dist/commands/bundle/assetCatalogIOS.js.flow +1 -1
- package/dist/commands/bundle/assetPathUtils.js +1 -3
- package/dist/commands/bundle/assetPathUtils.js.flow +1 -1
- package/dist/commands/bundle/buildBundle.js +6 -12
- package/dist/commands/bundle/buildBundle.js.flow +2 -2
- package/dist/commands/bundle/createKeepFileAsync.js +2 -4
- package/dist/commands/bundle/createKeepFileAsync.js.flow +1 -1
- package/dist/commands/bundle/filterPlatformAssetScales.js.flow +1 -1
- package/dist/commands/bundle/getAssetDestPathAndroid.js +1 -1
- package/dist/commands/bundle/getAssetDestPathAndroid.js.flow +1 -1
- package/dist/commands/bundle/getAssetDestPathIOS.js +1 -1
- package/dist/commands/bundle/getAssetDestPathIOS.js.flow +1 -1
- package/dist/commands/bundle/saveAssets.js +10 -13
- package/dist/commands/bundle/saveAssets.js.flow +1 -1
- package/dist/commands/start/OpenDebuggerKeyboardHandler.js +6 -9
- package/dist/commands/start/attachKeyHandlers.js +2 -2
- package/dist/commands/start/middleware.js +4 -3
- package/dist/commands/start/runServer.js +12 -18
- package/dist/commands/start/runServer.js.flow +1 -1
- package/dist/utils/createDevMiddlewareLogger.js.flow +1 -1
- package/dist/utils/isDevServerRunning.js.flow +1 -1
- package/dist/utils/loadMetroConfig.js +10 -10
- package/dist/utils/loadMetroConfig.js.flow +1 -1
- package/dist/utils/metroPlatformResolver.js +1 -3
- package/dist/utils/metroPlatformResolver.js.flow +1 -1
- package/dist/utils/parseKeyValueParamArray.js.flow +1 -1
- package/dist/utils/version.js +6 -14
- package/dist/utils/version.js.flow +2 -2
- package/package.json +2 -2
|
@@ -30,9 +30,7 @@ function getAndroidResourceFolderName(asset, scale) {
|
|
|
30
30
|
const suffix = getAndroidAssetSuffix(scale);
|
|
31
31
|
if (!suffix) {
|
|
32
32
|
throw new Error(
|
|
33
|
-
`Don't know which android drawable suffix to use for asset: ${JSON.stringify(
|
|
34
|
-
asset
|
|
35
|
-
)}`
|
|
33
|
+
`Don't know which android drawable suffix to use for asset: ${JSON.stringify(asset)}`,
|
|
36
34
|
);
|
|
37
35
|
}
|
|
38
36
|
return `drawable-${suffix}`;
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.unstable_buildBundleWithConfig = exports.default = void 0;
|
|
7
7
|
var _loadMetroConfig = _interopRequireDefault(
|
|
8
|
-
require("../../utils/loadMetroConfig")
|
|
8
|
+
require("../../utils/loadMetroConfig"),
|
|
9
9
|
);
|
|
10
10
|
var _parseKeyValueParamArray = _interopRequireDefault(
|
|
11
|
-
require("../../utils/parseKeyValueParamArray")
|
|
11
|
+
require("../../utils/parseKeyValueParamArray"),
|
|
12
12
|
);
|
|
13
13
|
var _saveAssets = _interopRequireDefault(require("./saveAssets"));
|
|
14
14
|
var _fs = require("fs");
|
|
@@ -28,20 +28,14 @@ async function buildBundle(_argv, ctx, args, bundleImpl) {
|
|
|
28
28
|
}
|
|
29
29
|
async function buildBundleWithConfig(args, config, bundleImpl) {
|
|
30
30
|
const customResolverOptions = (0, _parseKeyValueParamArray.default)(
|
|
31
|
-
args.resolverOption ?? []
|
|
31
|
+
args.resolverOption ?? [],
|
|
32
32
|
);
|
|
33
33
|
if (config.resolver.platforms.indexOf(args.platform) === -1) {
|
|
34
34
|
console.error(
|
|
35
|
-
`${(0, _util.styleText)("red", "error")}: Invalid platform ${
|
|
36
|
-
args.platform ? `"${(0, _util.styleText)("bold", args.platform)}" ` : ""
|
|
37
|
-
}selected.`
|
|
35
|
+
`${(0, _util.styleText)("red", "error")}: Invalid platform ${args.platform ? `"${(0, _util.styleText)("bold", args.platform)}" ` : ""}selected.`,
|
|
38
36
|
);
|
|
39
37
|
console.info(
|
|
40
|
-
`Available platforms are: ${config.resolver.platforms
|
|
41
|
-
.map((x) => `"${(0, _util.styleText)("bold", x)}"`)
|
|
42
|
-
.join(
|
|
43
|
-
", "
|
|
44
|
-
)}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`
|
|
38
|
+
`Available platforms are: ${config.resolver.platforms.map((x) => `"${(0, _util.styleText)("bold", x)}"`).join(", ")}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`,
|
|
45
39
|
);
|
|
46
40
|
throw new Error("Bundling failed");
|
|
47
41
|
}
|
|
@@ -81,7 +75,7 @@ async function buildBundleWithConfig(args, config, bundleImpl) {
|
|
|
81
75
|
outputAssets,
|
|
82
76
|
args.platform,
|
|
83
77
|
args.assetsDest,
|
|
84
|
-
args.assetCatalogDest
|
|
78
|
+
args.assetCatalogDest,
|
|
85
79
|
);
|
|
86
80
|
}
|
|
87
81
|
const unstable_buildBundleWithConfig = (exports.unstable_buildBundleWithConfig =
|
|
@@ -39,13 +39,13 @@ declare function buildBundle(
|
|
|
39
39
|
_argv: Array<string>,
|
|
40
40
|
ctx: Config,
|
|
41
41
|
args: BundleCommandArgs,
|
|
42
|
-
bundleImpl?: RunBuildOptions["output"]
|
|
42
|
+
bundleImpl?: RunBuildOptions["output"],
|
|
43
43
|
): Promise<void>;
|
|
44
44
|
|
|
45
45
|
declare function buildBundleWithConfig(
|
|
46
46
|
args: BundleCommandArgs,
|
|
47
47
|
config: ConfigT,
|
|
48
|
-
bundleImpl?: RunBuildOptions["output"]
|
|
48
|
+
bundleImpl?: RunBuildOptions["output"],
|
|
49
49
|
): Promise<void>;
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -20,13 +20,11 @@ async function createKeepFileAsync(assets, outputDirectory) {
|
|
|
20
20
|
? "drawable"
|
|
21
21
|
: "raw";
|
|
22
22
|
assetsList.push(
|
|
23
|
-
`@${prefix}/${_assetPathUtils.default.getResourceIdentifier(asset)}
|
|
23
|
+
`@${prefix}/${_assetPathUtils.default.getResourceIdentifier(asset)}`,
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
const keepPath = _path.default.join(outputDirectory, "raw/keep.xml");
|
|
27
|
-
const content = `<resources xmlns:tools="http://schemas.android.com/tools" tools:keep="${assetsList.join(
|
|
28
|
-
","
|
|
29
|
-
)}" />\n`;
|
|
27
|
+
const content = `<resources xmlns:tools="http://schemas.android.com/tools" tools:keep="${assetsList.join(",")}" />\n`;
|
|
30
28
|
await _fs.default.promises.mkdir(_path.default.dirname(keepPath), {
|
|
31
29
|
recursive: true,
|
|
32
30
|
});
|
|
@@ -12,7 +12,7 @@ function _interopRequireDefault(e) {
|
|
|
12
12
|
function getAssetDestPathAndroid(asset, scale) {
|
|
13
13
|
const androidFolder = _assetPathUtils.default.getAndroidResourceFolderName(
|
|
14
14
|
asset,
|
|
15
|
-
scale
|
|
15
|
+
scale,
|
|
16
16
|
);
|
|
17
17
|
const fileName = _assetPathUtils.default.getResourceIdentifier(asset);
|
|
18
18
|
return _path.default.join(androidFolder, `${fileName}.${asset.type}`);
|
|
@@ -13,7 +13,7 @@ function getAssetDestPathIOS(asset, scale) {
|
|
|
13
13
|
const fileName = `${asset.name + suffix}.${asset.type}`;
|
|
14
14
|
return _path.default.join(
|
|
15
15
|
asset.httpServerLocation.substr(1).replace(/\.\.\//g, "_"),
|
|
16
|
-
fileName
|
|
16
|
+
fileName,
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
var _default = (exports.default = getAssetDestPathIOS);
|
|
@@ -6,16 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _assetCatalogIOS = require("./assetCatalogIOS");
|
|
8
8
|
var _createKeepFileAsync = _interopRequireDefault(
|
|
9
|
-
require("./createKeepFileAsync")
|
|
9
|
+
require("./createKeepFileAsync"),
|
|
10
10
|
);
|
|
11
11
|
var _filterPlatformAssetScales = _interopRequireDefault(
|
|
12
|
-
require("./filterPlatformAssetScales")
|
|
12
|
+
require("./filterPlatformAssetScales"),
|
|
13
13
|
);
|
|
14
14
|
var _getAssetDestPathAndroid = _interopRequireDefault(
|
|
15
|
-
require("./getAssetDestPathAndroid")
|
|
15
|
+
require("./getAssetDestPathAndroid"),
|
|
16
16
|
);
|
|
17
17
|
var _getAssetDestPathIOS = _interopRequireDefault(
|
|
18
|
-
require("./getAssetDestPathIOS")
|
|
18
|
+
require("./getAssetDestPathIOS"),
|
|
19
19
|
);
|
|
20
20
|
var _fs = _interopRequireDefault(require("fs"));
|
|
21
21
|
var _path = _interopRequireDefault(require("path"));
|
|
@@ -35,7 +35,7 @@ async function saveAssets(assets, platform, assetsDest, assetCatalogDest) {
|
|
|
35
35
|
: _getAssetDestPathIOS.default;
|
|
36
36
|
const addAssetToCopy = (asset) => {
|
|
37
37
|
const validScales = new Set(
|
|
38
|
-
(0, _filterPlatformAssetScales.default)(platform, asset.scales)
|
|
38
|
+
(0, _filterPlatformAssetScales.default)(platform, asset.scales),
|
|
39
39
|
);
|
|
40
40
|
asset.scales.forEach((scale, idx) => {
|
|
41
41
|
if (!validScales.has(scale)) {
|
|
@@ -44,7 +44,7 @@ async function saveAssets(assets, platform, assetsDest, assetCatalogDest) {
|
|
|
44
44
|
const src = asset.files[idx];
|
|
45
45
|
const dest = _path.default.join(
|
|
46
46
|
assetsDest,
|
|
47
|
-
getAssetDestPath(asset, scale)
|
|
47
|
+
getAssetDestPath(asset, scale),
|
|
48
48
|
);
|
|
49
49
|
filesToCopy[src] = dest;
|
|
50
50
|
});
|
|
@@ -52,14 +52,11 @@ async function saveAssets(assets, platform, assetsDest, assetCatalogDest) {
|
|
|
52
52
|
if (platform === "ios" && assetCatalogDest != null) {
|
|
53
53
|
const catalogDir = _path.default.join(
|
|
54
54
|
assetCatalogDest,
|
|
55
|
-
"RNAssets.xcassets"
|
|
55
|
+
"RNAssets.xcassets",
|
|
56
56
|
);
|
|
57
57
|
if (!_fs.default.existsSync(catalogDir)) {
|
|
58
58
|
console.error(
|
|
59
|
-
`${(0, _util.styleText)(
|
|
60
|
-
"red",
|
|
61
|
-
"error"
|
|
62
|
-
)}: Could not find asset catalog 'RNAssets.xcassets' in ${assetCatalogDest}. Make sure to create it if it does not exist.`
|
|
59
|
+
`${(0, _util.styleText)("red", "error")}: Could not find asset catalog 'RNAssets.xcassets' in ${assetCatalogDest}. Make sure to create it if it does not exist.`,
|
|
63
60
|
);
|
|
64
61
|
return;
|
|
65
62
|
}
|
|
@@ -70,7 +67,7 @@ async function saveAssets(assets, platform, assetsDest, assetCatalogDest) {
|
|
|
70
67
|
const imageSet = (0, _assetCatalogIOS.getImageSet)(
|
|
71
68
|
catalogDir,
|
|
72
69
|
asset,
|
|
73
|
-
(0, _filterPlatformAssetScales.default)(platform, asset.scales)
|
|
70
|
+
(0, _filterPlatformAssetScales.default)(platform, asset.scales),
|
|
74
71
|
);
|
|
75
72
|
(0, _assetCatalogIOS.writeImageSet)(imageSet);
|
|
76
73
|
} else {
|
|
@@ -126,7 +123,7 @@ function copy(src, dest, callback) {
|
|
|
126
123
|
.createReadStream(src)
|
|
127
124
|
.pipe(_fs.default.createWriteStream(dest))
|
|
128
125
|
.on("finish", callback);
|
|
129
|
-
}
|
|
126
|
+
},
|
|
130
127
|
);
|
|
131
128
|
}
|
|
132
129
|
var _default = (exports.default = saveAssets);
|
|
@@ -20,11 +20,11 @@ class OpenDebuggerKeyboardHandler {
|
|
|
20
20
|
await fetch(
|
|
21
21
|
new URL(
|
|
22
22
|
"/open-debugger?target=" + encodeURIComponent(target.id),
|
|
23
|
-
this.#devServerUrl
|
|
23
|
+
this.#devServerUrl,
|
|
24
24
|
).href,
|
|
25
25
|
{
|
|
26
26
|
method: "POST",
|
|
27
|
-
}
|
|
27
|
+
},
|
|
28
28
|
);
|
|
29
29
|
} catch (e) {
|
|
30
30
|
this.#log(
|
|
@@ -32,7 +32,7 @@ class OpenDebuggerKeyboardHandler {
|
|
|
32
32
|
"Failed to open debugger for %s (%s): %s",
|
|
33
33
|
target.title,
|
|
34
34
|
target.description,
|
|
35
|
-
"Network error"
|
|
35
|
+
"Network error",
|
|
36
36
|
);
|
|
37
37
|
if (e.cause != null) {
|
|
38
38
|
this.#log("error", "Cause: %s", e.cause);
|
|
@@ -65,7 +65,7 @@ class OpenDebuggerKeyboardHandler {
|
|
|
65
65
|
if (targets.length > 9) {
|
|
66
66
|
this.#log(
|
|
67
67
|
"warn",
|
|
68
|
-
"10 or more debug targets available, showing the first 9."
|
|
68
|
+
"10 or more debug targets available, showing the first 9.",
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
this.#setTerminalMenu(
|
|
@@ -73,12 +73,9 @@ class OpenDebuggerKeyboardHandler {
|
|
|
73
73
|
.slice(0, 9)
|
|
74
74
|
.map(
|
|
75
75
|
({ title }, i) =>
|
|
76
|
-
`${(0, _util.styleText)(
|
|
77
|
-
["white", "inverse"],
|
|
78
|
-
` ${i + 1} `
|
|
79
|
-
)} - "${title}"`
|
|
76
|
+
`${(0, _util.styleText)(["white", "inverse"], ` ${i + 1} `)} - "${title}"`,
|
|
80
77
|
)
|
|
81
|
-
.join("\n ")}
|
|
78
|
+
.join("\n ")}`,
|
|
82
79
|
);
|
|
83
80
|
}
|
|
84
81
|
} catch (e) {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = attachKeyHandlers;
|
|
7
7
|
var _OpenDebuggerKeyboardHandler = _interopRequireDefault(
|
|
8
|
-
require("./OpenDebuggerKeyboardHandler")
|
|
8
|
+
require("./OpenDebuggerKeyboardHandler"),
|
|
9
9
|
);
|
|
10
10
|
var _invariant = _interopRequireDefault(require("invariant"));
|
|
11
11
|
var _readline = _interopRequireDefault(require("readline"));
|
|
@@ -97,7 +97,7 @@ function attachKeyHandlers({ devServerUrl, messageSocket, reporter }) {
|
|
|
97
97
|
function setRawMode(enable) {
|
|
98
98
|
(0, _invariant.default)(
|
|
99
99
|
process.stdin instanceof _tty.ReadStream,
|
|
100
|
-
"process.stdin must be a readable stream to modify raw mode"
|
|
100
|
+
"process.stdin must be a readable stream to modify raw mode",
|
|
101
101
|
);
|
|
102
102
|
process.stdin.setRawMode(enable);
|
|
103
103
|
}
|
|
@@ -27,10 +27,11 @@ try {
|
|
|
27
27
|
"@react-native-community/cli-server-api",
|
|
28
28
|
{
|
|
29
29
|
paths: [communityCliPath],
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
31
|
);
|
|
32
|
-
communityMiddlewareFallback.createDevServerMiddleware =
|
|
33
|
-
|
|
32
|
+
communityMiddlewareFallback.createDevServerMiddleware = require(
|
|
33
|
+
communityCliServerApiPath,
|
|
34
|
+
).createDevServerMiddleware;
|
|
34
35
|
} catch {
|
|
35
36
|
debug(`⚠️ Unable to find @react-native-community/cli-server-api
|
|
36
37
|
Starting the server without the community middleware.`);
|
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _createDevMiddlewareLogger = _interopRequireDefault(
|
|
8
|
-
require("../../utils/createDevMiddlewareLogger")
|
|
8
|
+
require("../../utils/createDevMiddlewareLogger"),
|
|
9
9
|
);
|
|
10
10
|
var _isDevServerRunning = _interopRequireDefault(
|
|
11
|
-
require("../../utils/isDevServerRunning")
|
|
11
|
+
require("../../utils/isDevServerRunning"),
|
|
12
12
|
);
|
|
13
13
|
var _loadMetroConfig = _interopRequireDefault(
|
|
14
|
-
require("../../utils/loadMetroConfig")
|
|
14
|
+
require("../../utils/loadMetroConfig"),
|
|
15
15
|
);
|
|
16
16
|
var version = _interopRequireWildcard(require("../../utils/version"));
|
|
17
17
|
var _attachKeyHandlers = _interopRequireDefault(require("./attachKeyHandlers"));
|
|
@@ -43,7 +43,7 @@ function _interopRequireWildcard(e, r) {
|
|
|
43
43
|
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
44
44
|
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : (n[u] = e[u]);
|
|
45
45
|
}
|
|
46
|
-
return (n.default = e), t && t.set(e, n), n;
|
|
46
|
+
return ((n.default = e), t && t.set(e, n), n);
|
|
47
47
|
}
|
|
48
48
|
function _interopRequireDefault(e) {
|
|
49
49
|
return e && e.__esModule ? e : { default: e };
|
|
@@ -73,32 +73,29 @@ async function runServer(_argv, cliConfig, args) {
|
|
|
73
73
|
console.info(
|
|
74
74
|
(0, _util.styleText)(
|
|
75
75
|
"blue",
|
|
76
|
-
`\nWelcome to React Native v${cliConfig.reactNativeVersion}
|
|
77
|
-
)
|
|
76
|
+
`\nWelcome to React Native v${cliConfig.reactNativeVersion}`,
|
|
77
|
+
),
|
|
78
78
|
);
|
|
79
79
|
const serverStatus = await (0, _isDevServerRunning.default)(
|
|
80
80
|
devServerUrl,
|
|
81
|
-
projectRoot
|
|
81
|
+
projectRoot,
|
|
82
82
|
);
|
|
83
83
|
if (serverStatus === "matched_server_running") {
|
|
84
84
|
console.info(
|
|
85
|
-
`A dev server is already running for this project on port ${port}. Exiting
|
|
85
|
+
`A dev server is already running for this project on port ${port}. Exiting.`,
|
|
86
86
|
);
|
|
87
87
|
return;
|
|
88
88
|
} else if (serverStatus === "port_taken") {
|
|
89
89
|
console.error(
|
|
90
|
-
`${(0, _util.styleText)(
|
|
91
|
-
"
|
|
92
|
-
"error"
|
|
93
|
-
)}: Another process is running on port ${port}. Please terminate this ` +
|
|
94
|
-
'process and try again, or use another port with "--port".'
|
|
90
|
+
`${(0, _util.styleText)("red", "error")}: Another process is running on port ${port}. Please terminate this ` +
|
|
91
|
+
'process and try again, or use another port with "--port".',
|
|
95
92
|
);
|
|
96
93
|
return;
|
|
97
94
|
}
|
|
98
95
|
console.info(`Starting dev server on ${devServerUrl}\n`);
|
|
99
96
|
if (args.assetPlugins) {
|
|
100
97
|
metroConfig.transformer.assetPlugins = args.assetPlugins.map((plugin) =>
|
|
101
|
-
require.resolve(plugin)
|
|
98
|
+
require.resolve(plugin),
|
|
102
99
|
);
|
|
103
100
|
}
|
|
104
101
|
if (!args.clientLogs) {
|
|
@@ -134,10 +131,7 @@ async function runServer(_argv, cliConfig, args) {
|
|
|
134
131
|
terminalReporter.update({
|
|
135
132
|
type: "unstable_server_log",
|
|
136
133
|
level: "info",
|
|
137
|
-
data: `Dev server ready. ${(0, _util.styleText)(
|
|
138
|
-
"dim",
|
|
139
|
-
"Press Ctrl+C to exit."
|
|
140
|
-
)}`,
|
|
134
|
+
data: `Dev server ready. ${(0, _util.styleText)("dim", "Press Ctrl+C to exit.")}`,
|
|
141
135
|
});
|
|
142
136
|
(0, _attachKeyHandlers.default)({
|
|
143
137
|
devServerUrl,
|
|
@@ -17,7 +17,7 @@ type LoggerFn = (...message: $ReadOnlyArray<string>) => void;
|
|
|
17
17
|
* terminal reporter.
|
|
18
18
|
*/
|
|
19
19
|
declare export default function createDevMiddlewareLogger(
|
|
20
|
-
reporter: TerminalReporter
|
|
20
|
+
reporter: TerminalReporter,
|
|
21
21
|
): $ReadOnly<{
|
|
22
22
|
info: LoggerFn,
|
|
23
23
|
error: LoggerFn,
|
|
@@ -14,7 +14,7 @@ function _interopRequireDefault(e) {
|
|
|
14
14
|
const debug = require("debug")("ReactNative:CommunityCliPlugin");
|
|
15
15
|
function getCommunityCliDefaultConfig(ctx, config) {
|
|
16
16
|
const outOfTreePlatforms = Object.keys(ctx.platforms).filter(
|
|
17
|
-
(platform) => ctx.platforms[platform].npmPackageName
|
|
17
|
+
(platform) => ctx.platforms[platform].npmPackageName,
|
|
18
18
|
);
|
|
19
19
|
const resolver = {
|
|
20
20
|
platforms: [...Object.keys(ctx.platforms), "native"],
|
|
@@ -26,7 +26,7 @@ function getCommunityCliDefaultConfig(ctx, config) {
|
|
|
26
26
|
result[platform] = ctx.platforms[platform].npmPackageName;
|
|
27
27
|
return result;
|
|
28
28
|
}, {}),
|
|
29
|
-
config.resolver?.resolveRequest
|
|
29
|
+
config.resolver?.resolveRequest,
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
return {
|
|
@@ -36,19 +36,19 @@ function getCommunityCliDefaultConfig(ctx, config) {
|
|
|
36
36
|
require.resolve(
|
|
37
37
|
_path.default.join(
|
|
38
38
|
ctx.reactNativePath,
|
|
39
|
-
"Libraries/Core/InitializeCore"
|
|
39
|
+
"Libraries/Core/InitializeCore",
|
|
40
40
|
),
|
|
41
41
|
{
|
|
42
42
|
paths: [ctx.root],
|
|
43
|
-
}
|
|
43
|
+
},
|
|
44
44
|
),
|
|
45
45
|
...outOfTreePlatforms.map((platform) =>
|
|
46
46
|
require.resolve(
|
|
47
47
|
`${ctx.platforms[platform].npmPackageName}/Libraries/Core/InitializeCore`,
|
|
48
48
|
{
|
|
49
49
|
paths: [ctx.root],
|
|
50
|
-
}
|
|
51
|
-
)
|
|
50
|
+
},
|
|
51
|
+
),
|
|
52
52
|
),
|
|
53
53
|
],
|
|
54
54
|
},
|
|
@@ -60,23 +60,23 @@ async function loadMetroConfig(ctx, options = {}) {
|
|
|
60
60
|
RNMetroConfig = require("@react-native/metro-config");
|
|
61
61
|
} catch (e) {
|
|
62
62
|
throw new Error(
|
|
63
|
-
"Cannot resolve `@react-native/metro-config`. Ensure it is listed in your project's `devDependencies`."
|
|
63
|
+
"Cannot resolve `@react-native/metro-config`. Ensure it is listed in your project's `devDependencies`.",
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
const defaultConfig = RNMetroConfig.getDefaultConfig(ctx.root);
|
|
67
67
|
global.__REACT_NATIVE_METRO_CONFIG_LOADED = false;
|
|
68
68
|
if (typeof RNMetroConfig.setFrameworkDefaults !== "function") {
|
|
69
69
|
throw new Error(
|
|
70
|
-
"`@react-native/metro-config` does not have the expected API. Ensure it matches your React Native version."
|
|
70
|
+
"`@react-native/metro-config` does not have the expected API. Ensure it matches your React Native version.",
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
RNMetroConfig.setFrameworkDefaults(
|
|
74
|
-
getCommunityCliDefaultConfig(ctx, defaultConfig)
|
|
74
|
+
getCommunityCliDefaultConfig(ctx, defaultConfig),
|
|
75
75
|
);
|
|
76
76
|
const cwd = ctx.root;
|
|
77
77
|
const projectConfig = await (0, _metroConfig.resolveConfig)(
|
|
78
78
|
options.config,
|
|
79
|
-
cwd
|
|
79
|
+
cwd,
|
|
80
80
|
);
|
|
81
81
|
if (projectConfig.isEmpty) {
|
|
82
82
|
throw new _errors.CLIError(`No Metro config found in ${cwd}`);
|
|
@@ -11,9 +11,7 @@ function reactNativePlatformResolver(platformImplementations, customResolver) {
|
|
|
11
11
|
if (moduleName === "react-native") {
|
|
12
12
|
modifiedModuleName = platformImplementations[platform];
|
|
13
13
|
} else if (moduleName.startsWith("react-native/")) {
|
|
14
|
-
modifiedModuleName = `${
|
|
15
|
-
platformImplementations[platform]
|
|
16
|
-
}/${modifiedModuleName.slice("react-native/".length)}`;
|
|
14
|
+
modifiedModuleName = `${platformImplementations[platform]}/${modifiedModuleName.slice("react-native/".length)}`;
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
17
|
if (customResolver) {
|
package/dist/utils/version.js
CHANGED
|
@@ -22,7 +22,7 @@ async function logIfUpdateAvailable(cliConfig, reporter) {
|
|
|
22
22
|
} catch (e) {
|
|
23
23
|
debug(
|
|
24
24
|
"Cannot detect current version of React Native, " +
|
|
25
|
-
"skipping check for a newer release"
|
|
25
|
+
"skipping check for a newer release",
|
|
26
26
|
);
|
|
27
27
|
debug(e);
|
|
28
28
|
}
|
|
@@ -33,17 +33,9 @@ async function logIfUpdateAvailable(cliConfig, reporter) {
|
|
|
33
33
|
reporter.update({
|
|
34
34
|
type: "unstable_server_log",
|
|
35
35
|
level: "info",
|
|
36
|
-
data: `React Native v${
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Changelog: ${(0, _util.styleText)(
|
|
40
|
-
["dim", "underline"],
|
|
41
|
-
newVersion?.changelogUrl ?? "none"
|
|
42
|
-
)}
|
|
43
|
-
Diff: ${(0, _util.styleText)(
|
|
44
|
-
["dim", "underline"],
|
|
45
|
-
newVersion?.diffUrl ?? "none"
|
|
46
|
-
)}
|
|
36
|
+
data: `React Native v${newVersion.stable} is now available (your project is running on v${currentVersion}).
|
|
37
|
+
Changelog: ${(0, _util.styleText)(["dim", "underline"], newVersion?.changelogUrl ?? "none")}
|
|
38
|
+
Diff: ${(0, _util.styleText)(["dim", "underline"], newVersion?.diffUrl ?? "none")}
|
|
47
39
|
`,
|
|
48
40
|
});
|
|
49
41
|
}
|
|
@@ -51,7 +43,7 @@ Diff: ${(0, _util.styleText)(
|
|
|
51
43
|
function isDiffPurgeEntry(data) {
|
|
52
44
|
return (
|
|
53
45
|
[data.name, data.zipball_url, data.tarball_url, data.node_id].filter(
|
|
54
|
-
(e) => typeof e !== "undefined"
|
|
46
|
+
(e) => typeof e !== "undefined",
|
|
55
47
|
).length === 0
|
|
56
48
|
);
|
|
57
49
|
}
|
|
@@ -96,7 +88,7 @@ async function getLatestRnDiffPurgeVersion() {
|
|
|
96
88
|
headers: {
|
|
97
89
|
"User-Agent": "@react-native/community-cli-plugin",
|
|
98
90
|
},
|
|
99
|
-
}
|
|
91
|
+
},
|
|
100
92
|
);
|
|
101
93
|
const result = {
|
|
102
94
|
stable: "0.0.0",
|
|
@@ -25,7 +25,7 @@ type Release = {
|
|
|
25
25
|
*/
|
|
26
26
|
declare export function logIfUpdateAvailable(
|
|
27
27
|
cliConfig: Config,
|
|
28
|
-
reporter: TerminalReporter
|
|
28
|
+
reporter: TerminalReporter,
|
|
29
29
|
): Promise<void>;
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -36,5 +36,5 @@ declare export function logIfUpdateAvailable(
|
|
|
36
36
|
* will return undefined.
|
|
37
37
|
*/
|
|
38
38
|
declare export default function getLatestRelease(
|
|
39
|
-
currentVersion: string
|
|
39
|
+
currentVersion: string,
|
|
40
40
|
): Promise<Release | void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native/community-cli-plugin",
|
|
3
|
-
"version": "0.82.0-nightly-
|
|
3
|
+
"version": "0.82.0-nightly-20250729-e17e3e3f3",
|
|
4
4
|
"description": "Core CLI commands for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-native/dev-middleware": "0.82.0-nightly-
|
|
25
|
+
"@react-native/dev-middleware": "0.82.0-nightly-20250729-e17e3e3f3",
|
|
26
26
|
"debug": "^4.4.0",
|
|
27
27
|
"invariant": "^2.2.4",
|
|
28
28
|
"metro": "^0.83.1",
|