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

Use package.json exports in Electron-auth #6739

Closed
wants to merge 76 commits into from
Closed

Conversation

hl662
Copy link
Contributor

@hl662 hl662 commented May 21, 2024

Update @itwin/electron-authorization to ^0.19.2
Rush build compiled successfully, but rush cover throws the following error in core-full-stack-tests:

Package subpath './Main' is not defined by "exports" in /Users/hoangnamle/Documents/itwinjs-core/full-stack-tests/core/node_modules/@itwin/electron-authorization/package.json imported from /Users/hoangnamle/Documents/itwinjs-core/full-stack-tests/core/lib/backend/backend.js
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './Main' is not defined by "exports" in /Users/hoangnamle/Documents/itwinjs-core/full-stack-tests/core/node_modules/@itwin/electron-authorization/package.json imported from /Users/hoangnamle/Documents/itwinjs-core/full-stack-tests/core/lib/backend/backend.js
    at exportsNotFound (node:internal/modules/esm/resolve:303:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:593:13)
    at packageResolve (node:internal/modules/esm/resolve:836:14)
    at moduleResolve (node:internal/modules/esm/resolve:910:20)
    at defaultResolve (node:internal/modules/esm/resolve:1130:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36)

Some important changes regarding core-full-stack-tests:
Updated tsconfig.json to include:

    "module": "ESNext",
    "moduleResolution": "Bundler",

And also updated package.json to have a type: module field.

@hl662
Copy link
Contributor Author

hl662 commented May 21, 2024

A follow up PR from #6058

@@ -1,6 +1,8 @@
{
"extends": "./node_modules/@itwin/build-tools/tsconfig-base.json",
"compilerOptions": {
"module": "ESNext",
Copy link
Member

Choose a reason for hiding this comment

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

can you look at seeing if applying these tsconfig settings would help:

    "resolvePackageJsonExports": true /* Use the package.json 'exports' field when resolving package imports. */,
    "resolvePackageJsonImports": true /* Use the package.json 'imports' field when resolving imports. */,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it didn't work - typescript docs mentions they should already be enabled by default, because the moduleResolution in our tsconfig is Bundler

imodeljs-admin and others added 25 commits June 3, 2024 15:07
* Improved formatting and documentations of PolyfaceQuery.ts.
* Improved behavior of dihedralAngleSummary and isConvexByDihedralAngleCount functions and fixed tests accordingly.
* Added md doc for polyface dihedral angles.
* Improved tests.
Co-authored-by: Eric Paquet <EricPaquetB@users.noreply.github.com>
Co-authored-by: pmconne <22944042+pmconne@users.noreply.github.com>
Co-authored-by: imodeljs-admin <38288322+imodeljs-admin@users.noreply.github.com>
…d Profile Upgrades (#6692)

Co-authored-by: Affan Khan <khanaffan@users.noreply.github.com>
Co-authored-by: Arun George <11051042+aruniverse@users.noreply.github.com>
Co-authored-by: imodeljs-admin <38288322+imodeljs-admin@users.noreply.github.com>
Co-authored-by: = <andremig-bentley@users.noreply.github.com>
Co-authored-by: danieliborra <107669762+danieliborra@users.noreply.github.com>
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
Co-authored-by: Arun George <aruniverse@users.noreply.github.com>
imodeljs-admin and others added 28 commits July 2, 2024 11:44
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
Co-authored-by: David Stradley <48810710+DStradley@users.noreply.github.com>
Co-authored-by: StefanApfel <71712332+StefanApfel-Bentley@users.noreply.github.com>
…6893)

Co-authored-by: andremig-bentley <andremig-bentley@users.noreply.github.com>
#6906)

Co-authored-by: yato333 <yato333@users.noreply.github.com>
Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com>
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
…low (#6911)

Co-authored-by: Mike Nguyen <MikeNBentley@users.noreply.github.com>
@hl662
Copy link
Contributor Author

hl662 commented Jul 3, 2024

Dunno what happened here, moving to a new PR #6931 and closing this one.

@hl662 hl662 closed this Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet