arcadible 1.0.28 → 1.0.29
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/dist/account.js +2 -3
- package/dist/action/serve/tool.js +4 -4
- package/dist/util/os.js +17 -6
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/account.js
CHANGED
|
@@ -9,7 +9,7 @@ import { HttpError } from "./util/http.js";
|
|
|
9
9
|
import { sessionExpired } from "./phrase/index.js";
|
|
10
10
|
import { deepSort, isTable } from "./util/objs.js";
|
|
11
11
|
import { configDir } from "./util/os.js";
|
|
12
|
-
import { title
|
|
12
|
+
import { title } from "./config/product.js";
|
|
13
13
|
// [declare]
|
|
14
14
|
const DIR_MODE = 0o700;
|
|
15
15
|
const FILE = "account.json";
|
|
@@ -19,9 +19,8 @@ const FILE_MODE = 0o600;
|
|
|
19
19
|
const REJECTED = [400, 401, 403];
|
|
20
20
|
// [declare]
|
|
21
21
|
const TOKEN_USER = { display_name: `${title} Token`, id: null };
|
|
22
|
-
const TOOL = tool;
|
|
23
22
|
// [define]
|
|
24
|
-
const dir =
|
|
23
|
+
const dir = configDir();
|
|
25
24
|
const file = join(dir, FILE);
|
|
26
25
|
// [function]
|
|
27
26
|
// whether a failure is the file system's, with this code, such as ENOENT.
|
|
@@ -18,7 +18,7 @@ import * as phrase from "../../phrase/index.js";
|
|
|
18
18
|
import { media } from "../../parser/media.js";
|
|
19
19
|
import { textOf } from "../../util/objs.js";
|
|
20
20
|
import { configDir } from "../../util/os.js";
|
|
21
|
-
import { title
|
|
21
|
+
import { title } from "../../config/product.js";
|
|
22
22
|
import { watchDir } from "../../serve/reload.js";
|
|
23
23
|
import { remoteFiles } from "../../serve/remote.js";
|
|
24
24
|
import { serve } from "../../serve/server.js";
|
|
@@ -165,20 +165,20 @@ export async function serveTool(conf) {
|
|
|
165
165
|
version: game.version ?? null,
|
|
166
166
|
},
|
|
167
167
|
// arc serve's own tickets, signed with a key kept beside the session
|
|
168
|
-
keyFile: join(configDir(),
|
|
168
|
+
keyFile: join(configDir(), "ticket-key.json"),
|
|
169
169
|
onRemote: handler.onRemote,
|
|
170
170
|
player,
|
|
171
171
|
port,
|
|
172
172
|
root,
|
|
173
173
|
remote: remoteFiles({
|
|
174
|
-
dir: join(configDir(),
|
|
174
|
+
dir: join(configDir(), "sdk"),
|
|
175
175
|
host: HOST_HTTP_PLAY,
|
|
176
176
|
sdk: ARCADIBLE_SDK,
|
|
177
177
|
}),
|
|
178
178
|
...(runs && runnerMain
|
|
179
179
|
? {
|
|
180
180
|
runner: {
|
|
181
|
-
dir: join(configDir(),
|
|
181
|
+
dir: join(configDir(), "runner"),
|
|
182
182
|
handler: {
|
|
183
183
|
onError: handler.onRunnerError,
|
|
184
184
|
onInstall: handler.onRunnerInstall,
|
package/dist/util/os.js
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
// [import]
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
// [import]
|
|
5
|
+
import { tool } from "../config/product.js";
|
|
4
6
|
// [function]
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
7
|
+
// arc's own folder, which holds the session and arc serve's key and caches:
|
|
8
|
+
// ARCADIBLE_CONFIG_DIR when it's set (left out of the developer docs on
|
|
9
|
+
// purpose, as ARCADIBLE_TOKEN is: it gives an agent or a test a folder of its
|
|
10
|
+
// own), or else ~/.config/arc, or on Windows the machine's own folder
|
|
11
|
+
// (%LOCALAPPDATA%\arc), not the roaming one: the session is a credential, and
|
|
12
|
+
// the SDK's copy a cache, neither of which should follow a roaming profile to
|
|
13
|
+
// other machines
|
|
8
14
|
export function configDir() {
|
|
15
|
+
const dir = process.env["ARCADIBLE_CONFIG_DIR"];
|
|
16
|
+
if (dir) {
|
|
17
|
+
return resolve(dir);
|
|
18
|
+
}
|
|
9
19
|
if (process.platform === "win32") {
|
|
10
|
-
|
|
20
|
+
const local = process.env["LOCALAPPDATA"] || join(homedir(), "AppData", "Local");
|
|
21
|
+
return join(local, tool);
|
|
11
22
|
}
|
|
12
|
-
return join(homedir(), ".config");
|
|
23
|
+
return join(homedir(), ".config", tool);
|
|
13
24
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"license": "Apache-2.0",
|
|
45
45
|
"name": "arcadible",
|
|
46
|
-
"version": "1.0.
|
|
46
|
+
"version": "1.0.29"
|
|
47
47
|
},
|
|
48
48
|
"node_modules/@asamuzakjp/css-color": {
|
|
49
49
|
"dependencies": {
|
|
@@ -3252,5 +3252,5 @@
|
|
|
3252
3252
|
}
|
|
3253
3253
|
},
|
|
3254
3254
|
"requires": true,
|
|
3255
|
-
"version": "1.0.
|
|
3255
|
+
"version": "1.0.29"
|
|
3256
3256
|
}
|
package/package.json
CHANGED