NodeJS: Publish mode check limitations #905
Replies: 1 comment 7 replies
-
|
It's an interesting idea, pondering where in the lifetime of a CI workflow each of these steps would be taken. As it currently stands, The original design of theses extensions was for the pre-CLI deployment model, aiming to prevent this step happening when you're doing a build of the manifest, so naturally there is some legacy in the way this is designed. Additionally, the Node.js integration was, from my perspective, designed around publishing a Docker image, and for that, you're more likely to have been doing the So, this brings an architectural question - who is responsible for deployment artifact generation. I think it could be quite validly argued that the steps you are describing here, builder.AddNpmApp("myapp", "../path-to-frontend", "dev")
.WithHttpEndpoint(targetPort: 4321)
.PublishAsNetlifySite(new NetlifyDeployOptions()
{
Dir = "dist" // Your build output directory
}, (IResourceBuilder<NetlifyAppResource> netlifyBuilder) => {
return netlifyBuilder.WithNpmInstaller().WithPrepackageCommand("build:prod");
});That makes it clear that there's a difference between preparing the "built artifacts" for local dev vs deploy. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Today, all of the
.With*PackageInstallationcalls are protected by a check for run mode:With the idea of building deploy-centric hosting integrations, it would be really useful to not have this limitation. For example, I was trying to evaluate
aspire deploymanaging the calls tonpm ciandnpm run build, and I knew there was already a lot of great work here around this—but then I found out it's only for run mode. The fact that it even has auseCIparameter makes me wonder why it's not for publish mode anyway.Maybe that could be an optional
boolas the last parameter, that defaults to the current behavior? I'm not sure how I feel about that, kind of ugly, but really this functionality would be really helpful. As would something like:.With*RunCommandwhere
*is the package manager, and again not only for run mode. Ideally, we could chain calls together:Anyway, this is kind of where my head is at. I already implemented a version of the
WithNpmRunCommandin my Netlify hosting integration.Beta Was this translation helpful? Give feedback.
All reactions