Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: react-native-community/template
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.76.0
Choose a base ref
...
head repository: react-native-community/template
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.76.1
Choose a head ref
  • 4 commits
  • 5 files changed
  • 4 contributors

Commits on Oct 24, 2024

  1. Copy the full SHA
    0225599 View commit details

Commits on Oct 28, 2024

  1. Pin xcodeproj gem to < 1.26.0 (#71)

    cipolleschi authored and blakef committed Oct 28, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b45d031 View commit details

Commits on Oct 29, 2024

  1. Copy the full SHA
    e47f949 View commit details
  2. Copy the full SHA
    7808d04 View commit details
Showing with 62 additions and 12 deletions.
  1. +2 −2 package.json
  2. +50 −1 scripts/__tests__/bumpTemplateVersion-test.js
  3. +1 −1 scripts/bumpedTemplateVersion.sh
  4. +1 −0 template/Gemfile
  5. +8 −8 template/package.json
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@react-native-community/template",
"version": "0.76.0",
"version": "0.76.1",
"description": "The template used by `npx @react-native-community/cli init` to bootstrap a React Native application.",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "jest",
"version": "0.76.0"
"version": "0.76.1"
},
"type": "commonjs",
"files": [
51 changes: 50 additions & 1 deletion scripts/__tests__/bumpTemplateVersion-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
const {execSync} = require('child_process');
const {execSync, exec: _exec} = require('child_process');
const fs = require('fs');
const {promisify} = require('util');
const path = require('path');
const semver = require('semver');

function run(version) {
return execSync(`./bumpedTemplateVersion.sh ${version}`, { cwd: 'scripts', stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
}

const FIFO_PATH = '/tmp/_npm_fifo'

const exec = promisify(_exec);
const writeFile = promisify(fs.writeFile);

async function runStubbedNpm(version, response) {
cleanUpStubbedNpm();
execSync(`mkfifo ${FIFO_PATH}`);
return Promise.all(
[
writeFile(FIFO_PATH, JSON.stringify(response)),
exec(`./bumpedTemplateVersion.sh ${version}`, {
cwd: 'scripts',
stdio: ['ignore', 'pipe', 'ignore'],
env: {
PATH: `${__dirname}/stub:${process.env.PATH}`,
NPM_STUB_FIFO: FIFO_PATH,
}
}).then(raw => raw.stdout.toString().trim()),
]
).then(([, resp]) => resp);
}

function cleanUpStubbedNpm() {
try {
fs.unlinkSync(FIFO_PATH);
} catch {
// Best attempt is OK.
}
}

describe('bumpTemplateVersion.sh', () => {

it('nightlies stay the same', () => {
@@ -27,4 +61,19 @@ describe('bumpTemplateVersion.sh', () => {
expect(run(`${major}.${minor}.${patch}`)).toEqual(`${major}.${minor}.${patch+1}`);
});

describe('handles different npm responses', () => {
afterAll(cleanUpStubbedNpm);
it('arrays of versions', async () => {
expect(await runStubbedNpm('0.76.0', [
{ version: '0.76.0' },
{ version: '0.76.2' },
// Expecting +1 on this:
{ version: '0.76.3' },
])).toEqual('0.76.4');
});

it('single version', async () => {
expect(await runStubbedNpm('0.76.0', { version: '0.76.0' })).toEqual('0.76.1');
});
});
});
2 changes: 1 addition & 1 deletion scripts/bumpedTemplateVersion.sh
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ if [[ $1 =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
exit 0;
fi
# Bump PATCH
PUBLISHED=$(jq -r 'last | .version' <<< $CURRENT_VERSION | awk -F'.' '{ print $1"."$2"."($3+1) }')
PUBLISHED=$(jq -r 'if . | type == "array" then last | .version else .version end' <<< $CURRENT_VERSION | awk -F'.' '{ print $1"."$2"."($3+1) }')
echo $PUBLISHED;
exit 0
fi
1 change: 1 addition & 0 deletions template/Gemfile
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@ ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
16 changes: 8 additions & 8 deletions template/package.json
Original file line number Diff line number Diff line change
@@ -11,19 +11,19 @@
},
"dependencies": {
"react": "18.3.1",
"react-native": "0.76.0"
"react-native": "0.76.1"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "15.0.0-alpha.2",
"@react-native-community/cli-platform-android": "15.0.0-alpha.2",
"@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
"@react-native/babel-preset": "0.76.0",
"@react-native/eslint-config": "0.76.0",
"@react-native/metro-config": "0.76.0",
"@react-native/typescript-config": "0.76.0",
"@react-native-community/cli": "15.0.0",
"@react-native-community/cli-platform-android": "15.0.0",
"@react-native-community/cli-platform-ios": "15.0.0",
"@react-native/babel-preset": "0.76.1",
"@react-native/eslint-config": "0.76.1",
"@react-native/metro-config": "0.76.1",
"@react-native/typescript-config": "0.76.1",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",