@appsemble/cli 0.20.9 → 0.20.12

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 (295) hide show
  1. package/__fixtures__/getBlockConfigFromTypeScript/comments/index.ts +40 -0
  2. package/__fixtures__/getBlockConfigFromTypeScript/comments/tsconfig.json +7 -0
  3. package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/index.ts +34 -0
  4. package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/tsconfig.json +7 -0
  5. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/index.ts +34 -0
  6. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/tsconfig.json +7 -0
  7. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/index.ts +34 -0
  8. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/tsconfig.json +7 -0
  9. package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/index.ts +34 -0
  10. package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/tsconfig.json +7 -0
  11. package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/index.ts +11 -0
  12. package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/tsconfig.json +7 -0
  13. package/__fixtures__/getBlockConfigFromTypeScript/tsError/index.ts +4 -0
  14. package/__fixtures__/getBlockConfigFromTypeScript/tsError/tsconfig.json +8 -0
  15. package/__fixtures__/getBlockConfigFromTypeScript/valid/index.ts +28 -0
  16. package/__fixtures__/getBlockConfigFromTypeScript/valid/tsconfig.json +7 -0
  17. package/__fixtures__/makePayload/no-icon/output/block.js +1 -0
  18. package/__fixtures__/makePayload/with-icon/icon.svg +2 -0
  19. package/__fixtures__/makePayload/with-icon/output/block.js +1 -0
  20. package/assets/appsemblerc.schema.json +150 -0
  21. package/changed/added/.gitkeep +0 -0
  22. package/changed/changed/.gitkeep +0 -0
  23. package/changed/deprecated/.gitkeep +0 -0
  24. package/changed/fixed/.gitkeep +0 -0
  25. package/changed/removed/.gitkeep +0 -0
  26. package/changed/security/.gitkeep +0 -0
  27. package/{dist/commands → commands}/app/create.d.ts +0 -0
  28. package/{dist/commands → commands}/app/create.js +0 -0
  29. package/commands/app/create.js.map +1 -0
  30. package/commands/app/create.ts +104 -0
  31. package/{dist/commands → commands}/app/extract-messages.d.ts +0 -0
  32. package/{dist/commands → commands}/app/extract-messages.js +0 -0
  33. package/commands/app/extract-messages.js.map +1 -0
  34. package/commands/app/extract-messages.ts +56 -0
  35. package/{dist/commands → commands}/app/index.d.ts +0 -0
  36. package/{dist/commands → commands}/app/index.js +0 -0
  37. package/commands/app/index.js.map +1 -0
  38. package/commands/app/index.ts +14 -0
  39. package/{dist/commands → commands}/app/update.d.ts +0 -0
  40. package/{dist/commands → commands}/app/update.js +0 -0
  41. package/commands/app/update.js.map +1 -0
  42. package/commands/app/update.ts +111 -0
  43. package/{dist/commands → commands}/asset/create.d.ts +0 -0
  44. package/{dist/commands → commands}/asset/create.js +0 -0
  45. package/commands/asset/create.js.map +1 -0
  46. package/commands/asset/create.ts +84 -0
  47. package/{dist/commands → commands}/asset/index.d.ts +0 -0
  48. package/{dist/commands → commands}/asset/index.js +0 -0
  49. package/commands/asset/index.js.map +1 -0
  50. package/commands/asset/index.ts +12 -0
  51. package/{dist/commands → commands}/block/build.d.ts +0 -0
  52. package/{dist/commands → commands}/block/build.js +0 -0
  53. package/commands/block/build.js.map +1 -0
  54. package/commands/block/build.ts +32 -0
  55. package/{dist/commands → commands}/block/extract-messages.d.ts +0 -0
  56. package/{dist/commands → commands}/block/extract-messages.js +0 -0
  57. package/commands/block/extract-messages.js.map +1 -0
  58. package/commands/block/extract-messages.ts +41 -0
  59. package/{dist/commands → commands}/block/index.d.ts +0 -0
  60. package/{dist/commands → commands}/block/index.js +0 -0
  61. package/commands/block/index.js.map +1 -0
  62. package/commands/block/index.ts +14 -0
  63. package/{dist/commands → commands}/block/publish.d.ts +0 -0
  64. package/{dist/commands → commands}/block/publish.js +0 -0
  65. package/commands/block/publish.js.map +1 -0
  66. package/commands/block/publish.ts +58 -0
  67. package/{dist/commands → commands}/cleanupResources.d.ts +0 -0
  68. package/{dist/commands → commands}/cleanupResources.js +0 -0
  69. package/commands/cleanupResources.js.map +1 -0
  70. package/commands/cleanupResources.ts +45 -0
  71. package/{dist/commands → commands}/config/get.d.ts +0 -0
  72. package/{dist/commands → commands}/config/get.js +0 -0
  73. package/commands/config/get.js.map +1 -0
  74. package/commands/config/get.ts +26 -0
  75. package/{dist/commands → commands}/config/index.d.ts +0 -0
  76. package/{dist/commands → commands}/config/index.js +0 -0
  77. package/commands/config/index.js.map +1 -0
  78. package/commands/config/index.ts +13 -0
  79. package/{dist/commands → commands}/config/set.d.ts +0 -0
  80. package/{dist/commands → commands}/config/set.js +0 -0
  81. package/commands/config/set.js.map +1 -0
  82. package/commands/config/set.ts +44 -0
  83. package/{dist/commands → commands}/login.d.ts +0 -0
  84. package/{dist/commands → commands}/login.js +0 -0
  85. package/commands/login.js.map +1 -0
  86. package/commands/login.ts +5 -0
  87. package/{dist/commands → commands}/logout.d.ts +0 -0
  88. package/{dist/commands → commands}/logout.js +0 -0
  89. package/commands/logout.js.map +1 -0
  90. package/commands/logout.ts +5 -0
  91. package/{dist/commands → commands}/migrate.d.ts +0 -0
  92. package/{dist/commands → commands}/migrate.js +5 -2
  93. package/commands/migrate.js.map +1 -0
  94. package/commands/migrate.ts +50 -0
  95. package/{dist/commands → commands}/organization/create.d.ts +0 -0
  96. package/{dist/commands → commands}/organization/create.js +0 -0
  97. package/commands/organization/create.js.map +1 -0
  98. package/commands/organization/create.ts +65 -0
  99. package/{dist/commands → commands}/organization/index.d.ts +0 -0
  100. package/{dist/commands → commands}/organization/index.js +0 -0
  101. package/commands/organization/index.js.map +1 -0
  102. package/commands/organization/index.ts +13 -0
  103. package/{dist/commands → commands}/organization/update.d.ts +0 -0
  104. package/{dist/commands → commands}/organization/update.js +0 -0
  105. package/commands/organization/update.js.map +1 -0
  106. package/commands/organization/update.ts +65 -0
  107. package/{dist/commands → commands}/resource/create.d.ts +0 -0
  108. package/{dist/commands → commands}/resource/create.js +0 -0
  109. package/commands/resource/create.js.map +1 -0
  110. package/commands/resource/create.ts +78 -0
  111. package/{dist/commands → commands}/resource/index.d.ts +0 -0
  112. package/{dist/commands → commands}/resource/index.js +0 -0
  113. package/commands/resource/index.js.map +1 -0
  114. package/commands/resource/index.ts +13 -0
  115. package/{dist/commands → commands}/resource/update.d.ts +0 -0
  116. package/{dist/commands → commands}/resource/update.js +0 -0
  117. package/commands/resource/update.js.map +1 -0
  118. package/commands/resource/update.ts +77 -0
  119. package/{dist/commands → commands}/runCronJobs.d.ts +0 -0
  120. package/{dist/commands → commands}/runCronJobs.js +0 -0
  121. package/commands/runCronJobs.js.map +1 -0
  122. package/commands/runCronJobs.ts +45 -0
  123. package/{dist/commands → commands}/start.d.ts +0 -0
  124. package/{dist/commands → commands}/start.js +4 -0
  125. package/commands/start.js.map +1 -0
  126. package/commands/start.ts +140 -0
  127. package/{dist/commands → commands}/team/create.d.ts +0 -0
  128. package/{dist/commands → commands}/team/create.js +0 -0
  129. package/commands/team/create.js.map +1 -0
  130. package/commands/team/create.ts +60 -0
  131. package/{dist/commands → commands}/team/delete.d.ts +0 -0
  132. package/{dist/commands → commands}/team/delete.js +0 -0
  133. package/commands/team/delete.js.map +1 -0
  134. package/commands/team/delete.ts +54 -0
  135. package/{dist/commands → commands}/team/index.d.ts +0 -0
  136. package/{dist/commands → commands}/team/index.js +0 -0
  137. package/commands/team/index.js.map +1 -0
  138. package/commands/team/index.ts +15 -0
  139. package/{dist/commands → commands}/team/member/delete.d.ts +0 -0
  140. package/{dist/commands → commands}/team/member/delete.js +0 -0
  141. package/commands/team/member/delete.js.map +1 -0
  142. package/commands/team/member/delete.ts +61 -0
  143. package/{dist/commands → commands}/team/member/index.d.ts +0 -0
  144. package/{dist/commands → commands}/team/member/index.js +0 -0
  145. package/commands/team/member/index.js.map +1 -0
  146. package/commands/team/member/index.ts +14 -0
  147. package/{dist/commands → commands}/team/member/invite.d.ts +0 -0
  148. package/{dist/commands → commands}/team/member/invite.js +0 -0
  149. package/commands/team/member/invite.js.map +1 -0
  150. package/commands/team/member/invite.ts +61 -0
  151. package/{dist/commands → commands}/team/member/update.d.ts +0 -0
  152. package/{dist/commands → commands}/team/member/update.js +0 -0
  153. package/commands/team/member/update.js.map +1 -0
  154. package/commands/team/member/update.ts +70 -0
  155. package/{dist/commands → commands}/team/update.d.ts +0 -0
  156. package/{dist/commands → commands}/team/update.js +0 -0
  157. package/commands/team/update.js.map +1 -0
  158. package/commands/team/update.ts +60 -0
  159. package/index.d.ts +2 -0
  160. package/{dist/index.js → index.js} +2 -6
  161. package/index.js.map +1 -0
  162. package/index.ts +74 -0
  163. package/jest.config.js +1 -0
  164. package/jest.setup.d.ts +1 -0
  165. package/jest.setup.js +6 -0
  166. package/jest.setup.js.map +1 -0
  167. package/jest.setup.ts +4 -0
  168. package/lib/__snapshots__/getBlockConfigFromTypeScript.test.ts.snap +3872 -0
  169. package/{dist/lib → lib}/app.d.ts +17 -17
  170. package/{dist/lib → lib}/app.js +29 -29
  171. package/lib/app.js.map +1 -0
  172. package/lib/app.ts +797 -0
  173. package/{dist/lib → lib}/asset.d.ts +0 -0
  174. package/{dist/lib → lib}/asset.js +0 -0
  175. package/lib/asset.js.map +1 -0
  176. package/lib/asset.ts +43 -0
  177. package/{dist/lib → lib}/authentication.d.ts +3 -3
  178. package/{dist/lib → lib}/authentication.js +47 -15
  179. package/lib/authentication.js.map +1 -0
  180. package/lib/authentication.ts +193 -0
  181. package/{dist/lib → lib}/block.d.ts +16 -16
  182. package/{dist/lib → lib}/block.js +35 -26
  183. package/lib/block.js.map +1 -0
  184. package/lib/block.test.d.ts +1 -0
  185. package/lib/block.test.js +106 -0
  186. package/lib/block.test.js.map +1 -0
  187. package/lib/block.test.ts +103 -0
  188. package/lib/block.ts +384 -0
  189. package/{dist/lib → lib}/coercers.d.ts +2 -2
  190. package/{dist/lib → lib}/coercers.js +2 -2
  191. package/lib/coercers.js.map +1 -0
  192. package/lib/coercers.test.d.ts +1 -0
  193. package/lib/coercers.test.js +28 -0
  194. package/lib/coercers.test.js.map +1 -0
  195. package/lib/coercers.test.ts +27 -0
  196. package/lib/coercers.ts +57 -0
  197. package/{dist/lib → lib}/getBlockConfigFromTypeScript.d.ts +1 -1
  198. package/{dist/lib → lib}/getBlockConfigFromTypeScript.js +38 -36
  199. package/lib/getBlockConfigFromTypeScript.js.map +1 -0
  200. package/lib/getBlockConfigFromTypeScript.test.d.ts +1 -0
  201. package/lib/getBlockConfigFromTypeScript.test.js +238 -0
  202. package/lib/getBlockConfigFromTypeScript.test.js.map +1 -0
  203. package/lib/getBlockConfigFromTypeScript.test.ts +281 -0
  204. package/lib/getBlockConfigFromTypeScript.ts +354 -0
  205. package/{dist/lib → lib}/initAxios.d.ts +1 -1
  206. package/{dist/lib → lib}/initAxios.js +3 -4
  207. package/lib/initAxios.js.map +1 -0
  208. package/lib/initAxios.ts +16 -0
  209. package/{dist/lib → lib}/loadWebpackConfig.d.ts +3 -3
  210. package/{dist/lib → lib}/loadWebpackConfig.js +3 -3
  211. package/lib/loadWebpackConfig.js.map +1 -0
  212. package/lib/loadWebpackConfig.ts +59 -0
  213. package/{dist/lib → lib}/organization.d.ts +1 -1
  214. package/{dist/lib → lib}/organization.js +0 -0
  215. package/lib/organization.js.map +1 -0
  216. package/lib/organization.ts +105 -0
  217. package/{dist/lib → lib}/output.d.ts +0 -0
  218. package/{dist/lib → lib}/output.js +0 -0
  219. package/lib/output.js.map +1 -0
  220. package/lib/output.ts +19 -0
  221. package/{dist/lib → lib}/processCss.d.ts +1 -1
  222. package/{dist/lib → lib}/processCss.js +3 -3
  223. package/lib/processCss.js.map +1 -0
  224. package/lib/processCss.ts +24 -0
  225. package/{dist/lib → lib}/resource.d.ts +0 -0
  226. package/{dist/lib → lib}/resource.js +1 -1
  227. package/lib/resource.js.map +1 -0
  228. package/lib/resource.ts +128 -0
  229. package/{dist/lib → lib}/serverImport.d.ts +1 -1
  230. package/{dist/lib → lib}/serverImport.js +2 -2
  231. package/lib/serverImport.js.map +1 -0
  232. package/lib/serverImport.ts +43 -0
  233. package/{dist/lib → lib}/team.d.ts +0 -0
  234. package/{dist/lib → lib}/team.js +0 -0
  235. package/lib/team.js.map +1 -0
  236. package/lib/team.ts +152 -0
  237. package/package.json +14 -12
  238. package/tsconfig.json +10 -0
  239. package/{dist/types.d.ts → types.d.ts} +0 -0
  240. package/{dist/types.js → types.js} +0 -0
  241. package/types.js.map +1 -0
  242. package/types.ts +110 -0
  243. package/dist/commands/app/create.js.map +0 -1
  244. package/dist/commands/app/extract-messages.js.map +0 -1
  245. package/dist/commands/app/index.js.map +0 -1
  246. package/dist/commands/app/update.js.map +0 -1
  247. package/dist/commands/asset/create.js.map +0 -1
  248. package/dist/commands/asset/index.js.map +0 -1
  249. package/dist/commands/block/build.js.map +0 -1
  250. package/dist/commands/block/extract-messages.js.map +0 -1
  251. package/dist/commands/block/index.js.map +0 -1
  252. package/dist/commands/block/publish.js.map +0 -1
  253. package/dist/commands/cleanupResources.js.map +0 -1
  254. package/dist/commands/config/get.js.map +0 -1
  255. package/dist/commands/config/index.js.map +0 -1
  256. package/dist/commands/config/set.js.map +0 -1
  257. package/dist/commands/login.js.map +0 -1
  258. package/dist/commands/logout.js.map +0 -1
  259. package/dist/commands/migrate.js.map +0 -1
  260. package/dist/commands/organization/create.js.map +0 -1
  261. package/dist/commands/organization/index.js.map +0 -1
  262. package/dist/commands/organization/update.js.map +0 -1
  263. package/dist/commands/resource/create.js.map +0 -1
  264. package/dist/commands/resource/index.js.map +0 -1
  265. package/dist/commands/resource/update.js.map +0 -1
  266. package/dist/commands/runCronJobs.js.map +0 -1
  267. package/dist/commands/start.js.map +0 -1
  268. package/dist/commands/team/create.js.map +0 -1
  269. package/dist/commands/team/delete.js.map +0 -1
  270. package/dist/commands/team/index.js.map +0 -1
  271. package/dist/commands/team/member/delete.js.map +0 -1
  272. package/dist/commands/team/member/index.js.map +0 -1
  273. package/dist/commands/team/member/invite.js.map +0 -1
  274. package/dist/commands/team/member/update.js.map +0 -1
  275. package/dist/commands/team/update.js.map +0 -1
  276. package/dist/index.d.ts +0 -2
  277. package/dist/index.js.map +0 -1
  278. package/dist/lib/app.js.map +0 -1
  279. package/dist/lib/asset.js.map +0 -1
  280. package/dist/lib/authentication.js.map +0 -1
  281. package/dist/lib/block.js.map +0 -1
  282. package/dist/lib/coercers.js.map +0 -1
  283. package/dist/lib/getBlockConfigFromTypeScript.js.map +0 -1
  284. package/dist/lib/initAxios.js.map +0 -1
  285. package/dist/lib/loadWebpackConfig.js.map +0 -1
  286. package/dist/lib/organization.js.map +0 -1
  287. package/dist/lib/output.js.map +0 -1
  288. package/dist/lib/processCss.js.map +0 -1
  289. package/dist/lib/readPackageJson.d.ts +0 -9
  290. package/dist/lib/readPackageJson.js +0 -16
  291. package/dist/lib/readPackageJson.js.map +0 -1
  292. package/dist/lib/resource.js.map +0 -1
  293. package/dist/lib/serverImport.js.map +0 -1
  294. package/dist/lib/team.js.map +0 -1
  295. package/dist/types.js.map +0 -1
