-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add bundle project command to simplify agent-nodejs migration (#…
…689)
- Loading branch information
1 parent
cf806df
commit 47e9328
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import AbstractProjectCreateCommand from '../../../abstract-project-create-command'; | ||
import { optionsToFlags } from '../../../utils/option-parser'; | ||
import NosqlCommand from '../create/nosql'; | ||
|
||
export default class NoSqlBundleCommand extends NosqlCommand { | ||
/** @see https://oclif.io/docs/args */ | ||
static override readonly args = AbstractProjectCreateCommand.args; | ||
|
||
/** @see https://oclif.io/docs/flags */ | ||
static override readonly flags = optionsToFlags(this.options); | ||
|
||
static override description = 'Bundle files for Forest Admin project.'; | ||
|
||
protected override async runAuthenticated(): Promise<void> { | ||
const { appConfig, dbConfig, language } = await this.getConfig(); | ||
|
||
await this.testDatabaseConnection(dbConfig); | ||
|
||
await this.generateProject({ | ||
dbConfig, | ||
appConfig, | ||
forestAuthSecret: '<TO BE FILLED WITH FOREST INIT COMMAND RESULT>', | ||
forestEnvSecret: '<TO BE FILLED WITH FOREST INIT COMMAND RESULT>', | ||
language, | ||
}); | ||
|
||
this.logger.info(`Hooray, ${this.chalk.green('installation success')}!`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import AbstractProjectCreateCommand from '../../../abstract-project-create-command'; | ||
import { optionsToFlags } from '../../../utils/option-parser'; | ||
import SqlCommand from '../create/sql'; | ||
|
||
export default class SqlBundleCommand extends SqlCommand { | ||
/** @see https://oclif.io/docs/args */ | ||
static override readonly args = AbstractProjectCreateCommand.args; | ||
|
||
/** @see https://oclif.io/docs/flags */ | ||
static override readonly flags = optionsToFlags(this.options); | ||
|
||
static override description = 'Bundle files for Forest Admin project.'; | ||
|
||
protected override async runAuthenticated(): Promise<void> { | ||
const { appConfig, dbConfig, language } = await this.getConfig(); | ||
|
||
await this.testDatabaseConnection(dbConfig); | ||
|
||
await this.generateProject({ | ||
dbConfig, | ||
appConfig, | ||
forestAuthSecret: '<TO BE FILLED WITH FOREST INIT COMMAND RESULT>', | ||
forestEnvSecret: '<TO BE FILLED WITH FOREST INIT COMMAND RESULT>', | ||
language, | ||
}); | ||
|
||
this.logger.info(`Hooray, ${this.chalk.green('installation success')}!`); | ||
} | ||
} |