The Wayback Machine - https://web.archive.org/web/20201207163114/https://github.com/pillarjs/path-to-regexp/pull/220
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

Ignore .spec.ts files when compiling #220

Merged
merged 1 commit into from Mar 1, 2020

Conversation

@jonchurch
Copy link
Member

@jonchurch jonchurch commented Feb 29, 2020

Relates to #219

Assuming the .spec.ts file are not intended to be part of the distribution, they should be ignored when compiling.

@jonchurch jonchurch requested a review from blakeembrey Feb 29, 2020
@jonchurch
Copy link
Member Author

@jonchurch jonchurch commented Feb 29, 2020

To be clear, it looks like the problem is that we are publishing the spec file.

This can also be solved in a different way, where test files are in a specific test folder, which is not included in the files list that is published to npm. After a lot of testing this single line change seems the most elegant.

@jonchurch jonchurch requested a review from wesleytodd Feb 29, 2020
Copy link
Member

@blakeembrey blakeembrey left a comment

Thanks @jonchurch!

@blakeembrey
Copy link
Member

@blakeembrey blakeembrey commented Feb 29, 2020

Dumb question, but can we use the NPM config to ignore these files? Last I recall you couldn't combine .npmignore with files, or put negations in files, but those would be a tiny bit nicer.

@jonchurch
Copy link
Member Author

@jonchurch jonchurch commented Feb 29, 2020

An .npmignore does work, ala dist*/*.spec.*, but then it overrides anything in .gitignore when it comes to publishing.

Since the package is whitelisting with the files field of package.json, it's less of a concern, but still something to keep in mind.

Grrr, I've written, rewritten, and deleted this comment several times now. I'm not having any luck actually with .gitignore or .npmignore.

@blakeembrey
Copy link
Member

@blakeembrey blakeembrey commented Mar 1, 2020

@jonchurch Thanks for exploring! Sorry to put you through that. Let's merge and we can release as is.

@blakeembrey blakeembrey merged commit 0c466b1 into pillarjs:master Mar 1, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jonchurch
Copy link
Member Author

@jonchurch jonchurch commented Mar 1, 2020

Thanks to @StephenTangCook for asking the question!

@blakeembrey
Copy link
Member

@blakeembrey blakeembrey commented Apr 16, 2020

We may need to revert this or do additional work. I realized the other week that by excluding these files, it’s not actually using the right settings for type checking. Not a problem right now, but we should probably have a specific build config instead of changing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.