Preparations (1)
This commit is contained in:
rodič
41f3f4bb06
revize
dd13463b6e
|
@ -0,0 +1,17 @@
|
||||||
|
.PHONY: all build
|
||||||
|
|
||||||
|
all: test build
|
||||||
|
|
||||||
|
test:
|
||||||
|
deno test --unstable --allow-read utils/test.js
|
||||||
|
|
||||||
|
link-check:
|
||||||
|
lychee spec/**/*.yaml
|
||||||
|
|
||||||
|
format:
|
||||||
|
deno fmt utils/*.js README.md
|
||||||
|
|
||||||
|
fmt: format
|
||||||
|
|
||||||
|
build:
|
||||||
|
deno run --unstable --allow-read --allow-write utils/exec.js build
|
|
@ -1,6 +1,8 @@
|
||||||
# Prague Blockchain Week (PBW)
|
# Prague Blockchain Week (PBW)
|
||||||
|
|
||||||
A decentralized conference hosted by [UTXO Foundation](https://utxo.foundation/). We are using this GitHub repository to coordinate event listings.
|
A decentralized conference hosted by
|
||||||
|
[UTXO Foundation](https://utxo.foundation/). We are using this GitHub repository
|
||||||
|
to coordinate event listings.
|
||||||
|
|
||||||
https://prgblockweek.com
|
https://prgblockweek.com
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
name = "UTXO.23"
|
|
@ -0,0 +1 @@
|
||||||
|
name = "Prague Blockchain Week 2023"
|
|
@ -0,0 +1,40 @@
|
||||||
|
import { parse as tomlParse } from "https://deno.land/std@0.173.0/encoding/toml.ts";
|
||||||
|
|
||||||
|
export class DeConfEngine {
|
||||||
|
constructor(options = {}) {
|
||||||
|
this.options = options;
|
||||||
|
this.srcDir = this.options.srcDir || "./data";
|
||||||
|
}
|
||||||
|
async init() {}
|
||||||
|
async build() {
|
||||||
|
this.entries = {};
|
||||||
|
for await (const f of Deno.readDir(this.srcDir)) {
|
||||||
|
if (!f.name.match(/^\d+$/)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const specDir = [this.srcDir, f.name].join("/");
|
||||||
|
|
||||||
|
const entry = this.entries[f.name] = {};
|
||||||
|
// load year index
|
||||||
|
entry.index = await this._tomlLoad([specDir, "index.toml"].join("/"));
|
||||||
|
console.log(`\n##\n## [${entry.index.name}] \n##`);
|
||||||
|
// load sub-events
|
||||||
|
entry.events = [];
|
||||||
|
for await (const ef of Deno.readDir([specDir, "events"].join("/"))) {
|
||||||
|
if (!ef.name.match(/^[\w\d\-]+$/)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const efDir = [specDir, "events", ef.name].join("/");
|
||||||
|
const efIndex = await this._tomlLoad([efDir, "index.toml"].join("/"));
|
||||||
|
const event = {
|
||||||
|
index: efIndex,
|
||||||
|
};
|
||||||
|
entry.events.push(event);
|
||||||
|
}
|
||||||
|
console.table(entry.events.map((e) => e.index), ["name"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async _tomlLoad(fn) {
|
||||||
|
return tomlParse(await Deno.readTextFile(fn));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { DeConfEngine } from "./engine.js";
|
||||||
|
|
||||||
|
const deconf = new DeConfEngine();
|
||||||
|
await deconf.init();
|
||||||
|
|
||||||
|
let cmd = Deno.args[0] || "build";
|
||||||
|
let args = Deno.args.slice(1) || [];
|
||||||
|
|
||||||
|
const output = await deconf[cmd](...args);
|
||||||
|
if (output) {
|
||||||
|
console.log(output);
|
||||||
|
}
|
Načítá se…
Odkázat v novém úkolu