-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from shoutem/release/5.3.0
Release/5.3.0
- Loading branch information
Showing
14 changed files
with
2,786 additions
and
3,034 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const fs = require('fs-extra'); | ||
const glob = require('glob'); | ||
const _ = require('lodash'); | ||
const path = require('path'); | ||
|
||
function createDependenciesJson() { | ||
const paths = glob.sync(path.join('..', 'extensions', '*')); | ||
|
||
let dependencies = {}; | ||
const allNativeDependencies = []; | ||
|
||
paths.forEach(extensionPath => { | ||
const stat = fs.statSync(extensionPath); | ||
|
||
if (stat && stat.isDirectory()) { | ||
try { | ||
const appPackageJsonPath = path.resolve( | ||
path.join(extensionPath, 'app', 'package.json'), | ||
); | ||
const extensionJsonPath = path.resolve( | ||
path.join(extensionPath, 'extension.json'), | ||
); | ||
const appPackageJsonStat = fs.statSync(appPackageJsonPath); | ||
|
||
if (appPackageJsonStat && appPackageJsonStat.isFile()) { | ||
const appPackageJson = fs.readJsonSync(appPackageJsonPath); | ||
|
||
if (appPackageJson.dependencies) { | ||
dependencies = { ...dependencies, ...appPackageJson.dependencies }; | ||
} | ||
|
||
if (appPackageJson.nativeDependencies) { | ||
appPackageJson.nativeDependencies.forEach(nativeDep => | ||
allNativeDependencies.push(nativeDep), | ||
); | ||
} | ||
} | ||
} catch (error) { | ||
console.log(`Failed to load ${extensionPath} with error: ${error}`); | ||
process.exit(1); | ||
} | ||
} | ||
}); | ||
|
||
allNativeDependencies.sort(); | ||
|
||
let nativeDependencies; | ||
_.uniq(allNativeDependencies).forEach(nativeDep => { | ||
nativeDependencies = { | ||
...nativeDependencies, | ||
[nativeDep]: dependencies[nativeDep], | ||
}; | ||
}); | ||
|
||
fs.writeJsonSync('dependencies.json', dependencies, { spaces: 2 }); | ||
fs.writeJsonSync('nativeDependencies.json', nativeDependencies, { | ||
spaces: 2, | ||
}); | ||
} | ||
|
||
createDependenciesJson(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.