JSCAD User Group
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Is the cli package also included in the web version?

    Scheduled Pinned Locked Moved Development Discussions
    6 Posts 2 Posters 2.2k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Jason SprouseJ Offline
      Jason Sprouse
      last edited by

      I posted a prompt suggesting the addition of some generative ai capabilities. In running the app locally I see that it is system linking the @jscad/cli and @jscad/web packages and running the postInstall.js script, but then after successfully bootstrapping it's running this demo.js script.

      Screenshot 2023-08-10 205812.png

      My goal is to create a prompt input area in the editor.js section, but we will need a server side capabilities to keep the api key to which ever ai api we send the prompt commands to.

      Fairly easy integration.

      Jason SprouseJ 1 Reply Last reply Reply Quote 0
      • Jason SprouseJ Offline
        Jason Sprouse @Jason Sprouse
        last edited by

        @Jason-Sprouse

        It's not node based, and just uses a minified compiled version of jscad.

        <body>
            <noscript>
              <h1>Please enable JavaScript to use this website</h1>
            </noscript>
            <div id='jscad'></div>
            <script language="javascript" src="./dist/jscad-web.min.js"></script> 
            <script language="javascript">
              const el1 = document.getElementById('jscad')
              const jscadInst1 = jscadWeb(el1, {name: 'jscad1'})
            </script>
            <script language="javascript">
              window.addEventListener('beforeunload', (event) => {
                event.preventDefault()
                event.returnValue = ''
              })
            </script>
          </body>
        
        Jason SprouseJ 1 Reply Last reply Reply Quote 0
        • Jason SprouseJ Offline
          Jason Sprouse @Jason Sprouse
          last edited by

          @Jason-Sprouse

          Screenshot 2023-08-10 235719.png

          z3devZ 1 Reply Last reply Reply Quote 0
          • z3devZ Offline
            z3dev @Jason Sprouse
            last edited by z3dev

            @Jason-Sprouse what you installed was the WHOLE project, which requires NODEJS, NPM, etc. you will find the code for the CLI and the WEBUI. Once setup, you can change the code, run tests, add new functionality, etc. The packages are linked together.

            The CLI can be installed directly from NPM. See the README for the CLI.

            https://github.com/jscad/OpenJSCAD.org/tree/master/packages/cli

            Jason SprouseJ 1 Reply Last reply Reply Quote 0
            • Jason SprouseJ Offline
              Jason Sprouse @z3dev
              last edited by

              @z3dev The only reason I wanted the cli was node.js to access environment variables server side.

              z3devZ 1 Reply Last reply Reply Quote 0
              • z3devZ Offline
                z3dev @Jason Sprouse
                last edited by

                @Jason-Sprouse hmm...

                The website doesn't have a backend service/process. Everything is handled by the browser, including loading designs.

                The only trick is for designs provided an a URL parameter. In this case, the URL is posted to a little script that reads the contents, stores the file locally, and returns the URL to the local file.

                Of course, some other backend service could be added.

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • First post
                  Last post
                Powered by NodeBB | Contributors