@teambit/deprecation 1.0.667 → 1.0.669

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import { UIRuntime } from '@teambit/ui';
3
- import { ComponentModel } from '@teambit/component';
4
- import { DocsAspect, DocsUI } from '@teambit/docs';
3
+ import type { ComponentModel } from '@teambit/component';
4
+ import type { DocsUI } from '@teambit/docs';
5
+ import { DocsAspect } from '@teambit/docs';
5
6
  import { ComponentDeprecated } from '@teambit/component.ui.component-deprecated';
6
7
  import { DeprecationAspect } from './deprecation.aspect';
7
8
 
@@ -1,5 +1,5 @@
1
- import { Command, CommandOptions } from '@teambit/cli';
2
- import { DeprecationMain } from './deprecation.main.runtime';
1
+ import type { Command, CommandOptions } from '@teambit/cli';
2
+ import type { DeprecationMain } from './deprecation.main.runtime';
3
3
  export declare class DeprecateCmd implements Command {
4
4
  private deprecation;
5
5
  name: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","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","chalk","green","bold","deprecateByCLIValues","exports"],"sources":["deprecate-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { 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 = 'deprecate a component';\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 return chalk.green(`the component \"${id}\" has been deprecated successfully`);\n }\n return chalk.bold(`the component \"${id}\" is already deprecated. no changes have been made`);\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":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,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":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","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","chalk","green","bold","deprecateByCLIValues","exports"],"sources":["deprecate-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { Command, CommandOptions } 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 = 'deprecate a component';\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 return chalk.green(`the component \"${id}\" has been deprecated successfully`);\n }\n return chalk.bold(`the component \"${id}\" is already deprecated. no changes have been made`);\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":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,S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0C;EAED;EAEnD,MAAMuB,MAAMA,CAAC,CAACC,EAAE,CAAW,EAAE;IAAEC,KAAK;IAAEC;EAA0C,CAAC,EAAmB;IAClG,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACC,SAAS,CAACJ,EAAE,EAAEC,KAAK,EAAEC,KAAK,CAAC;IACrD,IAAIC,MAAM,EAAE;MACV,OAAOE,gBAAK,CAACC,KAAK,CAAC,kBAAkBN,EAAE,oCAAoC,CAAC;IAC9E;IACA,OAAOK,gBAAK,CAACE,IAAI,CAAC,kBAAkBP,EAAE,oDAAoD,CAAC;EAC7F;EAEA,MAAcI,SAASA,CAACJ,EAAU,EAAEC,KAAc,EAAEC,KAAc,EAAoB;IACpF,OAAO,IAAI,CAACN,WAAW,CAACY,oBAAoB,CAACR,EAAE,EAAEC,KAAK,EAAEC,KAAK,CAAC;EAChE;AACF;AAACO,OAAA,CAAAf,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { Component, ShowFragment } from '@teambit/component';
