@vnodes/cli 0.1.4 → 0.1.5

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.
Files changed (58) hide show
  1. package/README.md +35 -1
  2. package/bin/vnodes.mjs +3 -0
  3. package/dist/cli/cli.d.ts +2 -0
  4. package/dist/cli/cli.d.ts.map +1 -0
  5. package/dist/cli/cli.js +13 -0
  6. package/dist/cli/cli.js.map +1 -0
  7. package/dist/cli/hello/hello.d.ts +12 -0
  8. package/dist/cli/hello/hello.d.ts.map +1 -0
  9. package/dist/cli/hello/hello.js +13 -0
  10. package/dist/cli/hello/hello.js.map +1 -0
  11. package/dist/cli/suffix/suffix.d.ts +12 -0
  12. package/dist/cli/suffix/suffix.d.ts.map +1 -0
  13. package/dist/cli/suffix/suffix.js +26 -0
  14. package/dist/cli/suffix/suffix.js.map +1 -0
  15. package/dist/cli/wd/wd.d.ts +12 -0
  16. package/dist/cli/wd/wd.d.ts.map +1 -0
  17. package/dist/cli/wd/wd.js +16 -0
  18. package/dist/cli/wd/wd.js.map +1 -0
  19. package/dist/generators/project/api/.env.template +6 -0
  20. package/dist/generators/project/api/.gitignore.template +4 -0
  21. package/dist/generators/project/api/.npmignore.template +2 -0
  22. package/dist/generators/project/api/.swcrc.template +29 -0
  23. package/dist/generators/project/api/assets/.gitkeep.template +0 -0
  24. package/dist/generators/project/api/eslint.config.mjs.template +5 -0
  25. package/dist/generators/project/api/package.json.template +115 -0
  26. package/dist/generators/project/api/prisma/schema.prisma.template +14 -0
  27. package/dist/generators/project/api/prisma.config.ts.template +12 -0
  28. package/dist/generators/project/api/src/app/app.controller.spec.ts.template +5 -0
  29. package/dist/generators/project/api/src/app/app.module.ts.template +5 -0
  30. package/dist/generators/project/api/src/app/bootstrap.ts.template +6 -0
  31. package/dist/generators/project/api/src/app/resources/resource.module.ts.template +9 -0
  32. package/dist/generators/project/api/src/app/resources/sample/sample.controller.ts.template +52 -0
  33. package/dist/generators/project/api/src/app/resources/sample/sample.dto.ts.template +6 -0
  34. package/dist/generators/project/api/src/app/resources/sample/sample.module.ts.template +10 -0
  35. package/dist/generators/project/api/src/index.ts.template +7 -0
  36. package/dist/generators/project/api/src/main.ts.template +3 -0
  37. package/dist/generators/project/api/src/peer-dependencies.ts.template +18 -0
  38. package/dist/generators/project/api/src/src/main.ts.template +3 -0
  39. package/dist/generators/project/api/tsconfig.app.json.template +14 -0
  40. package/dist/generators/project/api/tsconfig.json.template +16 -0
  41. package/dist/generators/project/{lib → common}/tsconfig.lib.json.template +0 -3
  42. package/dist/generators/project/{lib → common}/tsconfig.spec.json.template +1 -1
  43. package/dist/generators/project/{lib → common}/vitest.config.mts.template +2 -2
  44. package/dist/generators/project/lib/.npmignore.template +2 -0
  45. package/dist/generators/project/lib/package.json.template +4 -14
  46. package/dist/generators/project/project.d.ts +5 -3
  47. package/dist/generators/project/project.d.ts.map +1 -1
  48. package/dist/generators/project/project.js +22 -3
  49. package/dist/generators/project/project.js.map +1 -1
  50. package/dist/generators/project/schema.d.js.map +1 -1
  51. package/dist/generators/project/schema.d.ts +1 -1
  52. package/dist/index.d.ts +2 -0
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +3 -1
  55. package/dist/index.js.map +1 -1
  56. package/dist/package.json +33 -4
  57. package/package.json +33 -4
  58. /package/dist/generators/project/{lib → common}/README.md.template +0 -0
