@teambit/deprecation 0.0.597 → 0.0.603
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/deprecation.fragment.d.ts +1 -1
- package/dist/deprecation.fragment.js +1 -1
- package/dist/deprecation.fragment.js.map +1 -1
- package/dist/deprecation.main.runtime.js +4 -2
- package/dist/deprecation.main.runtime.js.map +1 -1
- package/package-tar/teambit-deprecation-0.0.603.tgz +0 -0
- package/package.json +9 -9
- package/package-tar/teambit-deprecation-0.0.597.tgz +0 -0
|
@@ -10,7 +10,7 @@ export declare class DeprecationFragment implements ShowFragment {
|
|
|
10
10
|
}>;
|
|
11
11
|
json(component: Component): Promise<{
|
|
12
12
|
title: string;
|
|
13
|
-
json:
|
|
13
|
+
json: import("./deprecation.main.runtime").DeprecationInfo;
|
|
14
14
|
}>;
|
|
15
15
|
weight: number;
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["deprecation.fragment.ts"],"names":["DeprecationFragment","constructor","deprecation","renderRow","component","deprecationInfo","getDeprecationInfo","isDeprecate","toString","newId","title","content","json"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,mBAAN,CAAkD;AACvDC,EAAAA,WAAW,CAASC,WAAT,EAAuC;AAAA,SAA9BA,WAA8B,GAA9BA,WAA8B;AAAA,mDAE1C,YAF0C;AAAA,oDAqBzC,CArByC;AAAE;;AAIrC,QAATC,SAAS,CAACC,SAAD,EAAuB;AACpC,UAAMC,eAAe,GAAG,MAAM,KAAKH,WAAL,CAAiBI,kBAAjB,CAAoCF,SAApC,CAA9B;AACA,UAAMG,WAAW,GAAGF,eAAe,CAACE,WAAhB,CAA4BC,QAA5B,EAApB;AACA,UAAMC,KAAK,GAAGJ,eAAe,CAACI,KAAhB,GAAyB,aAAYJ,eAAe,CAACI,KAAM,GAA3D,GAAgE,EAA9E;AACA,WAAO;AACLC,MAAAA,KAAK,EAAE,KAAKA,KADP;AAELC,MAAAA,OAAO,EAAEJ,WAAW,GAAGE;AAFlB,KAAP;AAID;;AAES,QAAJG,IAAI,CAACR,SAAD,EAAuB;AAC/B,WAAO;AACLM,MAAAA,KAAK,EAAE,KAAKA,KADP;AAELE,MAAAA,IAAI,EAAE,KAAKV,WAAL,CAAiBI,kBAAjB,CAAoCF,SAApC;
|
|
1
|
+
{"version":3,"sources":["deprecation.fragment.ts"],"names":["DeprecationFragment","constructor","deprecation","renderRow","component","deprecationInfo","getDeprecationInfo","isDeprecate","toString","newId","title","content","json"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,mBAAN,CAAkD;AACvDC,EAAAA,WAAW,CAASC,WAAT,EAAuC;AAAA,SAA9BA,WAA8B,GAA9BA,WAA8B;AAAA,mDAE1C,YAF0C;AAAA,oDAqBzC,CArByC;AAAE;;AAIrC,QAATC,SAAS,CAACC,SAAD,EAAuB;AACpC,UAAMC,eAAe,GAAG,MAAM,KAAKH,WAAL,CAAiBI,kBAAjB,CAAoCF,SAApC,CAA9B;AACA,UAAMG,WAAW,GAAGF,eAAe,CAACE,WAAhB,CAA4BC,QAA5B,EAApB;AACA,UAAMC,KAAK,GAAGJ,eAAe,CAACI,KAAhB,GAAyB,aAAYJ,eAAe,CAACI,KAAM,GAA3D,GAAgE,EAA9E;AACA,WAAO;AACLC,MAAAA,KAAK,EAAE,KAAKA,KADP;AAELC,MAAAA,OAAO,EAAEJ,WAAW,GAAGE;AAFlB,KAAP;AAID;;AAES,QAAJG,IAAI,CAACR,SAAD,EAAuB;AAC/B,WAAO;AACLM,MAAAA,KAAK,EAAE,KAAKA,KADP;AAELE,MAAAA,IAAI,EAAE,MAAM,KAAKV,WAAL,CAAiBI,kBAAjB,CAAoCF,SAApC;AAFP,KAAP;AAID;;AApBsD","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 return {\n title: this.title,\n content: isDeprecate + newId,\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"]}
|
|
@@ -150,18 +150,20 @@ class DeprecationMain {
|
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
async deprecate(componentId, newId) {
|
|
153
|
-
const results =
|
|
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 =
|
|
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","Workspa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AoCG,QAApC,EAAd,GAA+DC,SAA7E;AACA,WAAO;AACLP,MAAAA,WADK;AAELG,MAAAA;AAFK,KAAP;AAID;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;;AACiB,QAATD,SAAS,CAACM,WAAD,EAA2BL,KAA3B,EAAkE;AAC/E,UAAMM,OAAO,GAAG,
|
|
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,EAAyD;AAAA,SAAhDD,KAAgD,GAAhDA,KAAgD;AAAA,SAAtBC,SAAsB,GAAtBA,SAAsB;AAAE;;AA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,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);\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.603",
|
|
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.603"
|
|
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.
|
|
18
|
-
"@teambit/workspace": "0.0.
|
|
19
|
-
"@teambit/component": "0.0.
|
|
20
|
-
"@teambit/graphql": "0.0.
|
|
17
|
+
"@teambit/cli": "0.0.415",
|
|
18
|
+
"@teambit/workspace": "0.0.603",
|
|
19
|
+
"@teambit/component": "0.0.603",
|
|
20
|
+
"@teambit/graphql": "0.0.603",
|
|
21
21
|
"@teambit/component-id": "0.0.398",
|
|
22
|
-
"@teambit/scope": "0.0.
|
|
22
|
+
"@teambit/scope": "0.0.603"
|
|
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.
|
|
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.
|
|
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
|
}
|
|
Binary file
|