arcadible 1.0.23 → 1.0.25
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/README.md +1 -0
- package/bin/arc.js +1 -85
- package/dist/account.js +197 -0
- package/dist/action/build/tool.js +61 -0
- package/dist/action/delete/tool.js +47 -0
- package/dist/action/deploy/rebuilt.js +25 -0
- package/dist/action/deploy/result.js +36 -0
- package/dist/action/deploy/timeout.js +18 -0
- package/dist/action/deploy/tool-git.js +49 -0
- package/dist/action/deploy/tool.js +49 -0
- package/dist/action/deploy/wait.js +104 -0
- package/dist/action/function/tool.js +127 -0
- package/dist/action/game.js +62 -0
- package/dist/action/init/manifest.js +64 -0
- package/dist/action/init/tool-patch.js +15 -0
- package/dist/action/init/tool.js +64 -0
- package/dist/action/inspect/tool.js +13 -0
- package/dist/action/key/tool.js +88 -0
- package/dist/action/login/flow.js +69 -0
- package/dist/action/login/tool.js +8 -0
- package/dist/action/logout/tool.js +8 -0
- package/dist/action/open/tool.js +30 -0
- package/dist/action/pack/limits.js +46 -0
- package/dist/action/pack/tool.js +148 -0
- package/dist/action/pack/unsound.js +51 -0
- package/dist/action/play/tool.js +84 -0
- package/dist/action/predeploy/ac.js +75 -0
- package/dist/action/predeploy/game.js +6 -0
- package/dist/action/predeploy/git.js +151 -0
- package/dist/action/predeploy/pm.js +20 -0
- package/dist/action/predeploy/published.js +54 -0
- package/dist/action/predeploy/secrets.js +35 -0
- package/dist/action/predeploy/tool-git.js +103 -0
- package/dist/action/predeploy/tool.js +14 -0
- package/dist/action/secret/tool.js +91 -0
- package/dist/action/serve/tool.js +270 -0
- package/dist/action/validate/checked.js +28 -0
- package/dist/action/validate/tool.js +56 -0
- package/dist/action/validate/unknown.js +58 -0
- package/dist/action/validate/unsound.js +99 -0
- package/dist/action/value/tool.js +216 -0
- package/dist/action/whoami/tool.js +7 -0
- package/dist/api.js +312 -0
- package/dist/arc.js +41 -0
- package/dist/cli/argv.js +61 -0
- package/dist/cli/channel.js +29 -0
- package/dist/cli/command.js +163 -0
- package/dist/cli/confirm.js +39 -0
- package/dist/cli/options.js +62 -0
- package/dist/cli/rc.js +103 -0
- package/dist/cli/yargs.js +40 -0
- package/dist/command/build.js +68 -0
- package/dist/command/delete.js +66 -0
- package/dist/command/deploy.js +308 -0
- package/dist/command/function/index.js +17 -0
- package/dist/command/function/pause.js +18 -0
- package/dist/command/function/resume.js +18 -0
- package/dist/command/function/run.js +41 -0
- package/dist/command/function/secret/index.js +15 -0
- package/dist/command/function/secret/list.js +27 -0
- package/dist/command/function/secret/name.js +8 -0
- package/dist/command/function/secret/remove.js +26 -0
- package/dist/command/function/secret/run.js +52 -0
- package/dist/command/function/secret/set.js +48 -0
- package/dist/command/function/status.js +40 -0
- package/dist/command/init.js +128 -0
- package/dist/command/inspect.js +39 -0
- package/dist/command/login.js +108 -0
- package/dist/command/logout.js +24 -0
- package/dist/command/open.js +49 -0
- package/dist/command/pack.js +90 -0
- package/dist/command/play.js +81 -0
- package/dist/command/serve.js +177 -0
- package/dist/command/server/index.js +17 -0
- package/dist/command/server/key/create.js +36 -0
- package/dist/command/server/key/index.js +15 -0
- package/dist/command/server/key/list.js +34 -0
- package/dist/command/server/key/revoke.js +24 -0
- package/dist/command/server/key/run.js +54 -0
- package/dist/command/validate.js +47 -0
- package/dist/command/value/get.js +21 -0
- package/dist/command/value/index.js +19 -0
- package/dist/command/value/key.js +8 -0
- package/dist/command/value/list.js +41 -0
- package/dist/command/value/remove.js +26 -0
- package/dist/command/value/set.js +62 -0
- package/dist/command/value/usage.js +69 -0
- package/dist/command/whoami.js +55 -0
- package/dist/commands.js +100 -0
- package/dist/config/ai.js +2 -0
- package/dist/config/art.js +13 -0
- package/dist/config/audience.js +2 -0
- package/dist/config/code.js +129 -0
- package/dist/config/file.js +13 -0
- package/dist/config/genre.js +19 -0
- package/{src → dist}/config/html.js +2 -7
- package/dist/config/image.js +5 -0
- package/dist/config/input.js +11 -0
- package/dist/config/json.js +23 -0
- package/dist/config/limit.js +14 -0
- package/dist/config/orientation.js +11 -0
- package/dist/config/package.js +8 -0
- package/dist/config/product.js +14 -0
- package/dist/config/template.js +37 -0
- package/dist/config/uri.js +18 -0
- package/dist/config/url.js +11 -0
- package/dist/config/video.js +5 -0
- package/dist/config/visibility.js +2 -0
- package/dist/config/workflow.js +7 -0
- package/dist/parser/env.js +61 -0
- package/dist/parser/given.js +8 -0
- package/dist/parser/manifest.js +45 -0
- package/dist/parser/media.js +57 -0
- package/dist/parser/project.js +129 -0
- package/dist/parser/readme-file.js +44 -0
- package/dist/parser/readme.js +70 -0
- package/dist/parser/sections.js +92 -0
- package/dist/parser/self.js +16 -0
- package/dist/phrase/account.js +35 -0
- package/dist/phrase/common.js +139 -0
- package/dist/phrase/deploy.js +192 -0
- package/dist/phrase/function.js +139 -0
- package/dist/phrase/game.js +27 -0
- package/dist/phrase/index.js +16 -0
- package/dist/phrase/init.js +53 -0
- package/dist/phrase/internal.js +61 -0
- package/dist/phrase/manifest.js +120 -0
- package/dist/phrase/media.js +90 -0
- package/dist/phrase/pack.js +69 -0
- package/dist/phrase/serve.js +84 -0
- package/dist/phrase/server.js +38 -0
- package/dist/phrase/value.js +55 -0
- package/dist/runner/bundle.js +45 -0
- package/dist/runner/entry.js +57 -0
- package/dist/runner/outbound.js +69 -0
- package/dist/schema/check/game.js +29 -0
- package/dist/schema/check/workflow.js +57 -0
- package/dist/schema/game.js +462 -0
- package/dist/schema/message.js +61 -0
- package/dist/schema/readme.js +27 -0
- package/dist/schema/runner.js +43 -0
- package/dist/schema/server.js +91 -0
- package/dist/schema/workflow.js +99 -0
- package/dist/serve/files.js +39 -0
- package/dist/serve/game.js +172 -0
- package/dist/serve/page.js +689 -0
- package/dist/serve/reload.js +55 -0
- package/dist/serve/remote.js +114 -0
- package/dist/serve/runner.js +303 -0
- package/dist/serve/server.js +169 -0
- package/dist/serve/ticket.js +232 -0
- package/dist/serve/values.js +317 -0
- package/dist/util/bytes.js +16 -0
- package/dist/util/chars.js +19 -0
- package/dist/util/command.js +11 -0
- package/dist/util/delay.js +36 -0
- package/dist/util/doc.js +59 -0
- package/dist/util/error.js +35 -0
- package/dist/util/http.js +13 -0
- package/dist/util/image.js +64 -0
- package/dist/util/links.js +45 -0
- package/dist/util/lockfile.js +17 -0
- package/dist/util/log.js +101 -0
- package/dist/util/md.js +37 -0
- package/dist/util/media.js +27 -0
- package/dist/util/objs.js +46 -0
- package/dist/util/os.js +13 -0
- package/dist/util/output.js +133 -0
- package/dist/util/paths.js +8 -0
- package/dist/util/progress.js +57 -0
- package/dist/util/promise.js +18 -0
- package/dist/util/request.js +103 -0
- package/dist/util/s3.js +67 -0
- package/dist/util/schema.js +151 -0
- package/dist/util/screenshot.js +24 -0
- package/dist/util/shape.js +49 -0
- package/dist/util/shell.js +64 -0
- package/dist/util/size.js +32 -0
- package/dist/util/spinner.js +35 -0
- package/dist/util/strs.js +46 -0
- package/dist/util/table.js +18 -0
- package/dist/util/term.js +21 -0
- package/dist/util/time.js +16 -0
- package/dist/util/toml.js +28 -0
- package/{src → dist}/util/uris.js +8 -14
- package/dist/util/video.js +113 -0
- package/dist/util/zip.js +62 -0
- package/npm-shrinkwrap.json +3256 -0
- package/package.json +41 -39
- package/bin/arc-build.js +0 -139
- package/bin/arc-default.js +0 -65
- package/bin/arc-deploy.js +0 -456
- package/bin/arc-init.js +0 -187
- package/bin/arc-inspect.js +0 -97
- package/bin/arc-login.js +0 -165
- package/bin/arc-logout.js +0 -75
- package/bin/arc-open.js +0 -104
- package/bin/arc-pack.js +0 -146
- package/bin/arc-play.js +0 -140
- package/bin/arc-serve.js +0 -214
- package/bin/arc-validate.js +0 -112
- package/bin/arc-whoami.js +0 -119
- package/src/account.js +0 -249
- package/src/action/build/tool.js +0 -80
- package/src/action/deploy/tool-git.js +0 -90
- package/src/action/deploy/tool.js +0 -88
- package/src/action/deploy/wait.js +0 -151
- package/src/action/init/manifest.js +0 -83
- package/src/action/init/tool-patch.js +0 -32
- package/src/action/init/tool.js +0 -97
- package/src/action/inspect/tool.js +0 -26
- package/src/action/login/flow.js +0 -101
- package/src/action/login/tool.js +0 -16
- package/src/action/logout/tool.js +0 -15
- package/src/action/open/tool.js +0 -38
- package/src/action/pack/limits.js +0 -51
- package/src/action/pack/tool.js +0 -171
- package/src/action/pack/unsound.js +0 -69
- package/src/action/play/tool.js +0 -109
- package/src/action/predeploy/ac.js +0 -112
- package/src/action/predeploy/git.js +0 -223
- package/src/action/predeploy/pm.js +0 -37
- package/src/action/predeploy/published.js +0 -82
- package/src/action/predeploy/tool-git.js +0 -154
- package/src/action/predeploy/tool.js +0 -29
- package/src/action/serve/tool.js +0 -209
- package/src/action/validate/checked.js +0 -37
- package/src/action/validate/tool.js +0 -67
- package/src/action/validate/unknown.js +0 -86
- package/src/action/validate/unsound.js +0 -138
- package/src/action/whoami/tool.js +0 -15
- package/src/api.js +0 -163
- package/src/cli/build.js +0 -15
- package/src/cli/deploy.js +0 -21
- package/src/cli/init.js +0 -17
- package/src/cli/inspect.js +0 -15
- package/src/cli/login.js +0 -15
- package/src/cli/logout.js +0 -15
- package/src/cli/open.js +0 -15
- package/src/cli/pack.js +0 -15
- package/src/cli/play.js +0 -15
- package/src/cli/predeploy.js +0 -21
- package/src/cli/serve.js +0 -15
- package/src/cli/validate.js +0 -15
- package/src/cli/whoami.js +0 -15
- package/src/config/ai.js +0 -5
- package/src/config/art.js +0 -16
- package/src/config/audience.js +0 -5
- package/src/config/code.js +0 -142
- package/src/config/file.js +0 -23
- package/src/config/genre.js +0 -22
- package/src/config/image.js +0 -7
- package/src/config/input.js +0 -14
- package/src/config/limit.js +0 -21
- package/src/config/orientation.js +0 -14
- package/src/config/package.js +0 -5
- package/src/config/product.js +0 -5
- package/src/config/template.js +0 -45
- package/src/config/uri.js +0 -27
- package/src/config/url.js +0 -20
- package/src/config/video.js +0 -7
- package/src/config/visibility.js +0 -5
- package/src/config/workflow.js +0 -18
- package/src/parser/env.js +0 -84
- package/src/parser/given.js +0 -17
- package/src/parser/manifest.js +0 -80
- package/src/parser/media.js +0 -90
- package/src/parser/project.js +0 -166
- package/src/parser/readme-file.js +0 -76
- package/src/parser/readme.js +0 -96
- package/src/parser/sections.js +0 -107
- package/src/parser/self.js +0 -27
- package/src/phrase.js +0 -1294
- package/src/schema/check/game.js +0 -61
- package/src/schema/check/workflow.js +0 -99
- package/src/schema/game.js +0 -649
- package/src/schema/message.js +0 -85
- package/src/schema/readme.js +0 -44
- package/src/schema/workflow.js +0 -150
- package/src/serve/files.js +0 -61
- package/src/serve/game.js +0 -191
- package/src/serve/page.js +0 -345
- package/src/serve/reload.js +0 -68
- package/src/serve/remote.js +0 -121
- package/src/serve/server.js +0 -128
- package/src/util/argv.js +0 -116
- package/src/util/bytes.js +0 -25
- package/src/util/chars.js +0 -30
- package/src/util/command.js +0 -18
- package/src/util/delay.js +0 -52
- package/src/util/doc.js +0 -72
- package/src/util/error.js +0 -50
- package/src/util/http.js +0 -25
- package/src/util/image.js +0 -93
- package/src/util/links.js +0 -78
- package/src/util/lockfile.js +0 -35
- package/src/util/log.js +0 -149
- package/src/util/md.js +0 -61
- package/src/util/media.js +0 -40
- package/src/util/objs.js +0 -45
- package/src/util/os.js +0 -27
- package/src/util/output.js +0 -174
- package/src/util/paths.js +0 -21
- package/src/util/progress.js +0 -85
- package/src/util/promise.js +0 -29
- package/src/util/rc.js +0 -144
- package/src/util/request.js +0 -89
- package/src/util/s3.js +0 -92
- package/src/util/schema.js +0 -189
- package/src/util/screenshot.js +0 -37
- package/src/util/shell.js +0 -84
- package/src/util/size.js +0 -53
- package/src/util/spinner.js +0 -52
- package/src/util/strs.js +0 -73
- package/src/util/term.js +0 -28
- package/src/util/time.js +0 -29
- package/src/util/toml.js +0 -14
- package/src/util/video.js +0 -157
- package/src/util/zip.js +0 -88
- /package/{src/serve → assets}/favicon.ico +0 -0
package/src/config/code.js
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// every code a failure can have (OUTPUT.md, Codes), each with an entry on
|
|
3
|
-
// the Errors page. A code names one condition with one fix, as its subject
|
|
4
|
-
// then its state. It's never renamed, reused, or removed, and a new one can
|
|
5
|
-
// be added in any release.
|
|
6
|
-
|
|
7
|
-
// [declare]
|
|
8
|
-
|
|
9
|
-
// the CLI's own codes.
|
|
10
|
-
const CLI = {
|
|
11
|
-
API_REFUSED: "api_refused",
|
|
12
|
-
API_UNREACHABLE: "api_unreachable",
|
|
13
|
-
ARGUMENT_INVALID: "argument_invalid",
|
|
14
|
-
BUILD_FAILED: "build_failed",
|
|
15
|
-
DEPLOY_DIR_MISSING: "deploy_dir_missing",
|
|
16
|
-
DEPLOY_RATE_LIMITED: "deploy_rate_limited",
|
|
17
|
-
GAME_HANDLE_TAKEN: "game_handle_taken",
|
|
18
|
-
GAME_ID_MISSING: "game_id_missing",
|
|
19
|
-
GAME_NOT_DEPLOYED: "game_not_deployed",
|
|
20
|
-
GAME_NOT_FOUND: "game_not_found",
|
|
21
|
-
GIT_REMOTE_MISSING: "git_remote_missing",
|
|
22
|
-
GIT_REMOTE_UNREACHABLE: "git_remote_unreachable",
|
|
23
|
-
GIT_REPO_MISSING: "git_repo_missing",
|
|
24
|
-
GIT_TAG_CREATE_FAILED: "git_tag_create_failed",
|
|
25
|
-
GIT_TAG_EXISTS: "git_tag_exists",
|
|
26
|
-
GIT_TAG_PUSH_FAILED: "git_tag_push_failed",
|
|
27
|
-
GIT_UNCOMMITTED: "git_uncommitted",
|
|
28
|
-
LOCKFILE_MISSING: "lockfile_missing",
|
|
29
|
-
LOGIN_CODE_EXPIRED: "login_code_expired",
|
|
30
|
-
LOGIN_FAILED: "login_failed",
|
|
31
|
-
MANIFEST_MISSING: "manifest_missing",
|
|
32
|
-
NOT_LOGGED_IN: "not_logged_in",
|
|
33
|
-
PACKAGE_FILE_TOO_LARGE: "package_file_too_large",
|
|
34
|
-
PACKAGE_INDEX_MISSING: "package_index_missing",
|
|
35
|
-
PACKAGE_PATH_RESERVED: "package_path_reserved",
|
|
36
|
-
PACKAGE_TOO_LARGE: "package_too_large",
|
|
37
|
-
PACKAGE_TOO_MANY_FILES: "package_too_many_files",
|
|
38
|
-
PACKAGE_UNCOMPRESSED_TOO_LARGE: "package_uncompressed_too_large",
|
|
39
|
-
PARSE_FAILED: "parse_failed",
|
|
40
|
-
PATH_NOT_FOUND: "path_not_found",
|
|
41
|
-
PORT_IN_USE: "port_in_use",
|
|
42
|
-
PROJECT_NOT_REPO_ROOT: "project_not_repo_root",
|
|
43
|
-
SESSION_EXPIRED: "session_expired",
|
|
44
|
-
TEMPLATE_MISSING: "template_missing",
|
|
45
|
-
TEMPLATE_UNAVAILABLE: "template_unavailable",
|
|
46
|
-
UPLOAD_FAILED: "upload_failed",
|
|
47
|
-
VALIDATION_FAILED: "validation_failed",
|
|
48
|
-
WAIT_TIMED_OUT: "wait_timed_out",
|
|
49
|
-
};
|
|
50
|
-
// a release's reasons, from the pipeline (the API's
|
|
51
|
-
// db/type/release_reason.sql). The CLI shares them, so a name means the same
|
|
52
|
-
// thing wherever it appears: GAME_HANDLE_CHANGED, GAME_UNAVAILABLE, INTERNAL,
|
|
53
|
-
// as well as REPO_NOT_CONNECTED and VERSION_EXISTS, are the CLI's too.
|
|
54
|
-
const RELEASE = {
|
|
55
|
-
BUILD_RATE_LIMITED: "build_rate_limited",
|
|
56
|
-
GAME_HANDLE_CHANGED: "game_handle_changed",
|
|
57
|
-
GAME_LIMIT_REACHED: "game_limit_reached",
|
|
58
|
-
GAME_MISMATCH: "game_mismatch",
|
|
59
|
-
GAME_UNAVAILABLE: "game_unavailable",
|
|
60
|
-
GITHUB_APP_NOT_INSTALLED: "github_app_not_installed",
|
|
61
|
-
INTERNAL: "internal",
|
|
62
|
-
MANIFEST_INVALID: "manifest_invalid",
|
|
63
|
-
RELEASE_EXPIRED: "release_expired",
|
|
64
|
-
REPO_NOT_CONNECTED: "repo_not_connected",
|
|
65
|
-
VERSION_EXISTS: "version_exists",
|
|
66
|
-
VERSION_MISMATCH: "version_mismatch",
|
|
67
|
-
ZIP_INVALID: "zip_invalid",
|
|
68
|
-
ZIP_MISSING: "zip_missing",
|
|
69
|
-
ZIP_TOO_LARGE: "zip_too_large",
|
|
70
|
-
};
|
|
71
|
-
// the Arcadible check's own codes on GitHub, for a `git` release that fails
|
|
72
|
-
// before there's a release (the queue publisher and subscriber Lambdas). `arc deploy git`
|
|
73
|
-
// checks for workflow_missing before it pushes.
|
|
74
|
-
const GITHUB = {
|
|
75
|
-
GIT_TAG_INVALID: "git_tag_invalid",
|
|
76
|
-
WORKFLOW_MISSING: "workflow_missing",
|
|
77
|
-
};
|
|
78
|
-
// an `arc validate` issue's codes, named for the rule it breaks; the field
|
|
79
|
-
// is the issue's path. They follow the same rules, and share the Errors
|
|
80
|
-
// page, so no issue code is also an error code.
|
|
81
|
-
const ISSUE = {
|
|
82
|
-
CHARACTERS_INVALID: "characters_invalid",
|
|
83
|
-
DESCRIPTION_RULES_MISSING: "description_rules_missing",
|
|
84
|
-
DUPLICATE: "duplicate",
|
|
85
|
-
EMPTY: "empty",
|
|
86
|
-
INDEX_MISSING: "index_missing",
|
|
87
|
-
INVALID: "invalid",
|
|
88
|
-
MARKDOWN_INVALID: "markdown_invalid",
|
|
89
|
-
MEDIA_INVALID: "media_invalid",
|
|
90
|
-
OPTION_INVALID: "option_invalid",
|
|
91
|
-
OUT_OF_RANGE: "out_of_range",
|
|
92
|
-
PATH_INVALID: "path_invalid",
|
|
93
|
-
REQUIRED: "required",
|
|
94
|
-
SCREENSHOT_NUMBER_REPEATED: "screenshot_number_repeated",
|
|
95
|
-
TOO_LONG: "too_long",
|
|
96
|
-
TOO_MANY: "too_many",
|
|
97
|
-
TOO_SHORT: "too_short",
|
|
98
|
-
TYPE_INVALID: "type_invalid",
|
|
99
|
-
URL_INVALID: "url_invalid",
|
|
100
|
-
UUID_INVALID: "uuid_invalid",
|
|
101
|
-
VERSION_INVALID: "version_invalid",
|
|
102
|
-
};
|
|
103
|
-
// a warning's codes: what's reported without failing, in an issue's shape.
|
|
104
|
-
// they follow the same rules, and share the Errors page, so no warning code
|
|
105
|
-
// is also an error or issue code.
|
|
106
|
-
const WARNING = {
|
|
107
|
-
ART_VIDEO_UNPAIRED: "art_video_unpaired",
|
|
108
|
-
DEPLOY_DIR_NOT_BUILT: "deploy_dir_not_built",
|
|
109
|
-
FIELD_UNKNOWN: "field_unknown",
|
|
110
|
-
FIELD_UNSET: "field_unset",
|
|
111
|
-
GAME_HANDLE_LAPSED: "game_handle_lapsed",
|
|
112
|
-
GAME_HANDLE_LIMIT_REACHED: "game_handle_limit_reached",
|
|
113
|
-
PACKAGE_FILE_DEV: "package_file_dev",
|
|
114
|
-
PACKAGE_FILE_PRIVATE: "package_file_private",
|
|
115
|
-
SCREENSHOT_NAME_INVALID: "screenshot_name_invalid",
|
|
116
|
-
VERSION_UNCHECKED: "version_unchecked",
|
|
117
|
-
};
|
|
118
|
-
// every error code, for checking one exists.
|
|
119
|
-
const ALL = new Set([
|
|
120
|
-
...Object.values(CLI),
|
|
121
|
-
...Object.values(GITHUB),
|
|
122
|
-
...Object.values(RELEASE),
|
|
123
|
-
]);
|
|
124
|
-
// every issue code.
|
|
125
|
-
const ISSUES = new Set(Object.values(ISSUE));
|
|
126
|
-
// every warning code.
|
|
127
|
-
const WARNINGS = new Set(Object.values(WARNING));
|
|
128
|
-
|
|
129
|
-
// [export]
|
|
130
|
-
|
|
131
|
-
module.exports = {
|
|
132
|
-
ALL,
|
|
133
|
-
...RELEASE,
|
|
134
|
-
...CLI,
|
|
135
|
-
...GITHUB,
|
|
136
|
-
GITHUB,
|
|
137
|
-
ISSUE,
|
|
138
|
-
ISSUES,
|
|
139
|
-
RELEASE,
|
|
140
|
-
WARNING,
|
|
141
|
-
WARNINGS,
|
|
142
|
-
};
|
package/src/config/file.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [import]
|
|
4
|
-
|
|
5
|
-
const cfgproduct = require("./product");
|
|
6
|
-
|
|
7
|
-
// [declare]
|
|
8
|
-
|
|
9
|
-
const HANDLE = cfgproduct.handle;
|
|
10
|
-
const MEDIA = `.${HANDLE}`;
|
|
11
|
-
|
|
12
|
-
// [export]
|
|
13
|
-
|
|
14
|
-
// the project's files Arcadible reads, relative to its root, and the
|
|
15
|
-
// manifest arc pack writes into the zip.
|
|
16
|
-
module.exports = {
|
|
17
|
-
GALLERY: `${MEDIA}/gallery`,
|
|
18
|
-
MANIFEST: `${HANDLE}.toml`,
|
|
19
|
-
MEDIA,
|
|
20
|
-
PACKAGED: `${HANDLE}.json`,
|
|
21
|
-
// the release workflow, which builds a `git` release on GitHub Actions.
|
|
22
|
-
WORKFLOW: `.github/workflows/${HANDLE}-release.yml`,
|
|
23
|
-
};
|
package/src/config/genre.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [export]
|
|
4
|
-
|
|
5
|
-
module.exports = [
|
|
6
|
-
"action",
|
|
7
|
-
"adventure",
|
|
8
|
-
"arcade",
|
|
9
|
-
"board",
|
|
10
|
-
"card",
|
|
11
|
-
"casino",
|
|
12
|
-
"casual",
|
|
13
|
-
"music",
|
|
14
|
-
"puzzle",
|
|
15
|
-
"racing",
|
|
16
|
-
"rpg",
|
|
17
|
-
"simulation",
|
|
18
|
-
"sports",
|
|
19
|
-
"strategy",
|
|
20
|
-
"trivia",
|
|
21
|
-
"word",
|
|
22
|
-
];
|
package/src/config/image.js
DELETED
package/src/config/input.js
DELETED
package/src/config/limit.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [declare]
|
|
4
|
-
|
|
5
|
-
const MB = 1024 * 1024;
|
|
6
|
-
|
|
7
|
-
// [export]
|
|
8
|
-
|
|
9
|
-
// the limits on a packed game, as Arcadible enforces them when it publishes
|
|
10
|
-
// a release (docs: limits.md). arc pack checks them so a build that would
|
|
11
|
-
// fail there fails before it's uploaded.
|
|
12
|
-
module.exports = {
|
|
13
|
-
// the most files in the zip.
|
|
14
|
-
FILES: 10000,
|
|
15
|
-
// the largest file, uncompressed.
|
|
16
|
-
FILE_SIZE: 64 * MB,
|
|
17
|
-
// everything packed, uncompressed.
|
|
18
|
-
TOTAL_SIZE: 256 * MB,
|
|
19
|
-
// the zip of deploy_dir alone, compressed.
|
|
20
|
-
ZIP_SIZE: 64 * MB,
|
|
21
|
-
};
|
package/src/config/package.js
DELETED
package/src/config/product.js
DELETED
package/src/config/template.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [import]
|
|
4
|
-
|
|
5
|
-
const cfgproduct = require("./product");
|
|
6
|
-
const phrase = require("../phrase");
|
|
7
|
-
|
|
8
|
-
// [declare]
|
|
9
|
-
|
|
10
|
-
const HANDLE = cfgproduct.handle;
|
|
11
|
-
const STARTERS = `${HANDLE}/starters`;
|
|
12
|
-
|
|
13
|
-
// [export]
|
|
14
|
-
|
|
15
|
-
module.exports = {
|
|
16
|
-
choices: [
|
|
17
|
-
{
|
|
18
|
-
description: phrase.starterBlank(),
|
|
19
|
-
name: "Blank",
|
|
20
|
-
value: `${STARTERS}/blank`,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
description: phrase.starterThreeJs(),
|
|
24
|
-
name: "Three.js",
|
|
25
|
-
value: `${STARTERS}/threejs`,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
description: phrase.starterPhaser(),
|
|
29
|
-
name: "Phaser",
|
|
30
|
-
value: `${STARTERS}/phaser`,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
description: phrase.starterPixiJs(),
|
|
34
|
-
name: "PixiJS",
|
|
35
|
-
value: `${STARTERS}/pixijs`,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
description: phrase.starterBabylonJs(),
|
|
39
|
-
name: "Babylon.js",
|
|
40
|
-
value: `${STARTERS}/babylonjs`,
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
default: `${STARTERS}/blank`,
|
|
44
|
-
message: "Template",
|
|
45
|
-
};
|
package/src/config/uri.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [import]
|
|
4
|
-
|
|
5
|
-
const cfgproduct = require("./product");
|
|
6
|
-
|
|
7
|
-
// [declare]
|
|
8
|
-
|
|
9
|
-
const DOMAIN = cfgproduct.domain;
|
|
10
|
-
const PROTOCOL = cfgproduct.protocol;
|
|
11
|
-
|
|
12
|
-
// [export]
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
// a build origin, where arc serve fetches the SDK's hosted script
|
|
16
|
-
// (src/serve/remote.js): any of them serves it at /arcadible/sdk/. The play
|
|
17
|
-
// page's host comes from the play site, HOST_HTTP_PLAY.
|
|
18
|
-
ARCADIBLE_SDK: `https://sdk.${cfgproduct.handle}.io`,
|
|
19
|
-
HOST_APP_PLAY: `${PROTOCOL}://play`,
|
|
20
|
-
HOST_APP_STORE: `${PROTOCOL}://store`,
|
|
21
|
-
HOST_HTTP_ACCOUNT: `https://account.${DOMAIN}`,
|
|
22
|
-
HOST_HTTP_API: `https://api.${DOMAIN}`,
|
|
23
|
-
HOST_HTTP_DEVELOPER: `https://developer.${DOMAIN}`,
|
|
24
|
-
HOST_HTTP_PLAY: `https://play.${DOMAIN}`,
|
|
25
|
-
HOST_HTTP_STUDIO: `https://studio.${DOMAIN}`,
|
|
26
|
-
HOST_HTTP_WWW: `https://${DOMAIN}`,
|
|
27
|
-
};
|
package/src/config/url.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [import]
|
|
4
|
-
|
|
5
|
-
const cfgproduct = require("./product");
|
|
6
|
-
const cfguri = require("./uri");
|
|
7
|
-
|
|
8
|
-
// [declare]
|
|
9
|
-
|
|
10
|
-
const HANDLE = cfgproduct.handle;
|
|
11
|
-
|
|
12
|
-
// [export]
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
ERRORS: `${cfguri.HOST_HTTP_DEVELOPER}/references/errors`,
|
|
16
|
-
LINK: `${cfguri.HOST_HTTP_ACCOUNT}/link`,
|
|
17
|
-
MANIFEST: `${cfguri.HOST_HTTP_DEVELOPER}/references/${HANDLE}-manifest`,
|
|
18
|
-
// how to let arc serve's play page frame another server.
|
|
19
|
-
SERVE_URL: `${cfguri.HOST_HTTP_DEVELOPER}/references/${HANDLE}-cli/arc-serve#url`,
|
|
20
|
-
};
|
package/src/config/video.js
DELETED
package/src/config/visibility.js
DELETED
package/src/config/workflow.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [import]
|
|
4
|
-
|
|
5
|
-
const cfgproduct = require("./product");
|
|
6
|
-
|
|
7
|
-
// [declare]
|
|
8
|
-
|
|
9
|
-
const HANDLE = cfgproduct.handle;
|
|
10
|
-
|
|
11
|
-
// [export]
|
|
12
|
-
|
|
13
|
-
module.exports = {
|
|
14
|
-
/* eslint-disable camelcase */
|
|
15
|
-
build: "",
|
|
16
|
-
deploy_dir: `.${HANDLE}-public`,
|
|
17
|
-
/* eslint-enable camelcase */
|
|
18
|
-
};
|
package/src/parser/env.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [import]
|
|
4
|
-
|
|
5
|
-
const path = require("node:path");
|
|
6
|
-
|
|
7
|
-
// [import]
|
|
8
|
-
|
|
9
|
-
const fs = require("fs-extra");
|
|
10
|
-
|
|
11
|
-
// [import]
|
|
12
|
-
|
|
13
|
-
const cfgcode = require("../config/code");
|
|
14
|
-
const error = require("../util/error");
|
|
15
|
-
const lockfile = require("../util/lockfile");
|
|
16
|
-
const objs = require("../util/objs");
|
|
17
|
-
const phrase = require("../phrase");
|
|
18
|
-
|
|
19
|
-
// [use]
|
|
20
|
-
|
|
21
|
-
const ArcError = error.ArcError;
|
|
22
|
-
const deepCompact = objs.deepCompact;
|
|
23
|
-
const detect = lockfile.detect;
|
|
24
|
-
const join = path.join;
|
|
25
|
-
const pathExists = fs.pathExists;
|
|
26
|
-
const readFile = fs.readFile;
|
|
27
|
-
|
|
28
|
-
// [declare]
|
|
29
|
-
|
|
30
|
-
const PACKAGE = "package.json";
|
|
31
|
-
|
|
32
|
-
// [function]
|
|
33
|
-
|
|
34
|
-
const parseJson = function (buf) {
|
|
35
|
-
let conf = null;
|
|
36
|
-
try {
|
|
37
|
-
conf = JSON.parse(buf);
|
|
38
|
-
} catch (ex) {
|
|
39
|
-
throw new ArcError(
|
|
40
|
-
cfgcode.PARSE_FAILED,
|
|
41
|
-
phrase.unableToParse(PACKAGE, ex.message),
|
|
42
|
-
{ cause: ex },
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
if (!conf || typeof conf !== "object" || Array.isArray(conf)) {
|
|
46
|
-
throw new ArcError(
|
|
47
|
-
cfgcode.PARSE_FAILED,
|
|
48
|
-
phrase.unableToParse(PACKAGE, "Must be a JSON object."),
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
return conf;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// [function]
|
|
55
|
-
|
|
56
|
-
// package.json's version, and its build script as `<manager> run build`, run
|
|
57
|
-
// with the package manager its lockfile names (npm without one): the script
|
|
58
|
-
// finds the project's own tools, and its prebuild and postbuild run, as they do
|
|
59
|
-
// locally. A Yarn project on Plug'n'Play has no node_modules, so only Yarn
|
|
60
|
-
// finds its tools.
|
|
61
|
-
const extract = function (conf, manager) {
|
|
62
|
-
if (!Object.keys(conf).length) {
|
|
63
|
-
return {};
|
|
64
|
-
}
|
|
65
|
-
const game = { version: conf.version };
|
|
66
|
-
const workflow = conf.scripts?.build
|
|
67
|
-
? { build: `${manager || "npm"} run build` }
|
|
68
|
-
: {};
|
|
69
|
-
return deepCompact({ game, workflow }) ?? {};
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// [function]
|
|
73
|
-
|
|
74
|
-
const main = function (root) {
|
|
75
|
-
const file = join(root, PACKAGE);
|
|
76
|
-
return pathExists(file)
|
|
77
|
-
.then((exists) => (exists ? readFile(file, "utf8") : null))
|
|
78
|
-
.then((buf) => (buf === null ? {} : parseJson(buf)))
|
|
79
|
-
.then((conf) => extract(conf, detect(root)));
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
// [export]
|
|
83
|
-
|
|
84
|
-
module.exports = main;
|
package/src/parser/given.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [import]
|
|
4
|
-
|
|
5
|
-
const project = require("./project");
|
|
6
|
-
|
|
7
|
-
// [function]
|
|
8
|
-
|
|
9
|
-
// the project a step was given, or else the one at `root`. `arc deploy`
|
|
10
|
-
// parses the project once and gives it to each step.
|
|
11
|
-
const main = function ({ project: given, root }) {
|
|
12
|
-
return given ? Promise.resolve(given) : project(root);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// [export]
|
|
16
|
-
|
|
17
|
-
module.exports = main;
|
package/src/parser/manifest.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [import]
|
|
4
|
-
|
|
5
|
-
const path = require("node:path");
|
|
6
|
-
|
|
7
|
-
// [import]
|
|
8
|
-
|
|
9
|
-
const fs = require("fs-extra");
|
|
10
|
-
|
|
11
|
-
// [import]
|
|
12
|
-
|
|
13
|
-
const cfgcode = require("../config/code");
|
|
14
|
-
const cfgfile = require("../config/file");
|
|
15
|
-
const error = require("../util/error");
|
|
16
|
-
const objs = require("../util/objs");
|
|
17
|
-
const phrase = require("../phrase");
|
|
18
|
-
const TOML = require("../util/toml");
|
|
19
|
-
|
|
20
|
-
// [use]
|
|
21
|
-
|
|
22
|
-
const ArcError = error.ArcError;
|
|
23
|
-
const isTable = objs.isTable;
|
|
24
|
-
const join = path.join;
|
|
25
|
-
const pathExists = fs.pathExists;
|
|
26
|
-
const readFile = fs.readFile;
|
|
27
|
-
|
|
28
|
-
// [declare]
|
|
29
|
-
|
|
30
|
-
const MANIFEST = cfgfile.MANIFEST;
|
|
31
|
-
|
|
32
|
-
// [function]
|
|
33
|
-
|
|
34
|
-
const parseToml = function (buf) {
|
|
35
|
-
try {
|
|
36
|
-
return TOML.parse(buf);
|
|
37
|
-
} catch (ex) {
|
|
38
|
-
throw new ArcError(
|
|
39
|
-
cfgcode.PARSE_FAILED,
|
|
40
|
-
phrase.unableToParse(MANIFEST, ex.message),
|
|
41
|
-
{ cause: ex },
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// [function]
|
|
47
|
-
|
|
48
|
-
const isEmptyTable = function (value) {
|
|
49
|
-
return isTable(value) && !Object.keys(value).length;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
// [function]
|
|
53
|
-
|
|
54
|
-
// the tables with any values. Values are kept as written, empty or not, so
|
|
55
|
-
// validation sees them: only leaving a field out unsets it.
|
|
56
|
-
const extract = function (conf) {
|
|
57
|
-
return Object.fromEntries(
|
|
58
|
-
Object.entries(conf).filter(([, table]) => !isEmptyTable(table)),
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// [function]
|
|
63
|
-
|
|
64
|
-
// arcadible.toml as written, or {} without it.
|
|
65
|
-
const read = function (root) {
|
|
66
|
-
const file = join(root, MANIFEST);
|
|
67
|
-
return pathExists(file)
|
|
68
|
-
.then((exists) => (exists ? readFile(file, "utf8") : null))
|
|
69
|
-
.then((buf) => (buf === null ? {} : parseToml(buf)));
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// [function]
|
|
73
|
-
|
|
74
|
-
const main = function (root) {
|
|
75
|
-
return read(root).then(extract);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// [export]
|
|
79
|
-
|
|
80
|
-
module.exports = Object.assign(main, { read });
|
package/src/parser/media.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// [import]
|
|
4
|
-
|
|
5
|
-
const path = require("node:path");
|
|
6
|
-
|
|
7
|
-
// [import]
|
|
8
|
-
|
|
9
|
-
const fs = require("fs-extra");
|
|
10
|
-
|
|
11
|
-
// [import]
|
|
12
|
-
|
|
13
|
-
const cfgart = require("../config/art");
|
|
14
|
-
const cfgfile = require("../config/file");
|
|
15
|
-
const cfgimage = require("../config/image");
|
|
16
|
-
const cfgvideo = require("../config/video");
|
|
17
|
-
const objs = require("../util/objs");
|
|
18
|
-
|
|
19
|
-
// [use]
|
|
20
|
-
|
|
21
|
-
const deepCompact = objs.deepCompact;
|
|
22
|
-
const extname = path.extname;
|
|
23
|
-
const join = path.join;
|
|
24
|
-
const parse = path.parse;
|
|
25
|
-
// the manifest's paths use `/` on every platform, as Arcadible's do.
|
|
26
|
-
const posixJoin = path.posix.join;
|
|
27
|
-
const pathExists = fs.pathExists;
|
|
28
|
-
const readdir = fs.promises.readdir;
|
|
29
|
-
|
|
30
|
-
// [declare]
|
|
31
|
-
|
|
32
|
-
const GALLERY = cfgfile.GALLERY;
|
|
33
|
-
const MEDIA = cfgfile.MEDIA;
|
|
34
|
-
|
|
35
|
-
// [function]
|
|
36
|
-
|
|
37
|
-
// the files directly in `dir`, by their exact names, or none without it.
|
|
38
|
-
const list = function (dir) {
|
|
39
|
-
return pathExists(dir).then((exists) => (exists ? readdir(dir) : []));
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// [function]
|
|
43
|
-
|
|
44
|
-
// the art files in .arcadible/. Names are matched exactly, so `Icon.PNG`
|
|
45
|
-
// isn't `icon.png`, even on a file system that ignores case.
|
|
46
|
-
const art = function (root) {
|
|
47
|
-
return (game) =>
|
|
48
|
-
list(join(root, MEDIA)).then((names) => ({
|
|
49
|
-
...game,
|
|
50
|
-
...Object.fromEntries(
|
|
51
|
-
cfgart.map((f) => [
|
|
52
|
-
parse(f).name,
|
|
53
|
-
names.includes(f) ? posixJoin(MEDIA, f) : null,
|
|
54
|
-
]),
|
|
55
|
-
),
|
|
56
|
-
}));
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// [function]
|
|
60
|
-
|
|
61
|
-
const handleGallery = function (entries) {
|
|
62
|
-
const exts = [...Object.keys(cfgimage), ...Object.keys(cfgvideo)];
|
|
63
|
-
return entries
|
|
64
|
-
.filter((f) => exts.includes(extname(f)))
|
|
65
|
-
.map((f) => posixJoin(GALLERY, f))
|
|
66
|
-
.sort();
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// [function]
|
|
70
|
-
|
|
71
|
-
const gallery = function (root) {
|
|
72
|
-
return (game) =>
|
|
73
|
-
list(join(root, GALLERY))
|
|
74
|
-
.then(handleGallery)
|
|
75
|
-
.then((data) => ({ ...game, gallery: data }));
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// [function]
|
|
79
|
-
|
|
80
|
-
const main = function (root) {
|
|
81
|
-
return Promise.resolve({})
|
|
82
|
-
.then(art(root))
|
|
83
|
-
.then(gallery(root))
|
|
84
|
-
.then(deepCompact)
|
|
85
|
-
.then((game) => ({ game }));
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// [export]
|
|
89
|
-
|
|
90
|
-
module.exports = main;
|