@vibegameengine/shipit 0.1.2

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.
Files changed (142) hide show
  1. package/README.md +86 -0
  2. package/dist/app/build-cli.d.ts +5 -0
  3. package/dist/app/build-cli.d.ts.map +1 -0
  4. package/dist/app/build-cli.js +70 -0
  5. package/dist/app/build-cli.js.map +1 -0
  6. package/dist/bin.d.ts +3 -0
  7. package/dist/bin.d.ts.map +1 -0
  8. package/dist/bin.js +19 -0
  9. package/dist/bin.js.map +1 -0
  10. package/dist/entities/credentials/api/credentials-store.d.ts +12 -0
  11. package/dist/entities/credentials/api/credentials-store.d.ts.map +1 -0
  12. package/dist/entities/credentials/api/credentials-store.js +21 -0
  13. package/dist/entities/credentials/api/credentials-store.js.map +1 -0
  14. package/dist/entities/credentials/index.d.ts +4 -0
  15. package/dist/entities/credentials/index.d.ts.map +1 -0
  16. package/dist/entities/credentials/index.js +6 -0
  17. package/dist/entities/credentials/index.js.map +1 -0
  18. package/dist/entities/credentials/model/credentials.d.ts +4 -0
  19. package/dist/entities/credentials/model/credentials.d.ts.map +1 -0
  20. package/dist/entities/credentials/model/credentials.js +3 -0
  21. package/dist/entities/credentials/model/credentials.js.map +1 -0
  22. package/dist/entities/gamefeed-config/api/gamefeed-config-store.d.ts +15 -0
  23. package/dist/entities/gamefeed-config/api/gamefeed-config-store.d.ts.map +1 -0
  24. package/dist/entities/gamefeed-config/api/gamefeed-config-store.js +32 -0
  25. package/dist/entities/gamefeed-config/api/gamefeed-config-store.js.map +1 -0
  26. package/dist/entities/gamefeed-config/index.d.ts +6 -0
  27. package/dist/entities/gamefeed-config/index.d.ts.map +1 -0
  28. package/dist/entities/gamefeed-config/index.js +10 -0
  29. package/dist/entities/gamefeed-config/index.js.map +1 -0
  30. package/dist/entities/gamefeed-config/lib/default-config.d.ts +4 -0
  31. package/dist/entities/gamefeed-config/lib/default-config.d.ts.map +1 -0
  32. package/dist/entities/gamefeed-config/lib/default-config.js +21 -0
  33. package/dist/entities/gamefeed-config/lib/default-config.js.map +1 -0
  34. package/dist/entities/gamefeed-config/model/gamefeed-config.d.ts +52 -0
  35. package/dist/entities/gamefeed-config/model/gamefeed-config.d.ts.map +1 -0
  36. package/dist/entities/gamefeed-config/model/gamefeed-config.js +23 -0
  37. package/dist/entities/gamefeed-config/model/gamefeed-config.js.map +1 -0
  38. package/dist/features/init/index.d.ts +3 -0
  39. package/dist/features/init/index.d.ts.map +1 -0
  40. package/dist/features/init/index.js +6 -0
  41. package/dist/features/init/index.js.map +1 -0
  42. package/dist/features/init/model/init-command.d.ts +15 -0
  43. package/dist/features/init/model/init-command.d.ts.map +1 -0
  44. package/dist/features/init/model/init-command.js +72 -0
  45. package/dist/features/init/model/init-command.js.map +1 -0
  46. package/dist/features/login/index.d.ts +3 -0
  47. package/dist/features/login/index.d.ts.map +1 -0
  48. package/dist/features/login/index.js +6 -0
  49. package/dist/features/login/index.js.map +1 -0
  50. package/dist/features/login/model/login-command.d.ts +16 -0
  51. package/dist/features/login/model/login-command.d.ts.map +1 -0
  52. package/dist/features/login/model/login-command.js +24 -0
  53. package/dist/features/login/model/login-command.js.map +1 -0
  54. package/dist/features/publish/index.d.ts +3 -0
  55. package/dist/features/publish/index.d.ts.map +1 -0
  56. package/dist/features/publish/index.js +6 -0
  57. package/dist/features/publish/index.js.map +1 -0
  58. package/dist/features/publish/model/publish-command.d.ts +19 -0
  59. package/dist/features/publish/model/publish-command.d.ts.map +1 -0
  60. package/dist/features/publish/model/publish-command.js +85 -0
  61. package/dist/features/publish/model/publish-command.js.map +1 -0
  62. package/dist/features/register/index.d.ts +3 -0
  63. package/dist/features/register/index.d.ts.map +1 -0
  64. package/dist/features/register/index.js +6 -0
  65. package/dist/features/register/index.js.map +1 -0
  66. package/dist/features/register/model/register-command.d.ts +14 -0
  67. package/dist/features/register/model/register-command.d.ts.map +1 -0
  68. package/dist/features/register/model/register-command.js +17 -0
  69. package/dist/features/register/model/register-command.js.map +1 -0
  70. package/dist/features/validate/index.d.ts +2 -0
  71. package/dist/features/validate/index.d.ts.map +1 -0
  72. package/dist/features/validate/index.js +6 -0
  73. package/dist/features/validate/index.js.map +1 -0
  74. package/dist/features/validate/model/validate-command.d.ts +10 -0
  75. package/dist/features/validate/model/validate-command.d.ts.map +1 -0
  76. package/dist/features/validate/model/validate-command.js +41 -0
  77. package/dist/features/validate/model/validate-command.js.map +1 -0
  78. package/dist/features/version/index.d.ts +2 -0
  79. package/dist/features/version/index.d.ts.map +1 -0
  80. package/dist/features/version/index.js +6 -0
  81. package/dist/features/version/index.js.map +1 -0
  82. package/dist/features/version/model/version-command.d.ts +18 -0
  83. package/dist/features/version/model/version-command.d.ts.map +1 -0
  84. package/dist/features/version/model/version-command.js +54 -0
  85. package/dist/features/version/model/version-command.js.map +1 -0
  86. package/dist/shared/api/http-client/api-client.d.ts +22 -0
  87. package/dist/shared/api/http-client/api-client.d.ts.map +1 -0
  88. package/dist/shared/api/http-client/api-client.js +73 -0
  89. package/dist/shared/api/http-client/api-client.js.map +1 -0
  90. package/dist/shared/api/http-client/index.d.ts +4 -0
  91. package/dist/shared/api/http-client/index.d.ts.map +1 -0
  92. package/dist/shared/api/http-client/index.js +6 -0
  93. package/dist/shared/api/http-client/index.js.map +1 -0
  94. package/dist/shared/api/http-client/platform-api.d.ts +11 -0
  95. package/dist/shared/api/http-client/platform-api.d.ts.map +1 -0
  96. package/dist/shared/api/http-client/platform-api.js +3 -0
  97. package/dist/shared/api/http-client/platform-api.js.map +1 -0
  98. package/dist/shared/config/config.d.ts +7 -0
  99. package/dist/shared/config/config.d.ts.map +1 -0
  100. package/dist/shared/config/config.js +17 -0
  101. package/dist/shared/config/config.js.map +1 -0
  102. package/dist/shared/config/index.d.ts +3 -0
  103. package/dist/shared/config/index.d.ts.map +1 -0
  104. package/dist/shared/config/index.js +6 -0
  105. package/dist/shared/config/index.js.map +1 -0
  106. package/dist/shared/contracts.d.ts +112 -0
  107. package/dist/shared/contracts.d.ts.map +1 -0
  108. package/dist/shared/contracts.js +34 -0
  109. package/dist/shared/contracts.js.map +1 -0
  110. package/dist/shared/lib/archive/create-archive.d.ts +8 -0
  111. package/dist/shared/lib/archive/create-archive.d.ts.map +1 -0
  112. package/dist/shared/lib/archive/create-archive.js +17 -0
  113. package/dist/shared/lib/archive/create-archive.js.map +1 -0
  114. package/dist/shared/lib/archive/index.d.ts +3 -0
  115. package/dist/shared/lib/archive/index.d.ts.map +1 -0
  116. package/dist/shared/lib/archive/index.js +6 -0
  117. package/dist/shared/lib/archive/index.js.map +1 -0
  118. package/dist/shared/lib/console/index.d.ts +3 -0
  119. package/dist/shared/lib/console/index.d.ts.map +1 -0
  120. package/dist/shared/lib/console/index.js +6 -0
  121. package/dist/shared/lib/console/index.js.map +1 -0
  122. package/dist/shared/lib/console/reporter.d.ts +12 -0
  123. package/dist/shared/lib/console/reporter.d.ts.map +1 -0
  124. package/dist/shared/lib/console/reporter.js +23 -0
  125. package/dist/shared/lib/console/reporter.js.map +1 -0
  126. package/dist/shared/lib/errors/cli-error.d.ts +6 -0
  127. package/dist/shared/lib/errors/cli-error.d.ts.map +1 -0
  128. package/dist/shared/lib/errors/cli-error.js +14 -0
  129. package/dist/shared/lib/errors/cli-error.js.map +1 -0
  130. package/dist/shared/lib/errors/index.d.ts +2 -0
  131. package/dist/shared/lib/errors/index.d.ts.map +1 -0
  132. package/dist/shared/lib/errors/index.js +6 -0
  133. package/dist/shared/lib/errors/index.js.map +1 -0
  134. package/dist/shared/lib/fs/fs.d.ts +6 -0
  135. package/dist/shared/lib/fs/fs.d.ts.map +1 -0
  136. package/dist/shared/lib/fs/fs.js +32 -0
  137. package/dist/shared/lib/fs/fs.js.map +1 -0
  138. package/dist/shared/lib/fs/index.d.ts +2 -0
  139. package/dist/shared/lib/fs/index.d.ts.map +1 -0
  140. package/dist/shared/lib/fs/index.js +10 -0
  141. package/dist/shared/lib/fs/index.js.map +1 -0
  142. package/package.json +47 -0
package/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # @vibegameengine/shipit
2
+
3
+ Publish playable web games from the terminal.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @vibegameengine/shipit
9
+ ```
10
+
11
+ Or run it with npx:
12
+
13
+ ```bash
14
+ npx @vibegameengine/shipit --help
15
+ ```
16
+
17
+ ## Flow
18
+
19
+ ```bash
20
+ shipit login
21
+ shipit init
22
+ shipit version 1.0.1
23
+ shipit publish
24
+ ```
25
+
26
+ ## Commands
27
+
28
+ ```bash
29
+ shipit login --email you@example.com --password your-password
30
+ ```
31
+
32
+ Stores your publish token locally.
33
+
34
+ ```bash
35
+ shipit init --id asteroids --title "Asteroids"
36
+ ```
37
+
38
+ Creates `.shipit/` in the current game project.
39
+
40
+ ```bash
41
+ shipit version 1.0.1
42
+ ```
43
+
44
+ Creates a version description template and marks it as the next version to publish.
45
+
46
+ ```bash
47
+ shipit publish
48
+ ```
49
+
50
+ Publishes the next version.
51
+
52
+ ```bash
53
+ shipit publish 1.0.1
54
+ ```
55
+
56
+ Publishes a specific version.
57
+
58
+ ## Project Files
59
+
60
+ Shipit expects a built game and a `.shipit` directory:
61
+
62
+ ```text
63
+ dist/
64
+ index.html
65
+ .shipit/
66
+ shipit.json
67
+ media/
68
+ tiles/
69
+ 16x9.png
70
+ 1x1.png
71
+ 9x16.png
72
+ versions/
73
+ 1.0.1/
74
+ description/
75
+ en.md
76
+ ```
77
+
78
+ `description/*.md` files are feed posts for the release. Each one can be up to 500 characters.
79
+
80
+ ## Validate
81
+
82
+ ```bash
83
+ shipit validate
84
+ ```
85
+
86
+ Checks the project before publishing.
@@ -0,0 +1,5 @@
1
+ import { Command } from 'commander';
2
+ /** Composition root for the CLI: wires real adapters into commands and binds them
3
+ * to commander. Holds no logic of its own. */
4
+ export declare function buildCli(): Command;
5
+ //# sourceMappingURL=build-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-cli.d.ts","sourceRoot":"","sources":["../../src/app/build-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC;8CAC8C;AAC9C,wBAAgB,QAAQ,IAAI,OAAO,CAsElC"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildCli = buildCli;
4
+ const commander_1 = require("commander");
5
+ const credentials_1 = require("../entities/credentials");
6
+ const gamefeed_config_1 = require("../entities/gamefeed-config");
7
+ const init_1 = require("../features/init");
8
+ const login_1 = require("../features/login");
9
+ const publish_1 = require("../features/publish");
10
+ const register_1 = require("../features/register");
11
+ const validate_1 = require("../features/validate");
12
+ const version_1 = require("../features/version");
13
+ const http_client_1 = require("../shared/api/http-client");
14
+ const config_1 = require("../shared/config");
15
+ const console_1 = require("../shared/lib/console");
16
+ /** Composition root for the CLI: wires real adapters into commands and binds them
17
+ * to commander. Holds no logic of its own. */
18
+ function buildCli() {
19
+ const config = (0, config_1.loadCliConfig)();
20
+ const reporter = new console_1.ConsoleReporter();
21
+ const configStore = new gamefeed_config_1.FileGamefeedConfigStore(config.projectDir);
22
+ const credentialsStore = new credentials_1.FileCredentialsStore(config.credentialsPath);
23
+ const api = new http_client_1.ApiClient({ baseUrl: config.apiUrl });
24
+ const authedApi = (token) => new http_client_1.ApiClient({ baseUrl: config.apiUrl, token });
25
+ const program = new commander_1.Command();
26
+ program
27
+ .name('shipit')
28
+ .description('Publish playable games to your Playable Feed server');
29
+ program
30
+ .command('init')
31
+ .description('Scaffold a .shipit project directory in the current directory')
32
+ .option('--id <slug>', 'game id (kebab-case)')
33
+ .option('--title <title>', 'game title')
34
+ .action((options) => new init_1.InitCommand(configStore, reporter, config.projectDir).execute(options));
35
+ program
36
+ .command('validate')
37
+ .description('Check .shipit/shipit.json and the build before publishing')
38
+ .action(() => new validate_1.ValidateCommand(configStore, reporter, config.projectDir).execute());
39
+ program
40
+ .command('register')
41
+ .description('Create a creator account')
42
+ .requiredOption('--email <email>')
43
+ .requiredOption('--password <password>')
44
+ .requiredOption('--name <name>')
45
+ .action((options) => new register_1.RegisterCommand(api, reporter).execute(options));
46
+ program
47
+ .command('login')
48
+ .description('Log in and store an API token')
49
+ .requiredOption('--email <email>')
50
+ .requiredOption('--password <password>')
51
+ .action((options) => new login_1.LoginCommand(api, credentialsStore, reporter).execute(options));
52
+ program
53
+ .command('version [releaseName]')
54
+ .description('Show current API version or set the next local release name')
55
+ .action((releaseName) => new version_1.VersionCommand(configStore, credentialsStore, authedApi, reporter, config.projectDir).execute({
56
+ releaseName,
57
+ }));
58
+ program
59
+ .command('publish')
60
+ .description('Package the build and publish a new version')
61
+ .argument('[releaseName]')
62
+ .action((releaseName, options) => new publish_1.PublishCommand(configStore, credentialsStore, authedApi, reporter, config.projectDir).execute({ ...options, releaseName }));
63
+ program
64
+ .command('now')
65
+ .description('Alias for publish')
66
+ .argument('[releaseName]')
67
+ .action((releaseName, options) => new publish_1.PublishCommand(configStore, credentialsStore, authedApi, reporter, config.projectDir).execute({ ...options, releaseName }));
68
+ return program;
69
+ }
70
+ //# sourceMappingURL=build-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-cli.js","sourceRoot":"","sources":["../../src/app/build-cli.ts"],"names":[],"mappings":";;AAeA,4BAsEC;AArFD,yCAAoC;AACpC,yDAA+D;AAC/D,iEAAsE;AACtE,2CAA+C;AAC/C,6CAAiD;AACjD,iDAAqD;AACrD,mDAAuD;AACvD,mDAAuD;AACvD,iDAAqD;AACrD,2DAAsD;AACtD,6CAAiD;AACjD,mDAAwD;AAExD;8CAC8C;AAC9C,SAAgB,QAAQ;IACtB,MAAM,MAAM,GAAG,IAAA,sBAAa,GAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,IAAI,yBAAe,EAAE,CAAC;IACvC,MAAM,WAAW,GAAG,IAAI,yCAAuB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACnE,MAAM,gBAAgB,GAAG,IAAI,kCAAoB,CAAC,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,CAC5B,CACF,CAAC;IAEJ,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/dist/bin.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
package/dist/bin.js ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const build_cli_1 = require("./app/build-cli");
5
+ const errors_1 = require("./shared/lib/errors");
6
+ async function main() {
7
+ await (0, build_cli_1.buildCli)().parseAsync(process.argv);
8
+ }
9
+ main().catch((error) => {
10
+ if (error instanceof errors_1.CliError) {
11
+ // eslint-disable-next-line no-console
12
+ console.error(error.message);
13
+ process.exit(error.exitCode);
14
+ }
15
+ // eslint-disable-next-line no-console
16
+ console.error(error);
17
+ process.exit(1);
18
+ });
19
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";;;AACA,+CAA2C;AAC3C,gDAA+C;AAE/C,KAAK,UAAU,IAAI;IACjB,MAAM,IAAA,oBAAQ,GAAE,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,IAAI,KAAK,YAAY,iBAAQ,EAAE,CAAC;QAC9B,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IACD,sCAAsC;IACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Credentials } from '../model/credentials';
2
+ export interface CredentialsStore {
3
+ read(): Promise<Credentials | null>;
4
+ write(credentials: Credentials): Promise<void>;
5
+ }
6
+ export declare class FileCredentialsStore implements CredentialsStore {
7
+ private readonly path;
8
+ constructor(path: string);
9
+ read(): Promise<Credentials | null>;
10
+ write(credentials: Credentials): Promise<void>;
11
+ }
12
+ //# sourceMappingURL=credentials-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials-store.d.ts","sourceRoot":"","sources":["../../../../src/entities/credentials/api/credentials-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACpC,KAAK,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,qBAAa,oBAAqB,YAAW,gBAAgB;IAC/C,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,MAAM;IAEnC,IAAI,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAOzC,KAAK,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileCredentialsStore = void 0;
4
+ const fs_1 = require("../../../shared/lib/fs");
5
+ class FileCredentialsStore {
6
+ path;
7
+ constructor(path) {
8
+ this.path = path;
9
+ }
10
+ async read() {
11
+ if (!(await (0, fs_1.pathExists)(this.path))) {
12
+ return null;
13
+ }
14
+ return (0, fs_1.readJsonFile)(this.path);
15
+ }
16
+ write(credentials) {
17
+ return (0, fs_1.writeJsonFile)(this.path, credentials);
18
+ }
19
+ }
20
+ exports.FileCredentialsStore = FileCredentialsStore;
21
+ //# sourceMappingURL=credentials-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials-store.js","sourceRoot":"","sources":["../../../../src/entities/credentials/api/credentials-store.ts"],"names":[],"mappings":";;;AAAA,+CAAiF;AAQjF,MAAa,oBAAoB;IACF;IAA7B,YAA6B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAE7C,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,CAAC,MAAM,IAAA,eAAU,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,IAAA,iBAAY,EAAc,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,WAAwB;QAC5B,OAAO,IAAA,kBAAa,EAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC/C,CAAC;CACF;AAbD,oDAaC"}
@@ -0,0 +1,4 @@
1
+ export type { Credentials } from './model/credentials';
2
+ export { FileCredentialsStore } from './api/credentials-store';
3
+ export type { CredentialsStore } from './api/credentials-store';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/credentials/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileCredentialsStore = void 0;
4
+ var credentials_store_1 = require("./api/credentials-store");
5
+ Object.defineProperty(exports, "FileCredentialsStore", { enumerable: true, get: function () { return credentials_store_1.FileCredentialsStore; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/credentials/index.ts"],"names":[],"mappings":";;;AACA,6DAA+D;AAAtD,yHAAA,oBAAoB,OAAA"}
@@ -0,0 +1,4 @@
1
+ export interface Credentials {
2
+ token: string;
3
+ }
4
+ //# sourceMappingURL=credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/entities/credentials/model/credentials.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../../src/entities/credentials/model/credentials.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { type GamefeedConfig } from '../model/gamefeed-config';
2
+ export interface GamefeedConfigStore {
3
+ readonly path: string;
4
+ exists(): Promise<boolean>;
5
+ read(): Promise<GamefeedConfig>;
6
+ write(config: GamefeedConfig): Promise<void>;
7
+ }
8
+ export declare class FileGamefeedConfigStore implements GamefeedConfigStore {
9
+ readonly path: string;
10
+ constructor(projectDir: string);
11
+ exists(): Promise<boolean>;
12
+ read(): Promise<GamefeedConfig>;
13
+ write(config: GamefeedConfig): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=gamefeed-config-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gamefeed-config-store.d.ts","sourceRoot":"","sources":["../../../../src/entities/gamefeed-config/api/gamefeed-config-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAErF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3B,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IAChC,KAAK,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C;AAED,qBAAa,uBAAwB,YAAW,mBAAmB;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,UAAU,EAAE,MAAM;IAI9B,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAIpB,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC;IAYrC,KAAK,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7C"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileGamefeedConfigStore = void 0;
4
+ const node_path_1 = require("node:path");
5
+ const errors_1 = require("../../../shared/lib/errors");
6
+ const fs_1 = require("../../../shared/lib/fs");
7
+ const gamefeed_config_1 = require("../model/gamefeed-config");
8
+ class FileGamefeedConfigStore {
9
+ path;
10
+ constructor(projectDir) {
11
+ this.path = (0, node_path_1.join)(projectDir, '.shipit', 'shipit.json');
12
+ }
13
+ exists() {
14
+ return (0, fs_1.pathExists)(this.path);
15
+ }
16
+ async read() {
17
+ if (!(await this.exists())) {
18
+ throw new errors_1.CliError(`No .shipit/shipit.json at ${this.path}. Run "shipit init" first.`);
19
+ }
20
+ const result = gamefeed_config_1.gamefeedConfigSchema.safeParse(await (0, fs_1.readJsonFile)(this.path));
21
+ if (!result.success) {
22
+ const detail = result.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('; ');
23
+ throw new errors_1.CliError(`Invalid .shipit/shipit.json: ${detail}`);
24
+ }
25
+ return result.data;
26
+ }
27
+ write(config) {
28
+ return (0, fs_1.writeJsonFile)(this.path, config);
29
+ }
30
+ }
31
+ exports.FileGamefeedConfigStore = FileGamefeedConfigStore;
32
+ //# sourceMappingURL=gamefeed-config-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gamefeed-config-store.js","sourceRoot":"","sources":["../../../../src/entities/gamefeed-config/api/gamefeed-config-store.ts"],"names":[],"mappings":";;;AAAA,yCAAiC;AACjC,uDAAsD;AACtD,+CAAiF;AACjF,8DAAqF;AASrF,MAAa,uBAAuB;IACzB,IAAI,CAAS;IAEtB,YAAY,UAAkB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAA,gBAAI,EAAC,UAAU,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IACzD,CAAC;IAED,MAAM;QACJ,OAAO,IAAA,eAAU,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,iBAAQ,CAAC,6BAA6B,IAAI,CAAC,IAAI,4BAA4B,CAAC,CAAC;QACzF,CAAC;QACD,MAAM,MAAM,GAAG,sCAAoB,CAAC,SAAS,CAAC,MAAM,IAAA,iBAAY,EAAU,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACtF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9F,MAAM,IAAI,iBAAQ,CAAC,gCAAgC,MAAM,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,MAAsB;QAC1B,OAAO,IAAA,kBAAa,EAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;CACF;AA1BD,0DA0BC"}
@@ -0,0 +1,6 @@
1
+ export { gamefeedConfigSchema } from './model/gamefeed-config';
2
+ export type { GamefeedConfig } from './model/gamefeed-config';
3
+ export { buildDefaultConfig } from './lib/default-config';
4
+ export { FileGamefeedConfigStore } from './api/gamefeed-config-store';
5
+ export type { GamefeedConfigStore } from './api/gamefeed-config-store';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/gamefeed-config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileGamefeedConfigStore = exports.buildDefaultConfig = exports.gamefeedConfigSchema = void 0;
4
+ var gamefeed_config_1 = require("./model/gamefeed-config");
5
+ Object.defineProperty(exports, "gamefeedConfigSchema", { enumerable: true, get: function () { return gamefeed_config_1.gamefeedConfigSchema; } });
6
+ var default_config_1 = require("./lib/default-config");
7
+ Object.defineProperty(exports, "buildDefaultConfig", { enumerable: true, get: function () { return default_config_1.buildDefaultConfig; } });
8
+ var gamefeed_config_store_1 = require("./api/gamefeed-config-store");
9
+ Object.defineProperty(exports, "FileGamefeedConfigStore", { enumerable: true, get: function () { return gamefeed_config_store_1.FileGamefeedConfigStore; } });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/gamefeed-config/index.ts"],"names":[],"mappings":";;;AAAA,2DAA+D;AAAtD,uHAAA,oBAAoB,OAAA;AAE7B,uDAA0D;AAAjD,oHAAA,kBAAkB,OAAA;AAC3B,qEAAsE;AAA7D,gIAAA,uBAAuB,OAAA"}
@@ -0,0 +1,4 @@
1
+ import type { GamefeedConfig } from '../model/gamefeed-config';
2
+ /** A sensible starter .shipit/shipit.json mirroring the design-doc example. */
3
+ export declare function buildDefaultConfig(gameId: string, title: string): GamefeedConfig;
4
+ //# sourceMappingURL=default-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-config.d.ts","sourceRoot":"","sources":["../../../../src/entities/gamefeed-config/lib/default-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,CAehF"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildDefaultConfig = buildDefaultConfig;
4
+ /** A sensible starter .shipit/shipit.json mirroring the design-doc example. */
5
+ function buildDefaultConfig(gameId, title) {
6
+ return {
7
+ gameId,
8
+ title,
9
+ entry: 'index.html',
10
+ buildDir: 'dist',
11
+ orientation: ['portrait'],
12
+ tags: [],
13
+ previews: {
14
+ wide: '.shipit/media/tiles/16x9.png',
15
+ square: '.shipit/media/tiles/1x1.png',
16
+ portrait: '.shipit/media/tiles/9x16.png',
17
+ },
18
+ nextVersion: 'draft',
19
+ };
20
+ }
21
+ //# sourceMappingURL=default-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-config.js","sourceRoot":"","sources":["../../../../src/entities/gamefeed-config/lib/default-config.ts"],"names":[],"mappings":";;AAGA,gDAeC;AAhBD,+EAA+E;AAC/E,SAAgB,kBAAkB,CAAC,MAAc,EAAE,KAAa;IAC9D,OAAO;QACL,MAAM;QACN,KAAK;QACL,KAAK,EAAE,YAAY;QACnB,QAAQ,EAAE,MAAM;QAChB,WAAW,EAAE,CAAC,UAAU,CAAC;QACzB,IAAI,EAAE,EAAE;QACR,QAAQ,EAAE;YACR,IAAI,EAAE,8BAA8B;YACpC,MAAM,EAAE,6BAA6B;YACrC,QAAQ,EAAE,8BAA8B;SACzC;QACD,WAAW,EAAE,OAAO;KACrB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { z } from 'zod';
2
+ /** Shape of the project's .shipit/shipit.json. */
3
+ export declare const gamefeedConfigSchema: z.ZodObject<{
4
+ gameId: z.ZodString;
5
+ title: z.ZodString;
6
+ entry: z.ZodString;
7
+ buildDir: z.ZodString;
8
+ orientation: z.ZodDefault<z.ZodArray<z.ZodEnum<["portrait", "landscape"]>, "many">>;
9
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
10
+ previews: z.ZodDefault<z.ZodObject<{
11
+ wide: z.ZodDefault<z.ZodString>;
12
+ square: z.ZodDefault<z.ZodString>;
13
+ portrait: z.ZodDefault<z.ZodString>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ portrait: string;
16
+ wide: string;
17
+ square: string;
18
+ }, {
19
+ portrait?: string | undefined;
20
+ wide?: string | undefined;
21
+ square?: string | undefined;
22
+ }>>;
23
+ nextVersion: z.ZodDefault<z.ZodString>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ title: string;
26
+ orientation: ("portrait" | "landscape")[];
27
+ tags: string[];
28
+ entry: string;
29
+ gameId: string;
30
+ buildDir: string;
31
+ previews: {
32
+ portrait: string;
33
+ wide: string;
34
+ square: string;
35
+ };
36
+ nextVersion: string;
37
+ }, {
38
+ title: string;
39
+ entry: string;
40
+ gameId: string;
41
+ buildDir: string;
42
+ orientation?: ("portrait" | "landscape")[] | undefined;
43
+ tags?: string[] | undefined;
44
+ previews?: {
45
+ portrait?: string | undefined;
46
+ wide?: string | undefined;
47
+ square?: string | undefined;
48
+ } | undefined;
49
+ nextVersion?: string | undefined;
50
+ }>;
51
+ export type GamefeedConfig = z.infer<typeof gamefeedConfigSchema>;
52
+ //# sourceMappingURL=gamefeed-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gamefeed-config.d.ts","sourceRoot":"","sources":["../../../../src/entities/gamefeed-config/model/gamefeed-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,kDAAkD;AAClD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gamefeedConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const contracts_1 = require("../../../shared/contracts");
6
+ /** Shape of the project's .shipit/shipit.json. */
7
+ exports.gamefeedConfigSchema = zod_1.z.object({
8
+ gameId: contracts_1.gameSlugSchema,
9
+ title: zod_1.z.string().trim().min(1).max(120),
10
+ entry: zod_1.z.string().trim().min(1),
11
+ buildDir: zod_1.z.string().trim().min(1),
12
+ orientation: zod_1.z.array(contracts_1.orientationSchema).min(1).default(['portrait']),
13
+ tags: contracts_1.gameTagsSchema,
14
+ previews: zod_1.z
15
+ .object({
16
+ wide: zod_1.z.string().trim().min(1).default('.shipit/media/tiles/16x9.png'),
17
+ square: zod_1.z.string().trim().min(1).default('.shipit/media/tiles/1x1.png'),
18
+ portrait: zod_1.z.string().trim().min(1).default('.shipit/media/tiles/9x16.png'),
19
+ })
20
+ .default({}),
21
+ nextVersion: contracts_1.releaseNameSchema.default('draft'),
22
+ });
23
+ //# sourceMappingURL=gamefeed-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gamefeed-config.js","sourceRoot":"","sources":["../../../../src/entities/gamefeed-config/model/gamefeed-config.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,yDAAiH;AAEjH,kDAAkD;AACrC,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,0BAAc;IACtB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACxC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,6BAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IACpE,IAAI,EAAE,0BAAc;IACpB,QAAQ,EAAE,OAAC;SACR,MAAM,CAAC;QACN,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC;QACtE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,6BAA6B,CAAC;QACvE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC;KAC3E,CAAC;SACD,OAAO,CAAC,EAAE,CAAC;IACd,WAAW,EAAE,6BAAiB,CAAC,OAAO,CAAC,OAAO,CAAC;CAChD,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { InitCommand } from './model/init-command';
2
+ export type { InitOptions } from './model/init-command';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InitCommand = void 0;
4
+ var init_command_1 = require("./model/init-command");
5
+ Object.defineProperty(exports, "InitCommand", { enumerable: true, get: function () { return init_command_1.InitCommand; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/init/index.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAA1C,2GAAA,WAAW,OAAA"}
@@ -0,0 +1,15 @@
1
+ import { type GamefeedConfigStore } from '../../../entities/gamefeed-config';
2
+ import type { Reporter } from '../../../shared/lib/console';
3
+ export interface InitOptions {
4
+ id?: string;
5
+ title?: string;
6
+ }
7
+ export declare class InitCommand {
8
+ private readonly config;
9
+ private readonly reporter;
10
+ private readonly projectDir;
11
+ constructor(config: GamefeedConfigStore, reporter: Reporter, projectDir: string);
12
+ execute(options: InitOptions): Promise<void>;
13
+ private writeProjectTemplate;
14
+ }
15
+ //# sourceMappingURL=init-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../../../src/features/init/model/init-command.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAI5D,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,WAAW;IAEpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAFV,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM;IAG/B,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;YAiBpC,oBAAoB;CA0BnC"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InitCommand = void 0;
4
+ const promises_1 = require("node:fs/promises");
5
+ const node_path_1 = require("node:path");
6
+ const contracts_1 = require("../../../shared/contracts");
7
+ const gamefeed_config_1 = require("../../../entities/gamefeed-config");
8
+ const errors_1 = require("../../../shared/lib/errors");
9
+ const fs_1 = require("../../../shared/lib/fs");
10
+ class InitCommand {
11
+ config;
12
+ reporter;
13
+ projectDir;
14
+ constructor(config, reporter, projectDir) {
15
+ this.config = config;
16
+ this.reporter = reporter;
17
+ this.projectDir = projectDir;
18
+ }
19
+ async execute(options) {
20
+ if (await this.config.exists()) {
21
+ throw new errors_1.CliError(`.shipit/shipit.json already exists at ${this.config.path}`);
22
+ }
23
+ const gameId = options.id ?? toSlug((0, node_path_1.basename)(this.projectDir));
24
+ const parsed = contracts_1.gameSlugSchema.safeParse(gameId);
25
+ if (!parsed.success) {
26
+ throw new errors_1.CliError(`Cannot derive a valid game id from "${gameId}". Pass --id <kebab-case>.`);
27
+ }
28
+ const config = (0, gamefeed_config_1.buildDefaultConfig)(parsed.data, options.title ?? toTitle(parsed.data));
29
+ await this.config.write(config);
30
+ await this.writeProjectTemplate();
31
+ this.reporter.success(`Created ${this.config.path}`);
32
+ }
33
+ async writeProjectTemplate() {
34
+ const files = [
35
+ [
36
+ '.shipit/media/screenshots/README.md',
37
+ '# Screenshots\n\nAdd gameplay screenshots here, for example `01.png`, `02.png`, `03.png`.\n',
38
+ ],
39
+ [
40
+ '.shipit/media/icons/README.md',
41
+ '# Icons\n\nAdd app icons here, for example `512.png` and `1024.png`.\n',
42
+ ],
43
+ [
44
+ '.shipit/media/tiles/README.md',
45
+ '# Tiles\n\nAdd catalog tiles here: `16x9.png` for wide screens, `1x1.png` for square placements, `9x16.png` for portrait screens.\n',
46
+ ],
47
+ [
48
+ '.shipit/versions/draft/description/en.md',
49
+ '# Short description\n\nReplace this with the English store description for the next version.\n',
50
+ ],
51
+ ];
52
+ await (0, fs_1.ensureDir)((0, node_path_1.join)(this.projectDir, '.shipit'));
53
+ for (const [path, content] of files) {
54
+ await (0, fs_1.ensureDir)((0, node_path_1.dirname)((0, node_path_1.join)(this.projectDir, path)));
55
+ await (0, promises_1.writeFile)((0, node_path_1.join)(this.projectDir, path), content, 'utf8');
56
+ }
57
+ }
58
+ }
59
+ exports.InitCommand = InitCommand;
60
+ function toSlug(value) {
61
+ return value
62
+ .toLowerCase()
63
+ .replace(/[^a-z0-9]+/g, '-')
64
+ .replace(/^-+|-+$/g, '');
65
+ }
66
+ function toTitle(slug) {
67
+ return slug
68
+ .split('-')
69
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
70
+ .join(' ');
71
+ }
72
+ //# sourceMappingURL=init-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-command.js","sourceRoot":"","sources":["../../../../src/features/init/model/init-command.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAC7C,yCAAoD;AACpD,yDAA2D;AAC3D,uEAAiG;AAEjG,uDAAsD;AACtD,+CAAmD;AAOnD,MAAa,WAAW;IAEH;IACA;IACA;IAHnB,YACmB,MAA2B,EAC3B,QAAkB,EAClB,UAAkB;QAFlB,WAAM,GAAN,MAAM,CAAqB;QAC3B,aAAQ,GAAR,QAAQ,CAAU;QAClB,eAAU,GAAV,UAAU,CAAQ;IAClC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,OAAoB;QAChC,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM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AAO,EAAC,IAAA,gBAAI,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;YACtD,MAAM,IAAA,oBAAS,EAAC,IAAA,gBAAI,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;CACF;AAlDD,kCAkDC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,KAAK;SACT,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAI;SACR,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { LoginCommand } from './model/login-command';
2
+ export type { LoginInput } from './model/login-command';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/login/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC"}