@@ -0,0 +1,27 @@
1
+ import { coerceRemote } from './coercers';
2
+
3
+ describe('coerceRemote', () => {
4
+ const tests: [string, string][] = [
5
+ ['http://appsemble.app', 'http://appsemble.app/'],
6
+ ['http://appsemble.app:80', 'http://appsemble.app/'],
7
+ ['https://appsemble.app', 'https://appsemble.app/'],
8
+ ['https://appsemble.app:443', 'https://appsemble.app/'],
9
+ ['https://appsemble.app:1337', 'https://appsemble.app:1337/'],
10
+ ['https://appsemble.app/pathname', 'https://appsemble.app/'],
11
+ ['https://appsemble.app?query=param', 'https://appsemble.app/'],
12
+ ['https://appsemble.app#hash', 'https://appsemble.app/'],
13
+ ['appsemble.app', 'https://appsemble.app/'],
14
+ ['https://localhost', 'https://localhost/'],
15
+ ['https://127.0.0.1', 'https://127.0.0.1/'],
16
+ ['foo.localhost', 'http://foo.localhost/'],
17
+ ['localhost', 'http://localhost/'],
18
+ ['127.0.0.1', 'http://127.0.0.1/'],
19
+ ['localhost:1337', 'http://localhost:1337/'],
20
+ ['127.0.0.1:1337', 'http://127.0.0.1:1337/'],
21
+ ];
22
+
23
+ it.each(tests)('should convert %s to %s', (input, expected) => {
24
+ const output = coerceRemote(input);
25
+ expect(output).toBe(expected);
26
+ });
27
+ });
@@ -0,0 +1,57 @@
1
+ import { createReadStream, ReadStream } from 'fs';
2
+
3
+ import normalizePath from 'normalize-path';
4
+
5
+ /**
6
+ * Convert a remote to a valid URL.
7
+ *
8
+ * Ip addresses and localhost use the http://` protocol by default. Others use the `https://`
9
+ * protocol by default. The path, search parameters, and hash are stripped.
10
+ *
11
+ * @param value The raw remote as specified by the CLI user.
12
+ * @returns The normalized URL.
13
+ */
14
+ export function coerceRemote(value: string): string {
15
+ let url = value;
16
+ if (!/^https?:\/\//.test(url)) {
17
+ if (/^(\d+\.?){4}(\/|$|:)/.test(url)) {
18
+ // It’s an IP address.
19
+ url = `http://${url}`;
20
+ } else if (/(\.|^)localhost(\/|$|:)/.test(url)) {
21
+ // It’s a localhost address.
22
+ url = `http://${url}`;
23
+ } else {
24
+ // It's a live remote.
25
+ url = `https://${url}`;
26
+ }
27
+ }
28
+ const remote = new URL(url);
29
+ remote.hash = '';
30
+ remote.search = '';
31
+ remote.pathname = '';
32
+ return String(remote);
33
+ }
34
+
35
+ /**
36
+ * Get a stream based on the filepath.
37
+ *
38
+ * @param value The filepath of the file to read.
39
+ * @returns A stream of the file.
40
+ */
41
+ export function coerceFile(value: string): NodeJS.ReadStream | ReadStream {
42
+ if (value == null) {
43
+ return;
44
+ }
45
+
46
+ // Prevent trying to read the file multiple times.
47
+ // https://github.com/yargs/yargs/issues/1802
48
+ if (typeof value === 'object') {
49
+ return value;
50
+ }
51
+
52
+ if (value === '-') {
53
+ return process.stdin;
54
+ }
55
+
56
+ return createReadStream(normalizePath(value));
57
+ }
@@ -4,7 +4,7 @@ import { BlockConfig, BlockManifest } from '@appsemble/types';
4
4
  *
