koltyakov / generator-sppp Goto Github PK
View Code? Open in Web Editor NEW🐾 SP Pull-n-Push - Yeoman generator for SharePoint client-side applications
License: MIT License
🐾 SP Pull-n-Push - Yeoman generator for SharePoint client-side applications
License: MIT License
Hello,
Is there a way to work with react development environment. am i have to change the script tag as react.development.js
Thanks
...looking at the ./gulpfile.js line 26. It looks as 'sp-build-tasks' is being configured to look taskPath: './tools/tasks' instead './build/tasks',
generated ./gulpfile.js warns against modifying this file directly so I created .\tools\tasks\example.js and ran 'gulp example' to test as well as 'gulp --tasks' and it worked.
Hi,
I've got a local instance of SharePoint 2016 running and an SharePoint Online developer account, which I can't seem to get it to work with either installation.
I've tried using gulp sppull-all and I get the "Finished" message, however it does say processing 0 out of 0 folders.
Am I missing something for this behaviour?
There were a few modules I had to manually install after running generator-sppp 1.5:
npm install request-promise --save
npm install node-sp-auth --save
npm install socket.io-client --save
Add private config parameters prompting in case of missing config data.
I am using SPO and I can't seem to login because we are using multi-factor authentication
Hello
I think, it will be better to merge "gulp live-reload-install" with "gulp watch-live". So, when you start live-reload watching, it automatically deploys custom action to SharePoint. And when you stop, it automatically retracts custom action.
[�[90m13:12:40�[39m] Starting 'push'...
�[33m===�[39m �[32mPublishing assets to SharePoint�[39m �[33m===�[39m
�[31m[13:12:42] spsave: Error occured:�[39m
�[31m[13:12:42] spsave: 403 - "{"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}}}"�[39m
I'm a site collection admin. What can be causing this?
In the readme you mentionned :
"Communication layer settings are stored in ./config/private.json, parameters settings description can be found here." The link is 404
Hi Andrew!
Used You example from here to upload file from template (SP2019 on-prem version)
(async () => {
const templateUrl = "/sites/Quality/SQE/Shared Documents/qdr_tempate_en.rtf";
const folder = "/sites/Quality/SQE/QDR_Reports";
sp.web
.getFileByServerRelativeUrl(templateUrl)
.getBuffer()
.then((templateData) => {
console.log("template data:");
console.log(templateData);
// return sp.web.getFolderByServerRelativeUrl(folder).files.add(`${new Date()}.rtf`, templateData, true);
return sp.web.getFolderByServerRelativeUrl(folder).files.add(`test.rtf`, templateData, true); // <-- Fails here
})
.then(({ file }) => {
return file.getItem();
})
.then((item) => {
return item.validateUpdateListItem(
[
// Doesn't not create new version
{ FieldName: "Title", FieldValue: `Generated ${new Date()}` },
],
true
);
})
.then(console.log);
})().catch(console.log);
Strange that it is working if I run it in PnPjs Console (from SPEditor chrome extension):
But it gives error in sppp generator
Also if I use (new Date) in filename it shows different error, and the url contains subweb only(I have site-collection and a child web http://sppp/sites/Quality/SQE/ , it shows subweb only, not all server-relative path..):
Also I am using old v16.20.2 nodejs version (newest gave errors with sppp). Am I doing something wrong, or maybe it is something related with pnp/pnpjs#196 or koltyakov/sp-rest-proxy#61 ?
Hi Andrew!
Again not an issue but a question.. Can You please help me how to deploy final solution to prod?
I created small app using my local on-prem, then I change SPWeb url from
to production url:
Then I do
npm run connect
to my prod site,
npm run publish
the I add Wiki page, insert classic CEWP there and link it to my-app.cewp.html
sockjs.js GET https://localhost:9090/sockjs-node/info?t=
My code works but these multiple errors appear too. Do I need to change some other setting or I am doing something wrong?..
Hi,
I'm barely new in this topic, so any help would be appreciated.
Is it possible to pass the data to the .hbs template before compiling? For example, I'm aiming to execute an ajax request to fetch some data and render it in a webpart once the request is executed. Is this supported out of the box in the generator-sppp project or I need to manualy execute compiling of .hbs template?
Thanks in advance.
Ademir
Getting access denied when I try to use a web other than the one setup in the project connection.
Example, project setup to root https://xxx.sharepoint.com
Then I add a new context via...
import { Web } from "@pnp/sp/webs";
const web = Web("https://something.sharepoint.com/sites/dev");
const items = await web.lists.getByTitle('MyList').items.get();
Access denied. Haven't looked at the underlying setup yet to dig in yet.
In my projects, I setup each webpart to have it's own entry point, a dedicated folder under SCRIPTS and a dedicated hbs file under WEBPARTS.
My issue is that if I run "gulp watch --prod" the first time a change is made and saved, it rebuilds ALL webarts/entry points. After that, however, it works how I would expect, only rebuilding the webpart/entry point for which the change is made. Note - I believe I did need to remove COPYASSETSMAP and any entries or else it does rebuild all after every change.
I wonder if it's possible to eliminate that first rebuild of all when starting watch?
Ran "yo sppp".
At the conclusion, it said "run npm run config
to configure SharePoint connection".
When running the command, got "missing script error".
When reviewing the wiki, I found the command to be "gulp config".
Hi there.
I'm trying to build my own webpart using your great library.
But after running "npm run build" the app.css file in .dist/ directory is empty.
I also tried to build default Example project, both with css and scss. But the app.css in ./dist still empty. Even in example.
Is there any ways to solve this problem?
To write own export module for webpack?
If numerous package managers are installed (npm, yarn, pnpm), provide a possibility which package manager to use by default.
This is a question and not an issue
The gulpfile.js doesn't list the tasks individually. So, where are they defined? and how does gulp know what to do when I say gulp push for instance. I know the npm scripts invokes this but where is the definition for gulp push ( I know its spsave under the hood).
Thanks!
TSLint has been deprecated in favor of ESLint. Please see palantir/tslint-react#210 for more information.
Hi @koltyakov ,
I have created the project using no presets. How do I add external libraries from CDN like jQuery, Bootstrap, jQueryUI and refer them in say 'index.ts'?
If I have to include a third party library which doesn't have a CDN link but only a js file, how do I include that as well?
Thanks!
After scaffolding the project using 'yo sppp' and running the command npm run config, it threw an error Error: Cannot find module 'sp-build-tasks'. Assuming that the devDependencies were missing I ran the command " npm install --only=dev " .
I get another error now, "Cannot find module 'node-sass'" . What am I missing here?
Greetings Andrew!
Want to read rtf template and then create modified report in sp library.
https://www.npmjs.com/package/@iarna/rtf-to-html
https://github.com/iarna/rtf-to-html
I'm new in typescript and got stuck on "Uncaught Error: Cannot find module 'fs'" error..
Don't understand how to reference fs module (as I understand it should be part of NodeJs, but it is not found..)
My example code is:
import { loadContext } from "@utils/env";
import { logger } from "@utils/logger";
import { setupPnp } from "@utils/odata";
// import * as fs from "fs"; // <- tried to load like this
const fs = require("fs"); // and like this
import rtfToHTML from "@iarna/rtf-to-html";
loadContext()
.then(() => {
setupPnp();
const container = document.getElementById("example-cewp-container");
const rtfString = "{\\rtf1\\ansi\\deff0 hi \\b there\\b0 \\ul there \\ulnone\\i there is\\i0\\par }";
rtfToHTML.fromString(rtfString, (err, html) => {
console.log(html);
// This works ok, prints a document containing:
// <p>hi <strong>there</strong> <u>there </u><em>there</em></p>
});
rtfToHTML.fromStream(fs.createReadStream(`C:\qdr_template_en.rtf`), (err, html) => { // <----- Uncaught Error: Cannot find module 'fs'
// rtfToHTML.fromStream(fs.createReadStream("http://sppp/sites/site/web/Shared%20Documents/qdr_template_en.rtf"), (err, html) => { // not sure if it works by url..
console.log("html");
});
})
.catch(logger.error);
index.ts:8 Uncaught Error: Cannot find module 'fs'
at webpackMissingModule (index.ts:8:20)
at ./src/scripts/index.ts (index.ts:8:20)
at webpack_require (bootstrap:19:1)
at 4 (app.js?v=1.0.0_1694106066194:22590:18)
at webpack_require (bootstrap:19:1)
at bootstrap:83:1
at bootstrap:83:1
webpackMissingModule @ index.ts:8
./src/scripts/index.ts @ index.ts:8
webpack_require @ bootstrap:19
4 @ app.js?v=1.0.0_1694106066194:22590
webpack_require @ bootstrap:19
(anonymous) @ bootstrap:83
(anonymous) @ bootstrap:83
client:52 [WDS] Live Reloading enabled.
client:150 [WDS] Errors while compiling. Reload prevented.
errors @ client:150
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:159 ./src/scripts/index.ts
Module not found: Error: Can't resolve 'fs' in 'C:_prj\html-to-rtf-test\src\scripts'
errors @ client:159
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:52 [WDS] Live Reloading enabled.
client:150 [WDS] Errors while compiling. Reload prevented.
errors @ client:150
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:159 ./src/scripts/index.ts
Module not found: Error: Can't resolve 'fs' in 'C:_prj\html-to-rtf-test\src\scripts'
errors @ client:159
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:55 [WDS] App updated. Recompiling...
client:55 [WDS] App updated. Recompiling...
client:55 [WDS] App updated. Recompiling...
client:55 [WDS] App updated. Recompiling...
client:150 [WDS] Errors while compiling. Reload prevented.
errors @ client:150
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:159 ./src/scripts/index.ts
Module not found: Error: Can't resolve 'fs' in 'C:_prj\html-to-rtf-test\src\scripts'
errors @ client:159
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:150 [WDS] Errors while compiling. Reload prevented.
errors @ client:150
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:159 ./src/scripts/index.ts
Module not found: Error: Can't resolve 'fs' in 'C:_prj\html-to-rtf-test\src\scripts'
errors @ client:159
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:150 [WDS] Errors while compiling. Reload prevented.
errors @ client:150
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:159 ./src/scripts/index.ts
Module not found: Error: Can't resolve 'fs' in 'C:_prj\html-to-rtf-test\src\scripts'
errors @ client:159
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:150 [WDS] Errors while compiling. Reload prevented.
errors @ client:150
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:885
SockJS._transportMessage @ sockjs.js:883
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2958
client:159 ./src/scripts/index.ts
Module not found: Error: Can't resolve 'fs' in 'C:_prj\html-to-rtf-test\src\scripts'
Best regards, Gennady
While pushing files to SP (publish), if my masterpage library has a mandatory Title column then the push fails. Where do I make changes to handle such issues without making Title optional in SP.
Also, where are the gulp tasks, I don't see them in the gulpfile.js.
Thanks!
Hi Koltyakov,
I would like to seek your help in adding a sample for Azure Dev OPS deployment for SPPP. Also is it possible to deploy to mulitple sites at once because private.json only capture 1 sites?
Thank you so much
Best Regards
Alex Lee
Running dev server and the scripts directory isn't being created. Also scaffolded a project without any edits. Just ran npm run start, no issues, but no scripts being compiled. Latest version.
Add polyfills for React preset for <=IE10
I would like to apply a custom masterpage to my site and to the local server when viewing a web part. Do you have any example? Thanks in advance for all your help.
Hi,
I've just been trying out sppp with an on-prem sharepoint 2013 environment and have got the below issue.
I have followed the instructions exactly and am using the default options provided by sppp.
When i get to the 'gulp pull' command i receive the below error.
gulp pull
[23:38:07] Using gulpfile C:\Dev Stuff\SPPPTest\gulpfile.js
[23:38:07] Starting 'pull'...
=== Fetching files from SharePoint ===
[23:38:08] 'pull' errored after 917 ms
[23:38:08] TypeError: sppull is not a function
at C:\Dev Stuff\SPPPTest\node_modules\sp-build-tasks\dist\tasks\sync.js:89:36
at step (C:\Dev Stuff\SPPPTest\node_modules\sp-build-tasks\dist\tasks\sync.js:52:23)
at Object.next (C:\Dev Stuff\SPPPTest\node_modules\sp-build-tasks\dist\tasks\sync.js:33:53)
at fulfilled (C:\Dev Stuff\SPPPTest\node_modules\sp-build-tasks\dist\tasks\sync.js:24:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
If you could provide some guidance on this that would be great. I cannot see this issue raised before so i do not know if it is new, or whether i have missed something.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.