babel plugin for gjs
For best results, run transpiled code with CGJS
Please ★ this repo if you found it useful ★ ★ ★
class MyWindow extends Gtk.Window {
constructor() {
super({ title: 'Hello World' });
this.button = new Gtk.Button({ label: 'Click here' });
this.button.connect('clicked', this.handleClicked);
this.add(this.button);
}
handleClicked() {
console.log('Button clicked');
}
}
const GObject = imports.gi.GObject;
const MyWindow = GObject.registerClass(
class MyWindow extends Gtk.Window {
_init() {
super._init({ title: 'Hello World' });
this.button = new Gtk.Button({ label: 'Click here' });
this.button.connect('clicked', this.handleClicked);
this.add(this.button);
}
handleClicked() {
console.log('Button clicked');
}
}
);
npm install --save-dev babel-plugin-gjs
.babelrc
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "4"
}
}
]
],
"plugins": ["gjs"]
}
babel src -d lib
cgjs lib
Submit an issue
Contribute a screenshot
Review the guidelines for contributing
Jam Risser © 2018
Review the changelog
- Jam Risser - Author
A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.
Add some fuel if you'd like to keep me going!