@solidxai/solidctl 0.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 +98 -0
- package/dist/app.module.d.ts +2 -0
- package/dist/app.module.js +17 -0
- package/dist/app.module.js.map +1 -0
- package/dist/commands/build.command.d.ts +2 -0
- package/dist/commands/build.command.js +139 -0
- package/dist/commands/build.command.js.map +1 -0
- package/dist/commands/create-app/create-app.command.d.ts +2 -0
- package/dist/commands/create-app/create-app.command.js +71 -0
- package/dist/commands/create-app/create-app.command.js.map +1 -0
- package/dist/commands/create-app/helpers.d.ts +59 -0
- package/dist/commands/create-app/helpers.js +219 -0
- package/dist/commands/create-app/helpers.js.map +1 -0
- package/dist/commands/create-app/setup-questions.d.ts +31 -0
- package/dist/commands/create-app/setup-questions.js +70 -0
- package/dist/commands/create-app/setup-questions.js.map +1 -0
- package/dist/commands/info.command.d.ts +2 -0
- package/dist/commands/info.command.js +40 -0
- package/dist/commands/info.command.js.map +1 -0
- package/dist/commands/local-upgrade.command.d.ts +2 -0
- package/dist/commands/local-upgrade.command.js +94 -0
- package/dist/commands/local-upgrade.command.js.map +1 -0
- package/dist/commands/release.command.d.ts +2 -0
- package/dist/commands/release.command.js +181 -0
- package/dist/commands/release.command.js.map +1 -0
- package/dist/commands/seed.command.d.ts +2 -0
- package/dist/commands/seed.command.js +40 -0
- package/dist/commands/seed.command.js.map +1 -0
- package/dist/commands/test-data.command.d.ts +2 -0
- package/dist/commands/test-data.command.js +38 -0
- package/dist/commands/test-data.command.js.map +1 -0
- package/dist/commands/upgrade.command.d.ts +2 -0
- package/dist/commands/upgrade.command.js +48 -0
- package/dist/commands/upgrade.command.js.map +1 -0
- package/dist/helper.d.ts +1 -0
- package/dist/helper.js +19 -0
- package/dist/helper.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +34 -0
- package/dist/main.js.map +1 -0
- package/dist/shims/solid-shim.js +23 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +99 -0
- package/templates/dot-templates/dot.vscode.template/launch.json +35 -0
- package/templates/nest-template/README.md +73 -0
- package/templates/nest-template/bin/solid +2 -0
- package/templates/nest-template/dot-templates/dot.dockerignore.template +1 -0
- package/templates/nest-template/dot-templates/dot.eslintrc.template.js +25 -0
- package/templates/nest-template/dot-templates/dot.gitignore.template +56 -0
- package/templates/nest-template/dot-templates/dot.prettierrc.template +4 -0
- package/templates/nest-template/nest-cli.json +8 -0
- package/templates/nest-template/nodemon.json +13 -0
- package/templates/nest-template/package.json +132 -0
- package/templates/nest-template/src/app-default-database.module.ts +75 -0
- package/templates/nest-template/src/app.controller.spec.ts +22 -0
- package/templates/nest-template/src/app.module.ts +51 -0
- package/templates/nest-template/src/app.service.ts +32 -0
- package/templates/nest-template/src/database.utils.ts +18 -0
- package/templates/nest-template/src/main-cli.ts +81 -0
- package/templates/nest-template/src/main.ts +116 -0
- package/templates/nest-template/test/app.e2e-spec.ts +24 -0
- package/templates/nest-template/test/jest-e2e.json +9 -0
- package/templates/nest-template/tsconfig.build.json +4 -0
- package/templates/nest-template/tsconfig.json +22 -0
- package/templates/next-template/README.md +36 -0
- package/templates/next-template/app/GlobalProvider.tsx +23 -0
- package/templates/next-template/app/admin/core/[moduleName]/[modelName]/form/[id]/page.tsx +19 -0
- package/templates/next-template/app/admin/core/[moduleName]/[modelName]/kanban/page.tsx +18 -0
- package/templates/next-template/app/admin/core/[moduleName]/[modelName]/list/page.tsx +18 -0
- package/templates/next-template/app/admin/core/[moduleName]/home/page.tsx +15 -0
- package/templates/next-template/app/admin/core/[moduleName]/settings/[settings]/page.tsx +11 -0
- package/templates/next-template/app/admin/layout.tsx +11 -0
- package/templates/next-template/app/admin/loading.tsx +8 -0
- package/templates/next-template/app/admin/page.tsx +10 -0
- package/templates/next-template/app/api/auth/[...nextauth]/route.ts +6 -0
- package/templates/next-template/app/auth/confirm-forgot-password/page.tsx +12 -0
- package/templates/next-template/app/auth/forgot-password/page.tsx +11 -0
- package/templates/next-template/app/auth/initiate-forgot-password/page.tsx +11 -0
- package/templates/next-template/app/auth/initiate-forgot-password-thank-you/page.tsx +11 -0
- package/templates/next-template/app/auth/initiate-google-oauth/page.tsx +9 -0
- package/templates/next-template/app/auth/initiate-login/page.tsx +13 -0
- package/templates/next-template/app/auth/initiate-register/page.tsx +14 -0
- package/templates/next-template/app/auth/layout.tsx +10 -0
- package/templates/next-template/app/auth/login/page.tsx +12 -0
- package/templates/next-template/app/auth/otp-verify/page.tsx +12 -0
- package/templates/next-template/app/auth/register/page.tsx +12 -0
- package/templates/next-template/app/auth/reset-password/page.tsx +13 -0
- package/templates/next-template/app/auth/sso/page.tsx +80 -0
- package/templates/next-template/app/layout.tsx +56 -0
- package/templates/next-template/app/solid-extensions.ts +8 -0
- package/templates/next-template/dot-templates/dot.gitignore.template +44 -0
- package/templates/next-template/eslint.config.mjs +16 -0
- package/templates/next-template/middleware.ts +23 -0
- package/templates/next-template/next-env.d.ts +5 -0
- package/templates/next-template/next-solidx-run.js +18 -0
- package/templates/next-template/next.config.js +47 -0
- package/templates/next-template/package.json +79 -0
- package/templates/next-template/public/favicon.ico +0 -0
- package/templates/next-template/public/file.svg +1 -0
- package/templates/next-template/public/globe.svg +1 -0
- package/templates/next-template/public/next.svg +1 -0
- package/templates/next-template/public/themes/solid-dark-purple/theme.css +6203 -0
- package/templates/next-template/public/themes/solid-light-purple/solid-login-light.png +0 -0
- package/templates/next-template/public/themes/solid-light-purple/theme.css +6256 -0
- package/templates/next-template/public/vercel.svg +1 -0
- package/templates/next-template/public/window.svg +1 -0
- package/templates/next-template/redux/store.ts +52 -0
- package/templates/next-template/tsconfig.json +33 -0
- package/templates/next-template/types/index.d.ts +7 -0
- package/templates/next-template/types/layout.d.ts +94 -0
- package/templates/next-template/types/next.d.ts +46 -0
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@solidxai/solidctl",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "",
|
|
6
|
+
"private": false,
|
|
7
|
+
"license": "UNLICENSED",
|
|
8
|
+
"bin": {
|
|
9
|
+
"solidctl": "dist/main.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"templates"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "nest build",
|
|
20
|
+
"postbuild": "chmod +x dist/main.js",
|
|
21
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
22
|
+
"start": "nest start",
|
|
23
|
+
"start:dev": "nest start --watch",
|
|
24
|
+
"start:debug": "nest start --debug --watch",
|
|
25
|
+
"start:prod": "node dist/main",
|
|
26
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
27
|
+
"test": "jest",
|
|
28
|
+
"test:watch": "jest --watch",
|
|
29
|
+
"test:cov": "jest --coverage",
|
|
30
|
+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
31
|
+
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
32
|
+
"prepare": "npm run build",
|
|
33
|
+
"release": "npx ts-node src/main.ts release",
|
|
34
|
+
"release:patch": "npx ts-node src/main.ts release patch",
|
|
35
|
+
"release:minor": "npx ts-node src/main.ts release minor",
|
|
36
|
+
"release:major": "npx ts-node src/main.ts release major",
|
|
37
|
+
"release:alpha": "npx ts-node src/main.ts release --preid=alpha",
|
|
38
|
+
"release:beta": "npx ts-node src/main.ts release --preid=beta",
|
|
39
|
+
"release:rc": "npx ts-node src/main.ts release --preid=rc",
|
|
40
|
+
"release:alpha:minor": "npx ts-node src/main.ts release minor --preid=alpha",
|
|
41
|
+
"release:alpha:major": "npx ts-node src/main.ts release major --preid=alpha"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@nestjs/common": "^11.0.1",
|
|
45
|
+
"@nestjs/core": "^11.0.1",
|
|
46
|
+
"@nestjs/platform-express": "^11.0.1",
|
|
47
|
+
"@types/commander": "^2.12.0",
|
|
48
|
+
"chalk": "^4.1.2",
|
|
49
|
+
"commander": "^14.0.2",
|
|
50
|
+
"fs-extra": "^11.3.2",
|
|
51
|
+
"inquirer": "^8.2.7",
|
|
52
|
+
"reflect-metadata": "^0.2.2",
|
|
53
|
+
"rxjs": "^7.8.1"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
57
|
+
"@eslint/js": "^9.18.0",
|
|
58
|
+
"@nestjs/cli": "^11.0.0",
|
|
59
|
+
"@nestjs/schematics": "^11.0.0",
|
|
60
|
+
"@nestjs/testing": "^11.0.1",
|
|
61
|
+
"@types/express": "^5.0.0",
|
|
62
|
+
"@types/fs-extra": "^11.0.4",
|
|
63
|
+
"@types/inquirer": "^8.2.12",
|
|
64
|
+
"@types/jest": "^30.0.0",
|
|
65
|
+
"@types/node": "^22.10.7",
|
|
66
|
+
"@types/supertest": "^6.0.2",
|
|
67
|
+
"eslint": "^9.18.0",
|
|
68
|
+
"eslint-config-prettier": "^10.0.1",
|
|
69
|
+
"eslint-plugin-prettier": "^5.2.2",
|
|
70
|
+
"globals": "^16.0.0",
|
|
71
|
+
"jest": "^30.0.0",
|
|
72
|
+
"prettier": "^3.4.2",
|
|
73
|
+
"source-map-support": "^0.5.21",
|
|
74
|
+
"supertest": "^7.0.0",
|
|
75
|
+
"ts-jest": "^29.2.5",
|
|
76
|
+
"ts-loader": "^9.5.2",
|
|
77
|
+
"ts-node": "^10.9.2",
|
|
78
|
+
"tsconfig-paths": "^4.2.0",
|
|
79
|
+
"typescript": "^5.7.3",
|
|
80
|
+
"typescript-eslint": "^8.20.0"
|
|
81
|
+
},
|
|
82
|
+
"jest": {
|
|
83
|
+
"moduleFileExtensions": [
|
|
84
|
+
"js",
|
|
85
|
+
"json",
|
|
86
|
+
"ts"
|
|
87
|
+
],
|
|
88
|
+
"rootDir": "src",
|
|
89
|
+
"testRegex": ".*\\.spec\\.ts$",
|
|
90
|
+
"transform": {
|
|
91
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
|
92
|
+
},
|
|
93
|
+
"collectCoverageFrom": [
|
|
94
|
+
"**/*.(t|j)s"
|
|
95
|
+
],
|
|
96
|
+
"coverageDirectory": "../coverage",
|
|
97
|
+
"testEnvironment": "node"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"type": "node",
|
|
9
|
+
"request": "launch",
|
|
10
|
+
"name": "Debug solid-api",
|
|
11
|
+
"args": [
|
|
12
|
+
"${workspaceFolder}/solid-api/src/main.ts"
|
|
13
|
+
],
|
|
14
|
+
"runtimeArgs": [
|
|
15
|
+
"--nolazy",
|
|
16
|
+
"-r",
|
|
17
|
+
"ts-node/register",
|
|
18
|
+
"-r",
|
|
19
|
+
"tsconfig-paths/register"
|
|
20
|
+
],
|
|
21
|
+
"sourceMaps": true,
|
|
22
|
+
"outFiles": [
|
|
23
|
+
"${workspaceFolder}/dist/**/*.js",
|
|
24
|
+
"${workspaceFolder}/solid-api/node_modules/@solidxai/core/dist/**/*.js"
|
|
25
|
+
],
|
|
26
|
+
"resolveSourceMapLocations": [
|
|
27
|
+
"${workspaceFolder}/**",
|
|
28
|
+
"${workspaceFolder}/solid-api/node_modules/@solidxai/core/**"
|
|
29
|
+
],
|
|
30
|
+
"cwd": "${workspaceFolder}/solid-api",
|
|
31
|
+
"console": "integratedTerminal",
|
|
32
|
+
"autoAttachChildProcesses": true
|
|
33
|
+
},
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" 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://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
|
|
15
|
+
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
|
|
16
|
+
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
|
17
|
+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
|
18
|
+
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
|
|
19
|
+
<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>
|
|
20
|
+
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
|
|
21
|
+
</p>
|
|
22
|
+
<!--[](https://opencollective.com/nest#backer)
|
|
23
|
+
[](https://opencollective.com/nest#sponsor)-->
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
|
|
27
|
+
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
$ npm install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Running the app
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# development
|
|
39
|
+
$ npm run start
|
|
40
|
+
|
|
41
|
+
# watch mode
|
|
42
|
+
$ npm run start:dev
|
|
43
|
+
|
|
44
|
+
# production mode
|
|
45
|
+
$ npm run start:prod
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Test
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# unit tests
|
|
52
|
+
$ npm run test
|
|
53
|
+
|
|
54
|
+
# e2e tests
|
|
55
|
+
$ npm run test:e2e
|
|
56
|
+
|
|
57
|
+
# test coverage
|
|
58
|
+
$ npm run test:cov
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Support
|
|
62
|
+
|
|
63
|
+
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).
|
|
64
|
+
|
|
65
|
+
## Stay in touch
|
|
66
|
+
|
|
67
|
+
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
|
|
68
|
+
- Website - [https://nestjs.com](https://nestjs.com/)
|
|
69
|
+
- Twitter - [@nestframework](https://twitter.com/nestframework)
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
Nest is [MIT licensed](LICENSE).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
**/node_modules
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
parser: '@typescript-eslint/parser',
|
|
3
|
+
parserOptions: {
|
|
4
|
+
project: 'tsconfig.json',
|
|
5
|
+
tsconfigRootDir: __dirname,
|
|
6
|
+
sourceType: 'module',
|
|
7
|
+
},
|
|
8
|
+
plugins: ['@typescript-eslint/eslint-plugin'],
|
|
9
|
+
extends: [
|
|
10
|
+
'plugin:@typescript-eslint/recommended',
|
|
11
|
+
'plugin:prettier/recommended',
|
|
12
|
+
],
|
|
13
|
+
root: true,
|
|
14
|
+
env: {
|
|
15
|
+
node: true,
|
|
16
|
+
jest: true,
|
|
17
|
+
},
|
|
18
|
+
ignorePatterns: ['.eslintrc.js'],
|
|
19
|
+
rules: {
|
|
20
|
+
'@typescript-eslint/interface-name-prefix': 'off',
|
|
21
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
22
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
23
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# compiled output
|
|
2
|
+
/dist
|
|
3
|
+
/node_modules
|
|
4
|
+
/build
|
|
5
|
+
|
|
6
|
+
# Logs
|
|
7
|
+
logs
|
|
8
|
+
*.log
|
|
9
|
+
npm-debug.log*
|
|
10
|
+
pnpm-debug.log*
|
|
11
|
+
yarn-debug.log*
|
|
12
|
+
yarn-error.log*
|
|
13
|
+
lerna-debug.log*
|
|
14
|
+
|
|
15
|
+
# OS
|
|
16
|
+
.DS_Store
|
|
17
|
+
|
|
18
|
+
# Tests
|
|
19
|
+
/coverage
|
|
20
|
+
/.nyc_output
|
|
21
|
+
|
|
22
|
+
# IDEs and editors
|
|
23
|
+
/.idea
|
|
24
|
+
.project
|
|
25
|
+
.classpath
|
|
26
|
+
.c9/
|
|
27
|
+
*.launch
|
|
28
|
+
.settings/
|
|
29
|
+
*.sublime-workspace
|
|
30
|
+
|
|
31
|
+
# IDE - VSCode
|
|
32
|
+
.vscode/*
|
|
33
|
+
!.vscode/settings.json
|
|
34
|
+
!.vscode/tasks.json
|
|
35
|
+
!.vscode/launch.json
|
|
36
|
+
!.vscode/extensions.json
|
|
37
|
+
|
|
38
|
+
# ignore environment variable files
|
|
39
|
+
.env*
|
|
40
|
+
|
|
41
|
+
# temp directory
|
|
42
|
+
.temp
|
|
43
|
+
.tmp
|
|
44
|
+
|
|
45
|
+
# Runtime data
|
|
46
|
+
pids
|
|
47
|
+
*.pid
|
|
48
|
+
*.seed
|
|
49
|
+
*.pid.lock
|
|
50
|
+
|
|
51
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
52
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
53
|
+
|
|
54
|
+
media-uploads
|
|
55
|
+
media-files-storage
|
|
56
|
+
local_packages
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nest-template",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "",
|
|
6
|
+
"private": true,
|
|
7
|
+
"license": "UNLICENSED",
|
|
8
|
+
"main": "dist/main-cli.js",
|
|
9
|
+
"bin": {
|
|
10
|
+
"solid": "dist/main-cli.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "nest build",
|
|
14
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
15
|
+
"start": "nest start",
|
|
16
|
+
"start:dev": "nest start --watch",
|
|
17
|
+
"start:debug": "nest start --debug --watch",
|
|
18
|
+
"start:prod": "node dist/main",
|
|
19
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
20
|
+
"test": "jest",
|
|
21
|
+
"test:watch": "jest --watch",
|
|
22
|
+
"test:cov": "jest --coverage",
|
|
23
|
+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
24
|
+
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
25
|
+
"solidx:dev": "nodemon"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@angular-devkit/core": "^18.0.3",
|
|
29
|
+
"@aws-sdk/client-s3": "^3.637.0",
|
|
30
|
+
"@elasticemail/elasticemail-client": "^4.0.23",
|
|
31
|
+
"@hapi/joi": "^17.1.1",
|
|
32
|
+
"@nestjs/axios": "^3.0.2",
|
|
33
|
+
"@nestjs/cache-manager": "^2.2.2",
|
|
34
|
+
"@nestjs/common": "^10.0.0",
|
|
35
|
+
"@nestjs/config": "^3.2.0",
|
|
36
|
+
"@nestjs/core": "^10.0.0",
|
|
37
|
+
"@nestjs/event-emitter": "^2.0.4",
|
|
38
|
+
"@nestjs/jwt": "^10.2.0",
|
|
39
|
+
"@nestjs/mapped-types": "^2.0.4",
|
|
40
|
+
"@nestjs/mongoose": "^10.0.10",
|
|
41
|
+
"@nestjs/passport": "^10.0.3",
|
|
42
|
+
"@nestjs/platform-express": "^10.0.0",
|
|
43
|
+
"@nestjs/serve-static": "^4.0.2",
|
|
44
|
+
"@nestjs/swagger": "^7.2.0",
|
|
45
|
+
"@nestjs/typeorm": "^10.0.1",
|
|
46
|
+
"@solidxai/core": "^1.2.191",
|
|
47
|
+
"@types/luxon": "^3.4.2",
|
|
48
|
+
"amqplib": "^0.10.4",
|
|
49
|
+
"axios": "^1.7.0",
|
|
50
|
+
"bcrypt": "^5.1.1",
|
|
51
|
+
"bson": "^6.10.1",
|
|
52
|
+
"cache-manager": "^5.5.2",
|
|
53
|
+
"cache-manager-redis-store": "^3.0.1",
|
|
54
|
+
"class-transformer": "^0.5.1",
|
|
55
|
+
"class-validator": "^0.14.1",
|
|
56
|
+
"handlebars": "^4.7.8",
|
|
57
|
+
"ioredis": "^5.4.1",
|
|
58
|
+
"luxon": "^3.4.4",
|
|
59
|
+
"mailgen": "^2.0.28",
|
|
60
|
+
"mongoose": "^8.7.0",
|
|
61
|
+
"nest-commander": "^3.12.5",
|
|
62
|
+
"nest-winston": "^1.9.7",
|
|
63
|
+
"nodemailer": "^6.9.13",
|
|
64
|
+
"passport": "^0.7.0",
|
|
65
|
+
"passport-google-oauth2": "^0.2.0",
|
|
66
|
+
"passport-jwt": "^4.0.1",
|
|
67
|
+
"passport-local": "^1.0.0",
|
|
68
|
+
"pg": "^8.11.3",
|
|
69
|
+
"pluralize": "^8.0.0",
|
|
70
|
+
"puppeteer": "^23.2.0",
|
|
71
|
+
"reflect-metadata": "^0.2.2",
|
|
72
|
+
"rxjs": "^7.8.1",
|
|
73
|
+
"swagger-ui-express": "^5.0.0",
|
|
74
|
+
"typeorm": "^0.3.20",
|
|
75
|
+
"typeorm-naming-strategies": "^4.1.0",
|
|
76
|
+
"uuid": "^9.0.1",
|
|
77
|
+
"winston": "^3.17.0",
|
|
78
|
+
"xlsx": "^0.18.5",
|
|
79
|
+
"nestjs-cls": "^5.4.3"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@nestjs/cli": "^10.0.0",
|
|
83
|
+
"@nestjs/testing": "^10.0.0",
|
|
84
|
+
"@solidxai/code-builder": "^1.0.32",
|
|
85
|
+
"@types/express": "^4.17.17",
|
|
86
|
+
"@types/hapi__joi": "^17.1.12",
|
|
87
|
+
"@types/jest": "^29.5.2",
|
|
88
|
+
"@types/mongoose": "^5.11.97",
|
|
89
|
+
"@types/multer": "^1.4.11",
|
|
90
|
+
"@types/node": "^20.3.1",
|
|
91
|
+
"@types/nodemailer": "^6.4.15",
|
|
92
|
+
"@types/passport-google-oauth2": "^0.1.8",
|
|
93
|
+
"@types/passport-jwt": "^4.0.1",
|
|
94
|
+
"@types/passport-local": "^1.0.38",
|
|
95
|
+
"@types/pluralize": "^0.0.33",
|
|
96
|
+
"@types/supertest": "^2.0.12",
|
|
97
|
+
"@types/uuid": "^9.0.8",
|
|
98
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
99
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
100
|
+
"eslint": "^8.42.0",
|
|
101
|
+
"eslint-config-prettier": "^9.0.0",
|
|
102
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
103
|
+
"jest": "^29.5.0",
|
|
104
|
+
"nest-cli": "^0.0.5",
|
|
105
|
+
"prettier": "^3.0.0",
|
|
106
|
+
"source-map-support": "^0.5.21",
|
|
107
|
+
"supertest": "^6.3.3",
|
|
108
|
+
"ts-jest": "^29.1.0",
|
|
109
|
+
"ts-loader": "^9.4.3",
|
|
110
|
+
"ts-node": "^10.9.1",
|
|
111
|
+
"tsconfig-paths": "^4.2.0",
|
|
112
|
+
"typescript": "^5.1.3",
|
|
113
|
+
"nodemon": "^3.1.10"
|
|
114
|
+
},
|
|
115
|
+
"jest": {
|
|
116
|
+
"moduleFileExtensions": [
|
|
117
|
+
"js",
|
|
118
|
+
"json",
|
|
119
|
+
"ts"
|
|
120
|
+
],
|
|
121
|
+
"rootDir": "src",
|
|
122
|
+
"testRegex": ".*\\.spec\\.ts$",
|
|
123
|
+
"transform": {
|
|
124
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
|
125
|
+
},
|
|
126
|
+
"collectCoverageFrom": [
|
|
127
|
+
"**/*.(t|j)s"
|
|
128
|
+
],
|
|
129
|
+
"coverageDirectory": "../coverage",
|
|
130
|
+
"testEnvironment": "node"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Module } from '@nestjs/common';
|
|
2
|
+
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
3
|
+
import * as SolidCoreModuleExports from '@solidxai/core';
|
|
4
|
+
import { DatasourceType, getDynamicModuleNames, ISolidDatabaseModule, parseBooleanEnv, SolidDatabaseModule } from '@solidxai/core';
|
|
5
|
+
import { WINSTON_MODULE_PROVIDER } from 'nest-winston';
|
|
6
|
+
import { join } from 'path';
|
|
7
|
+
import { getMetadataArgsStorage } from 'typeorm';
|
|
8
|
+
import { SnakeNamingStrategy } from 'typeorm-naming-strategies';
|
|
9
|
+
import { Logger } from 'winston';
|
|
10
|
+
import { WinstonTypeORMLogger } from '@solidxai/core'; // Assuming you have this custom logger
|
|
11
|
+
|
|
12
|
+
function getEntitiesFromExports(exports: Record<string, any>) {
|
|
13
|
+
const metadataStorage = getMetadataArgsStorage();
|
|
14
|
+
return Object.values(exports).filter((item) =>
|
|
15
|
+
metadataStorage.tables.some((table) => table.target === item)
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
const coreEntities = getEntitiesFromExports(SolidCoreModuleExports);
|
|
19
|
+
|
|
20
|
+
@Module({
|
|
21
|
+
imports: [
|
|
22
|
+
TypeOrmModule.forRootAsync({
|
|
23
|
+
// This becomes the default by default.
|
|
24
|
+
// name: 'default',
|
|
25
|
+
useFactory: (logger: Logger) => {
|
|
26
|
+
const dynamicModules = getDynamicModuleNames();
|
|
27
|
+
|
|
28
|
+
const entities = [
|
|
29
|
+
...coreEntities,
|
|
30
|
+
...dynamicModules.map(module =>
|
|
31
|
+
join(__dirname, `./${module}/entities/*.entity.{ts,js}`)
|
|
32
|
+
),
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
// type of our database.
|
|
37
|
+
type: 'postgres',
|
|
38
|
+
host: process.env.DEFAULT_DATABASE_HOST,
|
|
39
|
+
port: +process.env.DEFAULT_DATABASE_PORT,
|
|
40
|
+
username: process.env.DEFAULT_DATABASE_USER,
|
|
41
|
+
password: process.env.DEFAULT_DATABASE_PASSWORD,
|
|
42
|
+
// name of our database
|
|
43
|
+
database: process.env.DEFAULT_DATABASE_NAME,
|
|
44
|
+
entities: entities,
|
|
45
|
+
// your entities will be synced with the database (recommended: disable in prod)
|
|
46
|
+
synchronize: parseBooleanEnv('DEFAULT_DATABASE_SYNCHRONIZE'),
|
|
47
|
+
logging: parseBooleanEnv('DEFAULT_DATABASE_LOGGING'),
|
|
48
|
+
logger: parseBooleanEnv('DEFAULT_DATABASE_LOGGING') ? new WinstonTypeORMLogger(logger) : undefined, // Pass in the custom WinstonLogger
|
|
49
|
+
namingStrategy: new SnakeNamingStrategy(),
|
|
50
|
+
maxQueryExecutionTime: 500,
|
|
51
|
+
extra: {
|
|
52
|
+
max: Number(process.env.DEFAULT_DATABASE_POOL_MAX ?? 20),
|
|
53
|
+
connectionTimeoutMillis: 30000,
|
|
54
|
+
idleTimeoutMillis: 30000,
|
|
55
|
+
statement_timeout: 15000,
|
|
56
|
+
idle_in_transaction_session_timeout: 60000,
|
|
57
|
+
},
|
|
58
|
+
retryAttempts: Number(process.env.DEFAULT_DATABASE_RETRY_ATTEMPTS ?? 0),
|
|
59
|
+
retryDelay: Number(process.env.DEFAULT_DATABASE_RETRY_DELAY_MS ?? 0),
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
inject: [WINSTON_MODULE_PROVIDER]
|
|
63
|
+
}),
|
|
64
|
+
],
|
|
65
|
+
})
|
|
66
|
+
@SolidDatabaseModule()
|
|
67
|
+
export class DefaultDBModule implements ISolidDatabaseModule {
|
|
68
|
+
type(): DatasourceType {
|
|
69
|
+
return DatasourceType.postgres;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
name(): string {
|
|
73
|
+
return 'default';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Test, TestingModule } from '@nestjs/testing';
|
|
2
|
+
import { AppController } from './app.controller';
|
|
3
|
+
import { AppService } from './app.service';
|
|
4
|
+
|
|
5
|
+
describe('AppController', () => {
|
|
6
|
+
let appController: AppController;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
const app: TestingModule = await Test.createTestingModule({
|
|
10
|
+
controllers: [AppController],
|
|
11
|
+
providers: [AppService],
|
|
12
|
+
}).compile();
|
|
13
|
+
|
|
14
|
+
appController = app.get<AppController>(AppController);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('root', () => {
|
|
18
|
+
it('should return "Hello World!"', () => {
|
|
19
|
+
expect(appController.getHello()).toBe('Hello World!');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DynamicModule, Module } from '@nestjs/common';
|
|
2
|
+
import { ConfigModule } from '@nestjs/config';
|
|
3
|
+
import { EventEmitterModule } from '@nestjs/event-emitter';
|
|
4
|
+
import { SolidCoreModule, WinstonLoggerConfig } from '@solidxai/core';
|
|
5
|
+
import { WinstonModule } from 'nest-winston';
|
|
6
|
+
import { ClsModule } from 'nestjs-cls';
|
|
7
|
+
import { DefaultDBModule } from './app-default-database.module';
|
|
8
|
+
import { AppService } from './app.service';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@Module({
|
|
12
|
+
imports: [
|
|
13
|
+
// Register Winston globally
|
|
14
|
+
WinstonModule.forRoot(WinstonLoggerConfig),
|
|
15
|
+
|
|
16
|
+
ConfigModule.forRoot({
|
|
17
|
+
isGlobal: true,
|
|
18
|
+
}),
|
|
19
|
+
|
|
20
|
+
DefaultDBModule,
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
SolidCoreModule,
|
|
24
|
+
|
|
25
|
+
EventEmitterModule.forRoot(),
|
|
26
|
+
|
|
27
|
+
ClsModule.forRoot({
|
|
28
|
+
global: true,
|
|
29
|
+
middleware: {
|
|
30
|
+
mount: true,
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
|
|
34
|
+
],
|
|
35
|
+
controllers: [],
|
|
36
|
+
providers: [
|
|
37
|
+
AppService,
|
|
38
|
+
],
|
|
39
|
+
})
|
|
40
|
+
export class AppModule {
|
|
41
|
+
|
|
42
|
+
static async forRoot(): Promise<DynamicModule> {
|
|
43
|
+
const appService = new AppService();
|
|
44
|
+
const dynamicModules = await appService.loadModules();
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
module: AppModule,
|
|
48
|
+
imports: [...dynamicModules],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DynamicModule, Injectable, Logger } from '@nestjs/common';
|
|
2
|
+
import { getDynamicModuleNames } from '@solidxai/core';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class AppService {
|
|
7
|
+
private readonly logger = new Logger(AppService.name);
|
|
8
|
+
|
|
9
|
+
async loadModules(): Promise<DynamicModule[]> {
|
|
10
|
+
const enabledModules = getDynamicModuleNames();
|
|
11
|
+
|
|
12
|
+
// Base path
|
|
13
|
+
const basePath = './';
|
|
14
|
+
const modules = await Promise.all(
|
|
15
|
+
enabledModules.map(async (moduleName) => {
|
|
16
|
+
const modulePath = `${basePath}${moduleName}/${moduleName}.module`;
|
|
17
|
+
try {
|
|
18
|
+
const importedModule = await import(modulePath);
|
|
19
|
+
|
|
20
|
+
// Return the first exported value, assuming it is the module class
|
|
21
|
+
return Object.values(importedModule)[0] as DynamicModule;
|
|
22
|
+
|
|
23
|
+
} catch (error) {
|
|
24
|
+
this.logger.error(`Failed to load module "${moduleName}" from "${modulePath}":`, error);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return modules.filter((module): module is DynamicModule => module !== null);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configures the PostgreSQL type parser to handle INT8 (BIGINT) values as JavaScript numbers.
|
|
3
|
+
*
|
|
4
|
+
* By default, pg returns INT8 values as strings to avoid precision loss with large numbers.
|
|
5
|
+
* This configuration converts them to integers, which is suitable when your INT8 values
|
|
6
|
+
* are within JavaScript's safe integer range.
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/typeorm/typeorm/issues/8583
|
|
9
|
+
*/
|
|
10
|
+
export function configurePgInt8TypeParser(): void {
|
|
11
|
+
try {
|
|
12
|
+
const types = require('pg').types;
|
|
13
|
+
types.setTypeParser(types.builtins.INT8, (val: string) => parseInt(val, 10));
|
|
14
|
+
} catch {
|
|
15
|
+
// If pg is not installed, we can ignore this.
|
|
16
|
+
// It is only relevant if you are using Postgres with TypeORM.
|
|
17
|
+
}
|
|
18
|
+
}
|