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

Sanitize special characters in the current working dir and resolution base dir#63

Closed
lukastaegert wants to merge 1 commit into
masterfrom
sanitize-cwd
Closed

Sanitize special characters in the current working dir and resolution base dir#63
lukastaegert wants to merge 1 commit into
masterfrom
sanitize-cwd

Conversation

@lukastaegert

Copy link
Copy Markdown
Member

For the moment, this will automatically escape opening and closing parantheses in the current working directory or the resolve parameter so that they are not interpreted as minimatch patterns.

@lukastaegert

Copy link
Copy Markdown
Member Author

Hmm, seems I cannot escape characters on Windows with a backslash, go figure. How do I escape characters on Windows!?

@lukastaegert lukastaegert changed the base branch from master to update-micromatch May 30, 2019 06:02
@lukastaegert lukastaegert changed the base branch from update-micromatch to master May 30, 2019 07:57
Comment thread src/createFilter.ts
return resolutionBase === false
? id
: resolve(
sanitizeResolutionBase(

@ForsakenHarmony ForsakenHarmony Jun 6, 2019

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

myb putting the sanitation after the resolve would work to fix the windows issue

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good thinking. Problem is we want to sanitize the resolution base but not the id, as it needs to support micromatch patterns. Let's see if I can think of something.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, that does not seem to be it. I'm really at a loss here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

what can the id be? as in what actually gets resolved here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

id is probably badly named. It is any micromatch pattern the user provides.

@lukastaegert lukastaegert Jun 11, 2019

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

E.g. src/**/*.js should be resolved to something like /Users/moi/project/src/**/*.js on a Unix-like system

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ah ok, wasn't sure resolve would deal with wildcards like that

@lukastaegert lukastaegert force-pushed the sanitize-cwd branch 7 times, most recently from 00bd11b to 16ef1ff Compare June 7, 2019 05:47
@shellscape

Copy link
Copy Markdown
Contributor

We've moved this repo to https://github.com/rollup/plugins. If anyone would like to take up this PR and resubmit it there, we'd welcome it.

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.

3 participants