Skip to content

Commit

Permalink
update hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pavjacko committed Dec 14, 2021
1 parent e4d79f1 commit 296fb7f
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 141 deletions.
17 changes: 10 additions & 7 deletions buildHooks/src/updateVersions.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ const VERSIONED_PACKAGES = [
'renative',
];

const updateDeps = (pkgFile, depKey, packageNamesAll, packageConfigs) => {
const updateDeps = (pkgConfig, depKey, packageNamesAll, packageConfigs, semVer = '') => {
const { pkgFile } = pkgConfig;
packageNamesAll.forEach((v) => {
const currVer = pkgFile?.[depKey]?.[v];
if (currVer) {
const newVer = packageConfigs[v].pkgFile?.version;
const newVer = `${semVer}${packageConfigs[v].pkgFile?.version}`;

if (currVer !== newVer) {
console.log('Found linked dependency to update:', v, currVer, newVer);
Expand All @@ -35,16 +36,18 @@ const updateDeps = (pkgFile, depKey, packageNamesAll, packageConfigs) => {
}
}
});
const output = Doctor.fixPackageObject(pkgFile);
FileUtils.writeFileSync(pkgConfig.pkgPath, output, 4, true);
};

export const updateVersions = async (c) => {
const rootPackage = FileUtils.readObjectSync(
path.join(c.paths.project.dir, '/../../', 'package.json')
path.join(c.paths.project.dir, 'package.json')
);
const v = {
version: rootPackage.version
};
const pkgFolder = path.join(c.paths.project.dir, '/../');
const pkgFolder = path.join(c.paths.project.dir, 'packages');
_updateJson(c, c.paths.project.package, v);

VERSIONED_PACKAGES.forEach((pkgName) => {
Expand Down Expand Up @@ -125,17 +128,17 @@ export const updateVersions = async (c) => {
updateDeps(pkgConfig.pkgFile, 'dependencies', packageNamesAll, packageConfigs);
updateDeps(pkgConfig.pkgFile, 'devDependencies', packageNamesAll, packageConfigs);
updateDeps(pkgConfig.pkgFile, 'optionalDependencies', packageNamesAll, packageConfigs);
updateDeps(pkgConfig.pkgFile, 'peerDependencies', packageNamesAll, packageConfigs);
updateDeps(pkgConfig.pkgFile, 'peerDependencies', packageNamesAll, packageConfigs, '^');
});


FileUtils.copyFileSync(
path.join(c.paths.project.dir, '/../../README.md'),
path.join(c.paths.project.dir, 'README.md'),
path.join(pkgFolder, 'renative/README.md')
);

FileUtils.copyFileSync(
path.join(c.paths.project.dir, '/../../README.md'),
path.join(c.paths.project.dir, 'README.md'),
path.join(pkgFolder, 'rnv/README.md')
);

Expand Down
268 changes: 134 additions & 134 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,136 +1,136 @@
{
"name": "renative-wrapper",
"version": "0.34.0-alpha.1",
"currentRelease": "0.33",
"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`, `FirefoxOS`, `Firefox TV`, `Linux` and `Chromecast` platforms",
"keywords": [
"android tv",
"android wear",
"apple tv",
"boilerplate",
"cocoapods",
"cross-platform",
"desktop",
"electron",
"firefox tv",
"firefoxox",
"firetv",
"kaios",
"kit",
"kotlin",
"lg",
"macos",
"multiplatform",
"native",
"osx",
"react",
"react-native",
"smart tv",
"starter",
"swift",
"template",
"tizen",
"tizen mobile",
"tizen watch",
"tvos",
"watch",
"web",
"webos",
"windows",
"linux"
],
"homepage": "https://github.com/renative-org/renative#readme",
"bugs": {
"url": "https://github.com/renative-org/renative/issues"
},
"license": "MIT",
"author": "Pavel Jacko <[email protected]> (https://github.com/pavjacko)",
"contributors": [
"Mihai Blaga <https://github.com/mihaiblaga89>",
"Donatas Velicka <https://github.com/doneitas>",
"Ricardas Noreika <https://github.com/RicardasN>",
"Aurimas Mickys <https://github.com/aurimas535>",
"Daniel Marino Ruiz <https://github.com/CHaNGeTe>",
"David Rielo <https://github.com/davidrielo>",
"Sander Looijenga <https://github.com/sanderlooijenga>"
],
"repository": {
"type": "git",
"url": "git://github.com/renative-org/renative.git"
},
"scripts": {
"bootstrap": "yarn run link:rnv && npx lerna bootstrap && yarn build",
"bootstrap-clean": "rm -rf ./node_modules; npx lerna clean --yes && yarn bootstrap",
"build": "lerna run --parallel --concurrency 1 build",
"build:clean": "lerna run --parallel --concurrency 1 build:clean",
"link:rnv": "cd packages/rnv && (yarn unlink || true) && yarn link",
"postinstall": "lerna link --force-local && npx jetify",
"lint": "npx eslint ./packages",
"test": "lerna run test --stream",
"watch": "lerna run --parallel --concurrency 2 watch",
"deploy-prepare": "cd packages/app && yarn deploy-prepare",
"git-commit": "cd packages/app && rnv hooks run -x gitCommit -r",
"git-tag": "cd packages/app && rnv hooks run -x gitTag -r",
"git-commit-tag": "cd packages/app && rnv hooks run -x gitCommitAndTag -r",
"deploy-all": "npm run test && npm run deploy-prepare && npm run git-commit-tag",
"deploy:feat": "npm run test && npm run deploy-prepare && npm run git-commit-tag && npx lerna publish from-package --dist-tag feat --yes && git push origin HEAD",
"deploy:alpha": "npm run deploy-all && npx lerna publish from-package --dist-tag alpha --yes && git push origin HEAD",
"deploy:alpha:soft": "npm run test && npm run deploy-prepare && npm run git-commit-tag && npx lerna publish from-package --dist-tag alpha --yes",
"deploy:prod": "npm run deploy-all && npx lerna publish from-package --yes && git push origin HEAD"
},
"dependencies": {
"simple-git": "2.20.1",
"deepmerge": "3.2.0"
},
"devDependencies": {
"babel-eslint": "8.2.6",
"babel-jest": "24.9.0",
"@babel/runtime": "7.8.3",
"babel-plugin-module-resolver": "3.2.0",
"babel-plugin-polyfill-corejs2": "0.2.2",
"lerna": "4.0.0",
"eslint": "6.2.2",
"eslint-plugin-detox": "1.0.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jest": "23.8.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-mocha": "6.3.0",
"eslint-plugin-react": "7.10.0",
"eslint-plugin-react-hooks": "2.5.0",
"husky": "4.2.5",
"jsdoc-to-markdown": "6.0.1",
"rnv": "0.34.0-alpha.1"
},
"engines": {
"node": ">=6.0.0",
"npm": ">=4.0.0"
},
"private": true,
"title": "ReNative",
"husky": {
"hooks": {
"pre-commit": "yarn lint && yarn test"
}
},
"lint-staged": {
"*.js": [
"eslint"
]
},
"workspaces": {
"packages": [
"packages/*"
"name": "renative-wrapper",
"version": "0.34.0-alpha.1",
"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`, `FirefoxOS`, `Firefox TV`, `Linux` and `Chromecast` platforms",
"keywords": [
"android tv",
"android wear",
"apple tv",
"boilerplate",
"cocoapods",
"cross-platform",
"desktop",
"electron",
"firefox tv",
"firefoxox",
"firetv",
"kaios",
"kit",
"kotlin",
"lg",
"linux",
"macos",
"multiplatform",
"native",
"osx",
"react",
"react-native",
"smart tv",
"starter",
"swift",
"template",
"tizen",
"tizen mobile",
"tizen watch",
"tvos",
"watch",
"web",
"webos",
"windows"
],
"homepage": "https://github.com/renative-org/renative#readme",
"bugs": {
"url": "https://github.com/renative-org/renative/issues"
},
"license": "MIT",
"author": "Pavel Jacko <[email protected]> (https://github.com/pavjacko)",
"contributors": [
"Aurimas Mickys <https://github.com/aurimas535>",
"Daniel Marino Ruiz <https://github.com/CHaNGeTe>",
"David Rielo <https://github.com/davidrielo>",
"Donatas Velicka <https://github.com/doneitas>",
"Mihai Blaga <https://github.com/mihaiblaga89>",
"Ricardas Noreika <https://github.com/RicardasN>",
"Sander Looijenga <https://github.com/sanderlooijenga>"
],
"nohoist": [
"html-webpack-plugin",
"html-webpack-harddisk-plugin",
"webpack",
"mini-css-extract-plugin",
"@zeit/next-css",
"@expo/next-adapter",
"@expo/webpack-config",
"@expo/**",
"reantive-app"
]
}
}
"repository": {
"type": "git",
"url": "git://github.com/renative-org/renative.git"
},
"scripts": {
"bootstrap": "yarn run link:rnv && npx lerna bootstrap && yarn build",
"bootstrap-clean": "rm -rf ./node_modules; npx lerna clean --yes && yarn bootstrap",
"build": "lerna run --parallel --concurrency 1 build",
"build:clean": "lerna run --parallel --concurrency 1 build:clean",
"deploy-all": "npm run test && npm run deploy-prepare && npm run git-commit-tag",
"deploy-prepare": "cd packages/app && yarn deploy-prepare",
"deploy:alpha": "npm run deploy-all && npx lerna publish from-package --dist-tag alpha --yes && git push origin HEAD",
"deploy:alpha:soft": "npm run test && npm run deploy-prepare && npm run git-commit-tag && npx lerna publish from-package --dist-tag alpha --yes",
"deploy:feat": "npm run test && npm run deploy-prepare && npm run git-commit-tag && npx lerna publish from-package --dist-tag feat --yes && git push origin HEAD",
"deploy:prod": "npm run deploy-all && npx lerna publish from-package --yes && git push origin HEAD",
"git-commit": "cd packages/app && rnv hooks run -x gitCommit -r",
"git-commit-tag": "cd packages/app && rnv hooks run -x gitCommitAndTag -r",
"git-tag": "cd packages/app && rnv hooks run -x gitTag -r",
"link:rnv": "cd packages/rnv && (yarn unlink || true) && yarn link",
"lint": "npx eslint ./packages",
"postinstall": "lerna link --force-local && npx jetify",
"test": "lerna run test --stream",
"watch": "lerna run --parallel --concurrency 2 watch"
},
"dependencies": {
"deepmerge": "3.2.0",
"simple-git": "2.20.1"
},
"devDependencies": {
"@babel/runtime": "7.8.3",
"babel-eslint": "8.2.6",
"babel-jest": "24.9.0",
"babel-plugin-module-resolver": "3.2.0",
"babel-plugin-polyfill-corejs2": "0.2.2",
"eslint": "6.2.2",
"eslint-plugin-detox": "1.0.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jest": "23.8.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-mocha": "6.3.0",
"eslint-plugin-react": "7.10.0",
"eslint-plugin-react-hooks": "2.5.0",
"husky": "4.2.5",
"jsdoc-to-markdown": "6.0.1",
"lerna": "4.0.0",
"rnv": "0.34.0-alpha.1"
},
"engines": {
"node": ">=6.0.0",
"npm": ">=4.0.0"
},
"private": true,
"currentRelease": "0.33",
"title": "ReNative",
"husky": {
"hooks": {
"pre-commit": "yarn lint && yarn test"
}
},
"lint-staged": {
"*.js": [
"eslint"
]
},
"workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"html-webpack-plugin",
"html-webpack-harddisk-plugin",
"webpack",
"mini-css-extract-plugin",
"@zeit/next-css",
"@expo/next-adapter",
"@expo/webpack-config",
"@expo/**",
"reantive-app"
]
}
}

0 comments on commit 296fb7f

Please sign in to comment.