@teambit/ripple 0.0.0-00ad897e742f2a0c76f3f48e46d69e13bfc07a2e
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/.npmignore +18 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/preview-1784578132641.js +7 -0
- package/dist/ripple-utils.d.ts +35 -0
- package/dist/ripple-utils.js +143 -0
- package/dist/ripple-utils.js.map +1 -0
- package/dist/ripple.aspect.d.ts +3 -0
- package/dist/ripple.aspect.js +19 -0
- package/dist/ripple.aspect.js.map +1 -0
- package/dist/ripple.cmd.d.ts +172 -0
- package/dist/ripple.cmd.js +635 -0
- package/dist/ripple.cmd.js.map +1 -0
- package/dist/ripple.main.runtime.d.ts +126 -0
- package/dist/ripple.main.runtime.js +448 -0
- package/dist/ripple.main.runtime.js.map +1 -0
- package/package.json +59 -0
- package/types/asset.d.ts +41 -0
- package/types/style.d.ts +46 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RippleMain = void 0;
|
|
7
|
+
function _cli() {
|
|
8
|
+
const data = require("@teambit/cli");
|
|
9
|
+
_cli = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _logger() {
|
|
15
|
+
const data = require("@teambit/logger");
|
|
16
|
+
_logger = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _cloud() {
|
|
22
|
+
const data = require("@teambit/cloud");
|
|
23
|
+
_cloud = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _workspace() {
|
|
29
|
+
const data = require("@teambit/workspace");
|
|
30
|
+
_workspace = function () {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
function _legacy() {
|
|
36
|
+
const data = require("@teambit/legacy.constants");
|
|
37
|
+
_legacy = function () {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
function _export() {
|
|
43
|
+
const data = require("@teambit/export");
|
|
44
|
+
_export = function () {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
function _rippleUtils() {
|
|
50
|
+
const data = require("./ripple-utils");
|
|
51
|
+
_rippleUtils = function () {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
56
|
+
function _stripAnsi() {
|
|
57
|
+
const data = _interopRequireDefault(require("strip-ansi"));
|
|
58
|
+
_stripAnsi = function () {
|
|
59
|
+
return data;
|
|
60
|
+
};
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
63
|
+
function _ripple() {
|
|
64
|
+
const data = require("./ripple.aspect");
|
|
65
|
+
_ripple = function () {
|
|
66
|
+
return data;
|
|
67
|
+
};
|
|
68
|
+
return data;
|
|
69
|
+
}
|
|
70
|
+
function _ripple2() {
|
|
71
|
+
const data = require("./ripple.cmd");
|
|
72
|
+
_ripple2 = function () {
|
|
73
|
+
return data;
|
|
74
|
+
};
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
78
|
+
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; }
|
|
79
|
+
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; }
|
|
80
|
+
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; }
|
|
81
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
82
|
+
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); }
|
|
83
|
+
class RippleMain {
|
|
84
|
+
constructor(cloud, logger, workspace) {
|
|
85
|
+
this.cloud = cloud;
|
|
86
|
+
this.logger = logger;
|
|
87
|
+
this.workspace = workspace;
|
|
88
|
+
}
|
|
89
|
+
ensureAuthenticated() {
|
|
90
|
+
if (!this.cloud.getAuthToken()) {
|
|
91
|
+
throw new Error('You are not logged in. Please run "bit login" first.');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async fetchRippleGQL(query, variables) {
|
|
95
|
+
this.ensureAuthenticated();
|
|
96
|
+
const graphqlUrl = `${this.cloud.getCloudApi()}/graphql`;
|
|
97
|
+
const body = JSON.stringify({
|
|
98
|
+
query,
|
|
99
|
+
variables
|
|
100
|
+
});
|
|
101
|
+
const headers = _objectSpread({
|
|
102
|
+
'Content-Type': 'application/json'
|
|
103
|
+
}, this.cloud.getAuthHeader());
|
|
104
|
+
const response = await fetch(graphqlUrl, {
|
|
105
|
+
method: 'POST',
|
|
106
|
+
headers,
|
|
107
|
+
body
|
|
108
|
+
});
|
|
109
|
+
if (!response.ok) {
|
|
110
|
+
const text = await response.text().catch(() => '');
|
|
111
|
+
throw new Error(`Ripple CI API returned HTTP ${response.status}: ${text}`);
|
|
112
|
+
}
|
|
113
|
+
const json = await response.json();
|
|
114
|
+
if (json.errors?.length) {
|
|
115
|
+
const messages = json.errors.map(e => e.message).join(', ');
|
|
116
|
+
throw new Error(`Ripple CI API error: ${messages}`);
|
|
117
|
+
}
|
|
118
|
+
return json.data ?? null;
|
|
119
|
+
}
|
|
120
|
+
async listJobs(opts) {
|
|
121
|
+
const data = await this.fetchRippleGQL(RippleMain.LIST_JOBS, {
|
|
122
|
+
filters: opts.filters,
|
|
123
|
+
limit: opts.limit ?? 20,
|
|
124
|
+
offset: opts.offset
|
|
125
|
+
});
|
|
126
|
+
return data?.listJobs ?? [];
|
|
127
|
+
}
|
|
128
|
+
async getJob(jobId) {
|
|
129
|
+
const data = await this.fetchRippleGQL(RippleMain.GET_JOB, {
|
|
130
|
+
jobId
|
|
131
|
+
});
|
|
132
|
+
return data?.getJob ?? null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* parse a job's ciGraph (internal graph) to extract per-node build status.
|
|
137
|
+
* ciGraph has the job-specific build results (unlike ciComponentGraph which is static).
|
|
138
|
+
* each node represents a build container that builds one or more components.
|
|
139
|
+
*/
|
|
140
|
+
getCiGraphNodes(job) {
|
|
141
|
+
if (!job.ciGraph) return [];
|
|
142
|
+
try {
|
|
143
|
+
const graph = JSON.parse(job.ciGraph);
|
|
144
|
+
if (!graph.nodes) return [];
|
|
145
|
+
return graph.nodes.map(node => {
|
|
146
|
+
const attr = typeof node.attr === 'string' ? JSON.parse(node.attr) : node.attr;
|
|
147
|
+
const ids = (attr.ids || []).map(id => (0, _rippleUtils().stripComponentVersion)(id));
|
|
148
|
+
return {
|
|
149
|
+
componentIds: ids,
|
|
150
|
+
containerName: attr.status?.name || node.id,
|
|
151
|
+
phase: attr.status?.phase || 'UNKNOWN'
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
} catch {
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
async getComponentBuildSummary(jobId, componentId) {
|
|
159
|
+
const data = await this.fetchRippleGQL(RippleMain.GET_COMPONENT_BUILD_SUMMARY, {
|
|
160
|
+
jobId,
|
|
161
|
+
componentId
|
|
162
|
+
});
|
|
163
|
+
return data?.getComponentBuildSummary ?? null;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* fetch build logs for a specific container in a job via the REST SSE endpoint.
|
|
168
|
+
* uses an idle timeout to detect end-of-stream (SSE connections may not close).
|
|
169
|
+
*/
|
|
170
|
+
async getContainerLog(jobId, containerName) {
|
|
171
|
+
this.ensureAuthenticated();
|
|
172
|
+
const url = `${this.cloud.getCloudApi()}/ripple-ci/api/job/log/${jobId}/${containerName}`;
|
|
173
|
+
const headers = _objectSpread({
|
|
174
|
+
Accept: 'text/event-stream'
|
|
175
|
+
}, this.cloud.getAuthHeader());
|
|
176
|
+
const controller = new AbortController();
|
|
177
|
+
// hard cap to avoid hanging forever
|
|
178
|
+
const hardTimeout = setTimeout(() => controller.abort(), 30_000);
|
|
179
|
+
const messages = [];
|
|
180
|
+
let idleTimer;
|
|
181
|
+
try {
|
|
182
|
+
const response = await fetch(url, {
|
|
183
|
+
headers,
|
|
184
|
+
signal: controller.signal
|
|
185
|
+
});
|
|
186
|
+
if (!response.ok || !response.body) {
|
|
187
|
+
clearTimeout(hardTimeout);
|
|
188
|
+
return [];
|
|
189
|
+
}
|
|
190
|
+
const reader = response.body.getReader();
|
|
191
|
+
const decoder = new TextDecoder();
|
|
192
|
+
let buffer = '';
|
|
193
|
+
const resetIdle = () => {
|
|
194
|
+
if (idleTimer) clearTimeout(idleTimer);
|
|
195
|
+
idleTimer = setTimeout(() => controller.abort(), 3_000);
|
|
196
|
+
};
|
|
197
|
+
resetIdle();
|
|
198
|
+
// eslint-disable-next-line no-constant-condition
|
|
199
|
+
while (true) {
|
|
200
|
+
// eslint-disable-next-line no-await-in-loop
|
|
201
|
+
const {
|
|
202
|
+
done,
|
|
203
|
+
value
|
|
204
|
+
} = await reader.read();
|
|
205
|
+
if (done) break;
|
|
206
|
+
resetIdle();
|
|
207
|
+
buffer += decoder.decode(value, {
|
|
208
|
+
stream: true
|
|
209
|
+
});
|
|
210
|
+
const lines = buffer.split('\n');
|
|
211
|
+
buffer = lines.pop() || '';
|
|
212
|
+
for (const line of lines) {
|
|
213
|
+
if (!line.startsWith('data: ')) continue;
|
|
214
|
+
try {
|
|
215
|
+
const parsed = JSON.parse(line.substring(6));
|
|
216
|
+
if (parsed.message != null) messages.push(parsed.message);
|
|
217
|
+
} catch {
|
|
218
|
+
// skip malformed lines
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
} catch (err) {
|
|
223
|
+
if (err?.name !== 'AbortError') {
|
|
224
|
+
this.logger.warn(`Failed to fetch container log: ${err?.message}`);
|
|
225
|
+
}
|
|
226
|
+
} finally {
|
|
227
|
+
if (idleTimer) clearTimeout(idleTimer);
|
|
228
|
+
clearTimeout(hardTimeout);
|
|
229
|
+
}
|
|
230
|
+
return messages;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* fetch build logs for multiple containers in parallel.
|
|
235
|
+
*/
|
|
236
|
+
async getContainerLogs(jobId, containerNames) {
|
|
237
|
+
const results = await Promise.allSettled(containerNames.map(async name => {
|
|
238
|
+
const log = await this.getContainerLog(jobId, name);
|
|
239
|
+
return {
|
|
240
|
+
name,
|
|
241
|
+
log
|
|
242
|
+
};
|
|
243
|
+
}));
|
|
244
|
+
const logMap = new Map();
|
|
245
|
+
for (const result of results) {
|
|
246
|
+
if (result.status === 'fulfilled') {
|
|
247
|
+
logMap.set(result.value.name, result.value.log);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return logMap;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* extract the error section from container log messages.
|
|
255
|
+
* looks for common error patterns in the build output.
|
|
256
|
+
*/
|
|
257
|
+
extractErrorsFromLog(messages) {
|
|
258
|
+
const patterns = ['errors were found', 'Failed task', 'threw an error', 'Error:', 'FAIL'];
|
|
259
|
+
for (const pattern of patterns) {
|
|
260
|
+
const idx = messages.findIndex(m => (0, _stripAnsi().default)(m).includes(pattern));
|
|
261
|
+
if (idx >= 0) {
|
|
262
|
+
return messages.slice(idx);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
// last resort: grab the last 30 lines if the log has content
|
|
266
|
+
if (messages.length > 0) {
|
|
267
|
+
return messages.slice(-30);
|
|
268
|
+
}
|
|
269
|
+
return [];
|
|
270
|
+
}
|
|
271
|
+
async retryJob(jobId) {
|
|
272
|
+
const data = await this.fetchRippleGQL(RippleMain.RETRY_JOB, {
|
|
273
|
+
jobId
|
|
274
|
+
});
|
|
275
|
+
return data?.retryJob ?? null;
|
|
276
|
+
}
|
|
277
|
+
async stopJob(jobId) {
|
|
278
|
+
const data = await this.fetchRippleGQL(RippleMain.STOP_JOB, {
|
|
279
|
+
jobId
|
|
280
|
+
});
|
|
281
|
+
return data?.stopJob ?? null;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* detect the current lane from the workspace.
|
|
286
|
+
* returns the laneId in "scope/lane-name" format, or undefined if not on a lane.
|
|
287
|
+
*/
|
|
288
|
+
getCurrentLaneId() {
|
|
289
|
+
if (!this.workspace) return undefined;
|
|
290
|
+
const laneId = this.workspace.getCurrentLaneId();
|
|
291
|
+
if (!laneId || laneId.isDefault()) return undefined;
|
|
292
|
+
return laneId.toString();
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* read the last-export.json written by ExportMain after a successful export.
|
|
297
|
+
* used to auto-resolve the ripple job when the user is on main (no current lane).
|
|
298
|
+
*/
|
|
299
|
+
async getLastExport() {
|
|
300
|
+
if (!this.workspace) return null;
|
|
301
|
+
return (0, _export().readLastExport)(this.workspace.scope.path);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* the central-hub returns url slugs in `metadata.jobs`, not the GraphQL job ids accepted by getJob(jobId).
|
|
306
|
+
* the schema also supports getJob(slug: ID!), which we use here to fetch the job directly from a slug.
|
|
307
|
+
*/
|
|
308
|
+
async getJobBySlug(slug) {
|
|
309
|
+
const data = await this.fetchRippleGQL(RippleMain.GET_JOB_BY_SLUG, {
|
|
310
|
+
slug
|
|
311
|
+
});
|
|
312
|
+
return data?.getJob ?? null;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* find the latest job for a given laneId, optionally filtered by status phase.
|
|
317
|
+
*/
|
|
318
|
+
async findLatestJobForLane(laneId, phase) {
|
|
319
|
+
const filters = {
|
|
320
|
+
lanes: [laneId]
|
|
321
|
+
};
|
|
322
|
+
if (phase) {
|
|
323
|
+
filters.status = phase;
|
|
324
|
+
}
|
|
325
|
+
const jobs = await this.listJobs({
|
|
326
|
+
filters,
|
|
327
|
+
limit: 1
|
|
328
|
+
});
|
|
329
|
+
return jobs[0] ?? null;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* detect the workspace owner from the workspace defaultScope.
|
|
334
|
+
*/
|
|
335
|
+
getDefaultOwner() {
|
|
336
|
+
const defaultScope = this.workspace?.defaultScope;
|
|
337
|
+
if (!defaultScope?.includes('.')) return undefined;
|
|
338
|
+
return defaultScope.split('.')[0];
|
|
339
|
+
}
|
|
340
|
+
getJobUrl(job) {
|
|
341
|
+
// the bit.cloud UI resolves the /ripple-ci/job/<id-or-slug> segment by slug;
|
|
342
|
+
// job.id (a uuid) returns "No CI job found", so prefer slug when present.
|
|
343
|
+
const segment = job.slug || job.id;
|
|
344
|
+
if (job.laneId) {
|
|
345
|
+
// laneId format: "scope/lane-name", e.g. "att-bit.duc/my-lane"
|
|
346
|
+
const [scope, ...laneParts] = job.laneId.split('/');
|
|
347
|
+
const laneName = laneParts.join('/');
|
|
348
|
+
if (scope && laneName) {
|
|
349
|
+
return `https://${(0, _legacy().getCloudDomain)()}/${scope.split('.').join('/')}/~lane/${laneName}/~ripple-ci/job/${segment}`;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return `https://${(0, _legacy().getCloudDomain)()}/ripple-ci/job/${segment}`;
|
|
353
|
+
}
|
|
354
|
+
static async provider([cli, cloud, loggerAspect, workspace]) {
|
|
355
|
+
const logger = loggerAspect.createLogger(_ripple().RippleAspect.id);
|
|
356
|
+
const ripple = new RippleMain(cloud, logger, workspace);
|
|
357
|
+
const rippleCmd = new (_ripple2().RippleCmd)();
|
|
358
|
+
rippleCmd.commands = [new (_ripple2().RippleListCmd)(ripple), new (_ripple2().RippleLogCmd)(ripple), new (_ripple2().RippleErrorsCmd)(ripple), new (_ripple2().RippleRetryCmd)(ripple), new (_ripple2().RippleStopCmd)(ripple)];
|
|
359
|
+
cli.register(rippleCmd);
|
|
360
|
+
return ripple;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
exports.RippleMain = RippleMain;
|
|
364
|
+
_defineProperty(RippleMain, "runtime", _cli().MainRuntime);
|
|
365
|
+
_defineProperty(RippleMain, "dependencies", [_cli().CLIAspect, _cloud().CloudAspect, _logger().LoggerAspect, _workspace().WorkspaceAspect]);
|
|
366
|
+
_defineProperty(RippleMain, "LIST_JOBS", `
|
|
367
|
+
query listJobs($filters: FilterOptions, $limit: Int, $offset: Int) {
|
|
368
|
+
listJobs(filters: $filters, limit: $limit, offset: $offset) {
|
|
369
|
+
id
|
|
370
|
+
name
|
|
371
|
+
laneId
|
|
372
|
+
simulation
|
|
373
|
+
user { username displayName }
|
|
374
|
+
status { startedAt finishedAt phase }
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
`);
|
|
378
|
+
_defineProperty(RippleMain, "GET_JOB", `
|
|
379
|
+
query getJob($jobId: ID!) {
|
|
380
|
+
getJob(jobId: $jobId) {
|
|
381
|
+
id
|
|
382
|
+
slug
|
|
383
|
+
name
|
|
384
|
+
laneId
|
|
385
|
+
hash
|
|
386
|
+
simulation
|
|
387
|
+
user { username displayName }
|
|
388
|
+
status { startedAt finishedAt phase }
|
|
389
|
+
ciGraph
|
|
390
|
+
ciComponentGraph
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
`);
|
|
394
|
+
_defineProperty(RippleMain, "GET_JOB_BY_SLUG", `
|
|
395
|
+
query getJobBySlug($slug: ID!) {
|
|
396
|
+
getJob(slug: $slug) {
|
|
397
|
+
id
|
|
398
|
+
slug
|
|
399
|
+
name
|
|
400
|
+
laneId
|
|
401
|
+
hash
|
|
402
|
+
simulation
|
|
403
|
+
user { username displayName }
|
|
404
|
+
status { startedAt finishedAt phase }
|
|
405
|
+
ciGraph
|
|
406
|
+
ciComponentGraph
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
`);
|
|
410
|
+
_defineProperty(RippleMain, "GET_COMPONENT_BUILD_SUMMARY", `
|
|
411
|
+
query getComponentBuildSummary($jobId: ID!, $componentId: String!) {
|
|
412
|
+
getComponentBuildSummary(jobId: $jobId, componentId: $componentId) {
|
|
413
|
+
id
|
|
414
|
+
name
|
|
415
|
+
tasks {
|
|
416
|
+
name
|
|
417
|
+
description
|
|
418
|
+
startTime
|
|
419
|
+
status { status warnings }
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
`);
|
|
424
|
+
_defineProperty(RippleMain, "RETRY_JOB", `
|
|
425
|
+
mutation retryJob($jobId: ID!) {
|
|
426
|
+
retryJob(jobId: $jobId) {
|
|
427
|
+
id
|
|
428
|
+
slug
|
|
429
|
+
name
|
|
430
|
+
laneId
|
|
431
|
+
status { startedAt finishedAt phase }
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
`);
|
|
435
|
+
_defineProperty(RippleMain, "STOP_JOB", `
|
|
436
|
+
mutation stopJob($jobId: ID!) {
|
|
437
|
+
stopJob(jobId: $jobId) {
|
|
438
|
+
id
|
|
439
|
+
slug
|
|
440
|
+
name
|
|
441
|
+
laneId
|
|
442
|
+
status { startedAt finishedAt phase }
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
`);
|
|
446
|
+
_ripple().RippleAspect.addRuntime(RippleMain);
|
|
447
|
+
|
|
448
|
+
//# sourceMappingURL=ripple.main.runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_logger","_cloud","_workspace","_legacy","_export","_rippleUtils","_stripAnsi","_interopRequireDefault","_ripple","_ripple2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RippleMain","constructor","cloud","logger","workspace","ensureAuthenticated","getAuthToken","Error","fetchRippleGQL","query","variables","graphqlUrl","getCloudApi","body","JSON","stringify","headers","getAuthHeader","response","fetch","method","ok","text","catch","status","json","errors","messages","map","message","join","listJobs","opts","LIST_JOBS","filters","limit","offset","getJob","jobId","GET_JOB","getCiGraphNodes","job","ciGraph","graph","parse","nodes","node","attr","ids","id","stripComponentVersion","componentIds","containerName","name","phase","getComponentBuildSummary","componentId","GET_COMPONENT_BUILD_SUMMARY","getContainerLog","url","Accept","controller","AbortController","hardTimeout","setTimeout","abort","idleTimer","signal","clearTimeout","reader","getReader","decoder","TextDecoder","buffer","resetIdle","done","read","decode","stream","lines","split","pop","line","startsWith","parsed","substring","err","warn","getContainerLogs","containerNames","results","Promise","allSettled","log","logMap","Map","result","set","extractErrorsFromLog","patterns","pattern","idx","findIndex","m","stripAnsi","includes","slice","retryJob","RETRY_JOB","stopJob","STOP_JOB","getCurrentLaneId","undefined","laneId","isDefault","toString","getLastExport","readLastExport","scope","path","getJobBySlug","slug","GET_JOB_BY_SLUG","findLatestJobForLane","lanes","jobs","getDefaultOwner","defaultScope","getJobUrl","segment","laneParts","laneName","getCloudDomain","provider","cli","loggerAspect","createLogger","RippleAspect","ripple","rippleCmd","RippleCmd","commands","RippleListCmd","RippleLogCmd","RippleErrorsCmd","RippleRetryCmd","RippleStopCmd","register","exports","MainRuntime","CLIAspect","CloudAspect","LoggerAspect","WorkspaceAspect","addRuntime"],"sources":["ripple.main.runtime.ts"],"sourcesContent":["import type { RuntimeDefinition } from '@teambit/harmony';\nimport { CLIAspect, type CLIMain, MainRuntime } from '@teambit/cli';\nimport { LoggerAspect, type LoggerMain, type Logger } from '@teambit/logger';\nimport { CloudAspect, type CloudMain } from '@teambit/cloud';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport { getCloudDomain } from '@teambit/legacy.constants';\nimport { readLastExport, type LastExportData } from '@teambit/export';\nimport { stripComponentVersion } from './ripple-utils';\nimport stripAnsi from 'strip-ansi';\nimport { RippleAspect } from './ripple.aspect';\nimport { RippleCmd, RippleListCmd, RippleLogCmd, RippleErrorsCmd, RippleRetryCmd, RippleStopCmd } from './ripple.cmd';\n\nexport type JobStatus = {\n startedAt?: string;\n finishedAt?: string;\n phase?: string;\n};\n\nexport type RippleJob = {\n id: string;\n /** url-safe identifier used by the cloud UI; the bit.cloud /ripple-ci/job/ page resolves by slug, not id */\n slug?: string;\n name?: string;\n laneId?: string;\n simulation?: boolean;\n user?: { username?: string; displayName?: string };\n status?: JobStatus;\n};\n\nexport type RippleJobFull = RippleJob & { hash?: string; ciGraph?: string; ciComponentGraph?: string };\n\nexport type BuildTaskStatus = {\n status?: string;\n warnings?: number;\n};\n\nexport type BuildTaskSummary = {\n name?: string;\n description?: string;\n startTime?: string;\n status?: BuildTaskStatus;\n};\n\nexport type ComponentBuildSummary = {\n id?: string;\n name?: string;\n tasks?: BuildTaskSummary[];\n};\n\nexport type CiGraphNode = {\n componentIds: string[];\n containerName: string;\n phase: string;\n};\n\nexport class RippleMain {\n static runtime: RuntimeDefinition = MainRuntime;\n static dependencies = [CLIAspect, CloudAspect, LoggerAspect, WorkspaceAspect];\n\n constructor(\n private cloud: CloudMain,\n private logger: Logger,\n private workspace?: Workspace\n ) {}\n\n private static LIST_JOBS = `\n query listJobs($filters: FilterOptions, $limit: Int, $offset: Int) {\n listJobs(filters: $filters, limit: $limit, offset: $offset) {\n id\n name\n laneId\n simulation\n user { username displayName }\n status { startedAt finishedAt phase }\n }\n }\n `;\n\n private static GET_JOB = `\n query getJob($jobId: ID!) {\n getJob(jobId: $jobId) {\n id\n slug\n name\n laneId\n hash\n simulation\n user { username displayName }\n status { startedAt finishedAt phase }\n ciGraph\n ciComponentGraph\n }\n }\n `;\n\n private static GET_JOB_BY_SLUG = `\n query getJobBySlug($slug: ID!) {\n getJob(slug: $slug) {\n id\n slug\n name\n laneId\n hash\n simulation\n user { username displayName }\n status { startedAt finishedAt phase }\n ciGraph\n ciComponentGraph\n }\n }\n `;\n\n private static GET_COMPONENT_BUILD_SUMMARY = `\n query getComponentBuildSummary($jobId: ID!, $componentId: String!) {\n getComponentBuildSummary(jobId: $jobId, componentId: $componentId) {\n id\n name\n tasks {\n name\n description\n startTime\n status { status warnings }\n }\n }\n }\n `;\n\n private static RETRY_JOB = `\n mutation retryJob($jobId: ID!) {\n retryJob(jobId: $jobId) {\n id\n slug\n name\n laneId\n status { startedAt finishedAt phase }\n }\n }\n `;\n\n private static STOP_JOB = `\n mutation stopJob($jobId: ID!) {\n stopJob(jobId: $jobId) {\n id\n slug\n name\n laneId\n status { startedAt finishedAt phase }\n }\n }\n `;\n\n private ensureAuthenticated(): void {\n if (!this.cloud.getAuthToken()) {\n throw new Error('You are not logged in. Please run \"bit login\" first.');\n }\n }\n\n private async fetchRippleGQL<T>(query: string, variables?: Record<string, any>): Promise<T | null> {\n this.ensureAuthenticated();\n const graphqlUrl = `${this.cloud.getCloudApi()}/graphql`;\n const body = JSON.stringify({ query, variables });\n const headers = {\n 'Content-Type': 'application/json',\n ...this.cloud.getAuthHeader(),\n };\n const response = await fetch(graphqlUrl, { method: 'POST', headers, body });\n if (!response.ok) {\n const text = await response.text().catch(() => '');\n throw new Error(`Ripple CI API returned HTTP ${response.status}: ${text}`);\n }\n const json = (await response.json()) as { data?: T; errors?: Array<{ message: string }> };\n if (json.errors?.length) {\n const messages = json.errors.map((e) => e.message).join(', ');\n throw new Error(`Ripple CI API error: ${messages}`);\n }\n return json.data ?? null;\n }\n\n async listJobs(opts: {\n limit?: number;\n offset?: number;\n filters?: { lanes?: string[]; owners?: string[]; scopes?: string[]; status?: string };\n }): Promise<RippleJob[]> {\n const data = await this.fetchRippleGQL<{ listJobs: RippleJob[] }>(RippleMain.LIST_JOBS, {\n filters: opts.filters,\n limit: opts.limit ?? 20,\n offset: opts.offset,\n });\n return data?.listJobs ?? [];\n }\n\n async getJob(jobId: string): Promise<RippleJobFull | null> {\n const data = await this.fetchRippleGQL<{\n getJob: RippleJobFull;\n }>(RippleMain.GET_JOB, { jobId });\n return data?.getJob ?? null;\n }\n\n /**\n * parse a job's ciGraph (internal graph) to extract per-node build status.\n * ciGraph has the job-specific build results (unlike ciComponentGraph which is static).\n * each node represents a build container that builds one or more components.\n */\n getCiGraphNodes(job: { ciGraph?: string }): CiGraphNode[] {\n if (!job.ciGraph) return [];\n try {\n const graph = JSON.parse(job.ciGraph) as { nodes?: Array<{ id: string; attr: string | Record<string, any> }> };\n if (!graph.nodes) return [];\n return graph.nodes.map((node) => {\n const attr = typeof node.attr === 'string' ? JSON.parse(node.attr) : node.attr;\n const ids: string[] = (attr.ids || []).map((id: string) => stripComponentVersion(id));\n return {\n componentIds: ids,\n containerName: attr.status?.name || node.id,\n phase: attr.status?.phase || 'UNKNOWN',\n };\n });\n } catch {\n return [];\n }\n }\n\n async getComponentBuildSummary(jobId: string, componentId: string): Promise<ComponentBuildSummary | null> {\n const data = await this.fetchRippleGQL<{ getComponentBuildSummary: ComponentBuildSummary }>(\n RippleMain.GET_COMPONENT_BUILD_SUMMARY,\n { jobId, componentId }\n );\n return data?.getComponentBuildSummary ?? null;\n }\n\n /**\n * fetch build logs for a specific container in a job via the REST SSE endpoint.\n * uses an idle timeout to detect end-of-stream (SSE connections may not close).\n */\n async getContainerLog(jobId: string, containerName: string): Promise<string[]> {\n this.ensureAuthenticated();\n const url = `${this.cloud.getCloudApi()}/ripple-ci/api/job/log/${jobId}/${containerName}`;\n const headers = {\n Accept: 'text/event-stream',\n ...this.cloud.getAuthHeader(),\n };\n const controller = new AbortController();\n // hard cap to avoid hanging forever\n const hardTimeout = setTimeout(() => controller.abort(), 30_000);\n const messages: string[] = [];\n let idleTimer: ReturnType<typeof setTimeout> | undefined;\n try {\n const response = await fetch(url, { headers, signal: controller.signal });\n if (!response.ok || !response.body) {\n clearTimeout(hardTimeout);\n return [];\n }\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = '';\n const resetIdle = () => {\n if (idleTimer) clearTimeout(idleTimer);\n idleTimer = setTimeout(() => controller.abort(), 3_000);\n };\n resetIdle();\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // eslint-disable-next-line no-await-in-loop\n const { done, value } = await reader.read();\n if (done) break;\n resetIdle();\n buffer += decoder.decode(value, { stream: true });\n const lines = buffer.split('\\n');\n buffer = lines.pop() || '';\n for (const line of lines) {\n if (!line.startsWith('data: ')) continue;\n try {\n const parsed = JSON.parse(line.substring(6)) as { message?: string };\n if (parsed.message != null) messages.push(parsed.message);\n } catch {\n // skip malformed lines\n }\n }\n }\n } catch (err: any) {\n if (err?.name !== 'AbortError') {\n this.logger.warn(`Failed to fetch container log: ${err?.message}`);\n }\n } finally {\n if (idleTimer) clearTimeout(idleTimer);\n clearTimeout(hardTimeout);\n }\n return messages;\n }\n\n /**\n * fetch build logs for multiple containers in parallel.\n */\n async getContainerLogs(jobId: string, containerNames: string[]): Promise<Map<string, string[]>> {\n const results = await Promise.allSettled(\n containerNames.map(async (name) => {\n const log = await this.getContainerLog(jobId, name);\n return { name, log };\n })\n );\n const logMap = new Map<string, string[]>();\n for (const result of results) {\n if (result.status === 'fulfilled') {\n logMap.set(result.value.name, result.value.log);\n }\n }\n return logMap;\n }\n\n /**\n * extract the error section from container log messages.\n * looks for common error patterns in the build output.\n */\n extractErrorsFromLog(messages: string[]): string[] {\n const patterns = ['errors were found', 'Failed task', 'threw an error', 'Error:', 'FAIL'];\n for (const pattern of patterns) {\n const idx = messages.findIndex((m) => stripAnsi(m).includes(pattern));\n if (idx >= 0) {\n return messages.slice(idx);\n }\n }\n // last resort: grab the last 30 lines if the log has content\n if (messages.length > 0) {\n return messages.slice(-30);\n }\n return [];\n }\n\n async retryJob(jobId: string): Promise<RippleJob | null> {\n const data = await this.fetchRippleGQL<{ retryJob: RippleJob }>(RippleMain.RETRY_JOB, { jobId });\n return data?.retryJob ?? null;\n }\n\n async stopJob(jobId: string): Promise<RippleJob | null> {\n const data = await this.fetchRippleGQL<{ stopJob: RippleJob }>(RippleMain.STOP_JOB, { jobId });\n return data?.stopJob ?? null;\n }\n\n /**\n * detect the current lane from the workspace.\n * returns the laneId in \"scope/lane-name\" format, or undefined if not on a lane.\n */\n getCurrentLaneId(): string | undefined {\n if (!this.workspace) return undefined;\n const laneId = this.workspace.getCurrentLaneId();\n if (!laneId || laneId.isDefault()) return undefined;\n return laneId.toString();\n }\n\n /**\n * read the last-export.json written by ExportMain after a successful export.\n * used to auto-resolve the ripple job when the user is on main (no current lane).\n */\n async getLastExport(): Promise<LastExportData | null> {\n if (!this.workspace) return null;\n return readLastExport(this.workspace.scope.path);\n }\n\n /**\n * the central-hub returns url slugs in `metadata.jobs`, not the GraphQL job ids accepted by getJob(jobId).\n * the schema also supports getJob(slug: ID!), which we use here to fetch the job directly from a slug.\n */\n async getJobBySlug(slug: string): Promise<RippleJobFull | null> {\n const data = await this.fetchRippleGQL<{\n getJob: RippleJobFull;\n }>(RippleMain.GET_JOB_BY_SLUG, { slug });\n return data?.getJob ?? null;\n }\n\n /**\n * find the latest job for a given laneId, optionally filtered by status phase.\n */\n async findLatestJobForLane(laneId: string, phase?: string): Promise<RippleJob | null> {\n const filters: { lanes: string[]; status?: string } = { lanes: [laneId] };\n if (phase) {\n filters.status = phase;\n }\n const jobs = await this.listJobs({ filters, limit: 1 });\n return jobs[0] ?? null;\n }\n\n /**\n * detect the workspace owner from the workspace defaultScope.\n */\n getDefaultOwner(): string | undefined {\n const defaultScope = this.workspace?.defaultScope;\n if (!defaultScope?.includes('.')) return undefined;\n return defaultScope.split('.')[0];\n }\n\n getJobUrl(job: RippleJob): string {\n // the bit.cloud UI resolves the /ripple-ci/job/<id-or-slug> segment by slug;\n // job.id (a uuid) returns \"No CI job found\", so prefer slug when present.\n const segment = job.slug || job.id;\n if (job.laneId) {\n // laneId format: \"scope/lane-name\", e.g. \"att-bit.duc/my-lane\"\n const [scope, ...laneParts] = job.laneId.split('/');\n const laneName = laneParts.join('/');\n if (scope && laneName) {\n return `https://${getCloudDomain()}/${scope.split('.').join('/')}/~lane/${laneName}/~ripple-ci/job/${segment}`;\n }\n }\n return `https://${getCloudDomain()}/ripple-ci/job/${segment}`;\n }\n\n static async provider([cli, cloud, loggerAspect, workspace]: [CLIMain, CloudMain, LoggerMain, Workspace]) {\n const logger = loggerAspect.createLogger(RippleAspect.id);\n const ripple = new RippleMain(cloud, logger, workspace);\n\n const rippleCmd = new RippleCmd();\n rippleCmd.commands = [\n new RippleListCmd(ripple),\n new RippleLogCmd(ripple),\n new RippleErrorsCmd(ripple),\n new RippleRetryCmd(ripple),\n new RippleStopCmd(ripple),\n ];\n cli.register(rippleCmd);\n\n return ripple;\n }\n}\n\nRippleAspect.addRuntime(RippleMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAA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ACnB,KAAIC,wBAAa,EAACJ,MAAM,CAAC,EACzB,KAAIK,uBAAY,EAACL,MAAM,CAAC,EACxB,KAAIM,0BAAe,EAACN,MAAM,CAAC,EAC3B,KAAIO,yBAAc,EAACP,MAAM,CAAC,EAC1B,KAAIQ,wBAAa,EAACR,MAAM,CAAC,CAC1B;IACDJ,GAAG,CAACa,QAAQ,CAACR,SAAS,CAAC;IAEvB,OAAOD,MAAM;EACf;AACF;AAACU,OAAA,CAAApJ,UAAA,GAAAA,UAAA;AAAAhB,eAAA,CA9WYgB,UAAU,aACeqJ,kBAAW;AAAArK,eAAA,CADpCgB,UAAU,kBAEC,CAACsJ,gBAAS,EAAEC,oBAAW,EAAEC,sBAAY,EAAEC,4BAAe,CAAC;AAAAzK,eAAA,CAFlEgB,UAAU,eAUM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AAAAhB,eAAA,CArBUgB,UAAU,aAuBI;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AAAAhB,eAAA,CAtCUgB,UAAU,qBAwCY;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AAAAhB,eAAA,CAvDUgB,UAAU,iCAyDwB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AAAAhB,eAAA,CAtEUgB,UAAU,eAwEM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AAAAhB,eAAA,CAlFUgB,UAAU,cAoFK;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AAkRHyI,sBAAY,CAACiB,UAAU,CAAC1J,UAAU,CAAC","ignoreList":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/ripple",
|
|
3
|
+
"version": "0.0.0-00ad897e742f2a0c76f3f48e46d69e13bfc07a2e",
|
|
4
|
+
"homepage": "https://bit.cloud/teambit/cloud/ripple",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"componentId": {
|
|
7
|
+
"scope": "teambit.cloud",
|
|
8
|
+
"name": "ripple",
|
|
9
|
+
"version": "00ad897e742f2a0c76f3f48e46d69e13bfc07a2e"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"chalk": "4.1.2",
|
|
13
|
+
"strip-ansi": "6.0.0",
|
|
14
|
+
"cli-table": "0.3.6",
|
|
15
|
+
"@teambit/harmony": "0.4.12",
|
|
16
|
+
"@teambit/cli": "0.0.1352",
|
|
17
|
+
"@teambit/legacy.constants": "0.0.34",
|
|
18
|
+
"@teambit/logger": "0.0.1445",
|
|
19
|
+
"@teambit/export": "0.0.0-656b88e9bce024137668774bcaad62bec1b9b263",
|
|
20
|
+
"@teambit/cloud": "0.0.0-9bbd5fca50cdc6a03dfe49c85a8bbde661409a28",
|
|
21
|
+
"@teambit/workspace": "0.0.0-38ae37bd55400e7bb2a15f98d3822edf58aff1fd"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/cli-table": "^0.3.0",
|
|
25
|
+
"@teambit/harmony.envs.core-aspect-env": "1.0.0"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {},
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
|
+
"optionalDependencies": {},
|
|
30
|
+
"peerDependenciesMeta": {},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"node": {
|
|
35
|
+
"require": "./dist/index.js",
|
|
36
|
+
"import": "./dist/esm.mjs"
|
|
37
|
+
},
|
|
38
|
+
"default": "./dist/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./dist/*": "./dist/*",
|
|
41
|
+
"./artifacts/*": "./artifacts/*"
|
|
42
|
+
},
|
|
43
|
+
"private": false,
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=16.0.0"
|
|
46
|
+
},
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://github.com/teambit/bit"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"bit",
|
|
53
|
+
"bit-aspect",
|
|
54
|
+
"bit-core-aspect",
|
|
55
|
+
"components",
|
|
56
|
+
"collaboration",
|
|
57
|
+
"web"
|
|
58
|
+
]
|
|
59
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -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
|
+
}
|
package/types/style.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
}
|
|
43
|
+
|
|
44
|
+
// `reset-css` ships only `reset.css` (no `.d.ts`). TS6 refuses bare
|
|
45
|
+
// side-effect imports without declarations, so we declare the module here.
|
|
46
|
+
declare module 'reset-css';
|