@vigajs/create 0.1.0 → 0.1.2
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/index.js +8 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ const MIN_NODE = [24, 13];
|
|
|
7
7
|
const NAME_FORMAT = /^[a-z0-9][a-z0-9._-]{0,213}$/;
|
|
8
8
|
|
|
9
9
|
const VERSIONS = {
|
|
10
|
-
'
|
|
10
|
+
viga: 'npm:@vigajs/core@^0.1.2',
|
|
11
11
|
express: '^5.1.0',
|
|
12
12
|
zod: '^4.0.0',
|
|
13
13
|
valibot: '^1.5.0',
|
|
@@ -35,7 +35,7 @@ function pickVersions(names) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function projectFiles(name, schema, manager) {
|
|
38
|
-
const dependencies = ['
|
|
38
|
+
const dependencies = ['viga', 'express', ...(schema === 'none' ? [] : [schema])];
|
|
39
39
|
const packageJson = {
|
|
40
40
|
name,
|
|
41
41
|
version: '0.1.0',
|
|
@@ -52,16 +52,16 @@ function projectFiles(name, schema, manager) {
|
|
|
52
52
|
|
|
53
53
|
const files = {
|
|
54
54
|
'package.json': `${JSON.stringify(packageJson, null, 2)}\n`,
|
|
55
|
-
'tsconfig.json': `${JSON.stringify({ extends: '
|
|
55
|
+
'tsconfig.json': `${JSON.stringify({ extends: 'viga/tsconfig.json', include: ['src'] }, null, 2)}\n`,
|
|
56
56
|
'.gitignore': 'node_modules\ndist\n.env\n',
|
|
57
|
-
'src/main.ts': `import { createApp } from '
|
|
57
|
+
'src/main.ts': `import { createApp } from 'viga';
|
|
58
58
|
import { AppModule } from './app.module.ts';
|
|
59
59
|
|
|
60
60
|
const app = createApp({ rootModule: AppModule }).enableShutdownHooks();
|
|
61
61
|
|
|
62
62
|
await app.listen();
|
|
63
63
|
`,
|
|
64
|
-
'src/app.module.ts': `import { Module } from '
|
|
64
|
+
'src/app.module.ts': `import { Module } from 'viga';
|
|
65
65
|
import { HelloModule } from './hello/hello.module.ts';
|
|
66
66
|
|
|
67
67
|
@Module({
|
|
@@ -69,7 +69,7 @@ import { HelloModule } from './hello/hello.module.ts';
|
|
|
69
69
|
})
|
|
70
70
|
export class AppModule {}
|
|
71
71
|
`,
|
|
72
|
-
'src/hello/hello.module.ts': `import { Module } from '
|
|
72
|
+
'src/hello/hello.module.ts': `import { Module } from 'viga';
|
|
73
73
|
import { HelloController } from './hello.controller.ts';
|
|
74
74
|
import { HelloService } from './hello.service.ts';
|
|
75
75
|
|
|
@@ -79,7 +79,7 @@ import { HelloService } from './hello.service.ts';
|
|
|
79
79
|
})
|
|
80
80
|
export class HelloModule {}
|
|
81
81
|
`,
|
|
82
|
-
'src/hello/hello.controller.ts': `import { Controller, Get, Public, inject } from '
|
|
82
|
+
'src/hello/hello.controller.ts': `import { Controller, Get, Public, inject } from 'viga';
|
|
83
83
|
import { HelloService } from './hello.service.ts';
|
|
84
84
|
|
|
85
85
|
@Controller('/hello')
|
|
@@ -93,7 +93,7 @@ export class HelloController {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
`,
|
|
96
|
-
'src/hello/hello.service.ts': `import { Injectable } from '
|
|
96
|
+
'src/hello/hello.service.ts': `import { Injectable } from 'viga';
|
|
97
97
|
|
|
98
98
|
@Injectable()
|
|
99
99
|
export class HelloService {
|