@shumai-one/shumai-transcode 0.0.5 → 0.0.6
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/bin/shumai-transcode-app.js +29 -20
- package/bin/shumai-transcode.js +22 -6
- package/package.json +7 -7
- package/prisma/migrations/20260614155934_add_pending_domains/migration.sql +2 -0
- package/prisma/migrations/20260615115103_add_c_collation_to_sort_index/migration.sql +6 -0
- package/prisma/schema.prisma +1 -0
package/bin/shumai-transcode.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
68
|
+
activeProcess.on('close', (code) => {
|
|
67
69
|
process.exit(code ?? 0)
|
|
68
70
|
})
|
|
69
71
|
|
|
70
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.0.6",
|
|
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.
|
|
29
|
-
"@shumai-one/shumai-transcode-darwin-x64": "0.0.
|
|
30
|
-
"@shumai-one/shumai-transcode-linux-arm64": "0.0.
|
|
31
|
-
"@shumai-one/shumai-transcode-linux-x64": "0.0.
|
|
32
|
-
"@shumai-one/shumai-transcode-win32-arm64": "0.0.
|
|
33
|
-
"@shumai-one/shumai-transcode-win32-x64": "0.0.
|
|
28
|
+
"@shumai-one/shumai-transcode-darwin-arm64": "0.0.6",
|
|
29
|
+
"@shumai-one/shumai-transcode-darwin-x64": "0.0.6",
|
|
30
|
+
"@shumai-one/shumai-transcode-linux-arm64": "0.0.6",
|
|
31
|
+
"@shumai-one/shumai-transcode-linux-x64": "0.0.6",
|
|
32
|
+
"@shumai-one/shumai-transcode-win32-arm64": "0.0.6",
|
|
33
|
+
"@shumai-one/shumai-transcode-win32-x64": "0.0.6"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
@@ -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");
|
package/prisma/schema.prisma
CHANGED
|
@@ -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
|
|