diff --git a/app.js b/app.js index 34fc7a83..4065873b 100644 --- a/app.js +++ b/app.js @@ -240,7 +240,16 @@ function initModule(mod, file, dir) { any: arg => { mod.add(arg) }, code() { const [ path, file ] = [ ...arguments ]; - code[path] = fs.readFileSync(file); + if (lastmod(file)) { + code[path] = fs.readFileSync(file); + // console.log({ CODE: path, file }); + } else if (lastmod(mod.dir + '/' + file)) { + const alt = mod.dir + '/' + file; + code[path] = fs.readFileSync(alt); + // console.log({ CODE: path, alt }); + } else { + console.log({ MISSING_CODE: path, file }); + } }, full: arg => { mod.add(fullpath(arg)) }, map: arg => { mod.add(fixedmap(arg)) }, diff --git a/src/kiri/api.js b/src/kiri/api.js index 074ac26f..94339f70 100644 --- a/src/kiri/api.js +++ b/src/kiri/api.js @@ -16,9 +16,10 @@ import { functions } from './function.js'; import { platform } from './platform.js'; import { selection } from './selection.js'; import { stats } from '../kiri/stats.js'; +import { newWidget } from './widget.js'; import { widgets } from './widgets.js'; import { updateTool } from '../kiri-mode/cam/tools.js'; -import { version } from '../moto/license.js'; +import { beta, version } from '../moto/license.js'; import { space as SPACE } from '../moto/space.js'; import { LANG } from './lang.js'; @@ -120,6 +121,7 @@ function localSet(key, val) { export const api = { ajax, + beta, alerts, busy, catalog, @@ -147,6 +149,9 @@ export const api = { local, modal, mode, + new: { + widget: newWidget + }, noop, o2js, onkey,