servcraft 0.1.6 → 0.1.7
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 +31 -3
- package/ROADMAP.md +320 -0
- package/dist/cli/index.cjs +2162 -71
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +2162 -71
- package/dist/cli/index.js.map +1 -1
- package/package.json +2 -2
- package/src/cli/commands/add-module.ts +1 -29
- package/src/cli/commands/init.ts +441 -65
- package/src/cli/index.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "servcraft",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "A modular, production-ready Node.js backend framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@fastify/cookie": "^9.3.1",
|
|
52
52
|
"@fastify/cors": "^9.0.1",
|
|
53
53
|
"@fastify/helmet": "^11.1.1",
|
|
54
|
-
"@fastify/jwt": "^
|
|
54
|
+
"@fastify/jwt": "^7.2.4",
|
|
55
55
|
"@fastify/multipart": "^8.3.0",
|
|
56
56
|
"@fastify/rate-limit": "^9.1.0",
|
|
57
57
|
"@fastify/swagger": "^8.15.0",
|
|
@@ -620,34 +620,6 @@ export interface ${name.charAt(0).toUpperCase() + name.slice(1)}Data {
|
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
622
|
|
|
623
|
-
/**
|
|
624
|
-
* Helper: Get the servcraft package directory (works for both npm installed and local dev)
|
|
625
|
-
*/
|
|
626
|
-
function getServercraftModulesDir(): string {
|
|
627
|
-
// Try node_modules first (when installed as dependency)
|
|
628
|
-
const nodeModulesPath = path.join(process.cwd(), 'node_modules', 'servcraft', 'src', 'modules');
|
|
629
|
-
|
|
630
|
-
// Try global npm path
|
|
631
|
-
const globalPath = path.join(
|
|
632
|
-
process.env.npm_config_prefix || '/usr/local',
|
|
633
|
-
'lib',
|
|
634
|
-
'node_modules',
|
|
635
|
-
'servcraft',
|
|
636
|
-
'src',
|
|
637
|
-
'modules'
|
|
638
|
-
);
|
|
639
|
-
|
|
640
|
-
// For CLI execution, use import.meta.url to find package location
|
|
641
|
-
const cliPath = path.resolve(
|
|
642
|
-
path.dirname(new URL(import.meta.url).pathname),
|
|
643
|
-
'..',
|
|
644
|
-
'..',
|
|
645
|
-
'modules'
|
|
646
|
-
);
|
|
647
|
-
|
|
648
|
-
return nodeModulesPath; // Primary path - will check existence in generateModuleFiles
|
|
649
|
-
}
|
|
650
|
-
|
|
651
623
|
/**
|
|
652
624
|
* Helper: Find servcraft modules source directory
|
|
653
625
|
*/
|
|
@@ -683,7 +655,7 @@ async function findServercraftModules(): Promise<string | null> {
|
|
|
683
655
|
async function generateModuleFiles(moduleName: string, moduleDir: string): Promise<void> {
|
|
684
656
|
// Map module names to their directory names in servcraft
|
|
685
657
|
const moduleNameMap: Record<string, string> = {
|
|
686
|
-
|
|
658
|
+
users: 'user',
|
|
687
659
|
'rate-limit': 'rate-limit',
|
|
688
660
|
'feature-flag': 'feature-flag',
|
|
689
661
|
'api-versioning': 'api-versioning',
|