@teambit/deprecation 1.0.1028 → 1.0.1030

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.
@@ -16,10 +16,13 @@ export declare class DeprecateCmd implements Command {
16
16
  loader: boolean;
17
17
  remoteOp: boolean;
18
18
  helpUrl: string;
19
+ examples: {
20
+ cmd: string;
21
+ description: string;
22
+ }[];
19
23
  constructor(deprecation: DeprecationMain);
20
- report([id]: [string], { newId, range }: {
24
+ report([pattern]: [string], { newId, range }: {
21
25
  newId?: string;
22
26
  range?: string;
23
27
  }): Promise<string>;
24
- private deprecate;
25
28
  }
@@ -11,43 +11,70 @@ function _cli() {
11
11
  };
12
12
  return data;
13
13
  }
14
+ function _legacy() {
15
+ const data = require("@teambit/legacy.constants");
16
+ _legacy = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _formatPatternResult() {
22
+ const data = require("./format-pattern-result");
23
+ _formatPatternResult = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
14
28
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
15
29
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
16
30
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
31
  class DeprecateCmd {
18
32
  constructor(deprecation) {
19
33
  this.deprecation = deprecation;
20
- _defineProperty(this, "name", 'deprecate <component-name>');
34
+ _defineProperty(this, "name", 'deprecate <component-pattern>');
21
35
  _defineProperty(this, "arguments", [{
22
- name: 'component-name',
23
- description: 'component name or component id'
36
+ name: 'component-pattern',
37
+ description: _legacy().COMPONENT_PATTERN_HELP
24
38
  }]);
25
- _defineProperty(this, "description", 'mark a component as deprecated to discourage its use');
26
- _defineProperty(this, "extendedDescription", `marks a component as deprecated locally, then after snap/tag and export it becomes deprecated in the remote scope.
27
- optionally specify a replacement component or deprecate only specific version ranges.
39
+ _defineProperty(this, "description", 'mark components as deprecated to discourage their use');
40
+ _defineProperty(this, "extendedDescription", `marks components as deprecated locally, then after snap/tag and export they become deprecated in the remote scope.
41
+ the pattern can match multiple components, so several can be deprecated at once.
42
+ optionally specify a replacement component (single component only) or deprecate only specific version ranges.
28
43
  deprecated components remain available but display warnings when installed or imported.`);
29
44
  _defineProperty(this, "group", 'collaborate');
30
45
  _defineProperty(this, "skipWorkspace", true);
31
46
  _defineProperty(this, "alias", 'd');
32
- _defineProperty(this, "options", [['', 'new-id <string>', 'if replaced by another component, enter the new component id. alternatively use "bit rename --deprecate" to do this automatically'], ['', 'range <string>', 'enter a Semver range to deprecate specific versions. see https://www.npmjs.com/package/semver#ranges for the range syntax']]);
47
+ _defineProperty(this, "options", [['', 'new-id <string>', 'if replaced by another component, enter the new component id. alternatively use "bit rename --deprecate" to do this automatically. only valid when the pattern matches a single component'], ['', 'range <string>', 'enter a Semver range to deprecate specific versions. see https://www.npmjs.com/package/semver#ranges for the range syntax']]);
33
48
  _defineProperty(this, "loader", true);
34
49
  _defineProperty(this, "remoteOp", true);
35
50
  _defineProperty(this, "helpUrl", 'reference/components/removing-components');
51
+ _defineProperty(this, "examples", [{
52
+ cmd: 'deprecate "ui/**"',
53
+ description: 'deprecate all components whose id starts with "ui/"'
54
+ }]);
36
55
  }
37
- async report([id], {
56
+ async report([pattern], {
38
57
  newId,
39
58
  range
40
59
  }) {
41
- const result = await this.deprecate(id, newId, range);
42
- if (result) {
43
- const successMessage = range ? `versions of "${id}" matching the range "${range}" have been deprecated successfully` : `the component "${id}" has been deprecated successfully`;
44
- return (0, _cli().formatSuccessSummary)(successMessage);
60
+ const {
61
+ deprecated,
62
+ alreadyDeprecated
63
+ } = await this.deprecation.deprecateByPattern(pattern, newId, range);
64
+ // a range-deprecation only affects specific versions, so reflect that in the single-component messages
65
+ if (range) {
66
+ if (deprecated.length === 1 && !alreadyDeprecated.length) {
67
+ return (0, _cli().formatSuccessSummary)(`versions of "${deprecated[0].toString()}" matching the range "${range}" have been deprecated successfully`);
68
+ }
69
+ if (!deprecated.length && alreadyDeprecated.length === 1) {
70
+ return (0, _cli().formatHint)(`the range "${range}" of "${alreadyDeprecated[0].toString()}" is already deprecated. no changes have been made`);
71
+ }
45
72
  }
46
- const hintMessage = range ? `the range "${range}" of "${id}" is already deprecated. no changes have been made` : `the component "${id}" is already deprecated. no changes have been made`;
47
- return (0, _cli().formatHint)(hintMessage);
48
- }
49
- async deprecate(id, newId, range) {
50
- return this.deprecation.deprecateByCLIValues(id, newId, range);
73
+ return (0, _formatPatternResult().formatPatternResult)(pattern, deprecated, alreadyDeprecated, {
74
+ verb: 'deprecated',
75
+ unchangedTitle: 'already deprecated',
76
+ unchangedState: 'already deprecated'
77
+ });
51
78
  }
52
79
  }
53
80
  exports.DeprecateCmd = DeprecateCmd;
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeprecateCmd","constructor","deprecation","name","description","report","id","newId","range","result","deprecate","successMessage","formatSuccessSummary","hintMessage","formatHint","deprecateByCLIValues","exports"],"sources":["deprecate-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport { formatSuccessSummary, formatHint } from '@teambit/cli';\nimport type { DeprecationMain } from './deprecation.main.runtime';\n\nexport class DeprecateCmd implements Command {\n name = 'deprecate <component-name>';\n arguments = [{ name: 'component-name', description: 'component name or component id' }];\n description = 'mark a component as deprecated to discourage its use';\n extendedDescription = `marks a component as deprecated locally, then after snap/tag and export it becomes deprecated in the remote scope.\noptionally specify a replacement component or deprecate only specific version ranges.\ndeprecated components remain available but display warnings when installed or imported.`;\n group = 'collaborate';\n skipWorkspace = true;\n alias = 'd';\n options = [\n [\n '',\n 'new-id <string>',\n 'if replaced by another component, enter the new component id. alternatively use \"bit rename --deprecate\" to do this automatically',\n ],\n [\n '',\n 'range <string>',\n 'enter a Semver range to deprecate specific versions. see https://www.npmjs.com/package/semver#ranges for the range syntax',\n ],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n helpUrl = 'reference/components/removing-components';\n\n constructor(private deprecation: DeprecationMain) {}\n\n async report([id]: [string], { newId, range }: { newId?: string; range?: string }): Promise<string> {\n const result = await this.deprecate(id, newId, range);\n if (result) {\n const successMessage = range\n ? `versions of \"${id}\" matching the range \"${range}\" have been deprecated successfully`\n : `the component \"${id}\" has been deprecated successfully`;\n return formatSuccessSummary(successMessage);\n }\n const hintMessage = range\n ? `the range \"${range}\" of \"${id}\" is already deprecated. no changes have been made`\n : `the component \"${id}\" is already deprecated. no changes have been made`;\n return formatHint(hintMessage);\n }\n\n private async deprecate(id: string, newId?: string, range?: string): Promise<boolean> {\n return this.deprecation.deprecateByCLIValues(id, newId, range);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgE,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAA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2BAAoB,EAACD,cAAc,CAAC;IAC7C;IACA,MAAME,WAAW,GAAGL,KAAK,GACrB,cAAcA,KAAK,SAASF,EAAE,oDAAoD,GAClF,kBAAkBA,EAAE,oDAAoD;IAC5E,OAAO,IAAAQ,iBAAU,EAACD,WAAW,CAAC;EAChC;EAEA,MAAcH,SAASA,CAACJ,EAAU,EAAEC,KAAc,EAAEC,KAAc,EAAoB;IACpF,OAAO,IAAI,CAACN,WAAW,CAACa,oBAAoB,CAACT,EAAE,EAAEC,KAAK,EAAEC,KAAK,CAAC;EAChE;AACF;AAACQ,OAAA,CAAAhB,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_legacy","_formatPatternResult","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeprecateCmd","constructor","deprecation","name","description","COMPONENT_PATTERN_HELP","cmd","report","pattern","newId","range","deprecated","alreadyDeprecated","deprecateByPattern","length","formatSuccessSummary","toString","formatHint","formatPatternResult","verb","unchangedTitle","unchangedState","exports"],"sources":["deprecate-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport { formatSuccessSummary, formatHint } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { DeprecationMain } from './deprecation.main.runtime';\nimport { formatPatternResult } from './format-pattern-result';\n\nexport class DeprecateCmd implements Command {\n name = 'deprecate <component-pattern>';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n description = 'mark components as deprecated to discourage their use';\n extendedDescription = `marks components as deprecated locally, then after snap/tag and export they become deprecated in the remote scope.\nthe pattern can match multiple components, so several can be deprecated at once.\noptionally specify a replacement component (single component only) or deprecate only specific version ranges.\ndeprecated components remain available but display warnings when installed or imported.`;\n group = 'collaborate';\n skipWorkspace = true;\n alias = 'd';\n options = [\n [\n '',\n 'new-id <string>',\n 'if replaced by another component, enter the new component id. alternatively use \"bit rename --deprecate\" to do this automatically. only valid when the pattern matches a single component',\n ],\n [\n '',\n 'range <string>',\n 'enter a Semver range to deprecate specific versions. see https://www.npmjs.com/package/semver#ranges for the range syntax',\n ],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n helpUrl = 'reference/components/removing-components';\n examples = [\n {\n cmd: 'deprecate \"ui/**\"',\n description: 'deprecate all components whose id starts with \"ui/\"',\n },\n ];\n\n constructor(private deprecation: DeprecationMain) {}\n\n async report([pattern]: [string], { newId, range }: { newId?: string; range?: string }): Promise<string> {\n const { deprecated, alreadyDeprecated } = await this.deprecation.deprecateByPattern(pattern, newId, range);\n // a range-deprecation only affects specific versions, so reflect that in the single-component messages\n if (range) {\n if (deprecated.length === 1 && !alreadyDeprecated.length) {\n return formatSuccessSummary(\n `versions of \"${deprecated[0].toString()}\" matching the range \"${range}\" have been deprecated successfully`\n );\n }\n if (!deprecated.length && alreadyDeprecated.length === 1) {\n return formatHint(\n `the range \"${range}\" of \"${alreadyDeprecated[0].toString()}\" is already deprecated. no changes have been made`\n );\n }\n }\n return formatPatternResult(pattern, deprecated, alreadyDeprecated, {\n verb: 'deprecated',\n unchangedTitle: 'already deprecated',\n unchangedState: 'already deprecated',\n });\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,qBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,oBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8D,SAAAI,gBAAAC,CAAA,EAAAC,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,eAAA,kBACL,0CAA0C;IAAAA,eAAA,mBACzC,CACT;MACEyB,GAAG,EAAE,mBAAmB;MACxBF,WAAW,EAAE;IACf,CAAC,CACF;EAEkD;EAEnD,MAAMG,MAAMA,CAAC,CAACC,OAAO,CAAW,EAAE;IAAEC,KAAK;IAAEC;EAA0C,CAAC,EAAmB;IACvG,MAAM;MAAEC,UAAU;MAAEC;IAAkB,CAAC,GAAG,MAAM,IAAI,CAACV,WAAW,CAACW,kBAAkB,CAACL,OAAO,EAAEC,KAAK,EAAEC,KAAK,CAAC;IAC1G;IACA,IAAIA,KAAK,EAAE;MACT,IAAIC,UAAU,CAACG,MAAM,KAAK,CAAC,IAAI,CAACF,iBAAiB,CAACE,MAAM,EAAE;QACxD,OAAO,IAAAC,2BAAoB,EACzB,gBAAgBJ,UAAU,CAAC,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC,yBAAyBN,KAAK,qCACxE,CAAC;MACH;MACA,IAAI,CAACC,UAAU,CAACG,MAAM,IAAIF,iBAAiB,CAACE,MAAM,KAAK,CAAC,EAAE;QACxD,OAAO,IAAAG,iBAAU,EACf,cAAcP,KAAK,SAASE,iBAAiB,CAAC,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC,oDAC7D,CAAC;MACH;IACF;IACA,OAAO,IAAAE,0CAAmB,EAACV,OAAO,EAAEG,UAAU,EAAEC,iBAAiB,EAAE;MACjEO,IAAI,EAAE,YAAY;MAClBC,cAAc,EAAE,oBAAoB;MACpCC,cAAc,EAAE;IAClB,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAtB,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -12,6 +12,26 @@ export type DeprecationInfo = {
12
12
  newId?: string;
13
13
  range?: string;
14
14
  };
15
+ export type DeprecateByPatternResult = {
16
+ /**
17
+ * components that were deprecated as a result of this operation.
18
+ */
19
+ deprecated: ComponentID[];
20
+ /**
21
+ * components that matched the pattern but were already deprecated (no changes made).
22
+ */
23
+ alreadyDeprecated: ComponentID[];
24
+ };
25
+ export type UnDeprecateByPatternResult = {
26
+ /**
27
+ * components whose deprecation status was removed as a result of this operation.
28
+ */
29
+ undeprecated: ComponentID[];
30
+ /**
31
+ * components that matched the pattern but were not deprecated (no changes made).
32
+ */
33
+ notDeprecated: ComponentID[];
34
+ };
15
35
  export type DeprecationMetadata = {
16
36
  /**
17
37
  * whether the head is deprecated
@@ -43,8 +63,32 @@ export declare class DeprecationMain {
43
63
  */
44
64
  deprecate(componentId: ComponentID, newId?: ComponentID, range?: string): Promise<boolean>;
45
65
  deprecateByCLIValues(id: string, newId?: string, range?: string): Promise<boolean>;
66
+ /**
67
+ * deprecate all components matching the given pattern. the pattern can match multiple components.
68
+ * see `COMPONENT_PATTERN_HELP` for the supported pattern syntax.
69
+ */
70
+ deprecateByPattern(pattern: string, newId?: string, range?: string): Promise<DeprecateByPatternResult>;
46
71
  unDeprecateByCLIValues(id: string): Promise<boolean>;
47
72
  unDeprecate(componentId: ComponentID): Promise<boolean>;
73
+ /**
74
+ * remove the deprecation status from all components matching the given pattern.
75
+ * the pattern can match multiple components. see `COMPONENT_PATTERN_HELP` for the supported pattern syntax.
76
+ */
77
+ unDeprecateByPattern(pattern: string): Promise<UnDeprecateByPatternResult>;
78
+ /**
79
+ * whether the component is currently deprecated, considering both the pending local .bitmap config
80
+ * (authoritative when present) and the persisted model/scope state.
81
+ */
82
+ private isDeprecated;
83
+ /**
84
+ * whether the component has any deprecation that an undeprecate should clear. unlike isDeprecated(),
85
+ * this also treats a range-deprecation as clearable (whether it lives in the local .bitmap or is
86
+ * already baked into the model), so "bit undeprecate" can revert a prior "bit deprecate --range" even
87
+ * when the head version is outside the range and thus not "currently" deprecated.
88
+ */
89
+ private hasDeprecationToClear;
90
+ private setDeprecateConfig;
91
+ private setUnDeprecateConfig;
48
92
  addDeprecatedDependenciesIssues(components: Component[]): Promise<void>;
49
93
  private addDeprecatedDepIssue;
50
94
  private isComponentDeprecated;
@@ -166,14 +166,7 @@ class DeprecationMain {
166
166
  * @returns boolean whether or not the component has been deprecated
167
167
  */
168
168
  async deprecate(componentId, newId, range) {
169
- if (range && !_semver().default.validRange(range)) {
170
- throw new (_bitError().BitError)(`the range "${range}" is invalid. see https://www.npmjs.com/package/semver#ranges for the range syntax`);
171
- }
172
- const results = this.workspace.bitMap.addComponentConfig(componentId, _deprecation().DeprecationAspect.id, {
173
- deprecate: !range,
174
- newId: newId?.toObject(),
175
- range
176
- });
169
+ const results = this.setDeprecateConfig(componentId, newId, range);
177
170
  await this.workspace.bitMap.write(`deprecate ${componentId.toString()}`);
178
171
  return results;
179
172
  }
@@ -182,17 +175,130 @@ class DeprecationMain {
182
175
  const newComponentId = newId ? await this.workspace.resolveComponentId(newId) : undefined;
183
176
  return this.deprecate(componentId, newComponentId, range);
184
177
  }
178
+
179
+ /**
180
+ * deprecate all components matching the given pattern. the pattern can match multiple components.
181
+ * see `COMPONENT_PATTERN_HELP` for the supported pattern syntax.
182
+ */
183
+ async deprecateByPattern(pattern, newId, range) {
184
+ const componentIds = await this.workspace.idsByPattern(pattern);
185
+ // reject the invalid multi-match + --new-id combination before resolving newId, so we don't
186
+ // trigger registry/package-name resolution (which can fail) for a command that's already invalid.
187
+ if (newId && componentIds.length > 1) {
188
+ throw new (_bitError().BitError)(`--new-id sets a single replacement component, but the pattern "${pattern}" matched ${componentIds.length} components.
189
+ run the command per-component to use --new-id, or remove it to deprecate them all`);
190
+ }
191
+ const newComponentId = newId ? await this.workspace.resolveComponentId(newId) : undefined;
192
+ const deprecated = [];
193
+ const alreadyDeprecated = [];
194
+ await (0, _pMapSeries().default)(componentIds, async componentId => {
195
+ // when the component is already deprecated and there's no replacement/range to (re)set, there's
196
+ // nothing to change. bucketing by the actual deprecated-state (bitmap + model) rather than by the
197
+ // bitmap config-diff avoids re-writing redundant config (e.g. for "$deprecated" matches) and
198
+ // reporting already-deprecated components as newly deprecated.
199
+ if (!newComponentId && !range && (await this.isDeprecated(componentId))) {
200
+ alreadyDeprecated.push(componentId);
201
+ return;
202
+ }
203
+ this.setDeprecateConfig(componentId, newComponentId, range);
204
+ deprecated.push(componentId);
205
+ });
206
+ if (deprecated.length) {
207
+ await this.workspace.bitMap.write(`deprecate ${pattern}`);
208
+ }
209
+ return {
210
+ deprecated,
211
+ alreadyDeprecated
212
+ };
213
+ }
185
214
  async unDeprecateByCLIValues(id) {
186
215
  const componentId = await this.workspace.resolveComponentId(id);
187
216
  return this.unDeprecate(componentId);
188
217
  }
189
218
  async unDeprecate(componentId) {
190
- const results = this.workspace.bitMap.addComponentConfig(componentId, _deprecation().DeprecationAspect.id, {
219
+ const results = this.setUnDeprecateConfig(componentId);
220
+ await this.workspace.bitMap.write(`undeprecate ${componentId.toString()}`);
221
+ return results;
222
+ }
223
+
224
+ /**
225
+ * remove the deprecation status from all components matching the given pattern.
226
+ * the pattern can match multiple components. see `COMPONENT_PATTERN_HELP` for the supported pattern syntax.
227
+ */
228
+ async unDeprecateByPattern(pattern) {
229
+ const componentIds = await this.workspace.idsByPattern(pattern);
230
+ const undeprecated = [];
231
+ const notDeprecated = [];
232
+ await (0, _pMapSeries().default)(componentIds, async componentId => {
233
+ // only undeprecate components that actually have a deprecation to clear (incl. range-deprecations,
234
+ // which are stored with deprecate:false). bucketing by the real state rather than the bitmap
235
+ // config-diff avoids writing a redundant "deprecate: false" config (and marking the component as
236
+ // modified) for components that were never deprecated.
237
+ if (!(await this.hasDeprecationToClear(componentId))) {
238
+ notDeprecated.push(componentId);
239
+ return;
240
+ }
241
+ this.setUnDeprecateConfig(componentId);
242
+ undeprecated.push(componentId);
243
+ });
244
+ if (undeprecated.length) {
245
+ await this.workspace.bitMap.write(`undeprecate ${pattern}`);
246
+ }
247
+ return {
248
+ undeprecated,
249
+ notDeprecated
250
+ };
251
+ }
252
+
253
+ /**
254
+ * whether the component is currently deprecated, considering both the pending local .bitmap config
255
+ * (authoritative when present) and the persisted model/scope state.
256
+ */
257
+ async isDeprecated(componentId) {
258
+ const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId, {
259
+ ignoreVersion: true
260
+ });
261
+ if (bitmapEntry?.isDeprecated()) return true;
262
+ if (bitmapEntry?.isUndeprecated()) return false;
263
+ return this.isDeprecatedByIdWithoutLoadingComponent(componentId);
264
+ }
265
+
266
+ /**
267
+ * whether the component has any deprecation that an undeprecate should clear. unlike isDeprecated(),
268
+ * this also treats a range-deprecation as clearable (whether it lives in the local .bitmap or is
269
+ * already baked into the model), so "bit undeprecate" can revert a prior "bit deprecate --range" even
270
+ * when the head version is outside the range and thus not "currently" deprecated.
271
+ */
272
+ async hasDeprecationToClear(componentId) {
273
+ const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId, {
274
+ ignoreVersion: true
275
+ });
276
+ if (bitmapEntry?.isDeprecated() || bitmapEntry?.isDeprecatedByRange()) return true;
277
+ if (bitmapEntry?.isUndeprecated()) return false;
278
+ // no decisive local config — consult the model. use getDeprecationInfo (which reports the configured
279
+ // range regardless of the head version) rather than the version-specific isDeprecated() check.
280
+ const component = await this.workspace.get(componentId);
281
+ const {
282
+ isDeprecate,
283
+ range
284
+ } = await this.getDeprecationInfo(component);
285
+ return isDeprecate || Boolean(range);
286
+ }
287
+ setDeprecateConfig(componentId, newId, range) {
288
+ if (range && !_semver().default.validRange(range)) {
289
+ throw new (_bitError().BitError)(`the range "${range}" is invalid. see https://www.npmjs.com/package/semver#ranges for the range syntax`);
290
+ }
291
+ return this.workspace.bitMap.addComponentConfig(componentId, _deprecation().DeprecationAspect.id, {
292
+ deprecate: !range,
293
+ newId: newId?.toObject(),
294
+ range
295
+ });
296
+ }
297
+ setUnDeprecateConfig(componentId) {
298
+ return this.workspace.bitMap.addComponentConfig(componentId, _deprecation().DeprecationAspect.id, {
191
299
  deprecate: false,
192
300
  newId: ''
193
301
  });
194
- await this.workspace.bitMap.write(`undeprecate ${componentId.toString()}`);
195
- return results;
196
302
  }
197
303
  async addDeprecatedDependenciesIssues(components) {
198
304
  await (0, _pMapSeries().default)(components, async component => {
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_bitError","_component","_scope","_workspace","_graphql","_deprecation","_deprecation2","_deprecation3","_deprecateCmd","_undeprecateCmd","_issues","_pMapSeries","_dependencyResolver","_lodash","_componentIssues","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeprecationMain","constructor","scope","workspace","depsResolver","getDeprecationInfo","component","headComponent","getHeadComponent","config","extensions","findExtension","DeprecationAspect","id","deprecatedBackwardCompatibility","state","_consumer","deprecated","isDeprecate","Boolean","deprecate","currentTag","getTag","isDeprecateByRange","range","semver","satisfies","version","newId","ComponentID","fromObject","toString","undefined","head","hash","headTag","headComp","get","changeVersion","Error","componentId","validRange","BitError","results","bitMap","addComponentConfig","toObject","write","deprecateByCLIValues","resolveComponentId","newComponentId","unDeprecateByCLIValues","unDeprecate","addDeprecatedDependenciesIssues","components","pMapSeries","addDeprecatedDepIssue","isSelfDeprecated","isComponentDeprecated","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","map","dep","isRemoved","isDeprecatedByIdWithoutLoadingComponent","removed","compact","length","issues","getOrCreate","IssuesClasses","DeprecatedDependencies","hasVersion","bitmapEntry","getBitmapEntryIfExist","isDeprecated","isUndeprecated","modelComp","getBitObjectModelComponent","legacyScope","objects","provider","graphql","componentAspect","cli","deprecation","registerAddComponentsIssues","bind","register","DeprecateCmd","UndeprecateCmd","registerShowFragments","DeprecationFragment","deprecationSchema","exports","MainRuntime","GraphqlAspect","ScopeAspect","ComponentAspect","WorkspaceAspect","CLIAspect","DependencyResolverAspect","IssuesAspect","addRuntime"],"sources":["deprecation.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport type { ComponentMain, Component } from '@teambit/component';\nimport { ComponentAspect, ComponentID } from '@teambit/component';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport type { ComponentIdObj } from '@teambit/component-id';\nimport { DeprecationAspect } from './deprecation.aspect';\nimport { deprecationSchema } from './deprecation.graphql';\nimport { DeprecationFragment } from './deprecation.fragment';\nimport { DeprecateCmd } from './deprecate-cmd';\nimport { UndeprecateCmd } from './undeprecate-cmd';\nimport type { IssuesMain } from '@teambit/issues';\nimport { IssuesAspect } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport { compact } from 'lodash';\nimport { IssuesClasses } from '@teambit/component-issues';\n\nexport type DeprecationInfo = {\n isDeprecate: boolean;\n newId?: string;\n range?: string;\n};\n\nexport type DeprecationMetadata = {\n /**\n * whether the head is deprecated\n */\n deprecate?: boolean;\n /**\n * the new id to use instead of the current one\n */\n newId?: ComponentIdObj;\n /**\n * Semver range to deprecate previous versions\n */\n range?: string;\n};\n\nexport class DeprecationMain {\n constructor(\n private scope: ScopeMain,\n private workspace: Workspace,\n private depsResolver: DependencyResolverMain\n ) {}\n\n async getDeprecationInfo(component: Component): Promise<DeprecationInfo> {\n const headComponent = await this.getHeadComponent(component);\n\n const data = headComponent.config.extensions.findExtension(DeprecationAspect.id)?.config as\n | DeprecationMetadata\n | undefined;\n const deprecatedBackwardCompatibility = component.state._consumer.deprecated;\n const isDeprecate = Boolean(data?.deprecate || deprecatedBackwardCompatibility);\n const currentTag = component.getTag();\n const isDeprecateByRange = Boolean(data?.range && currentTag && semver.satisfies(currentTag.version, data.range));\n const newId = data?.newId ? ComponentID.fromObject(data?.newId).toString() : undefined;\n return {\n isDeprecate: isDeprecate || isDeprecateByRange,\n newId,\n range: data?.range,\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exits, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * mark a component as deprecated. after this change, the component will be modified.\n * tag and export the component to have it deprecated on the remote.\n *\n * @param componentId\n * @param newId\n * @returns boolean whether or not the component has been deprecated\n */\n async deprecate(componentId: ComponentID, newId?: ComponentID, range?: string): Promise<boolean> {\n if (range && !semver.validRange(range)) {\n throw new BitError(\n `the range \"${range}\" is invalid. see https://www.npmjs.com/package/semver#ranges for the range syntax`\n );\n }\n const results = this.workspace.bitMap.addComponentConfig(componentId, DeprecationAspect.id, {\n deprecate: !range,\n newId: newId?.toObject(),\n range,\n });\n await this.workspace.bitMap.write(`deprecate ${componentId.toString()}`);\n\n return results;\n }\n\n async deprecateByCLIValues(id: string, newId?: string, range?: string): Promise<boolean> {\n const componentId = await this.workspace.resolveComponentId(id);\n const newComponentId = newId ? await this.workspace.resolveComponentId(newId) : undefined;\n return this.deprecate(componentId, newComponentId, range);\n }\n\n async unDeprecateByCLIValues(id: string): Promise<boolean> {\n const componentId = await this.workspace.resolveComponentId(id);\n return this.unDeprecate(componentId);\n }\n\n async unDeprecate(componentId: ComponentID) {\n const results = this.workspace.bitMap.addComponentConfig(componentId, DeprecationAspect.id, {\n deprecate: false,\n newId: '',\n });\n await this.workspace.bitMap.write(`undeprecate ${componentId.toString()}`);\n\n return results;\n }\n\n async addDeprecatedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addDeprecatedDepIssue(component);\n });\n }\n\n private async addDeprecatedDepIssue(component: Component) {\n const isSelfDeprecated = await this.isComponentDeprecated(component);\n if (isSelfDeprecated) return;\n const dependencies = this.depsResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isDeprecatedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.DeprecatedDependencies).data = removed;\n }\n }\n\n private async isComponentDeprecated(component: Component): Promise<boolean> {\n if (!component.id.hasVersion()) {\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(component.id);\n return Boolean(bitmapEntry && bitmapEntry.isDeprecated());\n }\n return this.isDeprecatedByIdWithoutLoadingComponent(component.id);\n }\n\n /**\n * performant version of isDeprecated() in case the component object is not available and loading it is expensive.\n */\n private async isDeprecatedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isDeprecated()) return true;\n if (bitmapEntry && bitmapEntry.isUndeprecated()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const isDeprecated = await modelComp.isDeprecated(\n this.workspace.scope.legacyScope.objects,\n componentId.version as string\n );\n return Boolean(isDeprecated);\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n GraphqlAspect,\n ScopeAspect,\n ComponentAspect,\n WorkspaceAspect,\n CLIAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static async provider([graphql, scope, componentAspect, workspace, cli, depsResolver, issues]: [\n GraphqlMain,\n ScopeMain,\n ComponentMain,\n Workspace,\n CLIMain,\n DependencyResolverMain,\n IssuesMain,\n ]) {\n const deprecation = new DeprecationMain(scope, workspace, depsResolver);\n issues.registerAddComponentsIssues(deprecation.addDeprecatedDependenciesIssues.bind(deprecation));\n cli.register(new DeprecateCmd(deprecation), new UndeprecateCmd(deprecation));\n componentAspect.registerShowFragments([new DeprecationFragment(deprecation)]);\n graphql.register(() => deprecationSchema(deprecation));\n\n return deprecation;\n }\n}\n\nDeprecationAspect.addRuntime(DeprecationMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,aAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,YAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA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AO,EACxC3C,WAAW,CAACb,OACd,CAAC;IACD,OAAOR,OAAO,CAAC2D,YAAY,CAAC;EAC9B;EAYA,aAAaM,QAAQA,CAAC,CAACC,OAAO,EAAEnF,KAAK,EAAEoF,eAAe,EAAEnF,SAAS,EAAEoF,GAAG,EAAEnF,YAAY,EAAEmE,MAAM,CAQ3F,EAAE;IACD,MAAMiB,WAAW,GAAG,IAAIxF,eAAe,CAACE,KAAK,EAAEC,SAAS,EAAEC,YAAY,CAAC;IACvEmE,MAAM,CAACkB,2BAA2B,CAACD,WAAW,CAACnC,+BAA+B,CAACqC,IAAI,CAACF,WAAW,CAAC,CAAC;IACjGD,GAAG,CAACI,QAAQ,CAAC,KAAIC,4BAAY,EAACJ,WAAW,CAAC,EAAE,KAAIK,gCAAc,EAACL,WAAW,CAAC,CAAC;IAC5EF,eAAe,CAACQ,qBAAqB,CAAC,CAAC,KAAIC,mCAAmB,EAACP,WAAW,CAAC,CAAC,CAAC;IAC7EH,OAAO,CAACM,QAAQ,CAAC,MAAM,IAAAK,iCAAiB,EAACR,WAAW,CAAC,CAAC;IAEtD,OAAOA,WAAW;EACpB;AACF;AAACS,OAAA,CAAAjG,eAAA,GAAAA,eAAA;AAAAlB,eAAA,CAjKYkB,eAAe,aAsITkG,kBAAW;AAAApH,eAAA,CAtIjBkB,eAAe,kBAuIJ,CACpBmG,wBAAa,EACbC,oBAAW,EACXC,4BAAe,EACfC,4BAAe,EACfC,gBAAS,EACTC,8CAAwB,EACxBC,sBAAY,CACb;AAoBH7F,gCAAiB,CAAC8F,UAAU,CAAC1G,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_bitError","_component","_scope","_workspace","_graphql","_deprecation","_deprecation2","_deprecation3","_deprecateCmd","_undeprecateCmd","_issues","_pMapSeries","_dependencyResolver","_lodash","_componentIssues","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeprecationMain","constructor","scope","workspace","depsResolver","getDeprecationInfo","component","headComponent","getHeadComponent","config","extensions","findExtension","DeprecationAspect","id","deprecatedBackwardCompatibility","state","_consumer","deprecated","isDeprecate","Boolean","deprecate","currentTag","getTag","isDeprecateByRange","range","semver","satisfies","version","newId","ComponentID","fromObject","toString","undefined","head","hash","headTag","headComp","get","changeVersion","Error","componentId","results","setDeprecateConfig","bitMap","write","deprecateByCLIValues","resolveComponentId","newComponentId","deprecateByPattern","pattern","componentIds","idsByPattern","length","BitError","alreadyDeprecated","pMapSeries","isDeprecated","push","unDeprecateByCLIValues","unDeprecate","setUnDeprecateConfig","unDeprecateByPattern","undeprecated","notDeprecated","hasDeprecationToClear","bitmapEntry","getBitmapEntryIfExist","ignoreVersion","isUndeprecated","isDeprecatedByIdWithoutLoadingComponent","isDeprecatedByRange","validRange","addComponentConfig","toObject","addDeprecatedDependenciesIssues","components","addDeprecatedDepIssue","isSelfDeprecated","isComponentDeprecated","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","map","dep","isRemoved","removed","compact","issues","getOrCreate","IssuesClasses","DeprecatedDependencies","hasVersion","modelComp","getBitObjectModelComponent","legacyScope","objects","provider","graphql","componentAspect","cli","deprecation","registerAddComponentsIssues","bind","register","DeprecateCmd","UndeprecateCmd","registerShowFragments","DeprecationFragment","deprecationSchema","exports","MainRuntime","GraphqlAspect","ScopeAspect","ComponentAspect","WorkspaceAspect","CLIAspect","DependencyResolverAspect","IssuesAspect","addRuntime"],"sources":["deprecation.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport type { ComponentMain, Component } from '@teambit/component';\nimport { ComponentAspect, ComponentID } from '@teambit/component';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport type { ComponentIdObj } from '@teambit/component-id';\nimport { DeprecationAspect } from './deprecation.aspect';\nimport { deprecationSchema } from './deprecation.graphql';\nimport { DeprecationFragment } from './deprecation.fragment';\nimport { DeprecateCmd } from './deprecate-cmd';\nimport { UndeprecateCmd } from './undeprecate-cmd';\nimport type { IssuesMain } from '@teambit/issues';\nimport { IssuesAspect } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport { compact } from 'lodash';\nimport { IssuesClasses } from '@teambit/component-issues';\n\nexport type DeprecationInfo = {\n isDeprecate: boolean;\n newId?: string;\n range?: string;\n};\n\nexport type DeprecateByPatternResult = {\n /**\n * components that were deprecated as a result of this operation.\n */\n deprecated: ComponentID[];\n /**\n * components that matched the pattern but were already deprecated (no changes made).\n */\n alreadyDeprecated: ComponentID[];\n};\n\nexport type UnDeprecateByPatternResult = {\n /**\n * components whose deprecation status was removed as a result of this operation.\n */\n undeprecated: ComponentID[];\n /**\n * components that matched the pattern but were not deprecated (no changes made).\n */\n notDeprecated: ComponentID[];\n};\n\nexport type DeprecationMetadata = {\n /**\n * whether the head is deprecated\n */\n deprecate?: boolean;\n /**\n * the new id to use instead of the current one\n */\n newId?: ComponentIdObj;\n /**\n * Semver range to deprecate previous versions\n */\n range?: string;\n};\n\nexport class DeprecationMain {\n constructor(\n private scope: ScopeMain,\n private workspace: Workspace,\n private depsResolver: DependencyResolverMain\n ) {}\n\n async getDeprecationInfo(component: Component): Promise<DeprecationInfo> {\n const headComponent = await this.getHeadComponent(component);\n\n const data = headComponent.config.extensions.findExtension(DeprecationAspect.id)?.config as\n | DeprecationMetadata\n | undefined;\n const deprecatedBackwardCompatibility = component.state._consumer.deprecated;\n const isDeprecate = Boolean(data?.deprecate || deprecatedBackwardCompatibility);\n const currentTag = component.getTag();\n const isDeprecateByRange = Boolean(data?.range && currentTag && semver.satisfies(currentTag.version, data.range));\n const newId = data?.newId ? ComponentID.fromObject(data?.newId).toString() : undefined;\n return {\n isDeprecate: isDeprecate || isDeprecateByRange,\n newId,\n range: data?.range,\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exits, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * mark a component as deprecated. after this change, the component will be modified.\n * tag and export the component to have it deprecated on the remote.\n *\n * @param componentId\n * @param newId\n * @returns boolean whether or not the component has been deprecated\n */\n async deprecate(componentId: ComponentID, newId?: ComponentID, range?: string): Promise<boolean> {\n const results = this.setDeprecateConfig(componentId, newId, range);\n await this.workspace.bitMap.write(`deprecate ${componentId.toString()}`);\n\n return results;\n }\n\n async deprecateByCLIValues(id: string, newId?: string, range?: string): Promise<boolean> {\n const componentId = await this.workspace.resolveComponentId(id);\n const newComponentId = newId ? await this.workspace.resolveComponentId(newId) : undefined;\n return this.deprecate(componentId, newComponentId, range);\n }\n\n /**\n * deprecate all components matching the given pattern. the pattern can match multiple components.\n * see `COMPONENT_PATTERN_HELP` for the supported pattern syntax.\n */\n async deprecateByPattern(pattern: string, newId?: string, range?: string): Promise<DeprecateByPatternResult> {\n const componentIds = await this.workspace.idsByPattern(pattern);\n // reject the invalid multi-match + --new-id combination before resolving newId, so we don't\n // trigger registry/package-name resolution (which can fail) for a command that's already invalid.\n if (newId && componentIds.length > 1) {\n throw new BitError(\n `--new-id sets a single replacement component, but the pattern \"${pattern}\" matched ${componentIds.length} components.\nrun the command per-component to use --new-id, or remove it to deprecate them all`\n );\n }\n const newComponentId = newId ? await this.workspace.resolveComponentId(newId) : undefined;\n const deprecated: ComponentID[] = [];\n const alreadyDeprecated: ComponentID[] = [];\n await pMapSeries(componentIds, async (componentId) => {\n // when the component is already deprecated and there's no replacement/range to (re)set, there's\n // nothing to change. bucketing by the actual deprecated-state (bitmap + model) rather than by the\n // bitmap config-diff avoids re-writing redundant config (e.g. for \"$deprecated\" matches) and\n // reporting already-deprecated components as newly deprecated.\n if (!newComponentId && !range && (await this.isDeprecated(componentId))) {\n alreadyDeprecated.push(componentId);\n return;\n }\n this.setDeprecateConfig(componentId, newComponentId, range);\n deprecated.push(componentId);\n });\n if (deprecated.length) {\n await this.workspace.bitMap.write(`deprecate ${pattern}`);\n }\n\n return { deprecated, alreadyDeprecated };\n }\n\n async unDeprecateByCLIValues(id: string): Promise<boolean> {\n const componentId = await this.workspace.resolveComponentId(id);\n return this.unDeprecate(componentId);\n }\n\n async unDeprecate(componentId: ComponentID) {\n const results = this.setUnDeprecateConfig(componentId);\n await this.workspace.bitMap.write(`undeprecate ${componentId.toString()}`);\n\n return results;\n }\n\n /**\n * remove the deprecation status from all components matching the given pattern.\n * the pattern can match multiple components. see `COMPONENT_PATTERN_HELP` for the supported pattern syntax.\n */\n async unDeprecateByPattern(pattern: string): Promise<UnDeprecateByPatternResult> {\n const componentIds = await this.workspace.idsByPattern(pattern);\n const undeprecated: ComponentID[] = [];\n const notDeprecated: ComponentID[] = [];\n await pMapSeries(componentIds, async (componentId) => {\n // only undeprecate components that actually have a deprecation to clear (incl. range-deprecations,\n // which are stored with deprecate:false). bucketing by the real state rather than the bitmap\n // config-diff avoids writing a redundant \"deprecate: false\" config (and marking the component as\n // modified) for components that were never deprecated.\n if (!(await this.hasDeprecationToClear(componentId))) {\n notDeprecated.push(componentId);\n return;\n }\n this.setUnDeprecateConfig(componentId);\n undeprecated.push(componentId);\n });\n if (undeprecated.length) {\n await this.workspace.bitMap.write(`undeprecate ${pattern}`);\n }\n\n return { undeprecated, notDeprecated };\n }\n\n /**\n * whether the component is currently deprecated, considering both the pending local .bitmap config\n * (authoritative when present) and the persisted model/scope state.\n */\n private async isDeprecated(componentId: ComponentID): Promise<boolean> {\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId, { ignoreVersion: true });\n if (bitmapEntry?.isDeprecated()) return true;\n if (bitmapEntry?.isUndeprecated()) return false;\n return this.isDeprecatedByIdWithoutLoadingComponent(componentId);\n }\n\n /**\n * whether the component has any deprecation that an undeprecate should clear. unlike isDeprecated(),\n * this also treats a range-deprecation as clearable (whether it lives in the local .bitmap or is\n * already baked into the model), so \"bit undeprecate\" can revert a prior \"bit deprecate --range\" even\n * when the head version is outside the range and thus not \"currently\" deprecated.\n */\n private async hasDeprecationToClear(componentId: ComponentID): Promise<boolean> {\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId, { ignoreVersion: true });\n if (bitmapEntry?.isDeprecated() || bitmapEntry?.isDeprecatedByRange()) return true;\n if (bitmapEntry?.isUndeprecated()) return false;\n // no decisive local config — consult the model. use getDeprecationInfo (which reports the configured\n // range regardless of the head version) rather than the version-specific isDeprecated() check.\n const component = await this.workspace.get(componentId);\n const { isDeprecate, range } = await this.getDeprecationInfo(component);\n return isDeprecate || Boolean(range);\n }\n\n private setDeprecateConfig(componentId: ComponentID, newId?: ComponentID, range?: string): boolean {\n if (range && !semver.validRange(range)) {\n throw new BitError(\n `the range \"${range}\" is invalid. see https://www.npmjs.com/package/semver#ranges for the range syntax`\n );\n }\n return this.workspace.bitMap.addComponentConfig(componentId, DeprecationAspect.id, {\n deprecate: !range,\n newId: newId?.toObject(),\n range,\n });\n }\n\n private setUnDeprecateConfig(componentId: ComponentID): boolean {\n return this.workspace.bitMap.addComponentConfig(componentId, DeprecationAspect.id, {\n deprecate: false,\n newId: '',\n });\n }\n\n async addDeprecatedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addDeprecatedDepIssue(component);\n });\n }\n\n private async addDeprecatedDepIssue(component: Component) {\n const isSelfDeprecated = await this.isComponentDeprecated(component);\n if (isSelfDeprecated) return;\n const dependencies = this.depsResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isDeprecatedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.DeprecatedDependencies).data = removed;\n }\n }\n\n private async isComponentDeprecated(component: Component): Promise<boolean> {\n if (!component.id.hasVersion()) {\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(component.id);\n return Boolean(bitmapEntry && bitmapEntry.isDeprecated());\n }\n return this.isDeprecatedByIdWithoutLoadingComponent(component.id);\n }\n\n /**\n * performant version of isDeprecated() in case the component object is not available and loading it is expensive.\n */\n private async isDeprecatedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isDeprecated()) return true;\n if (bitmapEntry && bitmapEntry.isUndeprecated()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const isDeprecated = await modelComp.isDeprecated(\n this.workspace.scope.legacyScope.objects,\n componentId.version as string\n );\n return Boolean(isDeprecated);\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n GraphqlAspect,\n ScopeAspect,\n ComponentAspect,\n WorkspaceAspect,\n CLIAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static async provider([graphql, scope, componentAspect, workspace, cli, depsResolver, issues]: [\n GraphqlMain,\n ScopeMain,\n ComponentMain,\n Workspace,\n CLIMain,\n DependencyResolverMain,\n IssuesMain,\n ]) {\n const deprecation = new DeprecationMain(scope, workspace, depsResolver);\n issues.registerAddComponentsIssues(deprecation.addDeprecatedDependenciesIssues.bind(deprecation));\n cli.register(new DeprecateCmd(deprecation), new UndeprecateCmd(deprecation));\n componentAspect.registerShowFragments([new DeprecationFragment(deprecation)]);\n graphql.register(() => deprecationSchema(deprecation));\n\n return deprecation;\n }\n}\n\nDeprecationAspect.addRuntime(DeprecationMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,aAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,YAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;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qB,CAAC,CAAC,KAAIC,mCAAmB,EAACP,WAAW,CAAC,CAAC,CAAC;IAC7EH,OAAO,CAACM,QAAQ,CAAC,MAAM,IAAAK,iCAAiB,EAACR,WAAW,CAAC,CAAC;IAEtD,OAAOA,WAAW;EACpB;AACF;AAACS,OAAA,CAAA/G,eAAA,GAAAA,eAAA;AAAAlB,eAAA,CApQYkB,eAAe,aAyOTgH,kBAAW;AAAAlI,eAAA,CAzOjBkB,eAAe,kBA0OJ,CACpBiH,wBAAa,EACbC,oBAAW,EACXC,4BAAe,EACfC,4BAAe,EACfC,gBAAS,EACTC,8CAAwB,EACxBC,sBAAY,CACb;AAoBH3G,gCAAiB,CAAC4G,UAAU,CAACxH,eAAe,CAAC","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ import type { ComponentID } from '@teambit/component-id';
2
+ export type PatternResultLabels = {
3
+ /** past-tense verb used in the success messages and the changed-section title, e.g. "deprecated" */
4
+ verb: string;
5
+ /** section title for the components that were left unchanged, e.g. "already deprecated" */
6
+ unchangedTitle: string;
7
+ /** describes the unchanged state in the "no changes" hint, e.g. "already deprecated" */
8
+ unchangedState: string;
9
+ };
10
+ /**
11
+ * shared output formatting for the pattern-based deprecate/undeprecate commands: a single-line summary
12
+ * for the common single-component case, a hint when nothing changed, or a sectioned summary listing the
13
+ * changed and unchanged components.
14
+ */
15
+ export declare function formatPatternResult(pattern: string, changed: ComponentID[], unchanged: ComponentID[], labels: PatternResultLabels): string;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatPatternResult = formatPatternResult;
7
+ function _cli() {
8
+ const data = require("@teambit/cli");
9
+ _cli = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ /**
15
+ * shared output formatting for the pattern-based deprecate/undeprecate commands: a single-line summary
16
+ * for the common single-component case, a hint when nothing changed, or a sectioned summary listing the
17
+ * changed and unchanged components.
18
+ */
19
+ function formatPatternResult(pattern, changed, unchanged, labels) {
20
+ // preserve the familiar single-line message when only one component is affected
21
+ if (changed.length === 1 && !unchanged.length) {
22
+ return (0, _cli().formatSuccessSummary)(`the component "${changed[0].toString()}" has been ${labels.verb} successfully`);
23
+ }
24
+ if (!changed.length) {
25
+ return (0, _cli().formatHint)(`all ${unchanged.length} component(s) matching "${pattern}" are ${labels.unchangedState}. no changes have been made`);
26
+ }
27
+ return (0, _cli().joinSections)([(0, _cli().formatSuccessSummary)(`${changed.length} component(s) have been ${labels.verb} successfully`), (0, _cli().formatSection)(labels.verb, '', changed.map(id => (0, _cli().formatItem)(id.toString()))), (0, _cli().formatSection)(labels.unchangedTitle, 'no changes were made to these', unchanged.map(id => (0, _cli().formatItem)(id.toString())))]);
28
+ }
29
+
30
+ //# sourceMappingURL=format-pattern-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_cli","data","require","formatPatternResult","pattern","changed","unchanged","labels","length","formatSuccessSummary","toString","verb","formatHint","unchangedState","joinSections","formatSection","map","id","formatItem","unchangedTitle"],"sources":["format-pattern-result.ts"],"sourcesContent":["import type { ComponentID } from '@teambit/component-id';\nimport { formatSuccessSummary, formatHint, formatSection, formatItem, joinSections } from '@teambit/cli';\n\nexport type PatternResultLabels = {\n /** past-tense verb used in the success messages and the changed-section title, e.g. \"deprecated\" */\n verb: string;\n /** section title for the components that were left unchanged, e.g. \"already deprecated\" */\n unchangedTitle: string;\n /** describes the unchanged state in the \"no changes\" hint, e.g. \"already deprecated\" */\n unchangedState: string;\n};\n\n/**\n * shared output formatting for the pattern-based deprecate/undeprecate commands: a single-line summary\n * for the common single-component case, a hint when nothing changed, or a sectioned summary listing the\n * changed and unchanged components.\n */\nexport function formatPatternResult(\n pattern: string,\n changed: ComponentID[],\n unchanged: ComponentID[],\n labels: PatternResultLabels\n): string {\n // preserve the familiar single-line message when only one component is affected\n if (changed.length === 1 && !unchanged.length) {\n return formatSuccessSummary(`the component \"${changed[0].toString()}\" has been ${labels.verb} successfully`);\n }\n if (!changed.length) {\n return formatHint(\n `all ${unchanged.length} component(s) matching \"${pattern}\" are ${labels.unchangedState}. no changes have been made`\n );\n }\n\n return joinSections([\n formatSuccessSummary(`${changed.length} component(s) have been ${labels.verb} successfully`),\n formatSection(\n labels.verb,\n '',\n changed.map((id) => formatItem(id.toString()))\n ),\n formatSection(\n labels.unchangedTitle,\n 'no changes were made to these',\n unchanged.map((id) => formatItem(id.toString()))\n ),\n ]);\n}\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAWA;AACA;AACA;AACA;AACA;AACO,SAASE,mBAAmBA,CACjCC,OAAe,EACfC,OAAsB,EACtBC,SAAwB,EACxBC,MAA2B,EACnB;EACR;EACA,IAAIF,OAAO,CAACG,MAAM,KAAK,CAAC,IAAI,CAACF,SAAS,CAACE,MAAM,EAAE;IAC7C,OAAO,IAAAC,2BAAoB,EAAC,kBAAkBJ,OAAO,CAAC,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC,cAAcH,MAAM,CAACI,IAAI,eAAe,CAAC;EAC9G;EACA,IAAI,CAACN,OAAO,CAACG,MAAM,EAAE;IACnB,OAAO,IAAAI,iBAAU,EACf,OAAON,SAAS,CAACE,MAAM,2BAA2BJ,OAAO,SAASG,MAAM,CAACM,cAAc,6BACzF,CAAC;EACH;EAEA,OAAO,IAAAC,mBAAY,EAAC,CAClB,IAAAL,2BAAoB,EAAC,GAAGJ,OAAO,CAACG,MAAM,2BAA2BD,MAAM,CAACI,IAAI,eAAe,CAAC,EAC5F,IAAAI,oBAAa,EACXR,MAAM,CAACI,IAAI,EACX,EAAE,EACFN,OAAO,CAACW,GAAG,CAAEC,EAAE,IAAK,IAAAC,iBAAU,EAACD,EAAE,CAACP,QAAQ,CAAC,CAAC,CAAC,CAC/C,CAAC,EACD,IAAAK,oBAAa,EACXR,MAAM,CAACY,cAAc,EACrB,+BAA+B,EAC/Bb,SAAS,CAACU,GAAG,CAAEC,EAAE,IAAK,IAAAC,iBAAU,EAACD,EAAE,CAACP,QAAQ,CAAC,CAAC,CAAC,CACjD,CAAC,CACF,CAAC;AACJ","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.1028/dist/deprecation.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.1028/dist/deprecation.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.1030/dist/deprecation.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.1030/dist/deprecation.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -3,6 +3,10 @@ import type { DeprecationMain } from './deprecation.main.runtime';
3
3
  export declare class UndeprecateCmd implements Command {
4
4
  private deprecation;
5
5
  name: string;
6
+ arguments: {
7
+ name: string;
8
+ description: string;
9
+ }[];
6
10
  group: string;
7
11
  description: string;
8
12
  extendedDescription: string;
@@ -11,6 +15,10 @@ export declare class UndeprecateCmd implements Command {
11
15
  loader: boolean;
12
16
  skipWorkspace: boolean;
13
17
  remoteOp: boolean;
18
+ examples: {
19
+ cmd: string;
20
+ description: string;
21
+ }[];
14
22
  constructor(deprecation: DeprecationMain);
15
- report([id]: [string]): Promise<string>;
23
+ report([pattern]: [string]): Promise<string>;
16
24
  }
@@ -4,9 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UndeprecateCmd = void 0;
7
- function _cli() {
8
- const data = require("@teambit/cli");
9
- _cli = function () {
7
+ function _legacy() {
8
+ const data = require("@teambit/legacy.constants");
9
+ _legacy = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _formatPatternResult() {
15
+ const data = require("./format-pattern-result");
16
+ _formatPatternResult = function () {
10
17
  return data;
11
18
  };
12
19
  return data;
@@ -17,22 +24,36 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
17
24
  class UndeprecateCmd {
18
25
  constructor(deprecation) {
19
26
  this.deprecation = deprecation;
20
- _defineProperty(this, "name", 'undeprecate <id>');
27
+ _defineProperty(this, "name", 'undeprecate <component-pattern>');
28
+ _defineProperty(this, "arguments", [{
29
+ name: 'component-pattern',
30
+ description: _legacy().COMPONENT_PATTERN_HELP
31
+ }]);
21
32
  _defineProperty(this, "group", 'collaborate');
22
- _defineProperty(this, "description", 'remove the deprecation status from a component');
23
- _defineProperty(this, "extendedDescription", 'reverses the deprecation of a component, removing warnings and allowing normal use again.');
33
+ _defineProperty(this, "description", 'remove the deprecation status from components');
34
+ _defineProperty(this, "extendedDescription", `reverses the deprecation of components, removing warnings and allowing normal use again.
35
+ the pattern can match multiple components, so several can be undeprecated at once.`);
24
36
  _defineProperty(this, "alias", '');
25
37
  _defineProperty(this, "options", []);
26
38
  _defineProperty(this, "loader", true);
27
39
  _defineProperty(this, "skipWorkspace", true);
28
40
  _defineProperty(this, "remoteOp", true);
41
+ _defineProperty(this, "examples", [{
42
+ // single-quote "$deprecated" so the shell doesn't expand it as an env var
43
+ cmd: "undeprecate '$deprecated'",
44
+ description: 'undeprecate all currently-deprecated components'
45
+ }]);
29
46
  }
30
- async report([id]) {
31
- const result = await this.deprecation.unDeprecateByCLIValues(id);
32
- if (result) {
33
- return (0, _cli().formatSuccessSummary)(`the component "${id}" has been undeprecated successfully`);
34
- }
35
- return (0, _cli().formatHint)(`the component "${id}" is not currently deprecated. no changes have been made`);
47
+ async report([pattern]) {
48
+ const {
49
+ undeprecated,
50
+ notDeprecated
51
+ } = await this.deprecation.unDeprecateByPattern(pattern);
52
+ return (0, _formatPatternResult().formatPatternResult)(pattern, undeprecated, notDeprecated, {
53
+ verb: 'undeprecated',
54
+ unchangedTitle: 'not deprecated',
55
+ unchangedState: 'not currently deprecated'
56
+ });
36
57
  }
37
58
  }
38
59
  exports.UndeprecateCmd = UndeprecateCmd;
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","UndeprecateCmd","constructor","deprecation","report","id","result","unDeprecateByCLIValues","formatSuccessSummary","formatHint","exports"],"sources":["undeprecate-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport { formatSuccessSummary, formatHint } from '@teambit/cli';\nimport type { DeprecationMain } from './deprecation.main.runtime';\n\nexport class UndeprecateCmd implements Command {\n name = 'undeprecate <id>';\n group = 'collaborate';\n description = 'remove the deprecation status from a component';\n extendedDescription = 'reverses the deprecation of a component, removing warnings and allowing normal use again.';\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n skipWorkspace = true;\n remoteOp = true;\n\n constructor(private deprecation: DeprecationMain) {}\n\n async report([id]: [string]): Promise<string> {\n const result = await this.deprecation.unDeprecateByCLIValues(id);\n if (result) {\n return formatSuccessSummary(`the component \"${id}\" has been undeprecated successfully`);\n }\n return formatHint(`the component \"${id}\" is not currently deprecated. no changes have been made`);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgE,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA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toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","UndeprecateCmd","constructor","deprecation","name","description","COMPONENT_PATTERN_HELP","cmd","report","pattern","undeprecated","notDeprecated","unDeprecateByPattern","formatPatternResult","verb","unchangedTitle","unchangedState","exports"],"sources":["undeprecate-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { DeprecationMain } from './deprecation.main.runtime';\nimport { formatPatternResult } from './format-pattern-result';\n\nexport class UndeprecateCmd implements Command {\n name = 'undeprecate <component-pattern>';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n group = 'collaborate';\n description = 'remove the deprecation status from components';\n extendedDescription = `reverses the deprecation of components, removing warnings and allowing normal use again.\nthe pattern can match multiple components, so several can be undeprecated at once.`;\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n skipWorkspace = true;\n remoteOp = true;\n examples = [\n {\n // single-quote \"$deprecated\" so the shell doesn't expand it as an env var\n cmd: \"undeprecate '$deprecated'\",\n description: 'undeprecate all currently-deprecated components',\n },\n ];\n\n constructor(private deprecation: DeprecationMain) {}\n\n async report([pattern]: [string]): Promise<string> {\n const { undeprecated, notDeprecated } = await this.deprecation.unDeprecateByPattern(pattern);\n return formatPatternResult(pattern, undeprecated, notDeprecated, {\n verb: 'undeprecated',\n unchangedTitle: 'not deprecated',\n unchangedState: 'not currently deprecated',\n });\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,qBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,oBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8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ACF;EAEkD;EAEnD,MAAMG,MAAMA,CAAC,CAACC,OAAO,CAAW,EAAmB;IACjD,MAAM;MAAEC,YAAY;MAAEC;IAAc,CAAC,GAAG,MAAM,IAAI,CAACR,WAAW,CAACS,oBAAoB,CAACH,OAAO,CAAC;IAC5F,OAAO,IAAAI,0CAAmB,EAACJ,OAAO,EAAEC,YAAY,EAAEC,aAAa,EAAE;MAC/DG,IAAI,EAAE,cAAc;MACpBC,cAAc,EAAE,gBAAgB;MAChCC,cAAc,EAAE;IAClB,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAhB,cAAA,GAAAA,cAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,32 +1,33 @@
1
1
  {
2
2
  "name": "@teambit/deprecation",
3
- "version": "1.0.1028",
3
+ "version": "1.0.1030",
4
4
  "homepage": "https://bit.cloud/teambit/component/deprecation",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "deprecation",
9
- "version": "1.0.1028"
9
+ "version": "1.0.1030"
10
10
  },
11
11
  "dependencies": {
12
12
  "graphql-tag": "2.12.1",
13
13
  "lodash": "4.17.21",
14
14
  "p-map-series": "2.1.0",
15
15
  "semver": "7.7.1",
16
- "@teambit/cli": "0.0.1341",
16
+ "@teambit/cli": "0.0.1342",
17
+ "@teambit/legacy.constants": "0.0.31",
17
18
  "@teambit/harmony": "0.4.7",
18
19
  "@teambit/bit-error": "0.0.404",
19
20
  "@teambit/component-id": "1.2.4",
20
21
  "@teambit/component-issues": "0.0.174",
21
22
  "@teambit/component.ui.component-deprecated": "0.0.41",
22
- "@teambit/component": "1.0.1028",
23
- "@teambit/graphql": "1.0.1028",
24
- "@teambit/dependency-resolver": "1.0.1028",
25
- "@teambit/issues": "1.0.1028",
26
- "@teambit/scope": "1.0.1028",
27
- "@teambit/workspace": "1.0.1028",
28
- "@teambit/docs": "1.0.1028",
29
- "@teambit/ui": "1.0.1028"
23
+ "@teambit/component": "1.0.1030",
24
+ "@teambit/graphql": "1.0.1030",
25
+ "@teambit/dependency-resolver": "1.0.1030",
26
+ "@teambit/issues": "1.0.1030",
27
+ "@teambit/scope": "1.0.1030",
28
+ "@teambit/workspace": "1.0.1030",
29
+ "@teambit/docs": "1.0.1030",
30
+ "@teambit/ui": "1.0.1030"
30
31
  },
31
32
  "devDependencies": {
32
33
  "@types/lodash": "4.14.165",