Skip to content

Try to fix cosmiconfig in the built version of Prettier - #2930

Merged
lydell merged 1 commit into
prettier:masterfrom
lydell:fix-build
Sep 29, 2017
Merged

lydell merged 1 commit into
prettier:masterfrom
lydell:fix-build

Conversation

@lydell

@lydell lydell commented Sep 28, 2017

Copy link
Copy Markdown
Member

Fixes #2924 (hopefully). Not sure if this is the correct fix, but it seems to work. Please help me test! We should also write integration tests that catch the error...

@ikatyang

Copy link
Copy Markdown
Member

I can't reproduce the issue in this PR, it seems worked.

Not sure how to write tests for it, can we just run tests for bundled version before releasing?


Unrelated question: our CI's NODE_ENV=production job is always failed, what does it want to test for?

@azz

azz commented Sep 29, 2017

Copy link
Copy Markdown
Member

I think it's supposed to run the tests on dist/. cc @josephfrazier

Speculation: I think it is failing because yarn --production=false doesn't do what it did in yarn v0. Maybe switching to NODE_ENV=development yarn or yarn --production=false install will fix it.

@lydell

lydell commented Sep 29, 2017

Copy link
Copy Markdown
Member Author

When running the build scripts, it says this at the end:

How to test against dist:
  1) NODE_ENV=production yarn test

I've tried that, and everything passes. It would be nice to construct a test that would fail there.

Btw, I also need to test this with eslint-plugin-prettier. Might be more rollup:ed files to tweak.

@lydell

lydell commented Sep 29, 2017

Copy link
Copy Markdown
Member Author

I've tested with eslint-plugin-prettier now. I've force-pushed a fix to also do the module.parent thing in index.js.

@lydell

lydell commented Sep 29, 2017

Copy link
Copy Markdown
Member Author

Turns out we don't have to write any new tests: #2932

@azz azz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So sounds like we're good to merge this?

@lydell

lydell commented Sep 29, 2017

Copy link
Copy Markdown
Member Author

It can’t make things worse at least.

@lydell
lydell merged commit 63916be into prettier:master Sep 29, 2017
@lydell
lydell deleted the fix-build branch September 29, 2017 07:27
samouri pushed a commit to Automattic/wp-prettier that referenced this pull request Oct 2, 2017
@lock lock Bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 19, 2019
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.7.2 js module config fails to load

3 participants