@memberjunction/cli 6.1.0-edge.2 → 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.
- package/LICENSE +180 -4
- package/README.md +1 -1
- package/dist/commands/codegen/manifest.d.ts +14 -0
- package/dist/commands/codegen/manifest.d.ts.map +1 -1
- package/dist/commands/codegen/manifest.js +26 -7
- package/dist/commands/codegen/manifest.js.map +1 -1
- package/dist/commands/dev/index.d.ts +7 -0
- package/dist/commands/dev/index.d.ts.map +1 -0
- package/dist/commands/dev/index.js +11 -0
- package/dist/commands/dev/index.js.map +1 -0
- package/dist/commands/dev/usage.d.ts +7 -0
- package/dist/commands/dev/usage.d.ts.map +1 -0
- package/dist/commands/dev/usage.js +10 -0
- package/dist/commands/dev/usage.js.map +1 -0
- package/dist/commands/dev/workspace/clean.d.ts +27 -0
- package/dist/commands/dev/workspace/clean.d.ts.map +1 -0
- package/dist/commands/dev/workspace/clean.js +87 -0
- package/dist/commands/dev/workspace/clean.js.map +1 -0
- package/dist/commands/dev/workspace/doctor.d.ts +28 -0
- package/dist/commands/dev/workspace/doctor.d.ts.map +1 -0
- package/dist/commands/dev/workspace/doctor.js +62 -0
- package/dist/commands/dev/workspace/doctor.js.map +1 -0
- package/dist/commands/dev/workspace/index.d.ts +60 -0
- package/dist/commands/dev/workspace/index.d.ts.map +1 -0
- package/dist/commands/dev/workspace/index.js +279 -0
- package/dist/commands/dev/workspace/index.js.map +1 -0
- package/dist/commands/dev/workspace/status.d.ts +19 -0
- package/dist/commands/dev/workspace/status.d.ts.map +1 -0
- package/dist/commands/dev/workspace/status.js +46 -0
- package/dist/commands/dev/workspace/status.js.map +1 -0
- package/dist/lib/cli-plugins.d.ts.map +1 -1
- package/dist/lib/cli-plugins.js +5 -0
- package/dist/lib/cli-plugins.js.map +1 -1
- package/dist/lib/dev-workspace/build.d.ts +180 -0
- package/dist/lib/dev-workspace/build.d.ts.map +1 -0
- package/dist/lib/dev-workspace/build.js +570 -0
- package/dist/lib/dev-workspace/build.js.map +1 -0
- package/dist/lib/dev-workspace/clean.d.ts +40 -0
- package/dist/lib/dev-workspace/clean.d.ts.map +1 -0
- package/dist/lib/dev-workspace/clean.js +193 -0
- package/dist/lib/dev-workspace/clean.js.map +1 -0
- package/dist/lib/dev-workspace/detect.d.ts +56 -0
- package/dist/lib/dev-workspace/detect.d.ts.map +1 -0
- package/dist/lib/dev-workspace/detect.js +343 -0
- package/dist/lib/dev-workspace/detect.js.map +1 -0
- package/dist/lib/dev-workspace/dir-flag.d.ts +23 -0
- package/dist/lib/dev-workspace/dir-flag.d.ts.map +1 -0
- package/dist/lib/dev-workspace/dir-flag.js +24 -0
- package/dist/lib/dev-workspace/dir-flag.js.map +1 -0
- package/dist/lib/dev-workspace/doctor.d.ts +96 -0
- package/dist/lib/dev-workspace/doctor.d.ts.map +1 -0
- package/dist/lib/dev-workspace/doctor.js +400 -0
- package/dist/lib/dev-workspace/doctor.js.map +1 -0
- package/dist/lib/dev-workspace/lockfile.d.ts +62 -0
- package/dist/lib/dev-workspace/lockfile.d.ts.map +1 -0
- package/dist/lib/dev-workspace/lockfile.js +456 -0
- package/dist/lib/dev-workspace/lockfile.js.map +1 -0
- package/dist/lib/dev-workspace/member-installs.d.ts +35 -0
- package/dist/lib/dev-workspace/member-installs.d.ts.map +1 -0
- package/dist/lib/dev-workspace/member-installs.js +139 -0
- package/dist/lib/dev-workspace/member-installs.js.map +1 -0
- package/dist/lib/dev-workspace/pnpm.d.ts +29 -0
- package/dist/lib/dev-workspace/pnpm.d.ts.map +1 -0
- package/dist/lib/dev-workspace/pnpm.js +59 -0
- package/dist/lib/dev-workspace/pnpm.js.map +1 -0
- package/dist/lib/dev-workspace/status.d.ts +16 -0
- package/dist/lib/dev-workspace/status.d.ts.map +1 -0
- package/dist/lib/dev-workspace/status.js +185 -0
- package/dist/lib/dev-workspace/status.js.map +1 -0
- package/dist/lib/dev-workspace/types.d.ts +312 -0
- package/dist/lib/dev-workspace/types.d.ts.map +1 -0
- package/dist/lib/dev-workspace/types.js +14 -0
- package/dist/lib/dev-workspace/types.js.map +1 -0
- package/dist/lib/dev-workspace/usage.d.ts +30 -0
- package/dist/lib/dev-workspace/usage.d.ts.map +1 -0
- package/dist/lib/dev-workspace/usage.js +177 -0
- package/dist/lib/dev-workspace/usage.js.map +1 -0
- package/dist/lib/dev-workspace/write.d.ts +25 -0
- package/dist/lib/dev-workspace/write.d.ts.map +1 -0
- package/dist/lib/dev-workspace/write.js +75 -0
- package/dist/lib/dev-workspace/write.js.map +1 -0
- package/dist/light-commands.d.ts.map +1 -1
- package/dist/light-commands.js +7 -0
- package/dist/light-commands.js.map +1 -1
- package/oclif.manifest.json +3105 -2846
- package/package.json +22 -22
package/LICENSE
CHANGED
|
@@ -1,7 +1,183 @@
|
|
|
1
|
-
|
|
1
|
+
Business Source License 1.1
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
License text copyright (c) 2024 MariaDB plc, All Rights Reserved.
|
|
4
|
+
"Business Source License" is a trademark of MariaDB plc.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
-----------------------------------------------------------------------------
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Parameters
|
|
9
|
+
|
|
10
|
+
Licensor: Blue Cypress, Inc.
|
|
11
|
+
|
|
12
|
+
Licensed Work: MemberJunction.
|
|
13
|
+
The Licensed Work is (c) 2023-2026 Blue Cypress, Inc.
|
|
14
|
+
|
|
15
|
+
Additional Use Grant: Subject to the terms of this License, Licensor grants
|
|
16
|
+
you the following additional rights to make Production
|
|
17
|
+
Use of the Licensed Work.
|
|
18
|
+
|
|
19
|
+
1. Internal Use
|
|
20
|
+
|
|
21
|
+
You may make production use of the Licensed Work for
|
|
22
|
+
your own internal business or organizational operations.
|
|
23
|
+
|
|
24
|
+
2. Nonprofit Use
|
|
25
|
+
|
|
26
|
+
If you are a Nonprofit, you may make production use of
|
|
27
|
+
the Licensed Work for the operations and activities of
|
|
28
|
+
your Organizational Family.
|
|
29
|
+
|
|
30
|
+
3. MemberJunction Certified Program Use
|
|
31
|
+
|
|
32
|
+
If you are authorized by Licensor under the
|
|
33
|
+
MemberJunction Certified Program to provide professional
|
|
34
|
+
services using the Licensed Work, you may make
|
|
35
|
+
production use of the Licensed Work in providing such
|
|
36
|
+
professional services to a client, provided that:
|
|
37
|
+
|
|
38
|
+
(a) the Licensed Work is deployed in, and the applicable
|
|
39
|
+
production use occurs within, an environment owned,
|
|
40
|
+
leased, licensed, subscribed to, or otherwise controlled
|
|
41
|
+
by that client; and
|
|
42
|
+
|
|
43
|
+
(b) the production use is for that client's own internal
|
|
44
|
+
business or organizational operations or is otherwise
|
|
45
|
+
independently permitted to that client under this
|
|
46
|
+
Additional Use Grant.
|
|
47
|
+
|
|
48
|
+
4. Definitions Applicable to the Additional Use Grant
|
|
49
|
+
|
|
50
|
+
"Affiliate" means, with respect to a specified Person,
|
|
51
|
+
any other Person that directly or indirectly Controls,
|
|
52
|
+
is Controlled by, or is under common Control with such
|
|
53
|
+
specified Person.
|
|
54
|
+
|
|
55
|
+
"Control" (including the terms "Controls," "Controlled
|
|
56
|
+
by," and "under common Control with") means the direct
|
|
57
|
+
or indirect possession of the power to direct or cause
|
|
58
|
+
the direction of the management and policies of a
|
|
59
|
+
Person, whether through ownership of voting interests,
|
|
60
|
+
by contract, or otherwise.
|
|
61
|
+
|
|
62
|
+
"Organizational Family" means, with respect to a Person,
|
|
63
|
+
(a) such Person and its Affiliates, and (b) any
|
|
64
|
+
nonprofit organization, governmental entity, chapter,
|
|
65
|
+
division, local affiliate, regional affiliate, state
|
|
66
|
+
affiliate, national affiliate, or other entity that is
|
|
67
|
+
formally affiliated with such Person through governing
|
|
68
|
+
documents, a charter, bylaws, a membership agreement, or
|
|
69
|
+
another written organizational instrument, and is
|
|
70
|
+
recognized under such documents as part of the same
|
|
71
|
+
organizational structure.
|
|
72
|
+
|
|
73
|
+
"Nonprofit" means a Person recognized by the Internal
|
|
74
|
+
Revenue Service as exempt from federal income taxation
|
|
75
|
+
under Section 501(c)(3), 501(c)(4), 501(c)(5), or
|
|
76
|
+
501(c)(6) of the Internal Revenue Code, or a foreign
|
|
77
|
+
organization recognized under substantially equivalent
|
|
78
|
+
laws.
|
|
79
|
+
|
|
80
|
+
A Person claiming eligibility as a Nonprofit shall, upon
|
|
81
|
+
Licensor's reasonable request, provide documentation
|
|
82
|
+
reasonably sufficient to demonstrate that it qualifies
|
|
83
|
+
as a Nonprofit. If such Person materially misrepresents,
|
|
84
|
+
or is unable to demonstrate, its qualification as a
|
|
85
|
+
Nonprofit, the rights granted to such Person under
|
|
86
|
+
Section 2 of this Additional Use Grant shall terminate.
|
|
87
|
+
|
|
88
|
+
"MemberJunction Certified Program" means Licensor's
|
|
89
|
+
then-current program for certifying and authorizing a
|
|
90
|
+
Person to provide professional services using the
|
|
91
|
+
Licensed Work.
|
|
92
|
+
|
|
93
|
+
"Person" means any individual, corporation, limited
|
|
94
|
+
liability company, partnership, association, nonprofit
|
|
95
|
+
organization, governmental entity, or other legal or
|
|
96
|
+
organizational entity.
|
|
97
|
+
|
|
98
|
+
Change Date: Four (4) years from the date the Licensed Work is first
|
|
99
|
+
made available.
|
|
100
|
+
|
|
101
|
+
Change License: MIT License.
|
|
102
|
+
|
|
103
|
+
For information about alternative licensing arrangements for the Licensed
|
|
104
|
+
Work, please contact Blue Cypress, Inc.
|
|
105
|
+
|
|
106
|
+
-----------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
Terms
|
|
109
|
+
|
|
110
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
111
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
112
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
113
|
+
production use.
|
|
114
|
+
|
|
115
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
116
|
+
available distribution of a specific version of the Licensed Work under this
|
|
117
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
118
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
119
|
+
above terminate.
|
|
120
|
+
|
|
121
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
122
|
+
currently in effect as described in this License, you must purchase a
|
|
123
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
124
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
125
|
+
|
|
126
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
127
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
128
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
129
|
+
for each version of the Licensed Work released by Licensor.
|
|
130
|
+
|
|
131
|
+
You must conspicuously display this License on each original or modified copy
|
|
132
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
133
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
134
|
+
License apply to your use of that work.
|
|
135
|
+
|
|
136
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
137
|
+
terminate your rights under this License for the current and all other
|
|
138
|
+
versions of the Licensed Work.
|
|
139
|
+
|
|
140
|
+
This License does not grant you any right in any trademark or logo of
|
|
141
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
142
|
+
Licensor as expressly required by this License).
|
|
143
|
+
|
|
144
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
145
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
146
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
147
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
148
|
+
TITLE.
|
|
149
|
+
|
|
150
|
+
MariaDB hereby grants you permission to use this License's text to license
|
|
151
|
+
your works, and to refer to it using the trademark "Business Source License",
|
|
152
|
+
as long as you comply with the Covenants of Licensor below.
|
|
153
|
+
|
|
154
|
+
-----------------------------------------------------------------------------
|
|
155
|
+
|
|
156
|
+
Covenants of Licensor
|
|
157
|
+
|
|
158
|
+
In consideration of the right to use this License's text and the "Business
|
|
159
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
160
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
161
|
+
|
|
162
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
163
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
164
|
+
where "compatible" means that software provided under the Change License
|
|
165
|
+
can be included in a program with software provided under GPL Version 2.0
|
|
166
|
+
or a later version. Licensor may specify additional Change Licenses without
|
|
167
|
+
limitation.
|
|
168
|
+
|
|
169
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
170
|
+
impose any additional restriction on the right granted in this License, as
|
|
171
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
172
|
+
|
|
173
|
+
3. To specify a Change Date.
|
|
174
|
+
|
|
175
|
+
4. Not to modify this License in any other way.
|
|
176
|
+
|
|
177
|
+
-----------------------------------------------------------------------------
|
|
178
|
+
|
|
179
|
+
Notice
|
|
180
|
+
|
|
181
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
182
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
183
|
+
under an Open Source License, as stated in this License.
|
package/README.md
CHANGED
|
@@ -27,6 +27,20 @@ export interface OpenAppClientEntry {
|
|
|
27
27
|
* survives even aggressive dead-code elimination, independent of how the host app
|
|
28
28
|
* consumes the manifest.
|
|
29
29
|
*
|
|
30
|
+
* On the choice of anchor: this is NOT the same mechanism `CLASS_REGISTRATIONS` uses.
|
|
31
|
+
* That array is anchored by being spread into `combinedClasses` in the host's
|
|
32
|
+
* `app.module.ts` — a real consumer reference, no `globalThis` involved. The
|
|
33
|
+
* `globalThis` assignment here is a deliberate variant whose tradeoff is that it
|
|
34
|
+
* anchors the block without requiring an `app.module.ts` edit per installed app,
|
|
35
|
+
* at the cost of a module-scope global write. Stated as a tradeoff, not a precedent.
|
|
36
|
+
*
|
|
37
|
+
* Note this is defense-in-depth, not the durable fix. A package that self-registers
|
|
38
|
+
* classes at module scope and still declares `"sideEffects": false` is making a false
|
|
39
|
+
* declaration; MJ's own such packages set `"sideEffects": true` (e.g.
|
|
40
|
+
* `@memberjunction/ng-core-entity-forms`), and the Open App scaffold should do the
|
|
41
|
+
* same for generated `-ng` packages. This block exists because third-party apps we
|
|
42
|
+
* do not control will get it wrong anyway.
|
|
43
|
+
*
|
|
30
44
|
* Exported for unit testing of the idempotency / disabled / cleared cases.
|
|
31
45
|
*/
|
|
32
46
|
export declare function applyOpenAppClientBootstrapBlock(content: string, clientEntries: OpenAppClientEntry[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AASD
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AASD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,GAAG,MAAM,CA0C7G;AAED,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAChD,MAAM,CAAC,WAAW,SAWwD;IAE1E,MAAM,CAAC,QAAQ;;;QAyBb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;MAwDV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAsD1B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,4BAA4B;CAcvC"}
|
|
@@ -30,6 +30,20 @@ function escapeRegex(s) {
|
|
|
30
30
|
* survives even aggressive dead-code elimination, independent of how the host app
|
|
31
31
|
* consumes the manifest.
|
|
32
32
|
*
|
|
33
|
+
* On the choice of anchor: this is NOT the same mechanism `CLASS_REGISTRATIONS` uses.
|
|
34
|
+
* That array is anchored by being spread into `combinedClasses` in the host's
|
|
35
|
+
* `app.module.ts` — a real consumer reference, no `globalThis` involved. The
|
|
36
|
+
* `globalThis` assignment here is a deliberate variant whose tradeoff is that it
|
|
37
|
+
* anchors the block without requiring an `app.module.ts` edit per installed app,
|
|
38
|
+
* at the cost of a module-scope global write. Stated as a tradeoff, not a precedent.
|
|
39
|
+
*
|
|
40
|
+
* Note this is defense-in-depth, not the durable fix. A package that self-registers
|
|
41
|
+
* classes at module scope and still declares `"sideEffects": false` is making a false
|
|
42
|
+
* declaration; MJ's own such packages set `"sideEffects": true` (e.g.
|
|
43
|
+
* `@memberjunction/ng-core-entity-forms`), and the Open App scaffold should do the
|
|
44
|
+
* same for generated `-ng` packages. This block exists because third-party apps we
|
|
45
|
+
* do not control will get it wrong anyway.
|
|
46
|
+
*
|
|
33
47
|
* Exported for unit testing of the idempotency / disabled / cleared cases.
|
|
34
48
|
*/
|
|
35
49
|
export function applyOpenAppClientBootstrapBlock(content, clientEntries) {
|
|
@@ -38,16 +52,21 @@ export function applyOpenAppClientBootstrapBlock(content, clientEntries) {
|
|
|
38
52
|
if (clientEntries.length > 0) {
|
|
39
53
|
const lines = [];
|
|
40
54
|
const refs = [];
|
|
41
|
-
|
|
55
|
+
for (const e of clientEntries) {
|
|
42
56
|
if (e.Enabled === false) {
|
|
43
57
|
lines.push(`// '${e.PackageName}' disabled by \`mj app disable\``);
|
|
58
|
+
continue;
|
|
44
59
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
// The alias index is `refs.length` — the position the alias is about to occupy
|
|
61
|
+
// in OPEN_APP_CLIENT_MODULES — so the declared name and the array contents share
|
|
62
|
+
// a single counter by construction. Numbering off the ENTRY index instead would
|
|
63
|
+
// leave the two able to drift: any future change that skipped a ref push (or
|
|
64
|
+
// pushed one for a commented-out entry) would emit an array element naming a
|
|
65
|
+
// variable that was never declared, which is a build break in the host app.
|
|
66
|
+
const alias = `__openAppClient${refs.length}`;
|
|
67
|
+
lines.push(`import * as ${alias} from '${e.PackageName}';`);
|
|
68
|
+
refs.push(alias);
|
|
69
|
+
}
|
|
51
70
|
// Anchor: the exported array references every namespace, and the globalThis
|
|
52
71
|
// assignment is an observable side effect the bundler must preserve — which
|
|
53
72
|
// keeps the array, the namespace imports, and their @RegisterClass side effects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAQpD,MAAM,wBAAwB,GAAG,8FAA8F,CAAC;AAChI,MAAM,sBAAsB,GAAG,8CAA8C,CAAC;AAE9E,SAAS,WAAW,CAAC,CAAS;IAC1B,OAAO,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAA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C,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACjE,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACK,4BAA4B,CAAC,UAAkB,EAAE,KAAc;QACnE,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;QACpD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,4FAA4F;QACxG,CAAC;QAED,MAAM,aAAa,GAAG,CAAC,iBAAiB,EAAE,EAAE,eAAe,EAAE,MAAM,IAAI,EAAE,CAAyB,CAAC;QACnG,MAAM,OAAO,GAAG,gCAAgC,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;QAEjG,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,IAAI,CAAC,GAAG,CAAC,+CAA+C,aAAa,CAAC,MAAM,WAAW,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,QAAQ,CAAC,CAAC;QACxJ,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/dev/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;IACtC,MAAM,CAAC,WAAW,SAEmF;IAErG,MAAM,CAAC,MAAM,UAAS;IAEhB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAI3B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class Dev extends Command {
|
|
3
|
+
static { this.description = 'Local development tooling: generate, inspect, and tear down the cross-repo pnpm workspace that links ' +
|
|
4
|
+
'sibling repo clones. Run `mj dev usage` for every command\'s flags, examples, and runtime hints.'; }
|
|
5
|
+
static { this.hidden = false; }
|
|
6
|
+
async run() {
|
|
7
|
+
// This command just displays help for the dev topic
|
|
8
|
+
await this.config.runCommand('help', ['dev']);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/dev/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;aAC/B,gBAAW,GAChB,uGAAuG;QACvG,kGAAkG,CAAC;aAE9F,WAAM,GAAG,KAAK,CAAC;IAEtB,KAAK,CAAC,GAAG;QACP,oDAAoD;QACpD,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DomainUsageCommand } from '../../lib/domain-usage-command.js';
|
|
2
|
+
/** Tier-2 usage for the `dev` domain (`mj dev usage`). */
|
|
3
|
+
export default class DevUsage extends DomainUsageCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
protected Domain: string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/commands/dev/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,0DAA0D;AAC1D,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,kBAAkB;IACtD,MAAM,CAAC,WAAW,SAAgF;IAClG,SAAS,CAAC,MAAM,SAAS;CAC1B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DomainUsageCommand } from '../../lib/domain-usage-command.js';
|
|
2
|
+
/** Tier-2 usage for the `dev` domain (`mj dev usage`). */
|
|
3
|
+
export default class DevUsage extends DomainUsageCommand {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.Domain = 'dev';
|
|
7
|
+
}
|
|
8
|
+
static { this.description = 'Show usage, flags, examples, and runtime hints for every `mj dev` command.'; }
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=usage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/commands/dev/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,0DAA0D;AAC1D,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,kBAAkB;IAAxD;;QAEY,WAAM,GAAG,KAAK,CAAC;IAC3B,CAAC;aAFQ,gBAAW,GAAG,4EAA4E,AAA/E,CAAgF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* CLI command: `mj dev workspace clean`.
|
|
4
|
+
*
|
|
5
|
+
* Removes exactly the residue `mj dev workspace` leaves at a parent directory:
|
|
6
|
+
* the four generated files, the sentinel manifest, `pnpm-lock.yaml`, and the
|
|
7
|
+
* `node_modules` tree. Member repo checkouts are never touched.
|
|
8
|
+
*
|
|
9
|
+
* Deletion is gated on proof of ownership — without `--force`, the sentinel the
|
|
10
|
+
* generator writes must be present and carry its marker, so a hand-made workspace
|
|
11
|
+
* cannot be torn down by accident.
|
|
12
|
+
*/
|
|
13
|
+
export default class DevWorkspaceClean extends Command {
|
|
14
|
+
static description: string;
|
|
15
|
+
static examples: string[];
|
|
16
|
+
static flags: {
|
|
17
|
+
dir: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
18
|
+
'dry-run': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
19
|
+
force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
/** Prints the plan and states plainly that nothing was deleted. */
|
|
23
|
+
private reportDryRun;
|
|
24
|
+
/** Logs every deletion, every path that was already gone, and every kept backup. */
|
|
25
|
+
private reportRemovals;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=clean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../../src/commands/dev/workspace/clean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAY7C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,OAAO;IACpD,MAAM,CAAC,WAAW,SAIoF;IAEtG,MAAM,CAAC,QAAQ,WAKb;IAEF,MAAM,CAAC,KAAK;;;;MAcV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB1B,mEAAmE;IACnE,OAAO,CAAC,YAAY;IAOpB,oFAAoF;IACpF,OAAO,CAAC,cAAc;CAgBvB"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { AssertCleanAllowed, ExecuteClean, PlanClean, RenderCleanPlan, } from '../../../lib/dev-workspace/clean.js';
|
|
5
|
+
import { WORKSPACE_DIR_ENV_VAR } from '../../../lib/dev-workspace/dir-flag.js';
|
|
6
|
+
/**
|
|
7
|
+
* CLI command: `mj dev workspace clean`.
|
|
8
|
+
*
|
|
9
|
+
* Removes exactly the residue `mj dev workspace` leaves at a parent directory:
|
|
10
|
+
* the four generated files, the sentinel manifest, `pnpm-lock.yaml`, and the
|
|
11
|
+
* `node_modules` tree. Member repo checkouts are never touched.
|
|
12
|
+
*
|
|
13
|
+
* Deletion is gated on proof of ownership — without `--force`, the sentinel the
|
|
14
|
+
* generator writes must be present and carry its marker, so a hand-made workspace
|
|
15
|
+
* cannot be torn down by accident.
|
|
16
|
+
*/
|
|
17
|
+
export default class DevWorkspaceClean extends Command {
|
|
18
|
+
static { this.description = 'Remove exactly the generated cross-repo workspace residue at a parent directory: the four generated files, ' +
|
|
19
|
+
'the .mj-dev-workspace.json sentinel, pnpm-lock.yaml and the node_modules tree. Member repo checkouts and ' +
|
|
20
|
+
'.bak backups are never touched. Without --force a valid sentinel must be present, so a hand-made workspace ' +
|
|
21
|
+
'cannot be torn down by accident. Preview first with --dry-run, which deletes nothing and exits 0.'; }
|
|
22
|
+
static { this.examples = [
|
|
23
|
+
'<%= config.bin %> dev workspace clean --dir ~/code/bluecypress --dry-run',
|
|
24
|
+
'<%= config.bin %> dev workspace clean --dir ~/code/bluecypress',
|
|
25
|
+
'<%= config.bin %> dev workspace clean --dir ~/code/bluecypress --dry-run --force',
|
|
26
|
+
'<%= config.bin %> dev workspace clean --dir ~/code/bluecypress --force',
|
|
27
|
+
]; }
|
|
28
|
+
static { this.flags = {
|
|
29
|
+
dir: Flags.string({
|
|
30
|
+
description: `Parent directory holding the sibling repo clones (must NOT itself be a git repo; env: ${WORKSPACE_DIR_ENV_VAR})`,
|
|
31
|
+
env: WORKSPACE_DIR_ENV_VAR,
|
|
32
|
+
default: '.',
|
|
33
|
+
}),
|
|
34
|
+
'dry-run': Flags.boolean({
|
|
35
|
+
description: 'List what would be removed and exit without deleting anything',
|
|
36
|
+
default: false,
|
|
37
|
+
}),
|
|
38
|
+
force: Flags.boolean({
|
|
39
|
+
description: 'Clean even without the generator sentinel (hand-made or pre-sentinel workspaces)',
|
|
40
|
+
default: false,
|
|
41
|
+
}),
|
|
42
|
+
}; }
|
|
43
|
+
async run() {
|
|
44
|
+
const { flags } = await this.parse(DevWorkspaceClean);
|
|
45
|
+
const parentDir = path.resolve(flags.dir);
|
|
46
|
+
try {
|
|
47
|
+
const sentinel = AssertCleanAllowed(parentDir, flags.force);
|
|
48
|
+
if (sentinel.Kind !== 'valid') {
|
|
49
|
+
this.warn(`Cleaning without a valid sentinel (--force): only the files this tool owns will be removed.`);
|
|
50
|
+
}
|
|
51
|
+
const plan = PlanClean(parentDir);
|
|
52
|
+
if (flags['dry-run']) {
|
|
53
|
+
this.reportDryRun(plan);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.reportRemovals(ExecuteClean(plan), plan);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
60
|
+
this.error(message);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Prints the plan and states plainly that nothing was deleted. */
|
|
64
|
+
reportDryRun(plan) {
|
|
65
|
+
for (const line of RenderCleanPlan(plan)) {
|
|
66
|
+
this.log(line);
|
|
67
|
+
}
|
|
68
|
+
this.log(chalk.dim('\n--dry-run: nothing was deleted.'));
|
|
69
|
+
}
|
|
70
|
+
/** Logs every deletion, every path that was already gone, and every kept backup. */
|
|
71
|
+
reportRemovals(result, plan) {
|
|
72
|
+
for (const name of result.Removed) {
|
|
73
|
+
this.log(`${chalk.green('removed')} ${name}`);
|
|
74
|
+
}
|
|
75
|
+
for (const name of result.AlreadyGone) {
|
|
76
|
+
this.log(chalk.dim(`already gone ${name}`));
|
|
77
|
+
}
|
|
78
|
+
for (const backup of plan.PreservedBackups) {
|
|
79
|
+
this.log(chalk.dim(`kept ${backup} (backups are never removed)`));
|
|
80
|
+
}
|
|
81
|
+
const summary = result.Removed.length === 0
|
|
82
|
+
? `Nothing to remove at ${plan.ParentDir}.`
|
|
83
|
+
: `Removed ${result.Removed.length} path(s) at ${plan.ParentDir}. Member repo checkouts were not touched.`;
|
|
84
|
+
this.log(chalk.bold(`\n${summary}`));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=clean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean.js","sourceRoot":"","sources":["../../../../src/commands/dev/workspace/clean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAG/E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,OAAO;aAC7C,gBAAW,GAChB,6GAA6G;QAC7G,2GAA2G;QAC3G,6GAA6G;QAC7G,mGAAmG,CAAC;aAE/F,aAAQ,GAAG;QAChB,0EAA0E;QAC1E,gEAAgE;QAChE,kFAAkF;QAClF,wEAAwE;KACzE,CAAC;aAEK,UAAK,GAAG;QACb,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;YAChB,WAAW,EAAE,yFAAyF,qBAAqB,GAAG;YAC9H,GAAG,EAAE,qBAAqB;YAC1B,OAAO,EAAE,GAAG;SACb,CAAC;QACF,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC;YACvB,WAAW,EAAE,+DAA+D;YAC5E,OAAO,EAAE,KAAK;SACf,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;YACnB,WAAW,EAAE,kFAAkF;YAC/F,OAAO,EAAE,KAAK;SACf,CAAC;KACH,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACtD,MAAM,SAAS,GAAG,IAAI,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QAChD,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACtC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9C,CAAC;QACD,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC3C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,MAAM,8BAA8B,CAAC,CAAC,CAAC;QACpE,CAAC;QACD,MAAM,OAAO,GACX,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YACzB,CAAC,CAAC,wBAAwB,IAAI,CAAC,SAAS,GAAG;YAC3C,CAAC,CAAC,WAAW,MAAM,CAAC,OAAO,CAAC,MAAM,eAAe,IAAI,CAAC,SAAS,2CAA2C,CAAC;QAC/G,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* CLI command: `mj dev workspace doctor`.
|
|
4
|
+
*
|
|
5
|
+
* Read-only health check for a generated cross-repo workspace: prints one
|
|
6
|
+
* PASS/WARN/FAIL/SKIP line per check and exits non-zero when any check FAILS, so
|
|
7
|
+
* it can gate a script. It writes nothing, deletes nothing and makes no network
|
|
8
|
+
* call — every fix it finds is printed as a command for the user to run.
|
|
9
|
+
*
|
|
10
|
+
* The check `status` cannot do is the one-copy census: it reads the parent's pnpm
|
|
11
|
+
* virtual store and fails when more than one version of a must-be-single-copy
|
|
12
|
+
* package (Angular, RxJS, zone.js, MJ core/global) is installed there.
|
|
13
|
+
*/
|
|
14
|
+
export default class DevWorkspaceDoctor extends Command {
|
|
15
|
+
static description: string;
|
|
16
|
+
static examples: string[];
|
|
17
|
+
static flags: {
|
|
18
|
+
dir: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
19
|
+
};
|
|
20
|
+
run(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Probes the active pnpm version (the one spawn in this command) and collects the
|
|
23
|
+
* report. Collection errors — an unreadable store, a parent that does not exist —
|
|
24
|
+
* become a clean CLI error rather than a stack trace; `this.error` never returns.
|
|
25
|
+
*/
|
|
26
|
+
private collectReport;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../../src/commands/dev/workspace/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAO7C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,OAAO;IACrD,MAAM,CAAC,WAAW,SAIwF;IAE1G,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;MAMV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAa1B;;;;OAIG;YACW,aAAa;CAS5B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { ResolveDirSource, WORKSPACE_DIR_ENV_VAR } from '../../../lib/dev-workspace/dir-flag.js';
|
|
4
|
+
import { CollectDoctorReport, DoctorHasFailures, RenderDoctor } from '../../../lib/dev-workspace/doctor.js';
|
|
5
|
+
import { GetPnpmVersion } from '../../../lib/dev-workspace/pnpm.js';
|
|
6
|
+
/**
|
|
7
|
+
* CLI command: `mj dev workspace doctor`.
|
|
8
|
+
*
|
|
9
|
+
* Read-only health check for a generated cross-repo workspace: prints one
|
|
10
|
+
* PASS/WARN/FAIL/SKIP line per check and exits non-zero when any check FAILS, so
|
|
11
|
+
* it can gate a script. It writes nothing, deletes nothing and makes no network
|
|
12
|
+
* call — every fix it finds is printed as a command for the user to run.
|
|
13
|
+
*
|
|
14
|
+
* The check `status` cannot do is the one-copy census: it reads the parent's pnpm
|
|
15
|
+
* virtual store and fails when more than one version of a must-be-single-copy
|
|
16
|
+
* package (Angular, RxJS, zone.js, MJ core/global) is installed there.
|
|
17
|
+
*/
|
|
18
|
+
export default class DevWorkspaceDoctor extends Command {
|
|
19
|
+
static { this.description = 'Health-check the generated cross-repo pnpm workspace at a parent directory: workspace files, sentinel, ' +
|
|
20
|
+
'pnpm pin vs. active version, member directories, detected-but-unlisted repos, members carrying a standalone ' +
|
|
21
|
+
'install, and a one-copy census of the parent package store (more than one @angular/core, rxjs, zone.js or ' +
|
|
22
|
+
'MJ core/global is a FAIL). Prints PASS/WARN/FAIL per check and exits non-zero on any FAIL. Read-only.'; }
|
|
23
|
+
static { this.examples = [
|
|
24
|
+
'<%= config.bin %> dev workspace doctor',
|
|
25
|
+
'<%= config.bin %> dev workspace doctor --dir ~/code/bluecypress',
|
|
26
|
+
`MJ_DEV_WORKSPACE_DIR=~/code/bluecypress <%= config.bin %> dev workspace doctor`,
|
|
27
|
+
]; }
|
|
28
|
+
static { this.flags = {
|
|
29
|
+
dir: Flags.string({
|
|
30
|
+
description: `Parent directory holding the sibling repo clones (env: ${WORKSPACE_DIR_ENV_VAR})`,
|
|
31
|
+
env: WORKSPACE_DIR_ENV_VAR,
|
|
32
|
+
default: '.',
|
|
33
|
+
}),
|
|
34
|
+
}; }
|
|
35
|
+
async run() {
|
|
36
|
+
const { flags } = await this.parse(DevWorkspaceDoctor);
|
|
37
|
+
const parentDir = path.resolve(flags.dir);
|
|
38
|
+
const dirSource = ResolveDirSource(this.argv, process.env[WORKSPACE_DIR_ENV_VAR]);
|
|
39
|
+
const report = await this.collectReport(parentDir, dirSource);
|
|
40
|
+
this.log('');
|
|
41
|
+
this.log(RenderDoctor(report));
|
|
42
|
+
if (DoctorHasFailures(report)) {
|
|
43
|
+
this.exit(1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Probes the active pnpm version (the one spawn in this command) and collects the
|
|
48
|
+
* report. Collection errors — an unreadable store, a parent that does not exist —
|
|
49
|
+
* become a clean CLI error rather than a stack trace; `this.error` never returns.
|
|
50
|
+
*/
|
|
51
|
+
async collectReport(parentDir, dirSource) {
|
|
52
|
+
try {
|
|
53
|
+
const activePnpm = await GetPnpmVersion(parentDir);
|
|
54
|
+
return CollectDoctorReport(parentDir, activePnpm, dirSource);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
58
|
+
return this.error(message);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../../src/commands/dev/workspace/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,YAAY,EAAqB,MAAM,sCAAsC,CAAC;AAC/H,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGpE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,OAAO;aAC9C,gBAAW,GAChB,yGAAyG;QACzG,8GAA8G;QAC9G,4GAA4G;QAC5G,uGAAuG,CAAC;aAEnG,aAAQ,GAAG;QAChB,wCAAwC;QACxC,iEAAiE;QACjE,gFAAgF;KACjF,CAAC;aAEK,UAAK,GAAG;QACb,GAAG,EAAE,KAAK,CAAC,MA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