Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ElenaDiachenko committed Jan 18, 2024
2 parents 8dafccc + 7578ea5 commit 10d904f
Show file tree
Hide file tree
Showing 43 changed files with 324 additions and 217 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flexn/renative-monorepo",
"version": "1.0.0-rc.8",
"version": "1.0.0-rc.9",
"description": "🚀🚀🚀 Unified Development Platform. Bootstrap, Develop & Deploy `iOS`, `tvOS`, `Android`, `Android TV`, `Fire TV`, `Android Wear`, `Web`, `Tizen TV`, `Tizen Watch`, `Tizen Mobile`, `LG webOS`, `macOS/OSX`, `Windows`, `KaiOS`, `Linux` and `Chromecast` platforms",
"keywords": [
"android tv",
Expand Down Expand Up @@ -84,8 +84,8 @@
"@flexn/eslint-config": "1.0.0",
"@flexn/prettier-config": "1.0.0",
"@flexn/typescript-config": "1.0.0",
"@rnv/build-hooks-git": "1.0.0-rc.8",
"@rnv/core": "1.0.0-rc.8",
"@rnv/build-hooks-git": "1.0.0-rc.9",
"@rnv/core": "1.0.0-rc.9",
"@types/jest": "~27.0.2",
"@types/kill-port": "2.0.0",
"@types/lodash.get": "4.4.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-harness/appConfigs/harness/renative.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "../../../../.rnv/schema/rnv.app.json",
"extend": "base",
"id": "template",
"id": "harness",
"skipBootstrapCopy": true,
"common": {
"id": "renative.harness",
Expand Down
23 changes: 12 additions & 11 deletions packages/app-harness/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/app-harness",
"version": "1.0.0-rc.8",
"version": "1.0.0-rc.9",
"description": "ReNative Test Harness App",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down Expand Up @@ -36,14 +36,15 @@
},
"dependencies": {
"@lightningjs/sdk": "^5.4.1",
"@rnv/renative": "1.0.0-rc.8",
"@rnv/renative": "1.0.0-rc.9",
"next": "14.0.4",
"raf": "3.4.1",
"react": "18.2.0",
"react-art": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.4",
"react-native-gesture-handler": "2.13.1",
"react-native-permissions": "3.10.1",
"react-native-tvos": "0.72.4-0",
"react-native-web": "0.19.9",
"react-native-splash-screen": "3.3.0",
Expand All @@ -52,22 +53,22 @@
"devDependencies": {
"@flexn/assets-renative-outline": "0.3.3",
"@flexn/graybox": "1.0.0-feat.12",
"@rnv/core": "1.0.0-rc.8",
"@rnv/engine-lightning": "1.0.0-rc.8",
"@rnv/engine-rn": "1.0.0-rc.8",
"@rnv/engine-rn-electron": "1.0.0-rc.8",
"@rnv/engine-rn-next": "1.0.0-rc.8",
"@rnv/engine-rn-tvos": "1.0.0-rc.8",
"@rnv/engine-rn-web": "1.0.0-rc.8",
"@rnv/template-starter": "1.0.0-rc.8",
"@rnv/core": "1.0.0-rc.9",
"@rnv/engine-lightning": "1.0.0-rc.9",
"@rnv/engine-rn": "1.0.0-rc.9",
"@rnv/engine-rn-electron": "1.0.0-rc.9",
"@rnv/engine-rn-next": "1.0.0-rc.9",
"@rnv/engine-rn-tvos": "1.0.0-rc.9",
"@rnv/engine-rn-web": "1.0.0-rc.9",
"@rnv/template-starter": "1.0.0-rc.9",
"@types/react": "18.2.22",
"@types/react-dom": "18.2.7",
"@types/react-native": "0.72.2",
"babel-jest": "29.2.1",
"babel-loader": "9.1.3",
"detox": "18.20.2",
"jetifier": "2.0.0",
"rnv": "1.0.0-rc.8"
"rnv": "1.0.0-rc.9"
},
"private": true,
"browserslist": {
Expand Down
11 changes: 11 additions & 0 deletions packages/app-harness/renative.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@
"podName": "react-native-carplay"
},
"version": "2.3.0"
},
"react-native-permissions": "3.10.1"
},
"permissions": {
"ios": {
"NSCalendarsUsageDescription": {
"desc": "Calendars usage description"
},
"NSContactsUsageDescription": {
"desc": "Contacts usage description"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/build-hooks-git/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/build-hooks-git",
"version": "1.0.0-rc.8",
"version": "1.0.0-rc.9",
"description": "Build Hooks for Git",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down Expand Up @@ -30,7 +30,7 @@
"simple-git": "^3.16.0"
},
"peerDependencies": {
"@rnv/core": "^1.0.0-rc.8"
"@rnv/core": "^1.0.0-rc.9"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/build-hooks-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"zod-to-json-schema": "3.21.4"
},
"peerDependencies": {
"@rnv/core": "^1.0.0-rc.8"
"@rnv/core": "^1.0.0-rc.9"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/cli",
"version": "1.0.0-rc.8",
"version": "1.0.0-rc.9",
"description": "ReNative CLI",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down Expand Up @@ -37,7 +37,7 @@
"inquirer": "8.2.0"
},
"peerDependencies": {
"@rnv/core": "^1.0.0-rc.8"
"@rnv/core": "^1.0.0-rc.9"
},
"private": false,
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/core",
"version": "1.0.0-rc.8",
"version": "1.0.0-rc.9",
"description": "RNV Core SDK",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down
96 changes: 96 additions & 0 deletions packages/core/src/__tests__/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,100 @@ describe('Testing getAppVersionCode functions', () => {
);
expect(result).toEqual('10000');
});

it('should evaluate given versionCode 1 with 1 on android', async () => {
const result = getAppVersionCode(
{
...BUILD_CONF,
files: {
...BUILD_CONF.files,
project: {
...BUILD_CONF.files.project,
package: { version: '1' },
},
},
buildConfig: {
common: {
versionCode: '1',
},
},
},
'android'
);
expect(result).toEqual('1');
});

it('should throw on given versionCode `string` on android', async () => {
expect.assertions(1);
try {
getAppVersionCode(
{
...BUILD_CONF,
files: {
...BUILD_CONF.files,
project: {
...BUILD_CONF.files.project,
package: { version: '1' },
},
},
buildConfig: {
common: {
versionCode: 'something as a string',
},
},
},
'android'
);
} catch (e) {
expect(e).toEqual(Error(`'versionCode' should be a positive integer. Check your config`));
}
});

it('should throw on given versionCode negative on android', async () => {
expect.assertions(1);
try {
getAppVersionCode(
{
...BUILD_CONF,
files: {
...BUILD_CONF.files,
project: {
...BUILD_CONF.files.project,
package: { version: '1' },
},
},
buildConfig: {
common: {
versionCode: '-1',
},
},
},
'android'
);
} catch (e) {
expect(e).toEqual(Error(`'versionCode' should be a positive integer. Check your config`));
}
});

it('should evaluate given versionCode 4.4.4 with 4.4.4 on ios', async () => {
const result = getAppVersionCode(
{
...BUILD_CONF,
files: {
...BUILD_CONF.files,
project: {
...BUILD_CONF.files.project,
package: { version: '1' },
},
},
buildConfig: {
common: {
versionCode: '4.4.4',
},
},
},
'ios'
);
expect(result).toEqual('4.4.4');
});
});
34 changes: 24 additions & 10 deletions packages/core/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,33 @@ export const getAppVersion = (c: RnvContext, platform: RnvPlatform) => {
return output;
};

