Skip to content

refactor(kit,nuxt,vite,webpack)!: remove legacy require utils in favour ofjiti #28008

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

Merged
merged 6 commits into from
Jul 3, 2024

Conversation

danielroe
Copy link
Member

🔗 Linked issue

📚 Description

This follows up on #27995 to remove legacy CJS utils and rely on jiti to resolve/import modules and postcss plugins.

We use resolvePath from mlly in other places which we might leave in place as it has lower overhead.

👉 Modules should now support Nuxt aliases! 🙌

🚨 Breaking changes

Internal CJS utils (marked as deprecated) have now been removed. They were never meant for external use anyway. We could add an example to the upgrade guide.

@danielroe danielroe requested a review from pi0 July 3, 2024 17:04
@danielroe danielroe self-assigned this Jul 3, 2024
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

socket-security bot commented Jul 3, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/h3-nightly@2.0.0-1718872656.6765a6e None 0 528 kB pi0

🚮 Removed packages: npm/vue-bundle-renderer@2.1.0

View full report↗︎

Copy link

socket-security bot commented Jul 3, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Install scripts npm/esbuild@0.20.2
  • orphan: npm/esbuild@0.20.2
🚫
Install scripts npm/esbuild@0.21.5
  • orphan: npm/esbuild@0.21.5
🚫
Install scripts npm/esbuild@0.23.0
  • orphan: npm/esbuild@0.23.0
🚫

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/esbuild@0.20.2
  • @SocketSecurity ignore npm/esbuild@0.21.5
  • @SocketSecurity ignore npm/esbuild@0.23.0

@danielroe danielroe merged commit 7919356 into main Jul 3, 2024
38 of 40 checks passed
@danielroe danielroe deleted the refactor/legacy-require branch July 3, 2024 20:12
@github-actions github-actions bot mentioned this pull request Jul 3, 2024
pluginFn = requireModule(pluginName, { paths: [cwd] })
}
const path = jiti.esmResolve(pluginName)
const pluginFn = (await jiti.import(path)) as (opts: Record<string, any>) => Plugin
Copy link
Member

Choose a reason for hiding this comment

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

jiti will do esmResolve i think in module.ts only reason was that we need to also reuse same path in resolved meta

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

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy