nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: couds/react-bulma-components
Pull request #26 (2018-05-10 19:41:58)

Add export statement for breadcrumb component

couds: Thanks for your PR. Can you update the test snapshots? `npm test -- -u`

Patch:
diff --git a/src/index.js b/src/index.js
index 280a0b9..9af3bce 100644
--- a/src/index.js
+++ b/src/index.js
@@ -3,6 +3,7 @@ import * as Form from './components/form';
 
 export { default as Box } from './components/box';
 export { default as Button } from './components/button';
+export { default as Breadcrumb } from './components/breadcrumb';
 export { default as Card } from './components/card';
 export { default as Columns } from './components/columns';
 export { default as Container } from './components/container';


Test patch:
diff --git a/src/__test__/__snapshots__/index.test.js.snap b/src/__test__/__snapshots__/index.test.js.snap
index 2f97e6f..de581f6 100644
--- a/src/__test__/__snapshots__/index.test.js.snap
+++ b/src/__test__/__snapshots__/index.test.js.snap
@@ -3,6 +3,7 @@
 exports[`ReactBulmaComponents component Should Exports all components 1`] = `
 Object {
   "Box": [Function],
+  "Breadcrumb": [Function],
   "Button": [Function],
   "Card": [Function],
   "Columns": [Function],
Repository: couds/react-bulma-components
Pull request #31 (2018-05-14 15:39:26)

Headings subtitle fix
- expected: produce `<h1 class="title ...">`
- actual: produces `<h1 class="title subtitle ...">`


coveralls: 
[![Coverage Status](https://coveralls.io/builds/16972234/badge)](https://coveralls.io/builds/16972234)

Coverage remained the same at 98.469% when pulling **25c8de083f9cf988bbb124759da5de67b06202d2 on DimitarChristoff:headings-subtitle-fix** into **f100f59e790a658503665f5a650762f1fcfd5ccb on couds:master**.


Patch:
diff --git a/src/components/heading/heading.js b/src/components/heading/heading.js
index 892e48e..faa1158 100644
--- a/src/components/heading/heading.js
+++ b/src/components/heading/heading.js
@@ -43,7 +43,7 @@ export default class Heading extends PureComponent {
         {...props}
         className={classnames(className, {
           title: !subtitle && !heading,
-          subtitle: !heading,
+          subtitle,
           heading,
           [`is-${size}`]: size,
           'is-spaced': spaced && !subtitle,


Test patch:
diff --git a/src/components/heading/__test__/__snapshots__/heading.test.js.snap b/src/components/heading/__test__/__snapshots__/heading.test.js.snap
index 78e9631..ad928e2 100644
--- a/src/components/heading/__test__/__snapshots__/heading.test.js.snap
+++ b/src/components/heading/__test__/__snapshots__/heading.test.js.snap
@@ -11,7 +11,7 @@ exports[`Heading component Should be a subtitle with size rendered as P 1`] = `
 
 exports[`Heading component Should be spaced 1`] = `
 <p
-  className="title subtitle is-spaced"
+  className="title is-spaced"
   style={Object {}}
 >
   Subtitle
@@ -20,7 +20,7 @@ exports[`Heading component Should be spaced 1`] = `
 
 exports[`Heading component Should concat classname in props with Bulma classname 1`] = `
 <h1
-  className="other-class this-is-a-test title subtitle"
+  className="other-class this-is-a-test title"
   style={Object {}}
 >
   <p>
@@ -33,7 +33,7 @@ exports[`Heading component Should exist 1`] = `[Function]`;
 
 exports[`Heading component Should have title classname 1`] = `
 <h1
-  className="title subtitle"
+  className="title"
   style={Object {}}
 >
   Test 
@@ -54,7 +54,7 @@ exports[`Heading component Should not be spaced because is subtitle 1`] = `
 
 exports[`Heading component Should use inline styles 1`] = `
 <h1