package/README.md CHANGED
@@ -1,2 +1,36 @@
1
- # cli
1
+ ![Npm version](https://img.shields.io/npm/v/@vnodes/cli)
2
+ ![Npm downloads](https://img.shields.io/npm/dm/@vnodes/cli)
3
+ ![Build Status](https://img.shields.io/github/actions/workflow/status/vnodes/vnodes/ci.yml)
4
+ ![Doc Status](https://img.shields.io/github/actions/workflow/status/vnodes/vnodes/doc.yml)
5
+ ![Bundle size](https://img.shields.io/bundlephobia/min/@vnodes/cli)
2
6
 
7
+ <p align="center">
8
+ <img srcset="./assets/favicon.png, https://vnodes.github.io/plugins/cli/assets/favicon.png" alt="Logo" width="200" height="200" style="border-radius: 100%"/>
9
+ </p>
10
+
11
+ ## @vnodes/cli
12
+
13
+ Vnodes tools and generators
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ pnpm add -D @vnodes/cli
19
+ ```
20
+
21
+
22
+ ## 💖 Support My Work
23
+
24
+ If you find my open-source contributions or the **@vnodes/cli** project helpful, consider supporting my work. Your sponsorship helps me maintain these projects and explore new enterprise patterns.
25
+
26
+ [![CashApp](https://img.shields.io/badge/Sponsor%20me-%23EA4AAA.svg?style=for-the-badge&logo=github-sponsors&logoColor=white)](https://cash.app/$puqlib)
27
+
28
+ ---
29
+
30
+ ## 🤝 Connect with Me
31
+
32
+ <p align="left">
33
+ <a href="mailto:robert.brightline+errors@gmail.com">
34
+ <img src="https://img.shields.io/badge/Email-D14836?style=for-the-badge&logo=gmail&logoColor=white" />
35
+ </a>
36
+ </p>
package/bin/vnodes.mjs ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ import '../dist/cli/cli.js';
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { program } from 'commander';
2
+ import { hello } from './hello/hello.js';
3
+ import { wd } from './wd/wd.js';
4
+ import { suffix } from './suffix/suffix.js';
5
+ program.name('Vnodes cli').description('Tools and generators').version('0.1.0').showHelpAfterError(true);
6
+ [
7
+ hello,
8
+ wd,
9
+ suffix
10
+ ].map((c)=>c(program));
11
+ program.parse();
12
+
13
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/cli.ts"],"sourcesContent":["import { program } from 'commander';\nimport { hello } from './hello/hello.js';\nimport { wd } from './wd/wd.js';\nimport { suffix } from './suffix/suffix.js';\n\nprogram\n .name('Vnodes cli')\n .description('Tools and generators')\n .version('0.1.0')\n .showHelpAfterError(true);\n\n[hello, wd, suffix].map((c) => c(program));\n\nprogram.parse();\n"],"names":["program","hello","wd","suffix","name","description","version","showHelpAfterError","map","c","parse"],"mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,EAAE,QAAQ,aAAa;AAChC,SAASC,MAAM,QAAQ,qBAAqB;AAE5CH,QACGI,IAAI,CAAC,cACLC,WAAW,CAAC,wBACZC,OAAO,CAAC,SACRC,kBAAkB,CAAC;AAEtB;IAACN;IAAOC;IAAIC;CAAO,CAACK,GAAG,CAAC,CAACC,IAAMA,EAAET;AAEjCA,QAAQU,KAAK"}
@@ -0,0 +1,12 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Say hello to the user
4
+ *
5
+ * ### Example
6
+ * ````sh
7
+ * vnodes hello --username YourName
8
+ * ````
9
+ * @param command main command instance
10
+ */
11
+ export declare function hello(command: Command): void;
12
+ //# sourceMappingURL=hello.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hello.d.ts","sourceRoot":"","sources":["../../../src/cli/hello/hello.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,QAKrC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Say hello to the user
3
+ *
4
+ * ### Example
5
+ * ````sh
6
+ * vnodes hello --username YourName
7
+ * ````
8
+ * @param command main command instance
9
+ */ export function hello(command) {
10
+ command.command('hello').requiredOption('-u, --username <string>', 'What is your name').action(({ username })=>console.log(`Hello, ${username}`));
11
+ }
12
+
13
+ //# sourceMappingURL=hello.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cli/hello/hello.ts"],"sourcesContent":["import { Command } from 'commander';\n\n/**\n * Say hello to the user\n *\n * ### Example\n * ````sh\n * vnodes hello --username YourName\n * ````\n * @param command main command instance\n */\nexport function hello(command: Command) {\n command\n .command('hello')\n .requiredOption('-u, --username <string>', 'What is your name')\n .action(({ username }) => console.log(`Hello, ${username}`));\n}\n"],"names":["hello","command","requiredOption","action","username","console","log"],"mappings":"AAEA;;;;;;;;CAQC,GACD,OAAO,SAASA,MAAMC,OAAgB;IACpCA,QACGA,OAAO,CAAC,SACRC,cAAc,CAAC,2BAA2B,qBAC1CC,MAAM,CAAC,CAAC,EAAEC,QAAQ,EAAE,GAAKC,QAAQC,GAAG,CAAC,CAAC,OAAO,EAAEF,UAAU;AAC9D"}
@@ -0,0 +1,12 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Suffix file/files recursive
4
+ *
5
+ * ### Example
6
+ * ````sh
7
+ * vnodes suffix --username YourName
8
+ * ````
9
+ * @param command main command instance
10
+ */
11
+ export declare function suffix(command: Command): void;
12
+ //# sourceMappingURL=suffix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suffix.d.ts","sourceRoot":"","sources":["../../../src/cli/suffix/suffix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO,QA2BtC"}
@@ -0,0 +1,26 @@
1
+ import { readdirSync, renameSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ /**
4
+ * Suffix file/files recursive
5
+ *
6
+ * ### Example
7
+ * ````sh
8
+ * vnodes suffix --username YourName
9
+ * ````
10
+ * @param command main command instance
11
+ */ export function suffix(command) {
12
+ command.command('suffix').option('-u, --undo', 'Would you like to undo the suffix?').option('-r, --recursive', 'Would you like to do recursively?').requiredOption('-s, --suffix <string>', 'What suffix would you like to add?').action(async ({ suffix, recursive, undo })=>{
13
+ const filePaths = readdirSync('./', {
14
+ recursive: !!recursive,
15
+ withFileTypes: true
16
+ }).filter((e)=>e.isFile()).map((e)=>join('./', e.parentPath, e.name));
17
+ const createNewFilepath = (filePath)=>{
18
+ return undo ? filePath.replace(new RegExp(`${suffix}$`), '') : `${filePath}${suffix}`;
19
+ };
20
+ for (const filePath of filePaths){
21
+ renameSync(filePath, createNewFilepath(filePath));
22
+ }
23
+ });
24
+ }
25
+
26
+ //# sourceMappingURL=suffix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cli/suffix/suffix.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { readdirSync, renameSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/**\n * Suffix file/files recursive\n *\n * ### Example\n * ````sh\n * vnodes suffix --username YourName\n * ````\n * @param command main command instance\n */\nexport function suffix(command: Command) {\n command\n .command('suffix')\n .option('-u, --undo', 'Would you like to undo the suffix?')\n .option('-r, --recursive', 'Would you like to do recursively?')\n .requiredOption(\n '-s, --suffix <string>',\n 'What suffix would you like to add?',\n )\n .action(async ({ suffix, recursive, undo }) => {\n const filePaths = readdirSync('./', {\n recursive: !!recursive,\n withFileTypes: true,\n })\n .filter((e) => e.isFile())\n .map((e) => join('./', e.parentPath, e.name));\n\n const createNewFilepath = (filePath: string) => {\n return undo\n ? filePath.replace(new RegExp(`${suffix}$`), '')\n : `${filePath}${suffix}`;\n };\n\n for (const filePath of filePaths) {\n renameSync(filePath, createNewFilepath(filePath));\n }\n });\n}\n"],"names":["readdirSync","renameSync","join","suffix","command","option","requiredOption","action","recursive","undo","filePaths","withFileTypes","filter","e","isFile","map","parentPath","name","createNewFilepath","filePath","replace","RegExp"],"mappings":"AACA,SAASA,WAAW,EAAEC,UAAU,QAAQ,UAAU;AAClD,SAASC,IAAI,QAAQ,YAAY;AAEjC;;;;;;;;CAQC,GACD,OAAO,SAASC,OAAOC,OAAgB;IACrCA,QACGA,OAAO,CAAC,UACRC,MAAM,CAAC,cAAc,sCACrBA,MAAM,CAAC,mBAAmB,qCAC1BC,cAAc,CACb,yBACA,sCAEDC,MAAM,CAAC,OAAO,EAAEJ,MAAM,EAAEK,SAAS,EAAEC,IAAI,EAAE;QACxC,MAAMC,YAAYV,YAAY,MAAM;YAClCQ,WAAW,CAAC,CAACA;YACbG,eAAe;QACjB,GACGC,MAAM,CAAC,CAACC,IAAMA,EAAEC,MAAM,IACtBC,GAAG,CAAC,CAACF,IAAMX,KAAK,MAAMW,EAAEG,UAAU,EAAEH,EAAEI,IAAI;QAE7C,MAAMC,oBAAoB,CAACC;YACzB,OAAOV,OACHU,SAASC,OAAO,CAAC,IAAIC,OAAO,GAAGlB,OAAO,CAAC,CAAC,GAAG,MAC3C,GAAGgB,WAAWhB,QAAQ;QAC5B;QAEA,KAAK,MAAMgB,YAAYT,UAAW;YAChCT,WAAWkB,UAAUD,kBAAkBC;QACzC;IACF;AACJ"}
@@ -0,0 +1,12 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Print the current working directory
4
+ *
5
+ * ### Example
6
+ * ````sh
7
+ * vnodes hello --username YourName
8
+ * ````
9
+ * @param command main command instance
10
+ */
11
+ export declare function wd(command: Command): void;
12
+ //# sourceMappingURL=wd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wd.d.ts","sourceRoot":"","sources":["../../../src/cli/wd/wd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;;;;;;;GAQG;AACH,wBAAgB,EAAE,CAAC,OAAO,EAAE,OAAO,QAIlC"}
@@ -0,0 +1,16 @@
1
+ import { cwd } from 'process';
2
+ /**
3
+ * Print the current working directory
4
+ *
5
+ * ### Example
6
+ * ````sh
7
+ * vnodes hello --username YourName
8
+ * ````
9
+ * @param command main command instance
10
+ */ export function wd(command) {
11
+ command.command('wd').action(()=>{
12
+ console.log(cwd());
13
+ });
14
+ }
15
+
16
+ //# sourceMappingURL=wd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cli/wd/wd.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { cwd } from 'process';\n\n/**\n * Print the current working directory\n *\n * ### Example\n * ````sh\n * vnodes hello --username YourName\n * ````\n * @param command main command instance\n */\nexport function wd(command: Command) {\n command.command('wd').action(() => {\n console.log(cwd());\n });\n}\n"],"names":["cwd","wd","command","action","console","log"],"mappings":"AACA,SAASA,GAAG,QAAQ,UAAU;AAE9B;;;;;;;;CAQC,GACD,OAAO,SAASC,GAAGC,OAAgB;IACjCA,QAAQA,OAAO,CAAC,MAAMC,MAAM,CAAC;QAC3BC,QAAQC,GAAG,CAACL;IACd;AACF"}
@@ -0,0 +1,6 @@
1
+ PROFILE=PROD
2
+ APP_ID=<%- fileName %>
3
+ API_PREFIX=api
4
+ PORT=3000
5
+ DB_URL=postgres://vnodes:password@localhost:5432/vnodes?schema=<%- fileName %>_db
6
+ DB_SCHEMA=<%- fileName %>_db
@@ -0,0 +1,4 @@
1
+ node_modules
2
+ # Keep environment variables out of version control
3
+ .env
4
+ /src/generated
@@ -0,0 +1,2 @@
1
+ **/package.json
2
+ !package.json
@@ -0,0 +1,29 @@
1
+ {
2
+ "jsc": {
3
+ "target": "es2022",
4
+ "parser": {
5
+ "syntax": "typescript",
6
+ "decorators": true,
7
+ "dynamicImport": true
8
+ },
9
+ "transform": {
10
+ "decoratorMetadata": true,
11
+ "legacyDecorator": true,
12
+ "verbatimModuleSyntax": true
13
+ },
14
+ "keepClassNames": true,
15
+ "externalHelpers": true,
16
+ "loose": false,
17
+ "preserveAllComments": true,
18
+ "paths": {}
19
+ },
20
+ "module": {
21
+ "type": "nodenext",
22
+ "strict": true,
23
+ "strictMode": true
24
+ },
25
+ "sourceMaps": true,
26
+ "exclude": [
27
+ ".*\\.spec\\.ts$"
28
+ ]
29
+ }
@@ -0,0 +1,5 @@
1
+ import { readJsonFile } from '@nx/devkit';
2
+ import baseConfig from '../../eslint.config.mjs';
3
+ import allowSelfImport from '../../.eslint/allow-self-import.mjs';
4
+
5
+ export default [...baseConfig, ...allowSelfImport];
@@ -0,0 +1,115 @@
1
+ {
2
+ "name": "<%- projectName %>",
3
+ "description":"- [ ] Add project description",
4
+ "version": "<%- version %>",
5
+ "author": {
6
+ "email": "<%- email %>",
7
+ "name": "<%- authorName %>",
8
+ "url": "<%- homePageUrl %>"
9
+ },
10
+ "keywords": ["nest", "api"],
11
+ "bugs": {
12
+ "email": "<%- email %>",
13
+ "url": "https://github.com/<%- orgName %>/<%- repoName %>/issues"
14
+ },
15
+ "homepage": "<%- homePageUrl %>/<%- directory %>",
16
+ "publishConfig": {
17
+ "access": "public",
18
+ "tag": "latest"
19
+ },
20
+ "funding": [
21
+ "<%- fundingUrl %>"
22
+ ],
23
+ "files": [
24
+ "dist",
25
+ "assets"
26
+ ],
27
+ "type": "module",
28
+ "main": "./dist/src/index.js",
29
+ "module": "./dist/src/index.js",
30
+ "types": "./dist/src/index.d.ts",
31
+ "exports": {
32
+ "./package.json": "./package.json",
33
+ ".": {
34
+ "types": "./dist/src/index.d.ts",
35
+ "import": "./dist/src/index.js",
36
+ "default": "./dist/src/index.js"
37
+ },
38
+ "./client": {
39
+ "types": "./dist/src/generated/prisma/client.d.ts",
40
+ "import": "./dist/src/generated/prisma/client.js",
41
+ "default": "./dist/src/generated/prisma/client.js"
42
+ },
43
+ "./browser": {
44
+ "types": "./dist/src/generated/prisma/browser.d.ts",
45
+ "import": "./dist/src/generated/prisma/browser.js",
46
+ "default": "./dist/src/generated/prisma/browser.js"
47
+ }
48
+ },
49
+ "nx": {
50
+ "sourceRoot": "<%- directory %>/src",
51
+ "tags": [
52
+ "<%- tag %>"
53
+ ],
54
+ "targets": {
55
+ "build": {
56
+ "options": {
57
+ "stripLeadingPaths": false
58
+ },
59
+ "dependsOn": [
60
+ "prisma:generate"
61
+ ]
62
+ },
63
+ "preserve": {},
64
+ "serve": {},
65
+ "prisma:migrate": {},
66
+ "prisma:reset": {},
67
+ "prisma:generate": {},
68
+ "doc":{}
69
+ }
70
+ },
71
+ "dependencies": {
72
+ "@swc/helpers": "~0.5.18"
73
+ },
74
+ "peerDependencies": {
75
+ "@nestjs/cache-manager": "^3.1.2",
76
+ "@nestjs/common": "^11.1.26",
77
+ "@nestjs/config": "^4.0.4",
78
+ "@nestjs/core": "^11.1.26",
79
+ "@nestjs/event-emitter": "^3.1.0",
80
+ "@nestjs/platform-express": "^11.1.26",
81
+ "@nestjs/schedule": "^6.1.3",
82
+ "@nestjs/swagger": "^11.4.4",
83
+ "@nestjs/throttler": "^6.5.0",
84
+ "@prisma/adapter-pg": "^7.8.0",
85
+ "@prisma/client": "^7.8.0",
86
+ "@vnodes/nest": "workspace:*",
87
+ "@vnodes/prisma": "workspace:*",
88
+ "cache-manager": "^7.2.8",
89
+ "class-transformer": "^0.5.1",
90
+ "class-validator": "^0.15.1",
91
+ "pg": "^8.21.0",
92
+ "rxjs": "^7.8.2"
93
+ },
94
+ "devDependencies": {
95
+ "@nestjs/cache-manager": "^3.1.2",
96
+ "@nestjs/common": "^11.1.26",
97
+ "@nestjs/config": "^4.0.4",
98
+ "@nestjs/core": "^11.1.26",
99
+ "@nestjs/event-emitter": "^3.1.0",
100
+ "@nestjs/platform-express": "^11.1.26",
101
+ "@nestjs/schedule": "^6.1.3",
102
+ "@nestjs/swagger": "^11.4.4",
103
+ "@nestjs/throttler": "^6.5.0",
104
+ "@prisma/adapter-pg": "^7.8.0",
105
+ "@prisma/client": "^7.8.0",
106
+ "@vnodes/nest": "workspace:*",
107
+ "@vnodes/prisma": "workspace:*",
108
+ "@vnodes/types": "workspace:*",
109
+ "cache-manager": "^7.2.8",
110
+ "class-transformer": "^0.5.1",
111
+ "class-validator": "^0.15.1",
112
+ "pg": "^8.21.0",
113
+ "rxjs": "^7.8.2"
114
+ }
115
+ }
@@ -0,0 +1,14 @@
1
+ generator client {
2
+ provider = "prisma-client"
3
+ output = "../src/generated/prisma"
4
+ }
5
+
6
+ datasource db {
7
+ provider = "postgresql"
8
+ }
9
+
10
+ model Sample {
11
+ id Int @id @default(autoincrement())
12
+
13
+ name String
14
+ }
@@ -0,0 +1,12 @@
1
+ import 'dotenv/config';
2
+ import { defineConfig } from 'prisma/config';
3
+
4
+ export default defineConfig({
5
+ schema: 'prisma/schema.prisma',
6
+ migrations: {
7
+ path: 'prisma/migrations',
8
+ },
9
+ datasource: {
10
+ url: process.env['DB_URL']!,
11
+ },
12
+ });
@@ -0,0 +1,5 @@
1
+ describe('AppController', () => {
2
+ it('should work', () => {
3
+ expect(1).toEqual(1);
4
+ });
5
+ });
@@ -0,0 +1,5 @@
1
+ import { CommonModule, Module } from '@vnodes/nest';
2
+ import { ResourceModule } from './resources/resource.module.js';
3
+
4
+ @Module({ imports: [CommonModule, ResourceModule] })
5
+ export class AppModule {}
@@ -0,0 +1,6 @@
1
+ import { bootstrap as __bootstrap } from '@vnodes/nest';
2
+ import { AppModule } from './app.module.js';
3
+
4
+ export function bootstrap() {
5
+ __bootstrap({ module: AppModule });
6
+ }
@@ -0,0 +1,9 @@
1
+ import { Module } from '@vnodes/nest';
2
+ import { SampleModule } from './sample/sample.module.js';
3
+ import { PrismaModule } from '@vnodes/prisma';
4
+ import { PrismaClient } from '@vnodes/test-api/client';
5
+
6
+ @Module({
7
+ imports: [PrismaModule.forRoot({ client: PrismaClient }), SampleModule],
8
+ })
9
+ export class ResourceModule {}
@@ -0,0 +1,52 @@
1
+ import { Body } from '@nestjs/common';
2
+ import {
3
+ DeleteOneById,
4
+ EmitRequest,
5
+ EmitResponse,
6
+ GetAll,
7
+ GetOneById,
8
+ ParamId,
9
+ PostOne,
10
+ PutOneById,
11
+ ResourceController,
12
+ } from '@vnodes/nest';
13
+ import { SampleCreateDto } from './sample.dto.js';
14
+ import { InjectDelegate } from '@vnodes/prisma';
15
+ import { Prisma } from '@vnodes/test-api/client';
16
+
17
+ @ResourceController('samples')
18
+ export class SampleController {
19
+ constructor(
20
+ @InjectDelegate(Prisma.ModelName.Sample)
21
+ protected readonly repo: Prisma.SampleDelegate,
22
+ ) {}
23
+
24
+ @EmitResponse()
25
+ @GetAll()
26
+ getAll() {
27
+ return this.repo.findMany();
28
+ }
29
+
30
+ @EmitRequest()
31
+ @GetOneById()
32
+ getOneById(@ParamId() id: number) {
33
+ return this.repo.findUnique({ where: { id } });
34
+ }
35
+
36
+ @EmitRequest()
37
+ @EmitResponse()
38
+ @PostOne()
39
+ postOne(@Body() data: SampleCreateDto) {
40
+ return this.repo.create({ data });
41
+ }
42
+
43
+ @PutOneById()
44
+ putOneById(@ParamId() id: number, @Body() data: SampleCreateDto) {
45
+ return this.repo.update({ where: { id }, data });
46
+ }
47
+
48
+ @DeleteOneById()
49
+ deleteOneById(@ParamId() id: number) {
50
+ return this.repo.delete({ where: { id } });
51
+ }
52
+ }
@@ -0,0 +1,6 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsString } from 'class-validator';
3
+
4
+ export class SampleCreateDto {
5
+ @ApiProperty() @IsString() name: string;
6
+ }
@@ -0,0 +1,10 @@
1
+ import { Module } from '@vnodes/nest';
2
+ import { SampleController } from './sample.controller.js';
3
+ import { PrismaModule } from '@vnodes/prisma';
4
+ import { Prisma } from '@vnodes/test-api/client';
5
+
6
+ @Module({
7
+ imports: [PrismaModule.forFeature({ models: [Prisma.ModelName.Sample] })],
8
+ controllers: [SampleController],
9
+ })
10
+ export class SampleModule {}
@@ -0,0 +1,7 @@
1
+ // @index(['app/**/*.ts', '!**/*.spec.ts', '!**/generated'], f => `export * from '${f.path}.js'`)
2
+ export * from './app/app.module.js';
3
+ export * from './app/bootstrap.js';
4
+ export * from './app/resources/resource.module.js';
5
+ export * from './app/resources/sample/sample.controller.js';
6
+ export * from './app/resources/sample/sample.dto.js';
7
+ export * from './app/resources/sample/sample.module.js';
@@ -0,0 +1,3 @@
1
+ import { bootstrap } from './app/bootstrap.js';
2
+
3
+ bootstrap();
@@ -0,0 +1,18 @@
1
+ import '@nestjs/cache-manager';
2
+ import '@nestjs/common';
3
+ import '@nestjs/config';
4
+ import '@nestjs/core';
5
+ import '@nestjs/event-emitter';
6
+ import '@nestjs/platform-express';
7
+ import '@nestjs/schedule';
8
+ import '@nestjs/swagger';
9
+ import '@nestjs/throttler';
10
+ import 'cache-manager';
11
+ import 'rxjs';
12
+ import 'class-validator';
13
+ import 'class-transformer';
14
+
15
+ import 'pg';
16
+ import '@prisma/client';
17
+ import '@prisma/adapter-pg';
18
+
@@ -0,0 +1,3 @@
1
+ import { bootstrap } from '../app/bootstrap.js';
2
+
3
+ bootstrap();
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist",
6
+ "emitDeclarationOnly": false
7
+ },
8
+ "include": [
9
+ "src/**/*.ts"
10
+ ],
11
+ "exclude": [
12
+ "src/**/*.spec.ts"
13
+ ]
14
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "exclude": [
4
+ "eslint.config.mjs",
5
+ "prisma.config.ts",
6
+ "vitest.config.mts",
7
+ ],
8
+ "references": [
9
+ {
10
+ "path": "./tsconfig.lib.json"
11
+ },
12
+ {
13
+ "path": "./tsconfig.spec.json"
14
+ }
15
+ ]
16
+ }
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "extends": "../../tsconfig.base.json",
3
3
  "compilerOptions": {
4
- "tsBuildInfoFile": "../../tmp/builds/packages/types/ts-build-info.json",
5
4
  "rootDir": "src",
6
5
  "outDir": "dist",
7
- "emitDeclarationOnly": true,
8
- "forceConsistentCasingInFileNames": true
9
6
  },
10
7
  "include": [
11
8
  "src/**/*.ts"
@@ -11,7 +11,7 @@
11
11
  ]
12
12
  },
13
13
  "include": [
14
- "src/**/*.spec.ts",
14
+ "src/**/*.spec.ts"
15
15
  ],
16
16
  "references": [
17
17
  {
@@ -2,9 +2,9 @@ import { defineConfig } from 'vitest/config';
2
2
 
3
3
  export default defineConfig(() => ({
4
4
  root: __dirname,
5
- cacheDir: '../../node_modules/.vite/<%- directory %>',
5
+ cacheDir: '../../node_modules/.vite/apis/test-api',
6
6
  test: {
7
- name: '<%- projectName %>',
7
+ name: '@vnodes/test-api',
8
8
  watch: false,
9
9
  globals: true,
10
10
  environment: 'node',
@@ -0,0 +1,2 @@
1
+ **/package.json
2
+ !package.json
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "<%- projectName %>",
3
+ "description":"- [ ] Add project description",
3
4
  "version": "<%- version %>",
4
5
  "author": {
5
6
  "email": "<%- email %>",
@@ -41,22 +42,11 @@
41
42
  "nx": {
42
43
  "sourceRoot": "<%- directory %>/src",
43
44
  "tags": [
44
- "lib:shared"
45
+ "<%- tag %>"
45
46
  ],
46
47
  "targets": {
47
- "build": {
48
- "executor": "@nx/js:swc",
49
- "outputs": [
50
- "{options.outputPath}"
51
- ],
52
- "options": {
53
- "outputPath": "{projectRoot}/dist",
54
- "main": "{projectRoot}/src/index.ts",
55
- "tsConfig": "{projectRoot}/tsconfig.lib.json",
56
- "skipTypeCheck": false,
57
- "stripLeadingPaths": true
58
- }
59
- }
48
+ "build": {},
49
+ "doc":{}
60
50
  }
61
51
  },
62
52
  "dependencies": {
@@ -1,12 +1,14 @@
1
- import { type Tree } from '@nx/devkit';
2
- import { type ProjectGeneratorSchema } from './schema.d.js';
1
+ import { names, type Tree } from '@nx/devkit';
2
+ import { type ProjectGeneratorSchema, type ProjectType } from './schema.d.js';
3
3
  export type NormalizedProjectGeneratorOptions = ProjectGeneratorSchema & {
4
4
  projectName: string;
5
5
  shortName: string;
6
6
  sourceRoot: string;
7
7
  targetRoot: string;
8
- };
8
+ tag: string;
9
+ } & ReturnType<typeof names>;
9
10
  export declare function normalizeProjectSchema(options: ProjectGeneratorSchema): NormalizedProjectGeneratorOptions;
11
+ export declare function autoTag(projectType: ProjectType): string;
10
12
  export declare function projectGenerator(tree: Tree, options: ProjectGeneratorSchema): Promise<void>;
11
13
  export default projectGenerator;
12
14
  //# sourceMappingURL=project.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/generators/project/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAM5D,MAAM,MAAM,iCAAiC,GAAG,sBAAsB,GAAG;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,sBAAsB,GAC9B,iCAAiC,CAoBnC;AACD,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sBAAsB,iBA0BhC;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/generators/project/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,EAEL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,KAAK,sBAAsB,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAM9E,MAAM,MAAM,iCAAiC,GAAG,sBAAsB,GAAG;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AAE7B,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,sBAAsB,GAC9B,iCAAiC,CAoBnC;AAED,wBAAgB,OAAO,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAUxD;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sBAAsB,iBA2BhC;AAED,eAAe,gBAAgB,CAAC"}
@@ -15,14 +15,33 @@ export function normalizeProjectSchema(options) {
15
15
  normalizedOptions.sourceRoot = join(__dirname, options.projectType);
16
16
  normalizedOptions.targetRoot = join(options.directory);
17
17
  normalizedOptions.projectName = `@${options.orgName}/${shortName}`;
18
+ normalizedOptions.tag = autoTag(normalizedOptions.projectType);
18
19
  normalizedOptions.email = options.email.split('@').join(`+${options.orgName}-${shortName}@`);
19
- return normalizedOptions;
20
+ return {
21
+ ...normalizedOptions,
22
+ ...names(shortName)
23
+ };
24
+ }
25
+ export function autoTag(projectType) {
26
+ switch(projectType){
27
+ case 'lib':
28
+ {
29
+ return 'lib:shared';
30
+ }
31
+ case 'cli':
32
+ case 'api':
33
+ {
34
+ return `app:${projectType}`;
35
+ }
36
+ }
20
37
  }
21
38
  export async function projectGenerator(tree, options) {
22
39
  const normalizedOptions = normalizeProjectSchema(options);
23
40
  generateFiles(tree, normalizedOptions.sourceRoot, normalizedOptions.targetRoot, {
24
- ...normalizedOptions,
25
- ...names(normalizedOptions.shortName)
41
+ ...normalizedOptions
42
+ });
43
+ generateFiles(tree, join(__dirname, 'common'), normalizedOptions.targetRoot, {
44
+ ...normalizedOptions
26
45
  });
27
46
  updateJson(tree, 'tsconfig.json', (value)=>{
28
47
  if (!value.references) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/generators/project/project.ts"],"sourcesContent":["import {\n formatFiles,\n generateFiles,\n names,\n updateJson,\n type Tree,\n} from '@nx/devkit';\nimport { dirname, join } from 'node:path';\nimport { type ProjectGeneratorSchema } from './schema.d.js';\nimport { fileURLToPath } from 'node:url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nexport type NormalizedProjectGeneratorOptions = ProjectGeneratorSchema & {\n projectName: string;\n shortName: string;\n sourceRoot: string;\n targetRoot: string;\n};\n\nexport function normalizeProjectSchema(\n options: ProjectGeneratorSchema,\n): NormalizedProjectGeneratorOptions {\n const normalizedOptions = { ...options } as NormalizedProjectGeneratorOptions;\n\n const shortName = options.directory.split('/').pop();\n\n if (typeof shortName !== 'string') {\n throw new Error(\n `Could not resolve the short name of the project form ${options.directory}`,\n );\n }\n normalizedOptions.shortName = shortName;\n normalizedOptions.sourceRoot = join(__dirname, options.projectType);\n normalizedOptions.targetRoot = join(options.directory);\n normalizedOptions.projectName = `@${options.orgName}/${shortName}`;\n\n normalizedOptions.email = options.email\n .split('@')\n .join(`+${options.orgName}-${shortName}@`);\n\n return normalizedOptions;\n}\nexport async function projectGenerator(\n tree: Tree,\n options: ProjectGeneratorSchema,\n) {\n const normalizedOptions = normalizeProjectSchema(options);\n\n generateFiles(\n tree,\n normalizedOptions.sourceRoot,\n normalizedOptions.targetRoot,\n {\n ...normalizedOptions,\n ...names(normalizedOptions.shortName),\n },\n );\n\n updateJson(tree, 'tsconfig.json', (value) => {\n if (!value.references) {\n value.references = [];\n }\n\n value.references.push({\n path: `./${options.directory}`,\n });\n\n return value;\n });\n await formatFiles(tree);\n}\n\nexport default projectGenerator;\n"],"names":["formatFiles","generateFiles","names","updateJson","dirname","join","fileURLToPath","__filename","url","__dirname","normalizeProjectSchema","options","normalizedOptions","shortName","directory","split","pop","Error","sourceRoot","projectType","targetRoot","projectName","orgName","email","projectGenerator","tree","value","references","push","path"],"mappings":"AAAA,SACEA,WAAW,EACXC,aAAa,EACbC,KAAK,EACLC,UAAU,QAEL,aAAa;AACpB,SAASC,OAAO,EAAEC,IAAI,QAAQ,YAAY;AAE1C,SAASC,aAAa,QAAQ,WAAW;AAEzC,MAAMC,aAAaD,cAAc,YAAYE,GAAG;AAChD,MAAMC,YAAYL,QAAQG;AAS1B,OAAO,SAASG,uBACdC,OAA+B;IAE/B,MAAMC,oBAAoB;QAAE,GAAGD,OAAO;IAAC;IAEvC,MAAME,YAAYF,QAAQG,SAAS,CAACC,KAAK,CAAC,KAAKC,GAAG;IAElD,IAAI,OAAOH,cAAc,UAAU;QACjC,MAAM,IAAII,MACR,CAAC,qDAAqD,EAAEN,QAAQG,SAAS,EAAE;IAE/E;IACAF,kBAAkBC,SAAS,GAAGA;IAC9BD,kBAAkBM,UAAU,GAAGb,KAAKI,WAAWE,QAAQQ,WAAW;IAClEP,kBAAkBQ,UAAU,GAAGf,KAAKM,QAAQG,SAAS;IACrDF,kBAAkBS,WAAW,GAAG,CAAC,CAAC,EAAEV,QAAQW,OAAO,CAAC,CAAC,EAAET,WAAW;IAElED,kBAAkBW,KAAK,GAAGZ,QAAQY,KAAK,CACpCR,KAAK,CAAC,KACNV,IAAI,CAAC,CAAC,CAAC,EAAEM,QAAQW,OAAO,CAAC,CAAC,EAAET,UAAU,CAAC,CAAC;IAE3C,OAAOD;AACT;AACA,OAAO,eAAeY,iBACpBC,IAAU,EACVd,OAA+B;IAE/B,MAAMC,oBAAoBF,uBAAuBC;IAEjDV,cACEwB,MACAb,kBAAkBM,UAAU,EAC5BN,kBAAkBQ,UAAU,EAC5B;QACE,GAAGR,iBAAiB;QACpB,GAAGV,MAAMU,kBAAkBC,SAAS,CAAC;IACvC;IAGFV,WAAWsB,MAAM,iBAAiB,CAACC;QACjC,IAAI,CAACA,MAAMC,UAAU,EAAE;YACrBD,MAAMC,UAAU,GAAG,EAAE;QACvB;QAEAD,MAAMC,UAAU,CAACC,IAAI,CAAC;YACpBC,MAAM,CAAC,EAAE,EAAElB,QAAQG,SAAS,EAAE;QAChC;QAEA,OAAOY;IACT;IACA,MAAM1B,YAAYyB;AACpB;AAEA,eAAeD,iBAAiB"}
1
+ {"version":3,"sources":["../../../src/generators/project/project.ts"],"sourcesContent":["import {\n formatFiles,\n generateFiles,\n names,\n updateJson,\n type Tree,\n} from '@nx/devkit';\nimport { dirname, join } from 'node:path';\nimport { type ProjectGeneratorSchema, type ProjectType } from './schema.d.js';\nimport { fileURLToPath } from 'node:url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nexport type NormalizedProjectGeneratorOptions = ProjectGeneratorSchema & {\n projectName: string;\n shortName: string;\n sourceRoot: string;\n targetRoot: string;\n tag: string;\n} & ReturnType<typeof names>;\n\nexport function normalizeProjectSchema(\n options: ProjectGeneratorSchema,\n): NormalizedProjectGeneratorOptions {\n const normalizedOptions = { ...options } as NormalizedProjectGeneratorOptions;\n\n const shortName = options.directory.split('/').pop();\n\n if (typeof shortName !== 'string') {\n throw new Error(\n `Could not resolve the short name of the project form ${options.directory}`,\n );\n }\n normalizedOptions.shortName = shortName;\n normalizedOptions.sourceRoot = join(__dirname, options.projectType);\n normalizedOptions.targetRoot = join(options.directory);\n normalizedOptions.projectName = `@${options.orgName}/${shortName}`;\n normalizedOptions.tag = autoTag(normalizedOptions.projectType);\n normalizedOptions.email = options.email\n .split('@')\n .join(`+${options.orgName}-${shortName}@`);\n\n return { ...normalizedOptions, ...names(shortName) };\n}\n\nexport function autoTag(projectType: ProjectType): string {\n switch (projectType) {\n case 'lib': {\n return 'lib:shared';\n }\n case 'cli':\n case 'api': {\n return `app:${projectType}`;\n }\n }\n}\n\nexport async function projectGenerator(\n tree: Tree,\n options: ProjectGeneratorSchema,\n) {\n const normalizedOptions = normalizeProjectSchema(options);\n\n generateFiles(\n tree,\n normalizedOptions.sourceRoot,\n normalizedOptions.targetRoot,\n { ...normalizedOptions },\n );\n\n generateFiles(tree, join(__dirname, 'common'), normalizedOptions.targetRoot, {\n ...normalizedOptions,\n });\n\n updateJson(tree, 'tsconfig.json', (value) => {\n if (!value.references) {\n value.references = [];\n }\n\n value.references.push({\n path: `./${options.directory}`,\n });\n\n return value;\n });\n await formatFiles(tree);\n}\n\nexport default projectGenerator;\n"],"names":["formatFiles","generateFiles","names","updateJson","dirname","join","fileURLToPath","__filename","url","__dirname","normalizeProjectSchema","options","normalizedOptions","shortName","directory","split","pop","Error","sourceRoot","projectType","targetRoot","projectName","orgName","tag","autoTag","email","projectGenerator","tree","value","references","push","path"],"mappings":"AAAA,SACEA,WAAW,EACXC,aAAa,EACbC,KAAK,EACLC,UAAU,QAEL,aAAa;AACpB,SAASC,OAAO,EAAEC,IAAI,QAAQ,YAAY;AAE1C,SAASC,aAAa,QAAQ,WAAW;AAEzC,MAAMC,aAAaD,cAAc,YAAYE,GAAG;AAChD,MAAMC,YAAYL,QAAQG;AAU1B,OAAO,SAASG,uBACdC,OAA+B;IAE/B,MAAMC,oBAAoB;QAAE,GAAGD,OAAO;IAAC;IAEvC,MAAME,YAAYF,QAAQG,SAAS,CAACC,KAAK,CAAC,KAAKC,GAAG;IAElD,IAAI,OAAOH,cAAc,UAAU;QACjC,MAAM,IAAII,MACR,CAAC,qDAAqD,EAAEN,QAAQG,SAAS,EAAE;IAE/E;IACAF,kBAAkBC,SAAS,GAAGA;IAC9BD,kBAAkBM,UAAU,GAAGb,KAAKI,WAAWE,QAAQQ,WAAW;IAClEP,kBAAkBQ,UAAU,GAAGf,KAAKM,QAAQG,SAAS;IACrDF,kBAAkBS,WAAW,GAAG,CAAC,CAAC,EAAEV,QAAQW,OAAO,CAAC,CAAC,EAAET,WAAW;IAClED,kBAAkBW,GAAG,GAAGC,QAAQZ,kBAAkBO,WAAW;IAC7DP,kBAAkBa,KAAK,GAAGd,QAAQc,KAAK,CACpCV,KAAK,CAAC,KACNV,IAAI,CAAC,CAAC,CAAC,EAAEM,QAAQW,OAAO,CAAC,CAAC,EAAET,UAAU,CAAC,CAAC;IAE3C,OAAO;QAAE,GAAGD,iBAAiB;QAAE,GAAGV,MAAMW,UAAU;IAAC;AACrD;AAEA,OAAO,SAASW,QAAQL,WAAwB;IAC9C,OAAQA;QACN,KAAK;YAAO;gBACV,OAAO;YACT;QACA,KAAK;QACL,KAAK;YAAO;gBACV,OAAO,CAAC,IAAI,EAAEA,aAAa;YAC7B;IACF;AACF;AAEA,OAAO,eAAeO,iBACpBC,IAAU,EACVhB,OAA+B;IAE/B,MAAMC,oBAAoBF,uBAAuBC;IAEjDV,cACE0B,MACAf,kBAAkBM,UAAU,EAC5BN,kBAAkBQ,UAAU,EAC5B;QAAE,GAAGR,iBAAiB;IAAC;IAGzBX,cAAc0B,MAAMtB,KAAKI,WAAW,WAAWG,kBAAkBQ,UAAU,EAAE;QAC3E,GAAGR,iBAAiB;IACtB;IAEAT,WAAWwB,MAAM,iBAAiB,CAACC;QACjC,IAAI,CAACA,MAAMC,UAAU,EAAE;YACrBD,MAAMC,UAAU,GAAG,EAAE;QACvB;QAEAD,MAAMC,UAAU,CAACC,IAAI,CAAC;YACpBC,MAAM,CAAC,EAAE,EAAEpB,QAAQG,SAAS,EAAE;QAChC;QAEA,OAAOc;IACT;IACA,MAAM5B,YAAY2B;AACpB;AAEA,eAAeD,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/generators/project/schema.d.ts"],"sourcesContent":["export type ProjectType = 'lib' | 'api';\n\nexport interface ProjectGeneratorSchema {\n /**\n * Project directory ex. `libs/types`\n */\n directory: string;\n\n /**\n * Project type such as `lib`, `api`\n */\n projectType: ProjectType;\n\n /**\n * Orgnaization name such as `vnodes` will be used the create the `projectName` `(@vnodes/project-name)`\n */\n orgName: string;\n\n /**\n * Repository name will be used the create relative links/urls for documentation\n */\n repoName: string;\n\n /**\n * The homepage url that serve the documentation for the project\n */\n homePageUrl: string;\n\n /**\n * Author's email addresss\n */\n email: string;\n\n /**\n * Funding url\n */\n fundingUrl: string;\n\n /**\n * Author's full name\n */\n authorName: string;\n}\n"],"names":[],"mappings":"AAEA,WAwCC"}
1
+ {"version":3,"sources":["../../../src/generators/project/schema.d.ts"],"sourcesContent":["export type ProjectType = 'lib' | 'api' | 'cli';\n\nexport interface ProjectGeneratorSchema {\n /**\n * Project directory ex. `libs/types`\n */\n directory: string;\n\n /**\n * Project type such as `lib`, `api`\n */\n projectType: ProjectType;\n\n /**\n * Orgnaization name such as `vnodes` will be used the create the `projectName` `(@vnodes/project-name)`\n */\n orgName: string;\n\n /**\n * Repository name will be used the create relative links/urls for documentation\n */\n repoName: string;\n\n /**\n * The homepage url that serve the documentation for the project\n */\n homePageUrl: string;\n\n /**\n * Author's email addresss\n */\n email: string;\n\n /**\n * Funding url\n */\n fundingUrl: string;\n\n /**\n * Author's full name\n */\n authorName: string;\n}\n"],"names":[],"mappings":"AAEA,WAwCC"}
@@ -1,4 +1,4 @@
1
- export type ProjectType = 'lib' | 'api';
1
+ export type ProjectType = 'lib' | 'api' | 'cli';
2
2
 
3
3
  export interface ProjectGeneratorSchema {
4
4
  /**
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from './cli/hello/hello.js';
2
+ export * from './cli/wd/wd.js';
1
3
  export * from './generators/project/project.js';
2
4
  export * from './generators/project/schema.d.js';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
- // @index(['./**/*.ts', '!./**/*.spec.ts'], f => `export * from '${f.path}.js'`)
1
+ // @index(['./generators/**/*.ts','./cli/*/**/*.ts', '!./**/*.spec.ts'], f => `export * from '${f.path}.js'`)
2
+ export * from './cli/hello/hello.js';
3
+ export * from './cli/wd/wd.js';
2
4
  export * from './generators/project/project.js';
3
5
  export * from './generators/project/schema.d.js';
4
6
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.spec.ts'], f => `export * from '${f.path}.js'`)\nexport * from './generators/project/project.js';\nexport * from './generators/project/schema.d.js';\n"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,cAAc,kCAAkC;AAChD,cAAc,mCAAmC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index(['./generators/**/*.ts','./cli/*/**/*.ts', '!./**/*.spec.ts'], f => `export * from '${f.path}.js'`)\nexport * from './cli/hello/hello.js';\nexport * from './cli/wd/wd.js';\nexport * from './generators/project/project.js';\nexport * from './generators/project/schema.d.js';\n"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,cAAc,uBAAuB;AACrC,cAAc,iBAAiB;AAC/B,cAAc,kCAAkC;AAChD,cAAc,mCAAmC"}
package/dist/package.json CHANGED
@@ -1,6 +1,28 @@
1
1
  {
2
2
  "name": "@vnodes/cli",
3
- "version": "0.1.4",
3
+ "description": "Vnodes cli",
4
+ "version": "0.1.5",
5
+ "author": {
6
+ "email": "robert.brightline+vnodes-prisma@gmail.com",
7
+ "name": "Robert Brightline",
8
+ "url": "https://vnodes.github.io"
9
+ },
10
+ "keywords": [
11
+ "library",
12
+ "types"
13
+ ],
14
+ "bugs": {
15
+ "email": "robert.brightline+vnodes-prisma@gmail.com",
16
+ "url": "https://github.com/vnodes/vnodes/issues"
17
+ },
18
+ "homepage": "https://vnodes.github.io/packages/prisma",
19
+ "publishConfig": {
20
+ "access": "public",
21
+ "tag": "latest"
22
+ },
23
+ "funding": [
24
+ "https://cash.app/$puqlib"
25
+ ],
4
26
  "type": "module",
5
27
  "main": "./dist/index.js",
6
28
  "module": "./dist/index.js",
@@ -14,7 +36,12 @@
14
36
  "default": "./dist/index.js"
15
37
  }
16
38
  },
39
+ "bin": {
40
+ "vnodes": "./bin/vnodes.mjs"
41
+ },
17
42
  "files": [
43
+ "bin",
44
+ "assets",
18
45
  "dist",
19
46
  "generators.json"
20
47
  ],
@@ -30,7 +57,7 @@
30
57
  "{options.outputPath}"
31
58
  ],
32
59
  "options": {
33
- "clean": false,
60
+ "clean": true,
34
61
  "outputPath": "{projectRoot}/dist",
35
62
  "main": "{projectRoot}/src/index.ts",
36
63
  "tsConfig": "{projectRoot}/tsconfig.lib.json",
@@ -54,12 +81,14 @@
54
81
  "dependsOn": [
55
82
  "build"
56
83
  ]
57
- }
84
+ },
85
+ "doc": {}
58
86
  }
59
87
  },
60
88
  "dependencies": {
61
89
  "@nx/devkit": "22.7.5",
62
- "@swc/helpers": "~0.5.18"
90
+ "@swc/helpers": "~0.5.18",
91
+ "commander": "^15.0.0"
63
92
  },
64
93
  "generators": "./generators.json"
65
94
  }
package/package.json CHANGED
@@ -1,6 +1,28 @@
1
1
  {
2
2
  "name": "@vnodes/cli",
3
- "version": "0.1.4",
3
+ "description": "Vnodes cli",
4
+ "version": "0.1.5",
5
+ "author": {
6
+ "email": "robert.brightline+vnodes-prisma@gmail.com",
7
+ "name": "Robert Brightline",
8
+ "url": "https://vnodes.github.io"
9
+ },
10
+ "keywords": [
11
+ "library",
12
+ "types"
13
+ ],
14
+ "bugs": {
15
+ "email": "robert.brightline+vnodes-prisma@gmail.com",
16
+ "url": "https://github.com/vnodes/vnodes/issues"
17
+ },
18
+ "homepage": "https://vnodes.github.io/packages/prisma",
19
+ "publishConfig": {
20
+ "access": "public",
21
+ "tag": "latest"
22
+ },
23
+ "funding": [
24
+ "https://cash.app/$puqlib"
25
+ ],
4
26
  "type": "module",
5
27
  "main": "./dist/index.js",
6
28
  "module": "./dist/index.js",
@@ -14,7 +36,12 @@
14
36
  "default": "./dist/index.js"
15
37
  }
16
38
  },
39
+ "bin": {
40
+ "vnodes": "./bin/vnodes.mjs"
41
+ },
17
42
  "files": [
43
+ "bin",
44
+ "assets",
18
45
  "dist",
19
46
  "generators.json"
20
47
  ],
@@ -30,7 +57,7 @@
30
57
  "{options.outputPath}"
31
58
  ],
32
59
  "options": {
33
- "clean": false,
60
+ "clean": true,
34
61
  "outputPath": "{projectRoot}/dist",
35
62
  "main": "{projectRoot}/src/index.ts",
36
63
  "tsConfig": "{projectRoot}/tsconfig.lib.json",
@@ -54,12 +81,14 @@
54
81
  "dependsOn": [
55
82
  "build"
56
83
  ]
57
- }
84
+ },
85
+ "doc": {}
58
86
  }
59
87
  },
60
88
  "dependencies": {
61
89
  "@nx/devkit": "22.7.5",
62
- "@swc/helpers": "~0.5.18"
90
+ "@swc/helpers": "~0.5.18",
91
+ "commander": "^15.0.0"
63
92
  },
64
93
  "generators": "./generators.json"
65
94
  }