Closed elboletaire closed 3 years ago
If I start working on it I'd assign it to me. Until then, I leave it open for others to collaborate.
So, given we have an oc package
command (which contains the _package
folder), perhaps I would name this --skip-package
- so it would just publish whatever is inside _package
(skipping the dependencies' check and all of that). What do you think?
I don't know the internals like you, so I guess your argument will probably fit better than mine :_D
@elboletaire look at @NimaSoroush's PR that we just merged. Sounds like very similar but for packaging (skips install and does symlinking) https://github.com/opencomponents/oc/pull/971
Thanks @matteofigus. Thing is I wasn't able to dedicate more time to this since last time, but I'll look into it as soon as I've time again :smiley:
I was thinking on taking on this issue and I think there's 3 use cases to consider when doing this new command.
oc package your-component-folder
oc publish your-component-folder --skip-package
In this case the scenario is you have your component, you package first, it creates the _package
folder, so when you run the second command, it just tries to find a _package
folder inside, and then it will compress, and publish it.
oc package your-component-folder
... store the _package folder somewhere to be published later
oc publish _package --skip-package
In this case, the component is already gone, as we only stored the artifact of the package to be deployed/published at a later stage. So here the CLI will see that there's no _package folder inside of your path, so will try to find a package.json inside, and if there is one, check that we are on a compiled package (checking that theres an oc.packaged = true
could do the trick here) and publish those files.
oc package your-component-folder --compress
... store the tar.gz file somewhere to be published later
oc publish your-file.tar.gz
Similar to the case 2 but here we also compress and we want to publish that file. In this case I don't see the point of skipping package, since CLI could already assume that if the path is of a compressed file, you just want to publish that.
Does this approach make sense?
In some scenarios people tend to compile dependencies by their own before doing
oc publish
, so let's add a cli argument, something like--skip-dependencies
or--skip-build
, to allow us skip the dependencies installation later again via oc.