@multiplayer-app/cli 1.3.36 → 2.0.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/.turbo/turbo-build.log +20 -0
- package/.turbo/turbo-lint.log +5 -0
- package/README.md +123 -30
- package/dist/highlights-eq9cgrbb.scm +604 -0
- package/dist/highlights-ghv9g403.scm +205 -0
- package/dist/highlights-hk7bwhj4.scm +284 -0
- package/dist/highlights-r812a2qc.scm +150 -0
- package/dist/highlights-x6tmsnaa.scm +115 -0
- package/dist/index.js +177063 -0
- package/dist/injections-73j83es3.scm +27 -0
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/eslint.config.js +135 -0
- package/package.json +30 -34
- package/LICENSE +0 -21
- package/bin/multiplayer-app-cli +0 -116
- package/src/api.js +0 -97
- package/src/commands/deployments/create.js +0 -70
- package/src/commands/releases/create.js +0 -55
- package/src/commands/sourcemaps/upload.js +0 -76
- package/src/helper.js +0 -5
- package/src/index.js +0 -3
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import fs from 'fs'
|
|
2
|
-
import path from 'path'
|
|
3
|
-
import * as API from '../../api.js'
|
|
4
|
-
import { decodeJwtToken } from '../../helper.js'
|
|
5
|
-
|
|
6
|
-
const collectSourcemaps = (dir) => {
|
|
7
|
-
const entries = fs.readdirSync(dir, { withFileTypes: true })
|
|
8
|
-
const files = []
|
|
9
|
-
|
|
10
|
-
for (const entry of entries) {
|
|
11
|
-
const fullPath = path.join(dir, entry.name)
|
|
12
|
-
if (entry.isDirectory()) {
|
|
13
|
-
files.push(...collectSourcemaps(fullPath))
|
|
14
|
-
} else if (entry.isFile() && entry.name.endsWith('.map')) {
|
|
15
|
-
files.push(fullPath)
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return files
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const upload = async (directories, options, callback) => {
|
|
22
|
-
try {
|
|
23
|
-
const { apiKey, service, release, baseUrl } = options
|
|
24
|
-
|
|
25
|
-
const jwtToken = decodeJwtToken(apiKey) || {}
|
|
26
|
-
|
|
27
|
-
const branchId = await API.getDefaultBranchId(
|
|
28
|
-
apiKey,
|
|
29
|
-
jwtToken.workspace,
|
|
30
|
-
jwtToken.project,
|
|
31
|
-
baseUrl,
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
const serviceId = await API.getEntityId(
|
|
35
|
-
apiKey,
|
|
36
|
-
jwtToken.workspace,
|
|
37
|
-
jwtToken.project,
|
|
38
|
-
branchId,
|
|
39
|
-
service,
|
|
40
|
-
'platform_component',
|
|
41
|
-
baseUrl,
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
const releaseId = await API.getReleaseId(
|
|
45
|
-
apiKey,
|
|
46
|
-
jwtToken.workspace,
|
|
47
|
-
jwtToken.project,
|
|
48
|
-
serviceId,
|
|
49
|
-
release,
|
|
50
|
-
baseUrl,
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
const files = directories.flatMap(collectSourcemaps)
|
|
54
|
-
|
|
55
|
-
if (files.length === 0) {
|
|
56
|
-
return callback(new Error(`No sourcemap files found in directories: ${directories.join(', ')}`), null)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
for (const filePath of files) {
|
|
60
|
-
const stream = fs.createReadStream(filePath)
|
|
61
|
-
await API.uploadSourcemap(
|
|
62
|
-
apiKey,
|
|
63
|
-
jwtToken.workspace,
|
|
64
|
-
jwtToken.project,
|
|
65
|
-
releaseId,
|
|
66
|
-
filePath,
|
|
67
|
-
stream,
|
|
68
|
-
baseUrl,
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
callback(null, { message: `Uploaded ${files.length} sourcemap(s) successfully` })
|
|
73
|
-
} catch (err) {
|
|
74
|
-
callback(err, null)
|
|
75
|
-
}
|
|
76
|
-
}
|
package/src/helper.js
DELETED
package/src/index.js
DELETED