const _androidLikePlatform = (platform: RnvPlatform) =>
['android', 'androidtv', 'firetv', 'androidwear'].includes(platform!);

/**
* Retrieves the version code for the specified platform from the configuration.
* If the platform is Android, the version code must be a positive integer.
* If the version code is not found or is invalid, it falls back to a default value of '0'.
* Otherwise version code is generated based on the version and version code format specified in the configuration.
*
* @param c - The RnvContext object.
* @param platform - The RnvPlatform object.
* @returns The version code as a string.
* @throws An error if the version code is not a positive integer for Android platforms.
*/
export const getAppVersionCode = (c: RnvContext, platform: RnvPlatform) => {
const versionCode = getConfigProp(c, platform, 'versionCode');
const isValidVersionCode = Number.isInteger(Number(versionCode)) && Number(versionCode) > 0

if (isValidVersionCode) {
return versionCode

}else if(versionCode && !isValidVersionCode){
throw new Error(`${chalk().white('versionCode')} should be a positive integer. Check your config `)
};



if (versionCode) {
// android platforms don't allow versionCode to be a string, only positive integer
if (_androidLikePlatform(platform)) {
const isValidVersionCode = Number.isInteger(Number(versionCode)) && Number(versionCode) > 0;
if (!isValidVersionCode) {
throw new Error(`'versionCode' should be a positive integer. Check your config`);
}
}
return versionCode;
}

const version = getConfigProp(c, platform, 'version') || c.files.project.package?.version;
if (!version || typeof version !== 'string') {
Expand Down
14 changes: 7 additions & 7 deletions packages/engine-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/engine-core",
"version": "1.0.0-rc.8",
"version": "1.0.0-rc.9",
"description": "ReNative Engine Core",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down Expand Up @@ -29,17 +29,17 @@
"watch": "tsc --watch --preserveWatchOutput"
},
"dependencies": {
"@rnv/sdk-android": "1.0.0-rc.8",
"@rnv/sdk-apple": "1.0.0-rc.8",
"@rnv/sdk-kaios": "1.0.0-rc.8",
"@rnv/sdk-tizen": "1.0.0-rc.8",
"@rnv/sdk-webos": "1.0.0-rc.8",
"@rnv/sdk-android": "1.0.0-rc.9",
"@rnv/sdk-apple": "1.0.0-rc.9",
"@rnv/sdk-kaios": "1.0.0-rc.9",
"@rnv/sdk-tizen": "1.0.0-rc.9",
"@rnv/sdk-webos": "1.0.0-rc.9",
"iocane": "4.0.0",
"kill-port": "1.6.1",
"tar": "4.4.19"
},
"peerDependencies": {
"@rnv/core": "^1.0.0-rc.8"
"@rnv/core": "^1.0.0-rc.9"
},
"private": false,
"publishConfig": {
Expand Down
8 changes: 4 additions & 4 deletions packages/engine-lightning/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/engine-lightning",
"version": "1.0.0-rc.8",
"version": "1.0.0-rc.9",
"description": "ReNative Engine to build lightning based apps.",
"keywords": [
"lightning"
Expand Down Expand Up @@ -34,11 +34,11 @@
"dependencies": {
"@lightningjs/cli": "2.12.0",
"@lightningjs/sdk": "5.4.1",
"@rnv/sdk-tizen": "1.0.0-rc.8",
"@rnv/sdk-webos": "1.0.0-rc.8"
"@rnv/sdk-tizen": "1.0.0-rc.9",
"@rnv/sdk-webos": "1.0.0-rc.9"
},
"peerDependencies": {
"@rnv/core": "^1.0.0-rc.8"
"@rnv/core": "^1.0.0-rc.9"
},
"private": false,
"publishConfig": {
Expand Down
8 changes: 4 additions & 4 deletions packages/engine-rn-electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/engine-rn-electron",
"version": "1.0.0-rc.8",
"version": "1.0.0-rc.9",
"description": "ReNative Engine to build electron based platforms with react native support.",
"keywords": [
"electron",
Expand Down Expand Up @@ -33,16 +33,16 @@
"watch": "tsc --watch --preserveWatchOutput"
},
"dependencies": {
"@rnv/sdk-react-native": "1.0.0-rc.8",
"@rnv/sdk-react-native": "1.0.0-rc.9",
"@rnv/sdk-utils": "1.0.0-feat-pin-cli.6",
"@rnv/sdk-webpack": "1.0.0-rc.8",
"@rnv/sdk-webpack": "1.0.0-rc.9",
"electron": "26.3.0",
"electron-builder": "24.6.4",
"electron-notarize": "1.2.2",
"metro-react-native-babel-preset": "0.76.8"
},
"peerDependencies": {
"@rnv/core": "^1.0.0-rc.8"
"@rnv/core": "^1.0.0-rc.9"
},
"private": false,
"publishConfig": {
Expand Down
Loading

0 comments on commit 10d904f

Please sign in to comment.