@xeno-js/cli 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/dist/index.js +3675 -18
- package/dist/index.js.map +1 -0
- package/eslint.config.mjs +1 -0
- package/package.json +4 -3
- package/tsup.config.ts +13 -0
- package/dist/domain/contracts/icommand-cli.contracts.js +0 -2
- package/dist/domain/contracts/icommand-runner.contracts.js +0 -2
- package/dist/domain/contracts/idispatch.contracts.js +0 -2
- package/dist/domain/contracts/ifile-service.contracts.js +0 -2
- package/dist/domain/contracts/igenerator.contracts.js +0 -2
- package/dist/domain/contracts/index.js +0 -2
- package/dist/domain/contracts/iscaffold-strategy.contracts.js +0 -2
- package/dist/domain/index.js +0 -2
- package/dist/generator.contracts.js +0 -13
- package/dist/infrastructure/bootstrap/bootstrapper.js +0 -32
- package/dist/infrastructure/bootstrap/index.js +0 -17
- package/dist/infrastructure/builder/builder.js +0 -16
- package/dist/infrastructure/builder/builder.test.js +0 -30
- package/dist/infrastructure/builder/index.js +0 -17
- package/dist/infrastructure/command_launcher/command.utils.js +0 -30
- package/dist/infrastructure/command_launcher/index.js +0 -2
- package/dist/infrastructure/commands/command-runner.service.js +0 -36
- package/dist/infrastructure/commands/generate.command.js +0 -48
- package/dist/infrastructure/commands/help.command.js +0 -44
- package/dist/infrastructure/commands/index.js +0 -20
- package/dist/infrastructure/commands/new-project.command.js +0 -43
- package/dist/infrastructure/dispatcher/dispatcher.js +0 -39
- package/dist/infrastructure/dispatcher/index.js +0 -17
- package/dist/infrastructure/file/file.service.js +0 -13
- package/dist/infrastructure/file/index.js +0 -17
- package/dist/infrastructure/generators/bootstrap.generator.js +0 -118
- package/dist/infrastructure/generators/core/bootstrap.generator.js +0 -118
- package/dist/infrastructure/generators/core/command/cqrs.generator.js +0 -49
- package/dist/infrastructure/generators/core/command/generate-command.generator.js +0 -163
- package/dist/infrastructure/generators/core/command/generate-query.generator.js +0 -131
- package/dist/infrastructure/generators/core/drizzle-sql-lite.generator.js +0 -78
- package/dist/infrastructure/generators/core/drizzle.generator.js +0 -85
- package/dist/infrastructure/generators/core/env.generator.js +0 -69
- package/dist/infrastructure/generators/core/index.js +0 -25
- package/dist/infrastructure/generators/core/main.generator.js +0 -45
- package/dist/infrastructure/generators/core/packagejson.generator.js +0 -78
- package/dist/infrastructure/generators/core/readme.generator.js +0 -431
- package/dist/infrastructure/generators/core/registry.generator.js +0 -46
- package/dist/infrastructure/generators/core/tsconfig.generator.js +0 -41
- package/dist/infrastructure/generators/core-packagejson.generator.js +0 -78
- package/dist/infrastructure/generators/drizzle-sql-lite.generator.js +0 -78
- package/dist/infrastructure/generators/drizzle.generator.js +0 -85
- package/dist/infrastructure/generators/env-vue.generator.js +0 -40
- package/dist/infrastructure/generators/env.generator.js +0 -71
- package/dist/infrastructure/generators/gitignore.generator.js +0 -62
- package/dist/infrastructure/generators/index.js +0 -26
- package/dist/infrastructure/generators/main.generator.js +0 -45
- package/dist/infrastructure/generators/readme.generator.js +0 -431
- package/dist/infrastructure/generators/registry.generator.js +0 -46
- package/dist/infrastructure/generators/tsconfig-vue.generator.js +0 -39
- package/dist/infrastructure/generators/tsconfig.generator.js +0 -41
- package/dist/infrastructure/generators/vite-config.generator.js +0 -39
- package/dist/infrastructure/generators/vue/app-vue.generator.js +0 -26
- package/dist/infrastructure/generators/vue/bootstrap-ts.generator.js +0 -59
- package/dist/infrastructure/generators/vue/command_query/cqrs.generator.js +0 -36
- package/dist/infrastructure/generators/vue/command_query/generate-command-vue.generator.js +0 -139
- package/dist/infrastructure/generators/vue/command_query/generate-query-vue.generator.js +0 -147
- package/dist/infrastructure/generators/vue/env.generator.js +0 -40
- package/dist/infrastructure/generators/vue/index-html.generator.js +0 -29
- package/dist/infrastructure/generators/vue/index.js +0 -28
- package/dist/infrastructure/generators/vue/main.generator.js +0 -45
- package/dist/infrastructure/generators/vue/packagejson.generator.js +0 -59
- package/dist/infrastructure/generators/vue/readme.generator.js +0 -394
- package/dist/infrastructure/generators/vue/registry-ts.generator.js +0 -28
- package/dist/infrastructure/generators/vue/router.generator.js +0 -33
- package/dist/infrastructure/generators/vue/tailwind.generator.js +0 -19
- package/dist/infrastructure/generators/vue/tsconfig.generator.js +0 -39
- package/dist/infrastructure/generators/vue/use-app.generator.js +0 -43
- package/dist/infrastructure/generators/vue/vite-config.generator.js +0 -39
- package/dist/infrastructure/generators/vue-packagejson.generator.js +0 -59
- package/dist/infrastructure/generators/vue-readme.generator.js +0 -53
- package/dist/infrastructure/generators/vue-source-files.generator.js +0 -136
- package/dist/infrastructure/index.js +0 -21
- package/dist/infrastructure/strategies/core-scaffold.strategy.js +0 -99
- package/dist/infrastructure/strategies/index.js +0 -18
- package/dist/infrastructure/strategies/vue-scaffold.strategy.js +0 -79
- package/dist/scaffolding.engine.js +0 -60
- package/dist/shared/constants/command.constants.js +0 -19
- package/dist/shared/constants/core.constants.js +0 -10
- package/dist/shared/constants/index.js +0 -18
- package/dist/shared/index.js +0 -18
- package/dist/shared/types/common.types.js +0 -2
- package/dist/shared/types/index.js +0 -2
- package/dist/shared/utils/guards.utils.js +0 -310
- package/dist/shared/utils/index.js +0 -18
- package/dist/shared/utils/string.utils.js +0 -62
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DrizzleSqlLiteGenerator = void 0;
|
|
7
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
-
/**
|
|
9
|
-
* @class DrizzleSqlLiteGenerator
|
|
10
|
-
* @description Generates a Drizzle configuration file (drizzle.config.ts) and a
|
|
11
|
-
* SQLite schema example (src/infrastructure/db/sqlite-schema.ts) when the user
|
|
12
|
-
* opts to use SQLite/libSQL instead of Postgres.
|
|
13
|
-
*/
|
|
14
|
-
class DrizzleSqlLiteGenerator {
|
|
15
|
-
_fileService;
|
|
16
|
-
constructor(_fileService) {
|
|
17
|
-
this._fileService = _fileService;
|
|
18
|
-
}
|
|
19
|
-
async generate(projectPath, _options) {
|
|
20
|
-
const configContent = this.composeDrizzleConfig();
|
|
21
|
-
const filePath = node_path_1.default.join(projectPath, 'drizzle.config.ts');
|
|
22
|
-
await this._fileService.writeFileRecursive(filePath, configContent);
|
|
23
|
-
const schemaPath = node_path_1.default.join(projectPath, 'src', 'schema.ts');
|
|
24
|
-
const schemaContent = this.composeSchema();
|
|
25
|
-
await this._fileService.writeFileRecursive(schemaPath, schemaContent);
|
|
26
|
-
}
|
|
27
|
-
composeDrizzleConfig() {
|
|
28
|
-
return `import 'dotenv/config';
|
|
29
|
-
import { defineConfig } from 'drizzle-kit';
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Drizzle Kit configuration for SQLite / libSQL.
|
|
33
|
-
* Uses environment variable SQLITE_DATABASE_URL to locate the database.
|
|
34
|
-
*/
|
|
35
|
-
export default defineConfig({
|
|
36
|
-
schema: './src/schema.ts',
|
|
37
|
-
out: './drizzle',
|
|
38
|
-
dialect: 'sqlite',
|
|
39
|
-
dbCredentials: {
|
|
40
|
-
url: process.env.SQLITE_DATABASE_URL!,
|
|
41
|
-
},
|
|
42
|
-
verbose: true,
|
|
43
|
-
strict: true,
|
|
44
|
-
});
|
|
45
|
-
`;
|
|
46
|
-
}
|
|
47
|
-
composeSchema() {
|
|
48
|
-
return `import { sqliteTable, integer, text } from 'drizzle-orm/sqlite-core';
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Example SQLite schema using Drizzle's libsql primitives.
|
|
52
|
-
* Place your application tables here (this file is scaffolded by the CLI when
|
|
53
|
-
* the user opts into SQLite support).
|
|
54
|
-
*/
|
|
55
|
-
export const usersTable = sqliteTable('users', {
|
|
56
|
-
id: integer('id').primaryKey().notNull(),
|
|
57
|
-
name: text('name').notNull(),
|
|
58
|
-
description: text('description'),
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Types inferred from the schema.
|
|
63
|
-
* - UserDto: Represents the shape of the data retrieved from the database ($inferSelect).
|
|
64
|
-
* - NewUserDto: Represents the shape of the data required to insert a new record ($inferInsert).
|
|
65
|
-
*/
|
|
66
|
-
export type UserDto = typeof usersTable.$inferSelect;
|
|
67
|
-
export type NewUserDto = typeof usersTable.$inferInsert;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Centralized Database Schema dictionary.
|
|
71
|
-
*/
|
|
72
|
-
export type SqliteSchema = {
|
|
73
|
-
users: typeof usersTable;
|
|
74
|
-
};
|
|
75
|
-
`;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.DrizzleSqlLiteGenerator = DrizzleSqlLiteGenerator;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DrizzleGenerator = void 0;
|
|
7
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
-
/**
|
|
9
|
-
* @class DrizzleGenerator
|
|
10
|
-
* @description Generates the Drizzle configuration file (drizzle.config.ts) and a basic schema file (src/schema.ts) for database scaffolding.
|
|
11
|
-
* The generator is only invoked if the user has opted to include database support in their project.
|
|
12
|
-
*
|
|
13
|
-
* @author Xeno
|
|
14
|
-
* @version 1.0.0
|
|
15
|
-
* @license ISC
|
|
16
|
-
* @since 2025-09-30
|
|
17
|
-
* @link https://github.com/Mattia-Carcione/xeno-js
|
|
18
|
-
*/
|
|
19
|
-
class DrizzleGenerator {
|
|
20
|
-
_fileService;
|
|
21
|
-
constructor(_fileService) {
|
|
22
|
-
this._fileService = _fileService;
|
|
23
|
-
}
|
|
24
|
-
async generate(projectPath, _options) {
|
|
25
|
-
const configContent = this.composeDrizzleConfig();
|
|
26
|
-
const filePath = node_path_1.default.join(projectPath, 'drizzle.config.ts');
|
|
27
|
-
await this._fileService.writeFileRecursive(filePath, configContent);
|
|
28
|
-
const schemaContent = this.composeSchema();
|
|
29
|
-
await this._fileService.writeFileRecursive(node_path_1.default.join(projectPath, 'src', 'schema.ts'), schemaContent);
|
|
30
|
-
}
|
|
31
|
-
composeDrizzleConfig() {
|
|
32
|
-
return `import 'dotenv/config';
|
|
33
|
-
import { defineConfig } from 'drizzle-kit';
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Drizzle Kit configuration file.
|
|
37
|
-
* Defines the schema location, migration output directory, and database connection.
|
|
38
|
-
*/
|
|
39
|
-
export default defineConfig({
|
|
40
|
-
schema: './src/schema.ts',
|
|
41
|
-
out: './drizzle',
|
|
42
|
-
dialect: 'postgresql',
|
|
43
|
-
dbCredentials: {
|
|
44
|
-
url: process.env.DATABASE_URL!,
|
|
45
|
-
},
|
|
46
|
-
verbose: true,
|
|
47
|
-
strict: true,
|
|
48
|
-
});
|
|
49
|
-
`;
|
|
50
|
-
}
|
|
51
|
-
composeSchema() {
|
|
52
|
-
return `import { boolean, pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core';
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @description Define your database tables here.
|
|
56
|
-
* The 'usersTable' serves as a baseline example.
|
|
57
|
-
* You can add more tables, relations, and indexes according to your domain requirements.
|
|
58
|
-
*/
|
|
59
|
-
export const usersTable = pgTable('users', {
|
|
60
|
-
id: serial('id').primaryKey(),
|
|
61
|
-
name: text('name').notNull(),
|
|
62
|
-
email: text('email').notNull().unique(),
|
|
63
|
-
isDeleted: boolean('is_deleted').notNull().default(false),
|
|
64
|
-
deletedAt: timestamp('deleted_at'),
|
|
65
|
-
createdAt: timestamp('created_at').defaultNow(),
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Types inferred from the schema.
|
|
70
|
-
* - UserDto: Represents the shape of the data retrieved from the database ($inferSelect).
|
|
71
|
-
* - NewUserDto: Represents the shape of the data required to insert a new record ($inferInsert).
|
|
72
|
-
*/
|
|
73
|
-
export type UserDto = typeof usersTable.$inferSelect;
|
|
74
|
-
export type NewUserDto = typeof usersTable.$inferInsert;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Centralized Database Schema dictionary.
|
|
78
|
-
*/
|
|
79
|
-
export type DbSchema = {
|
|
80
|
-
users: typeof usersTable;
|
|
81
|
-
};
|
|
82
|
-
`;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
exports.DrizzleGenerator = DrizzleGenerator;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EnvVueGenerator = void 0;
|
|
7
|
-
// src/infrastructure/generators/env-vue.generator.ts
|
|
8
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
class EnvVueGenerator {
|
|
10
|
-
_fileService;
|
|
11
|
-
constructor(_fileService) {
|
|
12
|
-
this._fileService = _fileService;
|
|
13
|
-
}
|
|
14
|
-
async generate(projectPath, options) {
|
|
15
|
-
let content = `# ─────────────────────────────────────────────────────────────────────────────
|
|
16
|
-
# Xeno VUE APPLICATION ENVIRONMENT VARIABLES
|
|
17
|
-
# ─────────────────────────────────────────────────────────────────────────────
|
|
18
|
-
VITE_APP_ENV=development
|
|
19
|
-
`;
|
|
20
|
-
if (options.axios) {
|
|
21
|
-
content += `\n# --- Axios ---
|
|
22
|
-
VITE_API_BASE_URL=http://localhost:3000
|
|
23
|
-
`;
|
|
24
|
-
}
|
|
25
|
-
if (options.supabase) {
|
|
26
|
-
content += `\n# --- Authentication (Supabase) ---
|
|
27
|
-
VITE_SUPABASE_URL=https://your-project.supabase.co
|
|
28
|
-
VITE_SUPABASE_KEY=your-anon-key
|
|
29
|
-
`;
|
|
30
|
-
}
|
|
31
|
-
if (options.sentry) {
|
|
32
|
-
content += `\n# --- Error Tracking (Sentry) ---
|
|
33
|
-
VITE_SENTRY_DSN=https://your-sentry-dsn@o0.ingest.sentry.io/0
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
36
|
-
await this._fileService.writeFileRecursive(node_path_1.default.join(projectPath, '.env'), content);
|
|
37
|
-
await this._fileService.writeFileRecursive(node_path_1.default.join(projectPath, '.env.example'), content);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.EnvVueGenerator = EnvVueGenerator;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EnvGenerator = void 0;
|
|
7
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
-
const shared_1 = require("../../shared");
|
|
9
|
-
const file_service_1 = require("../file/file.service");
|
|
10
|
-
class EnvGenerator {
|
|
11
|
-
_fileService;
|
|
12
|
-
constructor(_fileService) {
|
|
13
|
-
this._fileService = _fileService;
|
|
14
|
-
}
|
|
15
|
-
async generate(projectPath, options) {
|
|
16
|
-
const fileUtils = new file_service_1.FileUtils();
|
|
17
|
-
let content = `# ─────────────────────────────────────────────────────────────────────────────
|
|
18
|
-
# Xeno APPLICATION ENVIRONMENT VARIABLES
|
|
19
|
-
# ─────────────────────────────────────────────────────────────────────────────
|
|
20
|
-
NODE_ENV=development
|
|
21
|
-
`;
|
|
22
|
-
// Configurazione Database
|
|
23
|
-
if (options.database !== shared_1.CORE_CONSTANTS.NONE) {
|
|
24
|
-
if (options.database === shared_1.CORE_CONSTANTS.DRIZZLE) {
|
|
25
|
-
content += `\n# --- Database (PostgreSQL) ---
|
|
26
|
-
DATABASE_URL=postgres://postgres:password@localhost:5432/xeno_db
|
|
27
|
-
`;
|
|
28
|
-
}
|
|
29
|
-
else if (options.database === shared_1.CORE_CONSTANTS.SQL_LITE) {
|
|
30
|
-
content += `\n# --- Database (SQLite) ---
|
|
31
|
-
SQLITE_DATABASE_URL=file:./dev.sqlite
|
|
32
|
-
`;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (options.axios) {
|
|
36
|
-
content += `\n# --- Axios ---
|
|
37
|
-
BASE_URL=
|
|
38
|
-
`;
|
|
39
|
-
}
|
|
40
|
-
// Configurazione Redis (Caching, Idempotenza, Concorrenza)
|
|
41
|
-
if (options.redis) {
|
|
42
|
-
content += `\n# --- Cache (Redis) ---
|
|
43
|
-
REDIS_HOST=localhost
|
|
44
|
-
REDIS_PORT=6379
|
|
45
|
-
REDIS_PASSWORD=
|
|
46
|
-
REDIS_USERNAME=
|
|
47
|
-
REDIS_TLS=false
|
|
48
|
-
`;
|
|
49
|
-
}
|
|
50
|
-
// Configurazione Supabase (Autenticazione)
|
|
51
|
-
if (options.supabase) {
|
|
52
|
-
content += `\n# --- Authentication (Supabase) ---
|
|
53
|
-
SUPABASE_URL=https://your-project.supabase.co
|
|
54
|
-
SUPABASE_KEY=your-anon-key
|
|
55
|
-
`;
|
|
56
|
-
}
|
|
57
|
-
// Configurazione Logging & Observability
|
|
58
|
-
if (options.sentry) {
|
|
59
|
-
content += `\n# --- Error Tracking (Sentry) ---
|
|
60
|
-
SENTRY_DSN=https://your-sentry-dsn@o0.ingest.sentry.io/0
|
|
61
|
-
SENTRY_ENVIRONMENT=development
|
|
62
|
-
`;
|
|
63
|
-
}
|
|
64
|
-
// Creiamo sia il file effettivo che il file di esempio
|
|
65
|
-
const envPath = node_path_1.default.join(projectPath, '.env');
|
|
66
|
-
const envExamplePath = node_path_1.default.join(projectPath, '.env.example');
|
|
67
|
-
await fileUtils.writeFileRecursive(envPath, content);
|
|
68
|
-
await fileUtils.writeFileRecursive(envExamplePath, content);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.EnvGenerator = EnvGenerator;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GitIgnoreGenerator = void 0;
|
|
7
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
-
const shared_1 = require("../../shared");
|
|
9
|
-
class GitIgnoreGenerator {
|
|
10
|
-
_fileService;
|
|
11
|
-
constructor(_fileService) {
|
|
12
|
-
this._fileService = _fileService;
|
|
13
|
-
}
|
|
14
|
-
async generate(projectPath, options) {
|
|
15
|
-
let content = `# Dependencies
|
|
16
|
-
node_modules/
|
|
17
|
-
|
|
18
|
-
# Build artifacts
|
|
19
|
-
dist/
|
|
20
|
-
out/
|
|
21
|
-
build/
|
|
22
|
-
|
|
23
|
-
# Environment variables
|
|
24
|
-
# We ignore actual .env files for security, but keep .env.example for documentation
|
|
25
|
-
.env
|
|
26
|
-
.env.local
|
|
27
|
-
.env.*
|
|
28
|
-
!.env.example
|
|
29
|
-
|
|
30
|
-
# Logs
|
|
31
|
-
*.log
|
|
32
|
-
logs/
|
|
33
|
-
npm-debug.log*
|
|
34
|
-
|
|
35
|
-
# Test coverage
|
|
36
|
-
coverage/
|
|
37
|
-
.nyc_output/
|
|
38
|
-
|
|
39
|
-
# OS and IDE
|
|
40
|
-
.DS_Store
|
|
41
|
-
Thumbs.db
|
|
42
|
-
.vscode/
|
|
43
|
-
.idea/
|
|
44
|
-
`;
|
|
45
|
-
if (options.database === shared_1.CORE_CONSTANTS.SQL_LITE) {
|
|
46
|
-
content += `\n# SQLite Database
|
|
47
|
-
*.sqlite
|
|
48
|
-
*.sqlite3
|
|
49
|
-
*.sqlite-journal
|
|
50
|
-
`;
|
|
51
|
-
}
|
|
52
|
-
// Ignora la cartella di compilazione locale di Vercel se l'ambiente lo richiede
|
|
53
|
-
if (options.targetEnv === shared_1.CORE_CONSTANTS.VERCEL) {
|
|
54
|
-
content += `\n# Vercel
|
|
55
|
-
.vercel/
|
|
56
|
-
`;
|
|
57
|
-
}
|
|
58
|
-
const filePath = node_path_1.default.join(projectPath, '.gitignore');
|
|
59
|
-
await this._fileService.writeFileRecursive(filePath, content);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.GitIgnoreGenerator = GitIgnoreGenerator;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./bootstrap.generator"), exports);
|
|
18
|
-
__exportStar(require("./core-packagejson.generator"), exports);
|
|
19
|
-
__exportStar(require("./drizzle.generator"), exports);
|
|
20
|
-
__exportStar(require("./drizzle-sql-lite.generator"), exports);
|
|
21
|
-
__exportStar(require("./env.generator"), exports);
|
|
22
|
-
__exportStar(require("./gitignore.generator"), exports);
|
|
23
|
-
__exportStar(require("./main.generator"), exports);
|
|
24
|
-
__exportStar(require("./readme.generator"), exports);
|
|
25
|
-
__exportStar(require("./registry.generator"), exports);
|
|
26
|
-
__exportStar(require("./tsconfig.generator"), exports);
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MainGenerator = void 0;
|
|
7
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
-
class MainGenerator {
|
|
9
|
-
_fileService;
|
|
10
|
-
constructor(_fileService) {
|
|
11
|
-
this._fileService = _fileService;
|
|
12
|
-
}
|
|
13
|
-
async generate(projectPath, options) {
|
|
14
|
-
const content = `import 'dotenv/config';
|
|
15
|
-
import { bootstrap } from './bootstrap';
|
|
16
|
-
import { TOKENS } from '@xeno-js/core';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Main Application Entry Point
|
|
20
|
-
*/
|
|
21
|
-
async function main() {
|
|
22
|
-
try {
|
|
23
|
-
console.info('⏳ Bootstrapping ${options.targetDir} application...');
|
|
24
|
-
|
|
25
|
-
// Initialize the dependency injection container and infrastructure modules
|
|
26
|
-
const container = await bootstrap();
|
|
27
|
-
|
|
28
|
-
const logger = container.resolve(TOKENS.LOGGER)
|
|
29
|
-
logger.info('✅ Application started successfully!');
|
|
30
|
-
|
|
31
|
-
// TODO: Implement your logic here
|
|
32
|
-
|
|
33
|
-
} catch (error) {
|
|
34
|
-
console.error('❌ Critical error during startup:', error);
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
main();
|
|
40
|
-
`;
|
|
41
|
-
const filePath = node_path_1.default.join(projectPath, 'src', 'main.ts');
|
|
42
|
-
await this._fileService.writeFileRecursive(filePath, content);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.MainGenerator = MainGenerator;
|