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