npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

crownpeakgruntupload

v0.1.12

Published

Upload files to the Crownpeak CMS through grunt plugin

Downloads

41

Readme

CrownpeakGruntUpload

Upload files to the Crownpeak CMS through grunt plugin

Getting Started

This plugin requires Grunt

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install crownpeakgruntupload --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('crownpeakgruntupload');

The "CrownpeakGruntUpload" task

Overview

In your project's Gruntfile, add a section named crownpeakgruntupload to the data object passed into grunt.initConfig().

grunt.initConfig({
  crownpeakgruntupload: {
   {
     default_options: {
       options: {
        "username":Your Username,
        "password":Your Password,
        "apikey": Your API Key,
        "host": The url of the cms, usually cms.crownpeak.net,
        "instance":The name of your instance,
        "srcFolder":The location of your site in your local machine,
        "cmsFolder":The location you want this site to be uploaded on the cms ,
        "model":A model containing the desired workflow, overrides the workflow setting,
        "workflow":The workflow id if you did not set a model,
        "siteUrls":[List of site urls that will be replaced.],
        "allowDelete":Delete files that are in the cms, but not locally, default to false,
        "skipUpload":[list of files to skip when uploading. Can be local path or cms path],
        "skipDelete":[list of files to skip when deleting. Can be local path or cms path],
        "branch":If true, assets will be branched and the new data put there, otherwise it will replace the current, defaults to false,
        "route":Can either be the state id you wish it to go to or set to "model" for the models state to be used,
        "verbose":true if you want additional logging
       }
     }
  }
  },
});

Usage Examples

grunt.initConfig({
  crownpeakgruntupload: {
      default_options: {
          options:{
          username:"testuser",
          password:"hello",
          apikey: "279f53423a0456883c5",
          host: "cms2.crownpeak.net",
          instance:"Sandbox5",
          srcFolder:"D:\\Documents\\Example Websites\\space-science\\space-science\\upload",
          cmsFolder:"/test/",
          model:18445,
          workflow:11,
          siteUrls:["www.test.com"],
          allowDelete:false,
          skipUpload:["D:\\Documents\\Example Websites\\space-science\\space-science\\upload\\test.aspx","test.aspx","/test/test"],
          skipDelete:["D:\\Documents\\Example Websites\\space-science\\space-science\\upload\\test.aspx","test.aspx","/test/test"],
          branch:true,
          route:785,
          verbose:false
        }
      }
    },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

4/16/19 v0.1.2 Fixed bug for local folders 4/16/19 v0.1.3 Added deletion of assets on the server that are not available locally 4/17/19 v0.1.4 - Added support for ..,./,and file name in path Fixed bug where uploaded js and css files did not output the path to js/css on rendering Added support for exlusion from upload and deletion Added support for routing assets Upload creates branches and updates those instead of parent 4/19/19 Added Workflow to API Added Missing Commands to API 4/23/19 v0.1.7 Fixed issues with /./. files Fixed issue with changing url of files with no path 4/23/19 v0.1.9 Fixed issue with adding additional / when dealing with ../ 4/24/19 v0.1.10 Fixed issue with query becoming null 4/24/19 v0.1.11 Changed code so that uploaded files now have backup links in case the file is not uploaded Fixed bug preventing branch from working 4/25/19 v0.1.11-beta-2 Added @include to list of urls that are replaced Fixed links without base paths to be get their path from the root 4/25/19 v0.1.11-beta-3 Fixed issue linked to pure urls not ending with / not being updated to / 4/25/19 v0.1.11-beta-5 Fixed issue with regex getting src from javascript code Fixed issue with url((data:) 4/26/19 v0.1.12 Added additional code to wrap assets that do not have " or ' with ' if it has a bad link character