Git Product home page Git Product logo

generator-sppp's People

Contributors

dependabot[bot] avatar jeffangama avatar koltyakov avatar olegrumiancev avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-sppp's Issues

React development environment

Hello,

Is there a way to work with react development environment. am i have to change the script tag as react.development.js

Thanks

Unable to Pull Sharepoint Online & Sharepoint 2016 folders

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.

image

Am I missing something for this behaviour?

Missing modules

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

live-reload merging

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.

spsave: Error occured when running gulp push

[�[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?

Where is config.json ?

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

File not found using sp.web.getFolderByServerRelativeUrl(folder).files.add(`test.rtf`, templateData, true);

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):

err-0-2023-09-09_181624

But it gives error in sppp generator

err1-2023-09-09_174259

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..):

err2-2023-09-09_174454

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 ?

no site url?

Hello,

I'm not seeing the "Site URL" and other options as per your images when creating a new application via the CLI... am I missing something?

image

How to deploy to prod correctly?

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

http://localhost:9090/sites/site/web

to production url:

prod-2023-10-11_190212

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=

sock-2023-10-11_190346

rd-2023-10-11_191000

My code works but these multiple errors appear too. Do I need to change some other setting or I am doing something wrong?..

Pass the data object to .hbs webpart to be compiled

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

Dev proxy and other webs

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.

Watch with multiple entry points

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?

npm run config

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".

Include all script/components style files (scss/css) in build bundle.

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?

Where are the gulp tasks?

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!

Adding external libraries

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!

cannot find module 'node-sass'

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?

Question: what am I missing adding RTF-to-HTML third-party library? ..

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);

fs-missing-2023-09-07_210852

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

Publish to SP fails if there's a mandatory field to be set

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!

Request for SPPP deployment thru Azure Dev Ops sample

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

dev server script directory

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.

SPPull is not a function

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.