@memberjunction/cli 6.1.0-edge.1 → 6.1.0-edge.3

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 (91) hide show
  1. package/LICENSE +180 -4
  2. package/README.md +1 -1
  3. package/dist/commands/artifacts/reclassify.d.ts.map +1 -1
  4. package/dist/commands/artifacts/reclassify.js +2 -1
  5. package/dist/commands/artifacts/reclassify.js.map +1 -1
  6. package/dist/commands/codegen/manifest.d.ts +14 -0
  7. package/dist/commands/codegen/manifest.d.ts.map +1 -1
  8. package/dist/commands/codegen/manifest.js +26 -7
  9. package/dist/commands/codegen/manifest.js.map +1 -1
  10. package/dist/commands/dev/index.d.ts +7 -0
  11. package/dist/commands/dev/index.d.ts.map +1 -0
  12. package/dist/commands/dev/index.js +11 -0
  13. package/dist/commands/dev/index.js.map +1 -0
  14. package/dist/commands/dev/usage.d.ts +7 -0
  15. package/dist/commands/dev/usage.d.ts.map +1 -0
  16. package/dist/commands/dev/usage.js +10 -0
  17. package/dist/commands/dev/usage.js.map +1 -0
  18. package/dist/commands/dev/workspace/clean.d.ts +27 -0
  19. package/dist/commands/dev/workspace/clean.d.ts.map +1 -0
  20. package/dist/commands/dev/workspace/clean.js +87 -0
  21. package/dist/commands/dev/workspace/clean.js.map +1 -0
  22. package/dist/commands/dev/workspace/doctor.d.ts +28 -0
  23. package/dist/commands/dev/workspace/doctor.d.ts.map +1 -0
  24. package/dist/commands/dev/workspace/doctor.js +62 -0
  25. package/dist/commands/dev/workspace/doctor.js.map +1 -0
  26. package/dist/commands/dev/workspace/index.d.ts +60 -0
  27. package/dist/commands/dev/workspace/index.d.ts.map +1 -0
  28. package/dist/commands/dev/workspace/index.js +279 -0
  29. package/dist/commands/dev/workspace/index.js.map +1 -0
  30. package/dist/commands/dev/workspace/status.d.ts +19 -0
  31. package/dist/commands/dev/workspace/status.d.ts.map +1 -0
  32. package/dist/commands/dev/workspace/status.js +46 -0
  33. package/dist/commands/dev/workspace/status.js.map +1 -0
  34. package/dist/lib/cli-plugins.d.ts.map +1 -1
  35. package/dist/lib/cli-plugins.js +5 -0
  36. package/dist/lib/cli-plugins.js.map +1 -1
  37. package/dist/lib/dev-workspace/build.d.ts +180 -0
  38. package/dist/lib/dev-workspace/build.d.ts.map +1 -0
  39. package/dist/lib/dev-workspace/build.js +570 -0
  40. package/dist/lib/dev-workspace/build.js.map +1 -0
  41. package/dist/lib/dev-workspace/clean.d.ts +40 -0
  42. package/dist/lib/dev-workspace/clean.d.ts.map +1 -0
  43. package/dist/lib/dev-workspace/clean.js +193 -0
  44. package/dist/lib/dev-workspace/clean.js.map +1 -0
  45. package/dist/lib/dev-workspace/detect.d.ts +56 -0
  46. package/dist/lib/dev-workspace/detect.d.ts.map +1 -0
  47. package/dist/lib/dev-workspace/detect.js +343 -0
  48. package/dist/lib/dev-workspace/detect.js.map +1 -0
  49. package/dist/lib/dev-workspace/dir-flag.d.ts +23 -0
  50. package/dist/lib/dev-workspace/dir-flag.d.ts.map +1 -0
  51. package/dist/lib/dev-workspace/dir-flag.js +24 -0
  52. package/dist/lib/dev-workspace/dir-flag.js.map +1 -0
  53. package/dist/lib/dev-workspace/doctor.d.ts +96 -0
  54. package/dist/lib/dev-workspace/doctor.d.ts.map +1 -0
  55. package/dist/lib/dev-workspace/doctor.js +400 -0
  56. package/dist/lib/dev-workspace/doctor.js.map +1 -0
  57. package/dist/lib/dev-workspace/lockfile.d.ts +62 -0
  58. package/dist/lib/dev-workspace/lockfile.d.ts.map +1 -0
  59. package/dist/lib/dev-workspace/lockfile.js +456 -0
  60. package/dist/lib/dev-workspace/lockfile.js.map +1 -0
  61. package/dist/lib/dev-workspace/member-installs.d.ts +35 -0
  62. package/dist/lib/dev-workspace/member-installs.d.ts.map +1 -0
  63. package/dist/lib/dev-workspace/member-installs.js +139 -0
  64. package/dist/lib/dev-workspace/member-installs.js.map +1 -0
  65. package/dist/lib/dev-workspace/pnpm.d.ts +29 -0
  66. package/dist/lib/dev-workspace/pnpm.d.ts.map +1 -0
  67. package/dist/lib/dev-workspace/pnpm.js +59 -0
  68. package/dist/lib/dev-workspace/pnpm.js.map +1 -0
  69. package/dist/lib/dev-workspace/status.d.ts +16 -0
  70. package/dist/lib/dev-workspace/status.d.ts.map +1 -0
  71. package/dist/lib/dev-workspace/status.js +185 -0
  72. package/dist/lib/dev-workspace/status.js.map +1 -0
  73. package/dist/lib/dev-workspace/types.d.ts +312 -0
  74. package/dist/lib/dev-workspace/types.d.ts.map +1 -0
  75. package/dist/lib/dev-workspace/types.js +14 -0
  76. package/dist/lib/dev-workspace/types.js.map +1 -0
  77. package/dist/lib/dev-workspace/usage.d.ts +30 -0
  78. package/dist/lib/dev-workspace/usage.d.ts.map +1 -0
  79. package/dist/lib/dev-workspace/usage.js +177 -0
  80. package/dist/lib/dev-workspace/usage.js.map +1 -0
  81. package/dist/lib/dev-workspace/write.d.ts +25 -0
  82. package/dist/lib/dev-workspace/write.d.ts.map +1 -0
  83. package/dist/lib/dev-workspace/write.js +75 -0
  84. package/dist/lib/dev-workspace/write.js.map +1 -0
  85. package/dist/light-commands.d.ts.map +1 -1
  86. package/dist/light-commands.js +7 -0
  87. package/dist/light-commands.js.map +1 -1
  88. package/dist/utils/open-app-context.js +1 -1
  89. package/dist/utils/open-app-context.js.map +1 -1
  90. package/oclif.manifest.json +3432 -3173
  91. package/package.json +22 -22
