Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Fix aliasing with path.resolve() issue on windows - #22

Merged
Rich-Harris merged 6 commits into
rollup:masterfrom
mhhegazy:fix-windows-resolved-alias
Oct 19, 2017
Merged

Fix aliasing with path.resolve() issue on windows#22
Rich-Harris merged 6 commits into
rollup:masterfrom
mhhegazy:fix-windows-resolved-alias

Conversation

@mhhegazy

@mhhegazy mhhegazy commented May 15, 2017

Copy link
Copy Markdown
Contributor

@Rich-Harris Could you take a look?

Added 3 test cases:

  • Platform path.resolve('file-without-extension') aliasing
  • Windows absolute path aliasing
  • Platform path.resolve('file-with.ext') aliasing

This fix:

And Closes #11

mhhegazy added 2 commits May 15, 2017 08:00
added 3 test cases:
- alias with path.resolve() with file without extention
- alias with windows absolute path
- alias with path.resolve() with file with extention
passes test cases:
- Platform path.resolve('file-without-extension') aliasing
- Windows absolute path aliasing
- Platform path.resolve('file-with.ext') aliasing
Comment thread test/index.js Outdated
@@ -1,10 +1,11 @@
import test from 'ava';
import { posix as path } from 'path';
import paltformPath, { posix as path } from 'path';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be platformPath?

@frostney

frostney commented May 22, 2017

Copy link
Copy Markdown
Contributor

I'm not sure platformPath is a good export name here to be honest. I would rather prefer import path, { posix } from 'path' and change the path references to posix.

Let know what you think @mhhegazy

@mhhegazy

Copy link
Copy Markdown
Contributor Author

@frostney I agree this will be more clear

@mhhegazy

Copy link
Copy Markdown
Contributor Author

@frostney please rerun checks again; it was broken because of resolved issue on appveyor.

we should resolve this issue as soon as possible because it break build of many projects on windows

@ovirovkin

Copy link
Copy Markdown

@mhhegazy Is there any reason why this fix cannot be pushed?

@mhhegazy

mhhegazy commented Oct 18, 2017

Copy link
Copy Markdown
Contributor Author

@ovirovkin do mean merged? I don't know!

I have tested it in cases that used in react and vue and it worked as desired and this only pull request that resolve this problem.

@mhhegazy

Copy link
Copy Markdown
Contributor Author

@ovirovkin
what issue that bring you here?

is it react build on windows or other issue?

@ovirovkin

ovirovkin commented Oct 18, 2017

Copy link
Copy Markdown

@mhhegazy Yes, it's react build on windows issue. I fixed build as you suggested here: #9540 but it's causing 23 failed tests. So I was wondered can this be merged, to fix an issue properly. I don't know why they are not failing for you, also I have only 1465 tests total and you have 2559 on a screenshots.

@mhhegazy

mhhegazy commented Oct 18, 2017

Copy link
Copy Markdown
Contributor Author

you can try to clone PR repo (https://github.com/mhhegazy/react.git) and build it and tell me what is the result of build and test.
which tests are failing?

@Rich-Harris
Rich-Harris merged commit c7770dd into rollup:master Oct 19, 2017
@Rich-Harris

Copy link
Copy Markdown
Contributor

thanks all, LGTM. Will cut a new release soon

@ovirovkin

Copy link
Copy Markdown

@mhhegazy Thanks for your help, your branch looks better. But there is still 2 suits are failing. Results:

Summary of all failing tests
 FAIL  src\renderers\dom\shared\__tests__\ReactDOMServerIntegration-test.js
  ● Test suite failed to run

    C:\Users\User\Documents\react-test\react\src\renderers\dom\shared\__tests__\ReactDOMServerIntegration-test.js:41
    async function expectErrors(fn, count) {
          ^^^^^^^^

    SyntaxError: Unexpected token function

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:292:17)
      at undefined.next (native)
      at handle (node_modules/worker-farm/lib/child/index.js:44:8)
      at process.<anonymous> (node_modules/worker-farm/lib/child/index.js:51:3)
      at emitTwo (events.js:106:13)
      at process.emit (events.js:191:7)
      at process.nextTick (internal/child_process.js:787:12)
      at _combinedTickCallback (internal/process/next_tick.js:73:7)
      at process._tickCallback (internal/process/next_tick.js:104:9)


 FAIL  src\renderers\__tests__\ReactComponent-test.js
  ● Test suite failed to run

    C:\Users\User\Documents\react-test\react\src\renderers\__tests__\ReactComponent-test.js:429
      it('throws if a plain object is used as a child when using SSR', async function () {
                                                                       ^^^^^

    SyntaxError: missing ) after argument list

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:292:17)
      at undefined.next (native)
      at handle (node_modules/worker-farm/lib/child/index.js:44:8)
      at process.<anonymous> (node_modules/worker-farm/lib/child/index.js:51:3)
      at emitTwo (events.js:106:13)
      at process.emit (events.js:191:7)
      at process.nextTick (internal/child_process.js:787:12)
      at _combinedTickCallback (internal/process/next_tick.js:73:7)
      at process._tickCallback (internal/process/next_tick.js:104:9)

@mhhegazy

Copy link
Copy Markdown
Contributor Author

I will take a look at it,
this not related to the build or rollup-plugin-alias so let complete conversation on react/react#9540

@ovirovkin

Copy link
Copy Markdown

@mhhegazy Thank you, I really appreciate your help.

@mhhegazy

Copy link
Copy Markdown
Contributor Author

@ovirovkin you are welcome, I'll get into testing in next weekend,
but for now could you approve that build completed successfully here react/react#10982

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Could not load F:\tinybear\tinybearLab\rollup\libs/m1" in windows

4 participants