@factorialco/fcode-cli 2.0.0 → 2.2.0

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 (76) hide show
  1. package/README.md +248 -2
  2. package/dist/commands/add.js +3 -1
  3. package/dist/commands/clone.d.ts +1 -0
  4. package/dist/commands/clone.js +5 -0
  5. package/dist/commands/i18n/add.d.ts +9 -0
  6. package/dist/commands/i18n/add.js +13 -0
  7. package/dist/commands/i18n/pull.d.ts +12 -0
  8. package/dist/commands/i18n/pull.js +14 -0
  9. package/dist/commands/i18n/push.d.ts +12 -0
  10. package/dist/commands/i18n/push.js +14 -0
  11. package/dist/commands/i18n/remove.d.ts +9 -0
  12. package/dist/commands/i18n/remove.js +19 -0
  13. package/dist/commands/i18n/reset.d.ts +9 -0
  14. package/dist/commands/i18n/reset.js +13 -0
  15. package/dist/commands/i18n/status.d.ts +11 -0
  16. package/dist/commands/i18n/status.js +42 -0
  17. package/dist/commands/pull.js +5 -3
  18. package/dist/commands/push.js +5 -3
  19. package/dist/commands/reset.js +3 -1
  20. package/dist/commands/run.d.ts +1 -0
  21. package/dist/commands/run.js +5 -2
  22. package/dist/commands/setup-debug.js +2 -2
  23. package/dist/commands/status.js +4 -2
  24. package/dist/commands/team/aliases/delete.d.ts +9 -0
  25. package/dist/commands/team/aliases/delete.js +28 -0
  26. package/dist/commands/team/aliases/list.d.ts +6 -0
  27. package/dist/commands/team/aliases/list.js +23 -0
  28. package/dist/commands/team/aliases/set.d.ts +10 -0
  29. package/dist/commands/team/aliases/set.js +25 -0
  30. package/dist/commands/team/pull.js +8 -1
  31. package/dist/commands/team/push.js +6 -0
  32. package/dist/commands/team/versions/create.d.ts +13 -0
  33. package/dist/commands/team/versions/create.js +42 -0
  34. package/dist/commands/team/versions/delete.d.ts +12 -0
  35. package/dist/commands/team/versions/delete.js +32 -0
  36. package/dist/commands/team/versions/list.d.ts +6 -0
  37. package/dist/commands/team/versions/list.js +25 -0
  38. package/dist/commands/variables/status.js +11 -0
  39. package/dist/config/remote.js +1 -1
  40. package/dist/config/settings.d.ts +1 -0
  41. package/dist/config/settings.js +6 -0
  42. package/dist/config/workspace.js +10 -0
  43. package/dist/core/commands/i18n-command.d.ts +5 -0
  44. package/dist/core/commands/i18n-command.js +16 -0
  45. package/dist/core/errors.d.ts +6 -0
  46. package/dist/core/errors.js +19 -1
  47. package/dist/core/executors/execution-task.js +4 -0
  48. package/dist/core/executors/javascript-execution-task.js +26 -1
  49. package/dist/core/resource-pusher.js +15 -0
  50. package/dist/core/types.d.ts +66 -2
  51. package/dist/core/types.js +45 -3
  52. package/dist/env.d.ts +2 -2
  53. package/dist/env.js +1 -1
  54. package/dist/repositories/locale.d.ts +24 -0
  55. package/dist/repositories/locale.js +102 -0
  56. package/dist/repositories/resource.js +4 -1
  57. package/dist/repositories/team.d.ts +7 -1
  58. package/dist/repositories/team.js +39 -2
  59. package/dist/repositories/variable.d.ts +24 -0
  60. package/dist/repositories/variable.js +70 -22
  61. package/dist/runtime/executor.js +2 -2
  62. package/dist/runtime/executor.py +2 -2
  63. package/dist/runtime/libs/python/fcode/__init__.py +3 -2
  64. package/dist/runtime/libs/python/fcode/context.py +43 -1
  65. package/dist/services/fcode-graphql-client.d.ts +20 -1
  66. package/dist/services/fcode-graphql-client.js +276 -17
  67. package/dist/services/locale-merger.d.ts +23 -0
  68. package/dist/services/locale-merger.js +111 -0
  69. package/dist/services/locale-resolver.d.ts +18 -0
  70. package/dist/services/locale-resolver.js +120 -0
  71. package/dist/services/process-runner.d.ts +1 -0
  72. package/dist/services/process-runner.js +2 -2
  73. package/dist/utils/gitignore.d.ts +2 -0
  74. package/dist/utils/gitignore.js +9 -0
  75. package/oclif.manifest.json +511 -127
  76. package/package.json +11 -2
package/README.md CHANGED
@@ -20,7 +20,7 @@ $ npm install -g @factorialco/fcode-cli
20
20
  $ fcode COMMAND
21
21
  running command...
22
22
  $ fcode (--version)
23
- @factorialco/fcode-cli/2.0.0 linux-x64 node-v22.22.3
23
+ @factorialco/fcode-cli/2.2.0 linux-x64 node-v22.22.3
24
24
  $ fcode --help [COMMAND]
25
25
  USAGE
26
26
  $ fcode COMMAND
@@ -40,6 +40,12 @@ USAGE
40
40
  * [`fcode dependencies:status [RESOURCESLUG]`](#fcode-dependenciesstatus-resourceslug)
41
41
  * [`fcode help [COMMAND]`](#fcode-help-command)
42
42
  * [`fcode http`](#fcode-http)
43
+ * [`fcode i18n:add [RESOURCESLUG]`](#fcode-i18nadd-resourceslug)
44
+ * [`fcode i18n:pull [RESOURCESLUG]`](#fcode-i18npull-resourceslug)
45
+ * [`fcode i18n:push [RESOURCESLUG]`](#fcode-i18npush-resourceslug)
46
+ * [`fcode i18n:remove [RESOURCESLUG]`](#fcode-i18nremove-resourceslug)
47
+ * [`fcode i18n:reset [RESOURCESLUG]`](#fcode-i18nreset-resourceslug)
48
+ * [`fcode i18n:status [RESOURCESLUG]`](#fcode-i18nstatus-resourceslug)
43
49
  * [`fcode login`](#fcode-login)
44
50
  * [`fcode logout`](#fcode-logout)
45
51
  * [`fcode modules:add [RESOURCESLUG]`](#fcode-modulesadd-resourceslug)
@@ -67,9 +73,15 @@ USAGE
67
73
  * [`fcode settings:set KEY VALUE`](#fcode-settingsset-key-value)
68
74
  * [`fcode setup-debug`](#fcode-setup-debug)
69
75
  * [`fcode status`](#fcode-status)
76
+ * [`fcode team:aliases:delete NAME`](#fcode-teamaliasesdelete-name)
77
+ * [`fcode team:aliases:list`](#fcode-teamaliaseslist)
78
+ * [`fcode team:aliases:set NAME TAG`](#fcode-teamaliasesset-name-tag)
70
79
  * [`fcode team:pull`](#fcode-teampull)
71
80
  * [`fcode team:push`](#fcode-teampush)
72
81
  * [`fcode team:status`](#fcode-teamstatus)
82
+ * [`fcode team:versions:create TAG`](#fcode-teamversionscreate-tag)
83
+ * [`fcode team:versions:delete TAG`](#fcode-teamversionsdelete-tag)
84
+ * [`fcode team:versions:list`](#fcode-teamversionslist)
73
85
  * [`fcode test [SLUG]`](#fcode-test-slug)
74
86
  * [`fcode test:scaffold SLUG`](#fcode-testscaffold-slug)
75
87
  * [`fcode variables:add [RESOURCESLUG]`](#fcode-variablesadd-resourceslug)
@@ -284,6 +296,124 @@ EXAMPLES
284
296
  $ fcode http --auth-user admin --auth-password secret
285
297
  ```
286
298
 
299
+ ## `fcode i18n:add [RESOURCESLUG]`
300
+
301
+ Keeps track of new local locales
302
+
303
+ ```
304
+ USAGE
305
+ $ fcode i18n:add [RESOURCESLUG]
306
+
307
+ ARGUMENTS
308
+ [RESOURCESLUG] Resource slug
309
+
310
+ DESCRIPTION
311
+ Keeps track of new local locales
312
+
313
+ EXAMPLES
314
+ $ fcode i18n:add
315
+
316
+ $ fcode i18n:add pt-BR
317
+ ```
318
+
319
+ ## `fcode i18n:pull [RESOURCESLUG]`
320
+
321
+ Fetch all locales from cloud and save them locally
322
+
323
+ ```
324
+ USAGE
325
+ $ fcode i18n:pull [RESOURCESLUG] [-f]
326
+
327
+ ARGUMENTS
328
+ [RESOURCESLUG] Resource slug
329
+
330
+ FLAGS
331
+ -f, --force Force command
332
+
333
+ DESCRIPTION
334
+ Fetch all locales from cloud and save them locally
335
+
336
+ EXAMPLES
337
+ $ fcode i18n:pull
338
+ ```
339
+
340
+ ## `fcode i18n:push [RESOURCESLUG]`
341
+
342
+ Create or update cloud locales from local ones
343
+
344
+ ```
345
+ USAGE
346
+ $ fcode i18n:push [RESOURCESLUG] [-f]
347
+
348
+ ARGUMENTS
349
+ [RESOURCESLUG] Resource slug
350
+
351
+ FLAGS
352
+ -f, --force Force command
353
+
354
+ DESCRIPTION
355
+ Create or update cloud locales from local ones
356
+
357
+ EXAMPLES
358
+ $ fcode i18n:push
359
+
360
+ $ fcode i18n:push pt-BR
361
+ ```
362
+
363
+ ## `fcode i18n:remove [RESOURCESLUG]`
364
+
365
+ Remove track of a local locale
366
+
367
+ ```
368
+ USAGE
369
+ $ fcode i18n:remove [RESOURCESLUG]
370
+
371
+ ARGUMENTS
372
+ [RESOURCESLUG] Resource slug
373
+
374
+ DESCRIPTION
375
+ Remove track of a local locale
376
+
377
+ EXAMPLES
378
+ $ fcode i18n:remove pt-BR
379
+ ```
380
+
381
+ ## `fcode i18n:reset [RESOURCESLUG]`
382
+
383
+ Reset locales with contents from current remote
384
+
385
+ ```
386
+ USAGE
387
+ $ fcode i18n:reset [RESOURCESLUG]
388
+
389
+ ARGUMENTS
390
+ [RESOURCESLUG] Resource slug
391
+
392
+ DESCRIPTION
393
+ Reset locales with contents from current remote
394
+
395
+ EXAMPLES
396
+ $ fcode i18n:reset
397
+ ```
398
+
399
+ ## `fcode i18n:status [RESOURCESLUG]`
400
+
401
+ List all locales status
402
+
403
+ ```
404
+ USAGE
405
+ $ fcode i18n:status [RESOURCESLUG]
406
+
407
+ ARGUMENTS
408
+ [RESOURCESLUG] Resource slug
409
+
410
+ DESCRIPTION
411
+ List all locales status
412
+
413
+ EXAMPLES
414
+ $ fcode i18n:status
415
+ ```
416
+
287
417
  ## `fcode login`
288
418
 
289
419
  Login with your Factorial Code credentials (browser OAuth or email/password)
@@ -695,7 +825,8 @@ Run Factorial Code processes locally
695
825
 
696
826
  ```
697
827
  USAGE
698
- $ fcode run SLUG [-p <value>] [-v <value>] [-l DEBUG|INFO|WARNING|ERROR] [-j] [-e <value>]
828
+ $ fcode run SLUG [-p <value>] [-v <value>] [-l DEBUG|INFO|WARNING|ERROR] [-j] [--locale <value>] [-e
829
+ <value>]
699
830
 
700
831
  ARGUMENTS
701
832
  SLUG Process slug
@@ -707,6 +838,7 @@ FLAGS
707
838
  <options: DEBUG|INFO|WARNING|ERROR>
708
839
  -p, --parameters=<value> Parameters: stringified JSON or file path
709
840
  -v, --version=<value> Process version
841
+ --locale=<value> Locale fcode.i18n resolves against (defaults to the workspace primaryLocale)
710
842
 
711
843
  DESCRIPTION
712
844
  Run Factorial Code processes locally
@@ -811,6 +943,59 @@ EXAMPLES
811
943
  $ fcode status
812
944
  ```
813
945
 
946
+ ## `fcode team:aliases:delete NAME`
947
+
948
+ Delete a team version alias and the per-entity aliases carrying its name on every owned process and module
949
+
950
+ ```
951
+ USAGE
952
+ $ fcode team:aliases:delete NAME
953
+
954
+ ARGUMENTS
955
+ NAME alias name to delete
956
+
957
+ DESCRIPTION
958
+ Delete a team version alias and the per-entity aliases carrying its name on every owned process and module
959
+
960
+ EXAMPLES
961
+ $ fcode team:aliases:delete production
962
+ ```
963
+
964
+ ## `fcode team:aliases:list`
965
+
966
+ List the team version aliases of the active team workspace
967
+
968
+ ```
969
+ USAGE
970
+ $ fcode team:aliases:list
971
+
972
+ DESCRIPTION
973
+ List the team version aliases of the active team workspace
974
+
975
+ EXAMPLES
976
+ $ fcode team:aliases:list
977
+ ```
978
+
979
+ ## `fcode team:aliases:set NAME TAG`
980
+
981
+ Create or re-point a team version alias, upserting the per-entity alias on every owned process and module that has the target tag published
982
+
983
+ ```
984
+ USAGE
985
+ $ fcode team:aliases:set NAME TAG
986
+
987
+ ARGUMENTS
988
+ NAME alias name (e.g. production)
989
+ TAG team version tag the alias points at
990
+
991
+ DESCRIPTION
992
+ Create or re-point a team version alias, upserting the per-entity alias on every owned process and module that has the
993
+ target tag published
994
+
995
+ EXAMPLES
996
+ $ fcode team:aliases:set production v1.0.0
997
+ ```
998
+
814
999
  ## `fcode team:pull`
815
1000
 
816
1001
  Fetch team settings (timezone, error handler, inheritance) from cloud into team.json
@@ -859,6 +1044,67 @@ EXAMPLES
859
1044
  $ fcode team:status
860
1045
  ```
861
1046
 
1047
+ ## `fcode team:versions:create TAG`
1048
+
1049
+ Publish a team version: creates a version with the tag on every owned process and module (existing tags are skipped) and pins bare module imports in the published snapshots
1050
+
1051
+ ```
1052
+ USAGE
1053
+ $ fcode team:versions:create TAG [-c <value>]
1054
+
1055
+ ARGUMENTS
1056
+ TAG version tag to publish (e.g. v1.0.0)
1057
+
1058
+ FLAGS
1059
+ -c, --comment=<value> comment describing the version
1060
+
1061
+ DESCRIPTION
1062
+ Publish a team version: creates a version with the tag on every owned process and module (existing tags are skipped)
1063
+ and pins bare module imports in the published snapshots
1064
+
1065
+ EXAMPLES
1066
+ $ fcode team:versions:create v1.0.0
1067
+
1068
+ $ fcode team:versions:create v1.0.0 --comment "First stable release"
1069
+ ```
1070
+
1071
+ ## `fcode team:versions:delete TAG`
1072
+
1073
+ Delete a team version. CASCADES: every owned process/module version with the tag is deleted, together with the aliases, executions and schedules that reference them
1074
+
1075
+ ```
1076
+ USAGE
1077
+ $ fcode team:versions:delete TAG [-f]
1078
+
1079
+ ARGUMENTS
1080
+ TAG version tag to delete
1081
+
1082
+ FLAGS
1083
+ -f, --force Force command
1084
+
1085
+ DESCRIPTION
1086
+ Delete a team version. CASCADES: every owned process/module version with the tag is deleted, together with the
1087
+ aliases, executions and schedules that reference them
1088
+
1089
+ EXAMPLES
1090
+ $ fcode team:versions:delete v1.0.0
1091
+ ```
1092
+
1093
+ ## `fcode team:versions:list`
1094
+
1095
+ List the team versions published on the active team workspace
1096
+
1097
+ ```
1098
+ USAGE
1099
+ $ fcode team:versions:list
1100
+
1101
+ DESCRIPTION
1102
+ List the team versions published on the active team workspace
1103
+
1104
+ EXAMPLES
1105
+ $ fcode team:versions:list
1106
+ ```
1107
+
862
1108
  ## `fcode test [SLUG]`
863
1109
 
864
1110
  Run tests for Factorial Code processes
@@ -4,7 +4,8 @@ const base_command_1 = require("../core/commands/base-command");
4
4
  const add_1 = require("./processes/add");
5
5
  const add_2 = require("./modules/add");
6
6
  const add_3 = require("./variables/add");
7
- const add_4 = require("./dependencies/add");
7
+ const add_4 = require("./i18n/add");
8
+ const add_5 = require("./dependencies/add");
8
9
  const cli_1 = require("../utils/cli");
9
10
  class AddCommand extends base_command_1.default {
10
11
  async run() {
@@ -15,6 +16,7 @@ class AddCommand extends base_command_1.default {
15
16
  await add_2.default.run([]);
16
17
  await add_3.default.run([]);
17
18
  await add_4.default.run([]);
19
+ await add_5.default.run([]);
18
20
  }
19
21
  }
20
22
  AddCommand.description = 'Keeps track of new local components';
@@ -13,6 +13,7 @@ export default class Clone extends Command {
13
13
  checkWorkspaceIsEmpty(slug: string): Promise<void>;
14
14
  cloneTeam(origin: TeamOrigin, skipSkillsSetup?: boolean): Promise<void>;
15
15
  createWorkspaceConfig(origin: TeamOrigin): Promise<void>;
16
+ createWorkspaceI18n(slug: string): void;
16
17
  createWorkspaceDatastore(slug: string): void;
17
18
  createWorkspaceStorage(slug: string): void;
18
19
  createWorkspaceGitIgnore(slug: string): Promise<void>;
@@ -50,6 +50,7 @@ class Clone extends core_1.Command {
50
50
  await this.mkdirWorkspace(origin.slug);
51
51
  await this.createWorkspaceConfig(origin);
52
52
  await this.createWorkspaceGitIgnore(origin.slug);
53
+ this.createWorkspaceI18n(origin.slug);
53
54
  this.createWorkspaceDatastore(origin.slug);
54
55
  this.createWorkspaceStorage(origin.slug);
55
56
  await this.createWorkspaceLocalVariables(origin.slug);
@@ -63,6 +64,10 @@ class Clone extends core_1.Command {
63
64
  const config = new workspace_1.default(path.join(process.cwd(), origin.slug));
64
65
  await config.init(origin);
65
66
  }
67
+ // Created empty so `i18n:add` has somewhere to look before the first locale is pulled.
68
+ createWorkspaceI18n(slug) {
69
+ fs.mkdirpSync(path.join(slug, 'i18n'));
70
+ }
66
71
  createWorkspaceDatastore(slug) {
67
72
  fs.outputFileSync(path.join(slug, 'datastore.json'), '{}');
68
73
  }
@@ -0,0 +1,9 @@
1
+ import I18nCommand from '../../core/commands/i18n-command';
2
+ export default class I18nAdd extends I18nCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const i18n_command_1 = require("../../core/commands/i18n-command");
4
+ const types_1 = require("../../core/types");
5
+ class I18nAdd extends i18n_command_1.default {
6
+ async run() {
7
+ await super.addResources();
8
+ }
9
+ }
10
+ I18nAdd.description = 'Keeps track of new local locales';
11
+ I18nAdd.examples = ['$ fcode i18n:add', '$ fcode i18n:add pt-BR'];
12
+ I18nAdd.args = types_1.ResourceSlugArg;
13
+ exports.default = I18nAdd;
@@ -0,0 +1,12 @@
1
+ import I18nCommand from '../../core/commands/i18n-command';
2
+ export default class I18nPull extends I18nCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const i18n_command_1 = require("../../core/commands/i18n-command");
4
+ const types_1 = require("../../core/types");
5
+ class I18nPull extends i18n_command_1.default {
6
+ async run() {
7
+ await super.pullResources();
8
+ }
9
+ }
10
+ I18nPull.description = 'Fetch all locales from cloud and save them locally';
11
+ I18nPull.examples = ['$ fcode i18n:pull'];
12
+ I18nPull.args = types_1.ResourceSlugArg;
13
+ I18nPull.flags = types_1.ForceFlag;
14
+ exports.default = I18nPull;
@@ -0,0 +1,12 @@
1
+ import I18nCommand from '../../core/commands/i18n-command';
2
+ export default class I18nPush extends I18nCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const i18n_command_1 = require("../../core/commands/i18n-command");
4
+ const types_1 = require("../../core/types");
5
+ class I18nPush extends i18n_command_1.default {
6
+ async run() {
7
+ await super.pushResources();
8
+ }
9
+ }
10
+ I18nPush.description = 'Create or update cloud locales from local ones';
11
+ I18nPush.examples = ['$ fcode i18n:push', '$ fcode i18n:push pt-BR'];
12
+ I18nPush.args = types_1.ResourceSlugArg;
13
+ I18nPush.flags = types_1.ForceFlag;
14
+ exports.default = I18nPush;
@@ -0,0 +1,9 @@
1
+ import I18nCommand from '../../core/commands/i18n-command';
2
+ export default class I18nRemove extends I18nCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const color_1 = require("@oclif/color");
4
+ const i18n_command_1 = require("../../core/commands/i18n-command");
5
+ const types_1 = require("../../core/types");
6
+ const cli_1 = require("../../utils/cli");
7
+ class I18nRemove extends i18n_command_1.default {
8
+ async run() {
9
+ if (!this.resourceSlug) {
10
+ cli_1.default.log(color_1.default.red(`You must specify a locale`));
11
+ return;
12
+ }
13
+ await super.removeResource(this.resourceSlug);
14
+ }
15
+ }
16
+ I18nRemove.description = 'Remove track of a local locale';
17
+ I18nRemove.examples = ['$ fcode i18n:remove pt-BR'];
18
+ I18nRemove.args = types_1.ResourceSlugArg;
19
+ exports.default = I18nRemove;
@@ -0,0 +1,9 @@
1
+ import I18nCommand from '../../core/commands/i18n-command';
2
+ export default class I18nReset extends I18nCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const i18n_command_1 = require("../../core/commands/i18n-command");
4
+ const types_1 = require("../../core/types");
5
+ class I18nReset extends i18n_command_1.default {
6
+ async run() {
7
+ await super.resetResources();
8
+ }
9
+ }
10
+ I18nReset.description = 'Reset locales with contents from current remote';
11
+ I18nReset.examples = ['$ fcode i18n:reset'];
12
+ I18nReset.args = types_1.ResourceSlugArg;
13
+ exports.default = I18nReset;
@@ -0,0 +1,11 @@
1
+ import I18nCommand from '../../core/commands/i18n-command';
2
+ import { MergedResource } from '../../core/types';
3
+ export default class I18nStatus extends I18nCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
8
+ };
9
+ resourcesTableLog(resources: Array<MergedResource>): Promise<void>;
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const i18n_command_1 = require("../../core/commands/i18n-command");
4
+ const types_1 = require("../../core/types");
5
+ const colorize_resource_1 = require("../../utils/colorize-resource");
6
+ const cli_1 = require("../../utils/cli");
7
+ class I18nStatus extends i18n_command_1.default {
8
+ async resourcesTableLog(resources) {
9
+ const hasInherited = resources.some((resource) => resource.resolvingTeamSlug);
10
+ cli_1.cli.table(resources, {
11
+ locale: {
12
+ // The identifier, not the slug: an inherited file is tracked as `en.inherited`, and the
13
+ // workspace it comes from already has its own column.
14
+ get({ locale, slug, status }) {
15
+ return (0, colorize_resource_1.colorizeByStatus)(String(locale ?? slug), status);
16
+ },
17
+ header: 'locale',
18
+ },
19
+ ...(hasInherited && {
20
+ inherited: {
21
+ get(resource) {
22
+ return (0, colorize_resource_1.colorizeByStatus)(resource.resolvingTeamSlug ? `🔗 ${resource.resolvingTeamSlug}` : '', resource.status);
23
+ },
24
+ header: 'inherited',
25
+ },
26
+ }),
27
+ status: {
28
+ get({ status }) {
29
+ return (0, colorize_resource_1.colorizeByStatus)(status, status);
30
+ },
31
+ header: 'status',
32
+ },
33
+ }, { sort: 'locale' });
34
+ }
35
+ async run() {
36
+ await this.resourcesLog();
37
+ }
38
+ }
39
+ I18nStatus.description = 'List all locales status';
40
+ I18nStatus.examples = ['$ fcode i18n:status'];
41
+ I18nStatus.args = types_1.ResourceSlugArg;
42
+ exports.default = I18nStatus;
@@ -4,8 +4,9 @@ const base_command_1 = require("../core/commands/base-command");
4
4
  const pull_1 = require("./modules/pull");
5
5
  const pull_2 = require("./processes/pull");
6
6
  const pull_3 = require("./variables/pull");
7
- const pull_4 = require("./dependencies/pull");
8
- const pull_5 = require("./team/pull");
7
+ const pull_4 = require("./i18n/pull");
8
+ const pull_5 = require("./dependencies/pull");
9
+ const pull_6 = require("./team/pull");
9
10
  const types_1 = require("../core/types");
10
11
  const gitignore_1 = require("../utils/gitignore");
11
12
  class PullCommand extends base_command_1.default {
@@ -19,9 +20,10 @@ class PullCommand extends base_command_1.default {
19
20
  await pull_1.default.run(args);
20
21
  await pull_3.default.run(args);
21
22
  await pull_4.default.run(args);
23
+ await pull_5.default.run(args);
22
24
  // Team settings are pulled last so process metadata is available to resolve the
23
25
  // error-handler process id to its slug.
24
- await pull_5.default.run([]);
26
+ await pull_6.default.run([]);
25
27
  // Keep inherited resources out of git now that all resource metadata is saved.
26
28
  await (0, gitignore_1.syncInheritedGitignore)();
27
29
  }
@@ -4,8 +4,9 @@ const base_command_1 = require("../core/commands/base-command");
4
4
  const push_1 = require("./modules/push");
5
5
  const push_2 = require("./processes/push");
6
6
  const push_3 = require("./variables/push");
7
- const push_4 = require("./dependencies/push");
8
- const push_5 = require("./team/push");
7
+ const push_4 = require("./i18n/push");
8
+ const push_5 = require("./dependencies/push");
9
+ const push_6 = require("./team/push");
9
10
  const types_1 = require("../core/types");
10
11
  class PushCommand extends base_command_1.default {
11
12
  async run() {
@@ -18,9 +19,10 @@ class PushCommand extends base_command_1.default {
18
19
  await push_1.default.run(args);
19
20
  await push_3.default.run(args);
20
21
  await push_4.default.run(args);
22
+ await push_5.default.run(args);
21
23
  // Team settings are pushed last so the error-handler process exists to resolve
22
24
  // its slug to an id.
23
- await push_5.default.run(args);
25
+ await push_6.default.run(args);
24
26
  }
25
27
  }
26
28
  PushCommand.description = 'Update cloud team workspace with local workspace';
@@ -4,7 +4,8 @@ const core_1 = require("@oclif/core");
4
4
  const reset_1 = require("./processes/reset");
5
5
  const reset_2 = require("./modules/reset");
6
6
  const reset_3 = require("./variables/reset");
7
- const reset_4 = require("./dependencies/reset");
7
+ const reset_4 = require("./i18n/reset");
8
+ const reset_5 = require("./dependencies/reset");
8
9
  class Reset extends core_1.Command {
9
10
  async run() {
10
11
  await this.parse(Reset);
@@ -12,6 +13,7 @@ class Reset extends core_1.Command {
12
13
  await reset_2.default.run([]);
13
14
  await reset_3.default.run([]);
14
15
  await reset_4.default.run([]);
16
+ await reset_5.default.run([]);
15
17
  }
16
18
  }
17
19
  Reset.description = 'Reset team workspace with contents from current remote';
@@ -10,6 +10,7 @@ export default class Run extends Command {
10
10
  version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
11
  logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
12
  jsonLogs: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ locale: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
14
  variablesFile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
15
  };
15
16
  run(): Promise<void>;
@@ -6,7 +6,7 @@ const core_2 = require("@oclif/core");
6
6
  const process_runner_1 = require("../services/process-runner");
7
7
  class Run extends core_2.Command {
8
8
  async run() {
9
- const { args: { slug }, flags: { parameters: parametersFlag, version, logLevel, jsonLogs, variablesFile }, } = await this.parse(Run);
9
+ const { args: { slug }, flags: { parameters: parametersFlag, version, logLevel, jsonLogs, variablesFile, locale }, } = await this.parse(Run);
10
10
  let parameters;
11
11
  if (parametersFlag) {
12
12
  try {
@@ -16,7 +16,7 @@ class Run extends core_2.Command {
16
16
  parameters = await Promise.resolve(`${path.resolve(parametersFlag)}`).then(s => require(s));
17
17
  }
18
18
  }
19
- await (0, process_runner_1.runProcess)({ slug, parameters, version, logLevel, jsonLogs, extraVariablesFile: variablesFile });
19
+ await (0, process_runner_1.runProcess)({ slug, parameters, version, logLevel, jsonLogs, extraVariablesFile: variablesFile, locale });
20
20
  }
21
21
  }
22
22
  Run.args = {
@@ -48,6 +48,9 @@ Run.flags = {
48
48
  description: 'Output process logs as newline-delimited JSON (NDJSON)',
49
49
  default: false,
50
50
  }),
51
+ locale: core_1.Flags.string({
52
+ description: 'Locale fcode.i18n resolves against (defaults to the workspace primaryLocale)',
53
+ }),
51
54
  variablesFile: core_1.Flags.string({
52
55
  char: 'e',
53
56
  description: 'Path to a .env file whose variables override workspace variables',
@@ -70,11 +70,11 @@ class SetupDebug extends core_1.Command {
70
70
  });
71
71
  }
72
72
  }
73
- if (process.env.YC_COMMAND) {
73
+ if (process.env.FC_COMMAND) {
74
74
  configurations.forEach((configuration) => {
75
75
  configuration.env = {
76
76
  ...configuration.env,
77
- YC_COMMAND: process.env.YC_COMMAND
77
+ FC_COMMAND: process.env.FC_COMMAND
78
78
  };
79
79
  });
80
80
  }