breakaway 2.0.0-main.93 → 2.0.0-main.95

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,12 +1,12 @@
1
1
  {
2
2
  "name": "breakaway",
3
- "version": "2.0.0-main.93",
3
+ "version": "2.0.0-main.95",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "breakaway",
9
- "version": "2.0.0-main.93",
9
+ "version": "2.0.0-main.95",
10
10
  "license": "FSL-1.1-Apache-2.0",
11
11
  "bin": {
12
12
  "breakaway": "scripts/tasks.mjs"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "breakaway",
3
- "version": "2.0.0-main.93",
3
+ "version": "2.0.0-main.95",
4
4
  "description": "The task board for you and your coding agents: a Cloudflare Worker, its web app, Taskwarrior sync, and the CLI (npx breakaway).",
5
5
  "license": "FSL-1.1-Apache-2.0",
6
6
  "type": "module",
@@ -4,8 +4,12 @@
4
4
  * so the Worker renders an empty repository's first commit from the same files as the CLI. It's generated, never
5
5
  * committed (BRK-148): `pnpm install`, `build`, `typecheck`, `test`, and `deploy` run this first, and the release
6
6
  * workflow's build puts it in the bundle.
7
+ *
8
+ * It writes src/infra-shipped-templates.json too (BRK-259), generated and never committed the same way: the golden
9
+ * paths breakaway ships, template/infra/templates/<name>/, each file by name, so the board's console can add from
10
+ * them when a repository has no template of that name.
7
11
  */
8
- import { readFileSync, writeFileSync } from 'node:fs';
12
+ import { readdirSync, readFileSync, writeFileSync } from 'node:fs';
9
13
  import { boardSources } from '../src/init.js';
10
14
 
11
15
  const ROOT = new URL('../', import.meta.url);
@@ -13,8 +17,26 @@ const read = (path) => readFileSync(new URL(path, ROOT), 'utf8');
13
17
 
14
18
  export const boardFiles = () => Object.fromEntries(boardSources(read).map((path) => [path, read(path)]));
15
19
 
20
+ const TEMPLATES = 'template/infra/templates/';
21
+ export const shippedTemplates = () =>
22
+ Object.fromEntries(
23
+ readdirSync(new URL(TEMPLATES, ROOT), { withFileTypes: true })
24
+ .filter((d) => d.isDirectory())
25
+ .map((d) => d.name)
26
+ .sort()
27
+ .map((name) => [
28
+ name,
29
+ Object.fromEntries(
30
+ readdirSync(new URL(`${TEMPLATES}${name}/`, ROOT))
31
+ .sort()
32
+ .map((file) => [file, read(`${TEMPLATES}${name}/${file}`)]),
33
+ ),
34
+ ]),
35
+ );
36
+
16
37
  if (import.meta.url === `file://${process.argv[1]}`) {
17
38
  writeFileSync(new URL('src/board-files.json', ROOT), `${JSON.stringify(boardFiles(), null, 2)}\n`);
39
+ writeFileSync(new URL('src/infra-shipped-templates.json', ROOT), `${JSON.stringify(shippedTemplates(), null, 2)}\n`);
18
40
  // On stderr: npm pack and npm publish run it (prepare), and their --json goes to stdout.
19
- console.error('Wrote src/board-files.json.');
41
+ console.error('Wrote src/board-files.json and src/infra-shipped-templates.json.');
20
42
  }