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

feat(cli): build user peer-deps #6742

Merged
merged 6 commits into from
May 28, 2024
Merged

feat(cli): build user peer-deps #6742

merged 6 commits into from
May 28, 2024

Conversation

ricokahler
Copy link
Contributor

@ricokahler ricokahler commented May 23, 2024

Description

This PR introduces the buildVendorDependencies function which builds ESM browser-compatible versions of specified vendor packages. It includes a robust mechanism for handling semver versions, carefully considering major, minor, and patch version changes. The rationale is to ensure stability and flexibility by adding support for new subpath exports as needed. Read the TSDoc comment for more info.

What to review

  • Review the buildVendorDependencies function implementation.
  • Verify the handling of semver versions and the rationale for the approach.
  • Check the integration and usage of the fileSystem prop.
  • Ensure the function correctly resolves package.json files and constructs the necessary entry points.
  • Review the unit tests to ensure they cover the function's behavior, including handling different versions and file system interactions.

Testing

  • Unit tests verify the expected options are passed to vite.build along with some new fixtures example project to test that the resolution works as expected.

Notes for release

Not applicable to the release at this time. This should be merged into #6514 first.

@ricokahler ricokahler requested a review from a team as a code owner May 23, 2024 05:01
@ricokahler ricokahler requested review from jtpetty and removed request for a team May 23, 2024 05:01
Copy link

vercel bot commented May 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 5:48pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 5:48pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 5:48pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview May 28, 2024 5:48pm

Copy link

socket-security bot commented May 23, 2024

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

Package New capabilities Transitives Size Publisher
npm/[email protected] Transitive: eval, filesystem +11 4.49 MB odspnpm
npm/[email protected] filesystem Transitive: environment +10 145 kB isaacs
npm/[email protected] Transitive: filesystem, unsafe +3 19.8 kB sindresorhus
npm/[email protected] Transitive: unsafe +1 8.39 kB sindresorhus
npm/[email protected] filesystem Transitive: environment +3 25.6 kB sindresorhus
npm/[email protected] Transitive: environment, filesystem +1 576 kB vitaly
npm/[email protected] None 0 235 kB jordanbtucker
npm/[email protected] None 0 5.34 kB sindresorhus
npm/[email protected] None 0 1.41 MB bnjmnt4n
npm/[email protected] None 0 54.5 kB ljharb
npm/[email protected] None 0 24.4 kB ai
npm/[email protected] None 0 97.2 kB ljharb
npm/[email protected] None +1 13.3 kB sindresorhus
npm/[email protected] unsafe 0 13.5 kB danez
npm/[email protected] Transitive: filesystem +6 48.7 kB sindresorhus
npm/[email protected] environment, filesystem, unsafe 0 8.39 MB prettier-bot
npm/[email protected] None +1 15.6 kB sindresorhus
npm/[email protected] None 0 8.64 kB sindresorhus
npm/[email protected] environment 0 24 kB react-bot
npm/[email protected] Transitive: filesystem +7 106 kB sindresorhus
npm/[email protected] None +9 3.02 MB wooorm
npm/[email protected] filesystem, unsafe 0 5.82 kB sindresorhus
npm/[email protected] None 0 5.61 kB sindresorhus
npm/[email protected] filesystem 0 17.3 kB isaacs
npm/[email protected] None +1 4.59 MB blesh
npm/[email protected] None +2 125 kB npm-cli-ops
npm/[email protected] filesystem +6 59.2 kB mafintosh
npm/[email protected] None 0 32.4 MB typescript-bot
npm/[email protected] None +1 23.7 kB chrisdickinson
npm/[email protected] environment Transitive: filesystem +1 20.9 kB isaacs
npm/[email protected] None 0 5.69 kB sindresorhus

🚮 Removed packages: npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@bjoerge/[email protected], npm/@codemirror/[email protected], npm/@codemirror/[email protected], npm/@codemirror/[email protected], npm/@codemirror/[email protected], npm/@codemirror/[email protected], npm/@codemirror/[email protected], npm/@codemirror/[email protected], npm/@dnd-kit/[email protected], npm/@dnd-kit/[email protected], npm/@dnd-kit/[email protected], npm/@dnd-kit/[email protected], npm/@google-cloud/[email protected], npm/@juggle/[email protected], npm/@lezer/[email protected], npm/@node-ipc/[email protected], npm/@playwright/[email protected], npm/@playwright/[email protected], npm/@portabletext/[email protected], npm/@portabletext/[email protected], npm/@react-three/[email protected], npm/@react-three/[email protected], npm/@react-three/[email protected], npm/@repo/[email protected], npm/@repo/[email protected], npm/@rexxars/[email protected], npm/@rexxars/[email protected], npm/@rexxars/[email protected], npm/@rollup/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@sanity/[email protected], npm/@tanstack/[email protected], npm/@tanstack/[email protected], npm/@testing-library/[email protected], npm/@testing-library/[email protected], npm/@testing-library/[email protected], npm/@turf/[email protected], npm/@turf/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/@uiw/[email protected], npm/@vercel/[email protected], npm/@vercel/[email protected], npm/@vercel/[email protected], npm/@vitejs/[email protected], npm/@vvo/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Copy link

