@hanadkubat, thanks for starting using the generator. Yes, we still have 2013 projects.
when I publish my work to Sharepoint and open the html document directly
Didn't get this. After assets are published, html should be added to CEWP as a source link. For SPA, it can be web parts page with a single content editor web part. Pages+CEWP can be provisioned with PnP Provisioning Engine or SPMeta2 in automated way, or configured manually.
npm run publish
task publishes assets from local ./dist
folder to spFolder
(defined in ./config/app.json
). If you really need to change the publishing path destination from _catalogs/masterpage
to something else, e.g. SiteAssets
or Style Library
it can be done by editing ./config/app.json/spFolder
, but I recommend the defaults. When running publish task all the files from the dist folder are uploaded with spsave to SharePoint (2013 is supported as well). Then you link assets in CEWP or script link user custom action, etc.
const { sppull } = require("sppull");
const context = {
siteUrl: "xxx",
creds: {
username: "xxx",
password: "xxx"
}
};
const options = {
spRootFolder: "Shared%20Documents/SSC%20Projection/ZIP",
dlRootFolder: "W:\SCM\RawData\SSC_Proj"
};
sppull(context, options)
.then((downloadResults) => {
console.log("Files are downloaded");
console.log("For more, please check the results", JSON.stringify(downloadResults));
})
.catch((err) => {
console.log("Core error has happened", err);
});
.Folders
in sppull code base in node_mosules and logging the response.spr.post('${SCURL}/_api/web/GetFolderByServerRelativeUrl('${FolderServerRelativeUrl}')/Files/add(url='${FileName}',overwrite=true)',{
headers: {
'X-RequestDigest': digest,
'content-length':new Buffer(content).byteLength
},
body:content
})