@hed-hog/cli 0.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/README.md +98 -0
- package/dist/scripts/deploy.d.ts +1 -0
- package/dist/scripts/deploy.js +84 -0
- package/dist/scripts/deploy.js.map +1 -0
- package/dist/src/app.module.d.ts +2 -0
- package/dist/src/app.module.js +58 -0
- package/dist/src/app.module.js.map +1 -0
- package/dist/src/commands/add.command.d.ts +14 -0
- package/dist/src/commands/add.command.js +58 -0
- package/dist/src/commands/add.command.js.map +1 -0
- package/dist/src/commands/dev.command/backupdb.subcommand.d.ts +10 -0
- package/dist/src/commands/dev.command/backupdb.subcommand.js +47 -0
- package/dist/src/commands/dev.command/backupdb.subcommand.js.map +1 -0
- package/dist/src/commands/dev.command/create-library.subcommand.d.ts +15 -0
- package/dist/src/commands/dev.command/create-library.subcommand.js +88 -0
- package/dist/src/commands/dev.command/create-library.subcommand.js.map +1 -0
- package/dist/src/commands/dev.command/hash-directory.subcommand.d.ts +12 -0
- package/dist/src/commands/dev.command/hash-directory.subcommand.js +70 -0
- package/dist/src/commands/dev.command/hash-directory.subcommand.js.map +1 -0
- package/dist/src/commands/dev.command/initdb.subcommand.d.ts +10 -0
- package/dist/src/commands/dev.command/initdb.subcommand.js +47 -0
- package/dist/src/commands/dev.command/initdb.subcommand.js.map +1 -0
- package/dist/src/commands/dev.command/reset.subcommand.d.ts +10 -0
- package/dist/src/commands/dev.command/reset.subcommand.js +47 -0
- package/dist/src/commands/dev.command/reset.subcommand.js.map +1 -0
- package/dist/src/commands/dev.command/restoredb.subcommand.d.ts +10 -0
- package/dist/src/commands/dev.command/restoredb.subcommand.js +47 -0
- package/dist/src/commands/dev.command/restoredb.subcommand.js.map +1 -0
- package/dist/src/commands/dev.command/route.subcommand.d.ts +10 -0
- package/dist/src/commands/dev.command/route.subcommand.js +47 -0
- package/dist/src/commands/dev.command/route.subcommand.js.map +1 -0
- package/dist/src/commands/dev.command/tsconfig.subcommand.d.ts +10 -0
- package/dist/src/commands/dev.command/tsconfig.subcommand.js +47 -0
- package/dist/src/commands/dev.command/tsconfig.subcommand.js.map +1 -0
- package/dist/src/commands/dev.command.d.ts +4 -0
- package/dist/src/commands/dev.command.js +40 -0
- package/dist/src/commands/dev.command.js.map +1 -0
- package/dist/src/commands/new.command.d.ts +43 -0
- package/dist/src/commands/new.command.js +436 -0
- package/dist/src/commands/new.command.js.map +1 -0
- package/dist/src/functions/to-pascal-case.d.ts +1 -0
- package/dist/src/functions/to-pascal-case.js +10 -0
- package/dist/src/functions/to-pascal-case.js.map +1 -0
- package/dist/src/main.d.ts +2 -0
- package/dist/src/main.js +10 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/modules/database/database.module.d.ts +2 -0
- package/dist/src/modules/database/database.module.js +22 -0
- package/dist/src/modules/database/database.module.js.map +1 -0
- package/dist/src/modules/database/database.service.d.ts +14 -0
- package/dist/src/modules/database/database.service.js +186 -0
- package/dist/src/modules/database/database.service.js.map +1 -0
- package/dist/src/modules/developer/developer.module.d.ts +2 -0
- package/dist/src/modules/developer/developer.module.js +22 -0
- package/dist/src/modules/developer/developer.module.js.map +1 -0
- package/dist/src/modules/developer/developer.service.d.ts +37 -0
- package/dist/src/modules/developer/developer.service.js +900 -0
- package/dist/src/modules/developer/developer.service.js.map +1 -0
- package/dist/src/modules/git/git.module.d.ts +2 -0
- package/dist/src/modules/git/git.module.js +23 -0
- package/dist/src/modules/git/git.module.js.map +1 -0
- package/dist/src/modules/git/git.service.d.ts +8 -0
- package/dist/src/modules/git/git.service.js +67 -0
- package/dist/src/modules/git/git.service.js.map +1 -0
- package/dist/src/modules/hedhog/hedhog.module.d.ts +2 -0
- package/dist/src/modules/hedhog/hedhog.module.js +41 -0
- package/dist/src/modules/hedhog/hedhog.module.js.map +1 -0
- package/dist/src/modules/hedhog/hedhog.service.d.ts +44 -0
- package/dist/src/modules/hedhog/hedhog.service.js +350 -0
- package/dist/src/modules/hedhog/hedhog.service.js.map +1 -0
- package/dist/src/modules/hedhog/services/file-system.service.d.ts +22 -0
- package/dist/src/modules/hedhog/services/file-system.service.js +230 -0
- package/dist/src/modules/hedhog/services/file-system.service.js.map +1 -0
- package/dist/src/modules/hedhog/services/migration.service.d.ts +39 -0
- package/dist/src/modules/hedhog/services/migration.service.js +767 -0
- package/dist/src/modules/hedhog/services/migration.service.js.map +1 -0
- package/dist/src/modules/hedhog/services/module.service.d.ts +10 -0
- package/dist/src/modules/hedhog/services/module.service.js +135 -0
- package/dist/src/modules/hedhog/services/module.service.js.map +1 -0
- package/dist/src/modules/hedhog/services/table.service.d.ts +49 -0
- package/dist/src/modules/hedhog/services/table.service.js +432 -0
- package/dist/src/modules/hedhog/services/table.service.js.map +1 -0
- package/dist/src/modules/hedhog/services/template.service.d.ts +13 -0
- package/dist/src/modules/hedhog/services/template.service.js +88 -0
- package/dist/src/modules/hedhog/services/template.service.js.map +1 -0
- package/dist/src/modules/package/package.module.d.ts +2 -0
- package/dist/src/modules/package/package.module.js +23 -0
- package/dist/src/modules/package/package.module.js.map +1 -0
- package/dist/src/modules/package/package.service.d.ts +9 -0
- package/dist/src/modules/package/package.service.js +94 -0
- package/dist/src/modules/package/package.service.js.map +1 -0
- package/dist/src/modules/runner/runner.module.d.ts +2 -0
- package/dist/src/modules/runner/runner.module.js +23 -0
- package/dist/src/modules/runner/runner.module.js.map +1 -0
- package/dist/src/modules/runner/runner.service.d.ts +14 -0
- package/dist/src/modules/runner/runner.service.js +69 -0
- package/dist/src/modules/runner/runner.service.js.map +1 -0
- package/dist/src/questions/database.question.d.ts +12 -0
- package/dist/src/questions/database.question.js +61 -0
- package/dist/src/questions/database.question.js.map +1 -0
- package/dist/src/questions/project-name.question.d.ts +3 -0
- package/dist/src/questions/project-name.question.js +34 -0
- package/dist/src/questions/project-name.question.js.map +1 -0
- package/dist/templates/database/touch_updated_at.sql.ejs +9 -0
- package/dist/templates/database/trg_touch_updated_at.sql.ejs +2 -0
- package/dist/templates/library/.eslintrc.js.ejs +9 -0
- package/dist/templates/library/.prettierrc.js.ejs +4 -0
- package/dist/templates/library/index.ts.ejs +1 -0
- package/dist/templates/library/init.app.module.ts.ejs +25 -0
- package/dist/templates/library/init.package.json.ejs +61 -0
- package/dist/templates/library/module.ts.ejs +15 -0
- package/dist/templates/library/package.json.ejs +36 -0
- package/dist/templates/library/tsconfig.json.ejs +11 -0
- package/dist/templates/library/tsconfig.production.json.ejs +46 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +104 -0
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
|
6
|
+
[circleci-url]: https://circleci.com/gh/nestjs/nest
|
|
7
|
+
|
|
8
|
+
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
|
|
11
|
+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
|
|
12
|
+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
|
|
13
|
+
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
|
|
14
|
+
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
|
|
15
|
+
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
|
16
|
+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
|
17
|
+
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
|
|
18
|
+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
|
|
19
|
+
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
|
|
20
|
+
</p>
|
|
21
|
+
<!--[](https://opencollective.com/nest#backer)
|
|
22
|
+
[](https://opencollective.com/nest#sponsor)-->
|
|
23
|
+
|
|
24
|
+
## Description
|
|
25
|
+
|
|
26
|
+
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
|
|
27
|
+
|
|
28
|
+
## Project setup
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
$ npm install
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Compile and run the project
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# development
|
|
38
|
+
$ npm run start
|
|
39
|
+
|
|
40
|
+
# watch mode
|
|
41
|
+
$ npm run start:dev
|
|
42
|
+
|
|
43
|
+
# production mode
|
|
44
|
+
$ npm run start:prod
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Run tests
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# unit tests
|
|
51
|
+
$ npm run test
|
|
52
|
+
|
|
53
|
+
# e2e tests
|
|
54
|
+
$ npm run test:e2e
|
|
55
|
+
|
|
56
|
+
# test coverage
|
|
57
|
+
$ npm run test:cov
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Deployment
|
|
61
|
+
|
|
62
|
+
When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information.
|
|
63
|
+
|
|
64
|
+
If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
$ npm install -g @nestjs/mau
|
|
68
|
+
$ mau deploy
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
|
|
72
|
+
|
|
73
|
+
## Resources
|
|
74
|
+
|
|
75
|
+
Check out a few resources that may come in handy when working with NestJS:
|
|
76
|
+
|
|
77
|
+
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
|
|
78
|
+
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
|
|
79
|
+
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
|
|
80
|
+
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
|
|
81
|
+
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
|
|
82
|
+
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
|
|
83
|
+
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
|
|
84
|
+
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
|
|
85
|
+
|
|
86
|
+
## Support
|
|
87
|
+
|
|
88
|
+
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
|
89
|
+
|
|
90
|
+
## Stay in touch
|
|
91
|
+
|
|
92
|
+
- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
|
|
93
|
+
- Website - [https://nestjs.com](https://nestjs.com/)
|
|
94
|
+
- Twitter - [@nestframework](https://twitter.com/nestframework)
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const child_process_1 = require("child_process");
|
|
4
|
+
/**
|
|
5
|
+
* Runs the given command and throws an error if it fails.
|
|
6
|
+
*
|
|
7
|
+
* @param command The command to run.
|
|
8
|
+
* @returns The result of running the command.
|
|
9
|
+
*/
|
|
10
|
+
function runCommand(command) {
|
|
11
|
+
try {
|
|
12
|
+
return (0, child_process_1.execSync)(command, { stdio: 'inherit' });
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
console.error(`Error executing command: ${command}`);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Deploy the CLI to the production branch.
|
|
21
|
+
*
|
|
22
|
+
* This command verifies that there are no uncommitted changes in the
|
|
23
|
+
* repository, and then performs the following steps:
|
|
24
|
+
*
|
|
25
|
+
* 1. Pulls the latest changes from the "main" branch of the remote
|
|
26
|
+
* repository.
|
|
27
|
+
* 2. Pushes the latest changes to the "main" branch of the remote
|
|
28
|
+
* repository.
|
|
29
|
+
* 3. Creates a new version of the CLI using "npm version patch", which
|
|
30
|
+
* increments the patch version and creates a new version tag.
|
|
31
|
+
* 4. Verifies that the "production" branch exists, and creates it if it
|
|
32
|
+
* doesn't.
|
|
33
|
+
* 5. Pulls the latest changes from the "main" branch of the remote
|
|
34
|
+
* repository.
|
|
35
|
+
* 6. Pushes the latest changes to the "main" branch of the remote
|
|
36
|
+
* repository.
|
|
37
|
+
* 7. Checks out the "production" branch.
|
|
38
|
+
* 8. Merges the "main" branch into the "production" branch.
|
|
39
|
+
* 9. Pushes the latest changes to the "production" branch of the remote
|
|
40
|
+
* repository.
|
|
41
|
+
* 10. Checks out the "main" branch again.
|
|
42
|
+
*
|
|
43
|
+
* After completing these steps, the command prints a success message and
|
|
44
|
+
* exits with a status code of 0.
|
|
45
|
+
*
|
|
46
|
+
* If any of the above steps fail, the command prints an error message and
|
|
47
|
+
* exits with a non-zero status code.
|
|
48
|
+
*/
|
|
49
|
+
function main() {
|
|
50
|
+
try {
|
|
51
|
+
const gitStatus = (0, child_process_1.execSync)('git status -s').toString().trim();
|
|
52
|
+
if (gitStatus) {
|
|
53
|
+
console.error('❌ O repositório possui arquivos não commitados. Por favor, realize o commit e tente novamente.');
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
const gitLog = (0, child_process_1.execSync)('git log origin/main..main').toString().trim();
|
|
57
|
+
if (gitLog) {
|
|
58
|
+
runCommand('git pull origin main');
|
|
59
|
+
runCommand('git push origin main');
|
|
60
|
+
}
|
|
61
|
+
runCommand('npm version patch');
|
|
62
|
+
const branches = (0, child_process_1.execSync)('git branch')
|
|
63
|
+
.toString()
|
|
64
|
+
.trim()
|
|
65
|
+
.split('\n')
|
|
66
|
+
.map((branch) => branch.replace('*', '').trim());
|
|
67
|
+
if (!branches.includes('production')) {
|
|
68
|
+
runCommand('git branch production');
|
|
69
|
+
}
|
|
70
|
+
runCommand('git pull origin main');
|
|
71
|
+
runCommand('git push origin main');
|
|
72
|
+
runCommand('git checkout production');
|
|
73
|
+
runCommand('git merge main');
|
|
74
|
+
runCommand('git push origin production');
|
|
75
|
+
runCommand('git checkout main');
|
|
76
|
+
console.info('✅ Deploy realizado com sucesso!');
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
console.error('An error occurred during deployment:', error);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
main();
|
|
84
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../scripts/deploy.ts"],"names":[],"mappings":";;AAAA,iDAAyC;AAEzC;;;;;GAKG;AACH,SAAS,UAAU,CAAC,OAAe;IACjC,IAAI,CAAC;QACH,OAAO,IAAA,wBAAQ,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,OAAO,EAAE,CAAC,CAAC;QACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAS,IAAI;IACX,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,IAAA,wBAAQ,EAAC,eAAe,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;QAE9D,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CACX,gGAAgG,CACjG,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,2BAA2B,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;QAEvE,IAAI,MAAM,EAAE,CAAC;YACX,UAAU,CAAC,sBAAsB,CAAC,CAAC;YACnC,UAAU,CAAC,sBAAsB,CAAC,CAAC;QACrC,CAAC;QAED,UAAU,CAAC,mBAAmB,CAAC,CAAC;QAEhC,MAAM,QAAQ,GAAG,IAAA,wBAAQ,EAAC,YAAY,CAAC;aACpC,QAAQ,EAAE;aACV,IAAI,EAAE;aACN,KAAK,CAAC,IAAI,CAAC;aACX,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAEnD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACrC,UAAU,CAAC,uBAAuB,CAAC,CAAC;QACtC,CAAC;QAED,UAAU,CAAC,sBAAsB,CAAC,CAAC;QACnC,UAAU,CAAC,sBAAsB,CAAC,CAAC;QACnC,UAAU,CAAC,yBAAyB,CAAC,CAAC;QACtC,UAAU,CAAC,gBAAgB,CAAC,CAAC;QAC7B,UAAU,CAAC,4BAA4B,CAAC,CAAC;QACzC,UAAU,CAAC,mBAAmB,CAAC,CAAC;QAEhC,OAAO,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AppModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const add_command_1 = require("./commands/add.command");
|
|
12
|
+
const dev_command_1 = require("./commands/dev.command");
|
|
13
|
+
const backupdb_subcommand_1 = require("./commands/dev.command/backupdb.subcommand");
|
|
14
|
+
const create_library_subcommand_1 = require("./commands/dev.command/create-library.subcommand");
|
|
15
|
+
const hash_directory_subcommand_1 = require("./commands/dev.command/hash-directory.subcommand");
|
|
16
|
+
const initdb_subcommand_1 = require("./commands/dev.command/initdb.subcommand");
|
|
17
|
+
const reset_subcommand_1 = require("./commands/dev.command/reset.subcommand");
|
|
18
|
+
const restoredb_subcommand_1 = require("./commands/dev.command/restoredb.subcommand");
|
|
19
|
+
const route_subcommand_1 = require("./commands/dev.command/route.subcommand");
|
|
20
|
+
const tsconfig_subcommand_1 = require("./commands/dev.command/tsconfig.subcommand");
|
|
21
|
+
const new_command_1 = require("./commands/new.command");
|
|
22
|
+
const database_module_1 = require("./modules/database/database.module");
|
|
23
|
+
const developer_module_1 = require("./modules/developer/developer.module");
|
|
24
|
+
const git_module_1 = require("./modules/git/git.module");
|
|
25
|
+
const hedhog_module_1 = require("./modules/hedhog/hedhog.module");
|
|
26
|
+
const package_module_1 = require("./modules/package/package.module");
|
|
27
|
+
const runner_module_1 = require("./modules/runner/runner.module");
|
|
28
|
+
const project_name_question_1 = require("./questions/project-name.question");
|
|
29
|
+
let AppModule = class AppModule {
|
|
30
|
+
};
|
|
31
|
+
exports.AppModule = AppModule;
|
|
32
|
+
exports.AppModule = AppModule = __decorate([
|
|
33
|
+
(0, common_1.Module)({
|
|
34
|
+
imports: [
|
|
35
|
+
runner_module_1.RunnerModule,
|
|
36
|
+
package_module_1.PackageModule,
|
|
37
|
+
git_module_1.GitModule,
|
|
38
|
+
hedhog_module_1.HedHogModule,
|
|
39
|
+
database_module_1.DatabaseModule,
|
|
40
|
+
developer_module_1.DeveloperModule,
|
|
41
|
+
],
|
|
42
|
+
providers: [
|
|
43
|
+
new_command_1.NewCommand,
|
|
44
|
+
add_command_1.AddCommand,
|
|
45
|
+
project_name_question_1.ProjectNameQuestion,
|
|
46
|
+
dev_command_1.DevCommand,
|
|
47
|
+
tsconfig_subcommand_1.TsconfigCommand,
|
|
48
|
+
hash_directory_subcommand_1.HashDirectoryCommand,
|
|
49
|
+
create_library_subcommand_1.CreateLibraryCommand,
|
|
50
|
+
reset_subcommand_1.ResetCommand,
|
|
51
|
+
backupdb_subcommand_1.BackupDbCommand,
|
|
52
|
+
route_subcommand_1.RouteCommand,
|
|
53
|
+
initdb_subcommand_1.InitDbCommand,
|
|
54
|
+
restoredb_subcommand_1.RestoreDbCommand,
|
|
55
|
+
],
|
|
56
|
+
})
|
|
57
|
+
], AppModule);
|
|
58
|
+
//# sourceMappingURL=app.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,wDAAoD;AACpD,wDAAoD;AACpD,oFAA6E;AAC7E,gGAAwF;AACxF,gGAAwF;AACxF,gFAAyE;AACzE,8EAAuE;AACvE,sFAA+E;AAC/E,8EAAuE;AACvE,oFAA6E;AAC7E,wDAAoD;AACpD,wEAAoE;AACpE,2EAAuE;AACvE,yDAAqD;AACrD,kEAA8D;AAC9D,qEAAiE;AACjE,kEAA8D;AAC9D,6EAAwE;AA0BjE,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAxBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,4BAAY;YACZ,8BAAa;YACb,sBAAS;YACT,4BAAY;YACZ,gCAAc;YACd,kCAAe;SAChB;QACD,SAAS,EAAE;YACT,wBAAU;YACV,wBAAU;YACV,2CAAmB;YACnB,wBAAU;YACV,qCAAe;YACf,gDAAoB;YACpB,gDAAoB;YACpB,+BAAY;YACZ,qCAAe;YACf,+BAAY;YACZ,iCAAa;YACb,uCAAgB;SACjB;KACF,CAAC;GACW,SAAS,CAAG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CommandRunner } from 'nest-commander';
|
|
2
|
+
import { HedHogService } from 'src/modules/hedhog/hedhog.service';
|
|
3
|
+
type Options = {
|
|
4
|
+
verbose?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare class AddCommand extends CommandRunner {
|
|
7
|
+
private readonly hedhog;
|
|
8
|
+
private verbose;
|
|
9
|
+
constructor(hedhog: HedHogService);
|
|
10
|
+
log(...args: any[]): Promise<void>;
|
|
11
|
+
run(args: string[], { verbose }: Options): Promise<void>;
|
|
12
|
+
parseVerbose(): boolean;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AddCommand = void 0;
|
|
13
|
+
const nest_commander_1 = require("nest-commander");
|
|
14
|
+
const hedhog_service_1 = require("../modules/hedhog/hedhog.service");
|
|
15
|
+
let AddCommand = class AddCommand extends nest_commander_1.CommandRunner {
|
|
16
|
+
hedhog;
|
|
17
|
+
verbose = false;
|
|
18
|
+
constructor(hedhog) {
|
|
19
|
+
super();
|
|
20
|
+
this.hedhog = hedhog;
|
|
21
|
+
}
|
|
22
|
+
async log(...args) {
|
|
23
|
+
if (this.verbose) {
|
|
24
|
+
console.log(`\n`, ...args);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async run(args, { verbose = false }) {
|
|
28
|
+
this.verbose = verbose;
|
|
29
|
+
for (const arg of args) {
|
|
30
|
+
await this.hedhog.add(arg, verbose);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
parseVerbose() {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.AddCommand = AddCommand;
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, nest_commander_1.Option)({
|
|
40
|
+
flags: '-v, --verbose',
|
|
41
|
+
description: 'Enable verbose output',
|
|
42
|
+
defaultValue: false,
|
|
43
|
+
name: 'verbose',
|
|
44
|
+
}),
|
|
45
|
+
__metadata("design:type", Function),
|
|
46
|
+
__metadata("design:paramtypes", []),
|
|
47
|
+
__metadata("design:returntype", Boolean)
|
|
48
|
+
], AddCommand.prototype, "parseVerbose", null);
|
|
49
|
+
exports.AddCommand = AddCommand = __decorate([
|
|
50
|
+
(0, nest_commander_1.Command)({
|
|
51
|
+
name: 'add',
|
|
52
|
+
description: 'Add a new feature or module to the project',
|
|
53
|
+
aliases: ['a'],
|
|
54
|
+
arguments: '[...name]',
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:paramtypes", [hedhog_service_1.HedHogService])
|
|
57
|
+
], AddCommand);
|
|
58
|
+
//# sourceMappingURL=add.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.command.js","sourceRoot":"","sources":["../../../src/commands/add.command.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAgE;AAChE,qEAAkE;AAa3D,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,8BAAa;IAGd;IAFrB,OAAO,GAAY,KAAK,CAAC;IAEjC,YAA6B,MAAqB;QAChD,KAAK,EAAE,CAAC;QADmB,WAAM,GAAN,MAAM,CAAe;IAElD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI;QACf,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAc,EAAE,EAAE,OAAO,GAAG,KAAK,EAAW;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAQD,YAAY;QACV,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AA9BY,gCAAU;AA2BrB;IANC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,uBAAuB;QACpC,YAAY,EAAE,KAAK;QACnB,IAAI,EAAE,SAAS;KAChB,CAAC;;;;8CAGD;qBA7BU,UAAU;IANtB,IAAA,wBAAO,EAAC;QACP,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,4CAA4C;QACzD,OAAO,EAAE,CAAC,GAAG,CAAC;QACd,SAAS,EAAE,WAAW;KACvB,CAAC;qCAIqC,8BAAa;GAHvC,UAAU,CA8BtB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommandRunner } from 'nest-commander';
|
|
2
|
+
import { DeveloperService } from 'src/modules/developer/developer.service';
|
|
3
|
+
export declare class BackupDbCommand extends CommandRunner {
|
|
4
|
+
private readonly developer;
|
|
5
|
+
constructor(developer: DeveloperService);
|
|
6
|
+
run([]: Iterable<any, void, undefined>, { verbose }: {
|
|
7
|
+
verbose: any;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
parseVerboseOption(): boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BackupDbCommand = void 0;
|
|
13
|
+
const nest_commander_1 = require("nest-commander");
|
|
14
|
+
const developer_service_1 = require("../../modules/developer/developer.service");
|
|
15
|
+
let BackupDbCommand = class BackupDbCommand extends nest_commander_1.CommandRunner {
|
|
16
|
+
developer;
|
|
17
|
+
constructor(developer) {
|
|
18
|
+
super();
|
|
19
|
+
this.developer = developer;
|
|
20
|
+
}
|
|
21
|
+
async run([], { verbose }) {
|
|
22
|
+
return this.developer.backupDatabase(process.cwd(), verbose);
|
|
23
|
+
}
|
|
24
|
+
parseVerboseOption() {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.BackupDbCommand = BackupDbCommand;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, nest_commander_1.Option)({
|
|
31
|
+
flags: '-v, --verbose',
|
|
32
|
+
description: 'Enable verbose output',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
__metadata("design:type", Function),
|
|
36
|
+
__metadata("design:paramtypes", []),
|
|
37
|
+
__metadata("design:returntype", Boolean)
|
|
38
|
+
], BackupDbCommand.prototype, "parseVerboseOption", null);
|
|
39
|
+
exports.BackupDbCommand = BackupDbCommand = __decorate([
|
|
40
|
+
(0, nest_commander_1.SubCommand)({
|
|
41
|
+
name: 'backupdb',
|
|
42
|
+
aliases: ['bdb'],
|
|
43
|
+
description: 'Backup the development database',
|
|
44
|
+
}),
|
|
45
|
+
__metadata("design:paramtypes", [developer_service_1.DeveloperService])
|
|
46
|
+
], BackupDbCommand);
|
|
47
|
+
//# sourceMappingURL=backupdb.subcommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backupdb.subcommand.js","sourceRoot":"","sources":["../../../../src/commands/dev.command/backupdb.subcommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAmE;AACnE,iFAA2E;AAOpE,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,8BAAa;IACnB;IAA7B,YAA6B,SAA2B;QACtD,KAAK,EAAE,CAAC;QADmB,cAAS,GAAT,SAAS,CAAkB;IAExD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE;QACvB,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAOD,kBAAkB;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAjBY,0CAAe;AAc1B;IALC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,uBAAuB;QACpC,QAAQ,EAAE,KAAK;KAChB,CAAC;;;;yDAGD;0BAhBU,eAAe;IAL3B,IAAA,2BAAU,EAAC;QACV,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,CAAC,KAAK,CAAC;QAChB,WAAW,EAAE,iCAAiC;KAC/C,CAAC;qCAEwC,oCAAgB;GAD7C,eAAe,CAiB3B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CommandRunner } from 'nest-commander';
|
|
2
|
+
import { DeveloperService } from 'src/modules/developer/developer.service';
|
|
3
|
+
export declare class CreateLibraryCommand extends CommandRunner {
|
|
4
|
+
private readonly developer;
|
|
5
|
+
constructor(developer: DeveloperService);
|
|
6
|
+
run([name]: [any], { force, verbose, skipInstall }: {
|
|
7
|
+
force: any;
|
|
8
|
+
verbose: any;
|
|
9
|
+
skipInstall: any;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
parseOption(name: string): string;
|
|
12
|
+
parseForceOption(): boolean;
|
|
13
|
+
parseVerboseOption(): boolean;
|
|
14
|
+
parseSkipINstall(): boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreateLibraryCommand = void 0;
|
|
13
|
+
const nest_commander_1 = require("nest-commander");
|
|
14
|
+
const developer_service_1 = require("../../modules/developer/developer.service");
|
|
15
|
+
let CreateLibraryCommand = class CreateLibraryCommand extends nest_commander_1.CommandRunner {
|
|
16
|
+
developer;
|
|
17
|
+
constructor(developer) {
|
|
18
|
+
super();
|
|
19
|
+
this.developer = developer;
|
|
20
|
+
}
|
|
21
|
+
async run([name], { force, verbose, skipInstall }) {
|
|
22
|
+
return this.developer.createLibrary(process.cwd(), name, force, verbose, skipInstall);
|
|
23
|
+
}
|
|
24
|
+
parseOption(name) {
|
|
25
|
+
return name;
|
|
26
|
+
}
|
|
27
|
+
parseForceOption() {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
parseVerboseOption() {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
parseSkipINstall() {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.CreateLibraryCommand = CreateLibraryCommand;
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, nest_commander_1.Option)({
|
|
40
|
+
flags: '-n, --name <name>',
|
|
41
|
+
description: 'Name of the library to create',
|
|
42
|
+
required: false,
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", Function),
|
|
45
|
+
__metadata("design:paramtypes", [String]),
|
|
46
|
+
__metadata("design:returntype", String)
|
|
47
|
+
], CreateLibraryCommand.prototype, "parseOption", null);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, nest_commander_1.Option)({
|
|
50
|
+
flags: '-f, --force',
|
|
51
|
+
description: 'Force creation even if the library already exists',
|
|
52
|
+
required: false,
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", Function),
|
|
55
|
+
__metadata("design:paramtypes", []),
|
|
56
|
+
__metadata("design:returntype", Boolean)
|
|
57
|
+
], CreateLibraryCommand.prototype, "parseForceOption", null);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, nest_commander_1.Option)({
|
|
60
|
+
flags: '-v, --verbose',
|
|
61
|
+
description: 'Enable verbose output',
|
|
62
|
+
required: false,
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", Function),
|
|
65
|
+
__metadata("design:paramtypes", []),
|
|
66
|
+
__metadata("design:returntype", Boolean)
|
|
67
|
+
], CreateLibraryCommand.prototype, "parseVerboseOption", null);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, nest_commander_1.Option)({
|
|
70
|
+
flags: '-s, --skip-install',
|
|
71
|
+
description: 'Skip installation of dependencies',
|
|
72
|
+
defaultValue: false,
|
|
73
|
+
name: 'skipInstall',
|
|
74
|
+
}),
|
|
75
|
+
__metadata("design:type", Function),
|
|
76
|
+
__metadata("design:paramtypes", []),
|
|
77
|
+
__metadata("design:returntype", Boolean)
|
|
78
|
+
], CreateLibraryCommand.prototype, "parseSkipINstall", null);
|
|
79
|
+
exports.CreateLibraryCommand = CreateLibraryCommand = __decorate([
|
|
80
|
+
(0, nest_commander_1.SubCommand)({
|
|
81
|
+
name: 'create-library',
|
|
82
|
+
aliases: ['cl'],
|
|
83
|
+
description: 'Create a new library in the current workspace',
|
|
84
|
+
arguments: '[name]',
|
|
85
|
+
}),
|
|
86
|
+
__metadata("design:paramtypes", [developer_service_1.DeveloperService])
|
|
87
|
+
], CreateLibraryCommand);
|
|
88
|
+
//# sourceMappingURL=create-library.subcommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-library.subcommand.js","sourceRoot":"","sources":["../../../../src/commands/dev.command/create-library.subcommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAmE;AACnE,iFAA2E;AAQpE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,8BAAa;IACxB;IAA7B,YAA6B,SAA2B;QACtD,KAAK,EAAE,CAAC;QADmB,cAAS,GAAT,SAAS,CAAkB;IAExD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE;QAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CACjC,OAAO,CAAC,GAAG,EAAE,EACb,IAAI,EACJ,KAAK,EACL,OAAO,EACP,WAAW,CACZ,CAAC;IACJ,CAAC;IAOD,WAAW,CAAC,IAAY;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAOD,gBAAgB;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAOD,kBAAkB;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAQD,gBAAgB;QACd,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAnDY,oDAAoB;AAoB/B;IALC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,+BAA+B;QAC5C,QAAQ,EAAE,KAAK;KAChB,CAAC;;;;uDAGD;AAOD;IALC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,mDAAmD;QAChE,QAAQ,EAAE,KAAK;KAChB,CAAC;;;;4DAGD;AAOD;IALC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,uBAAuB;QACpC,QAAQ,EAAE,KAAK;KAChB,CAAC;;;;8DAGD;AAQD;IANC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,mCAAmC;QAChD,YAAY,EAAE,KAAK;QACnB,IAAI,EAAE,aAAa;KACpB,CAAC;;;;4DAGD;+BAlDU,oBAAoB;IANhC,IAAA,2BAAU,EAAC;QACV,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,CAAC,IAAI,CAAC;QACf,WAAW,EAAE,+CAA+C;QAC5D,SAAS,EAAE,QAAQ;KACpB,CAAC;qCAEwC,oCAAgB;GAD7C,oBAAoB,CAmDhC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CommandRunner } from 'nest-commander';
|
|
2
|
+
import { DeveloperService } from 'src/modules/developer/developer.service';
|
|
3
|
+
export declare class HashDirectoryCommand extends CommandRunner {
|
|
4
|
+
private readonly developer;
|
|
5
|
+
constructor(developer: DeveloperService);
|
|
6
|
+
run(_: any, { path, silent }: {
|
|
7
|
+
path: any;
|
|
8
|
+
silent: any;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
parsePath(path: string): string;
|
|
11
|
+
parseSilent(): boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HashDirectoryCommand = void 0;
|
|
13
|
+
const nest_commander_1 = require("nest-commander");
|
|
14
|
+
const path_1 = require("path");
|
|
15
|
+
const developer_service_1 = require("../../modules/developer/developer.service");
|
|
16
|
+
const ora = require("ora");
|
|
17
|
+
let HashDirectoryCommand = class HashDirectoryCommand extends nest_commander_1.CommandRunner {
|
|
18
|
+
developer;
|
|
19
|
+
constructor(developer) {
|
|
20
|
+
super();
|
|
21
|
+
this.developer = developer;
|
|
22
|
+
}
|
|
23
|
+
async run(_, { path, silent }) {
|
|
24
|
+
if (silent) {
|
|
25
|
+
const hash = await this.developer.hashDirectory(path);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const spinner = ora().start(`Hashing directory: ${path}`);
|
|
29
|
+
const hash = await this.developer.hashDirectory(path);
|
|
30
|
+
spinner.succeed(`Directory hashed successfully.`);
|
|
31
|
+
spinner.info(hash);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
parsePath(path) {
|
|
35
|
+
return (0, path_1.resolve)(path);
|
|
36
|
+
}
|
|
37
|
+
parseSilent() {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.HashDirectoryCommand = HashDirectoryCommand;
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, nest_commander_1.Option)({
|
|
44
|
+
flags: '-p, --path <path>',
|
|
45
|
+
description: 'Path to the directory to hash',
|
|
46
|
+
defaultValue: process.cwd(),
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", Function),
|
|
49
|
+
__metadata("design:paramtypes", [String]),
|
|
50
|
+
__metadata("design:returntype", String)
|
|
51
|
+
], HashDirectoryCommand.prototype, "parsePath", null);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, nest_commander_1.Option)({
|
|
54
|
+
description: 'Silent mode, no output except the hash',
|
|
55
|
+
flags: '-s, --silent',
|
|
56
|
+
defaultValue: false,
|
|
57
|
+
}),
|
|
58
|
+
__metadata("design:type", Function),
|
|
59
|
+
__metadata("design:paramtypes", []),
|
|
60
|
+
__metadata("design:returntype", Boolean)
|
|
61
|
+
], HashDirectoryCommand.prototype, "parseSilent", null);
|
|
62
|
+
exports.HashDirectoryCommand = HashDirectoryCommand = __decorate([
|
|
63
|
+
(0, nest_commander_1.SubCommand)({
|
|
64
|
+
name: 'hash-directory',
|
|
65
|
+
aliases: ['hd'],
|
|
66
|
+
description: 'Hash the current directory',
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:paramtypes", [developer_service_1.DeveloperService])
|
|
69
|
+
], HashDirectoryCommand);
|
|
70
|
+
//# sourceMappingURL=hash-directory.subcommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash-directory.subcommand.js","sourceRoot":"","sources":["../../../../src/commands/dev.command/hash-directory.subcommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAmE;AACnE,+BAA+B;AAC/B,iFAA2E;AAC3E,2BAA2B;AAOpB,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,8BAAa;IACxB;IAA7B,YAA6B,SAA2B;QACtD,KAAK,EAAE,CAAC;QADmB,cAAS,GAAT,SAAS,CAAkB;IAExD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QAC3B,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC;YAC1D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YACtD,OAAO,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAOD,SAAS,CAAC,IAAY;QACpB,OAAO,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAOD,WAAW;QACT,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAjCY,oDAAoB;AAqB/B;IALC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,+BAA+B;QAC5C,YAAY,EAAE,OAAO,CAAC,GAAG,EAAE;KAC5B,CAAC;;;;qDAGD;AAOD;IALC,IAAA,uBAAM,EAAC;QACN,WAAW,EAAE,wCAAwC;QACrD,KAAK,EAAE,cAAc;QACrB,YAAY,EAAE,KAAK;KACpB,CAAC;;;;uDAGD;+BAhCU,oBAAoB;IALhC,IAAA,2BAAU,EAAC;QACV,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,CAAC,IAAI,CAAC;QACf,WAAW,EAAE,4BAA4B;KAC1C,CAAC;qCAEwC,oCAAgB;GAD7C,oBAAoB,CAiChC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommandRunner } from 'nest-commander';
|
|
2
|
+
import { DeveloperService } from 'src/modules/developer/developer.service';
|
|
3
|
+
export declare class InitDbCommand extends CommandRunner {
|
|
4
|
+
private readonly developer;
|
|
5
|
+
constructor(developer: DeveloperService);
|
|
6
|
+
run([]: Iterable<any, void, undefined>, { verbose }: {
|
|
7
|
+
verbose: any;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
parseVerboseOption(): boolean;
|
|
10
|
+
}
|