@quantum-hub/qhubctl 2.2.1 → 2.2.2

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.
Files changed (74) hide show
  1. package/README.md +26 -2
  2. package/dist/commands/compress.d.ts +1 -1
  3. package/dist/commands/compress.js +15 -15
  4. package/dist/commands/datapool-upload.d.ts +1 -1
  5. package/dist/commands/datapool-upload.js +35 -35
  6. package/dist/commands/get-context.d.ts +1 -1
  7. package/dist/commands/get-context.js +5 -5
  8. package/dist/commands/init.d.ts +1 -1
  9. package/dist/commands/init.js +33 -29
  10. package/dist/commands/list-contexts.d.ts +1 -1
  11. package/dist/commands/list-contexts.js +21 -13
  12. package/dist/commands/login.d.ts +1 -1
  13. package/dist/commands/login.js +16 -16
  14. package/dist/commands/logout.d.ts +1 -1
  15. package/dist/commands/logout.js +10 -10
  16. package/dist/commands/openapi.d.ts +1 -1
  17. package/dist/commands/openapi.js +112 -94
  18. package/dist/commands/run.d.ts +2 -2
  19. package/dist/commands/run.js +37 -34
  20. package/dist/commands/serve.d.ts +1 -1
  21. package/dist/commands/serve.js +30 -19
  22. package/dist/commands/services-build-logs.d.ts +2 -2
  23. package/dist/commands/services-build-logs.js +26 -26
  24. package/dist/commands/services-build-status.d.ts +1 -1
  25. package/dist/commands/services-build-status.js +21 -21
  26. package/dist/commands/services-list.d.ts +1 -1
  27. package/dist/commands/services-list.js +20 -17
  28. package/dist/commands/set-context.d.ts +1 -1
  29. package/dist/commands/set-context.js +19 -24
  30. package/dist/commands/up.d.ts +1 -1
  31. package/dist/commands/up.js +50 -48
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/lib/command.js +2 -2
  35. package/dist/lib/config-dir.js +3 -3
  36. package/dist/lib/debug.js +1 -1
  37. package/dist/lib/entrypoint-resolver.js +15 -15
  38. package/dist/lib/error.js +4 -4
  39. package/dist/lib/fetch.js +3 -1
  40. package/dist/lib/init-user-input.d.ts +1 -1
  41. package/dist/lib/init-user-input.js +28 -26
  42. package/dist/lib/output.d.ts +2 -2
  43. package/dist/lib/output.js +3 -3
  44. package/dist/lib/random-name.js +147 -147
  45. package/dist/lib/random-string.js +2 -2
  46. package/dist/lib/repository.js +5 -5
  47. package/dist/lib/stream-to-blob.d.ts +1 -1
  48. package/dist/lib/stream-to-blob.js +5 -5
  49. package/dist/lib/up/get-description.js +8 -8
  50. package/dist/lib/up/ignore.js +8 -8
  51. package/dist/lib/up/qhubignore-help.js +10 -10
  52. package/dist/lib/up/required-files.js +17 -12
  53. package/dist/lib/up/source.d.ts +2 -2
  54. package/dist/lib/up/source.js +7 -7
  55. package/dist/lib/up/zip.js +8 -8
  56. package/dist/main.js +3 -3
  57. package/dist/model/command.d.ts +2 -2
  58. package/dist/model/command.js +9 -9
  59. package/dist/model/managed-service-config.d.ts +1 -1
  60. package/dist/model/user-config.js +1 -1
  61. package/dist/program.d.ts +1 -1
  62. package/dist/program.js +24 -24
  63. package/dist/service/auth-service.d.ts +3 -3
  64. package/dist/service/auth-service.js +11 -9
  65. package/dist/service/command-service.d.ts +1 -1
  66. package/dist/service/quantum-hub-service.d.ts +3 -3
  67. package/dist/service/quantum-hub-service.js +34 -20
  68. package/dist/service/service-config-service.d.ts +1 -1
  69. package/dist/service/service-config-service.js +8 -8
  70. package/dist/service/user-config-service.d.ts +1 -1
  71. package/dist/service/user-config-service.js +7 -7
  72. package/dist/service/user-service.d.ts +2 -2
  73. package/dist/service/user-service.js +4 -4
  74. package/package.json +8 -2
