diff --git a/lib/manager/meteor/resolve.js b/lib/manager/meteor/resolve.js new file mode 100644 index 0000000000000000000000000000000000000000..e44ae381f0a803f8b6dc1d5f811c0fe408bc89ca --- /dev/null +++ b/lib/manager/meteor/resolve.js @@ -0,0 +1,18 @@ +const configParser = require('../../config'); + +module.exports = { + resolvePackageFile, +}; + +async function resolvePackageFile(config, inputFile) { + const packageFile = configParser.mergeChildConfig(config.meteor, inputFile); + logger.debug( + `Resolving packageFile ${JSON.stringify(packageFile.packageFile)}` + ); + packageFile.content = await platform.getFile(packageFile.packageFile); + if (!packageFile.content) { + logger.debug('No packageFile content'); + return null; + } + return packageFile; +} diff --git a/lib/manager/resolve.js b/lib/manager/resolve.js index 5254fc20e9eb939fc4c7071ccd390620305dfc55..9f23a0c0c11b5ecc2d0581983ad2d195115d302f 100644 --- a/lib/manager/resolve.js +++ b/lib/manager/resolve.js @@ -4,6 +4,7 @@ const minimatch = require('minimatch'); const manager = require('./index'); const dockerResolve = require('../manager/docker/resolve'); +const meteorResolve = require('../manager/meteor/resolve'); const nodeResolve = require('../manager/node/resolve'); const bazelResolve = require('../manager/bazel/resolve'); const { mergeChildConfig } = require('../config'); @@ -146,7 +147,7 @@ async function resolvePackageFiles(config) { packageFile.currentPackageJsonVersion = packageFile.content.version; return mergeChildConfig(config.npm, packageFile); } else if (packageFile.manager === 'meteor') { - return mergeChildConfig(config.meteor, packageFile); + return meteorResolve.resolvePackageFile(config, packageFile); } else if (packageFile.manager === 'docker') { return dockerResolve.resolvePackageFile(config, packageFile); } else if (packageFile.manager === 'node') { diff --git a/test/manager/__snapshots__/resolve.spec.js.snap b/test/manager/__snapshots__/resolve.spec.js.snap index 39b85e321f4fd33f3e9f83c958856e6b5a53ed73..ebc8eabe8b088fa36cfb28e9991d62e578253254 100644 --- a/test/manager/__snapshots__/resolve.spec.js.snap +++ b/test/manager/__snapshots__/resolve.spec.js.snap @@ -45,6 +45,7 @@ Array [ exports[`manager/resolve resolvePackageFiles() detects meteor and docker and travis and bazel 1`] = ` Array [ Object { + "content": "{}", "enabled": true, "manager": "meteor", "packageFile": "package.js", diff --git a/test/manager/resolve.spec.js b/test/manager/resolve.spec.js index 028aa28e5583f09264776f0c82b6b3e5782e1790..32d1f8b85bd0120c7576d15437ad0d95487fbc3c 100644 --- a/test/manager/resolve.spec.js +++ b/test/manager/resolve.spec.js @@ -97,7 +97,8 @@ describe('manager/resolve', () => { '.travis.yml', 'WORKSPACE', ]; - platform.getFile.mockReturnValueOnce('# comment\nFROM node:8\n'); // Dockerfile.js + platform.getFile.mockReturnValueOnce('{}'); // package.js + platform.getFile.mockReturnValueOnce('# comment\nFROM node:8\n'); // Dockerfile platform.getFile.mockReturnValueOnce('hello: world\n'); // Dockerfile platform.getFile.mockReturnValueOnce('# travis'); // .travis.yml platform.getFile.mockReturnValueOnce('# WORKSPACE'); // Dockerfile @@ -110,6 +111,7 @@ describe('manager/resolve', () => { 'other/Dockerfile', '.travis.yml', 'WORKSPACE', + 'package.js', ]; platform.getFile.mockReturnValueOnce('# comment\n'); // Dockerfile const res = await resolvePackageFiles(config);