diegohaz/generact

Bug: Windows generact

Geczy opened this issue · 7 comments

Geczy commented

image

This shouldn't be happening. It works perfect in a unix environment but not my windows 10

This seems to be a problem with this function: https://github.com/diegohaz/generact/blob/master/src/utils.js#L11-L20

I don't have a Windows machine to test it. Could you try to change it?

still not working on Windows 10 even not the extension of vs code.

Hi, guys. I'd appreciate very much if some Windows user could take this.

The problem seems to be with this function:

generact/src/utils.js

Lines 12 to 21 in 638f952

export const getComponentName = (path: string): string => (
path.split('/').reduce((name, part) => {
if (/^[A-Z]/.test(part)) {
return removeExt(part)
} else if (/^((?!index).+)\.[^.]+$/.test(part)) {
return upperFirst(camelCase(removeExt(part)))
}
return name
}, '')
)

I am willing to contribute please guide me how to setup the basic environment and how to test it.

Sure, @Shhzdmrz.

  1. Fork the repo and clone it in your local machine (git clone https://github.com/Shhzdmrz/generact);
  2. Change to the directory: cd generact;
  3. Install dependencies with yarn or npm install;
  4. Run tests with yarn test or npm test (if you're on Windows, some should fail);
  5. Keep tests running with yarn test --watch or npm test -- --watch;
  6. Update the code in src trying to make tests to pass.

Just make sure to run yarn lint before creating the PR.

@diegohaz please check my forked branch with the comments I added.