From cf00d52e0aea194b6feb69d0fc1fafbfe03f93a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Nison?= Date: Fri, 2 Mar 2018 19:06:52 +0000 Subject: [PATCH] Improves the fixtures so that they also return info about their dev and peer dependencies Branch: dev-peer-fixtures --- packages/pkg-tests/pkg-tests-fixtures/default-index.js | 8 +++++--- .../packages/dep-loop-entry-1.0.0/index.js | 9 +++++++-- .../packages/dep-loop-exit-1.0.0/index.js | 9 +++++++-- .../pkg-tests-fixtures/packages/dev-deps-1.0.0/index.js | 9 +++++++-- .../packages/dragon-test-1-a-1.0.0/index.js | 9 +++++++-- .../packages/dragon-test-1-b-1.0.0/index.js | 9 +++++++-- .../packages/dragon-test-1-b-2.0.0/index.js | 9 +++++++-- .../packages/dragon-test-1-c-1.0.0/index.js | 9 +++++++-- .../packages/dragon-test-1-d-1.0.0/index.js | 9 +++++++-- .../packages/dragon-test-1-e-1.0.0/index.js | 9 +++++++-- .../packages/hoisting-peer-check-child-1.0.0/index.js | 9 +++++++-- .../packages/hoisting-peer-check-parent-1.0.0/index.js | 9 +++++++-- .../pkg-tests-fixtures/packages/no-deps-1.0.0/index.js | 9 +++++++-- .../pkg-tests-fixtures/packages/no-deps-1.0.1/index.js | 9 +++++++-- .../pkg-tests-fixtures/packages/no-deps-1.1.0/index.js | 9 +++++++-- .../pkg-tests-fixtures/packages/no-deps-2.0.0/index.js | 9 +++++++-- .../packages/no-deps-bins-1.0.0/index.js | 9 +++++++-- .../packages/no-deps-bins-2.0.0/index.js | 9 +++++++-- .../packages/no-deps-checked-1.0.0/index.js | 9 +++++++-- .../packages/no-deps-failing-1.0.0/index.js | 9 +++++++-- .../packages/no-deps-scripted-1.0.0/index.js | 9 +++++++-- .../packages/one-deep1-dep-bins/index.js | 9 +++++++-- .../packages/one-deep2-dep-bins-1.0.0/index.js | 9 +++++++-- .../packages/one-fixed-dep-1.0.0/index.js | 9 +++++++-- .../packages/one-fixed-dep-bins-0.0.0/index.js | 9 +++++++-- .../packages/one-fixed-dep-bins-1.0.0/index.js | 9 +++++++-- .../packages/one-fixed-dep-bins-2.0.0/index.js | 9 +++++++-- .../packages/one-fixed-dep-checked-1.0.0/index.js | 9 +++++++-- .../packages/one-fixed-dep-scripted-1.0.0/index.js | 9 +++++++-- .../packages/one-range-dep-1.0.0/index.js | 9 +++++++-- .../packages/various-requires-1.0.0/index.js | 9 +++++++-- 31 files changed, 215 insertions(+), 63 deletions(-) diff --git a/packages/pkg-tests/pkg-tests-fixtures/default-index.js b/packages/pkg-tests/pkg-tests-fixtures/default-index.js index 1aa13242b9..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/default-index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/default-index.js @@ -2,7 +2,9 @@ module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - // $FlowFixMe The whole point of this file is to be dynamic - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/dep-loop-entry-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/dep-loop-entry-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/dep-loop-entry-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/dep-loop-entry-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/dep-loop-exit-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/dep-loop-exit-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/dep-loop-exit-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/dep-loop-exit-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/dev-deps-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/dev-deps-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/dev-deps-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/dev-deps-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-a-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-a-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-a-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-a-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-b-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-b-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-b-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-b-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-b-2.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-b-2.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-b-2.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-b-2.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-c-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-c-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-c-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-c-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-d-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-d-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-d-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-d-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-e-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-e-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-e-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/dragon-test-1-e-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/hoisting-peer-check-child-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/hoisting-peer-check-child-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/hoisting-peer-check-child-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/hoisting-peer-check-child-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/hoisting-peer-check-parent-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/hoisting-peer-check-parent-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/hoisting-peer-check-parent-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/hoisting-peer-check-parent-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.0.1/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.0.1/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.0.1/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.0.1/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.1.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.1.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.1.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-1.1.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-2.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-2.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-2.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-2.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-bins-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-bins-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-bins-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-bins-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-bins-2.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-bins-2.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-bins-2.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-bins-2.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-checked-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-checked-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-checked-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-checked-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-failing-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-failing-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-failing-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-failing-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-scripted-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-scripted-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-scripted-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/no-deps-scripted-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/one-deep1-dep-bins/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/one-deep1-dep-bins/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/one-deep1-dep-bins/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/one-deep1-dep-bins/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/one-deep2-dep-bins-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/one-deep2-dep-bins-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/one-deep2-dep-bins-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/one-deep2-dep-bins-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-0.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-0.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-0.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-0.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-2.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-2.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-2.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-bins-2.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-checked-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-checked-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-checked-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-checked-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-scripted-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-scripted-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-scripted-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/one-fixed-dep-scripted-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/one-range-dep-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/one-range-dep-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/one-range-dep-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/one-range-dep-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } } diff --git a/packages/pkg-tests/pkg-tests-fixtures/packages/various-requires-1.0.0/index.js b/packages/pkg-tests/pkg-tests-fixtures/packages/various-requires-1.0.0/index.js index b375424a4e..a6bf8f5865 100644 --- a/packages/pkg-tests/pkg-tests-fixtures/packages/various-requires-1.0.0/index.js +++ b/packages/pkg-tests/pkg-tests-fixtures/packages/various-requires-1.0.0/index.js @@ -1,5 +1,10 @@ +/* @flow */ + module.exports = require(`./package.json`); -for (const key of Object.keys(module.exports.dependencies || {})) { - module.exports.dependencies[key] = require(key); +for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { + for (const dep of Object.keys(module.exports[key] || {})) { + // $FlowFixMe The whole point of this file is to be dynamic + module.exports[key][dep] = require(dep); + } }