@volter/teams 0.2.18 → 0.2.19
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/board-name.mjs +14 -0
- package/package.json +3 -2
package/board-name.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// A board's name, the last part of its address (sc:<machine>:board:<name>): the one rule both the board (which names
|
|
2
|
+
// itself) and a machine's daemon (which finds a board among the homes registered with it) read. A home's own board is
|
|
3
|
+
// named for the folder that owns the home (`…/volter-org/home` is `volter-org`), a named board of it `<that>/<board>`;
|
|
4
|
+
// any character other than A-Z a-z 0-9 _ . - in the name becomes `-`.
|
|
5
|
+
import { basename, dirname } from 'node:path';
|
|
6
|
+
|
|
7
|
+
/** The board's label as people read it: `volter-org`, or `volter-org/<board>` for a named board. */
|
|
8
|
+
export function boardLabel(root, slug) {
|
|
9
|
+
const home = basename(root) === 'home' ? basename(dirname(root)) : basename(root);
|
|
10
|
+
return slug && slug !== 'default' ? `${home}/${slug}` : home;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** The label as an address carries it. */
|
|
14
|
+
export const boardName = (label) => label.replace(/[^A-Za-z0-9_.-]/g, '-');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/teams",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Volter Teams, the neutral team plane: machine identity and daemon core, the local door and server link, admission from machine grants, product doors, and the Teams server's neutral routes (company RFC 0008).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"./redact": {
|
|
54
54
|
"default": "./redact.mjs"
|
|
55
55
|
},
|
|
56
|
-
"./checkout": "./checkout.mjs"
|
|
56
|
+
"./checkout": "./checkout.mjs",
|
|
57
|
+
"./board-name": "./board-name.mjs"
|
|
57
58
|
},
|
|
58
59
|
"files": [
|
|
59
60
|
"LICENSE-MIT",
|