chrishasz / spgo

SPGo: A Lightweight, Open Source, SharePoint IDE for Visual Studio Code
https://www.chrishasz.com/spgo
MIT License
60 stars 11 forks source link

Trigger save or publish action programmatically (API)? / gulp #105

Closed germain-italic closed 4 years ago

germain-italic commented 4 years ago

Hi, congrats on the great work! I would like to know if there is a way to trigger the save (or publish) action using a gulp task?

I have some gulp tasks that concat & compress some files, the idea is to tell gulp to trigger the spgo.save (or publish) action so that I don't have to upload the concatenated files manually.

Any hint?

germain-italic commented 4 years ago

related: https://github.com/chrishasz/spgo/issues/57

koltyakov commented 4 years ago

As you already use Gulp you can take a look at sp-build-tasks and generator-sppp, these automate most common tasks on the edge of modern front-end development and classic SharePoint.

germain-italic commented 4 years ago

Thanks for the links! This approach looks more complicated than the workflow offered by SPGo (and also more extensible but that's not what I look for).

s-KaiNet commented 4 years ago

Then just use gulp-spsave directly 😄

koltyakov commented 4 years ago

or to ask SPGo watch mode...

germain-italic commented 4 years ago

@s-KaiNet awesome!!!!

chrishasz commented 4 years ago

@Germain-Italic - I have a feature planned (1.5.2) to enhance the Publish Workspace command, but I don't know if this will help with a gulp task specifically.

@koltyakov - What do you mean by "SPGo watch mode..."? If you have an idea for a good way to integrate SPGo with external tools like webpack or gulp, I'm definitely interested.

I'm happy to reopen this issue if there is an option to solve this via SPGo.

koltyakov commented 4 years ago

@chrishasz, maybe there is one, not sure. I mean just an ordinary file system watch and applying an action on changes. Started watching, a file has changed somehow (direct edit or edited with an external tool), then uploaded automatically.

germain-italic commented 4 years ago

I'd rather have separate solutions (to watch/to do what SPGo does) and be able to trigger SPGO's actions programmatically. Looks more extensible. Another idea I had with that was to auto-publish every time I commit to a specific branch, using commit-hooks.