@teambit/scope 1.0.318 → 1.0.320

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.
Files changed (47) hide show
  1. package/artifacts/__bit_junit.xml +1 -1
  2. package/artifacts/preview/teambit_scope_scope-preview.js +1 -1
  3. package/artifacts/schema.json +1528 -1528
  4. package/debug-commands/cat-component-cmd.ts +23 -0
  5. package/debug-commands/cat-component.ts +21 -0
  6. package/debug-commands/cat-lane-cmd.ts +17 -0
  7. package/debug-commands/cat-lane.ts +12 -0
  8. package/debug-commands/cat-object-cmd.ts +24 -0
  9. package/debug-commands/cat-object.ts +12 -0
  10. package/debug-commands/cat-scope-cmd.ts +45 -0
  11. package/debug-commands/cat-scope.ts +10 -0
  12. package/dist/debug-commands/cat-component-cmd.d.ts +11 -0
  13. package/dist/debug-commands/cat-component-cmd.js +38 -0
  14. package/dist/debug-commands/cat-component-cmd.js.map +1 -0
  15. package/dist/debug-commands/cat-component.d.ts +1 -0
  16. package/dist/debug-commands/cat-component.js +39 -0
  17. package/dist/debug-commands/cat-component.js.map +1 -0
  18. package/dist/debug-commands/cat-lane-cmd.d.ts +11 -0
  19. package/dist/debug-commands/cat-lane-cmd.js +34 -0
  20. package/dist/debug-commands/cat-lane-cmd.js.map +1 -0
  21. package/dist/debug-commands/cat-lane.d.ts +17 -0
  22. package/dist/debug-commands/cat-lane.js +31 -0
  23. package/dist/debug-commands/cat-lane.js.map +1 -0
  24. package/dist/debug-commands/cat-object-cmd.d.ts +15 -0
  25. package/dist/debug-commands/cat-object-cmd.js +38 -0
  26. package/dist/debug-commands/cat-object-cmd.js.map +1 -0
  27. package/dist/debug-commands/cat-object.d.ts +1 -0
  28. package/dist/debug-commands/cat-object.js +25 -0
  29. package/dist/debug-commands/cat-object.js.map +1 -0
  30. package/dist/debug-commands/cat-scope-cmd.d.ts +18 -0
  31. package/dist/debug-commands/cat-scope-cmd.js +71 -0
  32. package/dist/debug-commands/cat-scope-cmd.js.map +1 -0
  33. package/dist/debug-commands/cat-scope.d.ts +2 -0
  34. package/dist/debug-commands/cat-scope.js +26 -0
  35. package/dist/debug-commands/cat-scope.js.map +1 -0
  36. package/dist/{preview-1719544843434.js → preview-1719717687832.js} +2 -2
  37. package/dist/run-action/run-action.cmd.d.ts +10 -0
  38. package/dist/run-action/run-action.cmd.js +34 -0
  39. package/dist/run-action/run-action.cmd.js.map +1 -0
  40. package/dist/run-action/run-action.d.ts +1 -0
  41. package/dist/run-action/run-action.js +28 -0
  42. package/dist/run-action/run-action.js.map +1 -0
  43. package/dist/scope.main.runtime.js +37 -1
  44. package/dist/scope.main.runtime.js.map +1 -1
  45. package/package.json +21 -19
  46. package/run-action/run-action.cmd.ts +17 -0
  47. package/run-action/run-action.ts +9 -0
@@ -0,0 +1,17 @@
1
+ import { runAction } from './run-action';
2
+ import { Command, CommandOptions } from '@teambit/cli';
3
+
4
+ export class RunActionCmd implements Command {
5
+ name = 'run-action <action-name> <remote> <options>';
6
+ description = 'run an action on a remote';
7
+ private = true;
8
+ alias = '';
9
+ options = [] as CommandOptions;
10
+ loadAspects = false;
11
+
12
+ async report([actionName, remote, options]: [string, string, string]) {
13
+ const optionsParsed = JSON.parse(options);
14
+ const result = await runAction(actionName, remote, optionsParsed);
15
+ return result || '';
16
+ }
17
+ }
@@ -0,0 +1,9 @@
1
+ import { loadScope, Scope } from '@teambit/legacy/dist/scope';
2
+ import { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';
3
+
4
+ export async function runAction(actionName: string, remote: string, options = {}): Promise<any> {
5
+ const scope: Scope = await loadScope();
6
+ const scopeRemotes = await getScopeRemotes(scope);
7
+ const remoteObj = await scopeRemotes.resolve(remote, scope);
8
+ return remoteObj.action(actionName, options);
9
+ }