Giter Club home page Giter Club logo

sitecore / content-hub-one-nextjs-starterkit Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 20.0 401 KB

The Content Hub ONE NextJS starterkit will contain helping functionalities such as handling GraphQL JSON output conversion to HTML for Rich Text, Media Fields and References. Also it will contain a small example implementation that Developers can use to start their customer projects on.

License: Apache License 2.0

TypeScript 38.35% JavaScript 44.94% CSS 16.71%

content-hub-one-nextjs-starterkit's People

Contributors

lovesitecore avatar sc-alexeytolkunov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

content-hub-one-nextjs-starterkit's Issues

Error "No tenant selected" when running `node setup`

Following the instructions for getting started and after setting environment variables, I run node setup and get the following errors (after the media gets successfully uploaded):


 Step 2/3: Push Content Types
 Push Content Types...
 Wait 10 seconds so push of content types can be completed
 error: Command failed: ch-one-cli ser push content-type -f "C:\projects\sitecore-demo-blog-chone\serialization"
No tenant selected

 Wait done
 Completed - Push Content Types: OK

 Step 3/3: Push Content Items
 Push Content Items for ContentType: menu...
 error: Command failed: ch-one-cli serialization push content-item -c menu -f "C:\projects\sitecore-demo-blog-chone\serialization"
No tenant selected

 Push Content Items for ContentType: recipe...
 error: Command failed: ch-one-cli serialization push content-item -c recipe -f "C:\projects\sitecore-demo-blog-chone\serialization"
No tenant selected

 Push Content Items for ContentType: header...
 error: Command failed: ch-one-cli serialization push content-item -c header -f "C:\projects\sitecore-demo-blog-chone\serialization"
No tenant selected

 Push Content Items for ContentType: footer...
 error: Command failed: ch-one-cli serialization push content-item -c footer -f "C:\projects\sitecore-demo-blog-chone\serialization"
No tenant selected

 Push Content Items for ContentType: homepage...
 error: Command failed: ch-one-cli serialization push content-item -c homepage -f "C:\projects\sitecore-demo-blog-chone\serialization"
No tenant selected

on mac the paths does not work

None of the content push was working.
here is the patch file to make this work. It would be nice if some could use the path and make this cross-platform.

Attach is the changes where this can be applied to make it work in Mac.

diff --git a/lib/setupscripts/cmd.js b/lib/setupscripts/cmd.js
index a9c3e6d..76e435f 100644
--- a/lib/setupscripts/cmd.js
+++ b/lib/setupscripts/cmd.js
@@ -1,36 +1,34 @@
-const color = require('./colorConstants');
+const color = require("./colorConstants");
 
+async function runCommand(command) {
+  const { exec } = require("child_process");
+  try {
+    await exec(command, (error, stdout, stderr) => {
+      if (error) {
+        console.log(color.ERROR, `error: ${error.message}`);
+        return "ERROR";
+      }
+      if (stderr) {
+        console.log(color.ERROR, `stderr: ${stderr}`);
+        return "STDERROR";
+      }
+      console.log(color.INFO, `${stdout}`);
+    });
+  } catch (error) {
+    console.log(color.ERROR, "Error (runCommand): " + error);
+  }
 
-async function runCommand (command) {
-    const { exec } = require("child_process");
-    try {
-        await exec(command, (error, stdout, stderr) => {
-            if (error) {
-                console.log(color.ERROR,`error: ${error.message}`);
-                return 'ERROR';
-            }
-            if (stderr) {
-                console.log(color.ERROR,`stderr: ${stderr}`);
-                return 'STDERROR';
-            }
-            console.log(color.INFO,`${stdout}`);
-        });
-    } catch(error) {
-        console.log(color.ERROR,'Error (runCommand): ' + error)
-    }
-
-    return 'OK';
+  return "OK";
 }
 
 function getRootDirectory() {
-
-    var root = __dirname.replace("\\lib\\setupscripts","");;
-    return root;
+  var root = __dirname.replace("/lib/setupscripts", "");
+  return root;
 }
 
 function sleep(ms) {
-    return new Promise((resolve) => {
-      setTimeout(resolve, ms);
-    });
-  }
-module.exports = {runCommand,getRootDirectory,sleep}
\ No newline at end of file
+  return new Promise((resolve) => {
+    setTimeout(resolve, ms);
+  });
+}
+module.exports = { runCommand, getRootDirectory, sleep };
diff --git a/lib/setupscripts/serialize.js b/lib/setupscripts/serialize.js
index 52adaba..735513a 100644
--- a/lib/setupscripts/serialize.js
+++ b/lib/setupscripts/serialize.js
@@ -1,25 +1,36 @@
-const cmd = require('./cmd');
-const color = require('./colorConstants');
+const cmd = require("./cmd");
+const color = require("./colorConstants");
 
 //Push Content Types
 async function pushContentTypes() {
-    console.log(color.INFO,'Push Content Types...');
-    var status = await cmd.runCommand("ch-one-cli ser push content-type -f \"" + cmd.getRootDirectory() + "\\serialization\"");
-    return status;
+  console.log(color.INFO, "Push Content Types...");
+  var status = await cmd.runCommand(
+    'ch-one-cli ser push content-type -f "' +
+      cmd.getRootDirectory() +
+      '/serialization"'
+  );
+  return status;
 }
 
-
-
 //Push Content Items
 async function pushContentItems(contentType) {
-    console.log(color.INFO,'Push Content Items for ContentType: ' + contentType + '...');
-    try {
-        var status = await cmd.runCommand("ch-one-cli serialization push content-item -c " + contentType + " -f \"" + cmd.getRootDirectory() + "\\serialization\"");
-    } catch (error) {
-        console.log(color.ERROR,'Error (pushContentItems): ' + error)
-        return status; 
-    }
-    return status;   
+  console.log(
+    color.INFO,
+    "Push Content Items for ContentType: " + contentType + "..."
+  );
+  try {
+    var status = await cmd.runCommand(
+      "ch-one-cli serialization push content-item -c " +
+        contentType +
+        " -f " +
+        cmd.getRootDirectory() +
+        "/serialization/"
+    );
+  } catch (error) {
+    console.log(color.ERROR, "Error (pushContentItems): " + error);
+    return status;
+  }
+  return status;
 }
 
-module.exports = {pushContentTypes,pushContentItems}
\ No newline at end of file
+module.exports = { pushContentTypes, pushContentItems };

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.