-  className="title subtitle"
+  className="title"
   style={
     Object {
       "height": 250,
Repository: couds/react-bulma-components
Pull request #46 (2018-06-19 02:40:34)

add static class to static buttons


Patch:
diff --git a/src/components/button/button.js b/src/components/button/button.js
index 9eaecd0..e0cc790 100644
--- a/src/components/button/button.js
+++ b/src/components/button/button.js
@@ -107,6 +107,7 @@ export default class Button extends PureComponent {
           [`is-${color}`]: color,
           [`is-${size}`]: size,
           [`is-${state}`]: state,
+          'is-static': isStatic,
           'is-outlined': outlined,
           'is-inverted': inverted,
           'is-fullwidth': fullwidth,
diff --git a/src/components/form/components/input.js b/src/components/form/components/input.js
index fc61178..50bbe74 100644
--- a/src/components/form/components/input.js
+++ b/src/components/form/components/input.js
@@ -10,7 +10,7 @@ export default class Input extends PureComponent {
   static propTypes = {
     className: PropTypes.string,
     style: PropTypes.shape({}),
-    type: PropTypes.oneOf(['text', 'email', 'tel', 'password', 'number']),
+    type: PropTypes.oneOf(['text', 'email', 'tel', 'password', 'number', 'search']),
     size: PropTypes.oneOf(['small', 'medium', 'large']),
     color: PropTypes.oneOf(colors),
     readOnly: PropTypes.bool,


Test patch:
diff --git a/src/components/button/__test__/__snapshots__/button.test.js.snap b/src/components/button/__test__/__snapshots__/button.test.js.snap
index 18f21cc..417ff01 100644
--- a/src/components/button/__test__/__snapshots__/button.test.js.snap
+++ b/src/components/button/__test__/__snapshots__/button.test.js.snap
@@ -73,7 +73,7 @@ exports[`Button component Should render as a html button 1`] = `
 
 exports[`Button component Should render as a static Button 1`] = `
 <span
-  className="is-primary button"
+  className="is-primary is-static button"
   disabled={false}
   onClick={[Function]}
   style={Object {}}
Repository: couds/react-bulma-components
Pull request #104 (2018-11-06 22:37:57)

Fix Checkbox component to propagate checked state
Problem:

The Checkbox component lists `checked` as a `prop`, but it doesn't actually set the `checked` attribute of its `<input>`. 

Solution:

This PR propagates the checked state to the input.

epall: @couds Looks like something glitched with the Travis build.
coveralls: 
[![Coverage Status](https://coveralls.io/builds/19993444/badge)](https://coveralls.io/builds/19993444)

Coverage remained the same at 99.118% when pulling **8d38f3b649af1ec9f73bf73a199ac866170b59da on epall:master** into **5cdf6b2cde754b2a774a4766a43e7c081c22c864 on couds:master**.


Patch:
diff --git a/src/components/form/components/checkbox.js b/src/components/form/components/checkbox.js
index 033a8dc..c56520f 100644
--- a/src/components/form/components/checkbox.js
+++ b/src/components/form/components/checkbox.js
@@ -26,6 +26,7 @@ const Checkbox = ({
         type="checkbox"
         value={value}
         disabled={disabled}
+        checked={checked}
       />
       {children}
     </label>


Test patch:
diff --git a/src/components/form/components/__test__/__snapshots__/checkbox.test.js.snap b/src/components/form/components/__test__/__snapshots__/checkbox.test.js.snap
index 544192f..d032ef4 100644
--- a/src/components/form/components/__test__/__snapshots__/checkbox.test.js.snap
+++ b/src/components/form/components/__test__/__snapshots__/checkbox.test.js.snap
@@ -9,6 +9,7 @@ exports[`Checkbox component Should have checkbox classname 1`] = `
   style={Object {}}
 >
   <input
+    checked={false}
     disabled={false}
     name={null}
     type="checkbox"
diff --git a/src/components/form/components/__test__/checkbox.test.js b/src/components/form/components/__test__/checkbox.test.js
index f1acdd2..dfa857e 100644
--- a/src/components/form/components/__test__/checkbox.test.js
+++ b/src/components/form/components/__test__/checkbox.test.js
@@ -23,4 +23,8 @@ describe('Checkbox component', () => {
     component.find('input').simulate('change');
     expect(spy).toHaveBeenCalledTimes(1);
   });
+  it('Should set input checked if checked', () => {
+    const component = shallow(<Checkbox checked />);
+    expect(component.find('input').is('[checked]')).toBe(true);
+  });
 });
Repository: couds/react-bulma-components
Pull request #218 (2019-10-25 02:01:48)

Fix/input file
I am using InputFile, but it seems that having a value="" prop on the &lt;input type="file"/&gt; component prevents accessing or posting the selected file's contents.

See this demo using v3.1.3: https://glitch.com/~ambitious-soursop

I removed that line from src/components/form/components/input-file.js and its test snapshot, and that seems to have fixed the problem. 

See demo with this change: https://glitch.com/~canyon-hotel

coveralls: 
[![Coverage Status](https://coveralls.io/builds/26539125/badge)](https://coveralls.io/builds/26539125)

Coverage remained the same at 98.153% when pulling **8393c34d48646378903372617361f7abe8080014 on mattkenney:fix/input-file** into **5d103ef780e9ba3387cdbbc33d303a66c71ff247 on couds:master**.


Patch:
diff --git a/src/components/form/components/input-file.js b/src/components/form/components/input-file.js
index d343e6d..59de711 100644
--- a/src/components/form/components/input-file.js
+++ b/src/components/form/components/input-file.js
@@ -63,7 +63,6 @@ export default class InputFile extends PureComponent {
           <input
             {...inputProps}
             name={name}
-            value=""
             type="file"
             className="file-input"
             onChange={this.select}


Test patch:
diff --git a/src/components/form/__test__/__snapshots__/file-input.test.js.snap b/src/components/form/__test__/__snapshots__/file-input.test.js.snap
index c83dd58..d1a5c83 100644
--- a/src/components/form/__test__/__snapshots__/file-input.test.js.snap
+++ b/src/components/form/__test__/__snapshots__/file-input.test.js.snap
@@ -13,7 +13,6 @@ exports[`Dropdown component Should render file input tree 1`] = `
       className="file-input"
       onChange={[Function]}
       type="file"
-      value=""
     />
     <span
       className="file-cta"
@@ -42,7 +41,6 @@ exports[`Dropdown component should pass file attributes 1`] = `
       multiple={true}
       onChange={[Function]}
       type="file"
-      value=""
     />
     <span
       className="file-cta"
Repository: netlify/zip-it-and-ship-it
Pull request #117 (2020-05-29 12:36:36)

Fix parsing invalid `require()`
Netlify Functions that do weird/invalid `require()` like `require('@scope')` currently fail with:

```
Cannot read property 'startsWith' of null 
```

[Bugsnag error](https://app.bugsnag.com/netlify/netlify-build/errors/5ed069ee275ecb0017438a5a).

This PR fixes this, and add a test for it.


Patch:
diff --git a/src/dependencies.js b/src/dependencies.js
index f2b0569..46b4621 100644
--- a/src/dependencies.js
+++ b/src/dependencies.js
@@ -74,6 +74,12 @@ const getLocalImportDependencies = async function(dependency, basedir, packageJs
 const getModuleDependencies = async function(dependency, basedir, state, packageJson) {
   const moduleName = requirePackageName(dependency.replace(BACKSLASH_REGEXP, '/'))
 
+  // Happens when doing require("@scope") (not "@scope/name") or other oddities
+  // Ignore those.
+  if (moduleName === null) {
+    return []
+  }
+
   try {
     return await getModuleNameDependencies(moduleName, basedir, state)
   } catch (error) {
diff --git a/src/fixtures/invalid-require/function.js b/src/fixtures/invalid-require/function.js
new file mode 100644
index 0000000..2573611
--- /dev/null
+++ b/src/fixtures/invalid-require/function.js
@@ -0,0 +1,7 @@
+// eslint-disable-next-line no-constant-condition
+if (false) {
+  // eslint-disable-next-line node/no-missing-require
+  require('@scope')
+}
+
+module.exports = true


Test patch:
diff --git a/src/main.test.js b/src/main.test.js
index 571c45b..ab753d8 100644
--- a/src/main.test.js
+++ b/src/main.test.js
@@ -108,6 +108,10 @@ test('Throws on missing non-optional peer dependencies', async t => {
   await t.throwsAsync(zipNode(t, 'node-module-peer-not-optional'))
 })
 
+test('Ignore invalid require()', async t => {
+  await zipNode(t, 'invalid-require')
+})
+
 test('Can require local files', async t => {
   await zipNode(t, 'local-require')
 })
Repository: netlify/zip-it-and-ship-it
Pull request #173 (2020-07-30 12:41:35)

Fix `extension` returned by `listFunctionsFiles()`
`listFunctionsFiles()` should return the file extension of each required file. At the moment, it returns the file extension of the Function's main file instead.


Patch:
diff --git a/src/fixtures/list/two/three.js b/src/fixtures/list/two/three.js
deleted file mode 100644
index 33c1891..0000000
--- a/src/fixtures/list/two/three.js
+++ /dev/null
@@ -1,1 +0,0 @@
-module.exports = true
diff --git a/src/fixtures/list/two/three.json b/src/fixtures/list/two/three.json
new file mode 100644
index 0000000..27ba77d
--- /dev/null
+++ b/src/fixtures/list/two/three.json
@@ -0,0 +1,1 @@
+true
diff --git a/src/fixtures/list/two/two.js b/src/fixtures/list/two/two.js
index e973b7f..14a47da 100644
--- a/src/fixtures/list/two/two.js
+++ b/src/fixtures/list/two/two.js
@@ -1,1 +1,1 @@
-module.exports = require('./three')
+module.exports = require('./three.json')
diff --git a/src/main.js b/src/main.js
index 21e2215..14c1f74 100644
--- a/src/main.js
+++ b/src/main.js
@@ -152,7 +152,7 @@ const getListedFunction = function({ runtime, mainFile, extension }) {
 
 const getListedFunctionFiles = async function({ runtime, filename, stat, mainFile, extension, srcPath, srcDir }) {
   const srcFiles = await getSrcFiles({ runtime, filename, stat, mainFile, extension, srcPath, srcDir })
-  return srcFiles.map(srcFile => ({ srcFile, mainFile, runtime, extension }))
+  return srcFiles.map(srcFile => ({ srcFile, mainFile, runtime, extension: extname(srcFile) }))
 }
 
 const getSrcFiles = function({ runtime, filename, stat, mainFile, extension, srcPath, srcDir }) {


Test patch:
diff --git a/src/main.test.js b/src/main.test.js
index 54b1066..b377865 100644
--- a/src/main.test.js
+++ b/src/main.test.js
@@ -297,7 +297,7 @@ test('Can list all function files with listFunctionsFiles()', async t => {
       { mainFile: 'test', runtime: 'go', extension: '', srcFile: 'test' },
       { mainFile: 'test.js', runtime: 'js', extension: '.js', srcFile: 'test.js' },
       { mainFile: 'test.zip', runtime: 'js', extension: '.zip', srcFile: 'test.zip' },
-      { mainFile: 'two/two.js', runtime: 'js', extension: '.js', srcFile: 'two/three.js' },
+      { mainFile: 'two/two.js', runtime: 'js', extension: '.json', srcFile: 'two/three.json' },
       { mainFile: 'two/two.js', runtime: 'js', extension: '.js', srcFile: 'two/two.js' }
     ].map(normalizeFiles.bind(null, fixtureDir))
   )
Repository: netlify/zip-it-and-ship-it
Pull request #191 (2020-09-01 15:00:18)

Improve invalid `package.json` error handling
We load the Site `package.json` when bundling Functions in order to know which dependencies are optional, as part of the `require()` search algorithm. When a Site has a `package.json` with invalid JSON, we throw an error.

This PR improves the error message in that case.


Patch:
diff --git a/src/dependencies.js b/src/dependencies.js
index 7116c25..a2ca2b1 100644
--- a/src/dependencies.js
+++ b/src/dependencies.js
@@ -62,7 +62,12 @@ const getPackageJson = function(packageRoot) {
     return {}
   }
 
-  return require(`${packageRoot}/package.json`)
+  const packageJsonPath = `${packageRoot}/package.json`
+  try {
+    return require(packageJsonPath)
+  } catch (error) {
+    throw new Error(`${packageJsonPath} is invalid JSON: ${error.message}`)
+  }
 }
 
 const getFileDependencies = async function(path, packageJson, state) {
diff --git a/src/fixtures/invalid-package-json/function.js b/src/fixtures/invalid-package-json/function.js
new file mode 100644
index 0000000..4ba52ba
--- /dev/null
+++ b/src/fixtures/invalid-package-json/function.js
@@ -0,0 +1,1 @@
+module.exports = {}
diff --git a/src/fixtures/invalid-package-json/package.json.txt b/src/fixtures/invalid-package-json/package.json.txt
new file mode 100644
index 0000000..bce97c0
--- /dev/null
+++ b/src/fixtures/invalid-package-json/package.json.txt
@@ -0,0 +1,1 @@
+{{}


Test patch:
diff --git a/src/main.test.js b/src/main.test.js
index f419f09..5f7b881 100644
--- a/src/main.test.js
+++ b/src/main.test.js
@@ -1,4 +1,4 @@
-const { readFile, chmod, symlink, unlink } = require('fs')
+const { readFile, chmod, symlink, unlink, rename } = require('fs')
 const { tmpdir } = require('os')
 const { normalize } = require('path')
 const { platform } = require('process')
@@ -20,6 +20,7 @@ const pReadFile = promisify(readFile)
 const pChmod = promisify(chmod)
 const pSymlink = promisify(symlink)
 const pUnlink = promisify(unlink)
+const pRename = promisify(rename)
 
 test.after(async () => {
   await del(`${tmpdir()}/zip-it-test*`, { force: true })
@@ -110,6 +111,22 @@ test('Throws on missing non-optional peer dependencies', async t => {
   await t.throwsAsync(zipNode(t, 'node-module-peer-not-optional'))
 })
 
+// We persist `package.json` as `package.json.txt` in git. Otherwise ESLint
+// tries to load when linting sibling JavaScript files. In this test, we
+// temporarily rename it to an actual `package.json`.
+test('Throws on invalid package.json', async t => {
+  const invalidPackageJsonDir = `${FIXTURES_DIR}/invalid-package-json`
+  const srcPackageJson = `${invalidPackageJsonDir}/package.json.txt`
+  const distPackageJson = `${invalidPackageJsonDir}/package.json`
+
+  await pRename(srcPackageJson, distPackageJson)
+  try {
+    await t.throwsAsync(zipNode(t, 'invalid-package-json'), /invalid JSON/)
+  } finally {
+    await pRename(distPackageJson, srcPackageJson)
+  }
+})
+
 test('Ignore invalid require()', async t => {
   await zipNode(t, 'invalid-require')
 })
Repository: netlify/zip-it-and-ship-it
Pull request #388 (2021-03-18 14:22:35)

fix: ignore undefined values when computing function config
**- Summary**

This PR changes the logic for computing the function configuration objects such that `undefined` values are ignored.

**- Test plan**

Added a new test.

**- Description for the changelog**

fix: ignore undefined values when computing function config

**- A picture of a cute animal (not mandatory but encouraged)**

![main-qimg-bea9ae821736573bf7bec505354303f6](https://user-images.githubusercontent.com/4162329/111641748-594eb600-87f5-11eb-9bef-b7f24adf4287.jpg)



Patch:
diff --git a/src/config.js b/src/config.js
index 703bfd7..9fadb9c 100644
--- a/src/config.js
+++ b/src/config.js
@@ -27,7 +27,7 @@ const getConfigForFunction = ({ config, func }) => {
     .sort(({ weight: weightA }, { weight: weightB }) => weightA - weightB)
     .map(({ expression }) => config[expression])
 
-  return mergeOptions.apply({ concatArrays: true }, matches)
+  return mergeOptions.apply({ concatArrays: true, ignoreUndefined: true }, matches)
 }
 
 module.exports = { getConfigForFunction }


Test patch:
diff --git a/tests/main.js b/tests/main.js
index dfe4647..85add87 100644
--- a/tests/main.js
+++ b/tests/main.js
@@ -755,6 +755,45 @@ testBundlers(
   },
 )
 
+testBundlers(
+  'Ignores `undefined` values when computing the configuration object for a function',
+  [ESBUILD],
+  async (bundler, t) => {
+    const externalNodeModules = ['test-1', 'test-2', 'test-3']
+    const config = {
+      '*': {
+        externalNodeModules,
+        nodeBundler: bundler,
+      },
+
+      function_one: {
+        externalNodeModules: undefined,
+        nodeBundler: undefined,
+      },
+    }
+
+    const { files, tmpDir } = await zipNode(t, 'config-apply-1', { length: 3, opts: { config } })
+    const requires = await Promise.all([
+      getRequires({ filePath: resolve(tmpDir, 'src/another_function.js') }),
+      getRequires({ filePath: resolve(tmpDir, 'src/function_two.js') }),
+      getRequires({ filePath: resolve(tmpDir, 'src/function_one.js') }),
+    ])
+
+    t.deepEqual(requires[0], externalNodeModules)
+    t.deepEqual(requires[1], externalNodeModules)
+    t.deepEqual(requires[2], externalNodeModules)
+
+    const matches = ['another_function.zip', 'function_two.zip', 'function_one.zip'].map((zipName) =>
+      // eslint-disable-next-line max-nested-callbacks
+      files.find(({ path }) => path.endsWith(zipName)),
+    )
+
+    t.deepEqual(matches[0].config, { externalNodeModules, nodeBundler: 'esbuild' })
+    t.deepEqual(matches[1].config, { externalNodeModules, nodeBundler: 'esbuild' })
+    t.deepEqual(matches[2].config, { externalNodeModules, nodeBundler: 'esbuild' })
+  },
+)
+
 test('Uses the default Node bundler if no configuration object is supplied', async (t) => {
   const { files, tmpDir } = await zipNode(t, 'local-node-module')
   const requires = await getRequires({ filePath: resolve(tmpDir, 'src/function.js') })