@canva/cli 1.4.0 → 1.5.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canva/cli",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
4
4
  "description": "The official Canva CLI.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Canva Pty Ltd.",
@@ -45,7 +45,10 @@
45
45
  "node": ">=20.10.0"
46
46
  },
47
47
  "overrides": {
48
- "@types/react": "^19.0.0",
48
+ "@types/react": "^19.2.0",
49
+ "react-infinite-scroller": {
50
+ "react": "$react"
51
+ },
49
52
  "@inkjs/ui": {
50
53
  "ink": "$ink"
51
54
  },
@@ -7,16 +7,16 @@
7
7
  "author": "Canva Pty Ltd.",
8
8
  "dependencies": {
9
9
  "@canva/app-i18n-kit": "^1.1.1",
10
- "@canva/app-ui-kit": "^5.0.2",
10
+ "@canva/app-ui-kit": "^5.1.0",
11
11
  "@canva/asset": "^2.2.1",
12
- "@canva/design": "^2.7.2",
12
+ "@canva/design": "^2.7.3",
13
13
  "@canva/error": "^2.1.0",
14
14
  "@canva/platform": "^2.2.0",
15
15
  "@canva/user": "^2.1.1",
16
16
  "cookie-parser": "1.4.7",
17
- "react": "19.1.1",
18
- "react-dom": "19.1.1",
19
- "react-intl": "7.1.11"
17
+ "react": "^19.2.0",
18
+ "react-dom": "^19.2.0",
19
+ "react-intl": "^7.1.11"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@canva/cli": ">= 0.0.1-beta.13",
@@ -32,8 +32,8 @@
32
32
  "@types/node-forge": "1.3.14",
33
33
  "@types/nodemon": "1.19.6",
34
34
  "@types/prompts": "2.4.9",
35
- "@types/react": "19.1.13",
36
- "@types/react-dom": "19.1.9",
35
+ "@types/react": "19.2.2",
36
+ "@types/react-dom": "19.2.1",
37
37
  "@types/webpack-env": "1.18.8",
38
38
  "chalk": "4.1.2",
39
39
  "cli-table3": "0.6.5",
@@ -34,11 +34,10 @@ export function buildConfig({
34
34
  const mode = devConfig ? "development" : "production";
35
35
 
36
36
  if (!backendHost) {
37
- console.error(
38
- chalk.redBright.bold("BACKEND_HOST is undefined."),
39
- `Refer to "Customizing the backend host" in the README.md for more information.`,
37
+ console.warn(
38
+ chalk.yellow.bold("BACKEND_HOST is undefined."),
39
+ `If your app requires a backend, refer to "Customizing the backend host" in the README.md for more information.`,
40
40
  );
41
- process.exit(-1);
42
41
  } else if (backendHost.includes("localhost") && mode === "production") {
43
42
  console.error(
44
43
  chalk.redBright.bold(
@@ -8,7 +8,7 @@ const { compilerOptions } = tsconfig;
8
8
  export default {
9
9
  preset: "ts-jest",
10
10
  testEnvironment: "jsdom",
11
- testRegex: "(/tests/.*|(\\.|/)(tests))\\.tsx?$",
11
+ testRegex: "(/(tests|__tests__)/.*|(\\.|/)(tests))\\.tsx?$",
12
12
  modulePathIgnorePatterns: ["./internal/", "./node_modules/"],
13
13
  modulePaths: [compilerOptions.baseUrl],
14
14
  moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
@@ -20,20 +20,20 @@
20
20
  "dependencies": {
21
21
  "@canva/app-components": "^2.0.0",
22
22
  "@canva/app-i18n-kit": "^1.1.1",
23
- "@canva/app-ui-kit": "^5.0.2",
23
+ "@canva/app-ui-kit": "^5.1.0",
24
24
  "@canva/asset": "^2.2.1",
25
- "@canva/design": "^2.7.2",
25
+ "@canva/design": "^2.7.3",
26
26
  "@canva/error": "^2.1.0",
27
27
  "@canva/platform": "^2.2.0",
28
28
  "@canva/user": "^2.1.1",
29
29
  "cookie-parser": "1.4.7",
30
30
  "cors": "2.8.5",
31
- "react": "19.1.1",
32
- "react-dom": "19.1.1",
33
- "react-intl": "7.1.11"
31
+ "react": "^19.2.0",
32
+ "react-dom": "^19.2.0",
33
+ "react-intl": "^7.1.11"
34
34
  },
35
35
  "devDependencies": {
36
- "@canva/app-eslint-plugin": "^1.0.0-beta.5",
36
+ "@canva/app-eslint-plugin": "^1.0.0-beta.7",
37
37
  "@canva/cli": ">= 0.0.1-beta.13",
38
38
  "@formatjs/cli": "6.7.2",
39
39
  "@formatjs/ts-transformer": "3.14.0",
@@ -52,8 +52,8 @@
52
52
  "@types/node-forge": "1.3.14",
53
53
  "@types/nodemon": "1.19.6",
54
54
  "@types/prompts": "2.4.9",
55
- "@types/react": "19.1.13",
56
- "@types/react-dom": "19.1.9",
55
+ "@types/react": "19.2.2",
56
+ "@types/react-dom": "19.2.1",
57
57
  "@types/webpack-env": "1.18.8",
58
58
  "chalk": "4.1.2",
59
59
  "cli-table3": "0.6.5",
@@ -34,11 +34,10 @@ export function buildConfig({
34
34
  const mode = devConfig ? "development" : "production";
35
35
 
36
36
  if (!backendHost) {
37
- console.error(
38
- chalk.redBright.bold("BACKEND_HOST is undefined."),
39
- `Refer to "Customizing the backend host" in the README.md for more information.`,
37
+ console.warn(
38
+ chalk.yellow.bold("BACKEND_HOST is undefined."),
39
+ `If your app requires a backend, refer to "Customizing the backend host" in the README.md for more information.`,
40
40
  );
41
- process.exit(-1);
42
41
  } else if (backendHost.includes("localhost") && mode === "production") {
43
42
  console.error(
44
43
  chalk.redBright.bold(
@@ -43,8 +43,7 @@ To run it and authenticate with the Canva Connect API via OAuth you must first c
43
43
 
44
44
  ### 0. Set up an App
45
45
 
46
- - If not already handled by the Canva CLI, you need to create an app.
47
- Go to [Your Apps](https://www.canva.com/developers/apps) and create an app.
46
+ - If not already handled by the Canva CLI, you need to create an app via the [Developer Portal](https://www.canva.com/developers/apps).
48
47
  - On the **Compatibility** page, enable the `Data Connector` intent.
49
48
 
50
49
  ### 1. Set up a Connect API Integration
@@ -75,6 +74,7 @@ To run it and authenticate with the Canva Connect API via OAuth you must first c
75
74
  ### 3. Run your app
76
75
 
77
76
  - Run `npm start` to run the app.
77
+ - Click **Preview** in the [Developer Portal](https://www.canva.com/developers/apps) to view the app in the Canva editor.
78
78
  - You should be able to log in and then choose from the available data sources.
79
79
 
80
80
  ### To use another OAuth source
@@ -20,21 +20,21 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@canva/app-i18n-kit": "^1.1.1",
23
- "@canva/app-ui-kit": "^5.0.2",
23
+ "@canva/app-ui-kit": "^5.1.0",
24
24
  "@canva/asset": "^2.2.1",
25
- "@canva/design": "^2.7.2",
25
+ "@canva/design": "^2.7.3",
26
26
  "@canva/error": "^2.1.0",
27
27
  "@canva/intents": "^2.0.0",
28
28
  "@canva/platform": "^2.2.0",
29
29
  "@canva/user": "^2.1.1",
30
- "react": "19.1.1",
31
- "react-dom": "19.1.1",
30
+ "react": "^19.2.0",
31
+ "react-dom": "^19.2.0",
32
32
  "react-error-boundary": "6.0.0",
33
- "react-intl": "7.1.11",
33
+ "react-intl": "^7.1.11",
34
34
  "react-router-dom": "7.8.2"
35
35
  },
36
36
  "devDependencies": {
37
- "@canva/app-eslint-plugin": "^1.0.0-beta.5",
37
+ "@canva/app-eslint-plugin": "^1.0.0-beta.7",
38
38
  "@canva/cli": ">= 0.0.1-beta.13",
39
39
  "@formatjs/cli": "6.7.2",
40
40
  "@formatjs/ts-transformer": "3.14.0",
@@ -50,8 +50,8 @@
50
50
  "@types/node-fetch": "2.6.13",
51
51
  "@types/node-forge": "1.3.14",
52
52
  "@types/nodemon": "1.19.6",
53
- "@types/react": "19.1.13",
54
- "@types/react-dom": "19.1.9",
53
+ "@types/react": "19.2.2",
54
+ "@types/react-dom": "19.2.1",
55
55
  "@types/webpack-env": "1.18.8",
56
56
  "chalk": "4.1.2",
57
57
  "cli-table3": "0.6.5",
@@ -1,4 +1,5 @@
1
1
  import type { DataTable } from "@canva/intents/data";
2
+ import type { JSX } from "react";
2
3
  import { type DataTableColumn, toDataTable } from "src/utils";
3
4
 
4
5
  /**
@@ -1,7 +1,7 @@
1
1
  import type { RenderSelectionUiRequest } from "@canva/intents/data";
2
2
  import type { AccessTokenResponse } from "@canva/user";
3
3
  import { auth } from "@canva/user";
4
- import type { ReactNode } from "react";
4
+ import type { JSX, ReactNode } from "react";
5
5
  import { createContext, useCallback, useState } from "react";
6
6
  import type { APIResponseItem, DataSourceHandler } from "src/api/data_source";
7
7
  import { type DataSourceConfig } from "src/api/data_source";
@@ -34,11 +34,10 @@ export function buildConfig({
34
34
  const mode = devConfig ? "development" : "production";
35
35
 
36
36
  if (!backendHost) {
37
- console.error(
38
- chalk.redBright.bold("BACKEND_HOST is undefined."),
39
- `Refer to "Customizing the backend host" in the README.md for more information.`,
37
+ console.warn(
38
+ chalk.yellow.bold("BACKEND_HOST is undefined."),
39
+ `If your app requires a backend, refer to "Customizing the backend host" in the README.md for more information.`,
40
40
  );
41
- process.exit(-1);
42
41
  } else if (backendHost.includes("localhost") && mode === "production") {
43
42
  console.error(
44
43
  chalk.redBright.bold(
@@ -19,9 +19,9 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@canva/app-i18n-kit": "^1.1.1",
22
- "@canva/app-ui-kit": "^5.0.2",
22
+ "@canva/app-ui-kit": "^5.1.0",
23
23
  "@canva/asset": "^2.2.1",
24
- "@canva/design": "^2.7.2",
24
+ "@canva/design": "^2.7.3",
25
25
  "@canva/error": "^2.1.0",
26
26
  "@canva/platform": "^2.2.0",
27
27
  "@canva/user": "^2.1.1",
@@ -29,14 +29,14 @@
29
29
  "cors": "2.8.5",
30
30
  "html-react-parser": "5.2.6",
31
31
  "obscenity": "0.4.4",
32
- "react": "19.1.1",
33
- "react-dom": "19.1.1",
32
+ "react": "^19.2.0",
33
+ "react-dom": "^19.2.0",
34
34
  "react-error-boundary": "6.0.0",
35
- "react-intl": "7.1.11",
35
+ "react-intl": "^7.1.11",
36
36
  "react-router-dom": "7.8.2"
37
37
  },
38
38
  "devDependencies": {
39
- "@canva/app-eslint-plugin": "^1.0.0-beta.5",
39
+ "@canva/app-eslint-plugin": "^1.0.0-beta.7",
40
40
  "@canva/cli": ">= 0.0.1-beta.13",
41
41
  "@formatjs/cli": "6.7.2",
42
42
  "@formatjs/ts-transformer": "3.14.0",
@@ -54,10 +54,9 @@
54
54
  "@types/node-forge": "1.3.14",
55
55
  "@types/nodemon": "1.19.6",
56
56
  "@types/prompts": "2.4.9",
57
- "@types/react": "19.1.13",
58
- "@types/react-dom": "19.1.9",
57
+ "@types/react": "19.2.2",
58
+ "@types/react-dom": "19.2.1",
59
59
  "@types/webpack": "5.28.5",
60
- "@types/webpack-dev-server": "4.7.2",
61
60
  "@types/webpack-env": "1.18.8",
62
61
  "chalk": "4.1.2",
63
62
  "cli-table3": "0.6.5",
@@ -1,5 +1,6 @@
1
1
  import { Link, Rows, Text, TextPlaceholder } from "@canva/app-ui-kit";
2
2
  import { getPlatformInfo, requestOpenExternalUrl } from "@canva/platform";
3
+ import type { JSX } from "react";
3
4
  import { FormattedMessage, useIntl } from "react-intl";
4
5
  import { useAppContext } from "src/context";
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { Box, Column, Columns, FlagIcon, Link, Text } from "@canva/app-ui-kit";
2
2
  import { requestOpenExternalUrl } from "@canva/platform";
3
+ import type { JSX } from "react";
3
4
  import { FormattedMessage, useIntl } from "react-intl";
4
5
  import { APP_NAME } from "src/config";
5
6
 
@@ -1,3 +1,4 @@
1
+ import type { JSX } from "react";
1
2
  import { createContext, useEffect, useState } from "react";
2
3
  import { useIntl } from "react-intl";
3
4
  import type { ImageType } from "src/api";
@@ -34,11 +34,10 @@ export function buildConfig({
34
34
  const mode = devConfig ? "development" : "production";
35
35
 
36
36
  if (!backendHost) {
37
- console.error(
38
- chalk.redBright.bold("BACKEND_HOST is undefined."),
39
- `Refer to "Customizing the backend host" in the README.md for more information.`,
37
+ console.warn(
38
+ chalk.yellow.bold("BACKEND_HOST is undefined."),
39
+ `If your app requires a backend, refer to "Customizing the backend host" in the README.md for more information.`,
40
40
  );
41
- process.exit(-1);
42
41
  } else if (backendHost.includes("localhost") && mode === "production") {
43
42
  console.error(
44
43
  chalk.redBright.bold(
@@ -20,18 +20,18 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@canva/app-i18n-kit": "^1.1.1",
23
- "@canva/app-ui-kit": "^5.0.2",
23
+ "@canva/app-ui-kit": "^5.1.0",
24
24
  "@canva/asset": "^2.2.1",
25
- "@canva/design": "^2.7.2",
25
+ "@canva/design": "^2.7.3",
26
26
  "@canva/error": "^2.1.0",
27
27
  "@canva/platform": "^2.2.0",
28
28
  "@canva/user": "^2.1.1",
29
- "react": "19.1.1",
30
- "react-dom": "19.1.1",
31
- "react-intl": "7.1.11"
29
+ "react": "^19.2.0",
30
+ "react-dom": "^19.2.0",
31
+ "react-intl": "^7.1.11"
32
32
  },
33
33
  "devDependencies": {
34
- "@canva/app-eslint-plugin": "^1.0.0-beta.5",
34
+ "@canva/app-eslint-plugin": "^1.0.0-beta.7",
35
35
  "@canva/cli": ">= 0.0.1-beta.13",
36
36
  "@formatjs/cli": "6.7.2",
37
37
  "@formatjs/ts-transformer": "3.14.0",
@@ -47,8 +47,8 @@
47
47
  "@types/node-fetch": "2.6.13",
48
48
  "@types/node-forge": "1.3.14",
49
49
  "@types/nodemon": "1.19.6",
50
- "@types/react": "19.1.13",
51
- "@types/react-dom": "19.1.9",
50
+ "@types/react": "19.2.2",
51
+ "@types/react-dom": "19.2.1",
52
52
  "@types/webpack-env": "1.18.8",
53
53
  "chalk": "4.1.2",
54
54
  "cli-table3": "0.6.5",
@@ -34,11 +34,10 @@ export function buildConfig({
34
34
  const mode = devConfig ? "development" : "production";
35
35
 
36
36
  if (!backendHost) {
37
- console.error(
38
- chalk.redBright.bold("BACKEND_HOST is undefined."),
39
- `Refer to "Customizing the backend host" in the README.md for more information.`,
37
+ console.warn(
38
+ chalk.yellow.bold("BACKEND_HOST is undefined."),
39
+ `If your app requires a backend, refer to "Customizing the backend host" in the README.md for more information.`,
40
40
  );
41
- process.exit(-1);
42
41
  } else if (backendHost.includes("localhost") && mode === "production") {
43
42
  console.error(
44
43
  chalk.redBright.bold(