@akash-chowdhury-24/deployhub 1.0.10 → 1.0.12
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/package.json +1 -1
- package/src/commands/init.js +9 -30
- package/src/utils/github-actions.js +4 -3
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -15,10 +15,8 @@ import {
|
|
|
15
15
|
writeWorkflowFile,
|
|
16
16
|
getRequiredSecrets,
|
|
17
17
|
generateEnvExampleContent,
|
|
18
|
-
guessCliGithubRepo,
|
|
19
18
|
addDeployhubToPackageJson,
|
|
20
|
-
|
|
21
|
-
normalizeGithubCliSource,
|
|
19
|
+
DEFAULT_NPM_CLI_SOURCE,
|
|
22
20
|
} from '../utils/github-actions.js';
|
|
23
21
|
import {
|
|
24
22
|
promptPlatformQuestions,
|
|
@@ -365,7 +363,7 @@ export function registerInitCommand(program) {
|
|
|
365
363
|
const detectedFrontend = detectFrontend(cwd);
|
|
366
364
|
const detectedBackend = detectBackend(cwd);
|
|
367
365
|
const defaultName = path.basename(cwd) || 'my-app';
|
|
368
|
-
const
|
|
366
|
+
const cliSource = DEFAULT_NPM_CLI_SOURCE;
|
|
369
367
|
|
|
370
368
|
const { projectName } = await inquirer.prompt([
|
|
371
369
|
{
|
|
@@ -448,14 +446,6 @@ export function registerInitCommand(program) {
|
|
|
448
446
|
message: 'Configure deployment?',
|
|
449
447
|
default: false,
|
|
450
448
|
},
|
|
451
|
-
{
|
|
452
|
-
type: 'input',
|
|
453
|
-
name: 'cliSource',
|
|
454
|
-
message:
|
|
455
|
-
'DeployHub CLI source for GitHub Actions (github:user/repo or npm:@akash-chowdhury-24/deployhub):',
|
|
456
|
-
default: defaultCliRepo,
|
|
457
|
-
filter: (value) => normalizeGithubCliSource(value),
|
|
458
|
-
},
|
|
459
449
|
]);
|
|
460
450
|
|
|
461
451
|
/** @type {Record<string, Record<string, unknown>>} */
|
|
@@ -734,7 +724,7 @@ export function registerInitCommand(program) {
|
|
|
734
724
|
},
|
|
735
725
|
artifactRetention: 10,
|
|
736
726
|
cli: {
|
|
737
|
-
source:
|
|
727
|
+
source: cliSource,
|
|
738
728
|
},
|
|
739
729
|
};
|
|
740
730
|
|
|
@@ -752,13 +742,13 @@ export function registerInitCommand(program) {
|
|
|
752
742
|
}
|
|
753
743
|
|
|
754
744
|
await saveConfig(config, cwd);
|
|
755
|
-
await addDeployhubToPackageJson(
|
|
745
|
+
await addDeployhubToPackageJson(cliSource, cwd);
|
|
756
746
|
await writeWorkflowFile(
|
|
757
747
|
config.storage,
|
|
758
748
|
deploy,
|
|
759
749
|
environments,
|
|
760
750
|
cwd,
|
|
761
|
-
|
|
751
|
+
cliSource,
|
|
762
752
|
config
|
|
763
753
|
);
|
|
764
754
|
|
|
@@ -784,24 +774,13 @@ export function registerInitCommand(program) {
|
|
|
784
774
|
console.log(' • .env.example');
|
|
785
775
|
console.log('');
|
|
786
776
|
console.log(chalk.bold('Next steps:'));
|
|
787
|
-
|
|
788
|
-
console.log(
|
|
789
|
-
' 1. For a private DeployHub CLI repo, create a GitHub PAT with repo read access'
|
|
790
|
-
);
|
|
791
|
-
console.log(
|
|
792
|
-
` and add it as ${chalk.cyan('DEPLOYHUB_GITHUB_TOKEN')} in your demo project secrets`
|
|
793
|
-
);
|
|
794
|
-
console.log(' (public CLI repos can skip this — HTTPS is used automatically)');
|
|
795
|
-
} else {
|
|
796
|
-
console.log(' 1. Push the DeployHub CLI repo to GitHub (if using github: source)');
|
|
797
|
-
}
|
|
798
|
-
console.log(' 2. Copy .env.example to .env and fill in credentials');
|
|
777
|
+
console.log(' 1. Copy .env.example to .env and fill in credentials');
|
|
799
778
|
if (secrets.length > 0) {
|
|
800
|
-
console.log('
|
|
779
|
+
console.log(' 2. Add these secrets to GitHub (Settings → Secrets):');
|
|
801
780
|
secrets.forEach((s) => console.log(` • ${s}`));
|
|
802
781
|
}
|
|
803
|
-
console.log(` ${secrets.length > 0 ? '
|
|
804
|
-
console.log(` ${secrets.length > 0 ? '
|
|
782
|
+
console.log(` ${secrets.length > 0 ? '3' : '2'}. Run ${chalk.cyan('deployhub doctor')} to verify your setup`);
|
|
783
|
+
console.log(` ${secrets.length > 0 ? '4' : '3'}. Push to main — GitHub Actions will run ${chalk.cyan('deployhub build')} automatically`);
|
|
805
784
|
console.log('');
|
|
806
785
|
printAuthorFooter();
|
|
807
786
|
});
|
|
@@ -60,7 +60,7 @@ const ENV_VAR_DEFAULTS = {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
const NPM_PACKAGE = '@akash-chowdhury-24/deployhub';
|
|
63
|
-
const DEFAULT_NPM_CLI_SOURCE = `npm:${NPM_PACKAGE}`;
|
|
63
|
+
export const DEFAULT_NPM_CLI_SOURCE = `npm:${NPM_PACKAGE}`;
|
|
64
64
|
export const GITHUB_CLI_TOKEN_SECRET = 'DEPLOYHUB_GITHUB_TOKEN';
|
|
65
65
|
|
|
66
66
|
/**
|
|
@@ -128,11 +128,12 @@ export function getCliInstallSpec(cliSource) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
|
-
*
|
|
131
|
+
* Shell command to run deployhub build from the installed scoped package.
|
|
132
|
+
* Uses node directly so it works reliably when installed from a private GitHub repo.
|
|
132
133
|
* @returns {string}
|
|
133
134
|
*/
|
|
134
135
|
export function getCliBuildCommand() {
|
|
135
|
-
return `
|
|
136
|
+
return `node ./node_modules/${NPM_PACKAGE}/src/cli/index.js build`;
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
/**
|