@appsemble/cli 0.20.8 → 0.20.11

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,40 @@
1
+ import '@appsemble/sdk';
2
+
3
+ declare module '@appsemble/sdk' {
4
+ interface Actions {
5
+ /**
6
+ * Valid action comment
7
+ */
8
+ comment: never;
9
+
10
+ /**
11
+ * Unexpected comment
12
+ */
13
+ /**
14
+ * Expected comment
15
+ */
16
+ duplicate: never;
17
+
18
+ // Ignored line comment
19
+ line: never;
20
+ }
21
+
22
+ interface EventEmitters {
23
+ /**
24
+ * Test event emitter.
25
+ */
26
+ testEmit: never;
27
+ }
28
+
29
+ interface EventListeners {
30
+ /**
31
+ * Test event listener.
32
+ */
33
+ testListener: never;
34
+ }
35
+
36
+ // Comments are extracted by typescript-json-schema
37
+ interface Parameters {
38
+ param: any;
39
+ }
40
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../../../../tsconfig",
3
+ "compilerOptions": {
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "types": []
6
+ }
7
+ }
@@ -0,0 +1,34 @@
1
+ import '@appsemble/sdk';
2
+
3
+ declare module '@appsemble/sdk' {
4
+ interface Actions {
5
+ testAction: never;
6
+ }
7
+
8
+ interface EventEmitters {
9
+ testEmit: never;
10
+ }
11
+
12
+ interface EventListeners {
13
+ testListener: never;
14
+ }
15
+
16
+ interface Parameters {
17
+ param1: string;
18
+ param2: number;
19
+ param3: boolean;
20
+ param4?: string;
21
+ param5: {
22
+ nested1: string;
23
+ nested2: number;
24
+ nested3: boolean;
25
+ };
26
+ param6: string[];
27
+ }
28
+ }
29
+
30
+ declare module '@appsemble/sdk' {
31
+ interface Actions {
32
+ duplicate: never;
33
+ }
34
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../../../../tsconfig",
3
+ "compilerOptions": {
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "types": []
6
+ }
7
+ }
@@ -0,0 +1,34 @@
1
+ import '@appsemble/sdk';
2
+
3
+ declare module '@appsemble/sdk' {
4
+ interface Actions {
5
+ testAction: never;
6
+ }
7
+
8
+ interface EventEmitters {
9
+ testEmit: never;
10
+ }
11
+
12
+ interface EventListeners {
13
+ testListener: never;
14
+ }
15
+
16
+ interface Parameters {
17
+ param1: string;
18
+ param2: number;
19
+ param3: boolean;
20
+ param4?: string;
21
+ param5: {
22
+ nested1: string;
23
+ nested2: number;
24
+ nested3: boolean;
25
+ };
26
+ param6: string[];
27
+ }
28
+ }
29
+
30
+ declare module '@appsemble/sdk' {
31
+ interface EventEmitters {
32
+ duplicate: never;
33
+ }
34
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../../../../tsconfig",
3
+ "compilerOptions": {
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "types": []
6
+ }
7
+ }
@@ -0,0 +1,34 @@
1
+ import '@appsemble/sdk';
2
+
3
+ declare module '@appsemble/sdk' {
4
+ interface Actions {
5
+ testAction: never;
6
+ }
7
+
8
+ interface EventEmitters {
9
+ testEmit: never;
10
+ }
11
+
12
+ interface EventListeners {
13
+ testListener: never;
14
+ }
15
+
16
+ interface Parameters {
17
+ param1: string;
18
+ param2: number;
19
+ param3: boolean;
20
+ param4?: string;
21
+ param5: {
22
+ nested1: string;
23
+ nested2: number;
24
+ nested3: boolean;
25
+ };
26
+ param6: string[];
27
+ }
28
+ }
29
+
30
+ declare module '@appsemble/sdk' {
31
+ interface EventListeners {
32
+ duplicate: never;
33
+ }
34
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../../../../tsconfig",
3
+ "compilerOptions": {
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "types": []
6
+ }
7
+ }
@@ -0,0 +1,34 @@
1
+ import '@appsemble/sdk';
2
+
3
+ declare module '@appsemble/sdk' {
4
+ interface Actions {
5
+ testAction: never;
6
+ }
7
+
8
+ interface EventEmitters {
9
+ testEmit: never;
10
+ }
11
+
12
+ interface EventListeners {
13
+ testListener: never;
14
+ }
15
+
16
+ interface Parameters {
17
+ param1: string;
18
+ param2: number;
19
+ param3: boolean;
20
+ param4?: string;
21
+ param5: {
22
+ nested1: string;
23
+ nested2: number;
24
+ nested3: boolean;
25
+ };
26
+ param6: string[];
27
+ }
28
+ }
29
+
30
+ declare module '@appsemble/sdk' {
31
+ interface Parameters {
32
+ duplicate: never;
33
+ }
34
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../../../../tsconfig",
3
+ "compilerOptions": {
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "types": []
6
+ }
7
+ }
@@ -0,0 +1,11 @@
1
+ import '@appsemble/sdk';
2
+ import { IconName } from '@fortawesome/fontawesome-common-types';
3
+
4
+ declare module '@appsemble/sdk' {
5
+ interface Parameters {
6
+ /**
7
+ * This is an icon.
8
+ */
9
+ icon?: IconName;
10
+ }
11
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../../../../tsconfig",
3
+ "compilerOptions": {
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "types": []
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ import '@appsemble/sdk';
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
+ const unused = undefined;
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../../../../tsconfig",
3
+ "compilerOptions": {
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "noUnusedLocals": true,
6
+ "types": []
7
+ }
8
+ }
@@ -0,0 +1,28 @@
1
+ import '@appsemble/sdk';
2
+
3
+ declare module '@appsemble/sdk' {
4
+ interface Actions {
5
+ testAction: never;
6
+ }
7
+
8
+ interface EventEmitters {
9
+ testEmit: never;
10
+ }
11
+
12
+ interface EventListeners {
13
+ testListener: never;
14
+ }
15
+
16
+ interface Parameters {
17
+ param1: string;
18
+ param2: number;
19
+ param3: boolean;
20
+ param4?: string;
21
+ param5: {
22
+ nested1: string;
23
+ nested2: number;
24
+ nested3: boolean;
25
+ };
26
+ param6: string[];
27
+ }
28
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../../../../tsconfig",
3
+ "compilerOptions": {
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "types": []
6
+ }
7
+ }
@@ -0,0 +1 @@
1
+ export const string = 'no-icon';
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <svg />
@@ -0,0 +1 @@
1
+ export const string = 'with-icon';
@@ -0,0 +1,150 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema",
3
+ "title": ".appsemblerc.yaml",
4
+ "description": "A .appsemblerc.yaml file may be used to configure either an app or a block.",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+
8
+ "properties": {
9
+ "name": {
10
+ "description": "The name of a block. By default the name in package.json is used.",
11
+ "type": "string",
12
+ "pattern": "^@([\\da-z](?:(?!.*--)[\\da-z-]*[\\da-z])?)/([\\da-z](?:(?!.*--)[\\da-z-]*[\\da-z])?)$"
13
+ },
14
+ "description": {
15
+ "description": "A short description of the block. By default the description in package.json is used.",
16
+ "maxLength": 160
17
+ },
18
+ "version": {
19
+ "description": "A semantic version of the block representation of the block version. By default the version in package.json is used."
20
+ },
21
+ "longDescription": {
22
+ "description": "The long description of the block. Markdown is supported. By default the content of README.md is used.",
23
+ "type": "string"
24
+ },
25
+ "layout": {
26
+ "description": "The type of layout to be used for the block.",
27
+ "enum": ["float", "grow", "hidden", "static", null],
28
+ "default": "static"
29
+ },
30
+ "output": {
31
+ "description": "Where to read build output from.",
32
+ "type": "string",
33
+ "default": "dist"
34
+ },
35
+ "webpack": {
36
+ "description": "The path to the webpack configuration file relative to the block project directory. By default a file named webpack.config.js is used, with a fallback to the webpack configuration from @appsemble/webpack-config.",
37
+ "type": "string"
38
+ },
39
+ "events": {
40
+ "type": "object",
41
+ "description": "An object describing the names of the events the block can listen and emit to. By default this is extracted from the block’s TypeScript module augmentations.",
42
+ "additionalProperties": false,
43
+ "properties": {
44
+ "listen": {
45
+ "description": "The events the block listens on.",
46
+ "type": "object",
47
+ "additionalProperties": {
48
+ "type": "object",
49
+ "properties": {
50
+ "description": {
51
+ "type": "string"
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "emit": {
57
+ "description": "The events the block may emit.",
58
+ "type": "object",
59
+ "additionalProperties": {
60
+ "type": "object",
61
+ "properties": {
62
+ "description": {
63
+ "type": "string"
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ },
70
+ "actions": {
71
+ "description": "An object which describes the actions a block can trigger. This will be used to validate app definitions. By default this is extracted from the block’s TypeScript module augmentations.",
72
+ "type": "object",
73
+ "additionalProperties": true
74
+ },
75
+ "parameters": {
76
+ "description": "A JSON schema which describes the block parameters. By default this is extracted from the block’s TypeScript module augmentations."
77
+ },
78
+ "iconBackground": {
79
+ "description": "The background color to use for maskable icons.",
80
+ "type": "string",
81
+ "pattern": "^#[a-zA-Z\\d]{6}$"
82
+ },
83
+ "context": {
84
+ "type": "object",
85
+ "description": "A context which can be specified using the --context command line parameter.",
86
+ "additionalProperties": {
87
+ "type": "object",
88
+ "additionalProperties": false,
89
+ "properties": {
90
+ "remote": {
91
+ "description": "If remote is specified, this will override --remote passed by the command line.",
92
+ "type": "string",
93
+ "format": "uri",
94
+ "default": "https://appsemble.app"
95
+ },
96
+ "organization": {
97
+ "description": "If organization is specified, this will override --organization passed by the command line when creating an app.",
98
+ "type": "string",
99
+ "pattern": "^([\\da-z](?:(?!.*--)[\\da-z-]*[\\da-z])?)$",
100
+ "minLength": 1,
101
+ "maxLength": 30
102
+ },
103
+ "icon": {
104
+ "description": "A path to the app icon to use",
105
+ "type": "string",
106
+ "default": "icon.png"
107
+ },
108
+ "iconBackground": {
109
+ "description": "The background color to use for maskable icons.",
110
+ "type": "string",
111
+ "pattern": "^#[a-zA-Z\\d]{6}$"
112
+ },
113
+ "maskableIcon": {
114
+ "description": "A path to the maskable app icon to use",
115
+ "type": "string",
116
+ "default": "maskable-icon.png"
117
+ },
118
+ "id": {
119
+ "description": "If id is specified, this will override --id passed by the command line when updating an app.",
120
+ "type": "integer",
121
+ "minimum": 1
122
+ },
123
+ "visibility": {
124
+ "description": "Determine the app visibility of the app in the Appsemble app store.\n\nThis doesn’t affect whether or not the app can be accessed on its own domain.\n\n- **public**: The app is publicly listed in the Appsemble app store.,\n- **unlisted**: The app store page can be accessed, but the app isn’t listed publicly in the Appsemble app store.\n- **private**: The app is only visible to people who are part of the organization.",
125
+ "default": "unlisted",
126
+ "enum": ["public", "unlisted", "private"]
127
+ },
128
+ "showAppDefinition": {
129
+ "description": "Whether or not people who have access to the app may see the app definition.",
130
+ "type": "boolean"
131
+ },
132
+ "template": {
133
+ "description": "If template is specified, this will override --template passed on the command line.",
134
+ "type": "boolean",
135
+ "default": false
136
+ },
137
+ "sentryDsn": {
138
+ "type": "string",
139
+ "format": "uri",
140
+ "description": "A custom Sentry DSN to use for the app."
141
+ },
142
+ "sentryEnvironment": {
143
+ "type": "string",
144
+ "description": "A custom Sentry environment to use for the app."
145
+ }
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["create.ts"],"names":[],"mappings":";;;;;;AAEA,sDAA+C;AAE/C,0DAA2B;AAC3B,oEAA2C;AAG3C,uCAA0C;AAC1C,iDAAgD;AAoBnC,QAAA,OAAO,GAAG,mBAAmB,CAAC;AAC9B,QAAA,WAAW,GAAG,+DAA+D,CAAC;AAE3F,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,kCAAkC;KAC7C,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,QAAQ,EAAE,gEAAgE;KAC3E,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACtB,QAAQ,EAAE,uCAAuC;KAClD,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,QAAQ,EAAE,yEAAyE;QACnF,MAAM,EAAE,qBAAU;KACnB,CAAC;SACD,MAAM,CAAC,iBAAiB,EAAE;QACzB,QAAQ,EAAE,8DAA8D;QACxE,OAAO,EAAE,SAAS;KACnB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,QAAQ,EACN,2FAA2F;QAC7F,MAAM,EAAE,qBAAU;KACnB,CAAC;SACD,MAAM,CAAC,YAAY,EAAE;QACpB,QAAQ,EAAE,gDAAgD;QAC1D,OAAO,EAAE,UAAU;QACnB,OAAO,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC;KAC3C,CAAC;SACD,MAAM,CAAC,UAAU,EAAE;QAClB,QAAQ,EAAE,iDAAiD;QAC3D,IAAI,EAAE,SAAS;KAChB,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,QAAQ,EAAE,4EAA4E;QACtF,IAAI,EAAE,SAAS;KAChB,CAAC;SACD,MAAM,CAAC,WAAW,EAAE;QACnB,QAAQ,EACN,0OAA0O;QAC5O,IAAI,EAAE,SAAS;KAChB,CAAC;SACD,MAAM,CAAC,gBAAgB,EAAE;QACxB,QAAQ,EACN,0GAA0G;QAC5G,IAAI,EAAE,SAAS;KAChB,CAAC;SACD,MAAM,CAAC,qBAAqB,EAAE;QAC7B,QAAQ,EAAE,0CAA0C;KACrD,CAAC;SACD,MAAM,CAAC,YAAY,EAAE;QACpB,QAAQ,EAAE,oCAAoC;KAC/C,CAAC;SACD,MAAM,CAAC,oBAAoB,EAAE;QAC5B,QAAQ,EAAE,wDAAwD;QAClE,OAAO,EAAE,CAAC,YAAY,CAAC;KACxB,CAAC,CAAC;AACP,CAAC;AAzDD,0BAyDC;AAEM,KAAK,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAsB;IAClE,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;IAEzF,mBAAM,CAAC,IAAI,CAAC,YAAY,WAAW,CAAC,MAAM,OAAO,CAAC,CAAC;IACnD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,mBAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,IAAA,eAAS,EAAC;YACd,GAAG,IAAI;YACP,IAAI,EAAE,GAAG;SACV,CAAC,CAAC;KACJ;AACH,CAAC;AAZD,0BAYC"}
@@ -0,0 +1,104 @@
1
+ import { ReadStream } from 'fs';
2
+
3
+ import { logger } from '@appsemble/node-utils';
4
+ import { AppVisibility } from '@appsemble/types';
5
+ import fg from 'fast-glob';
6
+ import normalizePath from 'normalize-path';
7
+ import { Argv } from 'yargs';
8
+
9
+ import { createApp } from '../../lib/app';
10
+ import { coerceFile } from '../../lib/coercers';
11
+ import { BaseArguments } from '../../types';
12
+
13
+ interface CreateAppArguments extends BaseArguments {
14
+ context: string;
15
+ icon: NodeJS.ReadStream | ReadStream;
16
+ iconBackground: string;
17
+ maskableIcon: NodeJS.ReadStream | ReadStream;
18
+ paths: string[];
19
+ organization: string;
20
+ template: boolean;
21
+ dryRun: boolean;
22
+ resources: boolean;
23
+ modifyContext: boolean;
24
+ visibility: AppVisibility;
25
+ sentryDsn: string;
26
+ sentryEnvironment: string;
27
+ googleAnalyticsId: string;
28
+ }
29
+
30
+ export const command = 'create <paths...>';
31
+ export const description = 'Create a new App based on a specified YAML file or directory.';
32
+
33
+ export function builder(yargs: Argv): Argv<any> {
34
+ return yargs
35
+ .positional('paths', {
36
+ describe: 'The paths to the apps to create.',
37
+ })
38
+ .option('context', {
39
+ describe: 'If specified, use the specified context from .appsemblerc.yaml',
40
+ })
41
+ .option('organization', {
42
+ describe: 'The ID the app should be created for.',
43
+ })
44
+ .option('icon', {
45
+ describe: 'The icon to upload. By default "icon.png" in the app directory is used.',
46
+ coerce: coerceFile,
47
+ })
48
+ .option('icon-background', {
49
+ describe: 'The background color to use for the icon in opaque contexts.',
50
+ default: '#ffffff',
51
+ })
52
+ .option('maskable-icon', {
53
+ describe:
54
+ 'The maskable icon to upload. By default "maskable-icon.png" in the app directory is used.',
55
+ coerce: coerceFile,
56
+ })
57
+ .option('visibility', {
58
+ describe: 'Visibility of the app in the public app store.',
59
+ default: 'unlisted',
60
+ choices: ['public', 'unlisted', 'private'],
61
+ })
62
+ .option('template', {
63
+ describe: 'Whether the app should be marked as a template.',
64
+ type: 'boolean',
65
+ })
66
+ .option('dry-run', {
67
+ describe: 'Whether the API should be called to run without actually creating the app.',
68
+ type: 'boolean',
69
+ })
70
+ .option('resources', {
71
+ describe:
72
+ 'Whether the resources from the `resources` directory should be created after creating the app. The names of subdirectories are used as the name of the resource, otherwise the names of top level resource .json files are used instead.',
73
+ type: 'boolean',
74
+ })
75
+ .option('modify-context', {
76
+ describe:
77
+ 'If the app context is specified, modify it for the current context to include the id of the created app.',
78
+ type: 'boolean',
79
+ })
80
+ .option('google-analytics-id', {
81
+ describe: 'The ID for Google Analytics for the app.',
82
+ })
83
+ .option('sentry-dsn', {
84
+ describe: 'The custom Sentry DSN for the app.',
85
+ })
86
+ .option('sentry-environment', {
87
+ describe: 'The environment for the custom Sentry DSN for the app.',
88
+ implies: ['sentry-dsn'],
89
+ });
90
+ }
91
+
92
+ export async function handler({ paths, ...args }: CreateAppArguments): Promise<void> {
93
+ const normalizedPaths = paths.map((path) => normalizePath(path));
94
+ const directories = await fg(normalizedPaths, { absolute: true, onlyDirectories: true });
95
+
96
+ logger.info(`Creating ${directories.length} apps`);
97
+ for (const dir of directories) {
98
+ logger.info('');
99
+ await createApp({
100
+ ...args,
101
+ path: dir,
102
+ });
103
+ }
104
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-messages.js","sourceRoot":"","sources":["extract-messages.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+C;AAC/C,0DAA2B;AAC3B,oEAA2C;AAG3C,uCAAiD;AAUpC,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,iDAAiD;KAC5D,CAAC;SACD,MAAM,CAAC,WAAW,EAAE;QACnB,QAAQ,EAAE,qDAAqD;KAChE,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EAAE,gDAAgD;QAC1D,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;QACzB,OAAO,EAAE,MAAM;KAChB,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EACN,yHAAyH;KAC5H,CAAC,CAAC;AACP,CAAC;AAlBD,0BAkBC;AAEM,KAAK,UAAU,OAAO,CAAC,EAC5B,MAAM,GAAG,MAAM,EACf,SAAS,GAAG,EAAE,EACd,KAAK,EACL,MAAM,GAAG,EAAE,GACS;IACpB,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,4BAA4B,WAAW,CAAC,MAAM,OAAO,CAAC,CAAC;IACnE,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,MAAM,IAAA,sBAAgB,EACpB,GAAG,EACH,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EACpC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EACjC,MAAM,CACP,CAAC;KACH;AACH,CAAC;AAjBD,0BAiBC"}
@@ -0,0 +1,56 @@
1
+ import { logger } from '@appsemble/node-utils';
2
+ import fg from 'fast-glob';
3
+ import normalizePath from 'normalize-path';
4
+ import { Argv } from 'yargs';
5
+
6
+ import { writeAppMessages } from '../../lib/app';
7
+ import { BaseArguments } from '../../types';
8
+
9
+ interface BuildBlockArguments extends BaseArguments {
10
+ paths: string[];
11
+ languages: string;
12
+ verify: string;
13
+ format: 'json' | 'yaml';
14
+ }
15
+
16
+ export const command = 'extract-messages <paths...>';
17
+ export const description = 'Extract messages from a block.';
18
+
19
+ export function builder(yargs: Argv): Argv<any> {
20
+ return yargs
21
+ .positional('paths', {
22
+ describe: 'The paths to the apps to extract messages from.',
23
+ })
24
+ .option('languages', {
25
+ describe: 'The languages to extract as a comma separated list.',
26
+ })
27
+ .option('format', {
28
+ describe: 'The format that should be used for the output.',
29
+ type: 'string',
30
+ choices: ['yaml', 'json'],
31
+ default: 'json',
32
+ })
33
+ .option('verify', {
34
+ describe:
35
+ 'A comma separated list of languages to verify. The CLI will fail if a message is missing for one of the given languages',
36
+ });
37
+ }
38
+
39
+ export async function handler({
40
+ format = 'json',
41
+ languages = '',
42
+ paths,
43
+ verify = '',
44
+ }: BuildBlockArguments): Promise<void> {
45
+ const normalizedPaths = paths.map((path) => normalizePath(path));
46
+ const directories = await fg(normalizedPaths, { absolute: true, onlyDirectories: true });
47
+ logger.info(`Extracting messages from ${directories.length} apps`);
48
+ for (const dir of directories) {
49
+ await writeAppMessages(
50
+ dir,
51
+ languages.split(',').filter(Boolean),
52
+ verify.split(',').filter(Boolean),
53
+ format,
54
+ );
55
+ }
56
+ }
File without changes
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iDAAmC;AACnC,oEAAsD;AACtD,iDAAmC;AAEnC,0CAAmD;AAA1C,gGAAA,IAAI,OAAW;AAEX,QAAA,OAAO,GAAG,KAAK,CAAC;AAChB,QAAA,WAAW,GAAG,2BAA2B,CAAC;AAEvD,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AACzF,CAAC;AAFD,0BAEC"}