socket-security bot commented May 23, 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 NoteSource
Install scripts npm/[email protected]
Install scripts npm/[email protected]
Install scripts npm/[email protected]
  • Install script: install
  • Source: node install/check

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/[email protected] or ignore all packages with @SocketSecurity ignore-all

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented May 23, 2024

Component Testing Report Updated May 28, 2024 5:55 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 25s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ❌ Failed (Inspect) 1m 18s 20 0 1
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 1s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 21s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 30s 12 0 0

@jtpetty jtpetty requested review from binoy14 and removed request for jtpetty May 23, 2024 13:10
Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

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

Overall it looks good to me, have one question

* feat: create import map w/ installed sanity version

* fix: use correct URL
@ricokahler ricokahler merged commit 527fffb into sdx-1242 May 28, 2024
40 of 41 checks passed
@ricokahler ricokahler deleted the sdx-1349 branch May 28, 2024 18:11
binoy14 pushed a commit that referenced this pull request May 28, 2024
* feat(cli): build user peer-deps

* chore: remove shared-modules build

* test(cli):  verify build config and `exports` subpaths

* text(cli): add depcheck config for fixture projects

* docs: update comments and test name

* feat: create import map w/ installed sanity version (#6784)

* feat: create import map w/ installed sanity version

* fix: use correct URL
binoy14 pushed a commit that referenced this pull request May 29, 2024
* feat(cli): build user peer-deps

* chore: remove shared-modules build

* test(cli):  verify build config and `exports` subpaths

* text(cli): add depcheck config for fixture projects

* docs: update comments and test name

* feat: create import map w/ installed sanity version (#6784)

* feat: create import map w/ installed sanity version

* fix: use correct URL
binoy14 pushed a commit that referenced this pull request May 30, 2024
* feat(cli): build user peer-deps

* chore: remove shared-modules build

* test(cli):  verify build config and `exports` subpaths

* text(cli): add depcheck config for fixture projects

* docs: update comments and test name

* feat: create import map w/ installed sanity version (#6784)

* feat: create import map w/ installed sanity version

* fix: use correct URL
binoy14 pushed a commit that referenced this pull request May 30, 2024
* feat(cli): build user peer-deps

* chore: remove shared-modules build

* test(cli):  verify build config and `exports` subpaths

* text(cli): add depcheck config for fixture projects

* docs: update comments and test name

* feat: create import map w/ installed sanity version (#6784)

* feat: create import map w/ installed sanity version

* fix: use correct URL
binoy14 pushed a commit that referenced this pull request May 31, 2024
* feat(cli): build user peer-deps

* chore: remove shared-modules build

* test(cli):  verify build config and `exports` subpaths

* text(cli): add depcheck config for fixture projects

* docs: update comments and test name

* feat: create import map w/ installed sanity version (#6784)

* feat: create import map w/ installed sanity version

* fix: use correct URL
binoy14 pushed a commit that referenced this pull request Jun 10, 2024
* feat(cli): build user peer-deps

* chore: remove shared-modules build

* test(cli):  verify build config and `exports` subpaths

* text(cli): add depcheck config for fixture projects

* docs: update comments and test name

* feat: create import map w/ installed sanity version (#6784)

* feat: create import map w/ installed sanity version

* fix: use correct URL
github-merge-queue bot pushed a commit that referenced this pull request Jun 11, 2024
* feat: add CLI options to enable auto-updating studios

* refactor(cli): prefix with `unstable_`

* test: Update packages/sanity/src/_internal/cli/server/renderDocument.ts

Co-authored-by: Espen Hovlandsdal <[email protected]>

* chore(core): update import map urls

* feat(cli): build user peer-deps (#6742)

* feat(cli): build user peer-deps

* chore: remove shared-modules build

* test(cli):  verify build config and `exports` subpaths

* text(cli): add depcheck config for fixture projects

* docs: update comments and test name

* feat: create import map w/ installed sanity version (#6784)

* feat: create import map w/ installed sanity version

* fix: use correct URL

* chore(cli): rename auto updates flag

---------

Co-authored-by: Espen Hovlandsdal <[email protected]>
Co-authored-by: Binoy Patel <[email protected]>
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.

2 participants