@quantum-hub/qhubctl 1.11.0 → 1.12.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.
@@ -1,7 +1,7 @@
1
1
  import { Command } from 'commander';
2
2
  import fs from 'fs-extra';
3
3
  import path from 'node:path';
4
- import { DEFAULT_STARTER, promptUserInput } from '../lib/init-user-input.js';
4
+ import { DEFAULT_STARTER, promptUserInput, resolveServiceDirectory } from '../lib/init-user-input.js';
5
5
  import { randomName } from '../lib/random-name.js';
6
6
  import { cloneRepository } from '../lib/repository.js';
7
7
  import { error, stdout } from '../lib/output.js';
@@ -49,11 +49,10 @@ export const initCommand = new Command('init')
49
49
  }
50
50
  if (input.starter) {
51
51
  fs.mkdirSync(targetDirectory);
52
- }
53
- writeServiceConfig(targetDirectory, serviceConfig);
54
- if (input.starter) {
55
52
  await cloneRepository(input.starter.url, targetDirectory);
56
53
  }
54
+ const serviceDirectory = resolveServiceDirectory(targetDirectory, input.starter);
55
+ writeServiceConfig(serviceDirectory, serviceConfig);
57
56
  stdout('\u{1F389} Initialized project. Happy hacking!');
58
57
  if (input.starter) {
59
58
  stdout('\n Next steps:');
@@ -2,6 +2,7 @@ import { GpuType, Runtime } from '../model/managed-service-config.js';
2
2
  export interface StarterInput {
3
3
  url: string;
4
4
  runtime: Runtime;
5
+ serviceDirectory?: string;
5
6
  }
6
7
  export interface UserInput {
7
8
  cpu: number;
@@ -11,5 +12,6 @@ export interface UserInput {
11
12
  name: string;
12
13
  starter?: StarterInput;
13
14
  }
15
+ export declare const resolveServiceDirectory: (targetDirectory: string, starter?: StarterInput) => string;
14
16
  export declare const DEFAULT_STARTER: StarterInput;
15
17
  export declare const promptUserInput: (defaultName: string) => Promise<UserInput>;
@@ -1,5 +1,7 @@
1
1
  import { input, select, number } from '@inquirer/prompts';
2
+ import path from 'node:path';
2
3
  import { GpuType, Runtime } from '../model/managed-service-config.js';
4
+ export const resolveServiceDirectory = (targetDirectory, starter) => starter?.serviceDirectory ? path.join(targetDirectory, starter.serviceDirectory) : targetDirectory;
3
5
  export const DEFAULT_STARTER = {
4
6
  url: 'https://repository.hub.kipu-quantum.com/cec4a31d-5856-4387-b4cf-718345803558/qhub-starter-python.git',
5
7
  runtime: Runtime.PYTHON_TEMPLATE,
@@ -30,6 +32,14 @@ export const promptUserInput = async (defaultName) => {
30
32
  runtime: Runtime.DOCKER,
31
33
  },
32
34
  },
35
+ {
36
+ name: 'Service Demo Starter (full-stack example with frontend accessing a service)',
37
+ value: {
38
+ url: 'https://repository.hub.kipu-quantum.com/cec4a31d-5856-4387-b4cf-718345803558/qhub-starter-service-demo.git',
39
+ runtime: Runtime.PYTHON_TEMPLATE,
40
+ serviceDirectory: 'service',
41
+ },
42
+ },
33
43
  { name: 'None (creates "qhub.json" in current directory)', value: undefined },
34
44
  ],
35
45
  default: DEFAULT_STARTER,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantum-hub/qhubctl",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
4
4
  "description": "Kipu Quantum Hub CLI",
5
5
  "author": "Kipu Quantum GmbH",
6
6
  "contributors": [