@shumai-one/shumai-transcode 0.0.5 → 0.0.7

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.
@@ -54,8 +54,10 @@ if (!binaryPath) {
54
54
 
55
55
  const appJsPath = join(__dirname, 'shumai-transcode-app.js')
56
56
 
57
+ let activeProcess = null
58
+
57
59
  function startApp() {
58
- const child = spawn(binaryPath, ['run', appJsPath, ...process.argv.slice(2)], {
60
+ activeProcess = spawn(binaryPath, ['run', appJsPath, ...process.argv.slice(2)], {
59
61
  stdio: 'inherit',
60
62
  env: {
61
63
  ...process.env,
@@ -63,11 +65,11 @@ function startApp() {
63
65
  },
64
66
  })
65
67
 
66
- child.on('close', (code) => {
68
+ activeProcess.on('close', (code) => {
67
69
  process.exit(code ?? 0)
68
70
  })
69
71
 
70
- child.on('error', (err) => {
72
+ activeProcess.on('error', (err) => {
71
73
  console.error(`Failed to start child process:`, err)
72
74
  process.exit(1)
73
75
  })
@@ -113,7 +115,7 @@ console.log(`ℹ️ [shumai-transcode] DATABASE_URL is: ${process.env.DATABASE_U
113
115
  const prismaSchemaPath = join(__dirname, '..', 'prisma', 'schema.prisma')
114
116
  if (existsSync(prismaSchemaPath)) {
115
117
  console.log('🔄 Running database migrations...')
116
- const migrationProcess = spawn(
118
+ activeProcess = spawn(
117
119
  binaryPath,
118
120
  ['run', 'prisma', 'migrate', 'deploy', '--schema', './prisma/schema.prisma'],
119
121
  {
@@ -126,7 +128,7 @@ if (existsSync(prismaSchemaPath)) {
126
128
  }
127
129
  )
128
130
 
129
- migrationProcess.on('close', (code) => {
131
+ activeProcess.on('close', (code) => {
130
132
  if (code !== 0) {
131
133
  console.error(`❌ Database migration failed with code ${code}. Exiting.`)
132
134
  process.exit(code ?? 1)
@@ -134,10 +136,24 @@ if (existsSync(prismaSchemaPath)) {
134
136
  startApp()
135
137
  })
136
138
 
137
- migrationProcess.on('error', (err) => {
139
+ activeProcess.on('error', (err) => {
138
140
  console.error('❌ Failed to run database migrations:', err)
139
141
  process.exit(1)
140
142
  })
141
143
  } else {
142
144
  startApp()
143
145
  }
146
+
147
+ // Forward kill signals to the active child process
148
+ const cleanupAndExit = (signal) => {
149
+ if (activeProcess && !activeProcess.killed) {
150
+ activeProcess.kill(signal)
151
+ } else {
152
+ process.exit(0)
153
+ }
154
+ }
155
+
156
+ process.on('SIGINT', () => cleanupAndExit('SIGINT'))
157
+ process.on('SIGTERM', () => cleanupAndExit('SIGTERM'))
158
+ process.on('SIGQUIT', () => cleanupAndExit('SIGQUIT'))
159
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shumai-one/shumai-transcode",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Media transcoding worker for the shumai media workspace",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,12 +25,12 @@
25
25
  "prisma": "7.8.0"
26
26
  },
27
27
  "optionalDependencies": {
28
- "@shumai-one/shumai-transcode-darwin-arm64": "0.0.5",
29
- "@shumai-one/shumai-transcode-darwin-x64": "0.0.5",
30
- "@shumai-one/shumai-transcode-linux-arm64": "0.0.5",
31
- "@shumai-one/shumai-transcode-linux-x64": "0.0.5",
32
- "@shumai-one/shumai-transcode-win32-arm64": "0.0.5",
33
- "@shumai-one/shumai-transcode-win32-x64": "0.0.5"
28
+ "@shumai-one/shumai-transcode-darwin-arm64": "0.0.7",
29
+ "@shumai-one/shumai-transcode-darwin-x64": "0.0.7",
30
+ "@shumai-one/shumai-transcode-linux-arm64": "0.0.7",
31
+ "@shumai-one/shumai-transcode-linux-x64": "0.0.7",
32
+ "@shumai-one/shumai-transcode-win32-arm64": "0.0.7",
33
+ "@shumai-one/shumai-transcode-win32-x64": "0.0.7"
34
34
  },
35
35
  "repository": {
36
36
  "type": "git",
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "sandboxes" ADD COLUMN "pending_domains" TEXT[] DEFAULT ARRAY[]::TEXT[];
@@ -0,0 +1,6 @@
1
+ -- AlterTable: Change sort_index column collation to "C"
2
+ ALTER TABLE "assets" ALTER COLUMN "sort_index" TYPE TEXT COLLATE "C";
3
+
4
+ -- Recreate index on sort_index with "C" collation
5
+ DROP INDEX IF EXISTS "assets_sort_index_idx";
6
+ CREATE INDEX "assets_sort_index_idx" ON "assets" ("sort_index" COLLATE "C");
@@ -236,6 +236,7 @@ model Team {
236
236
  model Sandbox {
237
237
  id String @id @default(ulid())
238
238
  allowedDomains String[] @default(["npmjs.org", "*.npmjs.org", "registry.npmjs.org", "registry.yarnpkg.com", "pypi.org", "*.pypi.org", "github.com", "*.github.com", "api.github.com", "raw.githubusercontent.com"])
239
+ pendingDomains String[] @default([]) @map("pending_domains")
239
240
  createdAt DateTime @default(now()) @map("created_at")
240
241
  updatedAt DateTime @updatedAt @map("updated_at")
241
242