@vnodes/cli 0.1.8 → 0.1.10

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 (137) hide show
  1. package/dist/cli/bye/bye.d.ts +12 -0
  2. package/dist/cli/bye/bye.d.ts.map +1 -0
  3. package/dist/cli/bye/bye.js +13 -0
  4. package/dist/cli/bye/bye.js.map +1 -0
  5. package/dist/cli/cli.js +5 -1
  6. package/dist/cli/cli.js.map +1 -1
  7. package/dist/cli/rm/rm.d.ts +1 -1
  8. package/dist/cli/rm/rm.d.ts.map +1 -1
  9. package/dist/cli/rm/rm.js +7 -5
  10. package/dist/cli/rm/rm.js.map +1 -1
  11. package/dist/cli/suffix/suffix.d.ts +6 -2
  12. package/dist/cli/suffix/suffix.d.ts.map +1 -1
  13. package/dist/cli/suffix/suffix.js +9 -5
  14. package/dist/cli/suffix/suffix.js.map +1 -1
  15. package/dist/cli/wd/wd.js +1 -1
  16. package/dist/cli/wd/wd.js.map +1 -1
  17. package/dist/cli/workspace/files/.eslint/allow-self-import.mjs.template +17 -0
  18. package/dist/cli/workspace/files/.eslint/common.mjs.template +22 -0
  19. package/dist/cli/workspace/files/.eslint/dependency-check.mjs.template +22 -0
  20. package/dist/cli/workspace/files/.eslint/eslint.base.mjs.template +8 -0
  21. package/dist/cli/workspace/files/.eslint/module-boundries.mjs.template +40 -0
  22. package/dist/cli/workspace/files/.eslint/no-undefined.mjs.template +16 -0
  23. package/dist/cli/workspace/files/.eslint/node-protocol.mjs.template +13 -0
  24. package/dist/cli/workspace/files/.eslint/plugin-check.mjs.template +11 -0
  25. package/dist/cli/workspace/files/.github/workflows/ci.yml.template +79 -0
  26. package/dist/cli/workspace/files/.gitignore.template +52 -0
  27. package/dist/cli/workspace/files/.husky/_/.gitignore.template +1 -0
  28. package/dist/cli/workspace/files/.husky/_/applypatch-msg.template +2 -0
  29. package/dist/cli/workspace/files/.husky/_/commit-msg.template +2 -0
  30. package/dist/cli/workspace/files/.husky/_/h.template +22 -0
  31. package/dist/cli/workspace/files/.husky/_/husky.sh.template +9 -0
  32. package/dist/cli/workspace/files/.husky/_/post-applypatch.template +2 -0
  33. package/dist/cli/workspace/files/.husky/_/post-checkout.template +2 -0
  34. package/dist/cli/workspace/files/.husky/_/post-commit.template +2 -0
  35. package/dist/cli/workspace/files/.husky/_/post-merge.template +2 -0
  36. package/dist/cli/workspace/files/.husky/_/post-rewrite.template +2 -0
  37. package/dist/cli/workspace/files/.husky/_/pre-applypatch.template +2 -0
  38. package/dist/cli/workspace/files/.husky/_/pre-auto-gc.template +2 -0
  39. package/dist/cli/workspace/files/.husky/_/pre-commit.template +2 -0
  40. package/dist/cli/workspace/files/.husky/_/pre-merge-commit.template +2 -0
  41. package/dist/cli/workspace/files/.husky/_/pre-push.template +2 -0
  42. package/dist/cli/workspace/files/.husky/_/pre-rebase.template +2 -0
  43. package/dist/cli/workspace/files/.husky/_/prepare-commit-msg.template +2 -0
  44. package/dist/cli/workspace/files/.husky/commit-msg.template +24 -0
  45. package/dist/cli/workspace/files/.husky/pre-commit.template +11 -0
  46. package/dist/cli/workspace/files/.prettierignore.template +5 -0
  47. package/dist/cli/workspace/files/.prettierrc.template +4 -0
  48. package/dist/cli/workspace/files/.verdaccio/config.yml.template +28 -0
  49. package/dist/cli/workspace/files/.vscode/_.code-snippets.template +8 -0
  50. package/dist/cli/workspace/files/.vscode/cli.code-snippets.template +25 -0
  51. package/dist/cli/workspace/files/.vscode/extensions.json.template +14 -0
  52. package/dist/cli/workspace/files/.vscode/nest.code-snippets.template +16 -0
  53. package/dist/cli/workspace/files/.vscode/settings.json.template +27 -0
  54. package/dist/cli/workspace/files/.vscode/ts.code-snippets.template +16 -0
  55. package/dist/cli/workspace/files/eslint.config.mjs.template +4 -0
  56. package/dist/cli/workspace/files/pnpm-workspace.yaml.template +13 -0
  57. package/dist/cli/workspace/files/tsconfig.json.template +5 -0
  58. package/dist/cli/workspace/files/vitest.workspace.ts.template +4 -0
  59. package/dist/cli/workspace/templates/README.md.ejs +34 -0
  60. package/dist/cli/workspace/templates/nx.json.ejs +127 -0
  61. package/dist/cli/workspace/templates/package.json.ejs +63 -0
  62. package/dist/cli/workspace/templates/project.json.ejs +14 -0
  63. package/dist/cli/workspace/templates/tsconfig.base.json.ejs +38 -0
  64. package/dist/cli/workspace/workspace.d.ts +12 -0
  65. package/dist/cli/workspace/workspace.d.ts.map +1 -0
  66. package/dist/cli/workspace/workspace.js +50 -0
  67. package/dist/cli/workspace/workspace.js.map +1 -0
  68. package/dist/generators/command/command.d.ts +5 -0
  69. package/dist/generators/command/command.d.ts.map +1 -0
  70. package/dist/generators/command/command.js +18 -0
  71. package/dist/generators/command/command.js.map +1 -0
  72. package/dist/generators/command/files/__fileName__.ts.template +17 -0
  73. package/dist/generators/command/schema.d.js +3 -0
  74. package/dist/generators/command/schema.d.js.map +1 -0
  75. package/dist/generators/command/schema.d.ts +3 -0
  76. package/dist/generators/command/schema.json +18 -0
  77. package/dist/generators/generator/files/__fileName__.ts.template +18 -0
  78. package/dist/generators/generator/files/files/__fileName__.json.template.template +3 -0
  79. package/dist/generators/generator/files/schema.d.ts.template +3 -0
  80. package/dist/generators/generator/files/schema.json.template +18 -0
  81. package/dist/generators/generator/generator.d.ts +5 -0
  82. package/dist/generators/generator/generator.d.ts.map +1 -0
  83. package/dist/generators/generator/generator.js +25 -0
  84. package/dist/generators/generator/generator.js.map +1 -0
  85. package/dist/generators/generator/schema.d.js +3 -0
  86. package/dist/generators/generator/schema.d.js.map +1 -0
  87. package/dist/generators/generator/schema.d.ts +3 -0
  88. package/dist/generators/generator/schema.json +18 -0
  89. package/dist/generators/hello/files/__fileName__.json.template +3 -0
  90. package/dist/generators/hello/hello.d.ts +5 -0
  91. package/dist/generators/hello/hello.d.ts.map +1 -0
  92. package/dist/generators/hello/hello.js +16 -0
  93. package/dist/generators/hello/hello.js.map +1 -0
  94. package/dist/generators/hello/schema.d.js +3 -0
  95. package/dist/generators/hello/schema.d.js.map +1 -0
  96. package/dist/generators/hello/schema.d.ts +3 -0
  97. package/dist/generators/hello/schema.json +18 -0
  98. package/dist/generators/project/api/package.json.template +1 -1
  99. package/dist/generators/project/api/src/app/resources/resource.module.ts.template +1 -1
  100. package/dist/generators/project/api/src/app/resources/sample/sample.controller.ts.template +1 -1
  101. package/dist/generators/project/api/src/app/resources/sample/sample.module.ts.template +1 -1
  102. package/dist/generators/project/cli/bin/__fileName__.mjs.template +3 -0
  103. package/dist/generators/project/cli/eslint.config.mjs.template +4 -0
  104. package/dist/generators/project/cli/generators.json.template +9 -0
  105. package/dist/generators/project/cli/package.json.template +96 -0
  106. package/dist/generators/project/cli/src/cli/cli.ts.template +11 -0
  107. package/dist/generators/project/cli/src/cli/hello/hello.ts.template +17 -0
  108. package/dist/generators/project/cli/src/generators/hello/files/hello.template.template +1 -0
  109. package/dist/generators/project/cli/src/generators/hello/hello.spec.ts.template +7 -0
  110. package/dist/generators/project/cli/src/generators/hello/hello.ts.template +19 -0
  111. package/dist/generators/project/cli/src/generators/hello/schema.d.ts.template +3 -0
  112. package/dist/generators/project/cli/src/generators/hello/schema.json.template +18 -0
  113. package/dist/generators/project/cli/src/index.ts.template +4 -0
  114. package/dist/generators/project/prisma/.env.template +0 -1
  115. package/dist/generators/project/prisma/package.json.template +4 -6
  116. package/dist/generators/project/prisma/prisma.config.ts.template +4 -10
  117. package/dist/generators/project/project.d.ts +2 -0
  118. package/dist/generators/project/project.d.ts.map +1 -1
  119. package/dist/generators/project/project.js +18 -13
  120. package/dist/generators/project/project.js.map +1 -1
  121. package/dist/generators/project/schema.json +2 -12
  122. package/dist/package.json +6 -2
  123. package/dist/peer-dependencies.d.ts +2 -0
  124. package/dist/peer-dependencies.d.ts.map +1 -0
  125. package/dist/peer-dependencies.js +3 -0
  126. package/dist/peer-dependencies.js.map +1 -0
  127. package/dist/utils/infer-project-configuration.d.ts +3 -0
  128. package/dist/utils/infer-project-configuration.d.ts.map +1 -0
  129. package/dist/utils/infer-project-configuration.js +13 -0
  130. package/dist/utils/infer-project-configuration.js.map +1 -0
  131. package/generators.json +16 -1
  132. package/package.json +6 -2
  133. package/dist/generators/project/api/.swcrc.template +0 -29
  134. package/dist/generators/project/api/prisma/schema.prisma.template +0 -14
  135. package/dist/generators/project/api/prisma.config.ts.template +0 -12
  136. package/dist/generators/project/api/tsconfig.app.json.template +0 -14
  137. /package/dist/generators/project/{lib → common}/.swcrc.template +0 -0