5
5
  * Uses the .appsemblerc file and the type definitions of the block.
6
6
  *
7
- * @param blockConfig - The block configuration
7
+ * @param blockConfig The block configuration
8
8
  * @returns The block configuration appended from the TypeScript project.
9
9
  */
10
10
  export declare function getBlockConfigFromTypeScript(blockConfig: BlockConfig): Pick<BlockManifest, 'actions' | 'events' | 'messages' | 'parameters'>;
@@ -9,12 +9,12 @@ const node_utils_1 = require("@appsemble/node-utils");
9
9
  const comment_parser_1 = require("comment-parser");
10
10
  const normalize_path_1 = __importDefault(require("normalize-path"));
11
11
  const ts_json_schema_generator_1 = require("ts-json-schema-generator");
12
- const typescript_1 = require("typescript");
12
+ const typescript_1 = __importDefault(require("typescript"));
13
13
  /**
14
14
  * Get the tsdoc comment for a TypeScript node.
15
15
  *
16
- * @param checker - The type checker instance to use.
17
- * @param node - The node for which to get the tsdoc.
16
+ * @param checker The type checker instance to use.
17
+ * @param node The node for which to get the tsdoc.
18
18
  * @returns The tsdoc comment as a string, if present.
19
19
  */
20
20
  function getNodeComments(checker, node) {
@@ -34,9 +34,9 @@ function getNodeComments(checker, node) {
34
34
  *
35
35
  * This asserts only index signature members and regular alphanumerical properties are used.
36
36
  *
37
- * @param iface - The TypeScript interface to check.
38
- * @param checker - The TypeScript type checker.
39
- * @param convert - A function for converting extracted data to a value. It will be called with the
37
+ * @param iface The TypeScript interface to check.
38
+ * @param checker The TypeScript type checker.
39
+ * @param convert A function for converting extracted data to a value. It will be called with the
40
40
  * name and JSDoc description. The name is `undefined` for index signatures. The function should
41
41
  * return a tuple of key and value.
42
42
  * @returns A record created from the returned key/value pairs.
@@ -49,9 +49,9 @@ function processInterface(iface, checker, convert) {
49
49
  return Object.fromEntries(iface.members.map((member) => {
50
50
  var _a;
51
51
  const description = getNodeComments(checker, member);
52
- if ((0, typescript_1.isIndexSignatureDeclaration)(member)) {
52
+ if (typescript_1.default.isIndexSignatureDeclaration(member)) {
53
53
  // Comments aren’t properly extracted for index signatures.
54
- const commentRanges = (0, typescript_1.getLeadingCommentRanges)(source, member.pos);
54
+ const commentRanges = typescript_1.default.getLeadingCommentRanges(source, member.pos);
55
55
  if (commentRanges) {
56
56
  const comments = (_a = commentRanges === null || commentRanges === void 0 ? void 0 : commentRanges.map((r) => source.slice(r.pos, r.end))) !== null && _a !== void 0 ? _a : [];
57
57
  const [block] = (0, comment_parser_1.parse)(comments[0]);
@@ -63,11 +63,11 @@ function processInterface(iface, checker, convert) {
63
63
  }
64
64
  return convert(undefined, description);
65
65
  }
66
- if (!(0, typescript_1.isPropertySignature)(member)) {
66
+ if (!typescript_1.default.isPropertySignature(member)) {
67
67
  throw new node_utils_1.AppsembleError(`Only property and index signatures are allowed as ${iface.name} keys. Found: ${member.getFullText()}`);
68
68
  }
69
69
  const { name } = member;
70
- if (!(0, typescript_1.isIdentifier)(name)) {
70
+ if (!typescript_1.default.isIdentifier(name)) {
71
71
  throw new node_utils_1.AppsembleError(`Only property and index signatures are allowed as ${iface.name} keys. Found: ${name.getFullText()}`);
72
72
  }
73
73
  const { text } = name;
@@ -80,8 +80,8 @@ function processInterface(iface, checker, convert) {
80
80
  /**
81
81
  * Get an actions object based on a TypeScript interface node.
82
82
  *
83
- * @param iface - The node to base the actions on.
84
- * @param checker - The TypeScript type checker.
83
+ * @param iface The node to base the actions on.
84
+ * @param checker The TypeScript type checker.
85
85
  * @returns The action manifest to upload.
86
86
  */
87
87
  function processActions(iface, checker) {
@@ -90,9 +90,9 @@ function processActions(iface, checker) {
90
90
  /**
91
91
  * Get an events object based on TypeScript interface nodes.
92
92
  *
93
- * @param eventListenerInterface - The node to base the event listeners on.
94
- * @param eventEmitterInterface - The node to base the event emitters on.
95
- * @param checker - The TypeScript type checker.
93
+ * @param eventListenerInterface The node to base the event listeners on.
94
+ * @param eventEmitterInterface The node to base the event emitters on.
95
+ * @param checker The TypeScript type checker.
96
96
  * @returns The events manifest to upload.
97
97
  */
98
98
  function processEvents(eventListenerInterface, eventEmitterInterface, checker) {
@@ -109,8 +109,8 @@ function processEvents(eventListenerInterface, eventEmitterInterface, checker) {
109
109
  /**
110
110
  * Get the JSON schema for parameters based on a TypeScript program.
111
111
  *
112
- * @param program - The TypeScript program from which to extract parameters.
113
- * @param iface - The interface node from which to extract parameters.
112
+ * @param program The TypeScript program from which to extract parameters.
113
+ * @param iface The interface node from which to extract parameters.
114
114
  * @returns The JSON schema for the block parameters.
115
115
  */
116
116
  function processParameters(program, iface) {
@@ -142,8 +142,8 @@ function processParameters(program, iface) {
142
142
  /**
143
143
  * Get a messages object based on a TypeScript interface node.
144
144
  *
145
- * @param iface - The node to base the messages on.
146
- * @param checker - The TypeScript type checker.
145
+ * @param iface The node to base the messages on.
146
+ * @param checker The TypeScript type checker.
147
147
  * @returns The action manifest to upload.
148
148
  */
149
149
  function processMessages(iface, checker) {
@@ -152,28 +152,30 @@ function processMessages(iface, checker) {
152
152
  /**
153
153
  * Get the TypeScript program for a given path.
154
154
  *
155
- * @param blockPath - The path for which to get the TypeScript program.
155
+ * @param blockPath The path for which to get the TypeScript program.
156
156
  * @returns The TypeScript program.
157
157
  */
158
158
  function getProgram(blockPath) {
159
159
  const diagnosticHost = {
160
- getNewLine: () => typescript_1.sys.newLine,
161
- getCurrentDirectory: typescript_1.sys.getCurrentDirectory,
160
+ getNewLine: () => typescript_1.default.sys.newLine,
161
+ getCurrentDirectory: typescript_1.default.sys.getCurrentDirectory,
162
162
  getCanonicalFileName: (x) => x,
163
163
  };
164
- const tsConfigPath = (0, typescript_1.findConfigFile)(blockPath, typescript_1.sys.fileExists);
165
- const { config, error } = (0, typescript_1.readConfigFile)(tsConfigPath, typescript_1.sys.readFile);
164
+ const tsConfigPath = typescript_1.default.findConfigFile(blockPath, typescript_1.default.sys.fileExists);
165
+ const { config, error } = typescript_1.default.readConfigFile(tsConfigPath, typescript_1.default.sys.readFile);
166
166
  if (error) {
167
- throw new node_utils_1.AppsembleError((0, typescript_1.formatDiagnostic)(error, diagnosticHost));
167
+ throw new node_utils_1.AppsembleError(typescript_1.default.formatDiagnostic(error, diagnosticHost));
168
168
  }
169
169
  if (!config.files || !config.include) {
170
- config.files = typescript_1.sys.readDirectory(blockPath, ['.ts', '.tsx']).map((f) => (0, path_1.relative)(blockPath, f));
170
+ config.files = typescript_1.default.sys
171
+ .readDirectory(blockPath, ['.ts', '.tsx'])
172
+ .map((f) => (0, path_1.relative)(blockPath, f));
171
173
  }
172
- const { errors, fileNames, options } = (0, typescript_1.parseJsonConfigFileContent)(config, typescript_1.sys, blockPath, undefined, tsConfigPath);
174
+ const { errors, fileNames, options } = typescript_1.default.parseJsonConfigFileContent(config, typescript_1.default.sys, blockPath, undefined, tsConfigPath);
173
175
  // Filter: 'rootDir' is expected to contain all source files.
174
176
  const diagnostics = errors.filter(({ code }) => code !== 6059);
175
177
  if (diagnostics.length) {
176
- throw new node_utils_1.AppsembleError((0, typescript_1.formatDiagnosticsWithColorAndContext)(diagnostics, diagnosticHost));
178
+ throw new node_utils_1.AppsembleError(typescript_1.default.formatDiagnosticsWithColorAndContext(diagnostics, diagnosticHost));
177
179
  }
178
180
  options.noEmit = true;
179
181
  delete options.out;
@@ -182,10 +184,10 @@ function getProgram(blockPath) {
182
184
  delete options.declaration;
183
185
  delete options.declarationDir;
184
186
  delete options.declarationMap;
185
- const program = (0, typescript_1.createProgram)(fileNames, options);
186
- const preEmitDiagnostics = (0, typescript_1.getPreEmitDiagnostics)(program);
187
+ const program = typescript_1.default.createProgram(fileNames, options);
188
+ const preEmitDiagnostics = typescript_1.default.getPreEmitDiagnostics(program);
187
189
  if (preEmitDiagnostics.length) {
188
- throw new node_utils_1.AppsembleError((0, typescript_1.formatDiagnosticsWithColorAndContext)(preEmitDiagnostics, diagnosticHost));
190
+ throw new node_utils_1.AppsembleError(typescript_1.default.formatDiagnosticsWithColorAndContext(preEmitDiagnostics, diagnosticHost));
189
191
  }
190
192
  return program;
191
193
  }
@@ -194,7 +196,7 @@ function getProgram(blockPath) {
194
196
  *
195
197
  * Uses the .appsemblerc file and the type definitions of the block.
196
198
  *
197
- * @param blockConfig - The block configuration
199
+ * @param blockConfig The block configuration
198
200
  * @returns The block configuration appended from the TypeScript project.
199
201
  */
200
202
  function getBlockConfigFromTypeScript(blockConfig) {
@@ -218,18 +220,18 @@ function getBlockConfigFromTypeScript(blockConfig) {
218
220
  }
219
221
  node_utils_1.logger.verbose(`Searching metadata in: ${fileName}`);
220
222
  // eslint-disable-next-line @typescript-eslint/no-loop-func
221
- (0, typescript_1.forEachChild)(sourceFile, (mod) => {
223
+ typescript_1.default.forEachChild(sourceFile, (mod) => {
222
224
  // This node doesn’t override SDK types
223
- if (!(0, typescript_1.isModuleDeclaration)(mod)) {
225
+ if (!typescript_1.default.isModuleDeclaration(mod)) {
224
226
  return;
225
227
  }
226
228
  // This module defines other types
227
229
  if (mod.name.text !== '@appsemble/sdk') {
228
230
  return;
229
231
  }
230
- (0, typescript_1.forEachChild)(mod.body, (iface) => {
232
+ typescript_1.default.forEachChild(mod.body, (iface) => {
231
233
  // Appsemble only uses module interface augmentation.
232
- if (!(0, typescript_1.isInterfaceDeclaration)(iface)) {
234
+ if (!typescript_1.default.isInterfaceDeclaration(iface)) {
233
235
  return;
234
236
  }
235
237
  const { line } = sourceFile.getLineAndCharacterOfPosition(iface.getStart(sourceFile));
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBlockConfigFromTypeScript.js","sourceRoot":"","sources":["getBlockConfigFromTypeScript.ts"],"names":[],"mappings":";;;;;;AAAA,+BAAgC;AAEhC,sDAA+D;AAE/D,mDAAuC;AAEvC,oEAA2C;AAC3C,uEAA0F;AAC1F,4DAA4B;AAE5B;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,OAAuB,EAAE,IAAoB;IACpE,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,IAAI,CAAC,MAAM,EAAE;QACX,OAAO;KACR;IAED,MAA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D,QAAQ,EACN,UAAU,IAAI,WAAW;YACvB,CAAC,CAAC,WAAW,CAAC,QAAQ;YACtB,CAAC,CAAC,eAAe,CAAC,iBAAiB,EAAE,OAAO,CAAC;KAClD,CAAC;AACJ,CAAC;AAnGD,oEAmGC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,238 @@
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
+ const fs_1 = require("fs");
7
+ const path_1 = require("path");
8
+ const node_utils_1 = require("@appsemble/node-utils");
9
+ const typescript_1 = __importDefault(require("typescript"));
10
+ const getBlockConfigFromTypeScript_1 = require("./getBlockConfigFromTypeScript");
11
+ beforeEach(() => {
12
+ jest.spyOn(process, 'cwd').mockReturnValue((0, node_utils_1.resolveFixture)('.'));
13
+ });
14
+ describe('getBlockConfigFromTypeScript', () => {
15
+ it('should extract configuration from a TypeScript project', () => {
16
+ const result = (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
17
+ name: '',
18
+ layout: 'float',
19
+ version: '1.33.7',
20
+ webpack: '',
21
+ output: '',
22
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/valid'),
23
+ });
24
+ expect(result).toStrictEqual({
25
+ actions: { testAction: { description: undefined } },
26
+ events: {
27
+ emit: { testEmit: { description: undefined } },
28
+ listen: { testListener: { description: undefined } },
29
+ },
30
+ messages: undefined,
31
+ parameters: {
32
+ $schema: 'http://json-schema.org/draft-07/schema#',
33
+ additionalProperties: false,
34
+ properties: {
35
+ param1: { type: 'string' },
36
+ param2: { type: 'number' },
37
+ param3: { type: 'boolean' },
38
+ param4: { type: 'string' },
39
+ param5: {
40
+ additionalProperties: false,
41
+ properties: {
42
+ nested1: { type: 'string' },
43
+ nested2: { type: 'number' },
44
+ nested3: { type: 'boolean' },
45
+ },
46
+ required: ['nested1', 'nested2', 'nested3'],
47
+ type: 'object',
48
+ },
49
+ param6: { items: { type: 'string' }, type: 'array' },
50
+ },
51
+ required: ['param1', 'param2', 'param3', 'param5', 'param6'],
52
+ type: 'object',
53
+ },
54
+ });
55
+ });
56
+ it('should not use TypeScript if all metadata is present in the original config', () => {
57
+ jest.spyOn(typescript_1.default, 'createProgram');
58
+ const input = {
59
+ actions: {},
60
+ events: { emit: { foo: {} }, listen: { bar: {} } },
61
+ layout: 'float',
62
+ parameters: { type: 'object' },
63
+ version: '1.33.7',
64
+ webpack: '',
65
+ output: '',
66
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/valid'),
67
+ name: '',
68
+ };
69
+ const result = (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)(input);
70
+ expect(result).toBe(input);
71
+ expect(typescript_1.default.createProgram).not.toHaveBeenCalled();
72
+ });
73
+ it('should prefer actions overrides over TypeScript actions', () => {
74
+ const result = (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
75
+ actions: {},
76
+ version: '1.33.7',
77
+ webpack: '',
78
+ output: '',
79
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/valid'),
80
+ name: '',
81
+ });
82
+ expect(result.actions).toStrictEqual({});
83
+ });
84
+ it('should prefer events overrides over TypeScript events', () => {
85
+ const result = (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
86
+ events: { emit: { onSuccess: {} } },
87
+ version: '1.33.7',
88
+ webpack: '',
89
+ output: '',
90
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/valid'),
91
+ name: '',
92
+ });
93
+ expect(result.events).toStrictEqual({ emit: { onSuccess: {} } });
94
+ });
95
+ it('should prefer parameters overrides over TypeScript parameters', () => {
96
+ const result = (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
97
+ parameters: { type: 'object' },
98
+ version: '1.33.7',
99
+ webpack: '',
100
+ output: '',
101
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/valid'),
102
+ name: '',
103
+ });
104
+ expect(result.parameters).toStrictEqual({ type: 'object' });
105
+ });
106
+ it('should throw if duplicate Actions are found', () => {
107
+ expect(() => (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
108
+ webpack: '',
109
+ output: '',
110
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/duplicateActions'),
111
+ name: '',
112
+ version: '1.33.7',
113
+ })).toThrow(new node_utils_1.AppsembleError("Found duplicate interface 'Actions' in 'getBlockConfigFromTypeScript/duplicateActions/index.ts:31'"));
114
+ });
115
+ it('should throw if duplicate EventEmitters are found', () => {
116
+ expect(() => (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
117
+ webpack: '',
118
+ output: '',
119
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/duplicateEventEmitters'),
120
+ name: '',
121
+ version: '1.33.7',
122
+ })).toThrow(new node_utils_1.AppsembleError("Found duplicate interface 'EventEmitters' in 'getBlockConfigFromTypeScript/duplicateEventEmitters/index.ts:31'"));
123
+ });
124
+ it('should throw if duplicate EventListeners are found', () => {
125
+ expect(() => (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
126
+ webpack: '',
127
+ output: '',
128
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/duplicateEventListeners'),
129
+ name: '',
130
+ version: '1.33.7',
131
+ })).toThrow(new node_utils_1.AppsembleError("Found duplicate interface 'EventListeners' in 'getBlockConfigFromTypeScript/duplicateEventListeners/index.ts:31'"));
132
+ });
133
+ it('should throw if duplicate Parameters are found', () => {
134
+ expect(() => (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
135
+ webpack: '',
136
+ output: '',
137
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/duplicateParameters'),
138
+ name: '',
139
+ version: '1.33.7',
140
+ })).toThrow(new node_utils_1.AppsembleError("Found duplicate interface 'Parameters' in 'getBlockConfigFromTypeScript/duplicateParameters/index.ts:31'"));
141
+ });
142
+ it('should handle fontawesome icons', () => {
143
+ const result = (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
144
+ webpack: '',
145
+ output: '',
146
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/fontawesomeParameters'),
147
+ name: '',
148
+ version: '1.33.7',
149
+ });
150
+ expect(result).toStrictEqual({
151
+ actions: undefined,
152
+ events: undefined,
153
+ messages: undefined,
154
+ parameters: {
155
+ $schema: 'http://json-schema.org/draft-07/schema#',
156
+ additionalProperties: false,
157
+ properties: {
158
+ icon: { description: 'This is an icon.', format: 'fontawesome', type: 'string' },
159
+ },
160
+ type: 'object',
161
+ },
162
+ });
163
+ });
164
+ it('should handle TypeScript pre emit diagnostics', () => {
165
+ function fn() {
166
+ (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
167
+ name: '',
168
+ layout: 'float',
169
+ version: '1.33.7',
170
+ webpack: '',
171
+ output: '',
172
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/tsError'),
173
+ });
174
+ }
175
+ expect(fn).toThrow(node_utils_1.AppsembleError);
176
+ expect(fn).toThrow(/'unused' is declared but its value is never read/);
177
+ });
178
+ it('should extract comments', () => {
179
+ const result = (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
180
+ name: '',
181
+ layout: 'float',
182
+ version: '1.33.7',
183
+ webpack: '',
184
+ output: '',
185
+ dir: (0, node_utils_1.resolveFixture)('getBlockConfigFromTypeScript/comments'),
186
+ });
187
+ expect(result).toStrictEqual({
188
+ actions: {
189
+ comment: {
190
+ description: 'Valid action comment',
191
+ },
192
+ duplicate: {
193
+ description: 'Expected comment',
194
+ },
195
+ line: {
196
+ description: undefined,
197
+ },
198
+ },
199
+ events: {
200
+ emit: {
201
+ testEmit: {
202
+ description: 'Test event emitter.',
203
+ },
204
+ },
205
+ listen: {
206
+ testListener: {
207
+ description: 'Test event listener.',
208
+ },
209
+ },
210
+ },
211
+ messages: undefined,
212
+ parameters: {
213
+ $schema: 'http://json-schema.org/draft-07/schema#',
214
+ additionalProperties: false,
215
+ properties: {
216
+ param: {},
217
+ },
218
+ required: ['param'],
219
+ type: 'object',
220
+ },
221
+ });
222
+ });
223
+ describe('official blocks', () => {
224
+ const blocksDir = (0, path_1.resolve)(__dirname, '..', '..', '..', 'blocks');
225
+ it.each((0, fs_1.readdirSync)(blocksDir))('%s', (name) => {
226
+ const dir = (0, path_1.join)(blocksDir, name);
227
+ const result = (0, getBlockConfigFromTypeScript_1.getBlockConfigFromTypeScript)({
228
+ name,
229
+ version: '',
230
+ output: '',
231
+ webpack: undefined,
232
+ dir,
233
+ });
234
+ expect(result).toMatchSnapshot();
235
+ });
236
+ });
237
+ });
238
+ //# sourceMappingURL=getBlockConfigFromTypeScript.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBlockConfigFromTypeScript.test.js","sourceRoot":"","sources":["getBlockConfigFromTypeScript.test.ts"],"names":[],"mappings":";;;;;AAAA,2BAAiC;AACjC,+BAAqC;AAErC,sDAAuE;AACvE,4DAA4B;AAE5B,iFAA8E;AAE9E,UAAU,CAAC,GAAG,EAAE;IACd,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,eAAe,CAAC,IAAA,2BAAc,EAAC,GAAG,CAAC,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAChE,MAAM,MAAM,GAAG,IAAA,2DAA4B,EAAC;YAC1C,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,EAAE;YACV,GAAG,EAAE,IAAA,2BAAc,EAAC,oCAAoC,CAAC;SAC1D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