@akash-chowdhury-24/deployhub 1.0.0 → 1.0.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/README.md CHANGED
@@ -11,7 +11,7 @@ npm install -g @akash-chowdhury-24/deployhub
11
11
  Or use locally in your project:
12
12
 
13
13
  ```bash
14
- npm install deployhub
14
+ npm install @akash-chowdhury-24/deployhub
15
15
  npx @akash-chowdhury-24/deployhub init
16
16
  ```
17
17
 
package/install.ps1 CHANGED
@@ -50,6 +50,6 @@ try {
50
50
  }
51
51
  catch {
52
52
  Write-Host "Binary install failed ($($_.Exception.Message)). Falling back to npm..." -ForegroundColor Yellow
53
- npm install -g deployhub@latest
53
+ npm install -g @akash-chowdhury-24/deployhub@latest
54
54
  Write-Host "DeployHub installed via npm."
55
55
  }
package/install.sh CHANGED
@@ -50,7 +50,7 @@ fetch_latest_version() {
50
50
 
51
51
  if [ -z "$VERSION" ]; then
52
52
  echo "Could not determine latest release version. Falling back to npm install." >&2
53
- npm install -g deployhub@latest
53
+ npm install -g @akash-chowdhury-24/deployhub@latest
54
54
  echo "DeployHub installed via npm."
55
55
  exit 0
56
56
  fi
@@ -71,7 +71,7 @@ download_binary() {
71
71
  if [ ! -s "$TMP" ]; then
72
72
  echo "Binary download failed. Falling back to npm install." >&2
73
73
  rm -f "$TMP"
74
- npm install -g deployhub@latest
74
+ npm install -g @akash-chowdhury-24/deployhub@latest
75
75
  echo "DeployHub installed via npm."
76
76
  exit 0
77
77
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akash-chowdhury-24/deployhub",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Zero-configuration deployment and artifact manager",
5
5
  "type": "module",
6
6
  "main": "./src/cli/index.js",
@@ -450,7 +450,7 @@ export function registerInitCommand(program) {
450
450
  type: 'input',
451
451
  name: 'cliSource',
452
452
  message:
453
- 'DeployHub CLI source for GitHub Actions (github:user/repo or npm:deployhub):',
453
+ 'DeployHub CLI source for GitHub Actions (github:user/repo or npm:@akash-chowdhury-24/deployhub):',
454
454
  default: defaultCliRepo,
455
455
  },
456
456
  ]);
@@ -3,7 +3,7 @@ import inquirer from 'inquirer';
3
3
  import { execa } from 'execa';
4
4
  import semver from 'semver';
5
5
 
6
- const PACKAGE_NAME = 'deployhub';
6
+ const PACKAGE_NAME = '@akash-chowdhury-24/deployhub';
7
7
 
8
8
  /**
9
9
  * @param {import('commander').Command} program
@@ -43,7 +43,7 @@ export function registerUpdateCommand(program) {
43
43
  {
44
44
  type: 'confirm',
45
45
  name: 'confirm',
46
- message: `Install deployhub@${latest}?`,
46
+ message: `Install @akash-chowdhury-24/deployhub@${latest}?`,
47
47
  default: true,
48
48
  },
49
49
  ]);
@@ -81,7 +81,7 @@ const ConfigSchema = z.object({
81
81
  artifactRetention: z.number().default(10),
82
82
  cli: z
83
83
  .object({
84
- source: z.string().default('npm:deployhub'),
84
+ source: z.string().default('npm:@akash-chowdhury-24/deployhub'),
85
85
  })
86
86
  .default({}),
87
87
  });
@@ -32,21 +32,34 @@ const BACKEND_SSH_ENV_VARS = [
32
32
  'SSH_PORT',
33
33
  ];
34
34
 
35
+ const NPM_PACKAGE = '@akash-chowdhury-24/deployhub';
36
+ const DEFAULT_NPM_CLI_SOURCE = `npm:${NPM_PACKAGE}`;
37
+
38
+ /** @param {string} [cliSource] */
39
+ function normalizeCliSource(cliSource) {
40
+ if (!cliSource) return DEFAULT_NPM_CLI_SOURCE;
41
+ if (/^npm:(deployhub-cli|deploy-hub-cli|deployhub)$/.test(cliSource)) {
42
+ return DEFAULT_NPM_CLI_SOURCE;
43
+ }
44
+ return cliSource;
45
+ }
46
+
35
47
  /**
36
48
  * @param {string} cliSource
37
49
  * @returns {string}
38
50
  */
39
51
  export function getCliInstallSpec(cliSource) {
40
- if (!cliSource || cliSource === 'npm:deployhub') {
41
- return 'deployhub@latest';
52
+ const normalized = normalizeCliSource(cliSource);
53
+ if (normalized === DEFAULT_NPM_CLI_SOURCE) {
54
+ return `${NPM_PACKAGE}@latest`;
42
55
  }
43
- if (cliSource.startsWith('github:')) {
44
- return cliSource;
56
+ if (normalized.startsWith('github:')) {
57
+ return normalized;
45
58
  }
46
- if (cliSource.startsWith('file:')) {
47
- return cliSource;
59
+ if (normalized.startsWith('file:')) {
60
+ return normalized;
48
61
  }
49
- return cliSource;
62
+ return normalized;
50
63
  }
51
64
 
52
65
  /**
@@ -161,7 +174,7 @@ export function generateWorkflowYaml(
161
174
  storageProviders,
162
175
  deployEnvironments,
163
176
  environments,
164
- cliSource = 'npm:deployhub',
177
+ cliSource = DEFAULT_NPM_CLI_SOURCE,
165
178
  config = null
166
179
  ) {
167
180
  /** @type {Set<string>} */
@@ -287,7 +300,7 @@ export async function writeWorkflowFile(
287
300
  deployEnvironments,
288
301
  environments,
289
302
  cwd = process.cwd(),
290
- cliSource = 'npm:deployhub',
303
+ cliSource = DEFAULT_NPM_CLI_SOURCE,
291
304
  config = null
292
305
  ) {
293
306
  const workflowDir = path.join(cwd, '.github', 'workflows');
@@ -312,7 +325,8 @@ export async function addDeployhubToPackageJson(cliSource, cwd = process.cwd())
312
325
 
313
326
  const pkg = await fs.readJson(pkgPath);
314
327
  pkg.devDependencies = pkg.devDependencies || {};
315
- pkg.devDependencies.deployhub = getCliInstallSpec(cliSource);
328
+ pkg.devDependencies[NPM_PACKAGE] = getCliInstallSpec(cliSource);
329
+ delete pkg.devDependencies.deployhub;
316
330
  pkg.scripts = pkg.scripts || {};
317
331
  pkg.scripts['deployhub:build'] = 'deployhub build';
318
332
  await fs.writeJson(pkgPath, pkg, { spaces: 2 });