@contentful/experience-design-system-cli 2.25.1-dev-build-298eb6a.0 → 2.25.1-dev-build-26ec156.0
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/dist/package.json +2 -2
- package/dist/src/session/db.d.ts +0 -9
- package/dist/src/session/db.js +0 -78
- package/package.json +6 -6
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.25.1-dev-build-
|
|
3
|
+
"version": "2.25.1-dev-build-26ec156.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"eslint-plugin-prettier": "^5.5.6",
|
|
58
58
|
"ink-testing-library": "^4.0.0",
|
|
59
59
|
"typescript-eslint": "^8.67.0",
|
|
60
|
-
"vitest": "^4.
|
|
60
|
+
"vitest": "^4.1.11"
|
|
61
61
|
},
|
|
62
62
|
"repository": {
|
|
63
63
|
"type": "git",
|
package/dist/src/session/db.d.ts
CHANGED
|
@@ -26,15 +26,6 @@ export interface StepRow {
|
|
|
26
26
|
}
|
|
27
27
|
export declare function getPipelineDbPath(): string;
|
|
28
28
|
export declare function openPipelineDb(dbPath?: string): DatabaseSync;
|
|
29
|
-
export type RawPropTokenPathKind = 'set' | 'allowed';
|
|
30
|
-
export interface RawPropTokenPathGroup {
|
|
31
|
-
componentId: string;
|
|
32
|
-
propName: string;
|
|
33
|
-
kind: RawPropTokenPathKind;
|
|
34
|
-
paths: string[];
|
|
35
|
-
}
|
|
36
|
-
export declare function replaceRawPropTokenPaths(db: DatabaseSync, sessionId: string, componentId: string, propName: string, kind: RawPropTokenPathKind, paths: string[]): void;
|
|
37
|
-
export declare function loadRawPropTokenPaths(db: DatabaseSync, sessionId: string): RawPropTokenPathGroup[];
|
|
38
29
|
export interface ApplyToolCallsResult {
|
|
39
30
|
classified: number;
|
|
40
31
|
excluded: number;
|
package/dist/src/session/db.js
CHANGED
|
@@ -185,40 +185,6 @@ export function openPipelineDb(dbPath) {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
function applyDbMigrations(db) {
|
|
188
|
-
const migrations = [
|
|
189
|
-
{
|
|
190
|
-
name: '001-raw-prop-token-paths',
|
|
191
|
-
sql: `
|
|
192
|
-
CREATE TABLE IF NOT EXISTS raw_prop_token_paths (
|
|
193
|
-
session_id TEXT NOT NULL,
|
|
194
|
-
component_id TEXT NOT NULL,
|
|
195
|
-
prop_name TEXT NOT NULL,
|
|
196
|
-
kind TEXT NOT NULL CHECK (kind IN ('set', 'allowed')),
|
|
197
|
-
position INTEGER NOT NULL,
|
|
198
|
-
path TEXT NOT NULL,
|
|
199
|
-
PRIMARY KEY (session_id, component_id, prop_name, kind, position),
|
|
200
|
-
FOREIGN KEY (session_id, component_id, prop_name)
|
|
201
|
-
REFERENCES raw_props(session_id, component_id, name) ON DELETE CASCADE
|
|
202
|
-
);
|
|
203
|
-
`,
|
|
204
|
-
},
|
|
205
|
-
];
|
|
206
|
-
const hasAppliedMigration = db.prepare('SELECT 1 FROM migrations WHERE name = ?');
|
|
207
|
-
const recordMigration = db.prepare('INSERT INTO migrations (name, applied_at) VALUES (?, ?)');
|
|
208
|
-
for (const migration of migrations) {
|
|
209
|
-
if (hasAppliedMigration.get(migration.name))
|
|
210
|
-
continue;
|
|
211
|
-
db.exec('BEGIN');
|
|
212
|
-
try {
|
|
213
|
-
db.exec(migration.sql);
|
|
214
|
-
recordMigration.run(migration.name, new Date().toISOString());
|
|
215
|
-
db.exec('COMMIT');
|
|
216
|
-
}
|
|
217
|
-
catch (e) {
|
|
218
|
-
db.exec('ROLLBACK');
|
|
219
|
-
throw e;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
188
|
const cols = db.prepare('PRAGMA table_info(raw_slots)').all();
|
|
223
189
|
if (!cols.some((c) => c.name === 'required')) {
|
|
224
190
|
db.exec('ALTER TABLE raw_slots ADD COLUMN required INTEGER NOT NULL DEFAULT 1 CHECK (required IN (0, 1))');
|
|
@@ -371,50 +337,6 @@ function applyDbMigrations(db) {
|
|
|
371
337
|
`);
|
|
372
338
|
}
|
|
373
339
|
}
|
|
374
|
-
export function replaceRawPropTokenPaths(db, sessionId, componentId, propName, kind, paths) {
|
|
375
|
-
const deletePaths = db.prepare(`DELETE FROM raw_prop_token_paths
|
|
376
|
-
WHERE session_id = ? AND component_id = ? AND prop_name = ? AND kind = ?`);
|
|
377
|
-
const insertPath = db.prepare(`INSERT INTO raw_prop_token_paths (session_id, component_id, prop_name, kind, position, path)
|
|
378
|
-
VALUES (?, ?, ?, ?, ?, ?)`);
|
|
379
|
-
db.exec('BEGIN');
|
|
380
|
-
try {
|
|
381
|
-
deletePaths.run(sessionId, componentId, propName, kind);
|
|
382
|
-
paths.forEach((path, position) => {
|
|
383
|
-
insertPath.run(sessionId, componentId, propName, kind, position, path);
|
|
384
|
-
});
|
|
385
|
-
db.exec('COMMIT');
|
|
386
|
-
}
|
|
387
|
-
catch (e) {
|
|
388
|
-
db.exec('ROLLBACK');
|
|
389
|
-
throw e;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
export function loadRawPropTokenPaths(db, sessionId) {
|
|
393
|
-
const rows = db
|
|
394
|
-
.prepare(`SELECT component_id, prop_name, kind, position, path
|
|
395
|
-
FROM raw_prop_token_paths
|
|
396
|
-
WHERE session_id = ?
|
|
397
|
-
ORDER BY component_id, prop_name, kind, position`)
|
|
398
|
-
.all(sessionId);
|
|
399
|
-
const groups = [];
|
|
400
|
-
for (const row of rows) {
|
|
401
|
-
const previous = groups.at(-1);
|
|
402
|
-
if (previous &&
|
|
403
|
-
previous.componentId === row.component_id &&
|
|
404
|
-
previous.propName === row.prop_name &&
|
|
405
|
-
previous.kind === row.kind) {
|
|
406
|
-
previous.paths.push(row.path);
|
|
407
|
-
continue;
|
|
408
|
-
}
|
|
409
|
-
groups.push({
|
|
410
|
-
componentId: row.component_id,
|
|
411
|
-
propName: row.prop_name,
|
|
412
|
-
kind: row.kind,
|
|
413
|
-
paths: [row.path],
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
return groups;
|
|
417
|
-
}
|
|
418
340
|
export function loadComponentReviewMetadata(db, sessionId, componentName) {
|
|
419
341
|
const compRow = db
|
|
420
342
|
.prepare(`SELECT component_id, source, source_path FROM raw_components WHERE session_id = ? AND name = ?`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.25.1-dev-build-
|
|
3
|
+
"version": "2.25.1-dev-build-26ec156.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"react": "^18.3.1",
|
|
35
35
|
"react-devtools-core": "^4.19.1",
|
|
36
36
|
"react-dom": "^18.3.1",
|
|
37
|
-
"@contentful/experience-design-system-extraction": "2.25.1-dev-build-
|
|
38
|
-
"@contentful/experience-design-system-types": "2.25.1-dev-build-
|
|
39
|
-
"@contentful/experience-design-system-
|
|
40
|
-
"@contentful/experience-design-system-
|
|
37
|
+
"@contentful/experience-design-system-extraction": "2.25.1-dev-build-26ec156.0",
|
|
38
|
+
"@contentful/experience-design-system-types": "2.25.1-dev-build-26ec156.0",
|
|
39
|
+
"@contentful/experience-design-system-client": "2.25.1-dev-build-26ec156.0",
|
|
40
|
+
"@contentful/experience-design-system-generation": "2.25.1-dev-build-26ec156.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"eslint-plugin-prettier": "^5.5.6",
|
|
49
49
|
"ink-testing-library": "^4.0.0",
|
|
50
50
|
"typescript-eslint": "^8.67.0",
|
|
51
|
-
"vitest": "^4.
|
|
51
|
+
"vitest": "^4.1.11"
|
|
52
52
|
},
|
|
53
53
|
"repository": {
|
|
54
54
|
"type": "git",
|