Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-toolchain/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ runs:
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: "20"
node-version: "22"
cache: ${{ inputs.cache-npm-dependencies }}
- name: Set up Xcode
if: ${{ inputs.xcode-developer-dir != '' }}
Expand Down
24 changes: 16 additions & 8 deletions android/autolink.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-check
import { getCurrentState } from "@rnx-kit/tools-react-native/cache";
import { loadContext } from "@rnx-kit/tools-react-native/context";
import { loadContextAsync } from "@rnx-kit/tools-react-native";
import * as fs from "node:fs";
import * as path from "node:path";
import {
Expand Down Expand Up @@ -83,16 +83,16 @@ export function pruneDependencies(config) {
/**
* @param {string} json
* @param {string} projectRoot
* @returns {Config}
* @returns {Promise<Config>}
*/
function loadConfig(json, projectRoot) {
async function loadConfig(json, projectRoot) {
const state = getCurrentState(projectRoot);
const stateFile = json.substring(0, json.length - "json".length) + "sha256";
if (fs.existsSync(stateFile) && readTextFile(stateFile) === state) {
return readJSONFile(json);
}

const config = loadContext(projectRoot);
const config = await loadContextAsync(projectRoot);
const prunedConfig = pruneDependencies(config);

ensureDirForFile(json);
Expand All @@ -101,10 +101,13 @@ function loadConfig(json, projectRoot) {
return prunedConfig;
}

if (isMain(import.meta.url)) {
const [, , projectRoot = process.cwd(), output] = process.argv;

const config = loadConfig(
/**
* @param {string} projectRoot
* @param {string} output
* @returns {Promise<void>}
*/
async function main(projectRoot, output) {
const config = await loadConfig(
output.replace(
/[/\\]app[/\\]build[/\\]generated[/\\]rnta[/\\]/,
"/build/generated/autolinking/"
Expand All @@ -121,3 +124,8 @@ if (isMain(import.meta.url)) {
writeTextFile(output, json + "\n");
}
}

if (isMain(import.meta.url)) {
const [, , projectRoot = process.cwd(), output = ""] = process.argv;
await main(projectRoot, output);
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@
"postpack": "node scripts/internal/pack.mjs post",
"release-notes": "node scripts/internal/release-notes.mjs",
"set-react-version": "node scripts/internal/set-react-version.mjs",
"show-affected": "node --import tsx scripts/build/affected.ts",
"show-affected": "node --experimental-transform-types --no-warnings scripts/build/affected.ts",
"test": "node scripts/internal/test.mjs",
"test:js": "node --import tsx --test $(git ls-files '*.test.ts')",
"test:js": "node --experimental-transform-types --no-warnings --test $(git ls-files '*.test.ts')",
"test:matrix": "node scripts/testing/test-matrix.mjs",
"test:rb": "bundle exec ruby -Ilib:test -e \"Dir.glob('./test/test_*.rb').each { |file| require(file) }\""
},
"dependencies": {
"@rnx-kit/react-native-host": "^0.5.0",
"@rnx-kit/tools-react-native": "^2.0.0",
"@rnx-kit/tools-react-native": "^2.0.1",
"ajv": "^8.0.0",
"cliui": "^8.0.0",
"fast-xml-parser": "^4.0.0",
Expand Down Expand Up @@ -146,7 +146,6 @@
"react-native-windows": "^0.75.0",
"semantic-release": "^24.0.0",
"suggestion-bot": "^3.0.0",
"tsx": "^4.16.2",
"typescript": "^5.0.0"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/internal/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ switch (getTarget(input)) {
break;
case "typescript":
testWith(process.argv0, [
"--import",
"tsx",
"--experimental-transform-types",
"--no-warnings",
"--test",
"--experimental-test-coverage",
...input,
Expand Down
Loading
Loading