Skip to content

Commit 04beba3

Browse files
committed
🚀 feat(push): add Supabase database migrations for cloud push feature
- Create core tables for package storage and management - Implement comprehensive RLS policies for security - Set up storage buckets for package files - Add user tier system with subscription management - Configure rate limiting and analytics tracking - Establish audit logging for compliance - Add team collaboration support with role-based access
1 parent 46ec801 commit 04beba3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1695
-186
lines changed

.kiro/specs/supabase-push-feature/tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- Set up constants file with error codes, limits, and configuration
88
- _Requirements: 8.1, 8.2, 8.3_
99

10-
- [ ] 2. Implement database schema and migrations
10+
- [x] 2. Implement database schema and migrations
1111
- Create Supabase migration for taptik_packages table with all required fields
1212
- Create package_versions table for version history tracking
1313
- Create package_downloads table for download analytics

.vscode/settings.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
{
2+
"[typescript]": {
3+
"editor.defaultFormatter": "denoland.vscode-deno"
4+
},
25
"cSpell.words": [
36
"Supabase"
7+
],
8+
"deno.enablePaths": [
9+
"supabase/functions"
10+
],
11+
"deno.lint": true,
12+
"deno.unstable": [
13+
"bare-node-builtins",
14+
"byonm",
15+
"sloppy-imports",
16+
"unsafe-proto",
17+
"webgpu",
18+
"broadcast-channel",
19+
"worker-options",
20+
"cron",
21+
"kv",
22+
"ffi",
23+
"fs",
24+
"http",
25+
"net"
426
]
5-
}
27+
}

