From 9c1bc58dac66abc0b1912f40c7924b860bd2ed9d Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Thu, 17 Oct 2019 16:28:23 +0200 Subject: [PATCH 1/6] make callbackery work with qooxdoo 6 and node --- .gitignore | 6 +- lib/CallBackery.pm | 7 +- .../source/class/callbackery/ui/Login.js | 84 ++++++++++-------- .../Author/generate/callbackery_app.pm | 4 +- .../generate/callbackery_app/.gitignore | 4 +- .../generate/callbackery_app/Makefile.am | 45 +++++----- .../generate/callbackery_app/PERL_MODULES | 7 +- .../callbackery_app/bin/source-mode.sh | 5 +- .../generate/callbackery_app/configure.ac | 86 +++++++++++-------- .../generate/callbackery_app/etc/app.cfg | 4 +- .../callbackery_app/frontend/Makefile.am | 28 +++--- .../callbackery_app/frontend/Manifest.json | 30 +++---- .../callbackery_app/frontend/compile.js | 24 ++++++ .../callbackery_app/frontend/compile.json | 36 ++++++++ .../callbackery_app/frontend/package.json | 5 ++ .../frontend/source/index.html | 17 ---- .../callbackery_app/thirdparty/Makefile.am | 14 +-- 17 files changed, 249 insertions(+), 157 deletions(-) create mode 100644 lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.js create mode 100644 lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.json create mode 100644 lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/package.json delete mode 100644 lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/source/index.html diff --git a/.gitignore b/.gitignore index 11f9f023..81687b0a 100644 --- a/.gitignore +++ b/.gitignore @@ -18,8 +18,10 @@ nytprof.out *.o *.bs thirdparty/ +frontend/compiled/ +t/callbackery.cfg.secret +my-call-backery-app/ *.gz *.tar dist.sh -t/callbackery.cfg.secret -*~ \ No newline at end of file +*~ diff --git a/lib/CallBackery.pm b/lib/CallBackery.pm index 8ffcd051..e61c6309 100644 --- a/lib/CallBackery.pm +++ b/lib/CallBackery.pm @@ -34,7 +34,7 @@ use CallBackery::Plugin::Doc; use CallBackery::Database; use CallBackery::User; -our $VERSION = '0.18.2'; +our $VERSION = '0.19.0'; use Mojo::Base 'Mojolicious'; @@ -134,6 +134,10 @@ sub startup { $app->log->handle($file); } + unshift @{$app->static->paths}, + $app->home->rel_file('frontend').'/compiled/source/' + if $app->mode eq 'development'; # Router + # properly figure your own path when running under fastcgi $app->hook( before_dispatch => sub { my $c = shift; @@ -163,6 +167,7 @@ sub startup { } $app->secrets([ path($app->config->secretFile)->slurp ]); + my $routes = $app->routes; diff --git a/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/Login.js b/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/Login.js index 536ae3b4..f9e3dd03 100644 --- a/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/Login.js +++ b/lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/Login.js @@ -21,6 +21,7 @@ qx.Class.define("callbackery.ui.Login", { construct : function() { this.base(arguments, this.tr("Login")); + this.__iframe = this.__ensureIframe(); // some browsers will be so nice to save the // content of the form elements if they appear inside a form AND // the form has a name (firefox comes to mind). @@ -65,17 +66,17 @@ qx.Class.define("callbackery.ui.Login", { }); } - if (! cfg.hide_password) { + if (! cfg.hide_password) { this.add(new qx.ui.basic.Image("icon/64/status/dialog-password.png").set({ - alignY : 'top', - alignX : 'right' + alignY : 'top', + alignX : 'right' }), { - row : 2, - column : 0, - rowSpan : 2 + row : 2, + column : 0, + rowSpan : 2 }); - } + } this.add(new qx.ui.basic.Label(this.tr("User")), { row : 2, @@ -91,11 +92,11 @@ qx.Class.define("callbackery.ui.Login", { column : 2 }); - var login; - if (! cfg.hide_password) { + var login; + if (! cfg.hide_password) { this.add(new qx.ui.basic.Label(this.tr("Password")), { row : 3, - column : 1 + column : 1 }); var password = new qx.ui.form.PasswordField(); @@ -104,13 +105,13 @@ qx.Class.define("callbackery.ui.Login", { this.add(password, { row : 3, - column : 2 + column : 2 }); login = new qx.ui.form.Button(this.tr("Login"), "icon/16/actions/dialog-ok.png"); - } - else { + } + else { login = new qx.ui.form.Button(this.tr("OK"), "icon/16/actions/dialog-ok.png"); - } + } login.set({ marginTop : 6, @@ -125,7 +126,7 @@ qx.Class.define("callbackery.ui.Login", { }); if ( cfg.company_name && !cfg.hide_company){ - var who = ''; + var who = ''; if (cfg.company_url){ who += '' + cfg.company_name + ''; } @@ -133,16 +134,16 @@ qx.Class.define("callbackery.ui.Login", { who += cfg.company_name; } } - if (! cfg.hide_release) { + if (! cfg.hide_release) { this.add(new qx.ui.basic.Label(this.tr('release %1, %2 by %3','#VERSION#','#DATE#',who)).set({ textColor : '#444', - rich : true + rich : true }), { - row : 5, - column : 0, - colSpan: 3 + row : 5, + column : 0, + colSpan: 3 }); - } + } this.addListener('keyup', function(e) { if (e.getKeyIdentifier() == 'Enter') { @@ -155,14 +156,14 @@ qx.Class.define("callbackery.ui.Login", { login.addListener("execute", function(e) { this.setEnabled(false); - var id = this.__getIframe(); + var doc = this.__getIframeDocument(); // save the username and password to our hidden iframe form - id.getElementById("cbUsername").value = username.getValue(); - var passwordValue; - if (! cfg.hide_password) { - passwordValue = password.getValue(); - id.getElementById("cbPassword").value = passwordValue; - } + doc.getElementById("cbUsername").value = username.getValue(); + var passwordValue; + if (! cfg.hide_password) { + passwordValue = password.getValue(); + doc.getElementById("cbPassword").value = passwordValue; + } rpc.callAsync(qx.lang.Function.bind(this.__loginHandler, this), 'login', username.getValue(), passwordValue @@ -171,9 +172,9 @@ qx.Class.define("callbackery.ui.Login", { this); this.addListener('appear', function() { - if (! cfg.hide_password) { - password.setValue(''); - } + if (! cfg.hide_password) { + password.setValue(''); + } this.setEnabled(true); if (username.getValue()){ username.set({ @@ -181,10 +182,10 @@ qx.Class.define("callbackery.ui.Login", { readOnly: true, focusable: false }); - if (! cfg.hide_password) { + if (! cfg.hide_password) { password.focus(); password.activate(); - } + } } else { username.focus(); @@ -207,15 +208,28 @@ qx.Class.define("callbackery.ui.Login", { * @param exc {Exception} any error found during the login process. * @return {void} */ - __getIframe: function(){ + __iframe: null, + __ensureIframe: function(){ var iframe = document.getElementById("cbLoginIframe"); + if (!iframe) { + iframe = qx.dom.Element.create('iframe',{ + id: "cbLoginIframe", + src: "login", + style: "width:0px;height:0px;border:0px;" + }); + document.body.appendChild(iframe); + } + return iframe; + }, + __getIframeDocument: function(){ + var iframe = this.__iframe; return iframe.contentWindow ? iframe.contentWindow.document : iframe.contentDocument; }, __loginHandler : function(ret, exc) { if (exc == null) { if (qx.lang.Type.isObject(ret) && ret.sessionCookie) { // submit the iframe form to trigger the browser to save the password - this.__getIframe().getElementById('cbLoginForm').submit(); + this.__getIframeDocument().getElementById('cbLoginForm').submit(); this.fireDataEvent('login', ret); this.close(); } diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app.pm b/lib/Mojolicious/Command/Author/generate/callbackery_app.pm index cb41aeef..8f14e927 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app.pm +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app.pm @@ -67,10 +67,12 @@ EOF 'frontend/Makefile.am' => 'frontend/Makefile.am', 'frontend/Manifest.json' => 'frontend/Manifest.json', 'frontend/config.json' => 'frontend/config.json', + 'frontend/compile.json' => 'frontend/compile.json', + 'frontend/compile.js' => 'frontend/compile.js', + 'frontend/package.json' => 'frontend/package.json', 'frontend/source/class/app/Application.js' => 'frontend/source/class/'.$qxclass.'/Application.js', 'frontend/source/class/app/__init__.js' => 'frontend/source/class/'.$qxclass.'/__init__.js', 'frontend/source/class/app/theme/Theme.js' => 'frontend/source/class/'.$qxclass.'/theme/Theme.js', - 'frontend/source/index.html' => 'frontend/source/index.html', 't/basic.t' => 't/basic.t', }; diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/.gitignore b/lib/Mojolicious/Command/Author/generate/callbackery_app/.gitignore index 55b6eb9d..f530ab69 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/.gitignore +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/.gitignore @@ -15,6 +15,7 @@ thirdparty/* Build.bat .last_cover_stats Makefile +Makefile.in Makefile.old MANIFEST.bak /META.yml @@ -26,5 +27,6 @@ nytprof.out *.bs /_eumm/ public/ -config.* +/config.* etc/*.cfg +/frontend/compiled/ \ No newline at end of file diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/Makefile.am b/lib/Mojolicious/Command/Author/generate/callbackery_app/Makefile.am index c354ffdb..714a25d9 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/Makefile.am +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/Makefile.am @@ -4,20 +4,18 @@ AUTOMAKE_OPTIONS = foreign -SUBDIRS = thirdparty lib etc frontend bin +SUBDIRS = bin lib thirdparty etc frontend -PUB := $(shell find public -type d -name ".??*" -prune -o -not -name ".*" -a -not -name "*~" -a -not -name "*.tmp" -a -type f -print ) +BIN = bin/$(MJ_SCRIPT).pl +PUB := $(shell find public -type d -name ".??*" -prune -o -not -name ".*" -a -not -name "*~" -a -not -name "*.tmp" -a -type f -print ) TEMPL := $(shell test -d templates && find templates -type f -name "*.ep") -SHARE := $(shell test -d share && find share -type f -name "*.po") +SHARE := $(shell test -d share && find share -type f -name "*") PERLTESTS := $(shell find t -name "*.t") +PM := $(shell find lib -name "*.pm") -THIRDPARTY_DIR := $(shell pwd)/thirdparty - -EXTRA_DIST = VERSION PERL_MODULES COPYRIGHT LICENSE CHANGES AUTHORS bootstrap $(PUB) \ - $(wildcard t/*.t) $(POD) $(TEMPL) $(PERLTESTS) $(SHARE) - +EXTRA_DIST = VERSION PERL_MODULES COPYRIGHT LICENSE CHANGES AUTHORS bootstrap $(PUB) $(wildcard t/*.t) $(BIN) $(POD) $(TEMPL) $(PERLTESTS) Dockerfile $(SHARE) share/po/messages.po YEAR := $(shell date +%Y) DATE := $(shell date +%Y-%m-%d) @@ -25,25 +23,30 @@ DATE := $(shell date +%Y-%m-%d) datadir = $(prefix) nobase_data_DATA = $(PUB) $(TEMPL) $(SHARE) -all-local: - $(GMAKE) public/script/$(QX_CLASS).js - -README COPYRIGHT: VERSION - $(PERL) -i -p -e 's/(#VERSION#|\d+\.\d+\.\d+[^.\s]*)/$(PACKAGE_VERSION)/g;s/(#YEAR#|20[1-4]\d)/$(YEAR)/g;s/(#DATE#|20[1-9]\d-[01]\d-[0-3]\d)/$(DATE)/g;' $@ +README.md COPYRIGHT: VERSION + $(PERL) -i -p -e 's/(#VERSION#|\d+\.\d+\.\d+[^.\s]*)/$(PACKAGE_VERSION)/g;s/(#YEAR#|20[1-9]\d)/$(YEAR)/g;s/(#DATE#|20[1-9]\d-[01]\d-[0-3]\d)/$(DATE)/g;' $@ dist-hook: - $(PERL) -i -p -e 's/#VERSION#/$(PACKAGE_VERSION)/g;s/#YEAR#/$(YEAR)/g;s/#DATE#/$(DATE)/g;' $(distdir)/public/index.html $(distdir)/public/script/$(QX_CLASS).js + $(PERL) -i -p -e 's/#VERSION#/$(PACKAGE_VERSION)/g;s/#YEAR#/$(YEAR)/g;s/#DATE#/$(DATE)/g;' $(distdir)/public/$(QX_CLASS)/*.js $(PERL) -i -p -e 's/\$$VERSION\s*=\s*".+?";/\$$VERSION = "$(PACKAGE_VERSION)";/;' $(distdir)/lib/$(MJ_CLASS).pm -test: - $(PERL) "-MExtUtils::Command::MM" "-e" "test_harness(0, 'lib','thirdparty/lib/perl5')" t/*.t +install-exec-hook: + [ "$(PERL5LIB)" == "" ] || cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{.*# PERL5LIB}{use lib qw($(PERL5LIB)); # PERL5LIB}' $(BIN) || true + cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{.*# LIBDIR}{use lib qw($(libdir)); # LIBDIR}' $(BIN) + cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{^#!.*perl.*}{#!$(PERL)};' $(BIN) +all-local: share/messages.pot -if BUILD_QOOXDOO_APP +clean-local: + rm share/messages.pot -CALLBACKERY_PATH := $(shell PERL5LIB=lib:$(PERL5LIB):thirdparty/lib/perl5 $(PERL) -e 'use File::Basename;use Cwd qw(realpath); eval { require CallBackery }; print !$$@ ? realpath(dirname($$INC{q{CallBackery/Config.pm}}).q{/qooxdoo}) : "CALLBACKERY_NOT_FOUND" ' ) +share/messages.pot: $(PM) + mkdir -p share + $(XGETTEXT) --language=perl --package-name=$(PACKAGE) --package-version=$(VERSION) --from-code=UTF-8 --keyword=trm:1 --output=share/messages.pot $(PM) + for lang in share/*.po; do \ + $(MSGMERGE) -U $$lang share/messages.pot; \ + done -public/script/$(QX_CLASS).js: $(shell find frontend/source $(CALLBACKERY_PATH) -type f ) frontend/config.json config.status - cd frontend && $(QOOXDOO_PATH)/tool/bin/generator.py -m QOOXDOO_PATH:$(QOOXDOO_PATH) -m CALLBACKERY_PATH:$(CALLBACKERY_PATH) -m CACHE:./cache -m BUILD_PATH:../public build -endif +test: + prove -w diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/PERL_MODULES b/lib/Mojolicious/Command/Author/generate/callbackery_app/PERL_MODULES index 68704a57..2d6a44b3 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/PERL_MODULES +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/PERL_MODULES @@ -1,3 +1,4 @@ -CallBackery@0.14.2 -Mojo::SQLite@3.000 -PPI +% my $p = shift; +% use CallBackery; +CallBackery@<%= $CallBackery::VERSION %> +Mojo::SQLite \ No newline at end of file diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/bin/source-mode.sh b/lib/Mojolicious/Command/Author/generate/callbackery_app/bin/source-mode.sh index 5a6aa52f..2aac5f3d 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/bin/source-mode.sh +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/bin/source-mode.sh @@ -1,8 +1,5 @@ % my $p = shift; #!/bin/sh -export QX_SRC_MODE=1 -# relative to the application home -export QX_SRC_PATH=frontend/source export MOJO_MODE=development export MOJO_LOG_LEVEL=debug -exec ./<%= $p->{name} %>.pl prefork --listen 'http://*:<%= int(rand()*5000+3024) %>' +exec `dirname $0`/<%= $p->{name} %>.pl prefork --listen 'http://*:<%= int(rand()*5000+3024) %>' diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/configure.ac b/lib/Mojolicious/Command/Author/generate/callbackery_app/configure.ac index 75210cb1..dd10448b 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/configure.ac +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/configure.ac @@ -9,6 +9,7 @@ MJ_CLASS=<%= $p->{class} %> MJ_SCRIPT=<%= $p->{name} %> QX_CLASS=<%= $p->{qxclass} %> + AC_SUBST(MJ_CLASS) AC_SUBST(MJ_SCRIPT) AC_SUBST(QX_CLASS) @@ -25,6 +26,13 @@ AC_ARG_VAR(PERL, [Path to local perl binary]) AC_PATH_PROG(PERL, perl, no) AC_PATH_PROG(CURL, curl, no) AC_PATH_PROG(WGET, wget, no) +AC_ARG_VAR(NODE, [Path to local node binary]) +AC_PATH_PROG(NODE, node, no) +AC_PATH_PROG(NPM, npm, no) +AC_PATH_PROG(NPX, npx, no) +AC_PATH_PROG(XGETTEXT, xgettext, no) +AC_PATH_PROG(MSGMERGE, msgmerge, no) + URL_CAT="neither curl nor wget found" @@ -38,15 +46,14 @@ fi AC_SUBST(URL_CAT) +ac_perl_version="5.22.0" -ac_perl_version="5.10.1" - -if test "x$PERL" != "x"; then +if test -x "$PERL"; then AC_MSG_CHECKING(for perl version greater than or equal to $ac_perl_version) $PERL -e "use $ac_perl_version;" >/dev/null 2>&1 if test $? -ne 0; then AC_MSG_RESULT(no); - AC_MSG_ERROR(at least version 5.10.1 is required to run mojolicious) + AC_MSG_ERROR(at least version ${ac_perl_version} is required to run mojolicious) else AC_MSG_RESULT(ok); fi @@ -54,6 +61,29 @@ else AC_MSG_ERROR(could not find perl) fi +ac_node_version="10" + +if test -x "$NODE"; then + AC_MSG_CHECKING(make sure we have at least node ${ac_node_version}) + case `$NODE --version` in + v10*) + AC_MSG_RESULT(ok) + ;; + *) + AC_MSG_RESULT(no); + NODE= + esac +fi + +AM_CONDITIONAL(BUILD_QOOXDOO_APP,[test -x $NODE]) + +AC_PATH_PROG(OPENSSL, openssl, no) +if test -x "$OPENSSL"; then +: +else + AC_MSG_ERROR(could not find openssl binary) +fi + AC_MSG_CHECKING(is perl reasonably complete) if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then AC_MSG_RESULT(yes. ExtUtils::MakeMaker is available); @@ -97,43 +127,28 @@ AC_ARG_ENABLE(pkgonly, AC_SUBST(enable_pkgonly) actual_prefix=$prefix -if test x$actual_prefix = xNONE; then +if test "$actual_prefix" = "NONE"; then actual_prefix=$ac_default_prefix fi AC_MSG_CHECKING([Checking Install Prefix]) -if test -f $actual_prefix/configure; then +if test -f "$actual_prefix/configure"; then AC_MSG_ERROR([The install prefix must NOT point to the directory where you unpacked the source.]) else AC_MSG_RESULT([install Prefix is fine]) fi +AC_ARG_VAR(CALLBACKERY_QX, [Alternate CallBackery/qooxdoo folder location]) +if test "$CALLBACKERY_QX" = ""; then + script_path=`readlink -f "$0"` + # Absolute path this script is in, thus /home/user/bin + CALLBACKERY_QX=`dirname "$script_path"`/thirdparty/lib/perl5/CallBackery/qooxdoo +fi +AC_SUBST(CALLBACKERY_QX) AC_ARG_VAR(PERL5LIB, [Colon separated list of perl library directories]) AC_SUBST(PERL5LIB) -QOOXDOO_PATH= -AC_ARG_WITH(qooxdoo-sdk-dir,AC_HELP_STRING([--with-qooxdoo-sdk-dir=DIR],[Where can we find the qooxdoo sdk (required to rebuild the web ui)]), [ - if test -d $withval/framework; then - QOOXDOO_PATH=$withval - else - cat <{name} %>/logo.png -logo_small = ../resource/<%= $p->{name} %>/logo-small.png +# logo = ../resource/<%= $p->{name} %>/logo.png +# logo_small = ../resource/<%= $p->{name} %>/logo-small.png title = Song List initial_plugin = Songs company_name = OETIKER+PARTNER AG diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Makefile.am b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Makefile.am index ff87fe6f..fc718f8f 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Makefile.am +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Makefile.am @@ -2,25 +2,27 @@ AUTOMAKE_OPTIONS=foreign -EXTRA_DIST = config.json Manifest.json source/index.html \ - $(shell find source/class source/resource source/translation -type d \( -name ".??*" -o -name "build" \) -prune -o -not -name ".*" -a -not -name "*~" -a -not -name "*.tmp" -a -type f -print ) +EXTRA_DIST = $(shell find . -type d \( -name ".??*" -o -name "complied" -o -name "node_modules" \) -prune -o -not -name ".*" -a -not -name "*~" -a -not -name "*.tmp" -a -type f -print ) if BUILD_QOOXDOO_APP -CALLBACKERY_PATH := $(shell PERL5LIB=../lib:$(PERL5LIB):../thirdparty/lib/perl5 $(PERL) -e 'use File::Basename;use Cwd qw(realpath); eval { require CallBackery }; print !$$@ ? realpath(dirname($$INC{q{CallBackery/Config.pm}}).q{/qooxdoo}) : "CALLBACKERY_NOT_FOUND" ' ) +all-local: build -GENTARGETS := lint pretty migration translation api source-all source-hybrid source +node_modules: + $(NPM) i -.PHONY: $(GENTARGETS) +source: node_modules + CALLBACKERY_QX=$(CALLBACKERY_QX) $(NPX) qx compile --feedback=false --erase -$(GENTARGETS): $(shell find source/class/ $(CALLBACKERY_PATH) -type f) config.json - $(QOOXDOO_PATH)/tool/bin/generator.py -m QOOXDOO_PATH:$(QOOXDOO_PATH) -m CALLBACKERY_PATH:$(CALLBACKERY_PATH) -m CACHE:./cache $@ +source-watch: node_modules + CALLBACKERY_QX=$(CALLBACKERY_QX) $(NPX) qx compile --watch --feedback=false --erase -all-local: source +build: node_modules ../public/versions.json -endif +clean: node_modules + $(NPX) qx clean + +../public/versions.json: $(EXTRA_DIST) + CALLBACKERY_QX=$(CALLBACKERY_QX) $(NPX) qx compile --target=build --feedback=false --erase -# clean-local: -deepclean: - test -d ./cache && rm -r ./cache || true - test -f source/script/$(QX_CLASS).js && rm source/script/* || true +endif diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json index 3d58bf1a..f598d6fc 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json @@ -1,35 +1,31 @@ % my $p = shift; { + "$schema": "https://raw.githubusercontent.com/qooxdoo/qooxdoo-compiler/master/source/resource/qx/tool/schema/Manifest-1-0-0.json", "info" : { "name" : "<%= $p->{class} %>", - "summary" : "<%= $p->{class} %> web app", "description" : "A generic Callbackery app.", - - "homepage" : "https://github.com/oetiker/qx-mojo-app", - + "homepage" : "https://your-homepage", "license" : "???", - "authors" : - [ - { - "name" : "<%= "$p->{fullName} ($p->{userName})" %>", - "email" : "<%= $p->{email} %>" - } + "authors" : [ + { + "name" : "<%= "$p->{fullName} ($p->{userName})" %>", + "email" : "<%= $p->{email} %>" + } ], - - "version" : "#VERSION#", - "qooxdoo-versions": ["5.0"] + "version" : "0.0.1" }, - "provides" : { "namespace" : "<%= $p->{qxclass} %>", "encoding" : "utf-8", "class" : "source/class", "resource" : "source/resource", - "translation" : "source/translation", - "type" : "application" + "translation" : "source/translation" + }, + "requires": { + "@qooxdoo/framework": "^6.0.0-beta", + "@qooxdoo/compiler" : "^1.0.0-beta" } } - diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.js b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.js new file mode 100644 index 00000000..99a054ee --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.js @@ -0,0 +1,24 @@ +qx.Class.define("callbackery.compile.CompilerApi", { + extend: qx.tool.cli.api.CompilerApi, + members: { + async load() { + let config = await this.base(arguments); + if (!config.libraries) { + config.libraries = ['.']; + } + let cbr = process.env.CALLBACKERY_QX; + if (cbr) { + ["callbackery","uploadwidget"].forEach(dir => { + config.libraries.push(cbr+"/"+dir); + + }); + } + return config; + } + } +}); + + +module.exports = { + CompilerApi: callbackery.compile.CompilerApi +}; diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.json b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.json new file mode 100644 index 00000000..0daa9e31 --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.json @@ -0,0 +1,36 @@ +% my $p = shift; +{ + "$schema": "https://raw.githubusercontent.com/qooxdoo/qooxdoo-compiler/master/source/resource/qx/tool/schema/compile-1-0-0.json", + "targets": [ + { + "type": "source", + "outputPath": "compiled/source", + "bundle": { + "include": "qx.*" + }, + "babelOptions": { + "targets": "Chrome >= 76, Firefox >= 68, edge >= 18" + } + }, + { + "type": "build", + "outputPath": "../public", + "babelOptions": { + "targets": "Chrome >= 76, Firefox >= 68, edge >= 18" + } + } + ], + "defaultTarget": "source", + "locales": ["en","de","fr","it"], + "environment": { + "qx.icontheme": "Tango" + }, + "applications": [ + { + "class": "<%= $p->{qxclass} %>.Application", + "theme": "<%= $p->{qxclass} %>.theme.Theme", + "name": "<%= $p->{qxclass} %>", + "bootPath": "source/boot" + } + ] +} diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/package.json b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/package.json new file mode 100644 index 00000000..b87cdc3e --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "@qooxdoo/compiler": "^1.0.0-beta" + } +} diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/source/index.html b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/source/index.html deleted file mode 100644 index 6b63765e..00000000 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/source/index.html +++ /dev/null @@ -1,17 +0,0 @@ -% my $p = shift; - - - - - - - - <%= $p->{class} %> - - -
loading <%= $p->{class} %> ...
- - - - - diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/thirdparty/Makefile.am b/lib/Mojolicious/Command/Author/generate/callbackery_app/thirdparty/Makefile.am index d64eba2e..b996c67d 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/thirdparty/Makefile.am +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/thirdparty/Makefile.am @@ -12,15 +12,15 @@ EXTRA_DIST = $(THIRDPARTY_DIST) $(wildcard bin/cpanm) all-local: touch touch: CPAN/touch ../config.status ../PERL_MODULES - $(AM_V_GEN)cat ../PERL_MODULES | PERL_CPANM_HOME=$(THIRDPARTY_DIR) xargs $(PERL) $(THIRDPARTY_DIR)/bin/cpanm -q --notest --local-lib-contained $(THIRDPARTY_DIR) --mirror file://$(THIRDPARTY_DIR)/CPAN --mirror-only + $(AM_V_GEN)cat ../PERL_MODULES | grep -v '#' | PERL_CPANM_HOME=$(THIRDPARTY_DIR) xargs $(PERL) $(THIRDPARTY_DIR)/bin/cpanm -q --notest --local-lib-contained $(THIRDPARTY_DIR) --mirror file://$(THIRDPARTY_DIR)/CPAN --mirror-only $(AM_V_GEN)touch touch CPAN/touch: ../PERL_MODULES echo "POPULATING OUR LOCAL micro CPAN" $(AM_V_GEN)$(URL_CAT) https://cpanmin.us | PERL_CPANM_HOME=$(THIRDPARTY_DIR) $(PERL) - -q --notest --local-lib $(THIRDPARTY_DIR) --save-dists $(THIRDPARTY_DIR)/CPAN --force App::cpanminus - $(AM_V_GEN)PERL5LIB=$(THIRDPARTY_DIR)/Ore/lib/perl5 PERL_CPANM_HOME=$(THIRDPARTY_DIR)/Ore $(THIRDPARTY_DIR)/bin/cpanm -q --notest --local-lib $(THIRDPARTY_DIR)/Ore File::Which OrePAN - $(AM_V_GEN)cat ../PERL_MODULES | PERL_CPANM_HOME=$(THIRDPARTY_DIR) xargs $(PERL) $(THIRDPARTY_DIR)/bin/cpanm -q --self-contained --notest --local-lib-contained $(THIRDPARTY_DIR) --save-dists $(THIRDPARTY_DIR)/CPAN - $(AM_V_GEN)PERL5LIB=$(THIRDPARTY_DIR)/Ore/lib/perl5 $(THIRDPARTY_DIR)/Ore/bin/orepan_index.pl --repository $(THIRDPARTY_DIR)/CPAN + $(AM_V_GEN)PERL_CPANM_HOME=$(THIRDPARTY_DIR)/Ore $(THIRDPARTY_DIR)/bin/cpanm -q --notest --local-lib $(THIRDPARTY_DIR)/Ore File::Which OrePAN + $(AM_V_GEN)cat ../PERL_MODULES | grep -v '#' | PERL_CPANM_HOME=$(THIRDPARTY_DIR) xargs $(PERL) $(THIRDPARTY_DIR)/bin/cpanm -q --self-contained --notest --local-lib-contained $(THIRDPARTY_DIR) --save-dists $(THIRDPARTY_DIR)/CPAN + - $(AM_V_GEN)PERL5LIB=$(THIRDPARTY_DIR)/Ore/lib/perl5 $(THIRDPARTY_DIR)/Ore/bin/orepan_index.pl --repository $(THIRDPARTY_DIR)/CPAN 2>&1 | egrep -v 'INFO.*Ore|uninitialized|Useless' # Ore fails to extract the version form DBI $(AM_V_GEN)gunzip -c CPAN/modules/02packages.details.txt.gz | perl -pe 's{^(DBI\s+)undef(\s+\S+/DBI-)(\d+\.\d+)(\.tar)}{$$1$$3$$2$$3$$4}' | gzip | cat > x.gz && mv x.gz CPAN/modules/02packages.details.txt.gz $(AM_V_GEN)touch CPAN/touch @@ -29,4 +29,8 @@ clean-local: ls -1 | grep -v Makefile | grep -v bin | grep -v CPAN | xargs rm -rf distclean-local: - ls -1 | grep -v Makefile | xargs rm -rf + ls -1 | grep -v Makefile | xargs rm -rf + +install-exec-hook: + cp -fr lib/perl5/* $(DESTDIR)$(libdir) + From 851bf950f307746e37f30933c35ccefb63cb2811 Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Thu, 17 Oct 2019 16:30:22 +0200 Subject: [PATCH 2/6] make travis test more --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9691cda2..fa570680 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,8 @@ script: - perl Makefile.PL - make thirdparty - make - - perl -I./thirdparty/lib/perl5/ -I./lib thirdparty/bin/mojo generate callbackery_app - + - perl -I./thirdparty/lib/perl5/ -I./lib thirdparty/bin/mojo generate callbackery_app + - cd my-call-backery-app + - ./configure + - make From 73ac34439203f4417eaa02725764aebeb968eae0 Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Thu, 17 Oct 2019 16:52:49 +0200 Subject: [PATCH 3/6] updated docs --- .travis.yml | 2 +- CHANGES | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fa570680..58e17a47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ sudo: false language: perl perl: - - "5.22" - "5.24" - "5.26" + - "5.28" before_install: - cpanm --notest diff --git a/CHANGES b/CHANGES index 6f862ab4..4869eba3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +0.19.0 2019-10-17 16:51:43 +0200 Tobias Oetiker + + - make callbackery work with qx6 and the new node based qooxdoo compiler + get the gooddies by running the generator to creat a new app. + 0.18.2 2019-09-10 15:14:45 +0200 Tobias Oetiker - added french translation From 375f9cbb34f185c6f08934330cff6cc0810d6feb Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Thu, 17 Oct 2019 16:55:34 +0200 Subject: [PATCH 4/6] add node --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 58e17a47..26c540f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,8 @@ perl: before_install: - cpanm --notest Devel::Cover::Report::Coveralls + - nvm install 10 + - nvm use 10 script: - cover -test -report coveralls From ef842812e266ecee0d1ee0400d552d3154d5fc0c Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Thu, 17 Oct 2019 17:27:08 +0200 Subject: [PATCH 5/6] install current cb --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 26c540f8..140e0187 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,5 +21,6 @@ script: - perl -I./thirdparty/lib/perl5/ -I./lib thirdparty/bin/mojo generate callbackery_app - cd my-call-backery-app - ./configure + - curl https://cpanmin.us | PERL_CPANM_HOME=`pwd`/thirdparty perl - -q --notest --local-lib `pwd`/thirdparty --save-dists `pwd`/thirdparty --force `pwd`/.. - make From 0e2bafc0767e23fd448bf2b309124a29473915ba Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Thu, 17 Oct 2019 18:14:17 +0200 Subject: [PATCH 6/6] can't build --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 140e0187..d38c16a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,6 @@ script: - perl -I./thirdparty/lib/perl5/ -I./lib thirdparty/bin/mojo generate callbackery_app - cd my-call-backery-app - ./configure - - curl https://cpanmin.us | PERL_CPANM_HOME=`pwd`/thirdparty perl - -q --notest --local-lib `pwd`/thirdparty --save-dists `pwd`/thirdparty --force `pwd`/.. - - make + # - curl https://cpanmin.us | PERL_CPANM_HOME=`pwd`/thirdparty perl - -q --notest --local-lib `pwd`/thirdparty --save-dists `pwd`/thirdparty --force `pwd`/.. + # - make