@sascha384/tic 5.16.0 → 5.17.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/.claude-plugin/plugin.json +1 -1
- package/dist/backends/ado/index.js +1 -1
- package/dist/backends/ado/index.js.map +1 -1
- package/dist/backends/ado/mappers.d.ts +2 -2
- package/dist/backends/ado/mappers.js +7 -2
- package/dist/backends/ado/mappers.js.map +1 -1
- package/dist/backends/files/index.d.ts +6 -0
- package/dist/backends/files/index.js +36 -0
- package/dist/backends/files/index.js.map +1 -1
- package/dist/backends/files/sync.d.ts +2 -2
- package/dist/backends/files/sync.js +9 -7
- package/dist/backends/files/sync.js.map +1 -1
- package/dist/backends/github/index.js +3 -3
- package/dist/backends/github/index.js.map +1 -1
- package/dist/backends/github/mappers.js +2 -1
- package/dist/backends/github/mappers.js.map +1 -1
- package/dist/backends/github/pr-mappers.d.ts +1 -1
- package/dist/backends/github/pr-mappers.js +1 -1
- package/dist/backends/github/pr-mappers.js.map +1 -1
- package/dist/backends/gitlab/index.js +13 -6
- package/dist/backends/gitlab/index.js.map +1 -1
- package/dist/backends/gitlab/mappers.js +2 -1
- package/dist/backends/gitlab/mappers.js.map +1 -1
- package/dist/backends/jira/index.js +2 -2
- package/dist/backends/jira/index.js.map +1 -1
- package/dist/backends/jira/mappers.d.ts +1 -1
- package/dist/backends/jira/mappers.js +5 -4
- package/dist/backends/jira/mappers.js.map +1 -1
- package/dist/backends/local/items.js +9 -2
- package/dist/backends/local/items.js.map +1 -1
- package/dist/backends/types.d.ts +2 -3
- package/dist/backends/types.js +8 -2
- package/dist/backends/types.js.map +1 -1
- package/dist/cli/commands/config.js +0 -1
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/item.js +45 -17
- package/dist/cli/commands/item.js.map +1 -1
- package/dist/cli/commands/mcp.js +24 -9
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/pr.js +12 -6
- package/dist/cli/commands/pr.js.map +1 -1
- package/dist/cli/index.js +13 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/components/BranchList.js +4 -2
- package/dist/components/BranchList.js.map +1 -1
- package/dist/components/CommandBar.js +8 -7
- package/dist/components/CommandBar.js.map +1 -1
- package/dist/components/DetailPanel.js +2 -2
- package/dist/components/DetailPanel.js.map +1 -1
- package/dist/components/Settings.js +1 -1
- package/dist/components/Settings.js.map +1 -1
- package/dist/components/StatusScreen.js +2 -2
- package/dist/components/StatusScreen.js.map +1 -1
- package/dist/components/WorkItemForm.js +107 -73
- package/dist/components/WorkItemForm.js.map +1 -1
- package/dist/components/WorkItemList.d.ts +5 -3
- package/dist/components/WorkItemList.js +175 -124
- package/dist/components/WorkItemList.js.map +1 -1
- package/dist/components/buildTree.js +15 -13
- package/dist/components/buildTree.js.map +1 -1
- package/dist/components/fuzzyMatch.js +1 -1
- package/dist/components/fuzzyMatch.js.map +1 -1
- package/dist/components/getMarkedDistribution.d.ts +2 -2
- package/dist/components/getMarkedDistribution.js +1 -1
- package/dist/components/getMarkedDistribution.js.map +1 -1
- package/dist/git.d.ts +2 -1
- package/dist/hooks/useFormValidation.js +31 -21
- package/dist/hooks/useFormValidation.js.map +1 -1
- package/dist/implement.js +3 -3
- package/dist/implement.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/storage/config.d.ts +0 -1
- package/dist/storage/config.js +0 -6
- package/dist/storage/config.js.map +1 -1
- package/dist/storage/index.d.ts +25 -6
- package/dist/storage/index.js +304 -183
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/mappers.d.ts +1 -1
- package/dist/storage/mappers.js +5 -3
- package/dist/storage/mappers.js.map +1 -1
- package/dist/storage/schema.d.ts +83 -380
- package/dist/storage/schema.js +27 -55
- package/dist/storage/schema.js.map +1 -1
- package/dist/storage/syncQueue.d.ts +2 -3
- package/dist/storage/syncQueue.js +10 -17
- package/dist/storage/syncQueue.js.map +1 -1
- package/dist/storage/undo.js +7 -6
- package/dist/storage/undo.js.map +1 -1
- package/dist/stores/backendDataStore.js +3 -1
- package/dist/stores/backendDataStore.js.map +1 -1
- package/dist/stores/formStackStore.d.ts +1 -1
- package/dist/stores/listViewStore.d.ts +6 -6
- package/dist/stores/navigationStore.d.ts +7 -7
- package/dist/stores/undoStore.d.ts +2 -2
- package/dist/sync/SyncManager.d.ts +6 -1
- package/dist/sync/SyncManager.js +80 -76
- package/dist/sync/SyncManager.js.map +1 -1
- package/dist/sync/types.d.ts +6 -7
- package/dist/test-helpers.d.ts +1 -1
- package/dist/test-helpers.js +11 -8
- package/dist/test-helpers.js.map +1 -1
- package/dist/types.d.ts +6 -5
- package/drizzle/0006_dual_id.sql +173 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
-- Dual-ID migration: separate internal rowId from display id
|
|
2
|
+
-- This migration rebuilds most tables to switch from text id primary key
|
|
3
|
+
-- to integer row_id primary key with nullable text display id.
|
|
4
|
+
|
|
5
|
+
-- 1. Rebuild work_items with row_id as primary key
|
|
6
|
+
CREATE TABLE `work_items_new` (
|
|
7
|
+
`row_id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
8
|
+
`id` text,
|
|
9
|
+
`title` text NOT NULL,
|
|
10
|
+
`type` text NOT NULL,
|
|
11
|
+
`status` text NOT NULL,
|
|
12
|
+
`iteration` text NOT NULL DEFAULT '',
|
|
13
|
+
`priority` text NOT NULL DEFAULT '',
|
|
14
|
+
`assignee` text NOT NULL DEFAULT '',
|
|
15
|
+
`description` text NOT NULL DEFAULT '',
|
|
16
|
+
`parent` integer,
|
|
17
|
+
`created` text NOT NULL,
|
|
18
|
+
`updated` text NOT NULL,
|
|
19
|
+
`deleted_at` text
|
|
20
|
+
);--> statement-breakpoint
|
|
21
|
+
|
|
22
|
+
-- Copy existing data: old text id becomes display id, row_id is auto-assigned
|
|
23
|
+
INSERT INTO `work_items_new` (`id`, `title`, `type`, `status`, `iteration`, `priority`, `assignee`, `description`, `parent`, `created`, `updated`, `deleted_at`)
|
|
24
|
+
SELECT `id`, `title`, `type`, `status`, `iteration`, `priority`, `assignee`, `description`, NULL, `created`, `updated`, `deleted_at`
|
|
25
|
+
FROM `work_items`;--> statement-breakpoint
|
|
26
|
+
|
|
27
|
+
-- Fix parent references: map old text parent to new row_id
|
|
28
|
+
UPDATE `work_items_new` SET `parent` = (
|
|
29
|
+
SELECT `p`.`row_id` FROM `work_items_new` `p`
|
|
30
|
+
WHERE `p`.`id` = (
|
|
31
|
+
SELECT `old`.`parent` FROM `work_items` `old`
|
|
32
|
+
WHERE `old`.`id` = `work_items_new`.`id`
|
|
33
|
+
)
|
|
34
|
+
) WHERE `work_items_new`.`id` IN (
|
|
35
|
+
SELECT `id` FROM `work_items` WHERE `parent` IS NOT NULL
|
|
36
|
+
);--> statement-breakpoint
|
|
37
|
+
|
|
38
|
+
DROP TABLE `work_items`;--> statement-breakpoint
|
|
39
|
+
ALTER TABLE `work_items_new` RENAME TO `work_items`;--> statement-breakpoint
|
|
40
|
+
|
|
41
|
+
-- Recreate work_items indexes
|
|
42
|
+
CREATE UNIQUE INDEX `idx_display_id` ON `work_items` (`id`);--> statement-breakpoint
|
|
43
|
+
CREATE INDEX `idx_status` ON `work_items` (`status`);--> statement-breakpoint
|
|
44
|
+
CREATE INDEX `idx_type` ON `work_items` (`type`);--> statement-breakpoint
|
|
45
|
+
CREATE INDEX `idx_assignee` ON `work_items` (`assignee`);--> statement-breakpoint
|
|
46
|
+
CREATE INDEX `idx_priority` ON `work_items` (`priority`);--> statement-breakpoint
|
|
47
|
+
CREATE INDEX `idx_iteration` ON `work_items` (`iteration`);--> statement-breakpoint
|
|
48
|
+
CREATE INDEX `idx_parent` ON `work_items` (`parent`);--> statement-breakpoint
|
|
49
|
+
CREATE INDEX `idx_deleted_iteration` ON `work_items` (`deleted_at`, `iteration`);--> statement-breakpoint
|
|
50
|
+
CREATE INDEX `idx_deleted_status` ON `work_items` (`deleted_at`, `status`);--> statement-breakpoint
|
|
51
|
+
CREATE INDEX `idx_deleted_assignee` ON `work_items` (`deleted_at`, `assignee`);--> statement-breakpoint
|
|
52
|
+
|
|
53
|
+
-- 2. Rebuild work_item_labels with integer FK
|
|
54
|
+
CREATE TABLE `work_item_labels_new` (
|
|
55
|
+
`work_item_row_id` integer NOT NULL REFERENCES `work_items`(`row_id`) ON DELETE CASCADE,
|
|
56
|
+
`label` text NOT NULL,
|
|
57
|
+
PRIMARY KEY (`work_item_row_id`, `label`)
|
|
58
|
+
);--> statement-breakpoint
|
|
59
|
+
|
|
60
|
+
INSERT INTO `work_item_labels_new` (`work_item_row_id`, `label`)
|
|
61
|
+
SELECT `w`.`row_id`, `l`.`label`
|
|
62
|
+
FROM `work_item_labels` `l`
|
|
63
|
+
JOIN `work_items` `w` ON `w`.`id` = `l`.`work_item_id`;--> statement-breakpoint
|
|
64
|
+
|
|
65
|
+
DROP TABLE `work_item_labels`;--> statement-breakpoint
|
|
66
|
+
ALTER TABLE `work_item_labels_new` RENAME TO `work_item_labels`;--> statement-breakpoint
|
|
67
|
+
CREATE INDEX `idx_label` ON `work_item_labels` (`label`);--> statement-breakpoint
|
|
68
|
+
|
|
69
|
+
-- 3. Rebuild work_item_deps with integer FKs
|
|
70
|
+
CREATE TABLE `work_item_deps_new` (
|
|
71
|
+
`work_item_row_id` integer NOT NULL REFERENCES `work_items`(`row_id`) ON DELETE CASCADE,
|
|
72
|
+
`depends_on_row_id` integer NOT NULL REFERENCES `work_items`(`row_id`) ON DELETE CASCADE,
|
|
73
|
+
PRIMARY KEY (`work_item_row_id`, `depends_on_row_id`)
|
|
74
|
+
);--> statement-breakpoint
|
|
75
|
+
|
|
76
|
+
INSERT INTO `work_item_deps_new` (`work_item_row_id`, `depends_on_row_id`)
|
|
77
|
+
SELECT `w1`.`row_id`, `w2`.`row_id`
|
|
78
|
+
FROM `work_item_deps` `d`
|
|
79
|
+
JOIN `work_items` `w1` ON `w1`.`id` = `d`.`work_item_id`
|
|
80
|
+
JOIN `work_items` `w2` ON `w2`.`id` = `d`.`depends_on_id`;--> statement-breakpoint
|
|
81
|
+
|
|
82
|
+
DROP TABLE `work_item_deps`;--> statement-breakpoint
|
|
83
|
+
ALTER TABLE `work_item_deps_new` RENAME TO `work_item_deps`;--> statement-breakpoint
|
|
84
|
+
CREATE INDEX `idx_dep_target` ON `work_item_deps` (`depends_on_row_id`);--> statement-breakpoint
|
|
85
|
+
|
|
86
|
+
-- 4. Rebuild comments with integer FK
|
|
87
|
+
CREATE TABLE `comments_new` (
|
|
88
|
+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
89
|
+
`work_item_row_id` integer NOT NULL REFERENCES `work_items`(`row_id`) ON DELETE CASCADE,
|
|
90
|
+
`author` text NOT NULL DEFAULT '',
|
|
91
|
+
`body` text NOT NULL,
|
|
92
|
+
`created` text NOT NULL
|
|
93
|
+
);--> statement-breakpoint
|
|
94
|
+
|
|
95
|
+
INSERT INTO `comments_new` (`id`, `work_item_row_id`, `author`, `body`, `created`)
|
|
96
|
+
SELECT `c`.`id`, `w`.`row_id`, `c`.`author`, `c`.`body`, `c`.`created`
|
|
97
|
+
FROM `comments` `c`
|
|
98
|
+
JOIN `work_items` `w` ON `w`.`id` = `c`.`work_item_id`;--> statement-breakpoint
|
|
99
|
+
|
|
100
|
+
DROP TABLE `comments`;--> statement-breakpoint
|
|
101
|
+
ALTER TABLE `comments_new` RENAME TO `comments`;--> statement-breakpoint
|
|
102
|
+
CREATE INDEX `idx_comment_item` ON `comments` (`work_item_row_id`);--> statement-breakpoint
|
|
103
|
+
|
|
104
|
+
-- 5. Rebuild sync_queue with integer item_row_id (clear existing queue)
|
|
105
|
+
DROP TABLE `sync_queue`;--> statement-breakpoint
|
|
106
|
+
CREATE TABLE `sync_queue` (
|
|
107
|
+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
108
|
+
`action` text NOT NULL,
|
|
109
|
+
`item_row_id` integer NOT NULL,
|
|
110
|
+
`timestamp` text NOT NULL,
|
|
111
|
+
`comment_data` text,
|
|
112
|
+
`template_slug` text
|
|
113
|
+
);--> statement-breakpoint
|
|
114
|
+
CREATE INDEX `idx_queue_item` ON `sync_queue` (`item_row_id`, `action`);--> statement-breakpoint
|
|
115
|
+
|
|
116
|
+
-- 6. Rebuild undo_stack with metadata column (clear existing stack)
|
|
117
|
+
DROP TABLE IF EXISTS `undo_item_snapshot_deps`;--> statement-breakpoint
|
|
118
|
+
DROP TABLE IF EXISTS `undo_item_snapshot_labels`;--> statement-breakpoint
|
|
119
|
+
DROP TABLE IF EXISTS `undo_item_snapshot`;--> statement-breakpoint
|
|
120
|
+
DROP TABLE `undo_stack`;--> statement-breakpoint
|
|
121
|
+
CREATE TABLE `undo_stack` (
|
|
122
|
+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
123
|
+
`action` text NOT NULL,
|
|
124
|
+
`metadata` text NOT NULL,
|
|
125
|
+
`created_at` text NOT NULL
|
|
126
|
+
);--> statement-breakpoint
|
|
127
|
+
|
|
128
|
+
-- 7. Rebuild file_sync_state with integer FK
|
|
129
|
+
DROP TABLE `file_sync_state`;--> statement-breakpoint
|
|
130
|
+
CREATE TABLE `file_sync_state` (
|
|
131
|
+
`item_row_id` integer PRIMARY KEY NOT NULL,
|
|
132
|
+
`display_id` text NOT NULL,
|
|
133
|
+
`hash` text NOT NULL,
|
|
134
|
+
`synced_at` text NOT NULL
|
|
135
|
+
);--> statement-breakpoint
|
|
136
|
+
|
|
137
|
+
-- 8. Rebuild pr_item_links with integer FK
|
|
138
|
+
CREATE TABLE `pr_item_links_new` (
|
|
139
|
+
`pr_id` text NOT NULL REFERENCES `pull_requests`(`id`) ON DELETE CASCADE,
|
|
140
|
+
`item_row_id` integer NOT NULL REFERENCES `work_items`(`row_id`) ON DELETE CASCADE,
|
|
141
|
+
PRIMARY KEY (`pr_id`, `item_row_id`)
|
|
142
|
+
);--> statement-breakpoint
|
|
143
|
+
|
|
144
|
+
INSERT INTO `pr_item_links_new` (`pr_id`, `item_row_id`)
|
|
145
|
+
SELECT `pl`.`pr_id`, `w`.`row_id`
|
|
146
|
+
FROM `pr_item_links` `pl`
|
|
147
|
+
JOIN `work_items` `w` ON `w`.`id` = `pl`.`item_id`;--> statement-breakpoint
|
|
148
|
+
|
|
149
|
+
DROP TABLE `pr_item_links`;--> statement-breakpoint
|
|
150
|
+
ALTER TABLE `pr_item_links_new` RENAME TO `pr_item_links`;--> statement-breakpoint
|
|
151
|
+
CREATE INDEX `idx_pr_link_item` ON `pr_item_links` (`item_row_id`);--> statement-breakpoint
|
|
152
|
+
|
|
153
|
+
-- 9. Rebuild project_config without next_id
|
|
154
|
+
CREATE TABLE `project_config_new` (
|
|
155
|
+
`id` integer PRIMARY KEY DEFAULT 1,
|
|
156
|
+
`backend` text NOT NULL DEFAULT 'none',
|
|
157
|
+
`current_iteration` text NOT NULL DEFAULT '',
|
|
158
|
+
`branch_mode` text NOT NULL DEFAULT 'branch',
|
|
159
|
+
`branch_command` text NOT NULL DEFAULT '',
|
|
160
|
+
`copy_to_clipboard` integer NOT NULL DEFAULT true,
|
|
161
|
+
`auto_update` integer NOT NULL DEFAULT true,
|
|
162
|
+
`default_type` text NOT NULL DEFAULT 'issue',
|
|
163
|
+
`show_detail_panel` integer NOT NULL DEFAULT false,
|
|
164
|
+
`default_view` text NOT NULL DEFAULT '',
|
|
165
|
+
`theme` text NOT NULL DEFAULT 'default'
|
|
166
|
+
);--> statement-breakpoint
|
|
167
|
+
|
|
168
|
+
INSERT INTO `project_config_new` (`id`, `backend`, `current_iteration`, `branch_mode`, `branch_command`, `copy_to_clipboard`, `auto_update`, `default_type`, `show_detail_panel`, `default_view`, `theme`)
|
|
169
|
+
SELECT `id`, `backend`, `current_iteration`, `branch_mode`, `branch_command`, `copy_to_clipboard`, `auto_update`, `default_type`, `show_detail_panel`, `default_view`, `theme`
|
|
170
|
+
FROM `project_config`;--> statement-breakpoint
|
|
171
|
+
|
|
172
|
+
DROP TABLE `project_config`;--> statement-breakpoint
|
|
173
|
+
ALTER TABLE `project_config_new` RENAME TO `project_config`;
|