@teambit/scope 1.0.403 → 1.0.405
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_scope_scope-preview.js +1 -1
- package/artifacts/schema.json +1548 -1548
- package/dist/_scope-garbage-collector.cmd.d.ts +19 -0
- package/dist/_scope-garbage-collector.cmd.js +32 -0
- package/dist/_scope-garbage-collector.cmd.js.map +1 -0
- package/dist/{preview-1725971117135.js → preview-1726111354925.js} +2 -2
- package/dist/scope.main.runtime.js +10 -1
- package/dist/scope.main.runtime.js.map +1 -1
- package/package.json +20 -20
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import { GarbageCollectorOpts } from '@teambit/legacy/dist/scope/scope';
|
|
3
|
+
import { ScopeMain } from './scope.main.runtime';
|
|
4
|
+
/**
|
|
5
|
+
* private command. the underscore prefix is intended.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ScopeGarbageCollectorCmd implements Command {
|
|
8
|
+
private scope;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
extendedDescription: string;
|
|
12
|
+
alias: string;
|
|
13
|
+
options: CommandOptions;
|
|
14
|
+
loader: boolean;
|
|
15
|
+
private: boolean;
|
|
16
|
+
remoteOp: boolean;
|
|
17
|
+
constructor(scope: ScopeMain);
|
|
18
|
+
report(_args: any, opts: GarbageCollectorOpts): Promise<string>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ScopeGarbageCollectorCmd = void 0;
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
|
+
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); }
|
|
10
|
+
/**
|
|
11
|
+
* private command. the underscore prefix is intended.
|
|
12
|
+
*/
|
|
13
|
+
class ScopeGarbageCollectorCmd {
|
|
14
|
+
constructor(scope) {
|
|
15
|
+
this.scope = scope;
|
|
16
|
+
_defineProperty(this, "name", '_scope-gc');
|
|
17
|
+
_defineProperty(this, "description", `delete objects that have no reference from the components/lanes of this scope`);
|
|
18
|
+
_defineProperty(this, "extendedDescription", 'the deleted objects are copied into "deleted-objects" directory in the local scope');
|
|
19
|
+
_defineProperty(this, "alias", '');
|
|
20
|
+
_defineProperty(this, "options", [['v', 'verbose', 'show verbose output'], ['d', 'dry-run', 'print the refs that are going to be deleted without actually deleting them'], ['f', 'find-comp-id-origin <comp-id>', 'find the origin of a specific component'], ['f', 'find-scope-id-origin <scope-id>', 'find the origin of all components of the given scope'], ['r', 'restore', 'restore deleted objects (copy objects from "deleted-objects" directory to the scope)'], ['', 'restore-overwrite', 'same as --restore but overwrite existing objects']]);
|
|
21
|
+
_defineProperty(this, "loader", true);
|
|
22
|
+
_defineProperty(this, "private", true);
|
|
23
|
+
_defineProperty(this, "remoteOp", true);
|
|
24
|
+
}
|
|
25
|
+
async report(_args, opts) {
|
|
26
|
+
await this.scope.legacyScope.garbageCollect(opts);
|
|
27
|
+
return `completed successfully`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ScopeGarbageCollectorCmd = ScopeGarbageCollectorCmd;
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=_scope-garbage-collector.cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ScopeGarbageCollectorCmd","constructor","scope","_defineProperty","report","_args","opts","legacyScope","garbageCollect","exports"],"sources":["_scope-garbage-collector.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { GarbageCollectorOpts } from '@teambit/legacy/dist/scope/scope';\nimport { ScopeMain } from './scope.main.runtime';\n\n/**\n * private command. the underscore prefix is intended.\n */\nexport class ScopeGarbageCollectorCmd implements Command {\n name = '_scope-gc';\n description = `delete objects that have no reference from the components/lanes of this scope`;\n extendedDescription = 'the deleted objects are copied into \"deleted-objects\" directory in the local scope';\n alias = '';\n options = [\n ['v', 'verbose', 'show verbose output'],\n ['d', 'dry-run', 'print the refs that are going to be deleted without actually deleting them'],\n ['f', 'find-comp-id-origin <comp-id>', 'find the origin of a specific component'],\n ['f', 'find-scope-id-origin <scope-id>', 'find the origin of all components of the given scope'],\n ['r', 'restore', 'restore deleted objects (copy objects from \"deleted-objects\" directory to the scope)'],\n ['', 'restore-overwrite', 'same as --restore but overwrite existing objects'],\n ] as CommandOptions;\n loader = true;\n private = true;\n remoteOp = true;\n\n constructor(private scope: ScopeMain) {}\n\n async report(_args, opts: GarbageCollectorOpts): Promise<string> {\n await this.scope.legacyScope.garbageCollect(opts);\n return `completed successfully`;\n }\n}\n"],"mappings":";;;;;;;;;AAIA;AACA;AACA;AACO,MAAMA,wBAAwB,CAAoB;EAiBvDC,WAAWA,CAASC,KAAgB,EAAE;IAAA,KAAlBA,KAAgB,GAAhBA,KAAgB;IAAAC,eAAA,eAhB7B,WAAW;IAAAA,eAAA,sBACJ,+EAA+E;IAAAA,eAAA,8BACvE,oFAAoF;IAAAA,eAAA,gBAClG,EAAE;IAAAA,eAAA,kBACA,CACR,CAAC,GAAG,EAAE,SAAS,EAAE,qBAAqB,CAAC,EACvC,CAAC,GAAG,EAAE,SAAS,EAAE,4EAA4E,CAAC,EAC9F,CAAC,GAAG,EAAE,+BAA+B,EAAE,yCAAyC,CAAC,EACjF,CAAC,GAAG,EAAE,iCAAiC,EAAE,sDAAsD,CAAC,EAChG,CAAC,GAAG,EAAE,SAAS,EAAE,sFAAsF,CAAC,EACxG,CAAC,EAAE,EAAE,mBAAmB,EAAE,kDAAkD,CAAC,CAC9E;IAAAA,eAAA,iBACQ,IAAI;IAAAA,eAAA,kBACH,IAAI;IAAAA,eAAA,mBACH,IAAI;EAEwB;EAEvC,MAAMC,MAAMA,CAACC,KAAK,EAAEC,IAA0B,EAAmB;IAC/D,MAAM,IAAI,CAACJ,KAAK,CAACK,WAAW,CAACC,cAAc,CAACF,IAAI,CAAC;IACjD,OAAO,wBAAwB;EACjC;AACF;AAACG,OAAA,CAAAT,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_scope@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_scope@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_scope@1.0.405/dist/scope.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_scope@1.0.405/dist/scope.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -382,6 +382,13 @@ function _runAction() {
|
|
|
382
382
|
};
|
|
383
383
|
return data;
|
|
384
384
|
}
|
|
385
|
+
function _scopeGarbageCollector() {
|
|
386
|
+
const data = require("./_scope-garbage-collector.cmd");
|
|
387
|
+
_scopeGarbageCollector = function () {
|
|
388
|
+
return data;
|
|
389
|
+
};
|
|
390
|
+
return data;
|
|
391
|
+
}
|
|
385
392
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
386
393
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
387
394
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -1274,13 +1281,15 @@ class ScopeMain {
|
|
|
1274
1281
|
static async provider([componentExt, ui, graphql, cli, isolator, aspectLoader, express, loggerMain, envs, depsResolver, globalConfig], config, [postPutSlot, postDeleteSlot, postExportSlot, postObjectsPersistSlot, preFetchObjectsSlot, OnCompAspectReCalcSlot], harmony) {
|
|
1275
1282
|
const bitConfig = harmony.config.get('teambit.harmony/bit');
|
|
1276
1283
|
const debugCommands = [new (_catScopeCmd().CatScopeCmd)(), new (_catComponentCmd().CatComponentCmd)(), new (_catObjectCmd().default)(), new (_catLaneCmd().default)()];
|
|
1277
|
-
|
|
1284
|
+
const allCommands = [new (_scopeCmd().ScopeCmd)(), ...debugCommands, new (_runAction().RunActionCmd)()];
|
|
1278
1285
|
const legacyScope = await (0, _scopeLoader().loadScopeIfExist)(bitConfig?.cwd);
|
|
1279
1286
|
if (!legacyScope) {
|
|
1287
|
+
cli.register(...allCommands);
|
|
1280
1288
|
return undefined;
|
|
1281
1289
|
}
|
|
1282
1290
|
const logger = loggerMain.createLogger(_scope2().ScopeAspect.id);
|
|
1283
1291
|
const scope = new ScopeMain(harmony, legacyScope, componentExt, config, postPutSlot, postDeleteSlot, postExportSlot, postObjectsPersistSlot, preFetchObjectsSlot, OnCompAspectReCalcSlot, isolator, aspectLoader, logger, envs, depsResolver, globalConfig);
|
|
1292
|
+
cli.register(...allCommands, new (_scopeGarbageCollector().ScopeGarbageCollectorCmd)(scope));
|
|
1284
1293
|
cli.registerOnStart(async hasWorkspace => {
|
|
1285
1294
|
if (hasWorkspace) return;
|
|
1286
1295
|
await scope.loadAspects(aspectLoader.getNotLoadedConfiguredExtensions(), undefined, 'scope.cli.registerOnStart');
|