Giter Club home page Giter Club logo

ch5-basic's Introduction

Basic Crestron CH5 Example

This example shows very basic usage of the Crestron Com Package with Vanilla JS. Its designed to help those just starting out learn some of the basics of taking HTML, CSS, and Javascript files communicate via a TSW touch panel to a processor. I've tried to put as many comments as possible in these files. As I add more examples I will be putting them into different branches and will update this readme on which branch shows what example.

Youtube WalkThrough Link

(https://youtu.be/RphhQH5DOYo)

Initial Setup

  1. If you don't have Node.js installed please install it prior to the steps below (https://nodejs.org/en/)

  2. Verify you have node installed: node -v

  3. Install dependancies: npm install this will install the Crestron Com Library

  4. Install dev dependancy: npm i parcel-bundler --save-dev I'm using Parcel for running the dev server as well as building the project in preparation for archiving to ch5z file.

  5. Open the project in VSCode [Make sure you have at least the Crestron Components extension installed in VSCode. I've notated some additional suggestions below] - Prettier - npm intellisense - path intellisense - html snippets

  6. Fix issue with Crestron's Com Library that prevents importing direct into index.js file

    • Open the following file: node_modules/@crestron/ch5-crcomlib/package.json
    • Replate "types": "build_bundles/umd/@types/index.d.ts"
    • With "types": "build_bundles/cjs/@types/index.d.ts", "main": "build_bundles/cjs/cr-com-lib.js",
  7. To start the project run npm run start Parcel will start and build the project for testing the html, css, and javascript

  8. Open "http://localhost:1234" in your browser Parcel provides hot reloading so you never have to refresh your browser. Whenever you make a change in your code it automatically rebuild and update in the browser

  9. Creating TSW file

    • run npm run build This will build the project so its ready for archiving
    • run npm run build:archive This will create the tsw file and put in the dist folder

Folder Structure of Project

├── assets
│   ├── css
           └── styles.css
│  └── js
          └── index.js
├── index.html
├── package.json

ch5-basic's People

Contributors

clouddrivensolutions avatar

Watchers

James Cloos avatar

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.