src/modules/build/commands/build.command.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,11 @@ describe('BuildCommand', () => {
233233
addCriticalError: vi.fn(),
234234
hasWarnings: vi.fn().mockReturnValue(false),
235235
hasCriticalErrors: vi.fn().mockReturnValue(false),
236-
getErrorSummary: vi
237-
.fn()
238-
.mockReturnValue({
239-
warnings: [],
240-
criticalErrors: [],
241-
partialFiles: [],
242-
}),
236+
getErrorSummary: vi.fn().mockReturnValue({
237+
warnings: [],
238+
criticalErrors: [],
239+
partialFiles: [],
240+
}),
243241
displayErrorSummary: vi.fn(),
244242
exitWithAppropriateCode: vi.fn().mockImplementation(() => undefined),
245243
handleCriticalErrorAndExit: vi.fn().mockImplementation(() => undefined),

src/modules/build/commands/build.command.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,6 @@ export class BuildCommand extends CommandRunner {
11581158
typeof cloudTransformService.transformClaudeCodePersonalContext ===
11591159
'function'
11601160
) {
1161-
11621161
transformedData.personalContext =
11631162
await cloudTransformService.transformClaudeCodePersonalContext(
11641163
settingsData.localSettings,
@@ -1206,7 +1205,6 @@ export class BuildCommand extends CommandRunner {
12061205
typeof cloudTransformService.transformClaudeCodeProjectContext ===
12071206
'function'
12081207
) {
1209-
12101208
transformedData.projectContext =
12111209
await cloudTransformService.transformClaudeCodeProjectContext(
12121210
settingsData.localSettings,
@@ -1252,7 +1250,6 @@ export class BuildCommand extends CommandRunner {
12521250
typeof cloudTransformService.transformClaudeCodePromptTemplates ===
12531251
'function'
12541252
) {
1255-
12561253
transformedData.promptTemplates =
12571254
await cloudTransformService.transformClaudeCodePromptTemplates(
12581255
settingsData.localSettings,

src/modules/build/services/collection/collection.service.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ export class CollectionService {
8787
* @param projectPath - The project path to scan
8888
* @returns Promise resolving to collected Claude Code local settings data
8989
*/
90-
async collectClaudeCodeLocalSettings(
91-
projectPath?: string,
92-
): Promise<
90+
async collectClaudeCodeLocalSettings(projectPath?: string): Promise<
9391
ClaudeCodeLocalSettingsData & {
9492
errors?: ClaudeCodeError[];
9593
recoveryStrategy?: ErrorRecoveryStrategy;
@@ -408,9 +406,7 @@ export class CollectionService {
408406
* @param directory - Directory containing the files
409407
* @returns Promise resolving to parsed agents
410408
*/
411-
async parseClaudeAgents(
412-
directory: string,
413-
): Promise<
409+
async parseClaudeAgents(directory: string): Promise<
414410
Array<{
415411
filename: string;
416412
content: string;
@@ -483,9 +479,7 @@ export class CollectionService {
483479
* @param directory - Directory containing the files
484480
* @returns Promise resolving to parsed commands
485481
*/
486-
async parseClaudeCommands(
487-
directory: string,
488-
): Promise<
482+
async parseClaudeCommands(directory: string): Promise<
489483
Array<{
490484
filename: string;
491485
content: string;

src/modules/build/test-fixtures/advanced-error-scenarios.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,7 @@ export class AdvancedMockFileSystem extends MockFileSystem {
326326
/**
327327
* Enhanced stat with various file system edge cases
328328
*/
329-
async stat(
330-
filePath: string,
331-
): Promise<{
329+
async stat(filePath: string): Promise<{
332330
isDirectory(): boolean;
333331
isFile(): boolean;
334332
size: number;

src/modules/context/services/package.service.spec.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -838,19 +838,31 @@ describe('PackageService', () => {
838838
local: {
839839
agents: Array(10)
840840
.fill(null)
841-
.map((_, i) => ({
841+
.map((_, i) => ({
842842
id: `agent${i}`,
843843
name: `Agent ${i}`,
844-
prompt: `Test prompt for agent ${i}`
844+
prompt: `Test prompt for agent ${i}`,
845845
})),
846846
commands: Array(10)
847847
.fill(null)
848848
.map((_, i) => ({ name: `cmd${i}`, command: `run cmd${i}` })),
849849
mcpServers: {
850850
servers: [
851-
{ name: 'server1', protocol: 'stdio', command: 'run server1' },
852-
{ name: 'server2', protocol: 'stdio', command: 'run server2' },
853-
{ name: 'server3', protocol: 'stdio', command: 'run server3' }
851+
{
852+
name: 'server1',
853+
protocol: 'stdio',
854+
command: 'run server1',
855+
},
856+
{
857+
name: 'server2',
858+
protocol: 'stdio',
859+
command: 'run server2',
860+
},
861+
{
862+
name: 'server3',
863+
protocol: 'stdio',
864+
command: 'run server3',
865+
},
854866
],
855867
},
856868
},

src/modules/context/services/package.service.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ export class PackageService {
963963
// Use cached size from package or manifest to avoid expensive serialization
964964
let originalSize: number;
965965
let compressedSize: number;
966-
966+
967967
// Check if we have metrics with originalSize from package creation
968968
const packageWithMetrics = taptikPackage as TaptikPackage & {
969969
metrics?: { originalSize: number };
@@ -975,9 +975,7 @@ export class PackageService {
975975
// For accurate compression ratio calculation, we need the actual JSON serialized size
976976
// Manifest totalSize is for component sizes, not the full package serialization size
977977
const { sanitizedConfig: fallbackConfig } = taptikPackage;
978-
originalSize = Buffer.from(
979-
JSON.stringify(fallbackConfig),
980-
).length;
978+
originalSize = Buffer.from(JSON.stringify(fallbackConfig)).length;
981979
}
982980

983981
// Calculate compressed size - we always need to compress to get accurate metrics

src/modules/deploy/services/deployment.service.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,9 @@ export class DeploymentService {
190190
context.content.project &&
191191
Object.keys(context.content.project).length > 0
192192
) {
193-
await this.deployProjectSettings( // eslint-disable-line no-await-in-loop
194-
193+
await this.deployProjectSettings(
194+
// eslint-disable-line no-await-in-loop
195+
195196
context.content.project as Record<string, unknown>,
196197
);
197198
(result.deployedComponents as string[]).push('project');
@@ -1030,9 +1031,10 @@ export class DeploymentService {
10301031
context.content.project &&
10311032
Object.keys(context.content.project).length > 0
10321033
) {
1033-
await this.deployProjectSettings( // eslint-disable-line no-await-in-loop
1034+
await this.deployProjectSettings(
1035+
// eslint-disable-line no-await-in-loop
10341036
context.content.project as Record<string, unknown>,
1035-
);
1037+
);
10361038
(result.deployedComponents as string[]).push('project');
10371039
result.summary.filesDeployed++;
10381040
}
@@ -1044,8 +1046,9 @@ export class DeploymentService {
10441046
);
10451047

10461048
// Trigger memory optimization after each component
1047-
await this.largeFileStreamer.optimizeMemoryUsage({ // eslint-disable-line no-await-in-loop
1048-
1049+
await this.largeFileStreamer.optimizeMemoryUsage({
1050+
// eslint-disable-line no-await-in-loop
1051+
10491052
memoryThreshold: 100 * 1024 * 1024,
10501053
enableGarbageCollection: true,
10511054
clearCaches: true,

src/modules/deploy/services/error-handler.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ export class ErrorHandlerService {
9595

9696
// Log retry attempt
9797
this.logger.log(
98-
9998
`⏳ Retry attempt ${attempt}/${config.maxAttempts} after ${delay}ms...`,
10099
);
101100

0 commit comments

Comments
 (0)