All Projects → koltyakov → sp-build-tasks

koltyakov / sp-build-tasks

Licence: MIT license
👷 SharePoint front-end projects automation and tasks tool-belt

Programming Languages

typescript
32286 projects
Handlebars
879 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to sp-build-tasks

buildozer
🚜 Build tool which simplify your buildprocess. Built with Gulp.js 🥤
Stars: ✭ 22 (+46.67%)
Mutual labels:  gulp, build
Asynctasks.vim
🚀 Modern Task System for Project Building, Testing and Deploying !!
Stars: ✭ 495 (+3200%)
Mutual labels:  build, tasks
Microsoft Graph Toolkit
Authentication Providers and UI components for Microsoft Graph 🦒
Stars: ✭ 518 (+3353.33%)
Mutual labels:  tasks, sharepoint
gulp-spsave
Gulp plugin for saving files inside SharePoint
Stars: ✭ 52 (+246.67%)
Mutual labels:  gulp, sharepoint
Just Task
Elegant javascript tasks
Stars: ✭ 25 (+66.67%)
Mutual labels:  gulp, build
Assemble
Community
Stars: ✭ 3,995 (+26533.33%)
Mutual labels:  gulp, build
gulp-spsync
Gulp plugin for synchronizing local files with a SharePoint library
Stars: ✭ 57 (+280%)
Mutual labels:  gulp, sharepoint
Fuzzymail
📨 Email template generator. Making emails fun again.
Stars: ✭ 114 (+660%)
Mutual labels:  gulp, build
Carbon.Gulp
Carbon/Gulp is a delicious blend of tasks and build tools poured into Gulp to form a full-featured modern asset pipeline for Flow Framework and Neos CMS.
Stars: ✭ 15 (+0%)
Mutual labels:  gulp, build
streetsupport-web
Helping people facing homelessness across the UK to find services in their area, and connecting people who want to help to where it is needed most.
Stars: ✭ 21 (+40%)
Mutual labels:  gulp
fly-helper
It's a Tool library, method collection
Stars: ✭ 21 (+40%)
Mutual labels:  gulp
gtd.vim
Getting things done with Vim
Stars: ✭ 42 (+180%)
Mutual labels:  tasks
pnpcore
The PnP Core SDK is a modern .NET SDK designed to work for Microsoft 365. It provides a unified object model for working with SharePoint Online and Teams which is agnostic to the underlying API's being called
Stars: ✭ 169 (+1026.67%)
Mutual labels:  sharepoint
netlify-plugin-cache
⚡ Generic plugin for caching any files and/or folders between Netlify builds
Stars: ✭ 19 (+26.67%)
Mutual labels:  build
electron-angular-ngrx
An Angular (6x) Electron seed featuring @angular/cli, @ngrx/platform, and Typescript. Complete with HMR workflow
Stars: ✭ 39 (+160%)
Mutual labels:  gulp
envoyer-npm-deployment
Compile assets that depend on node packages using Laravel Envoyer deployment hooks
Stars: ✭ 43 (+186.67%)
Mutual labels:  gulp
eslint4b
ESLint which works in browsers.
Stars: ✭ 33 (+120%)
Mutual labels:  build
pexample
Building and packaging Python with Pants and PEX - an annotated example
Stars: ✭ 21 (+40%)
Mutual labels:  build
react-ssr-spa
Server side rendered single page app using reactjs official libraries.
Stars: ✭ 30 (+100%)
Mutual labels:  gulp
eadmin
eadmin - 极致用户体验与极简开发并存的开箱即用的后台UI框架
Stars: ✭ 258 (+1620%)
Mutual labels:  gulp

sp-build-tasks

NPM

npm version Downloads Build Status FOSSA Status Gitter chat

SharePoint front-end projects automation and tasks tool-belt

banner

The library was designed for usage with SharePoint Push-n-Pull Yeoman generator but can be used as a stand-alone package as well.

Install

Dependency

npm i sp-build-tasks --save-dev

Integration to the code

// gulpfile.js

const gulp = require('gulp');
require('dotenv').config();

new (require('sp-build-tasks').SPBuildTasks)(gulp, {
  privateConf: process.env.PRIVATE_JSON || './config/private.json',
  appConfig: process.env.APP_JSON || './config/app.json',
  taskPath: './tools/tasks'
});

Settings

Parameter Description
privateConf path to credentials config file
appConfig path to application config file
taskPath path to custom gulp tasks folder

