@teambit/deprecation 0.0.555 → 0.0.556

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 CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@teambit/deprecation",
3
- "version": "0.0.555",
3
+ "version": "0.0.556",
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.555"
9
+ "version": "0.0.556"
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.555",
17
- "@teambit/graphql": "0.0.555",
18
- "@teambit/cli": "0.0.386",
19
- "@teambit/scope": "0.0.555"
16
+ "@teambit/component": "0.0.556",
17
+ "@teambit/graphql": "0.0.556",
18
+ "@teambit/cli": "0.0.387",
19
+ "@teambit/scope": "0.0.556"
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.172",
30
+ "@teambit/legacy": "1.0.173",
31
31
  "react-dom": "^16.8.0 || ^17.0.0",
32
32
  "react": "^16.8.0 || ^17.0.0"
33
33
  },
@@ -55,12 +55,18 @@
55
55
  "react": "-"
56
56
  },
57
57
  "peerDependencies": {
58
- "@teambit/legacy": "1.0.172",
58
+ "@teambit/legacy": "1.0.173",
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
+ "README.md",
68
+ "README.mdx"
69
+ ],
64
70
  "private": false,
65
71
  "engines": {
66
72
  "node": ">=12.22.0"
@@ -1,7 +0,0 @@
1
- import { Aspect } from '@teambit/harmony';
2
-
3
- export const DeprecationAspect = Aspect.create({
4
- id: 'teambit.component/deprecation',
5
- dependencies: [],
6
- defaultConfig: {},
7
- });
@@ -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
- }
@@ -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
@@ -1,3 +0,0 @@
1
- export type { DeprecationMain } from './deprecation.main.runtime';
2
- export { DeprecationAspect } from './deprecation.aspect';
3
- export { DeprecationInfo } from './deprecation.main.runtime';
package/tsconfig.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "lib": [
4
- "es2019",
5
- "DOM",
6
- "ES6",
7
- "DOM.Iterable",
8
- "ScriptHost"
9
- ],
10
- "target": "es2015",
11
- "module": "commonjs",
12
- "jsx": "react",
13
- "declaration": true,
14
- "sourceMap": true,
15
- "skipLibCheck": true,
16
- "moduleResolution": "node",
17
- "esModuleInterop": true,
18
- "outDir": "dist",
19
- "composite": true,
20
- "emitDeclarationOnly": true,
21
- "experimentalDecorators": true,
22
- "emitDecoratorMetadata": true,
23
- "allowSyntheticDefaultImports": true,
24
- "strictPropertyInitialization": false,
25
- "strict": true,
26
- "noImplicitAny": false,
27
- "rootDir": ".",
28
- "preserveConstEnums": true,
29
- "resolveJsonModule": true
30
- },
31
- "exclude": [
32
- "dist"
33
- ]
34
- }
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
- }