defang 1.1.8 → 1.1.11

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Defang
1
+ # ![Defang](https://raw.githubusercontent.com/DefangLabs/defang-assets/main/Logos/Element_Wordmark_Slogan/JPG/Dark_Colour_Glow.jpg)
2
2
 
3
- Defang is a radically simpler way for developers to develop, deploy, and debug cloud applications.
3
+ Develop Anything, Deploy Anywhere. Take your app from Docker Compose to a secure and scalable deployment on your favorite cloud in minutes.
4
4
 
5
5
  - Public releases of the Defang CLI; [click here](https://github.com/DefangLabs/defang/releases/latest/) for the latest version
6
6
  - Sample projects in Golang, Python, Node.js, and many more languages and frameworks, that show you how to accomplish various tasks and deploy them to the DOP using a Docker Compose file and the Defang CLI.
@@ -34,4 +34,8 @@ The Defang CLI recognizes the following environment variables:
34
34
  - `DEFANG_PROVIDER` - The name of the cloud provider to use, `auto` (default), `aws`, `digitalocean`, or `defang`
35
35
  - `NO_COLOR` - If set to any value, disables color output; by default, color output is enabled depending on the terminal
36
36
  - `TZ` - The timezone to use for log timestamps: an IANA TZ name like `UTC` or `Europe/Amsterdam`; defaults to `Local`
37
- - `XDG_STATE_HOME` - The directory to use for storing state; defaults to `~/.local/state`
37
+ - `XDG_STATE_HOME` - The directory to use for storing state; defaults to `~/.local/state`
38
+
39
+ ---
40
+
41
+ Made by [Defang Labs](https://defang.io)
package/bin/clilib.js CHANGED
@@ -26,13 +26,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
26
26
  }) : function(o, v) {
27
27
  o["default"] = v;
28
28
  });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
36
46
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
47
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
48
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -43,8 +53,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
53
  });
44
54
  };
45
55
  var __generator = (this && this.__generator) || function (thisArg, body) {
46
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
56
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
57
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
58
  function verb(n) { return function (v) { return step([n, v]); }; }
49
59
  function step(op) {
50
60
  if (f) throw new TypeError("Generator is already executing.");
@@ -96,7 +106,7 @@ function getLatestVersion() {
96
106
  case 0: return [4, axios_1.default.get(URL_LATEST_RELEASE)];
97
107
  case 1:
98
108
  response = _c.sent();
99
- if ((response === null || response === void 0 ? void 0 : response.status) !== HTTP_STATUS_OK) {
109
+ if (response.status !== HTTP_STATUS_OK) {
100
110
  throw new Error("Failed to get latest version from GitHub. Status code: ".concat(response.status));
101
111
  }
102
112
  return [2, (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.tag_name) === null || _b === void 0 ? void 0 : _b.replace("v", "").trim()];
@@ -133,7 +143,7 @@ function downloadFile(downloadUrl, downloadTargetFile) {
133
143
  })];
134
144
  case 1:
135
145
  response = _a.sent();
136
- if ((response === null || response === void 0 ? void 0 : response.data) === undefined) {
146
+ if (response.data == null) {
137
147
  throw new Error("Failed to download ".concat(downloadUrl, ". No data in response."));
138
148
  }
139
149
  return [4, fs.promises.writeFile(downloadTargetFile, response.data)];
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "defang",
3
- "version": "1.1.8",
3
+ "version": "1.1.11",
4
4
  "author": "Defang Software Labs Inc.",
5
- "description": "CLI for the Defang Opinionated Platform",
5
+ "description": "CLI to take your app from Docker Compose to a secure and scalable deployment on your favorite cloud in minutes",
6
6
  "license": "MIT",
7
7
  "bin": {
8
8
  "defang": "bin/cli.js"
9
9
  },
10
10
  "keywords": [],
11
- "homepage": "https://github.com/DefangLabs/defang#readme",
11
+ "homepage": "https://defang.io",
12
12
  "repository": {
13
13
  "type": "git",
14
14
  "url": "git+https://github.com/DefangLabs/defang.git"
@@ -32,23 +32,17 @@
32
32
  "scripts": {
33
33
  "build": "tsc",
34
34
  "postbuild": "chmod +x bin/cli.js",
35
- "test": "TS_NODE_PROJECT='./tsconfig-test.json' mocha -r ts-node/register --loader=ts-node/esm -trace-warnings --no-warnings=ExperimentalWarning test/*.spec.ts"
35
+ "test": "mocha -r ts-node/register -trace-warnings 'test/**/*.spec.ts'"
36
36
  },
37
37
  "dependencies": {
38
38
  "adm-zip": "^0.5.14",
39
- "axios": "^1.7.2",
40
- "babel-register-esm": "^1.2.5",
41
- "https": "^1.0.0",
42
- "os": "^0.1.2",
39
+ "axios": "^1.8.2",
43
40
  "tar": "^7.0.1"
44
41
  },
45
42
  "devDependencies": {
46
- "@babel/core": "^7.24.7",
47
- "@babel/preset-env": "^7.24.7",
48
- "@babel/preset-typescript": "^7.24.7",
49
43
  "@types/adm-zip": "^0.5.5",
50
- "@types/chai": "^4.3.16",
51
- "@types/chai-as-promised": "^7.1.8",
44
+ "@types/chai": "^5.1.1",
45
+ "@types/chai-as-promised": "^8.0.0",
52
46
  "@types/mocha": "^10.0.7",
53
47
  "@types/node": "^20.12.7",
54
48
  "@types/sinon": "^17.0.3",
@@ -1,16 +1,10 @@
1
- //********************************
2
- // To run these tests do the following:
3
- // 1. In package.json set/add the field "type": "module"
4
- // 2. Run `npm test`
5
- //********************************
6
- import * as mocha from "mocha";
7
- import * as sinon from "sinon";
1
+ import axios, { AxiosResponse } from "axios";
8
2
  import * as chai from "chai";
9
3
  import chaiAsPromised from "chai-as-promised";
10
-
11
- import axios, { AxiosResponse } from "axios";
12
4
  import fs from "fs";
13
- import clilib from "../src/clilib.ts";
5
+ import "mocha";
6
+ import * as sinon from "sinon";
7
+ import clilib from "../src/clilib";
14
8
 
15
9
  chai.use(chaiAsPromised);
16
10
  const { assert, expect } = chai;
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "baseUrl": "./",
4
- "outDir": "bin",
5
- "removeComments": true,
6
- "target": "ES6",
7
- "module": "ESNext",
8
- "moduleResolution": "node",
9
- "experimentalDecorators": true,
10
- "strictPropertyInitialization": false,
11
- "allowSyntheticDefaultImports":true,
12
- "allowImportingTsExtensions": true,
13
- "lib": ["es2021"],
14
- "noEmit": true,
15
- "isolatedModules": false,
16
- "strict": false,
17
- "noImplicitAny": false,
18
- "typeRoots" : [
19
- "../node_modules/@types"
20
- ]
21
- },
22
- "include": ["src/**/*.ts", "test/cliexec.spec.ts"],
23
- "exclude": ["node_modules", "**/*.spec.ts"]
24
- }