alemonjs 2.1.83-alpha.8 → 2.1.84

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.
@@ -1,9 +1,4 @@
1
- const escapeHtml = (value) => String(value)
2
- .replace(/&/g, '&')
3
- .replace(/</g, '&lt;')
4
- .replace(/>/g, '&gt;')
5
- .replace(/"/g, '&quot;')
6
- .replace(/'/g, '&#39;');
1
+ const escapeHtml = (value) => String(value).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
7
2
  const appHref = (app) => {
8
3
  return app.kind === 'main' ? '/app' : `/apps/${app.name}`;
9
4
  };
@@ -28,9 +23,7 @@ const renderCard = (app) => {
28
23
  const tags = appTags(app)
29
24
  .map(tag => `<span class="app-tag">${escapeHtml(tag)}</span>`)
30
25
  .join('');
31
- const desc = app.kind === 'main'
32
- ? '访问主应用页面、接口与默认资源。'
33
- : '访问插件页面、接口与公开入口。';
26
+ const desc = app.kind === 'main' ? '访问主应用页面、接口与默认资源。' : '访问插件页面、接口与公开入口。';
34
27
  return `
35
28
  <a
36
29
  class="app-card"
@@ -305,19 +298,12 @@ const renderHelloHtml = (apps) => {
305
298
  <main class="page">
306
299
  <section class="hero">
307
300
  <p class="hero-kicker">ALemonJS Launchpad</p>
308
- <h1 class="hero-title">欢迎使用阿柠檬机器人应用服务</h1>
309
- <p class="hero-desc">这里会自动列出当前已准备好的主应用与插件。</p>
310
- <div class="hero-meta">
311
- <span class="hero-pill"><strong>${visibleApps.length}</strong> 个可访问入口</span>
312
- <span class="hero-pill">主应用统一在 <strong>/app</strong></span>
313
- <span class="hero-pill">插件统一在 <strong>/apps/&lt;name&gt;</strong></span>
314
- </div>
301
+ <h1 class="hero-title">阿柠檬机器人</h1>
315
302
  </section>
316
303
  <section>
317
304
  <div class="section-head">
318
305
  <div>
319
306
  <h2 class="section-title">应用列表</h2>
320
- <p class="section-note">点击次数越高,卡片排序越靠前。排序记录仅保存在当前浏览器本地。</p>
321
307
  </div>
322
308
  </div>
323
309
  <div class="app-grid" id="app-grid">${cards}</div>
@@ -179,12 +179,12 @@ const dispatchRegisteredKoaRouters = async (ctx) => {
179
179
  const afterMatched = Array.isArray(matchedContext.matched) ? matchedContext.matched.length : 0;
180
180
  const afterMatchedRoute = ctx._matchedRoute;
181
181
  const afterRouterPath = ctx.routerPath;
182
- const handled = afterMatched > beforeMatched
183
- || afterMatchedRoute !== beforeMatchedRoute
184
- || afterRouterPath !== beforeRouterPath
185
- || ctx.status !== beforeStatus
186
- || ctx.body !== beforeBody
187
- || !fallthrough;
182
+ const handled = afterMatched > beforeMatched ||
183
+ afterMatchedRoute !== beforeMatchedRoute ||
184
+ afterRouterPath !== beforeRouterPath ||
185
+ ctx.status !== beforeStatus ||
186
+ ctx.body !== beforeBody ||
187
+ !fallthrough;
188
188
  if (!handled) {
189
189
  continue;
190
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alemonjs",
3
- "version": "2.1.83-alpha.8",
3
+ "version": "2.1.84",
4
4
  "description": "bot script",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",