Skip to content

al-bo/stb

 
 

Repository files navigation

STB single page application framework

![Gitter](https://badges.gitter.im/Join Chat.svg)

Provides development environment and base components in a form of CommonJS modules for set-top box software production.

This framework is targeted on the client side and requires a building stage with Webpack or Browserify.

Getting Started

Node.js and NPM should be installed beforehand. Please follow the official instruction.

stb is available as an npm package and should be installed globally:

npm install -g stb

In Linux this can be done as a root:

sudo npm install -g stb

Usage

Create a new folder for your project and move to it:

mkdir myapp
cd myapp

Run the generator from within the new folder:

stb init

This will create all necessary files and folders (with smart conflict resolution mechanism in case there are already some files in the current directory) and install all necessary package dependencies.

To start working with a project it's necessary to make initial build and start all servers:

stb serve

Full list of available commands:

Name Description
init initial creation of all necessary files and folders
serve main entry point - rebuild everything, start all watchers and servers
develop run all development tasks
release run all production tasks
lint analyse JavaScript code for potential errors and problems
static serve files in the build directory
proxy proxy js code execution from a desktop browser to STB
logger WebSocket server to translate log messages from STB to a desktop console
weinre WEb INspector REmote debugger server
img execute all the tasks to remove and copy all images
img:clean remove all images
img:clean:develop remove develop images
img:clean:release remove release images
img:develop remove and copy develop images
img:release remove and copy release images
jade compile all HTML files from Jade sources
jade:clean remove all HTML files
jade:clean:develop remove develop HTML files
jade:clean:release remove release HTML files
jade:develop compile develop HTML files from Jade sources
jade:release compile release HTML files from Jade sources
less compile all Less files into a set of css files with maps
less:clean remove all generated CSS and source-map files
less:clean:develop remove develop generated CSS and source-map files
less:clean:release remove release generated CSS and source-map files
less:develop compile develop Less files into a set of css files with maps
less:release compile release Less files into a set of css files with maps
webpack compile all CommonJS modules into a single js file
webpack:clean remove all JavaScript compiled files
webpack:develop compile develop version of all CommonJS modules into a single js file
webpack:release compile release version of all CommonJS modules into a single js file
webpack:clean:develop remove develop JavaScript compiled files
webpack:clean:release remove release JavaScript compiled files

After the stb serve command the start page should open in the default browser. This page should be accessible remotely on the STB device via http://external_ip_address:8000/ address.

It's possible to suppress a browser opening with

stb serve --noopen

In case remote access to STB device is enabled and configured in application ./config/ssh.js it's possible to activate one of the profiles:

stb serve --profile=develop

This will build and serve as usual but also connect to the STB device by SSH protocol and starts there a web browser with the configured page.

At runtime the development mode has a set of useful function available via keyboard shortcuts:

Keys Description
Numpad . reload the page CSS
Numpad 0 reload the page in the current resolution
Numpad 1 reload the page in NTSC
Numpad 2 reload the page in PAL
Numpad 3 reload the page in 720p
Numpad 4 reload the page in 1080p
Numpad 5 draw debug grid with indicators
Numpad 6 stress-testing based on gremlins.js for the emulation mode
Numpad 7 SpyJS tracing/debugging/profiling activation and deactivation
Numpad 8 FireBug Lite console activation

Structure

Path Description
app contains all framework JavaScript modules and associated Less files
bin main command-line script available globally
config base config files for all servers
doc help files generated from JSDocs comments in framework modules
lib modules required to framework work
tasks gulp tasks to provide all the functionality
test QUnit tests files (units and static)
tpl a new application directory structure and base files

Technologies

Contribution

If you have any problem or suggestion please open an issue here. Pull requests are welcomed with respect to the JavaScript Code Style and included ESLint rules.

License

stb is released under the GPL-3.0 License.

About

STB single page application framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 93.0%
  • CSS 7.0%