Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-07-11 18:14:11 +03:00
parent 4df54db767
commit 6f61be245e

View File

@ -4,11 +4,28 @@
* *
* Architecture: * Architecture:
* store * store
*
* page * page
* renderer * renderer
* *
* *
* XXX weaknesses to review:
* - <store>.paths() as an index...
* + decouples the search logic from the store backend
* - requires the whole list of pages to be in memory
* ...need to be independent of the number of pages if at
* all possible -- otherwise this will hinder long-term use...
* -
*
*
* TODO:
* - .load(..) / .json(..) -- for most stores...
* might be a good idea to keep a unified format...
* - <page>.then() -- resolve when all pending write operations done ???
* - an async REPL...
*
*
*
***********************************************************************
* *
* XXX might be a good idea to try signature based security: * XXX might be a good idea to try signature based security:
* - sign changes * - sign changes
@ -64,7 +81,6 @@ var types = require('ig-types')
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Path... // Path...
// XXX still some questions...
var path = var path =
module.path = { module.path = {
@ -573,7 +589,6 @@ function(meth, drop_cache=false, post){
// XXX not sure about the name... // XXX not sure about the name...
// XXX should this be a mixin??? // XXX should this be a mixin???
// XXX TEST...
var MetaStore = var MetaStore =
module.MetaStore = { module.MetaStore = {
__proto__: BaseStore, __proto__: BaseStore,
@ -826,6 +841,7 @@ module.PouchDBStore = {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Page...
var relProxy = var relProxy =
function(name){ function(name){
@ -948,13 +964,12 @@ object.Constructor('BasePage', {
set path(value){ set path(value){
this.location = value }, this.location = value },
// XXX should these be writable???
get name(){ get name(){
return module.path.split(this.path).pop() }, return module.path.split(this.path).pop() },
// XXX should this rename or change path???
//set name(value){ }, //set name(value){ },
get dir(){ get dir(){
return module.path.relative(this.location, '..') }, return module.path.relative(this.location, '..') },
// XXX should writing to this move the page???
//set dir(value){ }, //set dir(value){ },
get isPattern(){ get isPattern(){
return this.location.includes('*') }, return this.location.includes('*') },