@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 +1 -1
- package/install.ps1 +1 -1
- package/install.sh +2 -2
- package/package.json +1 -1
- package/src/commands/init.js +1 -1
- package/src/commands/update.js +2 -2
- package/src/core/config.js +1 -1
- package/src/utils/github-actions.js +24 -10
package/README.md
CHANGED
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
package/src/commands/init.js
CHANGED
|
@@ -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
|
|
453
|
+
'DeployHub CLI source for GitHub Actions (github:user/repo or npm:@akash-chowdhury-24/deployhub):',
|
|
454
454
|
default: defaultCliRepo,
|
|
455
455
|
},
|
|
456
456
|
]);
|
package/src/commands/update.js
CHANGED
|
@@ -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
|
]);
|
package/src/core/config.js
CHANGED
|
@@ -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
|
-
|
|
41
|
-
|
|
52
|
+
const normalized = normalizeCliSource(cliSource);
|
|
53
|
+
if (normalized === DEFAULT_NPM_CLI_SOURCE) {
|
|
54
|
+
return `${NPM_PACKAGE}@latest`;
|
|
42
55
|
}
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
56
|
+
if (normalized.startsWith('github:')) {
|
|
57
|
+
return normalized;
|
|
45
58
|
}
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
59
|
+
if (normalized.startsWith('file:')) {
|
|
60
|
+
return normalized;
|
|
48
61
|
}
|
|
49
|
-
return
|
|
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 =
|
|
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 =
|
|
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
|
|
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 });
|