Make Huginn emit Eve DSL only
This commit is contained in:
parent
d905639ecf
commit
a079386a3e
26 changed files with 177 additions and 8027 deletions
3
dist/huginn-eve-dsl.d.ts
vendored
Normal file
3
dist/huginn-eve-dsl.d.ts
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import type { CultCacheInspection } from "./cult-cache-inspector";
|
||||
export declare function buildHuginnEveDsl(inspection: CultCacheInspection): string;
|
||||
//# sourceMappingURL=huginn-eve-dsl.d.ts.map
|
||||
1
dist/huginn-eve-dsl.d.ts.map
vendored
Normal file
1
dist/huginn-eve-dsl.d.ts.map
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"huginn-eve-dsl.d.ts","sourceRoot":"","sources":["../src/huginn-eve-dsl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAA0C,MAAM,wBAAwB,CAAC;AAE1G,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM,CA8BzE"}
|
||||
55
dist/huginn-eve-dsl.js
vendored
Normal file
55
dist/huginn-eve-dsl.js
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.buildHuginnEveDsl = buildHuginnEveDsl;
|
||||
function buildHuginnEveDsl(inspection) {
|
||||
return [
|
||||
"# Huginn emits Eve DSL. Renderers compile and lower it.",
|
||||
`surface cultcache.huginn.inspector ${quoteDsl("Huginn .cc Inspector")}`,
|
||||
"version 1",
|
||||
"",
|
||||
"collection huginn.catalog.entries",
|
||||
...inspection.catalog.map((entry) => `item huginn.catalog.entries ${quoteDsl(renderCatalogEntry(entry))}`),
|
||||
"",
|
||||
"collection huginn.records.entries",
|
||||
...inspection.records.map((record) => `item huginn.records.entries ${quoteDsl(renderRecord(record))}`),
|
||||
"",
|
||||
"card source \"Source Witness\"",
|
||||
`text ${quoteDsl(`file: ${inspection.filePath}`)}`,
|
||||
`text ${quoteDsl(`format: ${inspection.format}`)}`,
|
||||
`text ${quoteDsl(`bytes: ${inspection.fileSizeBytes}`)}`,
|
||||
"text \".cc bytes are authority; Huginn only emits Eve DSL.\"",
|
||||
"end",
|
||||
"",
|
||||
"card catalog \"Schema Catalog\"",
|
||||
`text ${quoteDsl(`schemas: ${inspection.catalog.length}`)}`,
|
||||
"list \"Catalog Entries\" bind huginn.catalog.entries",
|
||||
"end",
|
||||
"",
|
||||
"card records \"Persisted Records\"",
|
||||
`text ${quoteDsl(`records: ${inspection.records.length}`)}`,
|
||||
"list \"Record Entries\" bind huginn.records.entries",
|
||||
"end",
|
||||
"",
|
||||
].join("\n");
|
||||
}
|
||||
function renderCatalogEntry(entry) {
|
||||
return [
|
||||
entry.schemaName,
|
||||
entry.schemaVersion,
|
||||
entry.schemaId,
|
||||
`${entry.members.length} members`,
|
||||
].join(" | ");
|
||||
}
|
||||
function renderRecord(record) {
|
||||
const status = record.payloadDecodeError ? `decode error: ${record.payloadDecodeError}` : "decoded";
|
||||
return [
|
||||
record.key,
|
||||
record.schemaName,
|
||||
record.storedAt,
|
||||
`${record.payloadBytes} bytes`,
|
||||
status,
|
||||
].join(" | ");
|
||||
}
|
||||
function quoteDsl(value) {
|
||||
return JSON.stringify(value);
|
||||
}
|
||||
1
dist/index.d.ts
vendored
1
dist/index.d.ts
vendored
|
|
@ -1,4 +1,5 @@
|
|||
export { CultCache, CultCacheBuilder } from "./cult-cache";
|
||||
export { buildHuginnEveDsl } from "./huginn-eve-dsl";
|
||||
export { inspectCultCacheBytes } from "./cult-cache-inspector";
|
||||
export { defineDocumentRegistry, defineDocumentType } from "./document";
|
||||
export { SingleFileMessagePackBackingStore } from "./single-file-messagepack-backing-store";
|
||||
|
|
|
|||
2
dist/index.d.ts.map
vendored
2
dist/index.d.ts.map
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE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Y,EACV,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,GAChB,MAAM,wBAAwB,CAAC"}
|
||||
4
dist/index.js
vendored
4
dist/index.js
vendored
|
|
@ -1,9 +1,11 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SingleFileMessagePackBackingStore = exports.defineDocumentType = exports.defineDocumentRegistry = exports.inspectCultCacheBytes = exports.CultCacheBuilder = exports.CultCache = void 0;
|
||||
exports.SingleFileMessagePackBackingStore = exports.defineDocumentType = exports.defineDocumentRegistry = exports.inspectCultCacheBytes = exports.buildHuginnEveDsl = exports.CultCacheBuilder = exports.CultCache = void 0;
|
||||
var cult_cache_1 = require("./cult-cache");
|
||||
Object.defineProperty(exports, "CultCache", { enumerable: true, get: function () { return cult_cache_1.CultCache; } });
|
||||
Object.defineProperty(exports, "CultCacheBuilder", { enumerable: true, get: function () { return cult_cache_1.CultCacheBuilder; } });
|
||||
var huginn_eve_dsl_1 = require("./huginn-eve-dsl");
|
||||
Object.defineProperty(exports, "buildHuginnEveDsl", { enumerable: true, get: function () { return huginn_eve_dsl_1.buildHuginnEveDsl; } });
|
||||
var cult_cache_inspector_1 = require("./cult-cache-inspector");
|
||||
Object.defineProperty(exports, "inspectCultCacheBytes", { enumerable: true, get: function () { return cult_cache_inspector_1.inspectCultCacheBytes; } });
|
||||
var document_1 = require("./document");
|
||||
|
|
|
|||
Loading…
Reference in a new issue