Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell build directive #57

Merged
merged 14 commits into from Apr 23, 2019
30 changes: 4 additions & 26 deletions .pnp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/acceptance-tests/berry.setup.js
@@ -1,6 +1,7 @@
/* @flow */

const {delimiter} = require(`path`);
const isWsl = require(`is-wsl`);

const {
tests: {generatePkgDriver, startPackageServer, getPackageRegistry},
Expand Down Expand Up @@ -50,7 +51,7 @@ global.makeTemporaryEnv = generatePkgDriver({
},
});

if (process.platform === `win32`) {
if (process.platform === `win32` || isWsl) {
jest.setTimeout(10000);
}

Expand Down
3 changes: 2 additions & 1 deletion packages/acceptance-tests/package.json
Expand Up @@ -8,7 +8,8 @@
],
"dependencies": {
"@berry/fslib": "workspace:*",
"@berry/monorepo": "workspace:*"
"@berry/monorepo": "workspace:*",
"is-wsl": "^1.1.0"
},
"scripts": {
"test:integration": "run test:unit --config \"$(pwd)/jest.config.js\""
Expand Down
Expand Up @@ -137,7 +137,7 @@ exports.createTemporaryFolder = function createTemporaryFolder(name?: string): P
dirPath = posix.join(dirPath, name);
await exports.mkdirp(dirPath);
}

return dirPath;
});
};
Expand Down
@@ -1,5 +1,5 @@
const {Minimatch} = require('minimatch');
const path = require('path');
const {posix} = require('path');

exports.stringPatternMatch = function stringPatternMatch(
string: string,
Expand Down Expand Up @@ -37,7 +37,7 @@ exports.filePatternMatch = function filePatternMatch(
patterns: Array<string>,
{matchBase = true, dot = true}: {matchBase?: boolean, dot?: boolean} = {},
): boolean {
return exports.stringPatternMatch(path.resolve('/', filePath), patterns, {matchBase, dot});
return exports.stringPatternMatch(posix.resolve('/', filePath), patterns, {matchBase, dot});
};

exports.parseJsonStream = function parseJsonStream(
Expand Down
@@ -0,0 +1,10 @@
/* @flow */

module.exports = require(`./package.json`);

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);
}
}
@@ -0,0 +1,7 @@
{
"name": "binding-gyp-scripts",
"version": "1.0.0",
"dependencies": {
"node-gyp": "^1.0.0"
}
}
@@ -0,0 +1,10 @@
/* @flow */

module.exports = require(`./package.json`);

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);
}
}
@@ -0,0 +1,7 @@
{
"name": "inject-node-gyp",
"version": "1.0.0",
"scripts": {
"install": "node-gyp help"
}
}
@@ -0,0 +1,10 @@
/* @flow */

module.exports = require(`./package.json`);

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);
}
}
@@ -0,0 +1,4 @@
const fs = require('fs');
const path = require('path');

fs.writeFileSync('build.node', `${process.cwd()}${path.sep}build.node`);
@@ -0,0 +1,7 @@
{
"name": "node-gyp",
"version": "1.0.0",
"bin": {
"node-gyp": "./node-gyp.js"
}
}