@canva/cli 0.0.1-beta.34 → 0.0.1-beta.36

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 (94) hide show
  1. package/README.md +4 -9
  2. package/cli.js +682 -600
  3. package/lib/cjs/index.cjs +4 -4
  4. package/lib/esm/index.mjs +4 -4
  5. package/package.json +3 -3
  6. package/templates/base/backend/routers/auth.ts +4 -4
  7. package/templates/base/backend/routers/oauth.ts +3 -3
  8. package/templates/base/package.json +19 -19
  9. package/templates/base/scripts/ssl/ssl.ts +1 -1
  10. package/templates/base/scripts/start/app_runner.ts +6 -6
  11. package/templates/base/scripts/start/start.ts +1 -1
  12. package/templates/base/utils/backend/base_backend/create.ts +3 -3
  13. package/templates/base/utils/backend/bearer_middleware/bearer_middleware.ts +2 -2
  14. package/templates/base/utils/backend/jwt_middleware/jwt_middleware.ts +4 -4
  15. package/templates/base/utils/backend/jwt_middleware/tests/jwt_middleware.tests.ts +1 -1
  16. package/templates/base/utils/use_add_element.ts +1 -1
  17. package/templates/base/utils/use_feature_support.ts +1 -1
  18. package/templates/base/webpack.config.ts +2 -20
  19. package/templates/common/jest.config.mjs +1 -1
  20. package/templates/common/utils/backend/base_backend/create.ts +3 -3
  21. package/templates/common/utils/backend/jwt_middleware/jwt_middleware.ts +4 -4
  22. package/templates/common/utils/backend/jwt_middleware/tests/jwt_middleware.tests.ts +1 -1
  23. package/templates/common/utils/tests/table_wrapper.tests.ts +1 -1
  24. package/templates/common/utils/use_add_element.ts +1 -1
  25. package/templates/common/utils/use_feature_support.ts +1 -1
  26. package/templates/dam/backend/routers/dam.ts +2 -2
  27. package/templates/dam/backend/server.ts +1 -1
  28. package/templates/dam/canva-app.json +16 -0
  29. package/templates/dam/package.json +26 -26
  30. package/templates/dam/scripts/ssl/ssl.ts +1 -1
  31. package/templates/dam/scripts/start/app_runner.ts +6 -6
  32. package/templates/dam/scripts/start/start.ts +1 -1
  33. package/templates/dam/src/app.tsx +1 -1
  34. package/templates/dam/src/index.tsx +1 -1
  35. package/templates/dam/utils/backend/base_backend/create.ts +3 -3
  36. package/templates/dam/utils/backend/jwt_middleware/jwt_middleware.ts +4 -4
  37. package/templates/dam/utils/backend/jwt_middleware/tests/jwt_middleware.tests.ts +1 -1
  38. package/templates/dam/webpack.config.ts +2 -20
  39. package/templates/data_connector/README.md +2 -2
  40. package/templates/data_connector/canva-app.json +21 -0
  41. package/templates/data_connector/package.json +26 -26
  42. package/templates/data_connector/scripts/ssl/ssl.ts +1 -1
  43. package/templates/data_connector/scripts/start/app_runner.ts +6 -6
  44. package/templates/data_connector/scripts/start/start.ts +1 -1
  45. package/templates/data_connector/src/api/data_source.ts +1 -1
  46. package/templates/data_connector/src/api/data_sources/designs.tsx +9 -9
  47. package/templates/data_connector/src/api/data_sources/templates.tsx +9 -9
  48. package/templates/data_connector/src/api/fetch_data_table.ts +1 -1
  49. package/templates/data_connector/src/api/tests/data_source.test.tsx +2 -2
  50. package/templates/data_connector/src/app.tsx +5 -5
  51. package/templates/data_connector/src/components/footer.tsx +1 -1
  52. package/templates/data_connector/src/components/header.tsx +1 -1
  53. package/templates/data_connector/src/context/app_context.tsx +1 -1
  54. package/templates/data_connector/src/entrypoint.tsx +7 -7
  55. package/templates/data_connector/src/home.tsx +2 -2
  56. package/templates/data_connector/src/index.tsx +5 -6
  57. package/templates/data_connector/src/pages/error.tsx +2 -2
  58. package/templates/data_connector/src/pages/login.tsx +7 -7
  59. package/templates/data_connector/src/routes/routes.tsx +1 -1
  60. package/templates/data_connector/src/utils/data_table.ts +1 -1
  61. package/templates/data_connector/src/utils/fetch_result.ts +1 -1
  62. package/templates/data_connector/src/utils/tests/data_table.test.ts +5 -5
  63. package/templates/data_connector/webpack.config.ts +2 -20
  64. package/templates/gen_ai/backend/server.ts +1 -1
  65. package/templates/gen_ai/canva-app.json +20 -0
  66. package/templates/gen_ai/package.json +30 -30
  67. package/templates/gen_ai/scripts/ssl/ssl.ts +1 -1
  68. package/templates/gen_ai/scripts/start/app_runner.ts +6 -6
  69. package/templates/gen_ai/scripts/start/start.ts +1 -1
  70. package/templates/gen_ai/src/app.tsx +3 -3
  71. package/templates/gen_ai/src/components/footer.tsx +4 -4
  72. package/templates/gen_ai/src/components/image_grid.tsx +1 -1
  73. package/templates/gen_ai/src/components/loading_results.tsx +8 -8
  74. package/templates/gen_ai/src/components/prompt_input.tsx +3 -3
  75. package/templates/gen_ai/src/components/remaining_credits.tsx +1 -1
  76. package/templates/gen_ai/src/components/report_box.tsx +1 -1
  77. package/templates/gen_ai/src/components/tests/remaining_credit.tests.tsx +2 -2
  78. package/templates/gen_ai/src/home.tsx +2 -2
  79. package/templates/gen_ai/src/pages/error.tsx +2 -2
  80. package/templates/gen_ai/src/pages/results.tsx +1 -1
  81. package/templates/gen_ai/utils/backend/base_backend/create.ts +3 -3
  82. package/templates/gen_ai/utils/backend/bearer_middleware/bearer_middleware.ts +2 -2
  83. package/templates/gen_ai/webpack.config.ts +2 -20
  84. package/templates/hello_world/canva-app.json +16 -0
  85. package/templates/hello_world/package.json +24 -24
  86. package/templates/hello_world/scripts/ssl/ssl.ts +1 -1
  87. package/templates/hello_world/scripts/start/app_runner.ts +6 -6
  88. package/templates/hello_world/scripts/start/start.ts +1 -1
  89. package/templates/hello_world/src/app.tsx +1 -1
  90. package/templates/hello_world/src/index.tsx +1 -1
  91. package/templates/hello_world/src/tests/app.tests.tsx +3 -3
  92. package/templates/hello_world/utils/use_add_element.ts +1 -1
  93. package/templates/hello_world/utils/use_feature_support.ts +1 -1
  94. package/templates/hello_world/webpack.config.ts +2 -20
