@teambit/deprecation 0.0.592 → 0.0.596
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.
|
@@ -169,7 +169,7 @@ class DeprecationMain {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
const componentId = await this.workspace.resolveComponentId(id);
|
|
172
|
-
const results = await this.workspace.
|
|
172
|
+
const results = await this.workspace.bitMap.addComponentConfig(_deprecation().DeprecationAspect.id, componentId, {
|
|
173
173
|
deprecate: true,
|
|
174
174
|
newId
|
|
175
175
|
});
|
|
@@ -186,7 +186,7 @@ class DeprecationMain {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
const componentId = await this.workspace.resolveComponentId(id);
|
|
189
|
-
const results = await this.workspace.
|
|
189
|
+
const results = await this.workspace.bitMap.addComponentConfig(_deprecation().DeprecationAspect.id, componentId, {
|
|
190
190
|
deprecate: false,
|
|
191
191
|
newId: ''
|
|
192
192
|
});
|
|
@@ -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","isLegacy","bitId","consumer","getParsedId","BitIds","componentId","resolveComponentId","results","
|
|
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","isLegacy","bitId","consumer","getParsedId","BitIds","componentId","resolveComponentId","results","bitMap","addComponentConfig","unDeprecate","provider","graphql","componentAspect","cli","deprecation","register","DeprecateCmd","UndeprecateCmd","registerShowFragments","DeprecationFragment","MainRuntime","GraphqlAspect","ScopeAspect","ComponentAspect","WorkspaceAspect","CLIAspect","addRuntime"],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ChGP,MAAAA,SAAS,EAAE,KADqF;AAEhGC,MAAAA,KAAK,EAAE;AAFyF,KAA5E,CAAtB;AAKA,WAAOQ,OAAP;AACD;;AAEoB,eAARI,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,CAAb,EAA4C,KAAIG,gCAAJ,EAAmBH,WAAnB,CAA5C;AACAF,IAAAA,eAAe,CAACM,qBAAhB,CAAsC,CAAC,KAAIC,mCAAJ,EAAwBL,WAAxB,CAAD,CAAtC;AACAH,IAAAA,OAAO,CAACI,QAAR,CAAiB,uCAAkBD,WAAlB,CAAjB;AACD;;AA9D0B;;;gCAAhBnC,e,aAEMyC,kB;gCAFNzC,e,kBAGW,CAAC0C,wBAAD,EAAgBC,oBAAhB,EAA6BC,4BAA7B,EAA8CC,oBAA9C,EAA+DC,gBAA/D,C;;AA8DxBpC,iCAAkBqC,UAAlB,CAA6B/C,eAA7B","sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ComponentMain, ComponentAspect, Component } from '@teambit/component';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { deprecateMany, undeprecateMany } from '@teambit/legacy/dist/scope/component-ops/components-deprecation';\nimport { BitIds } from '@teambit/legacy/dist/bit-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?: string;\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 return {\n isDeprecate,\n newId: data?.newId,\n };\n }\n\n async deprecate(id: string, newId?: string) {\n if (this.workspace.isLegacy) {\n const bitId = this.workspace.consumer.getParsedId(id);\n await deprecateMany(this.workspace.consumer.scope, new BitIds(bitId));\n return {\n deprecate: true,\n };\n }\n const componentId = await this.workspace.resolveComponentId(id);\n const results = await this.workspace.bitMap.addComponentConfig(DeprecationAspect.id, componentId, {\n deprecate: true,\n newId,\n });\n\n return results;\n }\n\n async unDeprecate(id: string) {\n if (this.workspace.isLegacy) {\n const bitId = this.workspace.consumer.getParsedId(id);\n await undeprecateMany(this.workspace.consumer.scope, new BitIds(bitId));\n return {\n deprecate: false,\n };\n }\n const componentId = await this.workspace.resolveComponentId(id);\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), new UndeprecateCmd(deprecation));\n componentAspect.registerShowFragments([new DeprecationFragment(deprecation)]);\n graphql.register(deprecationSchema(deprecation));\n }\n}\n\nDeprecationAspect.addRuntime(DeprecationMain);\n"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/deprecation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.596",
|
|
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.
|
|
9
|
+
"version": "0.0.596"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -14,11 +14,11 @@
|
|
|
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.
|
|
18
|
-
"@teambit/component": "0.0.
|
|
19
|
-
"@teambit/graphql": "0.0.
|
|
20
|
-
"@teambit/scope": "0.0.
|
|
21
|
-
"@teambit/workspace": "0.0.
|
|
17
|
+
"@teambit/cli": "0.0.409",
|
|
18
|
+
"@teambit/component": "0.0.596",
|
|
19
|
+
"@teambit/graphql": "0.0.596",
|
|
20
|
+
"@teambit/scope": "0.0.596",
|
|
21
|
+
"@teambit/workspace": "0.0.596"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/mocha": "5.2.7",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@types/node": "12.20.4"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@teambit/legacy": "1.0.
|
|
32
|
+
"@teambit/legacy": "1.0.196",
|
|
33
33
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
34
34
|
"react": "^16.8.0 || ^17.0.0"
|
|
35
35
|
},
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"react": "-"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@teambit/legacy": "1.0.
|
|
60
|
+
"@teambit/legacy": "1.0.196",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
62
62
|
"react": "^16.8.0 || ^17.0.0"
|
|
63
63
|
}
|
|
Binary file
|