npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pureqml-core

v1.2.0

Published

QML to HTML5 translator, both for mobile and desktop targets.

Downloads

20

Readme

PureQML::QMLCore: QML to Javascript translator

QmlCore is a simple set of tools we (a small team of QML advocates) use since years to simplify the development of HTML5 UIs for both mobile and desktop devices. It was designed with the original QML in mind, while it's not 100% compatible and improved in some aspects. The main concepts are the same though, so if you're familiar with original QML, you could start right away.

Usage

QmlCore provides a toolchain written in Python using python-future, allowing it to be run on top of both python versions. Normally you don't need to use them directly. build provides a convenient wrapper around them all.

Prerequisites

Any modern Python (2 or 3) will go well. Jinja2 is a different option for templating in case you want more than QML loader in your HTML file, while it's not required for small apps.

To install the requirements run:

$ pip install -r requirements.txt

Simple how-to

  • Create project directory, cd <project-dir>
  • Clone QmlCore to it: git clone [email protected]:pureqml/qmlcore.git
  • Run ./qmlcore/build --boilerplate
  • Look into ./src/app.qml
  • Run ./qmlcore/build Please find the resulting files in build.web/*

How it works

The QML compiler scans source directories for QML files and parses each one. Filename starting with uppercase letter considered component, lowercase instantiated. Project-wide options are stored in the .manifest file. The result of the compilation is a single Javascript file with minimum dependencies (modernizr only), ready to use in mobile and desktop environment and accompanied by sample .html launcher and flash video player.

Manifest options

Manifest is a collection of project-wide hacks we used to botch various projects. Some of them may or may not be useful.

  • templater - template engine to use, only 'simple' and 'jinja2' are supported at the moment
  • web-prefix - see -p option below, specify css rules prefix
  • minify - false/true or compiler name as string, only 'gcc' and 'uglify-js' are supported. google closure compiler requires java to run.
  • platforms use additional platform/*/ files, default and only platform is 'web' for now
  • path - additional directories to search sources for

build tool command line options

  • -m, --minify minify with default option ('uglify-js')
  • -k, --keep keep original source after minification, useful for debugging minification warnings
  • -d, --devel development mode, keep running and wait for changes, requires inotify module
  • -p, --web-prefix web prefix, removed default CSS rules, adds 'qml-' prefix for them, allowing you to interchange HTML/QML.
  • -u, --update-translation update translation files, specified in manifest.languages
  • -j, --jobs run N jobs in parallel
  • --boilerplate initialises bare minimum for quicker kick-off in current directory.

Localisation

QmlCore uses Qt-approach to localisation. You write the code in your default language, then generate/update (build -u) .ts translation files, translate them with qt linguist and compile your project. QmlCore recognizes tr, qsTr, qsTranslate function, as well as QT_TR_NOOP/QT_TRANSLATE_NOOP macros.

Controls library

QmlCore contains a bare minimum of platform controls: Images, texts, rectangles and model-view-delegate classes. Various controls that might be useful are in a separate repository. Just clone it via git clone [email protected]:pureqml/controls.git in your project and that's it!

QML differences

Grammar

We require a semicolon after each statement. This may be changed in future.

Focus

The biggest discrepancy with original QML is how focus is implemented. We're aiming to have "always-consistent" focus everywhere. You have to mark every focus-able component with focus: true; property, and the rest should work without tweaking. We provide several convenient properties to handle focus with ease:

  • activeFocus — this item has current focus and got any user input first
  • focused — this item has current focus in its parent, but not necessarily focused globally

Random customization notes

Adding modernizr features

Please use the following command to get the custom modernizr build page: head -n2 dist/modernizr-custom.js | tail -n1 or just the second line of modernizr-custom.js file

Thanks

Modernizr project

Modernizr tells you what HTML, CSS and JavaScript features the user’s browser has to offer. https://modernizr.com/

SDL Game Controller Database

A community sourced database of game controller mappings https://github.com/gabomdq/SDL_GameControllerDB

Apache Cordova project

Apache Cordova is an open-source mobile development framework. It allows you to use standard web technologies - HTML5, CSS3, and JavaScript for cross-platform development. https://cordova.apache.org