| 1 |
// generated from test/fixtures/testing-rebuild-bundle |
| 2 |
module.exports = t => { |
| 3 |
const path = t.testdir({ |
| 4 |
"README.md": `- \`root\` depends on \`parent\` |
| 5 |
- \`parent\` bundles \`a\` |
| 6 |
- \`a\` depends on \`b\` |
| 7 |
- \`b\` has a build script |
| 8 |
|
| 9 |
Should get rebuilt if \`rebuildBundle\` is true, otherwise not. |
| 10 |
`, |
| 11 |
"a": { |
| 12 |
"node_modules": { |
| 13 |
".package-lock.json": JSON.stringify({ |
| 14 |
"name": "@isaacs/testing-rebuild-bundle-a", |
| 15 |
"version": "1.0.2", |
| 16 |
"lockfileVersion": 2, |
| 17 |
"requires": true, |
| 18 |
"packages": { |
| 19 |
"node_modules/@isaacs/testing-rebuild-bundle-b": { |
| 20 |
"version": "1.0.1", |
| 21 |
"resolved": "https://registry.npmjs.org/@isaacs/testing-rebuild-bundle-b/-/testing-rebuild-bundle-b-1.0.1.tgz", |
| 22 |
"integrity": "sha512-Uk8u/2pQYJ2LRdm0bZB6k2MTxwtLJyZVfTHTFNR2pxirl9TPCLoRkGozbzwDV7n2V9pMwC26Oy230NoAml9tQg==", |
| 23 |
"hasInstallScript": true, |
| 24 |
"inBundle": true |
| 25 |
} |
| 26 |
} |
| 27 |
}), |
| 28 |
"@isaacs": { |
| 29 |
"testing-rebuild-bundle-b": { |
| 30 |
"package.json": JSON.stringify({ |
| 31 |
"name": "@isaacs/testing-rebuild-bundle-b", |
| 32 |
"version": "1.0.1", |
| 33 |
"scripts": { |
| 34 |
"install": "node -e \"require('fs').writeFileSync('cwd', process.cwd())\"" |
| 35 |
} |
| 36 |
}) |
| 37 |
} |
| 38 |
} |
| 39 |
}, |
| 40 |
"package-lock.json": JSON.stringify({ |
| 41 |
"name": "@isaacs/testing-rebuild-bundle-a", |
| 42 |
"version": "1.0.2", |
| 43 |
"lockfileVersion": 2, |
| 44 |
"requires": true, |
| 45 |
"packages": { |
| 46 |
"": { |
| 47 |
"name": "@isaacs/testing-rebuild-bundle-a", |
| 48 |
"version": "1.0.2", |
| 49 |
"bundleDependencies": [ |
| 50 |
"@isaacs/testing-rebuild-bundle-b" |
| 51 |
], |
| 52 |
"dependencies": { |
| 53 |
"@isaacs/testing-rebuild-bundle-b": "" |
| 54 |
} |
| 55 |
}, |
| 56 |
"node_modules/@isaacs/testing-rebuild-bundle-b": { |
| 57 |
"version": "1.0.1", |
| 58 |
"resolved": "https://registry.npmjs.org/@isaacs/testing-rebuild-bundle-b/-/testing-rebuild-bundle-b-1.0.1.tgz", |
| 59 |
"integrity": "sha512-Uk8u/2pQYJ2LRdm0bZB6k2MTxwtLJyZVfTHTFNR2pxirl9TPCLoRkGozbzwDV7n2V9pMwC26Oy230NoAml9tQg==", |
| 60 |
"hasInstallScript": true, |
| 61 |
"inBundle": true |
| 62 |
} |
| 63 |
}, |
| 64 |
"dependencies": { |
| 65 |
"@isaacs/testing-rebuild-bundle-b": { |
| 66 |
"version": "1.0.1", |
| 67 |
"resolved": "https://registry.npmjs.org/@isaacs/testing-rebuild-bundle-b/-/testing-rebuild-bundle-b-1.0.1.tgz", |
| 68 |
"integrity": "sha512-Uk8u/2pQYJ2LRdm0bZB6k2MTxwtLJyZVfTHTFNR2pxirl9TPCLoRkGozbzwDV7n2V9pMwC26Oy230NoAml9tQg==" |
| 69 |
} |
| 70 |
} |
| 71 |
}), |
| 72 |
"package.json": JSON.stringify({ |
| 73 |
"name": "@isaacs/testing-rebuild-bundle-a", |
| 74 |
"version": "1.0.2", |
| 75 |
"dependencies": { |
| 76 |
"@isaacs/testing-rebuild-bundle-b": "" |
| 77 |
}, |
| 78 |
"bundleDependencies": [ |
| 79 |
"@isaacs/testing-rebuild-bundle-b" |
| 80 |
] |
| 81 |
}) |
| 82 |
}, |
| 83 |
"b": { |
| 84 |
"package.json": JSON.stringify({ |
| 85 |
"name": "@isaacs/testing-rebuild-bundle-b", |
| 86 |
"version": "1.0.1", |
| 87 |
"scripts": { |
| 88 |
"install": "node -e \"require('fs').writeFileSync('cwd', process.cwd())\"" |
| 89 |
} |
| 90 |
}) |
| 91 |
}, |
| 92 |
"package-lock.json": JSON.stringify({ |
| 93 |
"name": "@isaacs/testing-rebuild-bundle", |
| 94 |
"version": "1.0.0", |
| 95 |
"lockfileVersion": 2, |
| 96 |
"requires": true, |
| 97 |
"packages": { |
| 98 |
"": { |
| 99 |
"name": "@isaacs/testing-rebuild-bundle", |
| 100 |
"version": "1.0.0", |
| 101 |
"dependencies": { |
| 102 |
"@isaacs/testing-rebuild-bundle-parent": "" |
| 103 |
} |
| 104 |
}, |
| 105 |
"node_modules/@isaacs/testing-rebuild-bundle-a": { |
| 106 |
"version": "1.0.2", |
| 107 |
"resolved": "https://registry.npmjs.org/@isaacs/testing-rebuild-bundle-a/-/testing-rebuild-bundle-a-1.0.2.tgz", |
| 108 |
"integrity": "sha512-iMx/CGv5Z5dHRdeuYDoaCy0Nfgg0ih9G23C4bwoYPbkdXemc8ahbE9AFJ7jCP0u0hm5ZoZiP11FLN1i7ADhRbA==", |
| 109 |
"bundleDependencies": [ |
| 110 |
"@isaacs/testing-rebuild-bundle-b" |
| 111 |
], |
| 112 |
"dependencies": { |
| 113 |
"@isaacs/testing-rebuild-bundle-b": "" |
| 114 |
} |
| 115 |
}, |
| 116 |
"node_modules/@isaacs/testing-rebuild-bundle-a/node_modules/@isaacs/testing-rebuild-bundle-b": { |
| 117 |
"version": "1.0.1", |
| 118 |
"hasInstallScript": true, |
| 119 |
"inBundle": true |
| 120 |
}, |
| 121 |
"node_modules/@isaacs/testing-rebuild-bundle-parent": { |
| 122 |
"version": "1.0.1", |
| 123 |
"resolved": "https://registry.npmjs.org/@isaacs/testing-rebuild-bundle-parent/-/testing-rebuild-bundle-parent-1.0.1.tgz", |
| 124 |
"integrity": "sha512-PM20bXdRox3OOUEC7m0oYrpW3qZIYN+fh+/9TazZrWkfIggkHNnB91mROyPwlc/HvfPYoYHp1CMGPlgUSl3FDQ==", |
| 125 |
"dependencies": { |
| 126 |
"@isaacs/testing-rebuild-bundle-a": "" |
| 127 |
} |
| 128 |
} |
| 129 |
}, |
| 130 |
"dependencies": { |
| 131 |
"@isaacs/testing-rebuild-bundle-a": { |
| 132 |
"version": "1.0.2", |
| 133 |
"resolved": "https://registry.npmjs.org/@isaacs/testing-rebuild-bundle-a/-/testing-rebuild-bundle-a-1.0.2.tgz", |
| 134 |
"integrity": "sha512-iMx/CGv5Z5dHRdeuYDoaCy0Nfgg0ih9G23C4bwoYPbkdXemc8ahbE9AFJ7jCP0u0hm5ZoZiP11FLN1i7ADhRbA==", |
| 135 |
"requires": { |
| 136 |
"@isaacs/testing-rebuild-bundle-b": "" |
| 137 |
}, |
| 138 |
"dependencies": { |
| 139 |
"@isaacs/testing-rebuild-bundle-b": { |
| 140 |
"version": "1.0.1", |
| 141 |
"bundled": true |
| 142 |
} |
| 143 |
} |
| 144 |
}, |
| 145 |
"@isaacs/testing-rebuild-bundle-parent": { |
| 146 |
"version": "1.0.1", |
| 147 |
"resolved": "https://registry.npmjs.org/@isaacs/testing-rebuild-bundle-parent/-/testing-rebuild-bundle-parent-1.0.1.tgz", |
| 148 |
"integrity": "sha512-PM20bXdRox3OOUEC7m0oYrpW3qZIYN+fh+/9TazZrWkfIggkHNnB91mROyPwlc/HvfPYoYHp1CMGPlgUSl3FDQ==", |
| 149 |
"requires": { |
| 150 |
"@isaacs/testing-rebuild-bundle-a": "" |
| 151 |
} |
| 152 |
} |
| 153 |
} |
| 154 |
}), |
| 155 |
"package.json": JSON.stringify({ |
| 156 |
"name": "@isaacs/testing-rebuild-bundle", |
| 157 |
"version": "1.0.0", |
| 158 |
"dependencies": { |
| 159 |
"@isaacs/testing-rebuild-bundle-parent": "" |
| 160 |
}, |
| 161 |
"files": [] |
| 162 |
}), |
| 163 |
"parent": { |
| 164 |
"package-lock.json": JSON.stringify({ |
| 165 |
"name": "@isaacs/testing-rebuild-bundle-parent", |
| 166 |
"version": "1.0.1", |
| 167 |
"lockfileVersion": 2, |
| 168 |
"requires": true, |
| 169 |
"packages": { |
| 170 |
"": { |
| 171 |
"name": "@isaacs/testing-rebuild-bundle-parent", |
| 172 |
"version": "1.0.1", |
| 173 |
"dependencies": { |
| 174 |
"@isaacs/testing-rebuild-bundle-a": "" |
| 175 |
} |
| 176 |
}, |
| 177 |
"node_modules/@isaacs/testing-rebuild-bundle-a": { |
| 178 |
"version": "1.0.2", |
| 179 |
"resolved": "https://registry.npmjs.org/@isaacs/testing-rebuild-bundle-a/-/testing-rebuild-bundle-a-1.0.2.tgz", |
| 180 |
"integrity": "sha512-iMx/CGv5Z5dHRdeuYDoaCy0Nfgg0ih9G23C4bwoYPbkdXemc8ahbE9AFJ7jCP0u0hm5ZoZiP11FLN1i7ADhRbA==", |
| 181 |
"bundleDependencies": [ |
| 182 |
"@isaacs/testing-rebuild-bundle-b" |
| 183 |
], |
| 184 |
"dependencies": { |
| 185 |
"@isaacs/testing-rebuild-bundle-b": "" |
| 186 |
} |
| 187 |
}, |
| 188 |
"node_modules/@isaacs/testing-rebuild-bundle-a/node_modules/@isaacs/testing-rebuild-bundle-b": { |
| 189 |
"version": "1.0.1", |
| 190 |
"hasInstallScript": true, |
| 191 |
"inBundle": true |
| 192 |
} |
| 193 |
}, |
| 194 |
"dependencies": { |
| 195 |
"@isaacs/testing-rebuild-bundle-a": { |
| 196 |
"version": "1.0.2", |
| 197 |
"resolved": "https://registry.npmjs.org/@isaacs/testing-rebuild-bundle-a/-/testing-rebuild-bundle-a-1.0.2.tgz", |
| 198 |
"integrity": "sha512-iMx/CGv5Z5dHRdeuYDoaCy0Nfgg0ih9G23C4bwoYPbkdXemc8ahbE9AFJ7jCP0u0hm5ZoZiP11FLN1i7ADhRbA==", |
| 199 |
"requires": { |
| 200 |
"@isaacs/testing-rebuild-bundle-b": "" |
| 201 |
}, |
| 202 |
"dependencies": { |
| 203 |
"@isaacs/testing-rebuild-bundle-b": { |
| 204 |
"version": "1.0.1", |
| 205 |
"bundled": true |
| 206 |
} |
| 207 |
} |
| 208 |
} |
| 209 |
} |
| 210 |
}), |
| 211 |
"package.json": JSON.stringify({ |
| 212 |
"name": "@isaacs/testing-rebuild-bundle-parent", |
| 213 |
"version": "1.0.1", |
| 214 |
"dependencies": { |
| 215 |
"@isaacs/testing-rebuild-bundle-a": "" |
| 216 |
} |
| 217 |
}) |
| 218 |
} |
| 219 |
}) |
| 220 |
const {utimesSync} = require('fs') |
| 221 |
const n = Date.now() + 10000 |
| 222 |
const {resolve} = require('path') |
| 223 |
|
| 224 |
utimesSync(resolve(path, "a/node_modules/.package-lock.json"), new Date(n), new Date(n)) |
| 225 |
return path |
| 226 |
} |