Navigation Menu

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

fix: replace backslashes with forward slashes from resolved path for … #11366

Merged

Conversation

johannes-z
Copy link
Contributor

…windows environments

Q                       A
Fixed Issues? Fixes #11357
Patch: Bug Fix? Yes
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? No
License MIT

See #11357

@nicolo-ribaudo
Copy link
Member

@johannes-z Could you add a test for this change?

Since the test should only run on windows, you can specify it like it has been done in packages/babel-plugin-transform-react-jsx-development/test/fixtures/windows/classic-runtime-with-source-self-plugins-windows/options.json.

@johannes-z
Copy link
Contributor Author

@nicolo-ribaudo Sure, I can try. I have no experience with the test suite. Are there docs for it? I also would need to know how to run it 😓

@existentialism
Copy link
Member

existentialism commented Apr 2, 2020

@johannes-z check out https://github.com/babel/babel/blob/master/CONTRIBUTING.md#running-lintingtests, and let us know if you run into any problems so we can improve the docs!

Also, feel free to join our Slack if you need any help!

@existentialism existentialism added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Apr 2, 2020
@johannes-z
Copy link
Contributor Author

I'm on Windows here and unable to run the test suite:

$ make test
BABEL_ENV=test yarn --silent eslint scripts packages codemods eslint '*.js' --format=codeframe
'BABEL_ENV' is not recognized as an internal or external command,
operable program or batch file.
mingw32-make: *** [Makefile:112: lint-js] Error 1

@nicolo-ribaudo
Copy link
Member

Try running yarn jest directly.

@johannes-z
Copy link
Contributor Author

johannes-z commented Apr 7, 2020

It worked executing, but I'm getting errors:

 FAIL  packages/babel-plugin-transform-typescript/test/index.js
  ● Test suite failed to run

    Configuration error:

    Could not locate module @babel/code-frame mapped as:
    ......\babel\packages\babel-code-frame.

    Please check your configuration for these entries:
    {
      "moduleNameMapper": {
        "/^@babel\/(?!eslint-)(?!plugin-syntax-async-generators|plugin-syntax-bigint|plugin-syntax-dynamic-import|plugin-syntax-json-strings|plugin-syntax-nullish-coalescing-operator|plugin-syntax-object-rest-spread|plugin-syntax-optional-catch-binding|plugin-syntax-optional-chaining|plugin-syntax-export-namespace-from)([a-zA-Z0-9_-]+)$/": "......\babel\packages\babel-$1"
      },
      "resolver": null
    }

      at createNoMappedModuleFoundError (node_modules/jest-resolve/build/index.js:501:17)

Ok nevermind, I figured it out. The docs should be improved a little for windows. It's quite hard to figure out how everything works if you're not familiar with the project setup:

yarn lerna bootstrap
yarn gulp build
yarn jest babel-plugin-transform-runtime

Now it works.

@nicolo-ribaudo
Copy link
Member

@johannes-z We are thinking about migrating away from make to make it easier for windows users.

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch anyway!

@nicolo-ribaudo nicolo-ribaudo merged commit fbcb251 into babel:master Apr 8, 2020
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 9, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken resolved paths in Windows inside a monorepo
4 participants