Closed BryceRussell closed 4 months ago
Name | Link |
---|---|
Latest commit | fb3f5c3a62508dda8bb9fa7f649d22f7a5e8155f |
Latest deploy log | https://app.netlify.com/sites/astro-integration-kit/deploys/65eb13fe251f2b000756bc1b |
Deploy Preview | https://deploy-preview-74--astro-integration-kit.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Feel free to assign us as reviewers once you feel like the PR is ready!
I am ready for a review on this, I plan on finishing the docs once all of the changes have been reviewed/finalized
The use and creation of Vite plugins is a lot safer now with warnings and incrementing names
hasVitePlugin
utility/plugin:// Utility
hasVitePlugin({ plugin: "vite-plugin-test-integration", config })
hasVitePlugin({ plugin: vitePlugin(), config })
// Plugin
hasVitePlugin("vite-plugin-test-integration")
hasVitePlugin(vitePlugin())
hasVitePlugin
utility can only detect plugins added from previous integrations and not the current integrationdefineIntegration
the hasVitePlugin
plugin has to be located at the beginning of the plugins
array in order to detect Vite plugins inside the current integrationaddVitePlugin
:// Add `config` and `logger` to warn about duplicate plugins
addVitePlugin({
plugin,
config,
logger
updateConfig
})
// or
// Add `warnDuplicate: false` to disable warnings for duplicate plugins
addVitePlugin({
warnDuplicate: false,
plugin,
updateConfig
})
// Add `warnDuplicate: false` AND `config` to increment plugin name if plugin already exists
// (for utils that depend on `addVitePlugin` so they don't need `logger` or `warnDuplicate` properties)
addVitePlugin({
warnDuplicate: false,
plugin,
config
updateConfig
})
addVirtualImports
and addDevToolbarFrameworkAppPlugin
utils// Now needs 'config' param to detect duplicate plugins and increment plugin name
addVirtualImports({
...
config
})
// Now needs 'config' param to detect duplicate plugins and increment plugin name
addDevToolbarFrameworkAppPlugin({
...
config
})
Let me know how this looks, and what can be improved
You have a few conflicts to resolve because of me @BryceRussell!
Closes #51
hasVitePlugin
util/plugin (Using Option B laid out here)addVitePlugin
util to warn when duplicate plugins are createdLimitations
hasVitePlugin
utility can only detect plugins added from previous integrations and not the current integrationdefineIntegration
thehasVitePlugin
plugin has to be located at the beginning of theplugins
array in order to detect Vite plugins inside the current integrationTodo
PluginOption
between Astro and Vite typesaddVirtualImports
andaddDevToolbarFrameworkApp
utilshasVitePlugin
utiladdVitePlugin
utilhasVitePlugin
plugin (Not sure how to mock this up in a test sincehasVitePlugin
overrides theupdateConfig
function)addVitePlugin
utiladdVirtualImports
utilhasVitePlugin
addVitePlugin
addVirtualImports
addDevToolbarFrameworkApp
hasVitePlugin
utiladdVitePlugin
utiladdVirtualImports
utiladdDevToolbarFrameworkApp
util