@@ -0,0 +1,4 @@
1
+ {
2
+ "singleQuote": true,
3
+ "printWidth": 140
4
+ }
@@ -0,0 +1,28 @@
1
+ # path to a directory with all packages
2
+ storage: ../tmp/local-registry/storage
3
+
4
+ # a list of other known repositories we can talk to
5
+ uplinks:
6
+ npmjs:
7
+ url: https://registry.npmjs.org/
8
+ maxage: 60m
9
+
10
+ packages:
11
+ '**':
12
+ # give all users (including non-authenticated users) full access
13
+ # because it is a local registry
14
+ access: $all
15
+ publish: $all
16
+ unpublish: $all
17
+
18
+ # if package is not available locally, proxy requests to npm registry
19
+ proxy: npmjs
20
+
21
+ # log settings
22
+ log:
23
+ type: stdout
24
+ format: pretty
25
+ level: warn
26
+
27
+ publish:
28
+ allow_offline: true # set offline to true to allow publish offline
@@ -0,0 +1,8 @@
1
+ {
2
+ "export all": {
3
+ "prefix": "export all",
4
+ "body": "// @index(['./**/*.ts', '!./**/*.spec.ts'], f => `export * from '${f.path}.js'`)",
5
+ "scope": "typescript",
6
+ "description": "Generate barral file content",
7
+ }
8
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "command": {
3
+ "prefix": "command",
4
+ "body": [
5
+ "import { Command } from 'commander';",
6
+ "",
7
+ "/**",
8
+ " * Say hello to the user",
9
+ " *",
10
+ " * ### Example",
11
+ " * ````sh",
12
+ " * vnodes $1 --username YourName",
13
+ " * ````",
14
+ " * @param command main command instance",
15
+ " */",
16
+ "export function $1(command: Command) {",
17
+ " command",
18
+ " .command('$1')",
19
+ " .requiredOption('-u, --username <string>', 'What is your name')",
20
+ " .action(({ username }) => console.log(`Hello, \\${username}`));",
21
+ "}",
22
+ ],
23
+ "scope": "typescript"
24
+ }
25
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "recommendations": [
3
+ "nrwl.angular-console",
4
+ "esbenp.prettier-vscode",
5
+ "dbaeumer.vscode-eslint",
6
+ "yzhang.markdown-all-in-one",
7
+ "redhat.vscode-yaml",
8
+ "IronGeek.vscode-env",
9
+ "JayFong.generate-index",
10
+ "Prisma.prisma",
11
+ "PKief.material-icon-theme",
12
+ "DigitalBrainstem.javascript-ejs-support"
13
+ ]
14
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "metadata decorator": {
3
+ "prefix": "metadata decorator",
4
+ "body": [
5
+ "import { SetMetadata } from '@nestjs/common';",
6
+ "import { MetadataToken } from '../constants/metadata-token.js';",
7
+ "",
8
+ "export function $1(): MethodDecorator {",
9
+ " return (...args) => {",
10
+ " SetMetadata(MetadataToken.$2, $3)(...args);",
11
+ " };",
12
+ "}",
13
+ ],
14
+ "scope": "typescript"
15
+ }
16
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "eslint.validate": [
3
+ "json"
4
+ ],
5
+ "github.copilot.enable": {
6
+ "*": false
7
+ },
8
+ "[dotenv]": {
9
+ "editor.defaultFormatter": "IronGeek.vscode-env"
10
+ },
11
+ "[markdown]": {
12
+ "editor.defaultFormatter": "yzhang.markdown-all-in-one"
13
+ },
14
+ "[yaml]": {
15
+ "editor.defaultFormatter": "redhat.vscode-yaml"
16
+ },
17
+ "[typescript]": {
18
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
19
+ "editor.codeActionsOnSave": {
20
+ "source.fixAll.prettier": "always",
21
+ "source.fixAll.eslint": "always",
22
+ "source.removeUnused.ts": "always",
23
+ "source.addMissingImports.ts": "always",
24
+ "source.removeUnusedImports": "always",
25
+ }
26
+ },
27
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "enum": {
3
+ "prefix": "enum",
4
+ "body": [
5
+ "export const $1 = { } as const;",
6
+ "export type $1 = keyof typeof $1;",
7
+ "export const $1s = Object.keys($1) as Readonly<$1[]>;",
8
+ ],
9
+ "scope": "typescript"
10
+ },
11
+ "_dirname": {
12
+ "prefix": "_dirname",
13
+ "body": "const __dirname = dirname(fileURLToPath(import.meta.url));",
14
+ "scope": "typescript"
15
+ }
16
+ }
@@ -0,0 +1,4 @@
1
+ import nx from '@nx/eslint-plugin';
2
+ import eslintBase from './.eslint/eslint.base.mjs';
3
+
4
+ export default [...eslintBase];
@@ -0,0 +1,13 @@
1
+ packages:
2
+ - 'packages/*'
3
+ - 'plugins/*'
4
+ - 'apis/*'
5
+ allowBuilds:
6
+ '@prisma/engines': true
7
+ '@scarf/scarf': true
8
+ '@swc/core': true
9
+ esbuild: true
10
+ nx: true
11
+ prisma: true
12
+ unrs-resolver: true
13
+ autoInstallPeers: true
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compileOnSave": false,
4
+ "references": []
5
+ }
@@ -0,0 +1,4 @@
1
+ export default [
2
+ '**/vite.config.{mjs,js,ts,mts}',
3
+ '**/vitest.config.{mjs,js,ts,mts}',
4
+ ];
@@ -0,0 +1,34 @@
1
+ ![Npm version](https://img.shields.io/npm/v/@<%- fileName %>/source)
2
+ ![Npm downloads](https://img.shields.io/npm/dm/@<%- fileName %>/source)
3
+ ![Build Status](https://img.shields.io/github/actions/workflow/status/<%- fileName %>/<%- fileName %>/ci.yml)
4
+ ![Bundle size](https://img.shields.io/bundlephobia/min/@<%- fileName %>/source)
5
+
6
+ <p align="center">
7
+ <img srcset="./assets/favicon.png, https://<%- fileName %>.github.io/favicon.png" alt="Logo" width="200" height="200" style="border-radius: 100%"/>
8
+ </p>
9
+
10
+ ## @<%- fileName %>/source
11
+
12
+ - [ ] Add project description for @<%- fileName %>/source
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ pnpm add -D @<%- fileName %>/source
18
+ ```
19
+
20
+ ## 💖 Support My Work
21
+
22
+ If you find my open-source contributions or the **@<%- fileName %>/source** project helpful, consider supporting my work. Your sponsorship helps me maintain these projects and explore new enterprise patterns.
23
+
24
+ [![CashApp](https://img.shields.io/badge/Sponsor%20me-%23EA4AAA.svg?style=for-the-badge&logo=github-sponsors&logoColor=white)](<https://cash.app/$puqlib>)
25
+
26
+ ---
27
+
28
+ ## 🤝 Connect with Me
29
+
30
+ <p align="left">
31
+ <a href="mailto:<%- email %>">
32
+ <img src="https://img.shields.io/badge/Email-D14836?style=for-the-badge&logo=gmail&logoColor=white" />
33
+ </a>
34
+ </p>
@@ -0,0 +1,127 @@
1
+ {
2
+ "$schema": "./node_modules/nx/schemas/nx-schema.json",
3
+ "analytics": false,
4
+ "namedInputs": {
5
+ "default": ["{projectRoot}/**/*", "sharedGlobals"],
6
+ "production": [
7
+ "default",
8
+ "!{projectRoot}/.eslintrc.json",
9
+ "!{projectRoot}/eslint.config.mjs",
10
+ "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
11
+ "!{projectRoot}/tsconfig.spec.json"
12
+ ],
13
+ "sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"]
14
+ },
15
+ "plugins": [
16
+ {
17
+ "plugin": "@nx/eslint/plugin",
18
+ "options": {
19
+ "targetName": "lint"
20
+ }
21
+ },
22
+ {
23
+ "plugin": "@nx/vitest",
24
+ "options": {
25
+ "testTargetName": "test",
26
+ "ciTargetName": "test-ci",
27
+ "testMode": "watch"
28
+ }
29
+ }
30
+ ],
31
+ "generators": {
32
+ "@nx/js:library": {
33
+ "bundler": "swc",
34
+ "unitTestRunner": "vitest",
35
+ "linter": "eslint",
36
+ "publishable": true,
37
+ "strict": true,
38
+ "skipTypeCheck": false,
39
+ "tags": "lib:shared"
40
+ },
41
+ "@vnodes/cli:project": {
42
+ "funding": "https://cash.app/$puqlib",
43
+ "authorName": "Robert Brightline",
44
+ "orgName": "<%- fileName %>",
45
+ "repoName": "<%- fileName %>",
46
+ "email": "robert.brightline@gmail.com",
47
+ "homePageUrl": "https://<%- fileName %>.github.io",
48
+ "fundingUrl": "https://cash.app/$puqlib",
49
+ "version": "0.0.1",
50
+ "workspaceVersion": "workspace:*"
51
+ },
52
+ "@nx/plugin:plugin": {
53
+ "compiler": "swc",
54
+ "unitTestRunner": "vitest",
55
+ "linter": "eslint",
56
+ "publishable": true,
57
+ "strict": true,
58
+ "skipTypeCheck": false,
59
+ "tags": "app:cli"
60
+ }
61
+ },
62
+ "targetDefaults": {
63
+ "@nx/js:swc": {
64
+ "cache": true,
65
+ "inputs": ["production", "^production"]
66
+ },
67
+ "test": {
68
+ "inputs": ["default", "^default"]
69
+ },
70
+ "build": {
71
+ "executor": "@nx/js:swc",
72
+ "cache": true,
73
+ "dependsOn": ["^build"],
74
+ "inputs": ["production", "^production"],
75
+ "outputs": ["{options.outputPath}"],
76
+ "options": {
77
+ "outputPath": "{projectRoot}/dist",
78
+ "main": "{projectRoot}/src/main.ts",
79
+ "tsConfig": "{projectRoot}/tsconfig.lib.json",
80
+ "skipTypeCheck": false,
81
+ "stripLeadingPaths": true
82
+ }
83
+ },
84
+ "serve": {
85
+ "executor": "@nx/js:node",
86
+ "options": {
87
+ "buildTarget": "build",
88
+ "watch": true
89
+ }
90
+ },
91
+ "prisma:migrate": {
92
+ "executor": "nx:run-commands",
93
+ "inputs": ["default"],
94
+ "options": {
95
+ "command": "pnpm prisma migrate dev --name updated",
96
+ "cwd": "{projectRoot}"
97
+ }
98
+ },
99
+ "prisma:reset": {
100
+ "executor": "nx:run-commands",
101
+ "inputs": ["default"],
102
+ "options": {
103
+ "command": "pnpm prisma migrate reset -f",
104
+ "cwd": "{projectRoot}"
105
+ }
106
+ },
107
+ "prisma:generate": {
108
+ "executor": "nx:run-commands",
109
+ "inputs": ["default"],
110
+ "options": {
111
+ "command": "pnpm prisma generate",
112
+ "cwd": "{projectRoot}"
113
+ }
114
+ },
115
+ "doc": {
116
+ "executor": "nx:run-commands",
117
+
118
+ "inputs": ["^default"],
119
+ "options": {
120
+ "command": "pnpm typedoc --entryPoints {projectRoot}/src/index.ts --out public/{projectRoot} --tsconfig {projectRoot}/tsconfig.lib.json --skipErrorChecking true"
121
+ }
122
+ }
123
+ },
124
+ "release": {
125
+ "projects": ["tag:lib:*", "tag:app:cli"]
126
+ }
127
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@<%- fileName %>/source",
3
+ "version": "0.0.0",
4
+ "license": "MIT",
5
+ "scripts": {
6
+ "prepare": "husky"
7
+ },
8
+ "private": true,
9
+ "nx": {
10
+ "includedScripts": [],
11
+ "targets": {
12
+ "local-registry": {
13
+ "executor": "@nx/js:verdaccio",
14
+ "options": {
15
+ "port": 4873,
16
+ "config": ".verdaccio/config.yml",
17
+ "storage": "tmp/local-registry/storage"
18
+ }
19
+ }
20
+ }
21
+ },
22
+ "devDependencies": {
23
+ "@eslint/js": "^9.8.0",
24
+ "@nx/esbuild": "22.7.5",
25
+ "@nx/eslint": "22.7.5",
26
+ "@nx/eslint-plugin": "22.7.5",
27
+ "@nx/js": "22.7.5",
28
+ "@nx/node": "^22.7.5",
29
+ "@nx/plugin": "^22.7.5",
30
+ "@nx/vite": "22.7.5",
31
+ "@nx/vitest": "22.7.5",
32
+ "@swc-node/register": "~1.11.1",
33
+ "@swc/cli": "~0.8.0",
34
+ "@swc/core": "~1.15.5",
35
+ "@swc/helpers": "~0.5.18",
36
+ "@types/node": "20.19.9",
37
+ "@vitest/coverage-v8": "~4.1.0",
38
+ "@vnodes/cli": "0.1.20",
39
+ "@vnodes/fs": "0.1.20",
40
+ "chokidar": "^5.0.0",
41
+ "dotenv": "^17.4.2",
42
+ "esbuild": "^0.27.0",
43
+ "eslint": "^9.8.0",
44
+ "eslint-config-prettier": "^10.0.0",
45
+ "eslint-plugin-unicorn": "^66.0.0",
46
+ "husky": "^9.1.7",
47
+ "jsdom": "^27.1.0",
48
+ "jsonc-eslint-parser": "^2.1.0",
49
+ "nx": "22.7.5",
50
+ "prettier": "~3.6.2",
51
+ "prisma": "^7.8.0",
52
+ "tslib": "^2.3.0",
53
+ "typedoc": "^0.28.19",
54
+ "typescript": "~5.9.2",
55
+ "typescript-eslint": "^8.40.0",
56
+ "verdaccio": "^6.3.2",
57
+ "vite": "^8.0.0",
58
+ "vitest": "~4.1.0"
59
+ },
60
+ "dependencies": {
61
+ "@nx/devkit": "22.7.5"
62
+ }
63
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@<%- fileName %>/source",
3
+ "$schema": "node_modules/nx/schemas/project-schema.json",
4
+ "targets": {
5
+ "local-registry": {
6
+ "executor": "@nx/js:verdaccio",
7
+ "options": {
8
+ "port": 4873,
9
+ "config": ".verdaccio/config.yml",
10
+ "storage": "tmp/local-registry/storage"
11
+ }
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "emitDeclarationOnly": true,
5
+ "forceConsistentCasingInFileNames": true,
6
+ "declarationMap": true,
7
+ "importHelpers": true,
8
+ "isolatedModules": false,
9
+ "allowUnusedLabels": true,
10
+ "lib": [
11
+ "ES2022"
12
+ ],
13
+ "types": [
14
+ "node"
15
+ ],
16
+ "module": "nodenext",
17
+ "moduleResolution": "nodenext",
18
+ "exactOptionalPropertyTypes": true,
19
+ "experimentalDecorators": true,
20
+ "emitDecoratorMetadata": true,
21
+ "noUnusedParameters": false,
22
+ "noUnusedLocals": true,
23
+ "verbatimModuleSyntax": true,
24
+ "noEmitOnError": true,
25
+ "noFallthroughCasesInSwitch": true,
26
+ "noImplicitOverride": true,
27
+ "noImplicitReturns": true,
28
+ "skipLibCheck": true,
29
+ "strict": true,
30
+ "strictFunctionTypes": true,
31
+ "strictPropertyInitialization": false,
32
+ "strictNullChecks": true,
33
+ "target": "es2022",
34
+ "customConditions": [
35
+ "@<%- fileName %>/source"
36
+ ]
37
+ }
38
+ }
@@ -0,0 +1,12 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Generate nx workspace
4
+ *
5
+ * ### Example
6
+ * ````sh
7
+ * vnodes workspace --name WorkSpaceName
8
+ * ````
9
+ * @param command main command instance
10
+ */
11
+ export declare function workspace(command: Command): void;
12
+ //# sourceMappingURL=workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/cli/workspace/workspace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoCpC;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,QASzC"}
@@ -0,0 +1,50 @@
1
+ import { copyFilesGenerator, filesGenerator, readTextFile, writeTextFile } from '@vnodes/fs';
2
+ import { basename, dirname, join, relative } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import ejs from 'ejs';
5
+ import { names } from '@nx/devkit';
6
+ import { mkdir } from 'node:fs/promises';
7
+ import { cwd } from 'node:process';
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ async function geneateFiles(name) {
10
+ const removeTemplateSuffix = (filePath)=>{
11
+ return filePath.slice(0, -'.template'.length);
12
+ };
13
+ const copyFilesGeneartor = copyFilesGenerator(join(__dirname, 'files'), join(name), removeTemplateSuffix);
14
+ for await (const entry of copyFilesGeneartor){
15
+ console.log(`[ Created ] ${entry}`);
16
+ }
17
+ }
18
+ async function generateTemplates(name) {
19
+ const templateRootDir = join(__dirname, 'templates');
20
+ const templateFiles = filesGenerator(templateRootDir);
21
+ for await (const filePath of templateFiles){
22
+ const templateFilePath = join(filePath, basename(filePath));
23
+ const templateFileContent = await readTextFile(templateFilePath);
24
+ const targetTemplateFilePath = relative(cwd(), templateFilePath).slice(0, -'.ejs'.length);
25
+ await mkdir(dirname(targetTemplateFilePath), {
26
+ recursive: true
27
+ });
28
+ const renderedContent = ejs.render(templateFileContent, {
29
+ ...names(name),
30
+ email: `${name}@${name}.com`
31
+ });
32
+ await writeTextFile(targetTemplateFilePath, renderedContent);
33
+ }
34
+ }
35
+ /**
36
+ * Generate nx workspace
37
+ *
38
+ * ### Example
39
+ * ````sh
40
+ * vnodes workspace --name WorkSpaceName
41
+ * ````
42
+ * @param command main command instance
43
+ */ export function workspace(command) {
44
+ command.command('workspace').description('Generate a nx workspace').requiredOption('-n, --name <string>', 'Project name').action(async ({ name })=>{
45
+ await geneateFiles(name);
46
+ await generateTemplates(name);
47
+ });
48
+ }
49
+
50
+ //# sourceMappingURL=workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cli/workspace/workspace.ts"],"sourcesContent":["import { copyFilesGenerator, filesGenerator, readTextFile, writeTextFile } from '@vnodes/fs';\nimport { Command } from 'commander';\nimport { basename, dirname, join, relative } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport ejs from 'ejs';\nimport { names } from '@nx/devkit';\nimport { mkdir } from 'node:fs/promises';\nimport { cwd } from 'node:process';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nasync function geneateFiles(name: string) {\n const removeTemplateSuffix = (filePath: string) => {\n return filePath.slice(0, -'.template'.length);\n };\n const copyFilesGeneartor = copyFilesGenerator(join(__dirname, 'files'), join(name), removeTemplateSuffix);\n\n for await (const entry of copyFilesGeneartor) {\n console.log(`[ Created ] ${entry}`);\n }\n}\n\nasync function generateTemplates(name: string) {\n const templateRootDir = join(__dirname, 'templates');\n const templateFiles = filesGenerator(templateRootDir);\n\n for await (const filePath of templateFiles) {\n const templateFilePath = join(filePath, basename(filePath));\n const templateFileContent = await readTextFile(templateFilePath);\n const targetTemplateFilePath = relative(cwd(), templateFilePath).slice(0, -'.ejs'.length);\n\n await mkdir(dirname(targetTemplateFilePath), { recursive: true });\n const renderedContent = ejs.render(templateFileContent, { ...names(name), email: `${name}@${name}.com` });\n await writeTextFile(targetTemplateFilePath, renderedContent);\n }\n}\n\n/**\n * Generate nx workspace\n *\n * ### Example\n * ````sh\n * vnodes workspace --name WorkSpaceName\n * ````\n * @param command main command instance\n */\nexport function workspace(command: Command) {\n command\n .command('workspace')\n .description('Generate a nx workspace')\n .requiredOption('-n, --name <string>', 'Project name')\n .action(async ({ name }) => {\n await geneateFiles(name);\n await generateTemplates(name);\n });\n}\n"],"names":["copyFilesGenerator","filesGenerator","readTextFile","writeTextFile","basename","dirname","join","relative","fileURLToPath","ejs","names","mkdir","cwd","__dirname","url","geneateFiles","name","removeTemplateSuffix","filePath","slice","length","copyFilesGeneartor","entry","console","log","generateTemplates","templateRootDir","templateFiles","templateFilePath","templateFileContent","targetTemplateFilePath","recursive","renderedContent","render","email","workspace","command","description","requiredOption","action"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,cAAc,EAAEC,YAAY,EAAEC,aAAa,QAAQ,aAAa;AAE7F,SAASC,QAAQ,EAAEC,OAAO,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,YAAY;AAC9D,SAASC,aAAa,QAAQ,WAAW;AACzC,OAAOC,SAAS,MAAM;AACtB,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,GAAG,QAAQ,eAAe;AAEnC,MAAMC,YAAYR,QAAQG,cAAc,YAAYM,GAAG;AAEvD,eAAeC,aAAaC,IAAY;IACtC,MAAMC,uBAAuB,CAACC;QAC5B,OAAOA,SAASC,KAAK,CAAC,GAAG,CAAC,YAAYC,MAAM;IAC9C;IACA,MAAMC,qBAAqBrB,mBAAmBM,KAAKO,WAAW,UAAUP,KAAKU,OAAOC;IAEpF,WAAW,MAAMK,SAASD,mBAAoB;QAC5CE,QAAQC,GAAG,CAAC,CAAC,YAAY,EAAEF,OAAO;IACpC;AACF;AAEA,eAAeG,kBAAkBT,IAAY;IAC3C,MAAMU,kBAAkBpB,KAAKO,WAAW;IACxC,MAAMc,gBAAgB1B,eAAeyB;IAErC,WAAW,MAAMR,YAAYS,cAAe;QAC1C,MAAMC,mBAAmBtB,KAAKY,UAAUd,SAASc;QACjD,MAAMW,sBAAsB,MAAM3B,aAAa0B;QAC/C,MAAME,yBAAyBvB,SAASK,OAAOgB,kBAAkBT,KAAK,CAAC,GAAG,CAAC,OAAOC,MAAM;QAExF,MAAMT,MAAMN,QAAQyB,yBAAyB;YAAEC,WAAW;QAAK;QAC/D,MAAMC,kBAAkBvB,IAAIwB,MAAM,CAACJ,qBAAqB;YAAE,GAAGnB,MAAMM,KAAK;YAAEkB,OAAO,GAAGlB,KAAK,CAAC,EAAEA,KAAK,IAAI,CAAC;QAAC;QACvG,MAAMb,cAAc2B,wBAAwBE;IAC9C;AACF;AAEA;;;;;;;;CAQC,GACD,OAAO,SAASG,UAAUC,OAAgB;IACxCA,QACGA,OAAO,CAAC,aACRC,WAAW,CAAC,2BACZC,cAAc,CAAC,uBAAuB,gBACtCC,MAAM,CAAC,OAAO,EAAEvB,IAAI,EAAE;QACrB,MAAMD,aAAaC;QACnB,MAAMS,kBAAkBT;IAC1B;AACJ"}
@@ -0,0 +1,5 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ import type { CommandGeneratorSchema } from './schema.js';
3
+ export declare function commandGenerator(tree: Tree, options: CommandGeneratorSchema): Promise<void>;
4
+ export default commandGenerator;
5
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/generators/command/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAE1E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAO1D,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,iBAQjF;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { formatFiles, generateFiles, names } from '@nx/devkit';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { dirname, join } from 'node:path';
4
+ import { inferProjectConfiguration } from '../../utils/infer-project-configuration.js';
5
+ const __dirname = dirname(fileURLToPath(import.meta.url));
6
+ export async function commandGenerator(tree, options) {
7
+ const sourceRoot = join(__dirname, 'files');
8
+ const projectConfig = inferProjectConfiguration(tree);
9
+ const projectRoot = projectConfig.root;
10
+ const targetRoot = `${projectRoot}/src/cli/${options.name}`;
11
+ generateFiles(tree, sourceRoot, targetRoot, {
12
+ ...names(options.name)
13
+ });
14
+ await formatFiles(tree);
15
+ }
16
+ export default commandGenerator;
17
+
18
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/generators/command/command.ts"],"sourcesContent":["import { formatFiles, generateFiles, names, type Tree } from '@nx/devkit';\n\nimport type { CommandGeneratorSchema } from './schema.js';\nimport { fileURLToPath } from 'node:url';\nimport { dirname, join } from 'node:path';\nimport { inferProjectConfiguration } from '../../utils/infer-project-configuration.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport async function commandGenerator(tree: Tree, options: CommandGeneratorSchema) {\n const sourceRoot = join(__dirname, 'files');\n const projectConfig = inferProjectConfiguration(tree);\n const projectRoot = projectConfig.root;\n const targetRoot = `${projectRoot}/src/cli/${options.name}`;\n\n generateFiles(tree, sourceRoot, targetRoot, { ...names(options.name) });\n await formatFiles(tree);\n}\n\nexport default commandGenerator;\n"],"names":["formatFiles","generateFiles","names","fileURLToPath","dirname","join","inferProjectConfiguration","__dirname","url","commandGenerator","tree","options","sourceRoot","projectConfig","projectRoot","root","targetRoot","name"],"mappings":"AAAA,SAASA,WAAW,EAAEC,aAAa,EAAEC,KAAK,QAAmB,aAAa;AAG1E,SAASC,aAAa,QAAQ,WAAW;AACzC,SAASC,OAAO,EAAEC,IAAI,QAAQ,YAAY;AAC1C,SAASC,yBAAyB,QAAQ,6CAA6C;AAEvF,MAAMC,YAAYH,QAAQD,cAAc,YAAYK,GAAG;AAEvD,OAAO,eAAeC,iBAAiBC,IAAU,EAAEC,OAA+B;IAChF,MAAMC,aAAaP,KAAKE,WAAW;IACnC,MAAMM,gBAAgBP,0BAA0BI;IAChD,MAAMI,cAAcD,cAAcE,IAAI;IACtC,MAAMC,aAAa,GAAGF,YAAY,SAAS,EAAEH,QAAQM,IAAI,EAAE;IAE3DhB,cAAcS,MAAME,YAAYI,YAAY;QAAE,GAAGd,MAAMS,QAAQM,IAAI,CAAC;IAAC;IACrE,MAAMjB,YAAYU;AACpB;AAEA,eAAeD,iBAAiB"}
@@ -0,0 +1,17 @@
1
+ import { Command } from 'commander';
2
+
3
+ /**
4
+ * Say <%- fileName %>
5
+ *
6
+ * ### Example
7
+ * ````sh
8
+ * vnodes <%- fileName %> --username YourName
9
+ * ````
10
+ * @param command main command instance
11
+ */
12
+ export function <%- fileName %>(command: Command) {
13
+ command
14
+ .command('<%- fileName %>')
15
+ .requiredOption('-u, --username <string>', 'What is your name')
16
+ .action(({ username }) => console.log(`Hello, ${username}`));
17
+ }
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=schema.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/generators/command/schema.d.ts"],"sourcesContent":["export interface CommandGeneratorSchema {\n name: string;\n}\n"],"names":[],"mappings":"AAAA,WAEC"}
@@ -0,0 +1,3 @@
1
+ export interface CommandGeneratorSchema {
2
+ name: string;
3
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft-07/schema#",
3
+ "$id": "command",
4
+ "title": "Command",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "",
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
14
+ "x-prompt": "What name would you like to use?"
15
+ }
16
+ },
17
+ "required": ["name"]
18
+ }
@@ -0,0 +1,18 @@
1
+ import { formatFiles, generateFiles, names, type Tree } from '@nx/devkit';
2
+
3
+ import type { <%- className %>GeneratorSchema } from './schema.js';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { dirname, join, basename } from 'node:path';
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+
9
+ export async function <%- propertyName %>Generator(tree: Tree, options: <%- className %>GeneratorSchema) {
10
+ const name = basename(options.directory);
11
+ const sourceRoot = join(__dirname, 'files');
12
+ const targetRoot = options.directory;
13
+
14
+ generateFiles(tree, sourceRoot, targetRoot, { ...names(name) });
15
+ await formatFiles(tree);
16
+ }
17
+
18
+ export default <%- propertyName %>Generator;