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

SWC produces type definitions in the wrong folder structure #9203

Closed
Jordan-Hall opened this issue Mar 4, 2022 · 7 comments · Fixed by #9240
Closed

SWC produces type definitions in the wrong folder structure #9203

Jordan-Hall opened this issue Mar 4, 2022 · 7 comments · Fixed by #9240

Comments

@Jordan-Hall
Copy link
Contributor

Jordan-Hall commented Mar 4, 2022

I believe @nartc been working on the SWC recently?

Current Behavior

Incorrect output structure.
image

Expected Behavior

The .d.ts file should live next to the generated js files

Steps to Reproduce

Generate a new nrwl/js lib with SWC
Build the project
Test repo:
https://github.com/nxext/nx-extensions/tree/package-angular/packages/angular/vite Building this package produce the above

@nartc
Copy link
Contributor

nartc commented Mar 4, 2022

Try 13.8.4 out

@Jordan-Hall
Copy link
Contributor Author

Try 13.8.4 out

Sorry should of stated the version. It's using 13.8.4. I've updated the other packages and I'm having the same issue

@nartc
Copy link
Contributor

nartc commented Mar 4, 2022

I just clone the project

  • Run yarn
  • Run npx nx build angular-vite

And this is the dist folder

image

dist/packages/angular/vite
├── README.md
├── package.json
└── src
    ├── index.d.ts
    ├── index.js
    ├── index.js.map
    └── lib
        ├── angular-vite-compiler
        │   ├── angular-vite-plugin.d.ts
        │   ├── angular-vite-plugin.js
        │   ├── angular-vite-plugin.js.map
        │   ├── benchmark.d.ts
        │   ├── benchmark.js
        │   ├── benchmark.js.map
        │   ├── cache.d.ts
        │   ├── cache.js
        │   ├── cache.js.map
        │   ├── host.d.ts
        │   ├── host.js
        │   ├── host.js.map
        │   ├── index.d.ts
        │   ├── index.js
        │   ├── index.js.map
        │   ├── ngcc_processor.d.ts
        │   ├── ngcc_processor.js
        │   ├── ngcc_processor.js.map
        │   ├── path.d.ts
        │   ├── path.js
        │   ├── path.js.map
        │   ├── plugin-options.d.ts
        │   ├── plugin-options.js
        │   ├── plugin-options.js.map
        │   ├── resolver.d.ts
        │   ├── resolver.js
        │   ├── resolver.js.map
        │   ├── symbol.d.ts
        │   ├── symbol.js
        │   ├── symbol.js.map
        │   ├── transformation.d.ts
        │   ├── transformation.js
        │   ├── transformation.js.map
        │   ├── transformers
        │   │   ├── elide_imports.d.ts
        │   │   ├── elide_imports.js
        │   │   ├── elide_imports.js.map
        │   │   ├── index.d.ts
        │   │   ├── index.js
        │   │   ├── index.js.map
        │   │   ├── remove-ivy-jit-support-calls.d.ts
        │   │   ├── remove-ivy-jit-support-calls.js
        │   │   ├── remove-ivy-jit-support-calls.js.map
        │   │   ├── replace_resources.d.ts
        │   │   ├── replace_resources.js
        │   │   └── replace_resources.js.map
        │   └── utils
        │       ├── load-tsconfig.d.ts
        │       ├── load-tsconfig.js
        │       ├── load-tsconfig.js.map
        │       ├── optimizer.d.ts
        │       ├── optimizer.js
        │       └── optimizer.js.map
        ├── vite-plugin-angular
        │   ├── index.d.ts
        │   ├── index.js
        │   ├── index.js.map
        │   ├── plugin-options.d.ts
        │   ├── plugin-options.js
        │   ├── plugin-options.js.map
        │   └── utils
        │       ├── optimizer.d.ts
        │       ├── optimizer.js
        │       ├── optimizer.js.map
        │       ├── resolver.d.ts
        │       ├── resolver.js
        │       └── resolver.js.map
        ├── vite.d.ts
        ├── vite.js
        └── vite.js.map

7 directories, 71 files

Maybe try clearing cache? or nuke the node_modules and reinstall?

@Jordan-Hall
Copy link
Contributor Author

Strange. I've just nuked the node_modules and getting the same issue. I'm using my windows laptop :/

@nartc
Copy link
Contributor

nartc commented Mar 4, 2022

Do you have a Unix-based machine to test out?

@Jordan-Hall
Copy link
Contributor Author

Jordan-Hall commented Mar 4, 2022

Do you have a Unix-based machine to test out?

Yea, I'll check it out on my PC in the morning. I was just doing some quick development on the laptop :)

@nartc nartc self-assigned this Mar 9, 2022
nartc pushed a commit that referenced this issue Mar 9, 2022
nartc pushed a commit that referenced this issue Mar 12, 2022
nartc pushed a commit that referenced this issue Mar 18, 2022
nartc pushed a commit that referenced this issue Mar 21, 2022
nartc pushed a commit that referenced this issue Mar 21, 2022
nartc added a commit that referenced this issue Mar 21, 2022
* fix(js): mimic the behavior of tsc compilation for runTypeCheck

ISSUES CLOSED: #9203

* chore(js): add check for type defs files in e2e

Co-authored-by: Chau Tran <ctran@Chaus-MacBook-Pro.local>
FrozenPandaz pushed a commit that referenced this issue Mar 21, 2022
* fix(js): mimic the behavior of tsc compilation for runTypeCheck

ISSUES CLOSED: #9203

* chore(js): add check for type defs files in e2e

Co-authored-by: Chau Tran <ctran@Chaus-MacBook-Pro.local>
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants