@appsemble/cli 0.20.13 → 0.20.14

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 (190) hide show
  1. package/README.md +4 -4
  2. package/__fixtures__/getBlockConfigFromTypeScript/comments/tsconfig.json +1 -1
  3. package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/tsconfig.json +1 -1
  4. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/tsconfig.json +1 -1
  5. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/tsconfig.json +1 -1
  6. package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/tsconfig.json +1 -1
  7. package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/tsconfig.json +1 -1
  8. package/__fixtures__/getBlockConfigFromTypeScript/tsError/tsconfig.json +1 -1
  9. package/__fixtures__/getBlockConfigFromTypeScript/valid/tsconfig.json +1 -1
  10. package/commands/app/create.d.ts +1 -1
  11. package/commands/app/create.js +16 -24
  12. package/commands/app/create.js.map +1 -1
  13. package/commands/app/create.ts +3 -3
  14. package/commands/app/extract-messages.d.ts +1 -1
  15. package/commands/app/extract-messages.js +12 -20
  16. package/commands/app/extract-messages.js.map +1 -1
  17. package/commands/app/extract-messages.ts +2 -2
  18. package/commands/app/index.js +12 -36
  19. package/commands/app/index.js.map +1 -1
  20. package/commands/app/index.ts +9 -5
  21. package/commands/app/update.d.ts +1 -1
  22. package/commands/app/update.js +18 -26
  23. package/commands/app/update.js.map +1 -1
  24. package/commands/app/update.ts +4 -4
  25. package/commands/asset/create.d.ts +1 -1
  26. package/commands/asset/create.js +20 -28
  27. package/commands/asset/create.js.map +1 -1
  28. package/commands/asset/create.ts +4 -4
  29. package/commands/asset/index.js +5 -33
  30. package/commands/asset/index.js.map +1 -1
  31. package/commands/asset/index.ts +3 -3
  32. package/commands/block/build.d.ts +1 -1
  33. package/commands/block/build.js +14 -22
  34. package/commands/block/build.js.map +1 -1
  35. package/commands/block/build.ts +2 -2
  36. package/commands/block/extract-messages.d.ts +1 -1
  37. package/commands/block/extract-messages.js +15 -23
  38. package/commands/block/extract-messages.js.map +1 -1
  39. package/commands/block/extract-messages.ts +2 -2
  40. package/commands/block/index.js +12 -36
  41. package/commands/block/index.js.map +1 -1
  42. package/commands/block/index.ts +9 -5
  43. package/commands/block/publish.d.ts +1 -1
  44. package/commands/block/publish.js +17 -25
  45. package/commands/block/publish.js.map +1 -1
  46. package/commands/block/publish.ts +3 -3
  47. package/commands/cleanupResources.d.ts +1 -1
  48. package/commands/cleanupResources.js +6 -11
  49. package/commands/cleanupResources.js.map +1 -1
  50. package/commands/cleanupResources.ts +2 -2
  51. package/commands/config/get.d.ts +1 -1
  52. package/commands/config/get.js +10 -17
  53. package/commands/config/get.js.map +1 -1
  54. package/commands/config/get.ts +6 -5
  55. package/commands/config/index.js +10 -35
  56. package/commands/config/index.js.map +1 -1
  57. package/commands/config/index.ts +7 -4
  58. package/commands/config/set.d.ts +1 -1
  59. package/commands/config/set.js +15 -22
  60. package/commands/config/set.js.map +1 -1
  61. package/commands/config/set.ts +7 -6
  62. package/commands/login.d.ts +1 -1
  63. package/commands/login.js +3 -7
  64. package/commands/login.js.map +1 -1
  65. package/commands/login.ts +1 -1
  66. package/commands/logout.d.ts +1 -1
  67. package/commands/logout.js +3 -7
  68. package/commands/logout.js.map +1 -1
  69. package/commands/logout.ts +1 -1
  70. package/commands/migrate.d.ts +1 -1
  71. package/commands/migrate.js +8 -16
  72. package/commands/migrate.js.map +1 -1
  73. package/commands/migrate.ts +3 -3
  74. package/commands/organization/create.d.ts +1 -1
  75. package/commands/organization/create.js +10 -15
  76. package/commands/organization/create.js.map +1 -1
  77. package/commands/organization/create.ts +4 -4
  78. package/commands/organization/index.js +10 -35
  79. package/commands/organization/index.js.map +1 -1
  80. package/commands/organization/index.ts +7 -4
  81. package/commands/organization/update.d.ts +1 -1
  82. package/commands/organization/update.js +10 -15
  83. package/commands/organization/update.js.map +1 -1
  84. package/commands/organization/update.ts +4 -4
  85. package/commands/resource/create.d.ts +1 -1
  86. package/commands/resource/create.js +18 -26
  87. package/commands/resource/create.js.map +1 -1
  88. package/commands/resource/create.ts +4 -4
  89. package/commands/resource/index.js +10 -35
  90. package/commands/resource/index.js.map +1 -1
  91. package/commands/resource/index.ts +7 -4
  92. package/commands/resource/update.d.ts +1 -1
  93. package/commands/resource/update.js +18 -26
  94. package/commands/resource/update.js.map +1 -1
  95. package/commands/resource/update.ts +4 -4
  96. package/commands/runCronJobs.d.ts +1 -1
  97. package/commands/runCronJobs.js +6 -11
  98. package/commands/runCronJobs.js.map +1 -1
  99. package/commands/runCronJobs.ts +2 -2
  100. package/commands/start.d.ts +1 -1
  101. package/commands/start.js +10 -15
  102. package/commands/start.js.map +1 -1
  103. package/commands/start.ts +4 -4
  104. package/commands/team/create.d.ts +1 -1
  105. package/commands/team/create.js +10 -15
  106. package/commands/team/create.js.map +1 -1
  107. package/commands/team/create.ts +4 -4
  108. package/commands/team/delete.d.ts +1 -1
  109. package/commands/team/delete.js +10 -15
  110. package/commands/team/delete.js.map +1 -1
  111. package/commands/team/delete.ts +4 -4
  112. package/commands/team/index.js +14 -37
  113. package/commands/team/index.js.map +1 -1
  114. package/commands/team/index.ts +11 -6
  115. package/commands/team/member/delete.d.ts +1 -1
  116. package/commands/team/member/delete.js +10 -15
  117. package/commands/team/member/delete.js.map +1 -1
  118. package/commands/team/member/delete.ts +4 -4
  119. package/commands/team/member/index.js +12 -36
  120. package/commands/team/member/index.js.map +1 -1
  121. package/commands/team/member/index.ts +9 -5
  122. package/commands/team/member/invite.d.ts +1 -1
  123. package/commands/team/member/invite.js +10 -15
  124. package/commands/team/member/invite.js.map +1 -1
  125. package/commands/team/member/invite.ts +4 -4
  126. package/commands/team/member/update.d.ts +1 -1
  127. package/commands/team/member/update.js +12 -17
  128. package/commands/team/member/update.js.map +1 -1
  129. package/commands/team/member/update.ts +4 -4
  130. package/commands/team/update.d.ts +1 -1
  131. package/commands/team/update.js +10 -15
  132. package/commands/team/update.js.map +1 -1
  133. package/commands/team/update.ts +4 -4
  134. package/index.js +66 -94
  135. package/index.js.map +1 -1
  136. package/index.ts +65 -65
  137. package/jest.config.js +3 -1
  138. package/jest.setup.js +3 -5
  139. package/jest.setup.js.map +1 -1
  140. package/jest.setup.ts +1 -1
  141. package/lib/__snapshots__/getBlockConfigFromTypeScript.test.ts.snap +5 -6
  142. package/lib/app.d.ts +1 -1
  143. package/lib/app.js +151 -163
  144. package/lib/app.js.map +1 -1
  145. package/lib/app.ts +7 -7
  146. package/lib/asset.js +11 -18
  147. package/lib/asset.js.map +1 -1
  148. package/lib/authentication.d.ts +1 -1
  149. package/lib/authentication.js +34 -65
  150. package/lib/authentication.js.map +1 -1
  151. package/lib/authentication.ts +3 -2
  152. package/lib/block.js +99 -113
  153. package/lib/block.js.map +1 -1
  154. package/lib/block.test.js +9 -14
  155. package/lib/block.test.js.map +1 -1
  156. package/lib/block.test.ts +1 -1
  157. package/lib/block.ts +5 -5
  158. package/lib/coercers.js +5 -13
  159. package/lib/coercers.js.map +1 -1
  160. package/lib/coercers.test.js +2 -4
  161. package/lib/coercers.test.js.map +1 -1
  162. package/lib/coercers.test.ts +1 -1
  163. package/lib/getBlockConfigFromTypeScript.js +49 -56
  164. package/lib/getBlockConfigFromTypeScript.js.map +1 -1
  165. package/lib/getBlockConfigFromTypeScript.test.js +42 -46
  166. package/lib/getBlockConfigFromTypeScript.test.js.map +1 -1
  167. package/lib/getBlockConfigFromTypeScript.test.ts +7 -6
  168. package/lib/initAxios.d.ts +1 -1
  169. package/lib/initAxios.js +7 -14
  170. package/lib/initAxios.js.map +1 -1
  171. package/lib/initAxios.ts +2 -2
  172. package/lib/loadWebpackConfig.js +14 -45
  173. package/lib/loadWebpackConfig.js.map +1 -1
  174. package/lib/loadWebpackConfig.ts +10 -17
  175. package/lib/organization.js +23 -31
  176. package/lib/organization.js.map +1 -1
  177. package/lib/output.js +5 -9
  178. package/lib/output.js.map +1 -1
  179. package/lib/processCss.js +11 -18
  180. package/lib/processCss.js.map +1 -1
  181. package/lib/resource.js +17 -25
  182. package/lib/resource.js.map +1 -1
  183. package/lib/serverImport.js +6 -34
  184. package/lib/serverImport.js.map +1 -1
  185. package/lib/serverImport.ts +0 -1
  186. package/lib/team.js +28 -41
  187. package/lib/team.js.map +1 -1
  188. package/package.json +11 -10
  189. package/tsconfig.json +0 -1
  190. package/types.js +1 -2
@@ -1,36 +1,8 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.builder = exports.description = exports.command = exports.handler = void 0;
27
- const create = __importStar(require("./create"));
28
- var utils_1 = require("@appsemble/utils");
29
- Object.defineProperty(exports, "handler", { enumerable: true, get: function () { return utils_1.noop; } });
30
- exports.command = 'asset';
31
- exports.description = 'Commands related to app assets.';
32
- function builder(yargs) {
1
+ import * as create from './create.js';
2
+ export { noop as handler } from '@appsemble/utils';
3
+ export const command = 'asset';
4
+ export const description = 'Commands related to app assets.';
5
+ export function builder(yargs) {
33
6
  return yargs.command(create).demandCommand(1);
34
7
  }
35
- exports.builder = builder;
36
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iDAAmC;AAEnC,0CAAmD;AAA1C,gGAAA,IAAI,OAAW;AAEX,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,WAAW,GAAG,iCAAiC,CAAC;AAE7D,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAFD,0BAEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAE7D,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAkC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC"}
@@ -1,6 +1,6 @@
1
- import { Argv } from 'yargs';
1
+ import { Argv, CommandModule } from 'yargs';
2
2
 
3
- import * as create from './create';
3
+ import * as create from './create.js';
4
4
 
5
5
  export { noop as handler } from '@appsemble/utils';
6
6
 
@@ -8,5 +8,5 @@ export const command = 'asset';
8
8
  export const description = 'Commands related to app assets.';
9
9
 
10
10
  export function builder(yargs: Argv): Argv {
11
- return yargs.command(create).demandCommand(1);
11
+ return yargs.command(create as unknown as CommandModule).demandCommand(1);
12
12
  }
@@ -1,5 +1,5 @@
1
1
  import { Argv } from 'yargs';
2
- import { BaseArguments } from '../../types';
2
+ import { BaseArguments } from '../../types.js';
3
3
  interface BuildBlockArguments extends BaseArguments {
4
4
  paths: string[];
5
5
  }
@@ -1,30 +1,22 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.handler = exports.builder = exports.description = exports.command = void 0;
7
- const node_utils_1 = require("@appsemble/node-utils");
8
- const fast_glob_1 = __importDefault(require("fast-glob"));
9
- const normalize_path_1 = __importDefault(require("normalize-path"));
10
- const block_1 = require("../../lib/block");
11
- exports.command = 'build <paths...>';
12
- exports.description = 'Build a block without publishing.';
13
- function builder(yargs) {
1
+ import { logger } from '@appsemble/node-utils';
2
+ import fg from 'fast-glob';
3
+ import normalizePath from 'normalize-path';
4
+ import { buildBlock, getBlockConfig } from '../../lib/block.js';
5
+ export const command = 'build <paths...>';
6
+ export const description = 'Build a block without publishing.';
7
+ export function builder(yargs) {
14
8
  return yargs.positional('paths', {
15
9
  describe: 'The paths to the blocks to build.',
16
10
  });
17
11
  }
18
- exports.builder = builder;
19
- async function handler({ paths }) {
20
- const normalizedPaths = paths.map((path) => (0, normalize_path_1.default)(path));
21
- const directories = await (0, fast_glob_1.default)(normalizedPaths, { absolute: true, onlyDirectories: true });
22
- node_utils_1.logger.info(`Building ${directories.length} Blocks`);
12
+ export async function handler({ paths }) {
13
+ const normalizedPaths = paths.map((path) => normalizePath(path));
14
+ const directories = await fg(normalizedPaths, { absolute: true, onlyDirectories: true });
15
+ logger.info(`Building ${directories.length} Blocks`);
23
16
  for (const dir of directories) {
24
- node_utils_1.logger.info('');
25
- const config = await (0, block_1.getBlockConfig)(dir);
26
- await (0, block_1.buildBlock)(config);
17
+ logger.info('');
18
+ const config = await getBlockConfig(dir);
19
+ await buildBlock(config);
27
20
  }
28
21
  }
29
- exports.handler = handler;
30
22
  //# sourceMappingURL=build.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+C;AAC/C,0DAA2B;AAC3B,oEAA2C;AAG3C,2CAA6D;AAOhD,QAAA,OAAO,GAAG,kBAAkB,CAAC;AAC7B,QAAA,WAAW,GAAG,mCAAmC,CAAC;AAE/D,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE;QAC/B,QAAQ,EAAE,mCAAmC;KAC9C,CAAC,CAAC;AACL,CAAC;AAJD,0BAIC;AAEM,KAAK,UAAU,OAAO,CAAC,EAAE,KAAK,EAAuB;IAC1D,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,IAAA,mBAAE,EAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACzF,mBAAM,CAAC,IAAI,CAAC,YAAY,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC;IACrD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,mBAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAc,EAAC,GAAG,CAAC,CAAC;QAEzC,MAAM,IAAA,kBAAU,EAAC,MAAM,CAAC,CAAC;KAC1B;AACH,CAAC;AAVD,0BAUC"}
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOhE,MAAM,CAAC,MAAM,OAAO,GAAG,kBAAkB,CAAC;AAC1C,MAAM,CAAC,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAE/D,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE;QAC/B,QAAQ,EAAE,mCAAmC;KAC9C,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAAE,KAAK,EAAuB;IAC1D,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACzF,MAAM,CAAC,IAAI,CAAC,YAAY,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC;IACrD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;QAEzC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;KAC1B;AACH,CAAC"}
@@ -3,8 +3,8 @@ import fg from 'fast-glob';
3
3
  import normalizePath from 'normalize-path';
4
4
  import { Argv } from 'yargs';
5
5
 
6
- import { buildBlock, getBlockConfig } from '../../lib/block';
7
- import { BaseArguments } from '../../types';
6
+ import { buildBlock, getBlockConfig } from '../../lib/block.js';
7
+ import { BaseArguments } from '../../types.js';
8
8
 
9
9
  interface BuildBlockArguments extends BaseArguments {
10
10
  paths: string[];
@@ -1,5 +1,5 @@
1
1
  import { Argv } from 'yargs';
2
- import { BaseArguments } from '../../types';
2
+ import { BaseArguments } from '../../types.js';
3
3
  interface BuildBlockArguments extends BaseArguments {
4
4
  paths: string[];
5
5
  languages: string[];
@@ -1,16 +1,10 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.handler = exports.builder = exports.description = exports.command = void 0;
7
- const node_utils_1 = require("@appsemble/node-utils");
8
- const fast_glob_1 = __importDefault(require("fast-glob"));
9
- const normalize_path_1 = __importDefault(require("normalize-path"));
10
- const block_1 = require("../../lib/block");
11
- exports.command = 'extract-messages <paths...>';
12
- exports.description = 'Extract messages from a block.';
13
- function builder(yargs) {
1
+ import { logger } from '@appsemble/node-utils';
2
+ import fg from 'fast-glob';
3
+ import normalizePath from 'normalize-path';
4
+ import { getBlockConfig, processBlockMessages } from '../../lib/block.js';
5
+ export const command = 'extract-messages <paths...>';
6
+ export const description = 'Extract messages from a block.';
7
+ export function builder(yargs) {
14
8
  return yargs
15
9
  .positional('paths', {
16
10
  describe: 'The paths to the blocks to extract messages from.',
@@ -21,18 +15,16 @@ function builder(yargs) {
21
15
  default: [],
22
16
  });
23
17
  }
24
- exports.builder = builder;
25
- async function handler({ languages, paths }) {
26
- const normalizedPaths = paths.map((path) => (0, normalize_path_1.default)(path));
27
- const directories = await (0, fast_glob_1.default)(normalizedPaths, { absolute: true, onlyDirectories: true });
18
+ export async function handler({ languages, paths }) {
19
+ const normalizedPaths = paths.map((path) => normalizePath(path));
20
+ const directories = await fg(normalizedPaths, { absolute: true, onlyDirectories: true });
28
21
  const langs = [...new Set(['en', ...languages.map((language) => language.toLowerCase())])];
29
- node_utils_1.logger.info(`Extracting messages from ${directories.length} Blocks`);
22
+ logger.info(`Extracting messages from ${directories.length} Blocks`);
30
23
  for (const dir of directories) {
31
- node_utils_1.logger.info('');
32
- const config = await (0, block_1.getBlockConfig)(dir);
33
- node_utils_1.logger.info(`Processing ${config.name}`);
34
- await (0, block_1.processBlockMessages)(config, langs);
24
+ logger.info('');
25
+ const config = await getBlockConfig(dir);
26
+ logger.info(`Processing ${config.name}`);
27
+ await processBlockMessages(config, langs);
35
28
  }
36
29
  }
37
- exports.handler = handler;
38
30
  //# sourceMappingURL=extract-messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extract-messages.js","sourceRoot":"","sources":["extract-messages.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+C;AAC/C,0DAA2B;AAC3B,oEAA2C;AAG3C,2CAAuE;AAQ1D,QAAA,OAAO,GAAG,6BAA6B,CAAC;AACxC,QAAA,WAAW,GAAG,gCAAgC,CAAC;AAE5D,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,mDAAmD;KAC9D,CAAC;SACD,MAAM,CAAC,WAAW,EAAE;QACnB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,2BAA2B;QACrC,OAAO,EAAE,EAAE;KACZ,CAAC,CAAC;AACP,CAAC;AAVD,0BAUC;AAEM,KAAK,UAAU,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAuB;IACrE,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,IAAA,mBAAE,EAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACzF,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3F,mBAAM,CAAC,IAAI,CAAC,4BAA4B,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC;IACrE,KAAK,MAAM,GAAG,IAAI,WAA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,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3F,MAAM,CAAC,IAAI,CAAC,4BAA4B,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC;IACrE,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAEzC,MAAM,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KAC3C;AACH,CAAC"}
@@ -3,8 +3,8 @@ import fg from 'fast-glob';
3
3
  import normalizePath from 'normalize-path';
4
4
  import { Argv } from 'yargs';
5
5
 
6
- import { getBlockConfig, processBlockMessages } from '../../lib/block';
7
- import { BaseArguments } from '../../types';
6
+ import { getBlockConfig, processBlockMessages } from '../../lib/block.js';
7
+ import { BaseArguments } from '../../types.js';
8
8
 
9
9
  interface BuildBlockArguments extends BaseArguments {
10
10
  paths: string[];
@@ -1,38 +1,14 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.builder = exports.description = exports.command = exports.handler = void 0;
27
- const build = __importStar(require("./build"));
28
- const extractMessages = __importStar(require("./extract-messages"));
29
- const publish = __importStar(require("./publish"));
30
- var utils_1 = require("@appsemble/utils");
31
- Object.defineProperty(exports, "handler", { enumerable: true, get: function () { return utils_1.noop; } });
32
- exports.command = 'block';
33
- exports.description = 'Commands related to blocks.';
34
- function builder(yargs) {
35
- return yargs.command(build).command(extractMessages).command(publish).demandCommand(1);
1
+ import * as build from './build.js';
2
+ import * as extractMessages from './extract-messages.js';
3
+ import * as publish from './publish.js';
4
+ export { noop as handler } from '@appsemble/utils';
5
+ export const command = 'block';
6
+ export const description = 'Commands related to blocks.';
7
+ export function builder(yargs) {
8
+ return yargs
9
+ .command(build)
10
+ .command(extractMessages)
11
+ .command(publish)
12
+ .demandCommand(1);
36
13
  }
37
- exports.builder = builder;
38
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAAiC;AACjC,oEAAsD;AACtD,mDAAqC;AAErC,0CAAmD;AAA1C,gGAAA,IAAI,OAAW;AAEX,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,WAAW,GAAG,6BAA6B,CAAC;AAEzD,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AACzF,CAAC;AAFD,0BAEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAEzD,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CAAC,KAAiC,CAAC;SAC1C,OAAO,CAAC,eAA2C,CAAC;SACpD,OAAO,CAAC,OAAmC,CAAC;SAC5C,aAAa,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC"}
@@ -1,8 +1,8 @@
1
- import { Argv } from 'yargs';
1
+ import { Argv, CommandModule } from 'yargs';
2
2
 
3
- import * as build from './build';
4
- import * as extractMessages from './extract-messages';
5
- import * as publish from './publish';
3
+ import * as build from './build.js';
4
+ import * as extractMessages from './extract-messages.js';
5
+ import * as publish from './publish.js';
6
6
 
7
7
  export { noop as handler } from '@appsemble/utils';
8
8
 
@@ -10,5 +10,9 @@ export const command = 'block';
10
10
  export const description = 'Commands related to blocks.';
11
11
 
12
12
  export function builder(yargs: Argv): Argv {
13
- return yargs.command(build).command(extractMessages).command(publish).demandCommand(1);
13
+ return yargs
14
+ .command(build as unknown as CommandModule)
15
+ .command(extractMessages as unknown as CommandModule)
16
+ .command(publish as unknown as CommandModule)
17
+ .demandCommand(1);
14
18
  }
@@ -1,5 +1,5 @@
1
1
  import { Argv } from 'yargs';
2
- import { BaseArguments } from '../../types';
2
+ import { BaseArguments } from '../../types.js';
3
3
  interface PublishBlockArguments extends BaseArguments {
4
4
  paths: string[];
5
5
  build: boolean;
@@ -1,17 +1,11 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.handler = exports.builder = exports.description = exports.command = void 0;
7
- const node_utils_1 = require("@appsemble/node-utils");
8
- const fast_glob_1 = __importDefault(require("fast-glob"));
9
- const normalize_path_1 = __importDefault(require("normalize-path"));
10
- const authentication_1 = require("../../lib/authentication");
11
- const block_1 = require("../../lib/block");
12
- exports.command = 'publish <paths...>';
13
- exports.description = 'Publish a block.';
14
- function builder(yargs) {
1
+ import { logger } from '@appsemble/node-utils';
2
+ import fg from 'fast-glob';
3
+ import normalizePath from 'normalize-path';
4
+ import { authenticate } from '../../lib/authentication.js';
5
+ import { buildBlock, getBlockConfig, publishBlock } from '../../lib/block.js';
6
+ export const command = 'publish <paths...>';
7
+ export const description = 'Publish a block.';
8
+ export function builder(yargs) {
15
9
  return yargs
16
10
  .positional('paths', {
17
11
  describe: 'The paths to the blocks to publish.',
@@ -27,20 +21,18 @@ function builder(yargs) {
27
21
  type: 'boolean',
28
22
  });
29
23
  }
30
- exports.builder = builder;
31
- async function handler({ build, clientCredentials, ignoreConflict, paths, remote, }) {
32
- await (0, authentication_1.authenticate)(remote, 'blocks:write', clientCredentials);
33
- const normalizedPaths = paths.map((path) => (0, normalize_path_1.default)(path));
34
- const directories = await (0, fast_glob_1.default)(normalizedPaths, { absolute: true, onlyDirectories: true });
35
- node_utils_1.logger.info(`Publishing ${directories.length} Blocks`);
24
+ export async function handler({ build, clientCredentials, ignoreConflict, paths, remote, }) {
25
+ await authenticate(remote, 'blocks:write', clientCredentials);
26
+ const normalizedPaths = paths.map((path) => normalizePath(path));
27
+ const directories = await fg(normalizedPaths, { absolute: true, onlyDirectories: true });
28
+ logger.info(`Publishing ${directories.length} Blocks`);
36
29
  for (const dir of directories) {
37
- node_utils_1.logger.info('');
38
- const config = await (0, block_1.getBlockConfig)(dir);
30
+ logger.info('');
31
+ const config = await getBlockConfig(dir);
39
32
  if (build) {
40
- await (0, block_1.buildBlock)(config);
33
+ await buildBlock(config);
41
34
  }
42
- await (0, block_1.publishBlock)(config, ignoreConflict);
35
+ await publishBlock(config, ignoreConflict);
43
36
  }
44
37
  }
45
- exports.handler = handler;
46
38
  //# sourceMappingURL=publish.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"publish.js","sourceRoot":"","sources":["publish.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+C;AAC/C,0DAA2B;AAC3B,oEAA2C;AAG3C,6DAAwD;AACxD,2CAA2E;AAS9D,QAAA,OAAO,GAAG,oBAAoB,CAAC;AAC/B,QAAA,WAAW,GAAG,kBAAkB,CAAC;AAE9C,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,qCAAqC;KAChD,CAAC;SACD,MAAM,CAAC,OAAO,EAAE;QACf,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,mEAAmE;QAC7E,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CAAC,iBAAiB,EAAE;QACzB,QAAQ,EAAE,qEAAqE;QAC/E,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC;AACP,CAAC;AAfD,0BAeC;AAEM,KAAK,UAAU,OAAO,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,MAAM,GACgB;IACtB,MAAM,IAAA,6BAAY,EAAC,MAAM,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAC;IAE9D,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,IAAA,mBAAE,EAAC,eAAe,EAAE,EAAE,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AS;KAChB,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,MAAM,GACgB;IACtB,MAAM,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAC;IAE9D,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACzF,MAAM,CAAC,IAAI,CAAC,cAAc,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC;IACvD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;QAEzC,IAAI,KAAK,EAAE;YACT,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;SAC1B;QAED,MAAM,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;KAC5C;AACH,CAAC"}
@@ -3,9 +3,9 @@ import fg from 'fast-glob';
3
3
  import normalizePath from 'normalize-path';
4
4
  import { Argv } from 'yargs';
5
5
 
6
- import { authenticate } from '../../lib/authentication';
7
- import { buildBlock, getBlockConfig, publishBlock } from '../../lib/block';
8
- import { BaseArguments } from '../../types';
6
+ import { authenticate } from '../../lib/authentication.js';
7
+ import { buildBlock, getBlockConfig, publishBlock } from '../../lib/block.js';
8
+ import { BaseArguments } from '../../types.js';
9
9
 
10
10
  interface PublishBlockArguments extends BaseArguments {
11
11
  paths: string[];
@@ -1,5 +1,5 @@
1
1
  import { Argv } from 'yargs';
2
- import { BaseArguments } from '../types';
2
+ import { BaseArguments } from '../types.js';
3
3
  export declare const command = "cleanup-resources";
4
4
  export declare const description = "Deletes all expired resources from the database.";
5
5
  export declare function builder(yargs: Argv): Argv<any>;
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handler = exports.builder = exports.description = exports.command = void 0;
4
- const serverImport_1 = require("../lib/serverImport");
5
- exports.command = 'cleanup-resources';
6
- exports.description = 'Deletes all expired resources from the database.';
7
- function builder(yargs) {
1
+ import { serverImport } from '../lib/serverImport.js';
2
+ export const command = 'cleanup-resources';
3
+ export const description = 'Deletes all expired resources from the database.';
4
+ export function builder(yargs) {
8
5
  return yargs
9
6
  .option('database-host', {
10
7
  desc: 'The host of the database to connect to. This defaults to the connected database container.',
@@ -35,11 +32,9 @@ function builder(yargs) {
35
32
  conflicts: ['database-host', 'database-name', 'database-user', 'database-password'],
36
33
  });
37
34
  }
38
- exports.builder = builder;
39
- async function handler(argv) {
40
- const { cleanupResources, setArgv } = await (0, serverImport_1.serverImport)('setArgv', 'cleanupResources');
35
+ export async function handler(argv) {
36
+ const { cleanupResources, setArgv } = await serverImport('setArgv', 'cleanupResources');
41
37
  setArgv(argv);
42
38
  return cleanupResources();
43
39
  }
44
- exports.handler = handler;
45
40
  //# sourceMappingURL=cleanupResources.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cleanupResources.js","sourceRoot":"","sources":["cleanupResources.ts"],"names":[],"mappings":";;;AAEA,sDAAmD;AAGtC,QAAA,OAAO,GAAG,mBAAmB,CAAC;AAC9B,QAAA,WAAW,GAAG,kDAAkD,CAAC;AAE9E,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,4FAA4F;KACnG,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CA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ACvB,IAAI,EAAE,yCAAyC;QAC/C,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACtB,IAAI,EAAE,qCAAqC;QAC3C,IAAI,EAAE,SAAS;KAChB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,OAAO,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;KAChD,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,2CAA2C;QACjD,OAAO,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;KAChD,CAAC;SACD,MAAM,CAAC,mBAAmB,EAAE;QAC3B,IAAI,EAAE,+CAA+C;QACrD,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;KAC5C,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACtB,IAAI,EAAE,wHAAwH;QAC9H,SAAS,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,CAAC;KACpF,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAmB;IAC/C,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IACxF,OAAO,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { Argv } from 'yargs';
2
2
 
3
- import { serverImport } from '../lib/serverImport';
4
- import { BaseArguments } from '../types';
3
+ import { serverImport } from '../lib/serverImport.js';
4
+ import { BaseArguments } from '../types.js';
5
5
 
6
6
  export const command = 'cleanup-resources';
7
7
  export const description = 'Deletes all expired resources from the database.';
@@ -1,5 +1,5 @@
1
1
  import { Argv } from 'yargs';
2
- import { BaseArguments } from '../../types';
2
+ import { BaseArguments } from '../../types.js';
3
3
  interface ConfigGetArguments extends BaseArguments {
4
4
  key: string;
5
5
  }
@@ -1,25 +1,18 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.handler = exports.builder = exports.description = exports.command = void 0;
7
- const utils_1 = require("@appsemble/utils");
8
- const read_pkg_up_1 = __importDefault(require("read-pkg-up"));
9
- exports.command = 'get <key>';
10
- exports.description = 'Get an Appsemble configuration option from package.json.';
11
- function builder(yargs) {
1
+ import { has } from '@appsemble/utils';
2
+ import { readPackageUp } from 'read-pkg-up';
3
+ export const command = 'get <key>';
4
+ export const description = 'Get an Appsemble configuration option from package.json.';
5
+ export function builder(yargs) {
12
6
  return yargs.positional('key', {
13
7
  describe: 'The key whose value to get',
14
8
  });
15
9
  }
16
- exports.builder = builder;
17
- async function handler({ key }) {
18
- const { packageJson } = await (0, read_pkg_up_1.default)({ normalize: false });
19
- if ((0, utils_1.has)(packageJson, 'appsembleServer')) {
10
+ export async function handler({ key }) {
11
+ const { packageJson } = await readPackageUp({ normalize: false });
12
+ const pkg = packageJson;
13
+ if (has(pkg, 'appsembleServer')) {
20
14
  // eslint-disable-next-line no-console
21
- console.log(packageJson.appsembleServer[key]);
15
+ console.log(pkg.appsembleServer[key]);
22
16
  }
23
17
  }
24
- exports.handler = handler;
25
18
  //# sourceMappingURL=get.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["get.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAuC;AACvC,8DAAoC;AASvB,QAAA,OAAO,GAAG,WAAW,CAAC;AACtB,QAAA,WAAW,GAAG,0DAA0D,CAAC;AAEtF,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE;QAC7B,QAAQ,EAAE,4BAA4B;KACvC,CAAC,CAAC;AACL,CAAC;AAJD,0BAIC;AAEM,KAAK,UAAU,OAAO,CAAC,EAAE,GAAG,EAAsB;IACvD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,qBAAS,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9D,IAAI,IAAA,WAAG,EAAC,WAAW,EAAE,iBAAiB,CAAC,EAAE;QACvC,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAE,WAAmC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;KACxE;AACH,CAAC;AAND,0BAMC"}
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAC;AACnC,MAAM,CAAC,MAAM,WAAW,GAAG,0DAA0D,CAAC;AAEtF,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE;QAC7B,QAAQ,EAAE,4BAA4B;KACvC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAAE,GAAG,EAAsB;IACvD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,aAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,MAAM,GAAG,GAAG,WAAkC,CAAC;IAC/C,IAAI,GAAG,CAAC,GAAG,EAAE,iBAAiB,CAAC,EAAE;QAC/B,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;KACvC;AACH,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { has } from '@appsemble/utils';
2
- import readPkgUp from 'read-pkg-up';
2
+ import { readPackageUp } from 'read-pkg-up';
3
3
  import { Argv } from 'yargs';
4
4
 
5
- import { BaseArguments, MonoRepoPackageJson } from '../../types';
5
+ import { BaseArguments, MonoRepoPackageJson } from '../../types.js';
6
6
 
7
7
  interface ConfigGetArguments extends BaseArguments {
8
8
  key: string;
@@ -18,9 +18,10 @@ export function builder(yargs: Argv): Argv<any> {
18
18
  }
19
19
 
20
20
  export async function handler({ key }: ConfigGetArguments): Promise<void> {
21
- const { packageJson } = await readPkgUp({ normalize: false });
22
- if (has(packageJson, 'appsembleServer')) {
21
+ const { packageJson } = await readPackageUp({ normalize: false });
22
+ const pkg = packageJson as MonoRepoPackageJson;
23
+ if (has(pkg, 'appsembleServer')) {
23
24
  // eslint-disable-next-line no-console
24
- console.log((packageJson as MonoRepoPackageJson).appsembleServer[key]);
25
+ console.log(pkg.appsembleServer[key]);
25
26
  }
26
27
  }
@@ -1,37 +1,12 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.builder = exports.description = exports.command = exports.handler = void 0;
27
- const get = __importStar(require("./get"));
28
- const set = __importStar(require("./set"));
29
- var utils_1 = require("@appsemble/utils");
30
- Object.defineProperty(exports, "handler", { enumerable: true, get: function () { return utils_1.noop; } });
31
- exports.command = 'config';
32
- exports.description = 'Commands related to local configurations.';
33
- function builder(yargs) {
34
- return yargs.command(get).command(set).demandCommand(1);
1
+ import * as get from './get.js';
2
+ import * as set from './set.js';
3
+ export { noop as handler } from '@appsemble/utils';
4
+ export const command = 'config';
5
+ export const description = 'Commands related to local configurations.';
6
+ export function builder(yargs) {
7
+ return yargs
8
+ .command(get)
9
+ .command(set)
10
+ .demandCommand(1);
35
11
  }
36
- exports.builder = builder;
37
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2CAA6B;AAC7B,2CAA6B;AAE7B,0CAAmD;AAA1C,gGAAA,IAAI,OAAW;AAEX,QAAA,OAAO,GAAG,QAAQ,CAAC;AACnB,QAAA,WAAW,GAAG,2CAA2C,CAAC;AAEvE,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAFD,0BAEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAG,2CAA2C,CAAC;AAEvE,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CAAC,GAA+B,CAAC;SACxC,OAAO,CAAC,GAA+B,CAAC;SACxC,aAAa,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC"}
@@ -1,7 +1,7 @@
1
- import { Argv } from 'yargs';
1
+ import { Argv, CommandModule } from 'yargs';
2
2
 
3
- import * as get from './get';
4
- import * as set from './set';
3
+ import * as get from './get.js';
4
+ import * as set from './set.js';
5
5
 
6
6
  export { noop as handler } from '@appsemble/utils';
7
7
 
@@ -9,5 +9,8 @@ export const command = 'config';
9
9
  export const description = 'Commands related to local configurations.';
10
10
 
11
11
  export function builder(yargs: Argv): Argv {
12
- return yargs.command(get).command(set).demandCommand(1);
12
+ return yargs
13
+ .command(get as unknown as CommandModule)
14
+ .command(set as unknown as CommandModule)
15
+ .demandCommand(1);
13
16
  }