@teambit/deprecation 0.0.599 → 0.0.601

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.
@@ -150,18 +150,20 @@ class DeprecationMain {
150
150
 
151
151
 
152
152
  async deprecate(componentId, newId) {
153
- const results = await this.workspace.bitMap.addComponentConfig(_deprecation().DeprecationAspect.id, componentId, {
153
+ const results = this.workspace.bitMap.addComponentConfig(componentId, _deprecation().DeprecationAspect.id, {
154
154
  deprecate: true,
155
155
  newId: newId === null || newId === void 0 ? void 0 : newId.toObject()
156
156
  });
157
+ await this.workspace.bitMap.write();
157
158
  return results;
158
159
  }
159
160
 
160
161
  async unDeprecate(componentId) {
161
- const results = await this.workspace.bitMap.addComponentConfig(_deprecation().DeprecationAspect.id, componentId, {
162
+ const results = this.workspace.bitMap.addComponentConfig(componentId, _deprecation().DeprecationAspect.id, {
162
163
  deprecate: false,
163
164
  newId: ''
164
165
  });
166
+ await this.workspace.bitMap.write();
165
167
  return results;
166
168
  }
167
169
 
@@ -1 +1 @@
1
- {"version":3,"sources":["deprecation.main.runtime.ts"],"names":["DeprecationMain","constructor","scope","workspace","getDeprecationInfo","component","data","config","extensions","findExtension","DeprecationAspect","id","deprecatedBackwardCompatibility","state","_consumer","deprecated","isDeprecate","Boolean","deprecate","newId","ComponentID","fromObject","toString","undefined","componentId","results","bitMap","addComponentConfig","toObject","unDeprecate","provider","graphql","componentAspect","cli","deprecation","register","DeprecateCmd","UndeprecateCmd","registerShowFragments","DeprecationFragment","MainRuntime","GraphqlAspect","ScopeAspect","ComponentAspect","WorkspaceAspect","CLIAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA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CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\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';\n\nexport type DeprecationInfo = {\n isDeprecate: boolean;\n newId?: string;\n};\n\nexport type DeprecationMetadata = {\n deprecate?: boolean;\n newId?: ComponentIdObj;\n};\n\nexport class DeprecationMain {\n constructor(private scope: ScopeMain, private workspace: Workspace) {}\n static runtime = MainRuntime;\n static dependencies = [GraphqlAspect, ScopeAspect, ComponentAspect, WorkspaceAspect, CLIAspect];\n\n async getDeprecationInfo(component: Component): Promise<DeprecationInfo> {\n const data = component.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 newId = data?.newId ? ComponentID.fromObject(data?.newId).toString() : undefined;\n return {\n isDeprecate,\n newId,\n };\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): Promise<boolean> {\n const results = await this.workspace.bitMap.addComponentConfig(DeprecationAspect.id, componentId, {\n deprecate: true,\n newId: newId?.toObject(),\n });\n\n return results;\n }\n\n async unDeprecate(componentId: ComponentID) {\n const results = await this.workspace.bitMap.addComponentConfig(DeprecationAspect.id, componentId, {\n deprecate: false,\n newId: '',\n });\n\n return results;\n }\n\n static async provider([graphql, scope, componentAspect, workspace, cli]: [\n GraphqlMain,\n ScopeMain,\n ComponentMain,\n Workspace,\n CLIMain\n ]) {\n const deprecation = new DeprecationMain(scope, workspace);\n cli.register(new DeprecateCmd(deprecation, workspace), new UndeprecateCmd(deprecation, workspace));\n componentAspect.registerShowFragments([new DeprecationFragment(deprecation)]);\n graphql.register(deprecationSchema(deprecation));\n\n return deprecation;\n }\n}\n\nDeprecationAspect.addRuntime(DeprecationMain);\n"]}
1
+ {"version":3,"sources":["deprecation.main.runtime.ts"],"names":["DeprecationMain","constructor","scope","workspace","getDeprecationInfo","component","data","config","extensions","findExtension","DeprecationAspect","id","deprecatedBackwardCompatibility","state","_consumer","deprecated","isDeprecate","Boolean","deprecate","newId","ComponentID","fromObject","toString","undefined","componentId","results","bitMap","addComponentConfig","toObject","write","unDeprecate","provider","graphql","componentAspect","cli","deprecation","register","DeprecateCmd","UndeprecateCmd","registerShowFragments","DeprecationFragment","MainRuntime","GraphqlAspect","ScopeAspect","ComponentAspect","WorkspaceAspect","CLIAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAYO,MAAMA,eAAN,CAAsB;AAC3BC,EAAAA,WAAW,CAASC,KAAT,EAAmCC,SAAnC,EAAy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O,GAAG,KAAKtB,SAAL,CAAeuB,MAAf,CAAsBC,kBAAtB,CAAyCH,WAAzC,EAAsDd,iCAAkBC,EAAxE,EAA4E;AAC1FO,MAAAA,SAAS,EAAE,KAD+E;AAE1FC,MAAAA,KAAK,EAAE;AAFmF,KAA5E,CAAhB;AAIA,UAAM,KAAKhB,SAAL,CAAeuB,MAAf,CAAsBG,KAAtB,EAAN;AAEA,WAAOJ,OAAP;AACD;;AAEoB,eAARM,QAAQ,CAAC,CAACC,OAAD,EAAU9B,KAAV,EAAiB+B,eAAjB,EAAkC9B,SAAlC,EAA6C+B,GAA7C,CAAD,EAMlB;AACD,UAAMC,WAAW,GAAG,IAAInC,eAAJ,CAAoBE,KAApB,EAA2BC,SAA3B,CAApB;AACA+B,IAAAA,GAAG,CAACE,QAAJ,CAAa,KAAIC,4BAAJ,EAAiBF,WAAjB,EAA8BhC,SAA9B,CAAb,EAAuD,KAAImC,gCAAJ,EAAmBH,WAAnB,EAAgChC,SAAhC,CAAvD;AACA8B,IAAAA,eAAe,CAACM,qBAAhB,CAAsC,CAAC,KAAIC,mCAAJ,EAAwBL,WAAxB,CAAD,CAAtC;AACAH,IAAAA,OAAO,CAACI,QAAR,CAAiB,uCAAkBD,WAAlB,CAAjB;AAEA,WAAOA,WAAP;AACD;;AA3D0B;;;gCAAhBnC,e,aAEMyC,kB;gCAFNzC,e,kBAGW,CAAC0C,wBAAD,EAAgBC,oBAAhB,EAA6BC,4BAA7B,EAA8CC,oBAA9C,EAA+DC,gBAA/D,C;;AA2DxBpC,iCAAkBqC,UAAlB,CAA6B/C,eAA7B","sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\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';\n\nexport type DeprecationInfo = {\n isDeprecate: boolean;\n newId?: string;\n};\n\nexport type DeprecationMetadata = {\n deprecate?: boolean;\n newId?: ComponentIdObj;\n};\n\nexport class DeprecationMain {\n constructor(private scope: ScopeMain, private workspace: Workspace) {}\n static runtime = MainRuntime;\n static dependencies = [GraphqlAspect, ScopeAspect, ComponentAspect, WorkspaceAspect, CLIAspect];\n\n async getDeprecationInfo(component: Component): Promise<DeprecationInfo> {\n const data = component.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 newId = data?.newId ? ComponentID.fromObject(data?.newId).toString() : undefined;\n return {\n isDeprecate,\n newId,\n };\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): Promise<boolean> {\n const results = this.workspace.bitMap.addComponentConfig(componentId, DeprecationAspect.id, {\n deprecate: true,\n newId: newId?.toObject(),\n });\n await this.workspace.bitMap.write();\n\n return results;\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();\n\n return results;\n }\n\n static async provider([graphql, scope, componentAspect, workspace, cli]: [\n GraphqlMain,\n ScopeMain,\n ComponentMain,\n Workspace,\n CLIMain\n ]) {\n const deprecation = new DeprecationMain(scope, workspace);\n cli.register(new DeprecateCmd(deprecation, workspace), new UndeprecateCmd(deprecation, workspace));\n componentAspect.registerShowFragments([new DeprecationFragment(deprecation)]);\n graphql.register(deprecationSchema(deprecation));\n\n return deprecation;\n }\n}\n\nDeprecationAspect.addRuntime(DeprecationMain);"]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/deprecation",
3
- "version": "0.0.599",
3
+ "version": "0.0.601",
4
4
  "homepage": "https://bit.dev/teambit/component/deprecation",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "deprecation",
9
- "version": "0.0.599"
9
+ "version": "0.0.601"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -14,12 +14,12 @@
14
14
  "graphql-tag": "2.12.1",
15
15
  "@babel/runtime": "7.12.18",
16
16
  "core-js": "^3.0.0",
17
- "@teambit/cli": "0.0.411",
18
- "@teambit/workspace": "0.0.599",
19
- "@teambit/component": "0.0.599",
20
- "@teambit/graphql": "0.0.599",
17
+ "@teambit/cli": "0.0.413",
18
+ "@teambit/workspace": "0.0.601",
19
+ "@teambit/component": "0.0.601",
20
+ "@teambit/graphql": "0.0.601",
21
21
  "@teambit/component-id": "0.0.398",
22
- "@teambit/scope": "0.0.599"
22
+ "@teambit/scope": "0.0.601"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/mocha": "5.2.7",
@@ -30,7 +30,7 @@
30
30
  "@types/node": "12.20.4"
31
31
  },
32
32
  "peerDependencies": {
33
- "@teambit/legacy": "1.0.198",
33
+ "@teambit/legacy": "1.0.200",
34
34
  "react-dom": "^16.8.0 || ^17.0.0",
35
35
  "react": "^16.8.0 || ^17.0.0"
36
36
  },
@@ -58,7 +58,7 @@
58
58
  "react": "-"
59
59
  },
60
60
  "peerDependencies": {
61
- "@teambit/legacy": "1.0.198",
61
+ "@teambit/legacy": "1.0.200",
62
62
  "react-dom": "^16.8.0 || ^17.0.0",
63
63
  "react": "^16.8.0 || ^17.0.0"
64
64
  }