@canva/cli 1.7.0 → 1.9.0
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/CHANGELOG.md +23 -0
- package/README.md +1 -1
- package/cli.js +455 -555
- package/lib/cjs/index.cjs +6 -6
- package/lib/esm/index.mjs +6 -6
- package/package.json +1 -1
- package/templates/base/backend/database/database.ts +2 -2
- package/templates/base/backend/routers/auth.ts +5 -5
- package/templates/base/backend/routers/oauth.ts +4 -4
- package/templates/base/package.json +1 -1
- package/templates/base/scripts/copy_env.ts +6 -3
- package/templates/base/scripts/ssl/ssl.ts +3 -3
- package/templates/base/scripts/start/app_runner.ts +29 -7
- package/templates/base/scripts/start/context.ts +2 -2
- package/templates/base/scripts/start/start.ts +1 -1
- package/templates/base/scripts/start.tests.ts +1 -1
- package/templates/base/tsconfig.json +2 -1
- package/templates/base/utils/backend/base_backend/create.ts +4 -4
- package/templates/base/utils/backend/bearer_middleware/bearer_middleware.ts +1 -1
- package/templates/base/utils/backend/jwt_middleware/jwt_middleware.ts +3 -6
- package/templates/base/webpack.config.ts +3 -3
- package/templates/common/utils/backend/base_backend/create.ts +4 -4
- package/templates/common/utils/backend/jwt_middleware/jwt_middleware.ts +3 -6
- package/templates/dam/backend/routers/dam.ts +2 -2
- package/templates/dam/backend/server.ts +2 -2
- package/templates/dam/package.json +1 -1
- package/templates/dam/scripts/copy_env.ts +6 -3
- package/templates/dam/scripts/ssl/ssl.ts +3 -3
- package/templates/dam/scripts/start/app_runner.ts +29 -7
- package/templates/dam/scripts/start/context.ts +2 -2
- package/templates/dam/scripts/start/start.ts +1 -1
- package/templates/dam/tsconfig.json +2 -1
- package/templates/dam/utils/backend/base_backend/create.ts +4 -4
- package/templates/dam/utils/backend/jwt_middleware/jwt_middleware.ts +3 -6
- package/templates/dam/webpack.config.ts +3 -3
- package/templates/data_connector/package.json +1 -1
- package/templates/data_connector/scripts/copy_env.ts +6 -3
- package/templates/data_connector/scripts/ssl/ssl.ts +3 -3
- package/templates/data_connector/scripts/start/app_runner.ts +29 -7
- package/templates/data_connector/scripts/start/context.ts +2 -2
- package/templates/data_connector/scripts/start/start.ts +1 -1
- package/templates/data_connector/tsconfig.json +2 -1
- package/templates/data_connector/webpack.config.ts +3 -3
- package/templates/gen_ai/backend/database/database.ts +2 -2
- package/templates/gen_ai/backend/routers/image.ts +1 -1
- package/templates/gen_ai/backend/server.ts +2 -2
- package/templates/gen_ai/package.json +1 -1
- package/templates/gen_ai/scripts/copy_env.ts +6 -3
- package/templates/gen_ai/scripts/ssl/ssl.ts +3 -3
- package/templates/gen_ai/scripts/start/app_runner.ts +29 -7
- package/templates/gen_ai/scripts/start/context.ts +2 -2
- package/templates/gen_ai/scripts/start/start.ts +1 -1
- package/templates/gen_ai/tsconfig.json +2 -1
- package/templates/gen_ai/utils/backend/base_backend/create.ts +4 -4
- package/templates/gen_ai/utils/backend/bearer_middleware/bearer_middleware.ts +1 -1
- package/templates/gen_ai/webpack.config.ts +3 -3
- package/templates/hello_world/package.json +1 -1
- package/templates/hello_world/scripts/copy_env.ts +6 -3
- package/templates/hello_world/scripts/ssl/ssl.ts +3 -3
- package/templates/hello_world/scripts/start/app_runner.ts +29 -7
- package/templates/hello_world/scripts/start/context.ts +2 -2
- package/templates/hello_world/scripts/start/start.ts +1 -1
- package/templates/hello_world/tsconfig.json +2 -1
- package/templates/hello_world/webpack.config.ts +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import
|
|
2
|
+
import debug from "debug";
|
|
3
3
|
import type { NextFunction, Request, Response } from "express";
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
5
|
import Express from "express-serve-static-core";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import
|
|
3
|
-
import * as debug from "debug";
|
|
2
|
+
import debug from "debug";
|
|
4
3
|
import type { NextFunction, Request, Response } from "express";
|
|
5
4
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
5
|
import Express from "express-serve-static-core";
|
|
7
|
-
import
|
|
6
|
+
import jwt from "jsonwebtoken";
|
|
8
7
|
import { JwksClient, SigningKeyNotFoundError } from "jwks-rsa";
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -125,9 +124,7 @@ export function createJwtMiddleware(
|
|
|
125
124
|
if (e instanceof SigningKeyNotFoundError) {
|
|
126
125
|
return sendUnauthorizedResponse(
|
|
127
126
|
res,
|
|
128
|
-
`Public key not found.
|
|
129
|
-
"Ensure you have the correct App_ID set",
|
|
130
|
-
)}.`,
|
|
127
|
+
`Public key not found. Ensure you have the correct App_ID set`,
|
|
131
128
|
);
|
|
132
129
|
}
|
|
133
130
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Configuration } from "webpack";
|
|
2
2
|
import { DefinePlugin, optimize } from "webpack";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import path from "path";
|
|
4
|
+
import TerserPlugin from "terser-webpack-plugin";
|
|
5
5
|
import { transform } from "@formatjs/ts-transformer";
|
|
6
|
-
import
|
|
6
|
+
import chalk from "chalk";
|
|
7
7
|
import { config } from "dotenv";
|
|
8
8
|
import { Configuration as DevServerConfiguration } from "webpack-dev-server";
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import debug from "debug";
|
|
3
|
-
import
|
|
3
|
+
import express from "express";
|
|
4
4
|
import type { NextFunction, Request, Response } from "express";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import http from "http";
|
|
7
|
+
import https from "https";
|
|
8
8
|
|
|
9
9
|
const serverDebug = debug("server");
|
|
10
10
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import
|
|
3
|
-
import * as debug from "debug";
|
|
2
|
+
import debug from "debug";
|
|
4
3
|
import type { NextFunction, Request, Response } from "express";
|
|
5
4
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
5
|
import Express from "express-serve-static-core";
|
|
7
|
-
import
|
|
6
|
+
import jwt from "jsonwebtoken";
|
|
8
7
|
import { JwksClient, SigningKeyNotFoundError } from "jwks-rsa";
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -125,9 +124,7 @@ export function createJwtMiddleware(
|
|
|
125
124
|
if (e instanceof SigningKeyNotFoundError) {
|
|
126
125
|
return sendUnauthorizedResponse(
|
|
127
126
|
res,
|
|
128
|
-
`Public key not found.
|
|
129
|
-
"Ensure you have the correct App_ID set",
|
|
130
|
-
)}.`,
|
|
127
|
+
`Public key not found. Ensure you have the correct App_ID set`,
|
|
131
128
|
);
|
|
132
129
|
}
|
|
133
130
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import path from "path";
|
|
4
5
|
|
|
5
6
|
const envPath = path.resolve(__dirname, "..", ".env");
|
|
6
7
|
const templatePath = path.resolve(__dirname, "..", ".env.template");
|
|
7
8
|
|
|
8
|
-
if (!fs.existsSync(
|
|
9
|
+
if (!fs.existsSync(templatePath)) {
|
|
10
|
+
console.warn(".env.template file does not exist, skipping copy of .env file");
|
|
11
|
+
} else if (!fs.existsSync(envPath)) {
|
|
9
12
|
fs.copyFileSync(templatePath, envPath);
|
|
10
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
import fs from "fs/promises";
|
|
3
3
|
import { pki } from "node-forge";
|
|
4
|
-
import
|
|
4
|
+
import path from "path";
|
|
5
5
|
|
|
6
6
|
const SSL_CERT_DIR = path.resolve(process.cwd(), "..", "..", ".ssl");
|
|
7
7
|
const CERT_FILE = path.resolve(SSL_CERT_DIR, "certificate.pem");
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import { generatePreviewUrl } from "@canva/cli";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import ngrok from "@ngrok/ngrok";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import Table from "cli-table3";
|
|
6
|
+
import nodemon from "nodemon";
|
|
7
7
|
import open from "open";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import os from "os";
|
|
9
|
+
import webpack from "webpack";
|
|
10
|
+
import WebpackDevServer from "webpack-dev-server";
|
|
10
11
|
import { buildConfig } from "../../webpack.config";
|
|
11
12
|
import type { Certificate } from "../ssl/ssl";
|
|
12
13
|
import { createOrRetrieveCertificate } from "../ssl/ssl";
|
|
@@ -18,6 +19,22 @@ export const errorChalk = chalk.bgRed.bold;
|
|
|
18
19
|
export const highlightChalk = chalk.greenBright.bold;
|
|
19
20
|
export const linkChalk = chalk.cyan;
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Returns the appropriate modifier key text based on the user's operating system.
|
|
24
|
+
* @returns "cmd" for macOS, "ctrl" for Windows and Linux
|
|
25
|
+
*/
|
|
26
|
+
export function getModifierKey(): string {
|
|
27
|
+
const platform = os.platform();
|
|
28
|
+
switch (platform) {
|
|
29
|
+
case "darwin": // macOS
|
|
30
|
+
return "cmd";
|
|
31
|
+
case "win32": // Windows
|
|
32
|
+
return "ctrl";
|
|
33
|
+
default: // Linux and others
|
|
34
|
+
return "ctrl";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
21
38
|
export class AppRunner {
|
|
22
39
|
async run(ctx: Context) {
|
|
23
40
|
console.log(
|
|
@@ -189,9 +206,14 @@ export class AppRunner {
|
|
|
189
206
|
return;
|
|
190
207
|
}
|
|
191
208
|
|
|
209
|
+
const modifierKey = getModifierKey();
|
|
210
|
+
|
|
192
211
|
table.push([
|
|
193
212
|
previewCellHeader,
|
|
194
|
-
{
|
|
213
|
+
{
|
|
214
|
+
content: `Preview URL (${modifierKey} + click)`,
|
|
215
|
+
href: generatePreviewResult.data,
|
|
216
|
+
},
|
|
195
217
|
]);
|
|
196
218
|
|
|
197
219
|
if (openPreview) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import debug from "debug";
|
|
3
|
-
import
|
|
3
|
+
import express from "express";
|
|
4
4
|
import type { NextFunction, Request, Response } from "express";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import http from "http";
|
|
7
|
+
import https from "https";
|
|
8
8
|
|
|
9
9
|
const serverDebug = debug("server");
|
|
10
10
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import
|
|
3
|
-
import * as debug from "debug";
|
|
2
|
+
import debug from "debug";
|
|
4
3
|
import type { NextFunction, Request, Response } from "express";
|
|
5
4
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
5
|
import Express from "express-serve-static-core";
|
|
7
|
-
import
|
|
6
|
+
import jwt from "jsonwebtoken";
|
|
8
7
|
import { JwksClient, SigningKeyNotFoundError } from "jwks-rsa";
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -125,9 +124,7 @@ export function createJwtMiddleware(
|
|
|
125
124
|
if (e instanceof SigningKeyNotFoundError) {
|
|
126
125
|
return sendUnauthorizedResponse(
|
|
127
126
|
res,
|
|
128
|
-
`Public key not found.
|
|
129
|
-
"Ensure you have the correct App_ID set",
|
|
130
|
-
)}.`,
|
|
127
|
+
`Public key not found. Ensure you have the correct App_ID set`,
|
|
131
128
|
);
|
|
132
129
|
}
|
|
133
130
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Configuration } from "webpack";
|
|
2
2
|
import { DefinePlugin, optimize } from "webpack";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import path from "path";
|
|
4
|
+
import TerserPlugin from "terser-webpack-plugin";
|
|
5
5
|
import { transform } from "@formatjs/ts-transformer";
|
|
6
|
-
import
|
|
6
|
+
import chalk from "chalk";
|
|
7
7
|
import { config } from "dotenv";
|
|
8
8
|
import { Configuration as DevServerConfiguration } from "webpack-dev-server";
|
|
9
9
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import path from "path";
|
|
4
5
|
|
|
5
6
|
const envPath = path.resolve(__dirname, "..", ".env");
|
|
6
7
|
const templatePath = path.resolve(__dirname, "..", ".env.template");
|
|
7
8
|
|
|
8
|
-
if (!fs.existsSync(
|
|
9
|
+
if (!fs.existsSync(templatePath)) {
|
|
10
|
+
console.warn(".env.template file does not exist, skipping copy of .env file");
|
|
11
|
+
} else if (!fs.existsSync(envPath)) {
|
|
9
12
|
fs.copyFileSync(templatePath, envPath);
|
|
10
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
import fs from "fs/promises";
|
|
3
3
|
import { pki } from "node-forge";
|
|
4
|
-
import
|
|
4
|
+
import path from "path";
|
|
5
5
|
|
|
6
6
|
const SSL_CERT_DIR = path.resolve(process.cwd(), "..", "..", ".ssl");
|
|
7
7
|
const CERT_FILE = path.resolve(SSL_CERT_DIR, "certificate.pem");
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import { generatePreviewUrl } from "@canva/cli";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import ngrok from "@ngrok/ngrok";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import Table from "cli-table3";
|
|
6
|
+
import nodemon from "nodemon";
|
|
7
7
|
import open from "open";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import os from "os";
|
|
9
|
+
import webpack from "webpack";
|
|
10
|
+
import WebpackDevServer from "webpack-dev-server";
|
|
10
11
|
import { buildConfig } from "../../webpack.config";
|
|
11
12
|
import type { Certificate } from "../ssl/ssl";
|
|
12
13
|
import { createOrRetrieveCertificate } from "../ssl/ssl";
|
|
@@ -18,6 +19,22 @@ export const errorChalk = chalk.bgRed.bold;
|
|
|
18
19
|
export const highlightChalk = chalk.greenBright.bold;
|
|
19
20
|
export const linkChalk = chalk.cyan;
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Returns the appropriate modifier key text based on the user's operating system.
|
|
24
|
+
* @returns "cmd" for macOS, "ctrl" for Windows and Linux
|
|
25
|
+
*/
|
|
26
|
+
export function getModifierKey(): string {
|
|
27
|
+
const platform = os.platform();
|
|
28
|
+
switch (platform) {
|
|
29
|
+
case "darwin": // macOS
|
|
30
|
+
return "cmd";
|
|
31
|
+
case "win32": // Windows
|
|
32
|
+
return "ctrl";
|
|
33
|
+
default: // Linux and others
|
|
34
|
+
return "ctrl";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
21
38
|
export class AppRunner {
|
|
22
39
|
async run(ctx: Context) {
|
|
23
40
|
console.log(
|
|
@@ -189,9 +206,14 @@ export class AppRunner {
|
|
|
189
206
|
return;
|
|
190
207
|
}
|
|
191
208
|
|
|
209
|
+
const modifierKey = getModifierKey();
|
|
210
|
+
|
|
192
211
|
table.push([
|
|
193
212
|
previewCellHeader,
|
|
194
|
-
{
|
|
213
|
+
{
|
|
214
|
+
content: `Preview URL (${modifierKey} + click)`,
|
|
215
|
+
href: generatePreviewResult.data,
|
|
216
|
+
},
|
|
195
217
|
]);
|
|
196
218
|
|
|
197
219
|
if (openPreview) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Configuration } from "webpack";
|
|
2
2
|
import { DefinePlugin, optimize } from "webpack";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import path from "path";
|
|
4
|
+
import TerserPlugin from "terser-webpack-plugin";
|
|
5
5
|
import { transform } from "@formatjs/ts-transformer";
|
|
6
|
-
import
|
|
6
|
+
import chalk from "chalk";
|
|
7
7
|
import { config } from "dotenv";
|
|
8
8
|
import { Configuration as DevServerConfiguration } from "webpack-dev-server";
|
|
9
9
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Use this code as a learning resource, but do not deploy it in a real backend without significant modifications
|
|
9
9
|
* to ensure reliability, security, and scalability.
|
|
10
10
|
*/
|
|
11
|
-
import
|
|
11
|
+
import express from "express";
|
|
12
12
|
|
|
13
13
|
interface ImageResponse {
|
|
14
14
|
fullsize: { width: number; height: number; url: string };
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import path from "path";
|
|
4
5
|
|
|
5
6
|
const envPath = path.resolve(__dirname, "..", ".env");
|
|
6
7
|
const templatePath = path.resolve(__dirname, "..", ".env.template");
|
|
7
8
|
|
|
8
|
-
if (!fs.existsSync(
|
|
9
|
+
if (!fs.existsSync(templatePath)) {
|
|
10
|
+
console.warn(".env.template file does not exist, skipping copy of .env file");
|
|
11
|
+
} else if (!fs.existsSync(envPath)) {
|
|
9
12
|
fs.copyFileSync(templatePath, envPath);
|
|
10
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
import fs from "fs/promises";
|
|
3
3
|
import { pki } from "node-forge";
|
|
4
|
-
import
|
|
4
|
+
import path from "path";
|
|
5
5
|
|
|
6
6
|
const SSL_CERT_DIR = path.resolve(process.cwd(), "..", "..", ".ssl");
|
|
7
7
|
const CERT_FILE = path.resolve(SSL_CERT_DIR, "certificate.pem");
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import { generatePreviewUrl } from "@canva/cli";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import ngrok from "@ngrok/ngrok";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import Table from "cli-table3";
|
|
6
|
+
import nodemon from "nodemon";
|
|
7
7
|
import open from "open";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import os from "os";
|
|
9
|
+
import webpack from "webpack";
|
|
10
|
+
import WebpackDevServer from "webpack-dev-server";
|
|
10
11
|
import { buildConfig } from "../../webpack.config";
|
|
11
12
|
import type { Certificate } from "../ssl/ssl";
|
|
12
13
|
import { createOrRetrieveCertificate } from "../ssl/ssl";
|
|
@@ -18,6 +19,22 @@ export const errorChalk = chalk.bgRed.bold;
|
|
|
18
19
|
export const highlightChalk = chalk.greenBright.bold;
|
|
19
20
|
export const linkChalk = chalk.cyan;
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Returns the appropriate modifier key text based on the user's operating system.
|
|
24
|
+
* @returns "cmd" for macOS, "ctrl" for Windows and Linux
|
|
25
|
+
*/
|
|
26
|
+
export function getModifierKey(): string {
|
|
27
|
+
const platform = os.platform();
|
|
28
|
+
switch (platform) {
|
|
29
|
+
case "darwin": // macOS
|
|
30
|
+
return "cmd";
|
|
31
|
+
case "win32": // Windows
|
|
32
|
+
return "ctrl";
|
|
33
|
+
default: // Linux and others
|
|
34
|
+
return "ctrl";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
21
38
|
export class AppRunner {
|
|
22
39
|
async run(ctx: Context) {
|
|
23
40
|
console.log(
|
|
@@ -189,9 +206,14 @@ export class AppRunner {
|
|
|
189
206
|
return;
|
|
190
207
|
}
|
|
191
208
|
|
|
209
|
+
const modifierKey = getModifierKey();
|
|
210
|
+
|
|
192
211
|
table.push([
|
|
193
212
|
previewCellHeader,
|
|
194
|
-
{
|
|
213
|
+
{
|
|
214
|
+
content: `Preview URL (${modifierKey} + click)`,
|
|
215
|
+
href: generatePreviewResult.data,
|
|
216
|
+
},
|
|
195
217
|
]);
|
|
196
218
|
|
|
197
219
|
if (openPreview) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import debug from "debug";
|
|
3
|
-
import
|
|
3
|
+
import express from "express";
|
|
4
4
|
import type { NextFunction, Request, Response } from "express";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import http from "http";
|
|
7
|
+
import https from "https";
|
|
8
8
|
|
|
9
9
|
const serverDebug = debug("server");
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import
|
|
2
|
+
import debug from "debug";
|
|
3
3
|
import type { NextFunction, Request, Response } from "express";
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
5
|
import Express from "express-serve-static-core";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Configuration } from "webpack";
|
|
2
2
|
import { DefinePlugin, optimize } from "webpack";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import path from "path";
|
|
4
|
+
import TerserPlugin from "terser-webpack-plugin";
|
|
5
5
|
import { transform } from "@formatjs/ts-transformer";
|
|
6
|
-
import
|
|
6
|
+
import chalk from "chalk";
|
|
7
7
|
import { config } from "dotenv";
|
|
8
8
|
import { Configuration as DevServerConfiguration } from "webpack-dev-server";
|
|
9
9
|
|