@theholocron/astromech 5.0.0-alpha.276 → 5.0.0-alpha.277

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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -38
  2. package/package.json +7 -7
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { t as normalizeTaskEntry } from "./schema-CalPyBNd.mjs";
2
2
  import { t as loadTasksConfig } from "./load-C1uY2yBv.mjs";
3
3
  import { n as alexrc_default, t as editorconfig_checker_default } from "./editorconfig-checker-HPpphHhI.mjs";
4
4
  import { existsSync, readFileSync, readdirSync } from "node:fs";
5
- import { dependencyNames, detectPackageManager, discoverWorkspacePackages, readPackageJsonSync } from "@theholocron/pkg-utils";
5
+ import { addWorkspaceMember, dependencyNames, detectPackageManager, discoverWorkspacePackages, readPackageJsonSync } from "@theholocron/pkg-utils";
6
6
  import { stringifyJson } from "@theholocron/json-utils";
7
7
  import { spawnSync } from "node:child_process";
8
8
  import { join, relative } from "node:path";
@@ -1583,15 +1583,11 @@ function turboConfig(config) {
1583
1583
  * <task>` again, forever). Only a matching script whose value is *not* that
1584
1584
  * wrapper counts as "root is genuinely a directly-buildable package".
1585
1585
  *
1586
- * A targeted line-based edit, not a full YAML parse/reserialize — same
1587
- * pattern `codecov.ts`'s `mergeCodecovComponents()` already uses for editing
1588
- * an existing generated file. `pnpm-workspace.yaml` routinely carries a
1589
- * `catalog:`/`catalogs:`/`overrides:` block after `packages:`; a real parser
1590
- * round-trip risks reformatting or reordering content nobody asked to touch.
1591
- * Only ever *adds* a line — never rewrites or reorders anything already
1592
- * there — and is a no-op (`changed: false`) whenever root doesn't need it,
1593
- * root is already listed, or `packages:` isn't in the plain block-list form
1594
- * every repo checked actually uses.
1586
+ * The edit itself is `addWorkspaceMember()` in `@theholocron/pkg-utils`: a
1587
+ * targeted line-based edit that only ever adds a line. This function decides
1588
+ * whether root needs it; it is a no-op (`changed: false`) whenever root
1589
+ * doesn't, root is already listed, or `packages:` isn't in the plain
1590
+ * block-list form every repo checked actually uses.
1595
1591
  */
1596
1592
  function ensureRootWorkspaceMember(workspaceYaml, rootScripts, taskNames) {
1597
1593
  if (!taskNames.some((t) => {
@@ -1601,34 +1597,7 @@ function ensureRootWorkspaceMember(workspaceYaml, rootScripts, taskNames) {
1601
1597
  content: workspaceYaml,
1602
1598
  changed: false
1603
1599
  };
1604
- const lines = workspaceYaml.split("\n");
1605
- const packagesLineIdx = lines.findIndex((l) => /^packages:\s*$/.test(l));
1606
- if (packagesLineIdx === -1) return {
1607
- content: workspaceYaml,
1608
- changed: false
1609
- };
1610
- const items = [];
1611
- let cursor = packagesLineIdx + 1;
1612
- while (cursor < lines.length && /^\s*-\s*/.test(lines[cursor])) {
1613
- items.push(lines[cursor]);
1614
- cursor++;
1615
- }
1616
- if (items.some((item) => {
1617
- const value = item.replace(/^\s*-\s*/, "").replace(/^["']|["']$/g, "").trim();
1618
- return value === "." || value === "";
1619
- })) return {
1620
- content: workspaceYaml,
1621
- changed: false
1622
- };
1623
- const newLine = `${items[0]?.match(/^(\s*-\s*)/)?.[1] ?? " - "}"."`;
1624
- return {
1625
- content: [
1626
- ...lines.slice(0, packagesLineIdx + 1),
1627
- newLine,
1628
- ...lines.slice(packagesLineIdx + 1)
1629
- ].join("\n"),
1630
- changed: true
1631
- };
1600
+ return addWorkspaceMember(workspaceYaml, ".");
1632
1601
  }
1633
1602
  /**
1634
1603
  * Matches the exact shape `packageScripts()` generates for `taskName` —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/astromech",
3
- "version": "5.0.0-alpha.276",
3
+ "version": "5.0.0-alpha.277",
4
4
  "description": "The Holocron task runner — one task manifest drives `holocron run`, `holocron run ci`, the CI workflows, package.json scripts, linters, and required checks.",
5
5
  "keywords": [
6
6
  "ci",
@@ -50,10 +50,10 @@
50
50
  "@commitlint/lint": "^21.2.3",
51
51
  "@commitlint/load": "^21.2.3",
52
52
  "@commitlint/types": "^21.2.3",
53
- "@theholocron/datapad": "5.0.0-alpha.276",
54
- "@theholocron/fs-utils": "^1.16.1-alpha.1",
55
- "@theholocron/json-utils": "^1.16.1-alpha.1",
56
- "@theholocron/pkg-utils": "^1.16.1-alpha.1"
53
+ "@theholocron/datapad": "5.0.0-alpha.277",
54
+ "@theholocron/pkg-utils": "^1.16.1-alpha.2",
55
+ "@theholocron/fs-utils": "^1.16.1-alpha.2",
56
+ "@theholocron/json-utils": "^1.16.1-alpha.2"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@commitlint/config-conventional": "^21.2.3",
@@ -69,12 +69,12 @@
69
69
  "tsdown": "^0.23.3",
70
70
  "typescript": "^5.9.3",
71
71
  "vitest": "^5.0.5",
72
+ "@theholocron/commitlint-config": "^8.9.0-alpha.3",
72
73
  "@theholocron/eslint-config": "^8.9.0-alpha.3",
73
74
  "@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.3",
74
- "@theholocron/semantic-release-config": "^8.9.0-alpha.3",
75
75
  "@theholocron/tsconfig": "^8.9.0-alpha.3",
76
- "@theholocron/commitlint-config": "^8.9.0-alpha.3",
77
76
  "@theholocron/vitest-config": "^8.9.0-alpha.3",
77
+ "@theholocron/semantic-release-config": "^8.9.0-alpha.3",
78
78
  "@theholocron/tsdown-config": "^8.9.0-alpha.3"
79
79
  },
80
80
  "peerDependencies": {