package/README.md CHANGED
@@ -13,7 +13,7 @@ CLI for creating and managing Canva Apps.
13
13
  - [Step 1: Install and log in](#step-1-install-and-log-in)
14
14
  - [Step 2: Create your app](#step-2-create-your-app)
15
15
  - [Step 3: Preview your app](#step-3-preview-your-app)
16
- - [Log out, auth token storage, and removal](#token-storage-and-removal)
16
+ - [Log out, auth token storage, and removal](#log-out-auth-token-storage-and-removal)
17
17
  - [CLI reference](#cli-reference)
18
18
  - [Flags](#flags)
19
19
  - [Commands](#commands)
@@ -107,7 +107,7 @@ To preview your app:
107
107
  ```
108
108
 
109
109
  3. The preview URL will be generated and opened automatically in your browser.
110
- 4. If this the first time previewing your app, click **Open** to preview your new app.
110
+ 4. If this is the first time previewing your app, click **Open** to preview your new app.
111
111
 
112
112
  ### Step 4: Run a health check on your app
113
113
 
@@ -131,7 +131,7 @@ The auth token is located in your home directory under the `.canva-cli` folder.
131
131
 
132
132
  ### Removing the Token
133
133
 
134
- To delete the token, there are two options. However only the `canva logout` command revokes and deletes the token. If there's a copy of the token, it's possible to reconnect the Canva CLI to your account's apps using the token.
134
+ To delete the token, there are two options. However, only the `canva logout` command revokes and deletes the token. If there's a copy of the token, it's possible to reconnect the Canva CLI to your account's apps using the token.
135
135
 
136
136
  #### Log out
137
137
 
@@ -144,7 +144,6 @@ To delete the token, there are two options. However only the `canva logout` comm
144
144
  #### Delete the file manually
145
145
 
146
146
  1. Locate the `credentials` file, which is stored in the following locations:
147
-
148
147
  - **macOS and Linux**: The token is stored in `~/.canva-cli/credentials`.
149
148
  - **Windows**: The token is stored in `%USERPROFILE%\.canva-cli\credentials`.
150
149
 
@@ -226,11 +225,9 @@ canva apps create "My New App" --template="hello_world" --distribution="public"
226
225
  - **Arguments**:
227
226
  - `--name`: Sets the app's name. Provide the name you want for the app.
228
227
  - **Flags**:
229
-
230
228
  - `--template`: Specifies the starting template for the app.
231
229
 
232
230
  Available templates:
233
-
234
231
  - `"hello_world"`: Basic starting point.
235
232
  - `"dam"`: Digital asset management integration.
236
233
  - `"gen_ai"`: Generative AI app creation.
@@ -238,7 +235,6 @@ canva apps create "My New App" --template="hello_world" --distribution="public"
238
235
  - `--distribution`: Sets the app's distribution type.
239
236
 
240
237
  Available types:
241
-
242
238
  - `"public"`: Available to all Canva users, subject to Canva review.
243
239
  - `"private"`: Only available to your team, and requires team admin approval.
244
240
 
@@ -259,7 +255,6 @@ canva apps list
259
255
  ```
260
256
 
261
257
  - **Flags**:
262
-
263
258
  - `--appId`: Specifies an App ID to select.
264
259
  - `--all`, `-a`: Lists all apps at once without pagination.
265
260
  - `--print`, `-p`: Prints the list of apps to the console without interactivity.
@@ -281,7 +276,7 @@ canva apps doctor
281
276
  ```
282
277
 
283
278
  - **Flags**:
284
-
279
+ - `--ci`: Run in CI mode (overrides all other flags: enables `--report`, `--silenceUpdates`, disables `--fix`, `--verbose`, skips environment checks).
285
280
  - `--fix`: Automatically apply fixes for issues where possible.
286
281
  - `--report`: Output check results without prompting for fixes.
287
282
  - `--verbose`: Show detailed diagnostic output optimized for AI agent assistance.