some cleanup and tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-01-14 22:23:51 +03:00
parent 892e908594
commit 031168bb2f
8 changed files with 76 additions and 24 deletions

View File

@ -40,6 +40,11 @@
# make can get fussy about...
# NOTE: to do a repack build call:
# (export BUILD_MODE=repack && make)
# NOTE: in most cases we do not add a "/" to target dirs to destinguish
# them from target files except for one case:
# $(BUILD_DIR)/$(APP_NAME)-%/
# this will help make destinguish it from things like:
# $(DIST_DIR)/$(APP_NAME)-%.zip
# NOTE: cross compilation is at this time not supported, if you try it
# and it works then 1) you got very lucky and 2) tell me about it =)
# ...at least the node native packages (sharp) will likely either
@ -81,7 +86,7 @@ VERSION_FALLBACK ?= 4.0.0a
# not work before we do 'npm install'...
VERSION := $(strip $(shell \
node version.js \
|| echo $(VERSION_FALLBACK)))
|| echo $(VERSION_FALLBACK)))
DATE := $(strip $(shell date "+%Y%m%d %H%M"))
COMMIT := $(strip $(shell git rev-parse HEAD))
@ -95,7 +100,7 @@ COMMIT := $(strip $(shell git rev-parse HEAD))
ELECTRON_VERSION_FALLBACK ?= v1.8.1
ELECTRON_VERSION := $(strip $(shell \
electron -v 2> /dev/null \
|| echo $(ELECTRON_VERSION_FALLBACK)))
|| echo $(ELECTRON_VERSION_FALLBACK)))
ELECTRON_DOWNOAD_URL ?= https://github.com/electron/electron/releases/download
ELECTRON_DIST ?= electron-$(ELECTRON_VERSION)-$(TARGET_OS)-$(ARCH).zip
@ -214,36 +219,45 @@ DEPENDENCIES = node npm wget zip unzip zipnote git \
#**********************************************************************
# User targets...
.PHONY: all
all: check dev dist
.PHONY: css
css: $(CSS_FILES)
.PHONY: dev
dev: $(NODE_DIR) css
.PHONY: clean
clean:
$(RM) $(BUILD_DIR)
.PHONY: cleanall
cleanall: clean
$(RM) $(DIST_DIR) $(TARGET_DIR) $(NODE_DIR)
.PHONY: electron-dist
electron-dist: $(DIST_DIR)/$(APP_NAME)-$(VERSION)-$(TARGET_OS)-$(ARCH).zip
#electron-inst: $(DIST_DIR)/$(APP_NAME)-$(VERSION)-$(TARGET_OS)-$(ARCH).msi
.PHONY: dist
dist: electron-dist
.PHONY: web
web: $(DIST_DIR)/$(APP_NAME)-$(VERSION)-web.zip
.PHONY: all css dev clean cleanall dist web dist-in-place \
electron-dist electron-inst electron-dist-in-place
# NOTE: the "/" at the end here is significant...
.PHONY: repack-dir
repack-dir: $(BUILD_DIR)/$(APP_NAME)-$(VERSION)-$(TARGET_OS)-$(ARCH)/
@ -288,18 +302,25 @@ $(BUILD_INFO): $(CSS_FILES) $(NODE_DIR) $(PROJECT_FILES) \
# XXX might be a good idea to install directly to $(BUILD_DIR) so as not
# to messup the current dir...
# XXX need to make this arch/os specific for cross compiling...
#%/$(NODE_DIR):
# XXX requirejs breaks here for some reason, breaking npm install and
# the build...
#%/$(NODE_DIR): package.json
# $(MD) "$@"
# cp package*.json "$(@D)"
# cd "$*" ; \
# npm install ; \
# electron-rebuild
#$(NODE_DIR): ./$(NODE_DIR)
# @touch "$@"
$(NODE_DIR):
#$(NODE_DIR):
$(NODE_DIR): package.json
npm install
electron-rebuild
# build app dir...
$(BUILD_DIR)/$(APP_NAME): $(CSS_FILES) $(PROJECT_FILES) \
$(BUILD_DIR)/$(APP_NAME)/: $(CSS_FILES) $(PROJECT_FILES) \
$(JS_FILES) $(CSS_FILES) $(HTML_FILES) \
$(BUILD_INFO)
$(MD) "$@"
@ -314,6 +335,7 @@ $(BUILD_DIR)/$(APP_NAME): $(CSS_FILES) $(PROJECT_FILES) \
# add $(NODE_DIR) to app dir...
# NOTE: making $(NODE_DIR) a link/junction would be quite a bit faster
# but it will also choke asar...
# XXX %/$(NODE_DIR): $(NODE_DIR) ???
$(BUILD_DIR)/$(APP_NAME)/$(NODE_DIR): $(NODE_DIR)
$(MD) "$@"
cp -r "$(NODE_DIR)" "$(@D)"
@ -329,6 +351,8 @@ $(BUILD_DIR)/$(APP_NAME)/$(NODE_DIR)/%: $(NODE_DIR)
# targets for testing...
# NOTE: do not use these phony targets as dependencies...
# NOTE: these intersect, so one should remove the previos before making
# a new app dir...
.PHONY: app-dir-full app-dir-minimal
app-dir-full: $(PACK_FULL)
app-dir-minimal: $(PACK_MINIMAL)
@ -376,6 +400,8 @@ $(TARGET_DIR)/$(ELECTRON_DIST):
# build the app dir (electron-specific)...
# NOTE: the "/" here is significant -- it prevents conflicts with other
# rules...
# XXX need to setup app icons...
.PRECIOUS: $(BUILD_DIR)/$(APP_NAME)-%/
$(BUILD_DIR)/$(APP_NAME)-%/: $(TARGET_DIR)/$(ELECTRON_DIST) \
@ -430,10 +456,7 @@ $(DIST_DIR)/$(APP_NAME)-%.zip: $(BUILD_DIR)/$(APP_NAME)-%.$(BUILD_MODE).zip
#----------------------------------------------------------------------
# Desktop installer...
# installer (WiX)...
# XXX add tools to path...
# Desktop installer (WiX)...
# harvest directory tree...
%.wxs:
@ -456,7 +479,13 @@ $(DIST_DIR)/$(APP_NAME)-%.msi: $(BUILD_DIR)/$(APP_NAME)-% $(BUILD_DIR)/$(APP_NAM
#----------------------------------------------------------------------
# Mobile XXX
# Debian package...
# XXX
#----------------------------------------------------------------------
# Mobile (cordova/PhoneGap) XXX

View File

@ -9,8 +9,8 @@ var requirejs_cfg = {
//urlArgs: 'bust='+Date.now(),
paths: {
//text: 'node_modules/requirejs-plugins/lib/text',
//json: 'node_modules/requirejs-plugins/src/json',
text: 'node_modules/requirejs-plugins/lib/text',
json: 'node_modules/requirejs-plugins/src/json',
//react: 'node_modules/react/dist/react-with-addons.min.js',
//'react-dom': 'node_modules/react-dom/dist/react-dom.min.js',

View File

@ -250,11 +250,6 @@ var ExampleActions = actions.Actions({
console.log('exampleConfigToggler: post-callback: shifting state to:', state)
})],
// XXX move this to a ui-dependant feature...
exampleCSSClassToggler: ['- Test/',
function(){
}],
// XXX event and event use...
// XXX inner/outer action...
@ -289,6 +284,11 @@ module.Example = core.ImageGridFeatures.Feature({
//---------------------------------------------------------------------
var ExampleUIActions = actions.Actions({
// XXX move this to a ui-dependant feature...
exampleCSSClassToggler: ['- Test/',
function(){
}],
exampleActionDisabled: ['Test/$Disabled example action',
{browseMode: function(){ return 'disabled' }},
function(){

View File

@ -2027,6 +2027,8 @@ var ButtonsActions = actions.Actions({
},
'app-buttons': {
//'<div style="transform: scaleX(-1)">&#9649;</div>':
// ['touch-controls', 'toggleSideButtons -- Toggle touch controls'],
'&#9965;': ['ui-settings', 'browseActions: "Interface/" -- Interface settings...'],
},

View File

@ -1313,6 +1313,14 @@ var ControlActions = actions.Actions({
'window-focus-timeout': 200,
},
// XXX do we need this???
get touchSupported(){
var t = this.__touchSupported = this.__touchSupported
|| (typeof(window) != 'undefined'
&& ('ontouchstart' in window || navigator.msMaxTouchPoints))
return t
},
// Lock unfocused viewer...
toggleUnfocusedLock: ['Interface/Lock unfocused viewer',
core.doc`Toggle unfocused viewer locking...

View File

@ -869,7 +869,8 @@
"glur": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/glur/-/glur-1.1.2.tgz",
"integrity": "sha1-8g6jbbEDv8KSNDkh8fkeg8NGdok="
"integrity": "sha1-8g6jbbEDv8KSNDkh8fkeg8NGdok=",
"optional": true
},
"got": {
"version": "https://registry.npmjs.org/got/-/got-6.7.1.tgz",
@ -1349,6 +1350,7 @@
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/pica/-/pica-3.0.6.tgz",
"integrity": "sha512-Tirjy4JKipFHk0K+k9v3N+SgM8nnaBb8UD6LTSkcr+TG2m4VKJ/+1TRDqL4ygytWx+pbhIx2mmMIDooiL910hQ==",
"optional": true,
"requires": {
"glur": "1.1.2",
"object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@ -1633,7 +1635,8 @@
"webworkify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/webworkify/-/webworkify-1.4.0.tgz",
"integrity": "sha1-cSRdHjTKz1TkJr2VX4zG7hLQJMI="
"integrity": "sha1-cSRdHjTKz1TkJr2VX4zG7hLQJMI=",
"optional": true
},
"whatwg-fetch": {
"version": "2.0.3",

View File

@ -2,6 +2,9 @@
"name": "ImageGrid.Viewer.g4",
"main": "e.js",
"version": "4.0.0a",
"author": "Alex A. Naanou <alex.nanou@gmail.com> (https://github.com/flynx)",
"contributors": [],
"repository": "github:flynx/ImageGrid",
"preferGlobal": true,
"window": {
"title": "ImageGrid.Viewer (gen4)",
@ -26,7 +29,6 @@
"ig-features": "^3.3.2",
"ig-object": "^1.0.2",
"openseadragon": "^2.3.1",
"pica": "^3.0.6",
"requirejs": "^2.3.5",
"requirejs-plugins": "^1.0.2",
"sharp": "^0.17.3",
@ -34,6 +36,7 @@
"wildglob": "^0.1.1"
},
"optionalDependencies": {
"pica": "^3.0.6",
"flickrapi": "^0.3.28",
"preact": "^8.2.7",
"react": "^15.6.2",
@ -49,5 +52,6 @@
"build-css": "lessc css/layout.less css/layout.css",
"build-dist": "make dist",
"start": "electron e.js"
}
},
"vim-cfg": " vim:set ts=2 sw=2 expandtab : "
}

View File

@ -7,6 +7,12 @@
(function(require){ var module={} // make module AMD/node compatible...
/*********************************************************************/
// XXX need to figure out a way to get the version from package.json and
// do it in:
// - bare nodejs
// > node version.js
// - browser + requirejs + file://
// - browser + requirejs + http*
var VERSION = '4.0.0a'
console.log(VERSION)