2
- import { DeprecationMain } from './deprecation.main.runtime';
1
+ import type { Component, ShowFragment } from '@teambit/component';
2
+ import type { DeprecationMain } from './deprecation.main.runtime';
3
3
  export declare class DeprecationFragment implements ShowFragment {
4
4
  private deprecation;
5
5
  constructor(deprecation: DeprecationMain);
@@ -1 +1 @@
1
- {"version":3,"names":["DeprecationFragment","constructor","deprecation","_defineProperty","renderRow","component","deprecationInfo","getDeprecationInfo","isDeprecate","toString","newId","range","title","content","json","exports"],"sources":["deprecation.fragment.ts"],"sourcesContent":["import { Component, ShowFragment } from '@teambit/component';\nimport { DeprecationMain } from './deprecation.main.runtime';\n\nexport class DeprecationFragment implements ShowFragment {\n constructor(private deprecation: DeprecationMain) {}\n\n title = 'deprecated';\n\n async renderRow(component: Component) {\n const deprecationInfo = await this.deprecation.getDeprecationInfo(component);\n const isDeprecate = deprecationInfo.isDeprecate.toString();\n const newId = deprecationInfo.newId ? ` (new-id: ${deprecationInfo.newId})` : '';\n const range = deprecationInfo.range ? ` (range: ${deprecationInfo.range})` : '';\n return {\n title: this.title,\n content: isDeprecate + newId + range,\n };\n }\n\n async json(component: Component) {\n return {\n title: this.title,\n json: await this.deprecation.getDeprecationInfo(component),\n };\n }\n\n weight = 3;\n}\n"],"mappings":";;;;;;;;;AAGO,MAAMA,mBAAmB,CAAyB;EACvDC,WAAWA,CAASC,WAA4B,EAAE;IAAA,KAA9BA,WAA4B,GAA5BA,WAA4B;IAAAC,eAAA,gBAExC,YAAY;IAAAA,eAAA,iBAoBX,CAAC;EAtByC;EAInD,MAAMC,SAASA,CAACC,SAAoB,EAAE;IACpC,MAAMC,eAAe,GAAG,MAAM,IAAI,CAACJ,WAAW,CAACK,kBAAkB,CAACF,SAAS,CAAC;IAC5E,MAAMG,WAAW,GAAGF,eAAe,CAACE,WAAW,CAACC,QAAQ,CAAC,CAAC;IAC1D,MAAMC,KAAK,GAAGJ,eAAe,CAACI,KAAK,GAAG,aAAaJ,eAAe,CAACI,KAAK,GAAG,GAAG,EAAE;IAChF,MAAMC,KAAK,GAAGL,eAAe,CAACK,KAAK,GAAG,YAAYL,eAAe,CAACK,KAAK,GAAG,GAAG,EAAE;IAC/E,OAAO;MACLC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,OAAO,EAAEL,WAAW,GAAGE,KAAK,GAAGC;IACjC,CAAC;EACH;EAEA,MAAMG,IAAIA,CAACT,SAAoB,EAAE;IAC/B,OAAO;MACLO,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBE,IAAI,EAAE,MAAM,IAAI,CAACZ,WAAW,CAACK,kBAAkB,CAACF,SAAS;IAC3D,CAAC;EACH;AAGF;AAACU,OAAA,CAAAf,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"names":["DeprecationFragment","constructor","deprecation","_defineProperty","renderRow","component","deprecationInfo","getDeprecationInfo","isDeprecate","toString","newId","range","title","content","json","exports"],"sources":["deprecation.fragment.ts"],"sourcesContent":["import type { Component, ShowFragment } from '@teambit/component';\nimport type { DeprecationMain } from './deprecation.main.runtime';\n\nexport class DeprecationFragment implements ShowFragment {\n constructor(private deprecation: DeprecationMain) {}\n\n title = 'deprecated';\n\n async renderRow(component: Component) {\n const deprecationInfo = await this.deprecation.getDeprecationInfo(component);\n const isDeprecate = deprecationInfo.isDeprecate.toString();\n const newId = deprecationInfo.newId ? ` (new-id: ${deprecationInfo.newId})` : '';\n const range = deprecationInfo.range ? ` (range: ${deprecationInfo.range})` : '';\n return {\n title: this.title,\n content: isDeprecate + newId + range,\n };\n }\n\n async json(component: Component) {\n return {\n title: this.title,\n json: await this.deprecation.getDeprecationInfo(component),\n };\n }\n\n weight = 3;\n}\n"],"mappings":";;;;;;;;;AAGO,MAAMA,mBAAmB,CAAyB;EACvDC,WAAWA,CAASC,WAA4B,EAAE;IAAA,KAA9BA,WAA4B,GAA5BA,WAA4B;IAAAC,eAAA,gBAExC,YAAY;IAAAA,eAAA,iBAoBX,CAAC;EAtByC;EAInD,MAAMC,SAASA,CAACC,SAAoB,EAAE;IACpC,MAAMC,eAAe,GAAG,MAAM,IAAI,CAACJ,WAAW,CAACK,kBAAkB,CAACF,SAAS,CAAC;IAC5E,MAAMG,WAAW,GAAGF,eAAe,CAACE,WAAW,CAACC,QAAQ,CAAC,CAAC;IAC1D,MAAMC,KAAK,GAAGJ,eAAe,CAACI,KAAK,GAAG,aAAaJ,eAAe,CAACI,KAAK,GAAG,GAAG,EAAE;IAChF,MAAMC,KAAK,GAAGL,eAAe,CAACK,KAAK,GAAG,YAAYL,eAAe,CAACK,KAAK,GAAG,GAAG,EAAE;IAC/E,OAAO;MACLC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,OAAO,EAAEL,WAAW,GAAGE,KAAK,GAAGC;IACjC,CAAC;EACH;EAEA,MAAMG,IAAIA,CAACT,SAAoB,EAAE;IAC/B,OAAO;MACLO,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBE,IAAI,EAAE,MAAM,IAAI,CAACZ,WAAW,CAACK,kBAAkB,CAACF,SAAS;IAC3D,CAAC;EACH;AAGF;AAACU,OAAA,CAAAf,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import { Schema } from '@teambit/graphql';
2
- import { DeprecationMain } from './deprecation.main.runtime';
1
+ import type { Schema } from '@teambit/graphql';
2
+ import type { DeprecationMain } from './deprecation.main.runtime';
3
3
  export declare function deprecationSchema(deprecation: DeprecationMain): Schema;
@@ -1 +1 @@
1
- {"version":3,"names":["_graphqlTag","data","require","deprecationSchema","deprecation","typeDefs","gql","resolvers","Component","component","getDeprecationInfo"],"sources":["deprecation.graphql.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { Schema } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\n\nimport { DeprecationMain } from './deprecation.main.runtime';\n\nexport function deprecationSchema(deprecation: DeprecationMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n deprecation: DeprecationInfo\n }\n\n type DeprecationInfo {\n isDeprecate: Boolean\n newId: String\n }\n\n type DeprecationResult {\n bitIds: [String]\n missingComponents: [String]\n }\n\n type Mutation {\n # deprecate components\n deprecate(bitIds: [String!]!): DeprecationResult\n\n # undo deprecate to components\n undeprecate(bitIds: [String!]!): DeprecationResult\n }\n `,\n resolvers: {\n // Mutation: {\n // deprecate: (req: any, { bitIds }: { bitIds: string[] }, context: { verb: string }) => {\n // if (context.verb !== 'write') throw new Error('You are not authorized');\n // return deprecation.deprecate(bitIds);\n // },\n\n // undeprecate: (req: any, { bitIds }: { bitIds: string[] }, context: { verb: string }) => {\n // if (context.verb !== 'write') throw new Error('You are not authorized');\n // return deprecation.unDeprecate(bitIds);\n // },\n // },\n Component: {\n deprecation: (component: Component) => {\n return deprecation.getDeprecationInfo(component);\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,SAASE,iBAAiBA,CAACC,WAA4B,EAAU;EACtE,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACDC,SAAS,EAAE;MACT;MACA;MACA;MACA;MACA;;MAEA;MACA;MACA;MACA;MACA;MACAC,SAAS,EAAE;QACTJ,WAAW,EAAGK,SAAoB,IAAK;UACrC,OAAOL,WAAW,CAACM,kBAAkB,CAACD,SAAS,CAAC;QAClD;MACF;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_graphqlTag","data","require","deprecationSchema","deprecation","typeDefs","gql","resolvers","Component","component","getDeprecationInfo"],"sources":["deprecation.graphql.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\nimport type { Schema } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\n\nimport type { DeprecationMain } from './deprecation.main.runtime';\n\nexport function deprecationSchema(deprecation: DeprecationMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n deprecation: DeprecationInfo\n }\n\n type DeprecationInfo {\n isDeprecate: Boolean\n newId: String\n }\n\n type DeprecationResult {\n bitIds: [String]\n missingComponents: [String]\n }\n\n type Mutation {\n # deprecate components\n deprecate(bitIds: [String!]!): DeprecationResult\n\n # undo deprecate to components\n undeprecate(bitIds: [String!]!): DeprecationResult\n }\n `,\n resolvers: {\n // Mutation: {\n // deprecate: (req: any, { bitIds }: { bitIds: string[] }, context: { verb: string }) => {\n // if (context.verb !== 'write') throw new Error('You are not authorized');\n // return deprecation.deprecate(bitIds);\n // },\n\n // undeprecate: (req: any, { bitIds }: { bitIds: string[] }, context: { verb: string }) => {\n // if (context.verb !== 'write') throw new Error('You are not authorized');\n // return deprecation.unDeprecate(bitIds);\n // },\n // },\n Component: {\n deprecation: (component: Component) => {\n return deprecation.getDeprecationInfo(component);\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,SAASE,iBAAiBA,CAACC,WAA4B,EAAU;EACtE,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACDC,SAAS,EAAE;MACT;MACA;MACA;MACA;MACA;;MAEA;MACA;MACA;MACA;MACA;MACAC,SAAS,EAAE;QACTJ,WAAW,EAAGK,SAAoB,IAAK;UACrC,OAAOL,WAAW,CAACM,kBAAkB,CAACD,SAAS,CAAC;QAClD;MACF;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -1,11 +1,12 @@
1
- import { CLIMain } from '@teambit/cli';
2
- import { ComponentMain, Component, ComponentID } from '@teambit/component';
3
- import { ScopeMain } from '@teambit/scope';
4
- import { Workspace } from '@teambit/workspace';
5
- import { GraphqlMain } from '@teambit/graphql';
6
- import { ComponentIdObj } from '@teambit/component-id';
7
- import { IssuesMain } from '@teambit/issues';
8
- import { DependencyResolverMain } from '@teambit/dependency-resolver';
1
+ import type { CLIMain } from '@teambit/cli';
2
+ import type { ComponentMain, Component } from '@teambit/component';
3
+ import { ComponentID } from '@teambit/component';
4
+ import type { ScopeMain } from '@teambit/scope';
5
+ import type { Workspace } from '@teambit/workspace';
6
+ import type { GraphqlMain } from '@teambit/graphql';
7
+ import type { ComponentIdObj } from '@teambit/component-id';
8
+ import type { IssuesMain } from '@teambit/issues';
9
+ import type { DependencyResolverMain } from '@teambit/dependency-resolver';
9
10
  export type DeprecationInfo = {
10
11
  isDeprecate: boolean;
11
12
  newId?: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_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","bitMap","addComponentConfig","toObject","write","deprecateByCLIValues","resolveComponentId","newComponentId","unDeprecateByCLIValues","unDeprecate","addDeprecatedDependenciesIssues","components","pMapSeries","addDeprecatedDepIssue","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 { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport { ComponentMain, ComponentAspect, Component, ComponentID } from '@teambit/component';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { 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 { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport { DependencyResolverAspect, DependencyResolverMain } 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 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 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 /**\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":";;;;;;AAAA,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,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAA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CAAC,CAACC,OAAO,EAAE/E,KAAK,EAAEgF,eAAe,EAAE/E,SAAS,EAAEgF,GAAG,EAAE/E,YAAY,EAAE+D,MAAM,CAQ3F,EAAE;IACD,MAAMiB,WAAW,GAAG,IAAIpF,eAAe,CAACE,KAAK,EAAEC,SAAS,EAAEC,YAAY,CAAC;IACvE+D,MAAM,CAACkB,2BAA2B,CAACD,WAAW,CAACjC,+BAA+B,CAACmC,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,CAAA7F,eAAA,GAAAA,eAAA;AAAAlB,eAAA,CAlJYkB,eAAe,aAuHT8F,kBAAW;AAAAhH,eAAA,CAvHjBkB,eAAe,kBAwHJ,CACpB+F,wBAAa,EACbC,oBAAW,EACXC,4BAAe,EACfC,4BAAe,EACfC,gBAAS,EACTC,8CAAwB,EACxBC,sBAAY,CACb;AAoBHzF,gCAAiB,CAAC0F,UAAU,CAACtG,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_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","bitMap","addComponentConfig","toObject","write","deprecateByCLIValues","resolveComponentId","newComponentId","unDeprecateByCLIValues","unDeprecate","addDeprecatedDependenciesIssues","components","pMapSeries","addDeprecatedDepIssue","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 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 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 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 /**\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;AAEA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAA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AEC,SAAS,EAAEC,YAAY,CAAC;IACvE+D,MAAM,CAACkB,2BAA2B,CAACD,WAAW,CAACjC,+BAA+B,CAACmC,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,CAAA7F,eAAA,GAAAA,eAAA;AAAAlB,eAAA,CAlJYkB,eAAe,aAuHT8F,kBAAW;AAAAhH,eAAA,CAvHjBkB,eAAe,kBAwHJ,CACpB+F,wBAAa,EACbC,oBAAW,EACXC,4BAAe,EACfC,4BAAe,EACfC,gBAAS,EACTC,8CAAwB,EACxBC,sBAAY,CACb;AAoBHzF,gCAAiB,CAAC0F,UAAU,CAACtG,eAAe,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { DocsUI } from '@teambit/docs';
1
+ import type { DocsUI } from '@teambit/docs';
2
2
  export declare class DeprecationUIRuntime {
3
3
  static dependencies: import("@teambit/harmony").Aspect[];
4
4
  static runtime: import("@teambit/harmony").RuntimeDefinition;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","data","_interopRequireDefault","require","_ui","_docs","_componentUi","_deprecation","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeprecationUIRuntime","provider","docsUI","registerTitleBadge","component","Badge","legacyComponentModel","createElement","ComponentDeprecated","deprecation","weight","exports","DocsAspect","UIRuntime","DeprecationAspect","addRuntime"],"sources":["deprecation.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { UIRuntime } from '@teambit/ui';\nimport { ComponentModel } from '@teambit/component';\nimport { DocsAspect, DocsUI } from '@teambit/docs';\nimport { ComponentDeprecated } from '@teambit/component.ui.component-deprecated';\nimport { DeprecationAspect } from './deprecation.aspect';\n\nexport class DeprecationUIRuntime {\n static dependencies = [DocsAspect];\n\n static runtime = UIRuntime;\n\n static async provider([docsUI]: [DocsUI]) {\n docsUI.registerTitleBadge({\n component: function Badge({ legacyComponentModel }: { legacyComponentModel: ComponentModel }) {\n return <ComponentDeprecated deprecation={legacyComponentModel.deprecation} />;\n },\n weight: 40,\n });\n }\n}\n\nDeprecationAspect.addRuntime(DeprecationUIRuntime);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,IAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyD,SAAAC,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH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oBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","data","_interopRequireDefault","require","_ui","_docs","_componentUi","_deprecation","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeprecationUIRuntime","provider","docsUI","registerTitleBadge","component","Badge","legacyComponentModel","createElement","ComponentDeprecated","deprecation","weight","exports","DocsAspect","UIRuntime","DeprecationAspect","addRuntime"],"sources":["deprecation.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { UIRuntime } from '@teambit/ui';\nimport type { ComponentModel } from '@teambit/component';\nimport type { DocsUI } from '@teambit/docs';\nimport { DocsAspect } from '@teambit/docs';\nimport { ComponentDeprecated } from '@teambit/component.ui.component-deprecated';\nimport { DeprecationAspect } from './deprecation.aspect';\n\nexport class DeprecationUIRuntime {\n static dependencies = [DocsAspect];\n\n static runtime = UIRuntime;\n\n static async provider([docsUI]: [DocsUI]) {\n docsUI.registerTitleBadge({\n component: function Badge({ legacyComponentModel }: { legacyComponentModel: ComponentModel }) {\n return <ComponentDeprecated deprecation={legacyComponentModel.deprecation} />;\n },\n weight: 40,\n });\n }\n}\n\nDeprecationAspect.addRuntime(DeprecationUIRuntime);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,IAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EA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F,oBAAOnC,MAAA,GAAAU,OAAA,CAAA0B,aAAA,CAAC9B,YAAA,GAAA+B,mBAAmB;UAACC,WAAW,EAAEH,oBAAoB,CAACG;QAAY,CAAE,CAAC;MAC/E,CAAC;MACDC,MAAM,EAAE;IACV,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAX,oBAAA,GAAAA,oBAAA;AAAAlB,eAAA,CAbYkB,oBAAoB,kBACT,CAACY,kBAAU,CAAC;AAAA9B,eAAA,CADvBkB,oBAAoB,aAGda,eAAS;AAY5BC,gCAAiB,CAACC,UAAU,CAACf,oBAAoB,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.667/dist/deprecation.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.667/dist/deprecation.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.669/dist/deprecation.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_deprecation@1.0.669/dist/deprecation.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -1,5 +1,5 @@
1
- import { Command, CommandOptions } from '@teambit/cli';
2
- import { DeprecationMain } from './deprecation.main.runtime';
1
+ import type { Command, CommandOptions } from '@teambit/cli';
2
+ import type { DeprecationMain } from './deprecation.main.runtime';
3
3
  export declare class UndeprecateCmd implements Command {
4
4
  private deprecation;
5
5
  name: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","UndeprecateCmd","constructor","deprecation","report","id","result","unDeprecateByCLIValues","chalk","green","bold","exports"],"sources":["undeprecate-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { DeprecationMain } from './deprecation.main.runtime';\n\nexport class UndeprecateCmd implements Command {\n name = 'undeprecate <id>';\n group = 'collaborate';\n description = 'undeprecate a deprecated component (local/remote)';\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 chalk.green(`the component \"${id}\" has been undeprecated successfully`);\n }\n return chalk.bold(`the component \"${id}\" is not currently deprecated. no changes have been made`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAInB,MAAMgB,cAAc,CAAoB;EAU7CC,WAAWA,CAASC,WAA4B,EAAE;IAAA,KAA9BA,WAA4B,GAA5BA,WAA4B;IAAApB,eAAA,eATzC,kBAAkB;IAAAA,eAAA,gBACjB,aAAa;IAAAA,eAAA,sBACP,mDAAmD;IAAAA,eAAA,gBACzD,EAAE;IAAAA,eAAA,kBACA,EAAE;IAAAA,eAAA,iBACH,IAAI;IAAAA,eAAA,wBACG,IAAI;IAAAA,eAAA,mBACT,IAAI;EAEoC;EAEnD,MAAMqB,MAAMA,CAAC,CAACC,EAAE,CAAW,EAAmB;IAC5C,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACH,WAAW,CAACI,sBAAsB,CAACF,EAAE,CAAC;IAChE,IAAIC,MAAM,EAAE;MACV,OAAOE,gBAAK,CAACC,KAAK,CAAC,kBAAkBJ,EAAE,sCAAsC,CAAC;IAChF;IACA,OAAOG,gBAAK,CAACE,IAAI,CAAC,kBAAkBL,EAAE,0DAA0D,CAAC;EACnG;AACF;AAACM,OAAA,CAAAV,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","UndeprecateCmd","constructor","deprecation","report","id","result","unDeprecateByCLIValues","chalk","green","bold","exports"],"sources":["undeprecate-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { Command, CommandOptions } 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 = 'undeprecate a deprecated component (local/remote)';\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 chalk.green(`the component \"${id}\" has been undeprecated successfully`);\n }\n return chalk.bold(`the component \"${id}\" is not currently deprecated. no changes have been made`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAInB,MAAMgB,cAAc,CAAoB;EAU7CC,WAAWA,CAASC,WAA4B,EAAE;IAAA,KAA9BA,WAA4B,GAA5BA,WAA4B;IAAApB,eAAA,eATzC,kBAAkB;IAAAA,eAAA,gBACjB,aAAa;IAAAA,eAAA,sBACP,mDAAmD;IAAAA,eAAA,gBACzD,EAAE;IAAAA,eAAA,kBACA,EAAE;IAAAA,eAAA,iBACH,IAAI;IAAAA,eAAA,wBACG,IAAI;IAAAA,eAAA,mBACT,IAAI;EAEoC;EAEnD,MAAMqB,MAAMA,CAAC,CAACC,EAAE,CAAW,EAAmB;IAC5C,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACH,WAAW,CAACI,sBAAsB,CAACF,EAAE,CAAC;IAChE,IAAIC,MAAM,EAAE;MACV,OAAOE,gBAAK,CAACC,KAAK,CAAC,kBAAkBJ,EAAE,sCAAsC,CAAC;IAChF;IACA,OAAOG,gBAAK,CAACE,IAAI,CAAC,kBAAkBL,EAAE,0DAA0D,CAAC;EACnG;AACF;AAACM,OAAA,CAAAV,cAAA,GAAAA,cAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/deprecation",
3
- "version": "1.0.667",
3
+ "version": "1.0.669",
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.667"
9
+ "version": "1.0.669"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -18,15 +18,15 @@
18
18
  "@teambit/component-id": "1.2.4",
19
19
  "@teambit/component-issues": "0.0.160",
20
20
  "@teambit/component.ui.component-deprecated": "0.0.41",
21
- "@teambit/cli": "0.0.1244",
22
- "@teambit/component": "1.0.667",
23
- "@teambit/graphql": "1.0.667",
24
- "@teambit/dependency-resolver": "1.0.667",
25
- "@teambit/issues": "1.0.667",
26
- "@teambit/scope": "1.0.667",
27
- "@teambit/workspace": "1.0.667",
28
- "@teambit/docs": "1.0.667",
29
- "@teambit/ui": "1.0.667"
21
+ "@teambit/cli": "0.0.1246",
22
+ "@teambit/component": "1.0.669",
23
+ "@teambit/graphql": "1.0.669",
24
+ "@teambit/dependency-resolver": "1.0.669",
25
+ "@teambit/issues": "1.0.669",
26
+ "@teambit/scope": "1.0.669",
27
+ "@teambit/workspace": "1.0.669",
28
+ "@teambit/docs": "1.0.669",
29
+ "@teambit/ui": "1.0.669"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/lodash": "4.14.165",