@@ -1,4 +1,4 @@
1
- import { warn } from './output.js';
1
+ import { warn } from "./output.js";
2
2
  export class EntrypointResolver {
3
3
  /**
4
4
  * Resolves the entrypoint string from various flag combinations.
@@ -14,8 +14,8 @@ export class EntrypointResolver {
14
14
  return entryPoint.entrypoint;
15
15
  }
16
16
  // If package and/or method flags are provided, construct the entrypoint
17
- const packagePath = entryPoint.package || 'src.program';
18
- const method = entryPoint.method || 'run';
17
+ const packagePath = entryPoint.package || "src.program";
18
+ const method = entryPoint.method || "run";
19
19
  const entrypoint = `${packagePath}:${method}`;
20
20
  this.validateEntrypoint(entrypoint);
21
21
  return entrypoint;
@@ -31,12 +31,12 @@ export class EntrypointResolver {
31
31
  */
32
32
  static validateEntrypoint(entrypoint) {
33
33
  if (!entrypoint) {
34
- throw new Error('Entrypoint cannot be empty');
34
+ throw new Error("Entrypoint cannot be empty");
35
35
  }
36
- const parts = entrypoint.split(':');
36
+ const parts = entrypoint.split(":");
37
37
  if (parts.length !== 2) {
38
38
  throw new Error(`Invalid entrypoint format: "${entrypoint}". ` +
39
- 'Must contain exactly one colon separating module and object reference');
39
+ "Must contain exactly one colon separating module and object reference");
40
40
  }
41
41
  const [modulePath, objectPath] = parts;
42
42
  // Check for empty parts first
@@ -49,7 +49,7 @@ export class EntrypointResolver {
49
49
  // Validate object path (function or Class.method)
50
50
  this.validateObjectPath(objectPath, entrypoint);
51
51
  // Warn if object path starts with underscore (private methods/classes)
52
- if (objectPath.startsWith('_')) {
52
+ if (objectPath.startsWith("_")) {
53
53
  warn(`Object "${objectPath}" starts with underscore. Make sure this is intended for a private object.`);
54
54
  }
55
55
  }
@@ -58,16 +58,16 @@ export class EntrypointResolver {
58
58
  */
59
59
  static validateModulePath(modulePath, fullEntrypoint) {
60
60
  // Check for leading/trailing dots or consecutive dots
61
- if (modulePath.startsWith('.') || modulePath.endsWith('.')) {
61
+ if (modulePath.startsWith(".") || modulePath.endsWith(".")) {
62
62
  throw new Error(`Invalid module path in entrypoint: "${modulePath}". ` +
63
- 'Module path should not start or end with dots.');
63
+ "Module path should not start or end with dots.");
64
64
  }
65
- if (modulePath.includes('..')) {
65
+ if (modulePath.includes("..")) {
66
66
  throw new Error(`Invalid module path in entrypoint: "${modulePath}". ` +
67
- 'Module path should not contain consecutive dots.');
67
+ "Module path should not contain consecutive dots.");
68
68
  }
69
69
  // Split by dots and validate each identifier
70
- const moduleIdentifiers = modulePath.split('.');
70
+ const moduleIdentifiers = modulePath.split(".");
71
71
  for (const identifier of moduleIdentifiers) {
72
72
  if (!this.isValidPythonIdentifier(identifier)) {
73
73
  throw new Error(`Invalid entrypoint format: "${fullEntrypoint}". ` +
@@ -80,7 +80,7 @@ export class EntrypointResolver {
80
80
  */
81
81
  static validateObjectPath(objectPath, fullEntrypoint) {
82
82
  // Split by dots and validate each identifier
83
- const objectIdentifiers = objectPath.split('.');
83
+ const objectIdentifiers = objectPath.split(".");
84
84
  for (const identifier of objectIdentifiers) {
85
85
  if (!this.isValidPythonIdentifier(identifier)) {
86
86
  throw new Error(`Invalid entrypoint format: "${fullEntrypoint}". ` +
@@ -106,7 +106,7 @@ export class EntrypointResolver {
106
106
  */
107
107
  static extractPackagePath(entrypoint) {
108
108
  this.validateEntrypoint(entrypoint);
109
- return entrypoint.split(':')[0];
109
+ return entrypoint.split(":")[0];
110
110
  }
111
111
  /**
112
112
  * Extracts the method name from an entrypoint string.
@@ -116,6 +116,6 @@ export class EntrypointResolver {
116
116
  */
117
117
  static extractMethod(entrypoint) {
118
118
  this.validateEntrypoint(entrypoint);
119
- return entrypoint.split(':')[1];
119
+ return entrypoint.split(":")[1];
120
120
  }
121
121
  }
package/dist/lib/error.js CHANGED
@@ -1,6 +1,6 @@
1
- import { HubPlatformError, HubPlatformTimeoutError } from '@quantum-hub/qhub-api/platform';
2
- import { HubUserError, HubUserTimeoutError } from '@quantum-hub/qhub-api/user';
3
- import { debugEnabled } from './debug.js';
1
+ import { HubPlatformError, HubPlatformTimeoutError } from "@quantum-hub/qhub-api/platform";
2
+ import { HubUserError, HubUserTimeoutError } from "@quantum-hub/qhub-api/user";
3
+ import { debugEnabled } from "./debug.js";
4
4
  export const handleError = async (error) => {
5
5
  if (error instanceof HubPlatformError || error instanceof HubUserError) {
6
6
  const httpStatus = error.statusCode;
@@ -30,5 +30,5 @@ export const handleError = async (error) => {
30
30
  console.error(JSON.stringify(error));
31
31
  }
32
32
  }
33
- return 'Internal error occurred, please contact your KQH administrator';
33
+ return "Internal error occurred, please contact your KQH administrator";
34
34
  };
package/dist/lib/fetch.js CHANGED
@@ -24,7 +24,9 @@ export const getErrorMessage = async (response) => {
24
24
  catch {
25
25
  // ignore
26
26
  }
27
- const httpStatus = response.status && response.statusText ? `${response.status} - ${response.statusText}` : response.status;
27
+ const httpStatus = response.status && response.statusText
28
+ ? `${response.status} - ${response.statusText}`
29
+ : response.status;
28
30
  // message is either in body.errorMessage, body.error or body.detail
29
31
  let errorMessage;
30
32
  if (body?.errorMessage)
@@ -1,4 +1,4 @@
1
- import { GpuType, Runtime } from '../model/managed-service-config.js';
1
+ import { GpuType, Runtime } from "../model/managed-service-config.js";
2
2
  export interface StarterInput {
3
3
  url: string;
4
4
  runtime: Runtime;
@@ -1,9 +1,11 @@
1
- import { input, select, number } from '@inquirer/prompts';
2
- import path from 'node:path';
3
- import { GpuType, Runtime } from '../model/managed-service-config.js';
4
- export const resolveServiceDirectory = (targetDirectory, starter) => starter?.serviceDirectory ? path.join(targetDirectory, starter.serviceDirectory) : targetDirectory;
1
+ import { input, select, number } from "@inquirer/prompts";
2
+ import path from "node:path";
3
+ import { GpuType, Runtime } from "../model/managed-service-config.js";
4
+ export const resolveServiceDirectory = (targetDirectory, starter) => starter?.serviceDirectory
5
+ ? path.join(targetDirectory, starter.serviceDirectory)
6
+ : targetDirectory;
5
7
  export const DEFAULT_STARTER = {
6
- url: 'https://repository.hub.kipu-quantum.com/cec4a31d-5856-4387-b4cf-718345803558/qhub-starter-python.git',
8
+ url: "https://repository.hub.kipu-quantum.com/cec4a31d-5856-4387-b4cf-718345803558/qhub-starter-python.git",
7
9
  runtime: Runtime.PYTHON_TEMPLATE,
8
10
  };
9
11
  export const promptUserInput = async (defaultName) => {
@@ -12,32 +14,32 @@ export const promptUserInput = async (defaultName) => {
12
14
  default: defaultName,
13
15
  });
14
16
  const starter = await select({
15
- message: 'Choose a starter template',
17
+ message: "Choose a starter template",
16
18
  choices: [
17
19
  {
18
- name: 'Python Starter (recommended to get started quickly)',
20
+ name: "Python Starter (recommended to get started quickly)",
19
21
  value: DEFAULT_STARTER,
20
22
  },
21
23
  {
22
- name: 'Docker Starter (setup for experienced users)',
24
+ name: "Docker Starter (setup for experienced users)",
23
25
  value: {
24
- url: 'https://repository.hub.kipu-quantum.com/cec4a31d-5856-4387-b4cf-718345803558/qhub-starter-docker.git',
26
+ url: "https://repository.hub.kipu-quantum.com/cec4a31d-5856-4387-b4cf-718345803558/qhub-starter-docker.git",
25
27
  runtime: Runtime.DOCKER,
26
28
  },
27
29
  },
28
30
  {
29
- name: 'NVIDIA CUDA-Q Starter (for GPU accelerated applications; setup for experienced users)',
31
+ name: "NVIDIA CUDA-Q Starter (for GPU accelerated applications; setup for experienced users)",
30
32
  value: {
31
- url: 'https://repository.hub.kipu-quantum.com/cec4a31d-5856-4387-b4cf-718345803558/qhub-starter-gpu.git',
33
+ url: "https://repository.hub.kipu-quantum.com/cec4a31d-5856-4387-b4cf-718345803558/qhub-starter-gpu.git",
32
34
  runtime: Runtime.DOCKER,
33
35
  },
34
36
  },
35
37
  {
36
- name: 'Service Demo Starter (full-stack example with frontend accessing a service)',
38
+ name: "Service Demo Starter (full-stack example with frontend accessing a service)",
37
39
  value: {
38
- url: 'https://repository.hub.kipu-quantum.com/cec4a31d-5856-4387-b4cf-718345803558/qhub-starter-service-demo.git',
40
+ url: "https://repository.hub.kipu-quantum.com/cec4a31d-5856-4387-b4cf-718345803558/qhub-starter-service-demo.git",
39
41
  runtime: Runtime.PYTHON_TEMPLATE,
40
- serviceDirectory: 'service',
42
+ serviceDirectory: "service",
41
43
  },
42
44
  },
43
45
  { name: 'None (creates "qhub.json" in current directory)', value: undefined },
@@ -45,39 +47,39 @@ export const promptUserInput = async (defaultName) => {
45
47
  default: DEFAULT_STARTER,
46
48
  });
47
49
  const cpu = await number({
48
- message: 'Enter vCPU configuration (may be between 1 and 220 vCPUs, depending on your account):',
50
+ message: "Enter vCPU configuration (may be between 1 and 220 vCPUs, depending on your account):",
49
51
  default: 1,
50
52
  validate: (input) => {
51
53
  if (input === null || input === undefined || !Number.isInteger(input)) {
52
- return 'Please enter a valid integer';
54
+ return "Please enter a valid integer";
53
55
  }
54
56
  if (input < 1 || input > 220) {
55
- return 'vCPU must be between 1 and 220';
57
+ return "vCPU must be between 1 and 220";
56
58
  }
57
59
  return true;
58
60
  },
59
61
  });
60
62
  const memory = await number({
61
- message: 'Enter memory configuration in GB (may be between 1 and 848 GBs, depending on your account):',
63
+ message: "Enter memory configuration in GB (may be between 1 and 848 GBs, depending on your account):",
62
64
  default: 1,
63
65
  validate: (input) => {
64
66
  if (input === null || input === undefined || !Number.isInteger(input)) {
65
- return 'Please enter a valid integer';
67
+ return "Please enter a valid integer";
66
68
  }
67
69
  if (input < 1 || input > 848) {
68
- return 'Memory must be between 1 and 848 GB';
70
+ return "Memory must be between 1 and 848 GB";
69
71
  }
70
72
  return true;
71
73
  },
72
74
  });
73
75
  let gpu = undefined;
74
- if (!starter || starter.url.includes('qhub-starter-gpu')) {
76
+ if (!starter || starter.url.includes("qhub-starter-gpu")) {
75
77
  gpu = await select({
76
- message: 'Choose your GPU configuration',
78
+ message: "Choose your GPU configuration",
77
79
  choices: [
78
- { name: 'No GPU support', value: undefined },
79
- { name: 'NVIDIA® T4', value: GpuType.NVIDIA_TESLA_T4 },
80
- { name: 'NVIDIA® V100', value: GpuType.NVIDIA_TESLA_V100 },
80
+ { name: "No GPU support", value: undefined },
81
+ { name: "NVIDIA® T4", value: GpuType.NVIDIA_TESLA_T4 },
82
+ { name: "NVIDIA® V100", value: GpuType.NVIDIA_TESLA_V100 },
81
83
  ],
82
84
  default: undefined,
83
85
  });
@@ -88,6 +90,6 @@ export const promptUserInput = async (defaultName) => {
88
90
  cpu: cpu,
89
91
  memory: memory,
90
92
  gpu,
91
- descriptionFile: 'README.md',
93
+ descriptionFile: "README.md",
92
94
  };
93
95
  };
@@ -1,5 +1,5 @@
1
- import { type Ora } from 'ora';
2
- export type { Ora } from 'ora';
1
+ import { type Ora } from "ora";
2
+ export type { Ora } from "ora";
3
3
  /**
4
4
  * Output helpers — replaces oclif's `ux.*` surface.
5
5
  *
@@ -1,4 +1,4 @@
1
- import ora from 'ora';
1
+ import ora from "ora";
2
2
  /**
3
3
  * Output helpers — replaces oclif's `ux.*` surface.
4
4
  *
@@ -7,8 +7,8 @@ import ora from 'ora';
7
7
  * error → ux.error() / this.error()
8
8
  * spinner → ux.action.start() / ux.action.stop()
9
9
  */
10
- export function stdout(msg = '') {
11
- process.stdout.write(msg + '\n');
10
+ export function stdout(msg = "") {
11
+ process.stdout.write(msg + "\n");
12
12
  }
13
13
  export function warn(msg) {
14
14
  process.stderr.write(`Warning: ${msg}\n`);
@@ -5,153 +5,153 @@ export const randomName = () => {
5
5
  return `${randomAdjective}-${randomAnimal}-${suffix}`;
6
6
  };
7
7
  const adjectives = [
8
- 'admiring',
9
- 'adoring',
10
- 'agile',
11
- 'ambitious',
12
- 'blissful',
13
- 'bold',
14
- 'brave',
15
- 'brilliant',
16
- 'calm',
17
- 'charming',
18
- 'cozy',
19
- 'creative',
20
- 'curious',
21
- 'dazzling',
22
- 'delightful',
23
- 'diligent',
24
- 'dynamic',
25
- 'eager',
26
- 'efficient',
27
- 'elegant',
28
- 'fantastic',
29
- 'fierce',
30
- 'fluffy',
31
- 'focused',
32
- 'generous',
33
- 'gentle',
34
- 'gloomy',
35
- 'graceful',
36
- 'harmonious',
37
- 'honest',
38
- 'innovative',
39
- 'intelligent',
40
- 'jolly',
41
- 'joyful',
42
- 'jubilant',
43
- 'kind',
44
- 'lively',
45
- 'luminous',
46
- 'magnificent',
47
- 'misty',
48
- 'noble',
49
- 'optimistic',
50
- 'peaceful',
51
- 'precious',
52
- 'quiet',
53
- 'radiant',
54
- 'resilient',
55
- 'serene',
56
- 'silly',
57
- 'trustworthy',
58
- 'unique',
59
- 'vibrant',
60
- 'wise',
61
- 'xenial',
62
- 'youthful',
63
- 'zealous',
8
+ "admiring",
9
+ "adoring",
10
+ "agile",
11
+ "ambitious",
12
+ "blissful",
13
+ "bold",
14
+ "brave",
15
+ "brilliant",
16
+ "calm",
17
+ "charming",
18
+ "cozy",
19
+ "creative",
20
+ "curious",
21
+ "dazzling",
22
+ "delightful",
23
+ "diligent",
24
+ "dynamic",
25
+ "eager",
26
+ "efficient",
27
+ "elegant",
28
+ "fantastic",
29
+ "fierce",
30
+ "fluffy",
31
+ "focused",
32
+ "generous",
33
+ "gentle",
34
+ "gloomy",
35
+ "graceful",
36
+ "harmonious",
37
+ "honest",
38
+ "innovative",
39
+ "intelligent",
40
+ "jolly",
41
+ "joyful",
42
+ "jubilant",
43
+ "kind",
44
+ "lively",
45
+ "luminous",
46
+ "magnificent",
47
+ "misty",
48
+ "noble",
49
+ "optimistic",
50
+ "peaceful",
51
+ "precious",
52
+ "quiet",
53
+ "radiant",
54
+ "resilient",
55
+ "serene",
56
+ "silly",
57
+ "trustworthy",
58
+ "unique",
59
+ "vibrant",
60
+ "wise",
61
+ "xenial",
62
+ "youthful",
63
+ "zealous",
64
64
  ];
65
65
  const animals = [
66
- 'aardvark',
67
- 'alpaca',
68
- 'anaconda',
69
- 'antelope',
70
- 'armadillo',
71
- 'baboon',
72
- 'badger',
73
- 'bat',
74
- 'bear',
75
- 'beaver',
76
- 'bison',
77
- 'boar',
78
- 'buffalo',
79
- 'camel',
80
- 'cat',
81
- 'cheetah',
82
- 'chimpanzee',
83
- 'chinchilla',
84
- 'cobra',
85
- 'cougar',
86
- 'coyote',
87
- 'crocodile',
88
- 'deer',
89
- 'dingo',
90
- 'dog',
91
- 'dolphin',
92
- 'donkey',
93
- 'eagle',
94
- 'elephant',
95
- 'elk',
96
- 'falcon',
97
- 'ferret',
98
- 'flamingo',
99
- 'fox',
100
- 'gazelle',
101
- 'giraffe',
102
- 'goat',
103
- 'gorilla',
104
- 'grizzly bear',
105
- 'hamster',
106
- 'hedgehog',
107
- 'hippopotamus',
108
- 'horse',
109
- 'hummingbird',
110
- 'hyena',
111
- 'iguana',
112
- 'jackal',
113
- 'jaguar',
114
- 'kangaroo',
115
- 'koala',
116
- 'lemur',
117
- 'leopard',
118
- 'lion',
119
- 'llama',
120
- 'lynx',
121
- 'mantis',
122
- 'marmot',
123
- 'mongoose',
124
- 'moose',
125
- 'narwhal',
126
- 'octopus',
127
- 'orangutan',
128
- 'ostrich',
129
- 'otter',
130
- 'panda',
131
- 'panther',
132
- 'peacock',
133
- 'penguin',
134
- 'platypus',
135
- 'puma',
136
- 'quail',
137
- 'rabbit',
138
- 'raccoon',
139
- 'raven',
140
- 'rhinoceros',
141
- 'salamander',
142
- 'seal',
143
- 'shark',
144
- 'skunk',
145
- 'sloth',
146
- 'squirrel',
147
- 'tapir',
148
- 'tiger',
149
- 'turtle',
150
- 'viper',
151
- 'walrus',
152
- 'whale',
153
- 'wombat',
154
- 'wolverine',
155
- 'yak',
156
- 'zebra',
66
+ "aardvark",
67
+ "alpaca",
68
+ "anaconda",
69
+ "antelope",
70
+ "armadillo",
71
+ "baboon",
72
+ "badger",
73
+ "bat",
74
+ "bear",
75
+ "beaver",
76
+ "bison",
77
+ "boar",
78
+ "buffalo",
79
+ "camel",
80
+ "cat",
81
+ "cheetah",
82
+ "chimpanzee",
83
+ "chinchilla",
84
+ "cobra",
85
+ "cougar",
86
+ "coyote",
87
+ "crocodile",
88
+ "deer",
89
+ "dingo",
90
+ "dog",
91
+ "dolphin",
92
+ "donkey",
93
+ "eagle",
94
+ "elephant",
95
+ "elk",
96
+ "falcon",
97
+ "ferret",
98
+ "flamingo",
99
+ "fox",
100
+ "gazelle",
101
+ "giraffe",
102
+ "goat",
103
+ "gorilla",
104
+ "grizzly bear",
105
+ "hamster",
106
+ "hedgehog",
107
+ "hippopotamus",
108
+ "horse",
109
+ "hummingbird",
110
+ "hyena",
111
+ "iguana",
112
+ "jackal",
113
+ "jaguar",
114
+ "kangaroo",
115
+ "koala",
116
+ "lemur",
117
+ "leopard",
118
+ "lion",
119
+ "llama",
120
+ "lynx",
121
+ "mantis",
122
+ "marmot",
123
+ "mongoose",
124
+ "moose",
125
+ "narwhal",
126
+ "octopus",
127
+ "orangutan",
128
+ "ostrich",
129
+ "otter",
130
+ "panda",
131
+ "panther",
132
+ "peacock",
133
+ "penguin",
134
+ "platypus",
135
+ "puma",
136
+ "quail",
137
+ "rabbit",
138
+ "raccoon",
139
+ "raven",
140
+ "rhinoceros",
141
+ "salamander",
142
+ "seal",
143
+ "shark",
144
+ "skunk",
145
+ "sloth",
146
+ "squirrel",
147
+ "tapir",
148
+ "tiger",
149
+ "turtle",
150
+ "viper",
151
+ "walrus",
152
+ "whale",
153
+ "wombat",
154
+ "wolverine",
155
+ "yak",
156
+ "zebra",
157
157
  ];
@@ -1,6 +1,6 @@
1
- const characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
1
+ const characters = "abcdefghijklmnopqrstuvwxyz0123456789";
2
2
  export const randomString = (length) => {
3
- let value = '';
3
+ let value = "";
4
4
  for (let i = 0; i < length; i++) {
5
5
  value += characters.charAt(Math.floor(Math.random() * characters.length));
6
6
  }
@@ -1,7 +1,7 @@
1
- import fs from 'fs-extra';
2
- import git from 'isomorphic-git';
3
- import http from 'isomorphic-git/http/node';
4
- import nodeFs from 'node:fs';
1
+ import fs from "fs-extra";
2
+ import git from "isomorphic-git";
3
+ import http from "isomorphic-git/http/node";
4
+ import nodeFs from "node:fs";
5
5
  /**
6
6
  * Clones a git repository (shallow, depth=1) into targetDirectory and removes
7
7
  * the .git metadata afterwards, leaving only the working-tree files.
@@ -19,7 +19,7 @@ export const cloneRepository = async (url, targetDirectory) => {
19
19
  }
20
20
  catch (error) {
21
21
  console.error(error);
22
- throw new Error('Failed to download starter template.', { cause: error });
22
+ throw new Error("Failed to download starter template.", { cause: error });
23
23
  }
24
24
  // Remove git metadata so the project directory is a clean working tree
25
25
  await fs.remove(`${targetDirectory}/.git`);
@@ -1,2 +1,2 @@
1
- import type { ReadStream } from 'node:fs';
1
+ import type { ReadStream } from "node:fs";
2
2
  export declare const streamToBlob: (stream: ReadStream, mimeType?: string) => Promise<Blob>;
@@ -1,22 +1,22 @@
1
1
  export const streamToBlob = (stream, mimeType) => {
2
2
  return new Promise((resolve, reject) => {
3
3
  const chunks = [];
4
- stream.on('data', (chunk) => {
4
+ stream.on("data", (chunk) => {
5
5
  // ReadStream can emit either string or Buffer, ensure we have Buffer
6
- if (typeof chunk === 'string') {
6
+ if (typeof chunk === "string") {
7
7
  chunks.push(Buffer.from(chunk));
8
8
  }
9
9
  else {
10
10
  chunks.push(chunk);
11
11
  }
12
12
  });
13
- stream.on('end', () => {
13
+ stream.on("end", () => {
14
14
  // Concatenate all chunks into a single Buffer, then convert to Blob
15
15
  const buffer = Buffer.concat(chunks);
16
- const blob = new Blob([buffer], { type: mimeType || 'application/octet-stream' });
16
+ const blob = new Blob([buffer], { type: mimeType || "application/octet-stream" });
17
17
  resolve(blob);
18
18
  });
19
- stream.on('error', (error) => {
19
+ stream.on("error", (error) => {
20
20
  reject(error);
21
21
  });
22
22
  });