@teambit/deprecation 0.0.555 → 0.0.559
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/package.json +23 -8
- package/tsconfig.json +1 -1
- package/deprecation.aspect.ts +0 -7
- package/deprecation.fragment.ts +0 -24
- package/deprecation.graphql.ts +0 -50
- package/deprecation.main.runtime.ts +0 -46
- package/index.ts +0 -3
- package/package-tar/teambit-deprecation-0.0.555.tgz +0 -0
- package/types/asset.d.ts +0 -29
- package/types/style.d.ts +0 -42
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/deprecation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.559",
|
|
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.559"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
13
13
|
"graphql-tag": "2.12.1",
|
|
14
14
|
"@babel/runtime": "7.12.18",
|
|
15
15
|
"core-js": "^3.0.0",
|
|
16
|
-
"@teambit/component": "0.0.
|
|
17
|
-
"@teambit/graphql": "0.0.
|
|
18
|
-
"@teambit/cli": "0.0.
|
|
19
|
-
"@teambit/scope": "0.0.
|
|
16
|
+
"@teambit/component": "0.0.559",
|
|
17
|
+
"@teambit/graphql": "0.0.559",
|
|
18
|
+
"@teambit/cli": "0.0.389",
|
|
19
|
+
"@teambit/scope": "0.0.559"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/mocha": "5.2.7",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@types/node": "12.20.4"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@teambit/legacy": "1.0.
|
|
30
|
+
"@teambit/legacy": "1.0.175",
|
|
31
31
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
32
32
|
"react": "^16.8.0 || ^17.0.0"
|
|
33
33
|
},
|
|
@@ -55,12 +55,27 @@
|
|
|
55
55
|
"react": "-"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@teambit/legacy": "1.0.
|
|
58
|
+
"@teambit/legacy": "1.0.175",
|
|
59
59
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0"
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
+
"files": [
|
|
65
|
+
"dist",
|
|
66
|
+
"!dist/tsconfig.tsbuildinfo",
|
|
67
|
+
"**/*.md",
|
|
68
|
+
"**/*.mdx",
|
|
69
|
+
"**/*.js",
|
|
70
|
+
"**/*.json",
|
|
71
|
+
"**/*.sass",
|
|
72
|
+
"**/*.scss",
|
|
73
|
+
"**/*.less",
|
|
74
|
+
"**/*.css",
|
|
75
|
+
"**/*.css",
|
|
76
|
+
"**/*.jpeg",
|
|
77
|
+
"**/*.gif"
|
|
78
|
+
],
|
|
64
79
|
"private": false,
|
|
65
80
|
"engines": {
|
|
66
81
|
"node": ">=12.22.0"
|
package/tsconfig.json
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"skipLibCheck": true,
|
|
16
16
|
"moduleResolution": "node",
|
|
17
17
|
"esModuleInterop": true,
|
|
18
|
-
"outDir": "dist",
|
|
19
18
|
"composite": true,
|
|
20
19
|
"emitDeclarationOnly": true,
|
|
20
|
+
"outDir": "dist",
|
|
21
21
|
"experimentalDecorators": true,
|
|
22
22
|
"emitDecoratorMetadata": true,
|
|
23
23
|
"allowSyntheticDefaultImports": true,
|
package/deprecation.aspect.ts
DELETED
package/deprecation.fragment.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Component, ShowFragment } from '@teambit/component';
|
|
2
|
-
import { DeprecationMain } from './deprecation.main.runtime';
|
|
3
|
-
|
|
4
|
-
export class DeprecationFragment implements ShowFragment {
|
|
5
|
-
constructor(private deprecation: DeprecationMain) {}
|
|
6
|
-
|
|
7
|
-
title = 'deprecated';
|
|
8
|
-
|
|
9
|
-
async renderRow(component: Component) {
|
|
10
|
-
return {
|
|
11
|
-
title: this.title,
|
|
12
|
-
content: this.deprecation.getDeprecationInfo(component).isDeprecate.toString(),
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async json(component: Component) {
|
|
17
|
-
return {
|
|
18
|
-
title: this.title,
|
|
19
|
-
json: this.deprecation.getDeprecationInfo(component),
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
weight = 3;
|
|
24
|
-
}
|
package/deprecation.graphql.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Component } from '@teambit/component';
|
|
2
|
-
import { Schema } from '@teambit/graphql';
|
|
3
|
-
import gql from 'graphql-tag';
|
|
4
|
-
|
|
5
|
-
import { DeprecationMain } from './deprecation.main.runtime';
|
|
6
|
-
|
|
7
|
-
export function deprecationSchema(deprecation: DeprecationMain): Schema {
|
|
8
|
-
return {
|
|
9
|
-
typeDefs: gql`
|
|
10
|
-
extend type Component {
|
|
11
|
-
deprecation: DeprecationInfo
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
type DeprecationInfo {
|
|
15
|
-
isDeprecate: Boolean
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type DeprecationResult {
|
|
19
|
-
bitIds: [String]
|
|
20
|
-
missingComponents: [String]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
type Mutation {
|
|
24
|
-
# deprecate components
|
|
25
|
-
deprecate(bitIds: [String!]!): DeprecationResult
|
|
26
|
-
|
|
27
|
-
# undo deprecate to components
|
|
28
|
-
undeprecate(bitIds: [String!]!): DeprecationResult
|
|
29
|
-
}
|
|
30
|
-
`,
|
|
31
|
-
resolvers: {
|
|
32
|
-
Mutation: {
|
|
33
|
-
deprecate: (req: any, { bitIds }: { bitIds: string[] }, context: { verb: string }) => {
|
|
34
|
-
if (context.verb !== 'write') throw new Error('You are not authorized');
|
|
35
|
-
return deprecation.deprecate(bitIds);
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
undeprecate: (req: any, { bitIds }: { bitIds: string[] }, context: { verb: string }) => {
|
|
39
|
-
if (context.verb !== 'write') throw new Error('You are not authorized');
|
|
40
|
-
return deprecation.unDeprecate(bitIds);
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
Component: {
|
|
44
|
-
deprecation: (component: Component) => {
|
|
45
|
-
return deprecation.getDeprecationInfo(component);
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { deprecate, undeprecate } from '@teambit/legacy/dist/api/scope';
|
|
2
|
-
import { MainRuntime } from '@teambit/cli';
|
|
3
|
-
import { ComponentMain, ComponentAspect, Component } from '@teambit/component';
|
|
4
|
-
import { ScopeMain, ScopeAspect } from '@teambit/scope';
|
|
5
|
-
import { GraphqlAspect, GraphqlMain } from '@teambit/graphql';
|
|
6
|
-
import { DeprecationAspect } from './deprecation.aspect';
|
|
7
|
-
import { deprecationSchema } from './deprecation.graphql';
|
|
8
|
-
import { DeprecationFragment } from './deprecation.fragment';
|
|
9
|
-
|
|
10
|
-
export type DeprecationInfo = {
|
|
11
|
-
isDeprecate: boolean;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export class DeprecationMain {
|
|
15
|
-
constructor(private scope: ScopeMain) {}
|
|
16
|
-
static runtime = MainRuntime;
|
|
17
|
-
static dependencies = [GraphqlAspect, ScopeAspect, ComponentAspect];
|
|
18
|
-
|
|
19
|
-
getDeprecationInfo(component: Component): DeprecationInfo {
|
|
20
|
-
const deprecated = component.state._consumer.deprecated;
|
|
21
|
-
const isDeprecate = !!deprecated;
|
|
22
|
-
return {
|
|
23
|
-
isDeprecate,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async deprecate(ids: string[]) {
|
|
28
|
-
const results = await deprecate({ path: this.scope.path, ids }, null);
|
|
29
|
-
this.scope.clearCache();
|
|
30
|
-
return results;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async unDeprecate(ids: string[]) {
|
|
34
|
-
const results = undeprecate({ path: this.scope.path, ids }, null);
|
|
35
|
-
this.scope.clearCache();
|
|
36
|
-
return results;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static async provider([graphql, scope, componentAspect]: [GraphqlMain, ScopeMain, ComponentMain]) {
|
|
40
|
-
const deprecation = new DeprecationMain(scope);
|
|
41
|
-
componentAspect.registerShowFragments([new DeprecationFragment(deprecation)]);
|
|
42
|
-
graphql.register(deprecationSchema(deprecation));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
DeprecationAspect.addRuntime(DeprecationMain);
|
package/index.ts
DELETED
|
Binary file
|
package/types/asset.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
declare module '*.png' {
|
|
2
|
-
const value: any;
|
|
3
|
-
export = value;
|
|
4
|
-
}
|
|
5
|
-
declare module '*.svg' {
|
|
6
|
-
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
-
|
|
8
|
-
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
-
const src: string;
|
|
10
|
-
export default src;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// @TODO Gilad
|
|
14
|
-
declare module '*.jpg' {
|
|
15
|
-
const value: any;
|
|
16
|
-
export = value;
|
|
17
|
-
}
|
|
18
|
-
declare module '*.jpeg' {
|
|
19
|
-
const value: any;
|
|
20
|
-
export = value;
|
|
21
|
-
}
|
|
22
|
-
declare module '*.gif' {
|
|
23
|
-
const value: any;
|
|
24
|
-
export = value;
|
|
25
|
-
}
|
|
26
|
-
declare module '*.bmp' {
|
|
27
|
-
const value: any;
|
|
28
|
-
export = value;
|
|
29
|
-
}
|
package/types/style.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
declare module '*.module.css' {
|
|
2
|
-
const classes: { readonly [key: string]: string };
|
|
3
|
-
export default classes;
|
|
4
|
-
}
|
|
5
|
-
declare module '*.module.scss' {
|
|
6
|
-
const classes: { readonly [key: string]: string };
|
|
7
|
-
export default classes;
|
|
8
|
-
}
|
|
9
|
-
declare module '*.module.sass' {
|
|
10
|
-
const classes: { readonly [key: string]: string };
|
|
11
|
-
export default classes;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
declare module '*.module.less' {
|
|
15
|
-
const classes: { readonly [key: string]: string };
|
|
16
|
-
export default classes;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare module '*.less' {
|
|
20
|
-
const classes: { readonly [key: string]: string };
|
|
21
|
-
export default classes;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare module '*.css' {
|
|
25
|
-
const classes: { readonly [key: string]: string };
|
|
26
|
-
export default classes;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
declare module '*.sass' {
|
|
30
|
-
const classes: { readonly [key: string]: string };
|
|
31
|
-
export default classes;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
declare module '*.scss' {
|
|
35
|
-
const classes: { readonly [key: string]: string };
|
|
36
|
-
export default classes;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare module '*.mdx' {
|
|
40
|
-
const component: any;
|
|
41
|
-
export default component;
|
|
42
|
-
}
|