@teambit/clear-cache 0.0.0-0c0104346dfe4ac205bd74e16e38ffd15263dc8d

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.
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+
3
+ export const Logo = () => (
4
+ <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>
5
+ <img style={{ width: 70 }} src="https://static.bit.dev/extensions-icons/clean-cache.svg" />
6
+ </div>
7
+ );
@@ -0,0 +1,4 @@
1
+ ---
2
+ description: Clears Bit's global and workspace cache
3
+ labels: ['aspect', 'cli']
4
+ ---
@@ -0,0 +1,18 @@
1
+ import type { Command, CommandOptions } from '@teambit/cli';
2
+ import type { ClearCacheMain } from './clear-cache.main.runtime';
3
+ export default class ClearCacheCmd implements Command {
4
+ private clearCache;
5
+ name: string;
6
+ description: string;
7
+ group: string;
8
+ extendedDescription: string;
9
+ alias: string;
10
+ options: CommandOptions;
11
+ loader: boolean;
12
+ skipWorkspace: boolean;
13
+ helpUrl: string;
14
+ constructor(clearCache: ClearCacheMain);
15
+ report(arg: any, { remote }: {
16
+ remote?: string;
17
+ }): Promise<string>;
18
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ function _chalk() {
8
+ const data = _interopRequireDefault(require("chalk"));
9
+ _chalk = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
+ class ClearCacheCmd {
19
+ constructor(clearCache) {
20
+ this.clearCache = clearCache;
21
+ _defineProperty(this, "name", 'clear-cache');
22
+ _defineProperty(this, "description", 'remove cached data to resolve stale data issues');
23
+ _defineProperty(this, "group", 'system');
24
+ _defineProperty(this, "extendedDescription", void 0);
25
+ _defineProperty(this, "alias", 'cc');
26
+ _defineProperty(this, "options", [['r', 'remote <remote-name>', 'clear memory cache from a remote scope']]);
27
+ _defineProperty(this, "loader", false);
28
+ _defineProperty(this, "skipWorkspace", true);
29
+ _defineProperty(this, "helpUrl", 'reference/workspace/clearing-cache');
30
+ this.extendedDescription = `clears various caches that Bit uses to improve performance. useful when experiencing stale data issues or
31
+ unexpected behavior. this command removes:
32
+ 1) components cache on the filesystem (mainly the dependencies graph and docs)
33
+ 2) scope's index file, which maps the component-id:object-hash
34
+
35
+ note: this cache has minimal impact on disk space. to free significant disk space, use "bit capsule delete --all" to remove build capsules.`;
36
+ }
37
+ async report(arg, {
38
+ remote
39
+ }) {
40
+ if (remote) {
41
+ const success = await this.clearCache.clearRemoteCache(remote);
42
+ if (success) {
43
+ return _chalk().default.green(`successfully cleaned the cache of "${remote}"`);
44
+ }
45
+ return _chalk().default.red(`failed cleaning the cache of "${remote}"`);
46
+ }
47
+ const {
48
+ succeed,
49
+ failed
50
+ } = await this.clearCache.clearCache();
51
+ const getSuccessOutput = () => {
52
+ if (!succeed.length) return '';
53
+ const title = 'the following cache(s) have been cleared:';
54
+ const output = succeed.map(str => ` ✔ ${str}`).join('\n');
55
+ return _chalk().default.green(`${_chalk().default.bold(title)}\n${output}`);
56
+ };
57
+ const getFailedOutput = () => {
58
+ if (!failed.length) return '';
59
+ const title = 'the following cache(s) failed to clear:';
60
+ const output = failed.map(str => ` X ${str}`).join('\n');
61
+ return _chalk().default.red(`${_chalk().default.bold(title)}\n${output}`);
62
+ };
63
+ return `${getSuccessOutput()}\n${getFailedOutput()}`;
64
+ }
65
+ }
66
+ exports.default = ClearCacheCmd;
67
+
68
+ //# sourceMappingURL=clear-cache-cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ClearCacheCmd","constructor","clearCache","extendedDescription","report","arg","remote","success","clearRemoteCache","chalk","green","red","succeed","failed","getSuccessOutput","length","title","output","map","str","join","bold","getFailedOutput","exports"],"sources":["clear-cache-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport type { ClearCacheMain } from './clear-cache.main.runtime';\n\nexport default class ClearCacheCmd implements Command {\n name = 'clear-cache';\n description = 'remove cached data to resolve stale data issues';\n group = 'system';\n extendedDescription: string;\n alias = 'cc';\n options = [['r', 'remote <remote-name>', 'clear memory cache from a remote scope']] as CommandOptions;\n loader = false;\n skipWorkspace = true;\n helpUrl = 'reference/workspace/clearing-cache';\n\n constructor(private clearCache: ClearCacheMain) {\n this.extendedDescription = `clears various caches that Bit uses to improve performance. useful when experiencing stale data issues or\nunexpected behavior. this command removes:\n1) components cache on the filesystem (mainly the dependencies graph and docs)\n2) scope's index file, which maps the component-id:object-hash\n\nnote: this cache has minimal impact on disk space. to free significant disk space, use \"bit capsule delete --all\" to remove build capsules.`;\n }\n\n async report(arg, { remote }: { remote?: string }): Promise<string> {\n if (remote) {\n const success = await this.clearCache.clearRemoteCache(remote);\n if (success) {\n return chalk.green(`successfully cleaned the cache of \"${remote}\"`);\n }\n return chalk.red(`failed cleaning the cache of \"${remote}\"`);\n }\n const { succeed, failed } = await this.clearCache.clearCache();\n const getSuccessOutput = () => {\n if (!succeed.length) return '';\n const title = 'the following cache(s) have been cleared:';\n const output = succeed.map((str) => ` ✔ ${str}`).join('\\n');\n return chalk.green(`${chalk.bold(title)}\\n${output}`);\n };\n const getFailedOutput = () => {\n if (!failed.length) return '';\n const title = 'the following cache(s) failed to clear:';\n const output = failed.map((str) => ` X ${str}`).join('\\n');\n return chalk.red(`${chalk.bold(title)}\\n${output}`);\n };\n return `${getSuccessOutput()}\\n${getFailedOutput()}`;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAGX,MAAMgB,aAAa,CAAoB;EAWpDC,WAAWA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MAAMK,eAAe,GAAGA,CAAA,KAAM;MAC5B,IAAI,CAACT,MAAM,CAACE,MAAM,EAAE,OAAO,EAAE;MAC7B,MAAMC,KAAK,GAAG,yCAAyC;MACvD,MAAMC,MAAM,GAAGJ,MAAM,CAACK,GAAG,CAAEC,GAAG,IAAK,OAAOA,GAAG,EAAE,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;MAC3D,OAAOX,gBAAK,CAACE,GAAG,CAAC,GAAGF,gBAAK,CAACY,IAAI,CAACL,KAAK,CAAC,KAAKC,MAAM,EAAE,CAAC;IACrD,CAAC;IACD,OAAO,GAAGH,gBAAgB,CAAC,CAAC,KAAKQ,eAAe,CAAC,CAAC,EAAE;EACtD;AACF;AAACC,OAAA,CAAA1C,OAAA,GAAAmB,aAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import { Aspect } from '@teambit/harmony';
2
+ export declare const ClearCacheAspect: Aspect;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ClearCacheAspect = void 0;
7
+ function _harmony() {
8
+ const data = require("@teambit/harmony");
9
+ _harmony = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ const ClearCacheAspect = exports.ClearCacheAspect = _harmony().Aspect.create({
15
+ id: 'teambit.bit/clear-cache'
16
+ });
17
+
18
+ //# sourceMappingURL=clear-cache.aspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_harmony","data","require","ClearCacheAspect","exports","Aspect","create","id"],"sources":["clear-cache.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const ClearCacheAspect = Aspect.create({\n id: 'teambit.bit/clear-cache',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC5CC,EAAE,EAAE;AACN,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const Logo: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Logo = void 0;
7
+ function _react() {
8
+ const data = _interopRequireDefault(require("react"));
9
+ _react = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
16
+ style: {
17
+ height: '100%',
18
+ display: 'flex',
19
+ justifyContent: 'center'
20
+ }
21
+ }, /*#__PURE__*/_react().default.createElement("img", {
22
+ style: {
23
+ width: 70
24
+ },
25
+ src: "https://static.bit.dev/extensions-icons/clean-cache.svg"
26
+ }));
27
+ exports.Logo = Logo;
28
+
29
+ //# sourceMappingURL=clear-cache.composition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","data","_interopRequireDefault","require","e","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["clear-cache.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/clean-cache.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAyD,CAAE,CACvF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export type CacheClearResult = {
2
+ succeed: string[];
3
+ failed: string[];
4
+ };
5
+ export declare function clearCache(): Promise<CacheClearResult>;
@@ -0,0 +1,4 @@
1
+ ---
2
+ description: Clears Bit's global and workspace cache
3
+ labels: ['aspect', 'cli']
4
+ ---
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.clearCache = clearCache;
7
+ function _fsExtra() {
8
+ const data = _interopRequireDefault(require("fs-extra"));
9
+ _fsExtra = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _legacy() {
15
+ const data = require("@teambit/legacy.consumer");
16
+ _legacy = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _workspaceModules() {
22
+ const data = require("@teambit/workspace.modules.workspace-locator");
23
+ _workspaceModules = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _workspaceModules2() {
29
+ const data = require("@teambit/workspace.modules.fs-cache");
30
+ _workspaceModules2 = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ function _scopeModules() {
36
+ const data = require("@teambit/scope.modules.find-scope-path");
37
+ _scopeModules = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
42
+ function _objects() {
43
+ const data = require("@teambit/objects");
44
+ _objects = function () {
45
+ return data;
46
+ };
47
+ return data;
48
+ }
49
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
50
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
51
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
52
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
53
+ class CacheClearer {
54
+ constructor() {
55
+ _defineProperty(this, "cacheCleared", []);
56
+ _defineProperty(this, "cacheClearedFailures", []);
57
+ }
58
+ async clear() {
59
+ await this.clearFSCache();
60
+ await this.clearScopeIndex();
61
+ return {
62
+ succeed: this.cacheCleared,
63
+ failed: this.cacheClearedFailures
64
+ };
65
+ }
66
+ async clearFSCache() {
67
+ const fsCachePath = await this.getFSCachePath();
68
+ if (fsCachePath) {
69
+ _fsExtra().default.removeSync(fsCachePath);
70
+ this.cacheCleared.push('components cache on the filesystem');
71
+ }
72
+ }
73
+ async getConsumerGracefully() {
74
+ try {
75
+ return await (0, _legacy().loadConsumerIfExist)();
76
+ } catch {
77
+ return undefined;
78
+ }
79
+ }
80
+ async getFSCachePath() {
81
+ const consumer = await this.getConsumerGracefully();
82
+ if (consumer) {
83
+ return consumer.componentFsCache.basePath;
84
+ }
85
+ const consumerInfo = await (0, _workspaceModules().getWorkspaceInfo)(process.cwd());
86
+ if (!consumerInfo) {
87
+ return null; // no workspace around, nothing to do.
88
+ }
89
+ const scopePath = (0, _scopeModules().findScopePath)(consumerInfo.path);
90
+ if (!scopePath) return null;
91
+ const componentFsCache = new (_workspaceModules2().FsCache)(scopePath);
92
+ return componentFsCache.basePath;
93
+ }
94
+ async clearScopeIndex() {
95
+ try {
96
+ const scopePath = (0, _scopeModules().findScopePath)(process.cwd());
97
+ if (!scopePath) return;
98
+ await _objects().ScopeIndex.reset(scopePath);
99
+ this.cacheCleared.push('scope-index file');
100
+ } catch (err) {
101
+ this.cacheClearedFailures.push(`scope-index file (err: ${err.message})`);
102
+ }
103
+ }
104
+ }
105
+ async function clearCache() {
106
+ return new CacheClearer().clear();
107
+ }
108
+
109
+ //# sourceMappingURL=clear-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_legacy","_workspaceModules","_workspaceModules2","_scopeModules","_objects","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CacheClearer","constructor","clear","clearFSCache","clearScopeIndex","succeed","cacheCleared","failed","cacheClearedFailures","fsCachePath","getFSCachePath","fs","removeSync","push","getConsumerGracefully","loadConsumerIfExist","undefined","consumer","componentFsCache","basePath","consumerInfo","getWorkspaceInfo","process","cwd","scopePath","findScopePath","path","FsCache","ScopeIndex","reset","err","message","clearCache"],"sources":["clear-cache.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport { loadConsumerIfExist } from '@teambit/legacy.consumer';\nimport { getWorkspaceInfo } from '@teambit/workspace.modules.workspace-locator';\nimport { FsCache } from '@teambit/workspace.modules.fs-cache';\nimport { findScopePath } from '@teambit/scope.modules.find-scope-path';\nimport { ScopeIndex } from '@teambit/objects';\n\nexport type CacheClearResult = { succeed: string[]; failed: string[] };\n\nclass CacheClearer {\n private cacheCleared: string[] = [];\n private cacheClearedFailures: string[] = [];\n async clear(): Promise<CacheClearResult> {\n await this.clearFSCache();\n await this.clearScopeIndex();\n\n return { succeed: this.cacheCleared, failed: this.cacheClearedFailures };\n }\n\n private async clearFSCache() {\n const fsCachePath = await this.getFSCachePath();\n if (fsCachePath) {\n fs.removeSync(fsCachePath);\n this.cacheCleared.push('components cache on the filesystem');\n }\n }\n\n private async getConsumerGracefully(): Promise<Consumer | undefined> {\n try {\n return await loadConsumerIfExist();\n } catch {\n return undefined;\n }\n }\n\n private async getFSCachePath(): Promise<string | null> {\n const consumer = await this.getConsumerGracefully();\n if (consumer) {\n return consumer.componentFsCache.basePath;\n }\n const consumerInfo = await getWorkspaceInfo(process.cwd());\n if (!consumerInfo) {\n return null; // no workspace around, nothing to do.\n }\n const scopePath = findScopePath(consumerInfo.path);\n if (!scopePath) return null;\n const componentFsCache = new FsCache(scopePath);\n return componentFsCache.basePath;\n }\n\n private async clearScopeIndex() {\n try {\n const scopePath = findScopePath(process.cwd());\n if (!scopePath) return;\n await ScopeIndex.reset(scopePath);\n this.cacheCleared.push('scope-index file');\n } catch (err: any) {\n this.cacheClearedFailures.push(`scope-index file (err: ${err.message})`);\n }\n }\n}\n\nexport async function clearCache(): Promise<CacheClearResult> {\n return new CacheClearer().clear();\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,mBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,cAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,aAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IA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C;IAC5C,CAAC,CAAC,OAAOiB,GAAQ,EAAE;MACjB,IAAI,CAACtB,oBAAoB,CAACK,IAAI,CAAC,0BAA0BiB,GAAG,CAACC,OAAO,GAAG,CAAC;IAC1E;EACF;AACF;AAEO,eAAeC,UAAUA,CAAA,EAA8B;EAC5D,OAAO,IAAIhC,YAAY,CAAC,CAAC,CAACE,KAAK,CAAC,CAAC;AACnC","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ import type { CLIMain } from '@teambit/cli';
2
+ import type { CacheClearResult } from './clear-cache';
3
+ /**
4
+ * avoid adding `workspace` / `scope` aspects as dependencies to this aspect.
5
+ * the clear-cache command is often being used when the workspace/scope is not working properly.
6
+ */
7
+ export declare class ClearCacheMain {
8
+ clearCache(): Promise<CacheClearResult>;
9
+ clearRemoteCache(remote: string): Promise<unknown>;
10
+ private getConsumerGracefully;
11
+ static slots: never[];
12
+ static dependencies: import("@teambit/harmony").Aspect[];
13
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
14
+ static provider([cli]: [CLIMain]): Promise<ClearCacheMain>;
15
+ }
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ClearCacheMain = void 0;
7
+ function _cli() {
8
+ const data = require("@teambit/cli");
9
+ _cli = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _scope() {
15
+ const data = require("@teambit/scope.remotes");
16
+ _scope = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _legacy() {
22
+ const data = require("@teambit/legacy.consumer");
23
+ _legacy = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _clearCacheCmd() {
29
+ const data = _interopRequireDefault(require("./clear-cache-cmd"));
30
+ _clearCacheCmd = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ function _clearCache() {
36
+ const data = require("./clear-cache.aspect");
37
+ _clearCache = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
42
+ function _clearCache2() {
43
+ const data = require("./clear-cache");
44
+ _clearCache2 = function () {
45
+ return data;
46
+ };
47
+ return data;
48
+ }
49
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
50
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
51
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
52
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
53
+ /**
54
+ * avoid adding `workspace` / `scope` aspects as dependencies to this aspect.
55
+ * the clear-cache command is often being used when the workspace/scope is not working properly.
56
+ */
57
+ class ClearCacheMain {
58
+ async clearCache() {
59
+ return (0, _clearCache2().clearCache)();
60
+ }
61
+ async clearRemoteCache(remote) {
62
+ const maybeConsumer = await this.getConsumerGracefully();
63
+ const remoteObj = await (0, _scope().getRemoteByName)(remote, maybeConsumer);
64
+ const result = await remoteObj.action('ClearCacheAction', {});
65
+ return result;
66
+ }
67
+ async getConsumerGracefully() {
68
+ try {
69
+ return await (0, _legacy().loadConsumerIfExist)();
70
+ } catch {
71
+ return undefined;
72
+ }
73
+ }
74
+ static async provider([cli]) {
75
+ const clearCacheMain = new ClearCacheMain();
76
+ cli.register(new (_clearCacheCmd().default)(clearCacheMain));
77
+ return clearCacheMain;
78
+ }
79
+ }
80
+ exports.ClearCacheMain = ClearCacheMain;
81
+ _defineProperty(ClearCacheMain, "slots", []);
82
+ _defineProperty(ClearCacheMain, "dependencies", [_cli().CLIAspect]);
83
+ _defineProperty(ClearCacheMain, "runtime", _cli().MainRuntime);
84
+ _clearCache().ClearCacheAspect.addRuntime(ClearCacheMain);
85
+
86
+ //# sourceMappingURL=clear-cache.main.runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_cli","data","require","_scope","_legacy","_clearCacheCmd","_interopRequireDefault","_clearCache","_clearCache2","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ClearCacheMain","clearCache","clearRemoteCache","remote","maybeConsumer","getConsumerGracefully","remoteObj","getRemoteByName","result","action","loadConsumerIfExist","undefined","provider","cli","clearCacheMain","register","ClearCacheCmd","exports","CLIAspect","MainRuntime","ClearCacheAspect","addRuntime"],"sources":["clear-cache.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport { getRemoteByName } from '@teambit/scope.remotes';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport { loadConsumerIfExist } from '@teambit/legacy.consumer';\nimport ClearCacheCmd from './clear-cache-cmd';\nimport { ClearCacheAspect } from './clear-cache.aspect';\nimport type { CacheClearResult } from './clear-cache';\nimport { clearCache } from './clear-cache';\n\n/**\n * avoid adding `workspace` / `scope` aspects as dependencies to this aspect.\n * the clear-cache command is often being used when the workspace/scope is not working properly.\n */\nexport class ClearCacheMain {\n async clearCache(): Promise<CacheClearResult> {\n return clearCache();\n }\n\n async clearRemoteCache(remote: string) {\n const maybeConsumer = await this.getConsumerGracefully();\n const remoteObj = await getRemoteByName(remote, maybeConsumer);\n const result = await remoteObj.action('ClearCacheAction', {});\n return result;\n }\n\n private async getConsumerGracefully(): Promise<Consumer | undefined> {\n try {\n return await loadConsumerIfExist();\n } catch {\n return undefined;\n }\n }\n\n static slots = [];\n static dependencies = [CLIAspect];\n static runtime = MainRuntime;\n static async provider([cli]: [CLIMain]) {\n const clearCacheMain = new ClearCacheMain();\n cli.register(new ClearCacheCmd(clearCacheMain));\n return clearCacheMain;\n }\n}\n\nClearCacheAspect.addRuntime(Clear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cAAc,WAoBV,EAAE;AAAAlB,eAAA,CApBNkB,cAAc,kBAqBH,CAACkB,gBAAS,CAAC;AAAApC,eAAA,CArBtBkB,cAAc,aAsBRmB,kBAAW;AAQ9BC,8BAAgB,CAACC,UAAU,CAACrB,cAAc,CAAC","ignoreList":[]}
package/dist/esm.mjs ADDED
@@ -0,0 +1,6 @@
1
+ // eslint-disable-next-line import/no-unresolved
2
+ import cjsModule from './index.js';
3
+
4
+ export const ClearCacheAspect = cjsModule.ClearCacheAspect;
5
+
6
+ export default cjsModule;
@@ -0,0 +1,4 @@
1
+ import { ClearCacheAspect } from './clear-cache.aspect';
2
+ export type { ClearCacheMain } from './clear-cache.main.runtime';
3
+ export default ClearCacheAspect;
4
+ export { ClearCacheAspect };
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ClearCacheAspect", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _clearCache().ClearCacheAspect;
10
+ }
11
+ });
12
+ exports.default = void 0;
13
+ function _clearCache() {
14
+ const data = require("./clear-cache.aspect");
15
+ _clearCache = function () {
16
+ return data;
17
+ };
18
+ return data;
19
+ }
20
+ var _default = exports.default = _clearCache().ClearCacheAspect;
21
+
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_clearCache","data","require","_default","exports","default","ClearCacheAspect"],"sources":["index.ts"],"sourcesContent":["import { ClearCacheAspect } from './clear-cache.aspect';\n\nexport type { ClearCacheMain } from './clear-cache.main.runtime';\nexport default ClearCacheAspect;\nexport { ClearCacheAspect };\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGzCC,8BAAgB","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_clear-cache@0c0104346dfe4ac205bd74e16e38ffd15263dc8d/dist/clear-cache.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_clear-cache@0c0104346dfe4ac205bd74e16e38ffd15263dc8d/dist/clear-cache.docs.mdx';
3
+
4
+ export const compositions = [compositions_0];
5
+ export const overview = [overview_0];
6
+
7
+ export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
package/esm.mjs ADDED
@@ -0,0 +1,6 @@
1
+ // eslint-disable-next-line import/no-unresolved
2
+ import cjsModule from './index.js';
3
+
4
+ export const ClearCacheAspect = cjsModule.ClearCacheAspect;
5
+
6
+ export default cjsModule;
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@teambit/clear-cache",
3
+ "version": "0.0.0-0c0104346dfe4ac205bd74e16e38ffd15263dc8d",
4
+ "homepage": "https://bit.cloud/teambit/workspace/clear-cache",
5
+ "main": "dist/index.js",
6
+ "componentId": {
7
+ "scope": "teambit.workspace",
8
+ "name": "clear-cache",
9
+ "version": "0c0104346dfe4ac205bd74e16e38ffd15263dc8d"
10
+ },
11
+ "dependencies": {
12
+ "chalk": "4.1.2",
13
+ "fs-extra": "10.0.0",
14
+ "@teambit/harmony": "0.4.7",
15
+ "@teambit/legacy.consumer": "0.0.0-a599545406d1badd9a158ce602d6ff32dfd213ee",
16
+ "@teambit/scope.remotes": "0.0.0-b33774a332523dd62df26b71dc83ea4fd447274c",
17
+ "@teambit/scope.modules.find-scope-path": "0.0.0-8e68fd0157eac1634e61ed128eaa5c7ed3d94f65",
18
+ "@teambit/workspace.modules.fs-cache": "0.0.0-49143eeb83d9f89f048cce9b71e39b0300a02ace",
19
+ "@teambit/workspace.modules.workspace-locator": "0.0.0-8d8ffa352853866da840b2fe9f2f2f1f8b0ee2db"
20
+ },
21
+ "devDependencies": {
22
+ "@types/fs-extra": "9.0.7",
23
+ "@types/mocha": "9.1.0",
24
+ "@teambit/harmony.envs.core-aspect-env": "0.0.79"
25
+ },
26
+ "peerDependencies": {
27
+ "react": "^17.0.0 || ^18.0.0",
28
+ "@types/react": "^17.0.73"
29
+ },
30
+ "license": "Apache-2.0",
31
+ "optionalDependencies": {},
32
+ "peerDependenciesMeta": {},
33
+ "exports": {
34
+ ".": {
35
+ "node": {
36
+ "require": "./dist/index.js",
37
+ "import": "./dist/esm.mjs"
38
+ },
39
+ "default": "./dist/index.js"
40
+ },
41
+ "./dist/*": "./dist/*",
42
+ "./artifacts/*": "./artifacts/*",
43
+ "./*": "./*.ts"
44
+ },
45
+ "private": false,
46
+ "engines": {
47
+ "node": ">=16.0.0"
48
+ },
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "https://github.com/teambit/bit"
52
+ },
53
+ "keywords": [
54
+ "bit",
55
+ "bit-aspect",
56
+ "bit-core-aspect",
57
+ "components",
58
+ "collaboration",
59
+ "web"
60
+ ]
61
+ }
@@ -0,0 +1,41 @@
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<
9
+ SVGProps<SVGSVGElement> & { title?: string }
10
+ >;
11
+ const src: string;
12
+ export default src;
13
+ }
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
+ }
30
+ declare module '*.otf' {
31
+ const value: any;
32
+ export = value;
33
+ }
34
+ declare module '*.woff' {
35
+ const value: any;
36
+ export = value;
37
+ }
38
+ declare module '*.woff2' {
39
+ const value: any;
40
+ export = value;
41
+ }
@@ -0,0 +1,42 @@
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
+ }