cornfield 0.26.0 → 0.28.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/explorer/view.js CHANGED
@@ -15,6 +15,7 @@ import { clearScenario } from './scenario-ui.js';
15
15
  import { measureParams } from './bench.js';
16
16
  import { mergeLive, placeLiveNodes } from './live-model.js';
17
17
  import { applyHouseLayout } from './house-model.js';
18
+ import { t } from './strings.js';
18
19
 
19
20
  const $ = (id) => document.getElementById(id);
20
21
 
@@ -166,5 +167,5 @@ export function syncViewUi() {
166
167
  const note = $('layers-preset-note');
167
168
  if (note) note.hidden = !preset;
168
169
  const badge = $('instruction-badge-text');
169
- if (badge) badge.textContent = preset ? 'Data flow: browser → servers → API → tables → services → outside' : (state.isFreeform ? 'Drag nodes to move • Double-tap to inspect' : 'Tap node to inspect live spec');
170
+ if (badge) badge.textContent = preset ? t('hintDataFlow') : (state.isFreeform ? t('hintDrag') : t('hintInspect'));
170
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cornfield",
3
- "version": "0.26.0",
3
+ "version": "0.28.0",
4
4
  "description": "A self-hostable dev dashboard with the topology map at its centre: proposals on the map, scenarios, outages and what-if edits, for any repo.",
5
5
  "license": "MIT",
6
6
  "author": "popcorn245 (https://github.com/popcorn245)",
package/server/server.js CHANGED
@@ -56,6 +56,7 @@ import { fileURLToPath } from 'node:url';
56
56
  import { browserSources, BUILTIN_SOURCES, parseDuration, specPollMs, triggersOf, DEFAULTS, hookWants, ideaLabel, runnerQuietAfterMs } from '../core/config.js';
57
57
  import { CLOUD_FILE } from '../core/cloud.js';
58
58
  import { BRAND_SVG_CSP, MANIFEST_PATH, appNameOf, brandAssetFile, brandImages, clientBrand, colorOf, manifestOf } from '../core/brand.js';
59
+ import { clientStrings } from '../core/strings.js';
59
60
  import { MAX_THEME_ASSET_BYTES, MAX_THEME_BYTES, THEME_ASSET_PREFIX, THEME_NAME, THEME_SVG_CSP, clientTheme, cssProblems, fontOrigins, fontUrl, themeAssetFile, themeAssetPath } from '../core/theme.js';
60
61
  import { decodePath, inside, notFound, sendFile } from './files.js';
61
62
  import { serveProposals } from './proposals.js';
@@ -78,7 +79,7 @@ import { createTriggers } from './triggers.js';
78
79
  export const CORNFIELD_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
79
80
  const EXPLORER_DIR = path.join(CORNFIELD_DIR, 'explorer');
80
81
  /** The pure core modules the explorer imports (no Node built-ins, no files): the only ones of core/ served */
81
- export const BROWSER_CORE = ['schema.js', 'proposal.js', 'personas.js', 'cloud.js', 'text.js', 'mentions.js', 'color.js'];
82
+ export const BROWSER_CORE = ['schema.js', 'proposal.js', 'personas.js', 'cloud.js', 'text.js', 'mentions.js', 'color.js', 'strings.js'];
82
83
  /** cornfield's own browser sources, by request path */
83
84
  const BROWSER_PLUGINS = new Map(Object.values(BUILTIN_SOURCES).map((p) => [p, path.join(CORNFIELD_DIR, p)]));
84
85
  const PKG = JSON.parse(fs.readFileSync(path.join(CORNFIELD_DIR, 'package.json'), 'utf8'));
@@ -264,6 +265,8 @@ export function clientConfig(config, signIn = false) {
264
265
  theme: clientTheme(config.theme),
265
266
  // The brand's image URLs and name, never a file's path (docs/config.md#brand)
266
267
  brand: clientBrand(config.brand, PKG.homepage),
268
+ // Only the labels the config overrides, as text (core/strings.js); the defaults are in the browser
269
+ strings: clientStrings(config.strings),
267
270
  forge: config.forge ? { type: config.forge.type, url: config.forge.url || (config.forge.type === 'github' ? 'https://github.com' : null), repo: config.forge.repo, mergeMethod: config.forge.mergeMethod || 'merge', ...(config.approveLands ? { approveLands: true } : {}) } : null,
268
271
  // Threads (docs/threads.md): the idea label, or false when `threads: false` turns the Threads tab off
269
272
  threads: config.threads === false ? false : { label: ideaLabel(config) },