@teambit/clear-cache 0.0.1
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/__preview-1644176887286.js +1 -0
- package/dist/clear-cache-action.d.ts +7 -0
- package/dist/clear-cache-action.js +36 -0
- package/dist/clear-cache-action.js.map +1 -0
- package/dist/clear-cache-cmd.d.ts +17 -0
- package/dist/clear-cache-cmd.js +82 -0
- package/dist/clear-cache-cmd.js.map +1 -0
- package/dist/clear-cache.aspect.d.ts +2 -0
- package/dist/clear-cache.aspect.js +24 -0
- package/dist/clear-cache.aspect.js.map +1 -0
- package/dist/clear-cache.main.runtime.d.ts +13 -0
- package/dist/clear-cache.main.runtime.js +149 -0
- package/dist/clear-cache.main.runtime.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/package-tar/teambit-clear-cache-0.0.1.tgz +0 -0
- package/package.json +80 -0
- package/tsconfig.json +34 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ClearCacheAction = void 0;
|
|
9
|
+
|
|
10
|
+
function _defineProperty2() {
|
|
11
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
+
|
|
13
|
+
_defineProperty2 = function () {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class ClearCacheAction {
|
|
21
|
+
constructor(scope) {
|
|
22
|
+
this.scope = scope;
|
|
23
|
+
(0, _defineProperty2().default)(this, "name", ClearCacheAction.name);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
execute() {
|
|
27
|
+
if (!this.scope) return false;
|
|
28
|
+
this.scope.clearCache();
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.ClearCacheAction = ClearCacheAction;
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=clear-cache-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["clear-cache-action.ts"],"names":["ClearCacheAction","constructor","scope","name","execute","clearCache"],"mappings":";;;;;;;;;;;;;;;;;;;AAEO,MAAMA,gBAAN,CAAuB;AAE5BC,EAAAA,WAAW,CAASC,KAAT,EAA2B;AAAA,SAAlBA,KAAkB,GAAlBA,KAAkB;AAAA,kDAD/BF,gBAAgB,CAACG,IACc;AAAE;;AACxCC,EAAAA,OAAO,GAAG;AACR,QAAI,CAAC,KAAKF,KAAV,EAAiB,OAAO,KAAP;AACjB,SAAKA,KAAL,CAAWG,UAAX;AACA,WAAO,IAAP;AACD;;AAP2B","sourcesContent":["import { ScopeMain } from '@teambit/scope';\n\nexport class ClearCacheAction {\n name = ClearCacheAction.name;\n constructor(private scope: ScopeMain) {}\n execute() {\n if (!this.scope) return false;\n this.scope.clearCache();\n return true;\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import { 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
|
+
constructor(clearCache: ClearCacheMain);
|
|
14
|
+
report(arg: any, { remote }: {
|
|
15
|
+
remote?: string;
|
|
16
|
+
}): Promise<string>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.promise.js");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
function _defineProperty2() {
|
|
13
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
|
|
15
|
+
_defineProperty2 = function () {
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function _chalk() {
|
|
23
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
24
|
+
|
|
25
|
+
_chalk = function () {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function _constants() {
|
|
33
|
+
const data = require("@teambit/legacy/dist/constants");
|
|
34
|
+
|
|
35
|
+
_constants = function () {
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return data;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
class ClearCacheCmd {
|
|
43
|
+
constructor(clearCache) {
|
|
44
|
+
this.clearCache = clearCache;
|
|
45
|
+
(0, _defineProperty2().default)(this, "name", 'clear-cache');
|
|
46
|
+
(0, _defineProperty2().default)(this, "description", "clears Bit's cache from current working machine");
|
|
47
|
+
(0, _defineProperty2().default)(this, "group", 'general');
|
|
48
|
+
(0, _defineProperty2().default)(this, "extendedDescription", `The following gets removed by this command:
|
|
49
|
+
1) V8 compiled code (generated the first time Bit is loaded by v8-compile-cache package)
|
|
50
|
+
2) components cache on the filesystem (mainly the dependencies graph and docs)
|
|
51
|
+
3) scope's index file, which maps the component-id:object-hash
|
|
52
|
+
https://${_constants().BASE_DOCS_DOMAIN}/docs/workspace#cache`);
|
|
53
|
+
(0, _defineProperty2().default)(this, "alias", 'cc');
|
|
54
|
+
(0, _defineProperty2().default)(this, "options", [['r', 'remote <remote-name>', 'clear memory cache from a remote scope']]);
|
|
55
|
+
(0, _defineProperty2().default)(this, "loader", false);
|
|
56
|
+
(0, _defineProperty2().default)(this, "skipWorkspace", true);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async report(arg, {
|
|
60
|
+
remote
|
|
61
|
+
}) {
|
|
62
|
+
if (remote) {
|
|
63
|
+
const success = await this.clearCache.clearRemoteCache(remote);
|
|
64
|
+
|
|
65
|
+
if (success) {
|
|
66
|
+
return _chalk().default.green(`successfully cleaned the cache of "${remote}"`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return _chalk().default.red(`failed cleaning the cache of "${remote}"`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const cacheCleared = await this.clearCache.clearCache();
|
|
73
|
+
const title = 'the following cache(s) have been cleared:';
|
|
74
|
+
const output = cacheCleared.map(str => ` ✔ ${str}`).join('\n');
|
|
75
|
+
return _chalk().default.green(`${_chalk().default.bold(title)}\n${output}`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
exports.default = ClearCacheCmd;
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=clear-cache-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["clear-cache-cmd.ts"],"names":["ClearCacheCmd","constructor","clearCache","BASE_DOCS_DOMAIN","report","arg","remote","success","clearRemoteCache","chalk","green","red","cacheCleared","title","output","map","str","join","bold"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGe,MAAMA,aAAN,CAAuC;AAcpDC,EAAAA,WAAW,CAASC,UAAT,EAAqC;AAAA,SAA5BA,UAA4B,GAA5BA,UAA4B;AAAA,kDAbzC,aAayC;AAAA,yDAZlC,iDAYkC;AAAA,mDAXxC,SAWwC;AAAA,iEAVzB;AACzB;AACA;AACA;AACA,UAAUC,6BAAiB,uBAMuB;AAAA,mDALxC,IAKwC;AAAA,qDAJtC,CAAC,CAAC,GAAD,EAAM,sBAAN,EAA8B,wCAA9B,CAAD,CAIsC;AAAA,oDAHvC,KAGuC;AAAA,2DAFhC,IAEgC;AAAE;;AAEtC,QAANC,MAAM,CAACC,GAAD,EAAM;AAAEC,IAAAA;AAAF,GAAN,EAAwD;AAClE,QAAIA,MAAJ,EAAY;AACV,YAAMC,OAAO,GAAG,MAAM,KAAKL,UAAL,CAAgBM,gBAAhB,CAAiCF,MAAjC,CAAtB;;AACA,UAAIC,OAAJ,EAAa;AACX,eAAOE,iBAAMC,KAAN,CAAa,sCAAqCJ,MAAO,GAAzD,CAAP;AACD;;AACD,aAAOG,iBAAME,GAAN,CAAW,iCAAgCL,MAAO,GAAlD,CAAP;AACD;;AACD,UAAMM,YAAY,GAAG,MAAM,KAAKV,UAAL,CAAgBA,UAAhB,EAA3B;AACA,UAAMW,KAAK,GAAG,2CAAd;AACA,UAAMC,MAAM,GAAGF,YAAY,CAACG,GAAb,CAAkBC,GAAD,IAAU,OAAMA,GAAI,EAArC,EAAwCC,IAAxC,CAA6C,IAA7C,CAAf;AACA,WAAOR,iBAAMC,KAAN,CAAa,GAAED,iBAAMS,IAAN,CAAWL,KAAX,CAAkB,KAAIC,MAAO,EAA5C,CAAP;AACD;;AA5BmD","sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { BASE_DOCS_DOMAIN } from '@teambit/legacy/dist/constants';\nimport { ClearCacheMain } from './clear-cache.main.runtime';\n\nexport default class ClearCacheCmd implements Command {\n name = 'clear-cache';\n description = \"clears Bit's cache from current working machine\";\n group = 'general';\n extendedDescription = `The following gets removed by this command:\n1) V8 compiled code (generated the first time Bit is loaded by v8-compile-cache package)\n2) components cache on the filesystem (mainly the dependencies graph and docs)\n3) scope's index file, which maps the component-id:object-hash\nhttps://${BASE_DOCS_DOMAIN}/docs/workspace#cache`;\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\n constructor(private clearCache: ClearCacheMain) {}\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 cacheCleared = await this.clearCache.clearCache();\n const title = 'the following cache(s) have been cleared:';\n const output = cacheCleared.map((str) => ` ✔ ${str}`).join('\\n');\n return chalk.green(`${chalk.bold(title)}\\n${output}`);\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ClearCacheAspect = void 0;
|
|
7
|
+
|
|
8
|
+
function _harmony() {
|
|
9
|
+
const data = require("@teambit/harmony");
|
|
10
|
+
|
|
11
|
+
_harmony = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const ClearCacheAspect = _harmony().Aspect.create({
|
|
19
|
+
id: 'teambit.bit/clear-cache'
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
exports.ClearCacheAspect = ClearCacheAspect;
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=clear-cache.aspect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["clear-cache.aspect.ts"],"names":["ClearCacheAspect","Aspect","create","id"],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,gBAAgB,GAAGC,kBAAOC,MAAP,CAAc;AAC5CC,EAAAA,EAAE,EAAE;AADwC,CAAd,CAAzB","sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const ClearCacheAspect = Aspect.create({\n id: 'teambit.bit/clear-cache',\n});\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CLIMain } from '@teambit/cli';
|
|
2
|
+
import { Workspace } from '@teambit/workspace';
|
|
3
|
+
import { ScopeMain } from '@teambit/scope';
|
|
4
|
+
export declare class ClearCacheMain {
|
|
5
|
+
private workspace?;
|
|
6
|
+
constructor(workspace?: Workspace | undefined);
|
|
7
|
+
clearCache(): Promise<string[]>;
|
|
8
|
+
clearRemoteCache(remote: string): Promise<unknown>;
|
|
9
|
+
static slots: never[];
|
|
10
|
+
static dependencies: import("@teambit/harmony").Aspect[];
|
|
11
|
+
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
12
|
+
static provider([workspace, cli, scope]: [Workspace, CLIMain, ScopeMain]): Promise<ClearCacheMain>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.promise.js");
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
});
|
|
12
|
+
exports.ClearCacheMain = void 0;
|
|
13
|
+
|
|
14
|
+
function _defineProperty2() {
|
|
15
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
|
|
17
|
+
_defineProperty2 = function () {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function _cli() {
|
|
25
|
+
const data = require("@teambit/cli");
|
|
26
|
+
|
|
27
|
+
_cli = function () {
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _workspace() {
|
|
35
|
+
const data = _interopRequireDefault(require("@teambit/workspace"));
|
|
36
|
+
|
|
37
|
+
_workspace = function () {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function _scope() {
|
|
45
|
+
const data = _interopRequireDefault(require("@teambit/scope"));
|
|
46
|
+
|
|
47
|
+
_scope = function () {
|
|
48
|
+
return data;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return data;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function _consumer() {
|
|
55
|
+
const data = require("@teambit/legacy/dist/api/consumer");
|
|
56
|
+
|
|
57
|
+
_consumer = function () {
|
|
58
|
+
return data;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function _action() {
|
|
65
|
+
const data = require("@teambit/legacy/dist/api/scope/lib/action");
|
|
66
|
+
|
|
67
|
+
_action = function () {
|
|
68
|
+
return data;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return data;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function _getRemoteByName() {
|
|
75
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/remotes/get-remote-by-name"));
|
|
76
|
+
|
|
77
|
+
_getRemoteByName = function () {
|
|
78
|
+
return data;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return data;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function _clearCacheCmd() {
|
|
85
|
+
const data = _interopRequireDefault(require("./clear-cache-cmd"));
|
|
86
|
+
|
|
87
|
+
_clearCacheCmd = function () {
|
|
88
|
+
return data;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return data;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function _clearCache() {
|
|
95
|
+
const data = require("./clear-cache.aspect");
|
|
96
|
+
|
|
97
|
+
_clearCache = function () {
|
|
98
|
+
return data;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
return data;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function _clearCacheAction() {
|
|
105
|
+
const data = require("./clear-cache-action");
|
|
106
|
+
|
|
107
|
+
_clearCacheAction = function () {
|
|
108
|
+
return data;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return data;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
class ClearCacheMain {
|
|
115
|
+
constructor(workspace) {
|
|
116
|
+
this.workspace = workspace;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
async clearCache() {
|
|
120
|
+
return (0, _consumer().clearCache)();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async clearRemoteCache(remote) {
|
|
124
|
+
var _this$workspace;
|
|
125
|
+
|
|
126
|
+
const remoteObj = await (0, _getRemoteByName().default)(remote, (_this$workspace = this.workspace) === null || _this$workspace === void 0 ? void 0 : _this$workspace.consumer);
|
|
127
|
+
const result = await remoteObj.action(_clearCacheAction().ClearCacheAction.name, {});
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
static async provider([workspace, cli, scope]) {
|
|
132
|
+
const clearCacheMain = new ClearCacheMain(workspace);
|
|
133
|
+
cli.register(new (_clearCacheCmd().default)(clearCacheMain));
|
|
134
|
+
|
|
135
|
+
_action().ExternalActions.externalActions.push(new (_clearCacheAction().ClearCacheAction)(scope));
|
|
136
|
+
|
|
137
|
+
return clearCacheMain;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
exports.ClearCacheMain = ClearCacheMain;
|
|
143
|
+
(0, _defineProperty2().default)(ClearCacheMain, "slots", []);
|
|
144
|
+
(0, _defineProperty2().default)(ClearCacheMain, "dependencies", [_workspace().default, _cli().CLIAspect, _scope().default]);
|
|
145
|
+
(0, _defineProperty2().default)(ClearCacheMain, "runtime", _cli().MainRuntime);
|
|
146
|
+
|
|
147
|
+
_clearCache().ClearCacheAspect.addRuntime(ClearCacheMain);
|
|
148
|
+
|
|
149
|
+
//# sourceMappingURL=clear-cache.main.runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["clear-cache.main.runtime.ts"],"names":["ClearCacheMain","constructor","workspace","clearCache","clearRemoteCache","remote","remoteObj","consumer","result","action","ClearCacheAction","name","provider","cli","scope","clearCacheMain","register","ClearCacheCmd","ExternalActions","externalActions","push","WorkspaceAspect","CLIAspect","ScopeAspect","MainRuntime","ClearCacheAspect","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;;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;;AAEO,MAAMA,cAAN,CAAqB;AAC1BC,EAAAA,WAAW,CAASC,SAAT,EAAgC;AAAA,SAAvBA,SAAuB,GAAvBA,SAAuB;AAAE;;AAE7B,QAAVC,UAAU,GAAsB;AACpC,WAAO,6BAAP;AACD;;AAEqB,QAAhBC,gBAAgB,CAACC,MAAD,EAAiB;AAAA;;AACrC,UAAMC,SAAS,GAAG,MAAM,gCAAgBD,MAAhB,qBAAwB,KAAKH,SAA7B,oDAAwB,gBAAgBK,QAAxC,CAAxB;AACA,UAAMC,MAAM,GAAG,MAAMF,SAAS,CAACG,MAAV,CAAiBC,qCAAiBC,IAAlC,EAAwC,EAAxC,CAArB;AACA,WAAOH,MAAP;AACD;;AAKoB,eAARI,QAAQ,CAAC,CAACV,SAAD,EAAYW,GAAZ,EAAiBC,KAAjB,CAAD,EAA2D;AAC9E,UAAMC,cAAc,GAAG,IAAIf,cAAJ,CAAmBE,SAAnB,CAAvB;AACAW,IAAAA,GAAG,CAACG,QAAJ,CAAa,KAAIC,wBAAJ,EAAkBF,cAAlB,CAAb;;AACAG,8BAAgBC,eAAhB,CAAgCC,IAAhC,CAAqC,KAAIV,oCAAJ,EAAqBI,KAArB,CAArC;;AAEA,WAAOC,cAAP;AACD;;AAtByB;;;gCAAff,c,WAaI,E;gCAbJA,c,kBAcW,CAACqB,oBAAD,EAAkBC,gBAAlB,EAA6BC,gBAA7B,C;gCAdXvB,c,aAeMwB,kB;;AAUnBC,+BAAiBC,UAAjB,CAA4B1B,cAA5B","sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport { clearCache } from '@teambit/legacy/dist/api/consumer';\nimport { ExternalActions } from '@teambit/legacy/dist/api/scope/lib/action';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport ClearCacheCmd from './clear-cache-cmd';\nimport { ClearCacheAspect } from './clear-cache.aspect';\nimport { ClearCacheAction } from './clear-cache-action';\n\nexport class ClearCacheMain {\n constructor(private workspace?: Workspace) {}\n\n async clearCache(): Promise<string[]> {\n return clearCache();\n }\n\n async clearRemoteCache(remote: string) {\n const remoteObj = await getRemoteByName(remote, this.workspace?.consumer);\n const result = await remoteObj.action(ClearCacheAction.name, {});\n return result;\n }\n\n static slots = [];\n static dependencies = [WorkspaceAspect, CLIAspect, ScopeAspect];\n static runtime = MainRuntime;\n static async provider([workspace, cli, scope]: [Workspace, CLIMain, ScopeMain]) {\n const clearCacheMain = new ClearCacheMain(workspace);\n cli.register(new ClearCacheCmd(clearCacheMain));\n ExternalActions.externalActions.push(new ClearCacheAction(scope));\n\n return clearCacheMain;\n }\n}\n\nClearCacheAspect.addRuntime(ClearCacheMain);\n"]}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
|
|
14
|
+
function _clearCache() {
|
|
15
|
+
const data = require("./clear-cache.aspect");
|
|
16
|
+
|
|
17
|
+
_clearCache = function () {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var _default = _clearCache().ClearCacheAspect;
|
|
25
|
+
|
|
26
|
+
exports.default = _default;
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["ClearCacheAspect"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;eAGeA,8B","sourcesContent":["import { ClearCacheAspect } from './clear-cache.aspect';\n\nexport type { ClearCacheMain } from './clear-cache.main.runtime';\nexport default ClearCacheAspect;\nexport { ClearCacheAspect };\n"]}
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/clear-cache",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"componentId": {
|
|
6
|
+
"scope": "teambit.workspace",
|
|
7
|
+
"name": "clear-cache",
|
|
8
|
+
"version": "0.0.1"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"chalk": "2.4.2",
|
|
12
|
+
"@teambit/harmony": "0.2.11",
|
|
13
|
+
"@babel/runtime": "7.12.18",
|
|
14
|
+
"core-js": "^3.0.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/mocha": "5.2.7",
|
|
18
|
+
"@types/testing-library__jest-dom": "5.9.5",
|
|
19
|
+
"@types/jest": "^26.0.0",
|
|
20
|
+
"@types/react-dom": "^17.0.5",
|
|
21
|
+
"@types/react": "^17.0.8",
|
|
22
|
+
"@types/node": "12.20.4"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@teambit/legacy": "1.0.216",
|
|
26
|
+
"react-dom": "^16.8.0 || ^17.0.0",
|
|
27
|
+
"react": "^16.8.0 || ^17.0.0"
|
|
28
|
+
},
|
|
29
|
+
"license": "Apache-2.0",
|
|
30
|
+
"bit": {
|
|
31
|
+
"bindingPrefix": "@teambit",
|
|
32
|
+
"env": {},
|
|
33
|
+
"overrides": {
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@teambit/legacy": "-",
|
|
36
|
+
"@babel/runtime": "7.12.18",
|
|
37
|
+
"core-js": "^3.0.0",
|
|
38
|
+
"react-dom": "-",
|
|
39
|
+
"react": "-"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@teambit/legacy": "-",
|
|
43
|
+
"@types/mocha": "5.2.7",
|
|
44
|
+
"@types/testing-library__jest-dom": "5.9.5",
|
|
45
|
+
"@types/jest": "^26.0.0",
|
|
46
|
+
"@types/react-dom": "^17.0.5",
|
|
47
|
+
"@types/react": "^17.0.8",
|
|
48
|
+
"@types/node": "12.20.4",
|
|
49
|
+
"react-dom": "-",
|
|
50
|
+
"react": "-"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"@teambit/legacy": "1.0.216",
|
|
54
|
+
"react-dom": "^16.8.0 || ^17.0.0",
|
|
55
|
+
"react": "^16.8.0 || ^17.0.0"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"private": false,
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=12.22.0"
|
|
62
|
+
},
|
|
63
|
+
"repository": {
|
|
64
|
+
"type": "git",
|
|
65
|
+
"url": "https://github.com/teambit/bit"
|
|
66
|
+
},
|
|
67
|
+
"keywords": [
|
|
68
|
+
"bit",
|
|
69
|
+
"bit-aspect",
|
|
70
|
+
"components",
|
|
71
|
+
"collaboration",
|
|
72
|
+
"web",
|
|
73
|
+
"react",
|
|
74
|
+
"react-components",
|
|
75
|
+
"angular",
|
|
76
|
+
"angular-components",
|
|
77
|
+
"vue",
|
|
78
|
+
"vue-components"
|
|
79
|
+
]
|
|
80
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
"resolveJsonModule": true,
|
|
19
|
+
"composite": true,
|
|
20
|
+
"emitDeclarationOnly": true,
|
|
21
|
+
"outDir": "dist",
|
|
22
|
+
"experimentalDecorators": true,
|
|
23
|
+
"emitDecoratorMetadata": true,
|
|
24
|
+
"allowSyntheticDefaultImports": true,
|
|
25
|
+
"strictPropertyInitialization": false,
|
|
26
|
+
"strict": true,
|
|
27
|
+
"noImplicitAny": false,
|
|
28
|
+
"rootDir": ".",
|
|
29
|
+
"preserveConstEnums": true
|
|
30
|
+
},
|
|
31
|
+
"exclude": [
|
|
32
|
+
"dist"
|
|
33
|
+
]
|
|
34
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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
ADDED
|
@@ -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
|
+
}
|