App config file

The app config file should be a JSON document with the following schema sp-build-tasks/schema/v1/sppp.json.

The schema represents the following interface:

export interface IAppConfig {
  $schema?: string; // Path to `sp-build-tasks/schema/v1/sppp.json`
  spFolder: string; // SharePoint relative target folder (e.i. `_catalogs/masterpage/contoso`)
  distFolder: string; // Local distribution folder path
  deleteFiles?: boolean; // Delete remote files on local files unlink event
  masterpagePath?: string; // Path to masterpage .hbs in `./src` structure
  masterpage?: any; // masterpage's custom properties passed to hbs template
  masterpageCodeName?: string; // masterpage code name (used for renaming output file)
  platformVersion?: string; // Masterpage platform version (2016, 2013, etc.)
  logoPath?: string; // Path to logo image
  bundleJSLibsFiles?: string[]; // Paths to .js files to bundle together in a single vendor.js
  bundleCSSLibsFiles?: string[]; // Paths to .css files to bundle together in a single vendor.css
  copyAssetsMap?: IAssetMap[]; // Custom static files copy configuration
  customActions?: ICustomActionDefinition[];
  customStyles?: IAssetMap | IAssetMap[]; // Custom styles
  modulePath?: string; // Relative path for module inside dist structure, e.g. `modules/my-module`
  customData?: any; // Optional custom data object that can be used for feeding data to templates
  webpackItemsMap?: Array<{ entry: string; target: string; }>; // Scripts build configuration. Array or entry/target script pairs.
  devtool?: Options.Devtool; // Webpack `devtool` option for development mode, i.e. `eval`
}

Custom Gulp tasks

// `./build/tasks/example.js`
module.exports = (gulp, $, settings) => {

  // gulp - Gulp object
  // $ - Gulp plugins dynamic loader
  // settings - ISPBuilderSettings object

  gulp.task('example', cb => {
    console.log('Example Gulp Task');
    cb();
  });

  // ...
};

or types supported version:

//@ts-check

const { customTask } = require('sp-build-tasks');

module.exports = customTask((gulp, $, settings) => {

  gulp.task('example', cb => {
    console.log('Example Gulp Task');
    cb();
  });

});

Gulp tasks

Authentication config setup initiation

gulp config

Populates ./config/private.json with credentials options.

Watch and live development

Watch

gulp watch

Watch for changes in ./src folder, compiles .ts, .hbs and .scss to ./dist. Watch for changes in ./dist and uploads to target SharePoint folder.

Use --skipSync flag to skip any upload to SharePoint assets, e.g. if you need external tools (like gosip sync) to be used instead of embeded.

Watch with SharePoint pages live reload

gulp live

Does the same as the watch task. Emits files update to SharePoint live reload client which triggers live pages reload for:

  • JavaScript's updates
  • CSS's updates
  • CEWPs updates
  • Layouts updates
  • Masterpage updates

Syncronization

Publishing ./dist to SharePoint

gulp push

Publishes all ./dist folder content to SharePoint target folder.

Publishing in incremental mode

gulp push --diff

Uploads only files which size is different from those in SharePoint.

Fetching files from SharePoint

gulp pull

Downloads all files and folders from remote SharePoint target to ./dist folder.

Build front-end

gulp build

Compiles front-end to ./dist folder.

Build options

Production build
gulp build --prod

Used with Webpack build.

Build subtasks

A specific subtasks can be provided as gulp build parameters:

Parameter Description
--webpack webpack'ing .ts to single app.js buldle
--css-custom bundling custom css (from .scss)
--copy-assets copying static content
--js-libs bundling JavaScript libraries
--css-libs bundling CSS libraries or custom .css
--masterpage .hbs to .masterpage
--layouts .hbs to .aspx layouts
--webparts compiles .hbs CEWPs
gulp build --prod --webpack --webparts

Starts webparts and webpack tasks, also uses production build configs.

Deployment

Live reload

gulp live-reload [--install]

Installs live reload client as ScriptLink custom action to SPWeb.

gulp live-reload --uninstall

Retracts live reload custom action client.

Masterpage

gulp masterpage [--install]

Applies custom masterpage and logo to SPWeb.

gulp masterpage --uninstall

Restores default (seattle.masterpage) masterpage.

Custom actions

gulp custom-actions [--install]

Provisions custom actions from app.json settings.

gulp custom-actions --uninstall

Removes custom actions based on project namespace prefix.

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].