-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore: remove type: module
, create openmct-e2e
subpackage
#7590
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7590 +/- ##
==========================================
- Coverage 56.13% 49.99% -6.15%
==========================================
Files 672 672
Lines 27116 27111 -5
Branches 2635 2635
==========================================
- Hits 15222 13554 -1668
- Misses 11567 13230 +1663
Partials 327 327
... and 189 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
@ozyx This is perfect! I tried it with the nirvss project and it now works really well. Thank you! |
3248694
to
14ff6b1
Compare
type: module
, create openmct-e2e
subpackage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! We'll need to let others know who use Open MCT that this will require them updating how they import us. I tested core, and using the accompanying PR, and everything appeared to work well.
b45a127
to
5f9e83d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7590 +/- ##
==========================================
- Coverage 56.60% 49.99% -6.62%
==========================================
Files 672 672
Lines 27120 27120
Branches 2632 2632
==========================================
- Hits 15351 13558 -1793
- Misses 11441 13234 +1793
Partials 328 328
*This pull request uses carry forward flags. Click here to find out more.
... and 192 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
e2e/tests/functional/plugins/importAndExportAsJSON/importAsJson.e2e.spec.mjs
Fixed
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look great. Looks like there are some new conflicts due to all the recent merging, and two github warnings we should address before merge. Thanks!
e2e/tests/functional/plugins/importAndExportAsJSON/exportAsJson.e2e.spec.mjs
Outdated
Show resolved
Hide resolved
e2e/tests/functional/plugins/importAndExportAsJSON/importAsJson.e2e.spec.mjs
Fixed
Show resolved
Hide resolved
78f6e88
to
69ae299
Compare
- we aren't a module... yet
This reverts commit eb14d52.
69ae299
to
a42daad
Compare
@@ -0,0 +1,27 @@ | |||
{ | |||
"name": "openmct-e2e", | |||
"version": "4.0.0-next", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should always match openmct's package.json
. Is there an easy way to manage that based on monorepo tooling?
@@ -15,6 +15,7 @@ const config = { | |||
timeout: 60 * 1000, | |||
webServer: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a .npmignore
file and to ignore *.config.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small changes:
- We should not be exposing all avpFixtures in other projects. viper should never attempt to publish a percy check!
- We need to .npmignore our e2e config files
@ozyx just needs to add |
@@ -0,0 +1,7 @@ | |||
* | |||
!appActions.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're going to want to include the test s but not right now
bad origin on the initial review. All comments were already addressed
Closes #7602
Describe your changes:
Now this is a story all about how our project got flipped, turned upside down--
TL;DR: We took
openmct
totype: 'module'
too soon.A few months back, we converted the entire project to using ESM import/export syntax. We switched the package itself to
type: module
because running unit/e2e tests were failing (as we couldn't useimport
orexport
keywords unless the package was oftype: module
or the file had an*.mjs
extension).Even though our package was of
type: module
, under the hood Webpack was compiling our source using a UMD wrapper which is meant to support imports in both node and browser environments. However, this never worked properly because we set the package type as 'module' (when it really wasn't!). Consumers would attempt toimport
the package only to find that it defined no exports. They would then try torequire
the package, only to be denied under the basis that you cannotrequire
an ESModule. In fact, webpack currently does not support packaging a library as an ESModule. As it stands, webpack is a dead-end foropenmct
as a true ESModule.This PR fixes a ton of misconfiguration with webpack, switches our package type off of
module
, and specifies paths and entry points for bothimport
andrequire
syntax.In addition, and to avoid having to change the extensions of all e2e test files to *.mjs, this PR initializes a new npm sub-package
openmct-e2e
oftype: module
. This package is specified as aworkspace
ofopenmct
, so a singlenode_modules
folder is shared between the two projects (same as it ever was).See the corresponding PRs for
openmct-yamcs
andviper-openmct
.Brief Summary of Changes
e2e
folder from our distributabletype: module
frompackage.json
openmct-e2e
which exports our e2e testing frameworke2e
folder as a workspace toopenmct
so they sharenode_modules
webpack.*.js
->webpack.*.mjs
module
andexports
inpackage.json
--workspace
to call scripts in e2e folder.tsconfig.json
settings to generate TypeScript types indist/types/index.d.ts
as opposed to creating individual files.All Submissions:
Author Checklist
type:
label? Note: this is not necessarily the same as the original issue.Reviewer Checklist