@playcraft/cli 0.1.74 → 0.1.75

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.
@@ -8,21 +8,9 @@ import { excludeFromGit } from './dependencies.js';
8
8
  import { hashAttachment, probeAttachmentVideo } from './video-attachments.js';
9
9
  import { resolveLibraryAttachment } from './library-attachments.js';
10
10
  import { resolveWorkspaceDirectoryAttachment } from './directory-attachments.js';
11
- async function attachmentRoot(root) {
12
- // Reject redirected upload directories, including symlinks that stay inside the workspace.
13
- let directory = root;
14
- for (const part of WORKSPACE_USER_UPLOADS_DIRECTORY.split('/')) {
15
- directory = join(directory, part);
16
- // shared
17
- await mkdir(directory, { mode: 0o755 }).catch((error) => {
18
- if (error.code !== 'EEXIST')
19
- throw error;
20
- });
21
- if (!(await lstat(directory)).isDirectory())
22
- throw new Error('invalid_attachment');
23
- await chmod(directory, 0o755);
24
- }
25
- return directory;
11
+ import { ensureSharedDirectory } from './shared-write.js';
12
+ function attachmentRoot(root) {
13
+ return ensureSharedDirectory(root, join(root, WORKSPACE_USER_UPLOADS_DIRECTORY));
26
14
  }
27
15
  export function imageMime(bytes) {
28
16
  if (bytes.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10])))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcraft/cli",
3
- "version": "0.1.74",
3
+ "version": "0.1.75",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -57,8 +57,8 @@
57
57
  "@gltf-transform/core": "^4.3.0",
58
58
  "@gltf-transform/extensions": "^4.3.0",
59
59
  "@gltf-transform/functions": "^4.3.0",
60
- "@playcraft/build": "0.1.74",
61
- "@playcraft/common": "0.1.74",
60
+ "@playcraft/build": "0.1.75",
61
+ "@playcraft/common": "0.1.75",
62
62
  "better-sqlite3-pinned": "npm:better-sqlite3@13.0.3",
63
63
  "chokidar": "^4.0.3",
64
64
  "commander": "^13.1.0",