-
Notifications
You must be signed in to change notification settings - Fork 916
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
Add programmatic install interface #525
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pikapkg/snowpack/djygqqvdo |
4515b0a
to
15e9692
Compare
15e9692
to
56c13c2
Compare
56c13c2
to
8bb7b65
Compare
8bb7b65
to
966fbb7
Compare
@@ -14,13 +14,13 @@ import {InputOptions, OutputOptions, rollup, RollupError} from 'rollup'; | |||
import validatePackageName from 'validate-npm-package-name'; | |||
import {EnvVarReplacements, SnowpackConfig} from '../config.js'; | |||
import {resolveTargetsFromRemoteCDN} from '../resolve-remote.js'; | |||
import {rollupPluginCatchUnresolved} from '../rollup-plugin-catch-unresolved.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.
🔠
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.
lol I can't take credit for this, there's a great "Organize Imports" command inside of VSCode that automates this :)
@@ -1,4 +1,3 @@ | |||
- snowpack installing... |
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!
Allows for the build command to run an install on the final build, before it's written to disk. A big part of how we will solve #475. See more background here: #475 (comment)
build
&dev
: Some small clean up of build & dev but keeps them calling the CLI interface for now.webModulesPath
to our new import resolver, instead of having the import resolver figure it out itselfscan-imports
: Separate out the "file collection" and "import scanning" logic into two functions, so that build can call it with an already collected set of files.install
: The meat of the change - moves the core install logic out of the existing CLIcommand
, and into a more programmatic interface /w detailed return object.