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

invert npmignore to include what we want #4605

Merged
merged 23 commits into from
Mar 23, 2022
Merged
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dc94e43
invert npmignore to include what we want
trusktr Dec 17, 2021
801d364
Merge branch 'master' into dont-publish-test-files
trusktr Dec 17, 2021
0329067
Merge branch 'master' into dont-publish-test-files
unlikelyzero Dec 30, 2021
7ba622c
Merge branch 'master' into dont-publish-test-files
trusktr Jan 3, 2022
accce64
Merge branch 'master' into dont-publish-test-files
trusktr Jan 4, 2022
3003f2e
remove line for no-longer-existent src/**/*.spec.js files from npmignore
trusktr Jan 4, 2022
fb2d91c
Merge branch 'master' into dont-publish-test-files
trusktr Jan 4, 2022
938376b
Merge branch 'master' into dont-publish-test-files
trusktr Jan 5, 2022
e0e095d
cleanup npmignore comments
trusktr Jan 5, 2022
6580244
Merge branch 'master' into dont-publish-test-files
unlikelyzero Jan 7, 2022
3afab2d
Merge branch 'master' into dont-publish-test-files
trusktr Jan 13, 2022
39cf0bf
Merge branch 'master' into dont-publish-test-files
shefalijoshi Jan 20, 2022
fb349db
Merge branch 'master' into dont-publish-test-files
unlikelyzero Mar 21, 2022
e1502ac
Merge branch 'master' into dont-publish-test-files
trusktr Mar 22, 2022
16bcdfa
remove platform dirs from npmignore, they were removed from the repo
trusktr Mar 22, 2022
f772a99
Merge branch 'master' into dont-publish-test-files
shefalijoshi Mar 22, 2022
c5a60f9
remove one more platform reference from npmignore
trusktr Mar 23, 2022
ef8f61d
Merge branch 'master' into dont-publish-test-files
jvigliotta Mar 23, 2022
2944845
Merge branch 'master' into dont-publish-test-files
trusktr Mar 23, 2022
8c94f0f
publish example/ and app.js, at least for now
trusktr Mar 23, 2022
c1a547b
Merge branch 'dont-publish-test-files' of github.com:nasa/openmct int…
trusktr Mar 23, 2022
2bb4a07
Merge branch 'master' into dont-publish-test-files
trusktr Mar 23, 2022
fe0a0a8
Merge branch 'master' into dont-publish-test-files
jvigliotta Mar 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 34 additions & 44 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,44 +1,34 @@
*.scssc
*.zip
*.gzip
*.tgz
*.DS_Store

*.sass-cache
*COMPILE.css

# Intellij project configuration files
*.idea
*.iml

# External dependencies

# Build output
target

# Mac OS X Finder
.DS_Store

# Closed source libraries
closed-lib

# Node, Bower dependencies
node_modules
bower_components

Procfile

# Protractor logs
protractor/logs

# npm-debug log
npm-debug.log

# Infra and tests
.circleci
.github
e2e
codecov.yml
lighthouserc.yml
*.Spec.js
karma.conf.js
# Specificty of the following rules matters. If more specific rules comes first,
# less specific rules can not override them.
# For example, the following won't work as you may assume:
# /**/* <-- ignore everything
# !/src/**/* <-- don't ignore src/
# But still ignore test files in src/:
# /**/*.test.* <-- HERE: This won't work, is not as specific as `!/dist/**/*`, so test files inside dist or src will NOT be ignored.
# /src/**/*.test.* <-- But this will work, because it is more specific.

# NOTE! Although we ignored everything by default, NPM will not ignore special files like
# LICENSE.md, README.md, and package.json.

# Ignore everything,
/**/*

# ...but include these folders...
!/dist/**/*
!/src/**/*
!/platform/**/*
trusktr marked this conversation as resolved.
Show resolved Hide resolved

# ...except for these files in the above folders (these rules are more specific, so they will apply).
/src/**/*Spec.js
/src/**/test/
# TODO move test utils into test/ folders
/src/utils/testing.js
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wdyt think about this TODO?

Copy link
Contributor Author

@trusktr trusktr Jan 4, 2022

Choose a reason for hiding this comment

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

/src/utils/testing.js was previously being published to npm.

I added a /src/**/test/ rule ignore anything in test/ folders. It would make sense to put all test files (apart from the specs files that may be co-located with the thing they test) in test/ folders, to make it easier to ignore them without having to modify npmignore.

We can add one-off rules for specific test files to ignore as we go, but I think it would be better to have the test/ folder convention, otherwise it's the same problem this PR aimed to eliminate (but in reverse).

Copy link
Collaborator

Choose a reason for hiding this comment

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

@trusktr maybe we could file an issue for that chance and include a link to that issue in this comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

We have a naming convention of Spec. why can't we use that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shefalijoshi Yes, true that, but multiple spec files like to import test-specific utilities from src/utils/testing.js so I had to specifically ignore that file because it isn't following a catch-all convention. So what I meant above is that instead we could move that file to src/test/utils.js instead, and that way it will fall under the src/**/test/* catch-all instead of having a one-off entry in npmignore.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we do go with this approach, we should add example to this too. It has eventGenerator and generator which a lot of people use to demo OpenMCT

Copy link
Contributor

Choose a reason for hiding this comment

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

If we do go with this approach, we should add example to this too. It has eventGenerator and generator which a lot of people use to demo OpenMCT

@trusktr Please include the example, docs folders and Contributing.md, API.md, app.js as well.
What is the procfile used for?

Copy link
Contributor Author

@trusktr trusktr Jan 31, 2022

Choose a reason for hiding this comment

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

We want to publish all those things in the package on NPM? I figured people can go to the repo for that stuff. People don't normally look for that stuff in node_modules. EDIT: Oh I see @scottbell, so some people will want to import from examples.

Copy link
Contributor Author

@trusktr trusktr Jan 31, 2022

Choose a reason for hiding this comment

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

Do people consume app.js from node_modules? My understanding is we want to obliterate app.js ( @akhenry) and I think it is a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the procfile used for?

https://www.google.com/search?q=procfile&oq=procfile&aqs=edge..69i57.870j0j1&sourceid=chrome&ie=UTF-8

Not sure why we need that. Are we using it on some service? If some downstream project needs it, they should have that in their repo instead.

/platform/**/*Spec.js
/platform/**/test/
trusktr marked this conversation as resolved.
Show resolved Hide resolved

# Also include these top-level files.
!copyright-notice.js
!copyright-notice.html
!index.html
!openmct.js
!SECURITY.md