@dainprotocol/cli 1.3.0 → 1.3.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/dist/commands/build.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/deploy.js +2 -2
- package/dist/commands/dev.js +2 -2
- package/dist/commands/init.js +1 -1
- package/dist/commands/logs.js +1 -1
- package/dist/commands/start.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/testchat.js +1 -1
- package/dist/commands/undeploy.js +1 -1
- package/dist/index.js +9 -9
- package/package.json +3 -2
package/dist/commands/build.js
CHANGED
package/dist/commands/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { logError, logSuccess, logInfo } from '../utils';
|
|
3
|
+
import { logError, logSuccess, logInfo } from '../utils.js';
|
|
4
4
|
export default async function config(action, key, value) {
|
|
5
5
|
const configPath = path.join(process.cwd(), 'dain.json');
|
|
6
6
|
try {
|
package/dist/commands/deploy.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DEFAULT_API_BASE_URL, fetchWithTimeout, getDainConfig, joinUrl, logError, parseEnvContent, } from "../utils";
|
|
1
|
+
import { DEFAULT_API_BASE_URL, fetchWithTimeout, getDainConfig, joinUrl, logError, parseEnvContent, } from "../utils.js";
|
|
2
2
|
import ora from "ora";
|
|
3
3
|
import fs from "fs-extra";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import archiver from "archiver";
|
|
6
|
-
import build from "./build";
|
|
6
|
+
import build from "./build.js";
|
|
7
7
|
const START_DEPLOY_URI = "/api/app/data/deployments/start-deploy";
|
|
8
8
|
const DEPLOY_TIMEOUT_MS = 120000;
|
|
9
9
|
export default async function deploy(options) {
|
package/dist/commands/dev.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
|
-
import { getDainConfig, setupProxy, logError, logInfo, logSuccess, getStaticFilesPath, displayTunnelUrl, } from '../utils';
|
|
2
|
+
import { getDainConfig, setupProxy, logError, logInfo, logSuccess, getStaticFilesPath, displayTunnelUrl, } from '../utils.js';
|
|
3
3
|
import ora from 'ora';
|
|
4
4
|
import chokidar from 'chokidar';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import { Log, LogLevel, Miniflare } from 'miniflare';
|
|
7
|
-
import build from './build';
|
|
7
|
+
import build from './build.js';
|
|
8
8
|
import fs from 'fs-extra';
|
|
9
9
|
import { createServer } from 'net';
|
|
10
10
|
let childProcess = null;
|
package/dist/commands/init.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
|
-
import { logError, logSuccess, logInfo } from '../utils';
|
|
4
|
+
import { logError, logSuccess, logInfo } from '../utils.js';
|
|
5
5
|
import ora from 'ora';
|
|
6
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = path.dirname(__filename);
|
package/dist/commands/logs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ora from "ora";
|
|
2
|
-
import { getDainConfig, logError, logInfo, platformRequest, validatePlatformConfig, } from "../utils";
|
|
2
|
+
import { getDainConfig, logError, logInfo, platformRequest, validatePlatformConfig, } from "../utils.js";
|
|
3
3
|
let watchInterval = null;
|
|
4
4
|
let isShuttingDown = false;
|
|
5
5
|
function cleanup() {
|
package/dist/commands/start.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import { getDainConfig, logError } from '../utils';
|
|
4
|
+
import { getDainConfig, logError } from '../utils.js';
|
|
5
5
|
export default function start(options) {
|
|
6
6
|
const config = getDainConfig();
|
|
7
7
|
process.env.PORT = options.port;
|
package/dist/commands/status.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ora from "ora";
|
|
2
|
-
import { getDainConfig, logError, platformRequest, validatePlatformConfig, } from "../utils";
|
|
2
|
+
import { getDainConfig, logError, platformRequest, validatePlatformConfig, } from "../utils.js";
|
|
3
3
|
export default async function status(options, preDefinedDeploymentId, preDefinedEnvironmentName, preDefinedServiceId) {
|
|
4
4
|
const config = getDainConfig(options.config);
|
|
5
5
|
const ctx = validatePlatformConfig(config, {
|
|
@@ -3,7 +3,7 @@ import { generateText } from "ai";
|
|
|
3
3
|
import "dotenv/config";
|
|
4
4
|
import * as readline from "node:readline/promises";
|
|
5
5
|
import { DainClientAuth, DainServiceConnection, } from "@dainprotocol/service-sdk/client";
|
|
6
|
-
import { getDainConfig } from "../utils";
|
|
6
|
+
import { getDainConfig } from "../utils.js";
|
|
7
7
|
const terminal = readline.createInterface({
|
|
8
8
|
input: process.stdin,
|
|
9
9
|
output: process.stdout,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ora from "ora";
|
|
2
|
-
import { getDainConfig, logError, platformRequest, validatePlatformConfig, } from "../utils";
|
|
2
|
+
import { getDainConfig, logError, platformRequest, validatePlatformConfig, } from "../utils.js";
|
|
3
3
|
export default async function undeploy(options) {
|
|
4
4
|
const config = getDainConfig(options.config);
|
|
5
5
|
const ctx = validatePlatformConfig(config);
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { readFileSync } from 'fs';
|
|
3
3
|
import { Command } from 'commander';
|
|
4
|
-
import init from './commands/init';
|
|
5
|
-
import dev from './commands/dev';
|
|
6
|
-
import deploy from './commands/deploy';
|
|
7
|
-
import build from './commands/build';
|
|
8
|
-
import start from './commands/start';
|
|
9
|
-
import testchat from './commands/testchat';
|
|
10
|
-
import status from './commands/status';
|
|
11
|
-
import undeploy from './commands/undeploy';
|
|
12
|
-
import logs from './commands/logs';
|
|
4
|
+
import init from './commands/init.js';
|
|
5
|
+
import dev from './commands/dev.js';
|
|
6
|
+
import deploy from './commands/deploy.js';
|
|
7
|
+
import build from './commands/build.js';
|
|
8
|
+
import start from './commands/start.js';
|
|
9
|
+
import testchat from './commands/testchat.js';
|
|
10
|
+
import status from './commands/status.js';
|
|
11
|
+
import undeploy from './commands/undeploy.js';
|
|
12
|
+
import logs from './commands/logs.js';
|
|
13
13
|
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
|
|
14
14
|
const program = new Command();
|
|
15
15
|
program
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dainprotocol/cli",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"description": "CLI for Dain Protocol",
|
|
9
|
+
"type": "module",
|
|
9
10
|
"main": "dist/index.js",
|
|
10
11
|
"bin": {
|
|
11
12
|
"dain": "./dist/index.js"
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
"test": "jest",
|
|
16
17
|
"test:watch": "jest --watch",
|
|
17
18
|
"test:coverage": "jest --coverage",
|
|
18
|
-
"prepublishOnly": "pnpm run build
|
|
19
|
+
"prepublishOnly": "pnpm run build"
|
|
19
20
|
},
|
|
20
21
|
"files": [
|
|
21
22
|
"dist",
|