@@ -0,0 +1,180 @@
1
+ import type { CandidateRepo, DevDepConflict, DuplicateFamilyPackage, PackageExtension, RootPackageJsonResult, TurboJsonResult } from './types.js';
2
+ /** Build-scripts allowlist proven on the core-monorepo spike. */
3
+ export declare const ONLY_BUILT_DEPENDENCIES: readonly string[];
4
+ /** The three .npmrc settings lines — strict peers has been the standard since 2026-08-07. */
5
+ export declare const NPMRC_BASE_LINES: readonly string[];
6
+ /**
7
+ * Packages an MJ library declares as a `peerDependency` because the choice belongs
8
+ * to the app shell, not the library — the auth SDK family especially, where a shell
9
+ * picks exactly one provider out of five. These are NOT a layout problem and no
10
+ * pnpm setting fixes them: a shell that serves one of these features declares the
11
+ * package in its own `package.json`, the same as any other direct dependency.
12
+ *
13
+ * Kept here (rather than as prose) so the command's guidance text has one source of
14
+ * truth. Grouped by the MJ package whose peer declaration creates the requirement.
15
+ */
16
+ export declare const SHELL_PROVIDED_PEERS: ReadonlyArray<{
17
+ Library: string;
18
+ Peers: readonly string[];
19
+ }>;
20
+ /**
21
+ * Peer bridge baseline for older published MJ copies still in the tree.
22
+ *
23
+ * Verified 2026-08-13 against the MJ monorepo root: the five `allowedVersions`
24
+ * rules match MJ's own `pnpm.peerDependencyRules` exactly; `ignoreMissing:
25
+ * ['axios']` is generator-only, for older published MJ copies a parent may still
26
+ * resolve. The baseline stays hardcoded (rather than read from MJ) because a
27
+ * parent whose members declare no rules still needs the proven bridge — and any
28
+ * member-declared `peerDependencyRules` are UNIONED ON TOP of it by
29
+ * {@link ResolveMemberPnpmBlocks}, so MJ's rules can evolve without a generator
30
+ * release as long as MJ is a member.
31
+ */
32
+ export declare const PEER_DEPENDENCY_RULES: {
33
+ readonly allowedVersions: {
34
+ readonly 'nunjucks>chokidar': "5";
35
+ readonly '@modelcontextprotocol/sdk>zod': "^3.24";
36
+ readonly 'zod-to-json-schema>zod': "^3.24";
37
+ readonly 'openai>zod': "^3.24";
38
+ readonly '@anthropic-ai/sdk>zod': "^3.24";
39
+ };
40
+ readonly ignoreMissing: readonly ["axios"];
41
+ };
42
+ /** Used only when no member pins pnpm — the proven pin (== the MJ monorepo's pin today). */
43
+ export declare const FALLBACK_PNPM_PIN = "pnpm@10.33.0";
44
+ /** The proven root-manifest devDependency baseline; fills gaps the union leaves. */
45
+ export declare const BASELINE_DEV_DEPENDENCIES: Readonly<Record<string, string>>;
46
+ /**
47
+ * Builds `pnpm-workspace.yaml`: per member (sorted by name) the repo root plus the
48
+ * member's own packages-rooted workspace globs re-prefixed with its directory name.
49
+ * Producer packages only — never `apps/*` (app-shell names collide across repos).
50
+ */
51
+ export declare function BuildWorkspaceYaml(members: ReadonlyArray<Pick<CandidateRepo, 'Name' | 'WorkspaceGlobs'>>): string;
52
+ /**
53
+ * Renders the shell-dependency guidance the command prints — the replacement for
54
+ * the deleted hoist block. Derived from {@link SHELL_PROVIDED_PEERS} so the advice
55
+ * and the data cannot drift apart.
56
+ */
57
+ export declare function BuildShellPeerGuidance(): string[];
58
+ /**
59
+ * Builds `.npmrc`: exactly the three proven settings lines.
60
+ *
61
+ * No `public-hoist-pattern[]` block by design — see the "Why no hoist block" note
62
+ * at the top of this module.
63
+ */
64
+ export declare function BuildNpmrc(): string;
65
+ /**
66
+ * Compares two version/range strings by their base numeric triple.
67
+ * Returns >0 when `a` is higher, <0 when `b` is higher, 0 on a tie or when
68
+ * either side has no parseable triple (caller keeps the incumbent and reports).
69
+ */
70
+ export declare function CompareVersionStrings(a: string, b: string): number;
71
+ /** Result of the devDependency union: the deps plus everything it dropped or transformed. */
72
+ export interface DevDependencyUnionResult {
73
+ DevDependencies: Record<string, string>;
74
+ Conflicts: DevDepConflict[];
75
+ /** `@types/*` names excluded entirely — two copies of one @types package is a guaranteed nominal-type break. */
76
+ SkippedTypes: string[];
77
+ /** `workspace:` specifiers on packages NO member provides — unresolvable at the parent, dropped. */
78
+ DroppedWorkspace: Array<{
79
+ Package: string;
80
+ Repo: string;
81
+ }>;
82
+ }
83
+ /**
84
+ * Unions every member repo's root devDependencies. Conflict rule: highest base
85
+ * version wins; ties keep the first seen. EVERY conflict, skip, and drop is
86
+ * returned so the command can log it — the resolver never decides silently.
87
+ * `familyNames` = package names provided by workspace members; those become
88
+ * `workspace:*` (local ALWAYS beats a registry pin — field finding on #3795).
89
+ */
90
+ export declare function ResolveDevDependencyUnion(members: readonly CandidateRepo[], familyNames?: ReadonlySet<string>): DevDependencyUnionResult;
91
+ /**
92
+ * Resolves the pnpm `packageManager` pin for the parent manifest: the highest
93
+ * pnpm pin any member carries (the MJ monorepo pins pnpm, so with MJ as a member
94
+ * this matches the MJ repo's pin); otherwise the proven fallback pin.
95
+ */
96
+ export declare function ResolvePnpmPin(members: readonly CandidateRepo[]): {
97
+ Pin: string;
98
+ Source: string;
99
+ };
100
+ /**
101
+ * Collects every package name the workspace members provide, from the members'
102
+ * OWN package enumerations. These names get `workspace:*` overrides in the
103
+ * parent manifest so local source ALWAYS beats registry copies — the field
104
+ * measured 1,898 registry shadow copies of family packages before forcing local
105
+ * with 367 `workspace:*` overrides (#3795 addendum). Duplicate providers are
106
+ * returned for loud reporting: the link target for a duplicated name is decided
107
+ * by sort order, silently.
108
+ */
109
+ export declare function CollectFamilyPackages(members: readonly CandidateRepo[]): {
110
+ Names: string[];
111
+ Duplicates: DuplicateFamilyPackage[];
112
+ };
113
+ /** The unioned member pnpm blocks, ready for the parent manifest. */
114
+ export interface MemberPnpmBlocksResult {
115
+ Overrides: Record<string, string>;
116
+ /** `pkg@version` -> patch path RE-ROOTED to `<member>/<path>`. */
117
+ PatchedDependencies: Record<string, string>;
118
+ PackageExtensions: Record<string, PackageExtension>;
119
+ PeerAllowedVersions: Record<string, string>;
120
+ PeerIgnoreMissing: string[];
121
+ Conflicts: DevDepConflict[];
122
+ Patches: Array<{
123
+ Package: string;
124
+ Path: string;
125
+ Repo: string;
126
+ }>;
127
+ }
128
+ /**
129
+ * Hoists every member's `pnpm` block into one parent-manifest block. pnpm honors
130
+ * NONE of these at a member (finding 2 on #3795: the field workspace ran
131
+ * unpatched type-graphql and lost MJ's 26 pins until this was done by hand).
132
+ * Rules, all deterministic over codepoint-sorted member names:
133
+ * - overrides: higher base version wins where comparable, first member wins
134
+ * otherwise (npm-alias values never parse) — every conflict reported;
135
+ * - patchedDependencies: paths re-rooted to `<member>/<path>`; first member
136
+ * wins a same-key conflict (two patches cannot merge) — reported;
137
+ * - packageExtensions: first member wins a differing same-key block — reported;
138
+ * - peerDependencyRules: allowedVersions first-wins with conflicts reported,
139
+ * ignoreMissing set-unioned.
140
+ */
141
+ export declare function ResolveMemberPnpmBlocks(members: readonly CandidateRepo[]): MemberPnpmBlocksResult;
142
+ /**
143
+ * Layers the three override sources into the parent `pnpm.overrides`, weakest
144
+ * first: lockfile-derived pins < explicit member overrides < family
145
+ * `workspace:*` (local source always wins). A member's or family's whole-name
146
+ * entry displaces every per-major pin selector for that name (a plain key and
147
+ * a `name@^N` selector must not fight). Displacements are returned so the
148
+ * command reports them — nothing is overwritten silently.
149
+ */
150
+ export declare function AssembleParentOverrides(lockfilePins: Record<string, string>, memberOverrides: Record<string, string>, familyNames: readonly string[]): {
151
+ Overrides: Record<string, string>;
152
+ SupersededPins: string[];
153
+ };
154
+ /**
155
+ * Builds the private parent `package.json`: pnpm pin, the cleaned member
156
+ * devDependency union, and the full absorbed `pnpm` block — member overrides and
157
+ * patches hoisted, lockfile-derived pins, and `workspace:*` overrides for every
158
+ * member-provided package. Every decision lands in the returned Report.
159
+ */
160
+ export declare function BuildRootPackageJson(parentDirName: string, members: readonly CandidateRepo[]): RootPackageJsonResult;
161
+ /**
162
+ * Marker value the sentinel carries. `mj dev workspace clean` refuses to delete a
163
+ * workspace whose sentinel does not carry exactly this string, so it is the proof
164
+ * that the residue at a parent directory is this tool's own output.
165
+ */
166
+ export declare const SENTINEL_MARKER = "mj dev workspace";
167
+ /**
168
+ * Builds the `.mj-dev-workspace.json` sentinel manifest: the marker `clean`
169
+ * checks, the files the generator wrote, and the members it wrote them for.
170
+ *
171
+ * Both lists are sorted and no timestamp is recorded — regenerating an unchanged
172
+ * workspace must produce a byte-identical sentinel.
173
+ */
174
+ export declare function BuildSentinel(fileNames: readonly string[], memberNames: readonly string[]): string;
175
+ /**
176
+ * Picks the parent `turbo.json`: copied verbatim from the first member (sorted by
177
+ * name) that carries one; a minimal proven config otherwise.
178
+ */
179
+ export declare function PickTurboJson(members: readonly CandidateRepo[]): TurboJsonResult;
180
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/lib/dev-workspace/build.ts"],"names":[],"m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