@canva/cli 0.0.1-beta.26 → 0.0.1-beta.28

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,9 +1,13 @@
1
1
  {
2
2
  "name": "@canva/cli",
3
- "version": "0.0.1-beta.26",
3
+ "version": "0.0.1-beta.28",
4
4
  "description": "The official Canva CLI.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Canva Pty Ltd.",
7
+ "repository": {
8
+ "directory": "git+https://github.com/canva-sdks/canva-cli.git",
9
+ "type": "git"
10
+ },
7
11
  "type": "module",
8
12
  "main": "./lib/cjs/index.cjs",
9
13
  "module": "./lib/esm/index.mjs",
@@ -26,7 +30,8 @@
26
30
  "dependencies": {
27
31
  "ink": "5.1.0",
28
32
  "react": "18.3.1",
29
- "@modelcontextprotocol/sdk": "1.8.0"
33
+ "@modelcontextprotocol/sdk": "1.8.0",
34
+ "react-docgen-typescript": "2.2.2"
30
35
  },
31
36
  "keywords": [
32
37
  "apps sdk",
@@ -23,10 +23,13 @@ export function buildConfig({
23
23
  devConfig,
24
24
  appEntry = path.join(process.cwd(), "src", "index.tsx"),
25
25
  backendHost = process.env.CANVA_BACKEND_HOST,
26
+ // For IN_HARNESS, refer to the following docs for more information: https://www.canva.dev/docs/apps/mcp-server/harness-setup/
27
+ inHarness = process.env.IN_HARNESS === "true",
26
28
  }: {
27
29
  devConfig?: DevConfig;
28
30
  appEntry?: string;
29
31
  backendHost?: string;
32
+ inHarness?: boolean;
30
33
  } = {}): Configuration & DevServerConfiguration {
31
34
  const mode = devConfig ? "development" : "production";
32
35
 
@@ -48,9 +51,14 @@ export function buildConfig({
48
51
  return {
49
52
  mode,
50
53
  context: path.resolve(process.cwd(), "./"),
51
- entry: {
52
- app: appEntry,
53
- },
54
+ entry: inHarness
55
+ ? {
56
+ harness: path.join(process.cwd(), "harness", "harness.tsx"),
57
+ init: path.join(process.cwd(), "harness", "init.ts"),
58
+ }
59
+ : {
60
+ app: appEntry,
61
+ },
54
62
  target: "web",
55
63
  resolve: {
56
64
  alias: {
@@ -62,7 +70,7 @@ export function buildConfig({
62
70
  extensions: [".ts", ".tsx", ".js", ".css", ".svg", ".woff", ".woff2"],
63
71
  },
64
72
  infrastructureLogging: {
65
- level: "none",
73
+ level: inHarness ? "info" : "none",
66
74
  },
67
75
  module: {
68
76
  rules: [
@@ -10,6 +10,5 @@ export default [
10
10
  "**/*.config.*",
11
11
  ],
12
12
  },
13
- // This template is not yet translated, switch to apps when it is
14
- ...canvaPlugin.configs.apps_no_i18n,
13
+ ...canvaPlugin.configs.apps,
15
14
  ];
@@ -22,11 +22,14 @@ export const useConfig = (): Config<ContainerTypes> => {
22
22
  description: "Label of filters for file type",
23
23
  }),
24
24
  key: "fileType",
25
+ // These options do not need to be translated as they are universal technical terms
26
+ /* eslint-disable formatjs/no-literal-string-in-object */
25
27
  options: [
26
28
  { value: "mp4", label: "MP4" },
27
29
  { value: "png", label: "PNG" },
28
30
  { value: "jpeg", label: "JPEG" },
29
31
  ],
32
+ /* eslint-enable formatjs/no-literal-string-in-object */
30
33
  allowCustomValue: true,
31
34
  },
32
35
  {
@@ -23,10 +23,13 @@ export function buildConfig({
23
23
  devConfig,
24
24
  appEntry = path.join(process.cwd(), "src", "index.tsx"),
25
25
  backendHost = process.env.CANVA_BACKEND_HOST,
26
+ // For IN_HARNESS, refer to the following docs for more information: https://www.canva.dev/docs/apps/mcp-server/harness-setup/
27
+ inHarness = process.env.IN_HARNESS === "true",
26
28
  }: {
27
29
  devConfig?: DevConfig;
28
30
  appEntry?: string;
29
31
  backendHost?: string;
32
+ inHarness?: boolean;
30
33
  } = {}): Configuration & DevServerConfiguration {
31
34
  const mode = devConfig ? "development" : "production";
32
35
 
@@ -48,9 +51,14 @@ export function buildConfig({
48
51
  return {
49
52
  mode,
50
53
  context: path.resolve(process.cwd(), "./"),
51
- entry: {
52
- app: appEntry,
53
- },
54
+ entry: inHarness
55
+ ? {
56
+ harness: path.join(process.cwd(), "harness", "harness.tsx"),
57
+ init: path.join(process.cwd(), "harness", "init.ts"),
58
+ }
59
+ : {
60
+ app: appEntry,
61
+ },
54
62
  target: "web",
55
63
  resolve: {
56
64
  alias: {
@@ -62,7 +70,7 @@ export function buildConfig({
62
70
  extensions: [".ts", ".tsx", ".js", ".css", ".svg", ".woff", ".woff2"],
63
71
  },
64
72
  infrastructureLogging: {
65
- level: "none",
73
+ level: inHarness ? "info" : "none",
66
74
  },
67
75
  module: {
68
76
  rules: [
@@ -23,10 +23,13 @@ export function buildConfig({
23
23
  devConfig,
24
24
  appEntry = path.join(process.cwd(), "src", "index.tsx"),
25
25
  backendHost = process.env.CANVA_BACKEND_HOST,
26
+ // For IN_HARNESS, refer to the following docs for more information: https://www.canva.dev/docs/apps/mcp-server/harness-setup/
27
+ inHarness = process.env.IN_HARNESS === "true",
26
28
  }: {
27
29
  devConfig?: DevConfig;
28
30
  appEntry?: string;
29
31
  backendHost?: string;
32
+ inHarness?: boolean;
30
33
  } = {}): Configuration & DevServerConfiguration {
31
34
  const mode = devConfig ? "development" : "production";
32
35
 
@@ -48,9 +51,14 @@ export function buildConfig({
48
51
  return {
49
52
  mode,
50
53
  context: path.resolve(process.cwd(), "./"),
51
- entry: {
52
- app: appEntry,
53
- },
54
+ entry: inHarness
55
+ ? {
56
+ harness: path.join(process.cwd(), "harness", "harness.tsx"),
57
+ init: path.join(process.cwd(), "harness", "init.ts"),
58
+ }
59
+ : {
60
+ app: appEntry,
61
+ },
54
62
  target: "web",
55
63
  resolve: {
56
64
  alias: {
@@ -62,7 +70,7 @@ export function buildConfig({
62
70
  extensions: [".ts", ".tsx", ".js", ".css", ".svg", ".woff", ".woff2"],
63
71
  },
64
72
  infrastructureLogging: {
65
- level: "none",
73
+ level: inHarness ? "info" : "none",
66
74
  },
67
75
  module: {
68
76
  rules: [
@@ -23,10 +23,13 @@ export function buildConfig({
23
23
  devConfig,
24
24
  appEntry = path.join(process.cwd(), "src", "index.tsx"),
25
25
  backendHost = process.env.CANVA_BACKEND_HOST,
26
+ // For IN_HARNESS, refer to the following docs for more information: https://www.canva.dev/docs/apps/mcp-server/harness-setup/
27
+ inHarness = process.env.IN_HARNESS === "true",
26
28
  }: {
27
29
  devConfig?: DevConfig;
28
30
  appEntry?: string;
29
31
  backendHost?: string;
32
+ inHarness?: boolean;
30
33
  } = {}): Configuration & DevServerConfiguration {
31
34
  const mode = devConfig ? "development" : "production";
32
35
 
@@ -48,9 +51,14 @@ export function buildConfig({
48
51
  return {
49
52
  mode,
50
53
  context: path.resolve(process.cwd(), "./"),
51
- entry: {
52
- app: appEntry,
53
- },
54
+ entry: inHarness
55
+ ? {
56
+ harness: path.join(process.cwd(), "harness", "harness.tsx"),
57
+ init: path.join(process.cwd(), "harness", "init.ts"),
58
+ }
59
+ : {
60
+ app: appEntry,
61
+ },
54
62
  target: "web",
55
63
  resolve: {
56
64
  alias: {
@@ -62,7 +70,7 @@ export function buildConfig({
62
70
  extensions: [".ts", ".tsx", ".js", ".css", ".svg", ".woff", ".woff2"],
63
71
  },
64
72
  infrastructureLogging: {
65
- level: "none",
73
+ level: inHarness ? "info" : "none",
66
74
  },
67
75
  module: {
68
76
  rules: [