@contrail/cli 3.1.4 → 3.1.6

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
@@ -17,7 +17,7 @@ $ npm install -g @contrail/cli
17
17
  $ contrail COMMAND
18
18
  running command...
19
19
  $ contrail (--version)
20
- @contrail/cli/3.1.4 darwin-x64 node-v22.12.0
20
+ @contrail/cli/3.1.6 darwin-arm64 node-v20.18.0
21
21
  $ contrail --help [COMMAND]
22
22
  USAGE
23
23
  $ contrail COMMAND
@@ -147,9 +147,10 @@ Deploy an extension from the extensions directory to a VibeIQ managed URL.
147
147
 
148
148
  ```
149
149
  USAGE
150
- $ contrail app extension deploy -i <value> [-l error|warn|info|debug] [-e true|false]
150
+ $ contrail app extension deploy -i <value> [-l error|warn|info|debug] [-e true|false] [-d]
151
151
 
152
152
  FLAGS
153
+ -d, --debug Enable debug mode
153
154
  -e, --alwaysConfirmEnv=<option> [default: true] The Environment variables
154
155
  <options: true|false>
155
156
  -i, --identifier=<value> (required) The extension identifier to deploy. The identifier of the extension is the
@@ -4,6 +4,7 @@ export default class DeployExtension extends BaseCommand {
4
4
  static examples: string[];
5
5
  static flags: {
6
6
  identifier: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
+ debug: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
8
  alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
9
  logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
10
  };
@@ -24,6 +24,11 @@ class DeployExtension extends basecommand_1.BaseCommand {
24
24
  description: 'The extension identifier to deploy. The identifier of the extension is the "identifier" property in the extension defined in the app.yml',
25
25
  required: true,
26
26
  }),
27
+ debug: core_1.Flags.boolean({
28
+ char: 'd',
29
+ description: 'Enable debug mode',
30
+ default: false,
31
+ }),
27
32
  };
28
33
  async run() {
29
34
  await (0, login_1.authUser)();
@@ -35,7 +40,7 @@ class DeployExtension extends basecommand_1.BaseCommand {
35
40
  await this.validateExtensionDeclaration(appDeclaration, extensionIdentifier);
36
41
  const extensionDir = this.getExtensionDirectory(extensionIdentifier);
37
42
  // 2. Package and upload extension
38
- const createdPackage = await (0, extension_package_1.createExtensionPackage)(app.id, extensionDir);
43
+ const createdPackage = await (0, extension_package_1.createExtensionPackage)(app.id, extensionDir, { debug: this.flags.debug });
39
44
  // 3. Poll until package is ready (timeout after 1 minute)
40
45
  const readyPackage = await this.pollUntilPackageIsReady(createdPackage);
41
46
  logger_1.default.info("Extension package is ready...Checking for extension deployment");
@@ -1,5 +1,7 @@
1
1
  import { App } from '@contrail/entity-types';
2
2
  import { AppDeclaration, AppExtensionPackage } from '../../interfaces';
3
- export declare function createExtensionPackage(appId: string, extensionDir: string): Promise<any>;
3
+ export declare function createExtensionPackage(appId: string, extensionDir: string, options: {
4
+ debug: boolean;
5
+ }): Promise<any>;
4
6
  export declare function getExistingApp(appDeclaration: AppDeclaration): Promise<App>;
5
7
  export declare function getExtensionPackage(packageId: string): Promise<AppExtensionPackage>;
@@ -32,27 +32,12 @@ function cleanAndPrepareTmpDir(extensionDir, tmpDir) {
32
32
  function cleanUp(tmpDir) {
33
33
  fs_1.default.rmSync(tmpDir, { recursive: true, force: true });
34
34
  }
35
- function installDependencies(tmpDir) {
36
- try {
37
- logger_1.default.info('Installing production dependencies started...');
38
- const child_process = require('child_process');
39
- child_process.execSync('npm install --omit=dev --prefix ./', {
40
- cwd: tmpDir,
41
- stdio: 'inherit',
42
- });
43
- logger_1.default.info('Installing production dependencies done.');
44
- }
45
- catch (e) {
46
- logger_1.default.info(`${chalk_1.default.red.bold('FAIL')} Failed during dependency install: ${e}`);
47
- throw e;
48
- }
49
- }
50
35
  function buildExtension(packageId, extensionDir, tmpDir) {
51
36
  try {
52
37
  logger_1.default.info('Building package...');
53
38
  const child_process = require('child_process');
54
39
  console.log('Building package... in ', tmpDir);
55
- child_process.execSync(`npx ng build --output-path ${tmpDir}/dist --deploy-url /packages/${packageId}/`, {
40
+ child_process.execSync(`npx ng build --output-path "${tmpDir}/dist" --deploy-url /packages/${packageId}/`, {
56
41
  cwd: extensionDir,
57
42
  stdio: 'inherit',
58
43
  });
@@ -71,7 +56,7 @@ function copyAssets(extensionDir, tmpDir) {
71
56
  try {
72
57
  logger_1.default.info('Copying Assets...');
73
58
  const child_process = require('child_process');
74
- child_process.execSync(`npx copyfiles assets/**/* ${tmpDir}/dist/`, {
59
+ child_process.execSync(`npx copyfiles assets/**/* "${tmpDir}/dist/"`, {
75
60
  cwd: extensionDir,
76
61
  stdio: 'inherit',
77
62
  });
@@ -113,7 +98,7 @@ async function uploadExtensionPackage(appExtensionPackage, tmpDir) {
113
98
  logger_1.default.info(`${chalk_1.default.green.bold('EXTENSION')} Extension package uploaded. ID: ${appExtensionPackage.id}`);
114
99
  return appExtensionPackage;
115
100
  }
116
- async function createExtensionPackage(appId, extensionDir) {
101
+ async function createExtensionPackage(appId, extensionDir, options) {
117
102
  const tmpDir = createTmpDir(extensionDir);
118
103
  logger_1.default.info(`${chalk_1.default.blue.bold('START')} Creating extension package at ${tmpDir}`);
119
104
  cleanAndPrepareTmpDir(extensionDir, tmpDir);
@@ -128,7 +113,12 @@ async function createExtensionPackage(appId, extensionDir) {
128
113
  await zipDist(tmpDir);
129
114
  await uploadExtensionPackage(appExtensionPackage, tmpDir);
130
115
  logger_1.default.info(`${chalk_1.default.green.bold('COMPLETE')} Extension packaged and uploaded.`);
131
- cleanUp(tmpDir);
116
+ if (options.debug) {
117
+ logger_1.default.debug("debug mode enabled. Not cleaning up tmp dir.");
118
+ }
119
+ else {
120
+ cleanUp(tmpDir);
121
+ }
132
122
  return appExtensionPackage;
133
123
  }
134
124
  exports.createExtensionPackage = createExtensionPackage;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.1.4",
2
+ "version": "3.1.6",
3
3
  "commands": {
4
4
  "app:create": {
5
5
  "id": "app:create",
@@ -3056,6 +3056,13 @@
3056
3056
  "description": "The extension identifier to deploy. The identifier of the extension is the \"identifier\" property in the extension defined in the app.yml",
3057
3057
  "required": true,
3058
3058
  "multiple": false
3059
+ },
3060
+ "debug": {
3061
+ "name": "debug",
3062
+ "type": "boolean",
3063
+ "char": "d",
3064
+ "description": "Enable debug mode",
3065
+ "allowNo": false
3059
3066
  }
3060
3067
  },
3061
3068
  "args": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "3.1.4",
3
+ "version": "3.1.6",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",