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

Add programmatic install interface #525

Merged
merged 3 commits into from
Jun 23, 2020
Merged

Conversation

FredKSchott
Copy link
Owner

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.
    • Pass webModulesPath to our new import resolver, instead of having the import resolver figure it out itself
  • scan-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 CLI command, and into a more programmatic interface /w detailed return object.

@FredKSchott FredKSchott requested a review from drwpow June 20, 2020 19:09
@FredKSchott FredKSchott requested a review from a team as a code owner June 20, 2020 19:09
@vercel
Copy link

vercel bot commented Jun 20, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/djygqqvdo
✅ Preview: https://snowpack-git-programmatic-install.pikapkg.vercel.app

@@ -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';
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔠

Copy link
Owner Author

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...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

@FredKSchott FredKSchott merged commit d203b02 into master Jun 23, 2020
@FredKSchott FredKSchott deleted the programmatic-install branch June 23, 2020 00:11
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