pico-engine 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # pico-engine
2
2
 
3
- [![Build Status](https://travis-ci.org/Picolab/pico-engine.svg?branch=master)](https://travis-ci.org/Picolab/pico-engine)
4
3
  [![Node version](https://img.shields.io/node/v/pico-engine.svg)](https://nodejs.org/en/download/)
5
4
 
6
5
  An implementation of the [pico-engine](http://www.windley.com/archives/2016/03/rebuilding_krl.shtml) hosted on node.js
@@ -36,7 +36,7 @@ function getUrlFilename(url) {
36
36
  }
37
37
  function RulesetRegistryLoaderFs(engineHomeDir) {
38
38
  const rulesetDir = path.resolve(engineHomeDir, "rulesets");
39
- const db = levelup_1.default(encode(leveldown_1.default(path.resolve(engineHomeDir, "rulesets-db")), {
39
+ const db = (0, levelup_1.default)(encode((0, leveldown_1.default)(path.resolve(engineHomeDir, "rulesets-db")), {
40
40
  keyEncoding: charwise,
41
41
  valueEncoding: safeJsonCodec,
42
42
  }));
@@ -106,7 +106,7 @@ async function fetchKrl(url) {
106
106
  });
107
107
  });
108
108
  }
109
- const res = await cross_fetch_1.default(url);
109
+ const res = await (0, cross_fetch_1.default)(url);
110
110
  if (res.status < 200 || res.status >= 300) {
111
111
  throw new Error("Got a statusCode=" + res.status + " for: " + url);
112
112
  }
package/dist/cli.js CHANGED
@@ -41,7 +41,7 @@ if (typeof process.env.PICO_ENGINE_BASE_URL === "string" &&
41
41
  process.env.PICO_ENGINE_BASE_URL.length > 0) {
42
42
  env.base_url = process.env.PICO_ENGINE_BASE_URL;
43
43
  }
44
- index_1.startEngine(env).catch((err) => {
44
+ (0, index_1.startEngine)(env).catch((err) => {
45
45
  console.error("Failed to start engine.");
46
46
  console.error(err);
47
47
  process.exit(1);
package/dist/index.js CHANGED
@@ -24,24 +24,24 @@ async function startEngine(configuration = {}) {
24
24
  const logFilePath = path.resolve(home, "pico-engine.log");
25
25
  const log = configuration.log
26
26
  ? configuration.log
27
- : krl_stdlib_1.makeKrlLogger(logging_1.makeRotatingFileLogWriter(logFilePath));
27
+ : (0, krl_stdlib_1.makeKrlLogger)((0, logging_1.makeRotatingFileLogWriter)(logFilePath));
28
28
  const core = new pico_engine_core_1.PicoEngineCore({
29
- leveldown: leveldown_1.default(path.resolve(home, "db")),
30
- rsRegLoader: RulesetRegistryLoaderFs_1.RulesetRegistryLoaderFs(home),
29
+ leveldown: (0, leveldown_1.default)(path.resolve(home, "db")),
30
+ rsRegLoader: (0, RulesetRegistryLoaderFs_1.RulesetRegistryLoaderFs)(home),
31
31
  log,
32
32
  modules: configuration.modules,
33
33
  useEventInputTime: configuration.useEventInputTime,
34
34
  getPicoLogs(picoId) {
35
- return logging_1.getPicoLogs(logFilePath, picoId);
35
+ return (0, logging_1.getPicoLogs)(logFilePath, picoId);
36
36
  },
37
37
  });
38
38
  await core.start();
39
39
  const rsRegistry = core.rsRegistry;
40
40
  const pf = core.picoFramework;
41
41
  const krl_urls = [
42
- toFileUrl_1.toFileUrl(path.resolve(__dirname, "..", "krl", "io.picolabs.pico-engine-ui.krl")),
43
- toFileUrl_1.toFileUrl(path.resolve(__dirname, "..", "krl", "io.picolabs.wrangler.krl")),
44
- toFileUrl_1.toFileUrl(path.resolve(__dirname, "..", "krl", "io.picolabs.subscription.krl")),
42
+ (0, toFileUrl_1.toFileUrl)(path.resolve(__dirname, "..", "krl", "io.picolabs.pico-engine-ui.krl")),
43
+ (0, toFileUrl_1.toFileUrl)(path.resolve(__dirname, "..", "krl", "io.picolabs.wrangler.krl")),
44
+ (0, toFileUrl_1.toFileUrl)(path.resolve(__dirname, "..", "krl", "io.picolabs.subscription.krl")),
45
45
  ];
46
46
  for (const url of krl_urls) {
47
47
  const { ruleset } = await rsRegistry.flush(url);
@@ -67,7 +67,7 @@ async function startEngine(configuration = {}) {
67
67
  time: 0,
68
68
  });
69
69
  const uiECI = uiChannel.id;
70
- const app = server_1.server(core, uiECI);
70
+ const app = (0, server_1.server)(core, uiECI);
71
71
  if ((!port || !_.isInteger(port) || port < 1) && port !== 0) {
72
72
  port = 3000;
73
73
  }
@@ -13,7 +13,8 @@ ruleset io.picolabs.pico-engine-ui {
13
13
  .head()
14
14
  }
15
15
  getOtherUiECI = function(eci){
16
- return eci => ctx:query(eci, ctx:rid, "uiECI") | null
16
+ thisPico = ctx:channels.any(function(c){c{"id"}==eci})
17
+ return (eci && not thisPico) => ctx:query(eci, ctx:rid, "uiECI") | null
17
18
  }
18
19
  testingECI = function(){
19
20
  return ent:testingECI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pico-engine",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "An implementation of the pico-engine targeting node.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,8 +50,8 @@
50
50
  "express": "^4.16.4",
51
51
  "helmet": "^3.16.0",
52
52
  "home-dir": "^1.0.0",
53
- "krl-compiler": "^1.1.1",
54
- "krl-stdlib": "^1.0.6",
53
+ "krl-compiler": "^1.2.0",
54
+ "krl-stdlib": "^1.2.0",
55
55
  "level-json-coerce-null": "^1.0.1",
56
56
  "leveldown": "^5.0.2",
57
57
  "levelup": "^4.0.1",
@@ -59,7 +59,7 @@
59
59
  "make-dir": "^3.0.0",
60
60
  "memdown": "^5.1.0",
61
61
  "minimist": "^1.2.5",
62
- "pico-engine-core": "^1.1.1",
62
+ "pico-engine-core": "^1.2.0",
63
63
  "pico-framework": "^0.6.0",
64
64
  "rotating-file-stream": "^1.4.1",
65
65
  "split": "^1.0.1",
@@ -77,7 +77,7 @@
77
77
  "onchange": "^6.0.0",
78
78
  "scriptsp": "^1.1.1",
79
79
  "temp-dir": "^2.0.0",
80
- "ts-node": "^9.1.1",
80
+ "ts-node": "^10.4.0",
81
81
  "typescript": "^4.1.2"
82
82
  },
83
83
  "ava": {
@@ -89,5 +89,5 @@
89
89
  "ts-node/register"
90
90
  ]
91
91
  },
92
- "gitHead": "276e5c39f3749db848fadccc536509c137b43ca4"
92
+ "gitHead": "7052049b68ebf82ac0042dfcfbd8c71470e95652"
93
93
  }