@teambit/ripple 0.0.0-0fcea42669e4049189e0c52bcca222dabdc0c6fe

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,4 @@
1
+ import { RippleAspect } from './ripple.aspect';
2
+ export default RippleAspect;
3
+ export { RippleAspect };
4
+ export type { RippleMain } from './ripple.main.runtime';
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, "RippleAspect", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _ripple().RippleAspect;
10
+ }
11
+ });
12
+ exports.default = void 0;
13
+ function _ripple() {
14
+ const data = require("./ripple.aspect");
15
+ _ripple = function () {
16
+ return data;
17
+ };
18
+ return data;
19
+ }
20
+ var _default = exports.default = _ripple().RippleAspect;
21
+
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ripple","data","require","_default","exports","default","RippleAspect"],"sources":["index.ts"],"sourcesContent":["import { RippleAspect } from './ripple.aspect';\n\nexport default RippleAspect;\nexport { RippleAspect };\nexport type { RippleMain } from './ripple.main.runtime';\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEhCC,sBAAY","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ ;
2
+ ;
3
+
4
+ export const compositions = [];
5
+ export const overview = [];
6
+
7
+ export const compositions_metadata = {"compositions":[]};
@@ -0,0 +1,24 @@
1
+ import stripAnsi from 'strip-ansi';
2
+ import type { RippleMain } from './ripple.main.runtime';
3
+ export { stripAnsi };
4
+ export declare function colorPhase(phase?: string): string;
5
+ export declare function isFailedPhase(phase?: string): boolean;
6
+ /**
7
+ * strip "@hash" or "@version" suffix from a component ID.
8
+ * e.g. "scope/name@abc123" → "scope/name"
9
+ */
10
+ export declare function stripComponentVersion(id: string): string;
11
+ /**
12
+ * resolve a job ID from explicit argument, --lane flag, or auto-detected workspace lane.
13
+ * when no jobId is given, finds the latest job for the lane and optionally validates its phase.
14
+ */
15
+ export declare function resolveJobId(ripple: RippleMain, jobId: string | undefined, flags: {
16
+ lane?: string;
17
+ }, opts?: {
18
+ allowedPhases?: string[];
19
+ actionVerb?: string;
20
+ }): Promise<{
21
+ id: string;
22
+ } | {
23
+ error: string;
24
+ }>;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.colorPhase = colorPhase;
7
+ exports.isFailedPhase = isFailedPhase;
8
+ exports.resolveJobId = resolveJobId;
9
+ Object.defineProperty(exports, "stripAnsi", {
10
+ enumerable: true,
11
+ get: function () {
12
+ return _stripAnsi().default;
13
+ }
14
+ });
15
+ exports.stripComponentVersion = stripComponentVersion;
16
+ function _chalk() {
17
+ const data = _interopRequireDefault(require("chalk"));
18
+ _chalk = function () {
19
+ return data;
20
+ };
21
+ return data;
22
+ }
23
+ function _stripAnsi() {
24
+ const data = _interopRequireDefault(require("strip-ansi"));
25
+ _stripAnsi = function () {
26
+ return data;
27
+ };
28
+ return data;
29
+ }
30
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
31
+ function colorPhase(phase) {
32
+ if (!phase) return _chalk().default.yellow('unknown');
33
+ switch (phase.toUpperCase()) {
34
+ case 'SUCCESS':
35
+ return _chalk().default.green(phase);
36
+ case 'FAILED':
37
+ case 'FAILURE':
38
+ return _chalk().default.red(phase);
39
+ case 'RUNNING':
40
+ case 'IN_PROGRESS':
41
+ return _chalk().default.blue(phase);
42
+ case 'STOPPED':
43
+ case 'PAUSED':
44
+ return _chalk().default.gray(phase);
45
+ default:
46
+ return _chalk().default.yellow(phase);
47
+ }
48
+ }
49
+ function isFailedPhase(phase) {
50
+ const p = phase?.toUpperCase();
51
+ return p === 'FAILURE' || p === 'FAILED';
52
+ }
53
+
54
+ /**
55
+ * strip "@hash" or "@version" suffix from a component ID.
56
+ * e.g. "scope/name@abc123" → "scope/name"
57
+ */
58
+ function stripComponentVersion(id) {
59
+ const atIdx = id.indexOf('@');
60
+ return atIdx > 0 ? id.substring(0, atIdx) : id;
61
+ }
62
+
63
+ /**
64
+ * resolve a job ID from explicit argument, --lane flag, or auto-detected workspace lane.
65
+ * when no jobId is given, finds the latest job for the lane and optionally validates its phase.
66
+ */
67
+ async function resolveJobId(ripple, jobId, flags, opts) {
68
+ if (jobId) return {
69
+ id: jobId
70
+ };
71
+ const laneId = flags.lane || ripple.getCurrentLaneId();
72
+ if (!laneId) {
73
+ return {
74
+ error: 'Could not find a Ripple CI job. Provide a job ID, use --lane, or run from a workspace on a lane.'
75
+ };
76
+ }
77
+ const found = await ripple.findLatestJobForLane(laneId);
78
+ if (!found) {
79
+ return {
80
+ error: `No Ripple CI job found for lane "${laneId}".`
81
+ };
82
+ }
83
+ if (opts?.allowedPhases) {
84
+ const phase = found.status?.phase?.toUpperCase();
85
+ if (!opts.allowedPhases.includes(phase || '')) {
86
+ const verb = opts.actionVerb || 'act on';
87
+ return {
88
+ error: `Latest job for lane "${laneId}" is ${found.status?.phase || 'unknown'} (${found.id}), cannot ${verb}. Provide a specific job ID.`
89
+ };
90
+ }
91
+ }
92
+ return {
93
+ id: found.id
94
+ };
95
+ }
96
+
97
+ //# sourceMappingURL=ripple-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_stripAnsi","e","__esModule","default","colorPhase","phase","chalk","yellow","toUpperCase","green","red","blue","gray","isFailedPhase","p","stripComponentVersion","id","atIdx","indexOf","substring","resolveJobId","ripple","jobId","flags","opts","laneId","lane","getCurrentLaneId","error","found","findLatestJobForLane","allowedPhases","status","includes","verb","actionVerb"],"sources":["ripple-utils.ts"],"sourcesContent":["import chalk from 'chalk';\nimport stripAnsi from 'strip-ansi';\nimport type { RippleMain } from './ripple.main.runtime';\n\nexport { stripAnsi };\n\nexport function colorPhase(phase?: string): string {\n if (!phase) return chalk.yellow('unknown');\n switch (phase.toUpperCase()) {\n case 'SUCCESS':\n return chalk.green(phase);\n case 'FAILED':\n case 'FAILURE':\n return chalk.red(phase);\n case 'RUNNING':\n case 'IN_PROGRESS':\n return chalk.blue(phase);\n case 'STOPPED':\n case 'PAUSED':\n return chalk.gray(phase);\n default:\n return chalk.yellow(phase);\n }\n}\n\nexport function isFailedPhase(phase?: string): boolean {\n const p = phase?.toUpperCase();\n return p === 'FAILURE' || p === 'FAILED';\n}\n\n/**\n * strip \"@hash\" or \"@version\" suffix from a component ID.\n * e.g. \"scope/name@abc123\" → \"scope/name\"\n */\nexport function stripComponentVersion(id: string): string {\n const atIdx = id.indexOf('@');\n return atIdx > 0 ? id.substring(0, atIdx) : id;\n}\n\n/**\n * resolve a job ID from explicit argument, --lane flag, or auto-detected workspace lane.\n * when no jobId is given, finds the latest job for the lane and optionally validates its phase.\n */\nexport async function resolveJobId(\n ripple: RippleMain,\n jobId: string | undefined,\n flags: { lane?: string },\n opts?: { allowedPhases?: string[]; actionVerb?: string }\n): Promise<{ id: string } | { error: string }> {\n if (jobId) return { id: jobId };\n const laneId = flags.lane || ripple.getCurrentLaneId();\n if (!laneId) {\n return {\n error: 'Could not find a Ripple CI job. Provide a job ID, use --lane, or run from a workspace on a lane.',\n };\n }\n const found = await ripple.findLatestJobForLane(laneId);\n if (!found) {\n return { error: `No Ripple CI job found for lane \"${laneId}\".` };\n }\n if (opts?.allowedPhases) {\n const phase = found.status?.phase?.toUpperCase();\n if (!opts.allowedPhases.includes(phase || '')) {\n const verb = opts.actionVerb || 'act on';\n return {\n error: `Latest job for lane \"${laneId}\" is ${found.status?.phase || 'unknown'} (${found.id}), cannot ${verb}. Provide a specific job ID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aspect;
3
+ export default RippleAspect;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.RippleAspect = void 0;
7
+ function _harmony() {
8
+ const data = require("@teambit/harmony");
9
+ _harmony = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ const RippleAspect = exports.RippleAspect = _harmony().Aspect.create({
15
+ id: 'teambit.cloud/ripple'
16
+ });
17
+ var _default = exports.default = RippleAspect;
18
+
19
+ //# sourceMappingURL=ripple.aspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_harmony","data","require","RippleAspect","exports","Aspect","create","id","_default","default"],"sources":["ripple.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const RippleAspect = Aspect.create({\n id: 'teambit.cloud/ripple',\n});\n\nexport default RippleAspect;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EACxCC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAJ,OAAA,CAAAK,OAAA,GAEYN,YAAY","ignoreList":[]}
@@ -0,0 +1,171 @@
1
+ import type { Command, CommandOptions } from '@teambit/cli';
2
+ import type { RippleMain, RippleJob, CiGraphNode } from './ripple.main.runtime';
3
+ export declare class RippleCmd implements Command {
4
+ name: string;
5
+ description: string;
6
+ extendedDescription: string;
7
+ group: string;
8
+ skipWorkspace: boolean;
9
+ remoteOp: boolean;
10
+ options: CommandOptions;
11
+ commands: Command[];
12
+ report(): Promise<{
13
+ code: number;
14
+ data: string;
15
+ }>;
16
+ }
17
+ export declare class RippleListCmd implements Command {
18
+ private ripple;
19
+ name: string;
20
+ description: string;
21
+ skipWorkspace: boolean;
22
+ remoteOp: boolean;
23
+ alias: string;
24
+ options: CommandOptions;
25
+ constructor(ripple: RippleMain);
26
+ report(args: [], flags: {
27
+ all?: boolean;
28
+ owner?: string;
29
+ scope?: string;
30
+ lane?: string;
31
+ user?: string;
32
+ status?: string;
33
+ limit?: string;
34
+ }): Promise<string>;
35
+ json(args: [], flags: {
36
+ all?: boolean;
37
+ owner?: string;
38
+ scope?: string;
39
+ lane?: string;
40
+ user?: string;
41
+ status?: string;
42
+ limit?: string;
43
+ }): Promise<{
44
+ jobs: RippleJob[];
45
+ }>;
46
+ private getFilteredJobs;
47
+ }
48
+ export declare class RippleLogCmd implements Command {
49
+ private ripple;
50
+ name: string;
51
+ description: string;
52
+ skipWorkspace: boolean;
53
+ remoteOp: boolean;
54
+ alias: string;
55
+ options: CommandOptions;
56
+ arguments: {
57
+ name: string;
58
+ description: string;
59
+ }[];
60
+ constructor(ripple: RippleMain);
61
+ private resolveJob;
62
+ report([jobId]: [string], flags: {
63
+ lane?: string;
64
+ component?: string;
65
+ }): Promise<string>;
66
+ private appendComponentDetail;
67
+ private appendComponentList;
68
+ json([jobId]: [string], flags: {
69
+ lane?: string;
70
+ component?: string;
71
+ }): Promise<{
72
+ job: RippleJob & {
73
+ hash?: string;
74
+ ciGraph?: string;
75
+ ciComponentGraph?: string;
76
+ };
77
+ componentBuild: import("./ripple.main.runtime").ComponentBuildSummary | null;
78
+ } | {
79
+ job: (RippleJob & {
80
+ hash?: string;
81
+ ciGraph?: string;
82
+ ciComponentGraph?: string;
83
+ }) | null;
84
+ componentBuild?: undefined;
85
+ }>;
86
+ }
87
+ export declare class RippleErrorsCmd implements Command {
88
+ private ripple;
89
+ name: string;
90
+ description: string;
91
+ skipWorkspace: boolean;
92
+ remoteOp: boolean;
93
+ alias: string;
94
+ options: CommandOptions;
95
+ arguments: {
96
+ name: string;
97
+ description: string;
98
+ }[];
99
+ constructor(ripple: RippleMain);
100
+ report([jobId]: [string], flags: {
101
+ lane?: string;
102
+ log?: boolean;
103
+ }): Promise<string>;
104
+ json([jobId]: [string], flags: {
105
+ lane?: string;
106
+ log?: boolean;
107
+ }): Promise<{
108
+ error: string;
109
+ job: null;
110
+ ciNodes: never[];
111
+ containerLogs: {};
112
+ } | {
113
+ job: any;
114
+ ciNodes: CiGraphNode[];
115
+ containerLogs: Record<string, string[]>;
116
+ error?: undefined;
117
+ }>;
118
+ private getErrors;
119
+ }
120
+ export declare class RippleRetryCmd implements Command {
121
+ private ripple;
122
+ name: string;
123
+ description: string;
124
+ skipWorkspace: boolean;
125
+ remoteOp: boolean;
126
+ alias: string;
127
+ options: CommandOptions;
128
+ arguments: {
129
+ name: string;
130
+ description: string;
131
+ }[];
132
+ constructor(ripple: RippleMain);
133
+ report([jobId]: [string], flags: {
134
+ lane?: string;
135
+ }): Promise<string>;
136
+ json([jobId]: [string], flags: {
137
+ lane?: string;
138
+ }): Promise<{
139
+ error: string;
140
+ job?: undefined;
141
+ } | {
142
+ job: RippleJob | null;
143
+ error?: undefined;
144
+ }>;
145
+ }
146
+ export declare class RippleStopCmd implements Command {
147
+ private ripple;
148
+ name: string;
149
+ description: string;
150
+ skipWorkspace: boolean;
151
+ remoteOp: boolean;
152
+ alias: string;
153
+ options: CommandOptions;
154
+ arguments: {
155
+ name: string;
156
+ description: string;
157
+ }[];
158
+ constructor(ripple: RippleMain);
159
+ report([jobId]: [string], flags: {
160
+ lane?: string;
161
+ }): Promise<string>;
162
+ json([jobId]: [string], flags: {
163
+ lane?: string;
164
+ }): Promise<{
165
+ error: string;
166
+ job?: undefined;
167
+ } | {
168
+ job: RippleJob | null;
169
+ error?: undefined;
170
+ }>;
171
+ }