@igniter-js/cli 0.1.10 → 0.2.0-alpha.0
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/bin/igniter +2 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +14394 -522
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14427 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +37 -51
- package/dist/templates/components.json.hbs +0 -21
- package/dist/templates/copilot.feature.instructions.hbs +0 -145
- package/dist/templates/copilot.form.instructions.hbs +0 -1021
- package/dist/templates/copilot.igniter.instructions.hbs +0 -753
- package/dist/templates/copilot.instructions.hbs +0 -117
- package/dist/templates/copilot.next.instructions.hbs +0 -67
- package/dist/templates/copilot.review.instructions.hbs +0 -42
- package/dist/templates/copilot.test.instructions.hbs +0 -55
- package/dist/templates/docker-compose.hbs +0 -15
- package/dist/templates/env.hbs +0 -33
- package/dist/templates/eslintrc.hbs +0 -6
- package/dist/templates/express.server.hbs +0 -33
- package/dist/templates/feature.controller.hbs +0 -95
- package/dist/templates/feature.index.hbs +0 -5
- package/dist/templates/feature.interface.hbs +0 -101
- package/dist/templates/feature.procedure.hbs +0 -88
- package/dist/templates/globals.hbs +0 -123
- package/dist/templates/igniter.client.hbs +0 -21
- package/dist/templates/igniter.context.hbs +0 -23
- package/dist/templates/igniter.hbs +0 -8
- package/dist/templates/igniter.router.hbs +0 -29
- package/dist/templates/layout.hbs +0 -39
- package/dist/templates/page.hbs +0 -117
- package/dist/templates/prisma.hbs +0 -9
- package/dist/templates/readme.hbs +0 -119
- package/dist/templates/route.hbs +0 -4
- package/dist/templates/use-form-with-zod.hbs +0 -39
- package/dist/templates/vitest.config.hbs +0 -11
- package/dist/templates/vscode.settings.hbs +0 -53
- package/dist/utils/analyze.d.ts +0 -17
- package/dist/utils/analyze.js +0 -185
- package/dist/utils/analyze.js.map +0 -1
- package/dist/utils/cli-style.d.ts +0 -55
- package/dist/utils/cli-style.js +0 -171
- package/dist/utils/cli-style.js.map +0 -1
- package/dist/utils/consts.d.ts +0 -19
- package/dist/utils/consts.js +0 -30
- package/dist/utils/consts.js.map +0 -1
- package/dist/utils/handlebars-helpers.d.ts +0 -1
- package/dist/utils/handlebars-helpers.js +0 -88
- package/dist/utils/handlebars-helpers.js.map +0 -1
- package/dist/utils/helpers.d.ts +0 -13
- package/dist/utils/helpers.js +0 -112
- package/dist/utils/helpers.js.map +0 -1
- package/dist/utils/platform-utils.d.ts +0 -46
- package/dist/utils/platform-utils.js +0 -95
- package/dist/utils/platform-utils.js.map +0 -1
- package/dist/utils/prisma-schema-parser.d.ts +0 -60
- package/dist/utils/prisma-schema-parser.js +0 -255
- package/dist/utils/prisma-schema-parser.js.map +0 -1
- package/dist/utils/project-utils.d.ts +0 -32
- package/dist/utils/project-utils.js +0 -123
- package/dist/utils/project-utils.js.map +0 -1
- package/dist/utils/template-handler.d.ts +0 -6
- package/dist/utils/template-handler.js +0 -32
- package/dist/utils/template-handler.js.map +0 -1
- package/readme.md +0 -165
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNextJSProject = isNextJSProject;
|
|
4
|
-
exports.hasSrcFolder = hasSrcFolder;
|
|
5
|
-
exports.getProjectBasePath = getProjectBasePath;
|
|
6
|
-
exports.getNextApiPath = getNextApiPath;
|
|
7
|
-
exports.getPackageManager = getPackageManager;
|
|
8
|
-
exports.getPackageManagerRunner = getPackageManagerRunner;
|
|
9
|
-
const tslib_1 = require("tslib");
|
|
10
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
11
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
|
-
/**
|
|
13
|
-
* Verifica se o projeto atual é um projeto Next.js
|
|
14
|
-
* @returns {boolean} true se for um projeto Next.js, false caso contrário
|
|
15
|
-
*/
|
|
16
|
-
function isNextJSProject(projectPath = process.cwd()) {
|
|
17
|
-
try {
|
|
18
|
-
// Verifica se existe um package.json
|
|
19
|
-
const packageJsonPath = path_1.default.join(projectPath, 'package.json');
|
|
20
|
-
if (!fs_1.default.existsSync(packageJsonPath))
|
|
21
|
-
return false;
|
|
22
|
-
// Lê o package.json e verifica se há dependência do Next.js
|
|
23
|
-
const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf8'));
|
|
24
|
-
// Verifica nas dependencies e devDependencies
|
|
25
|
-
const hasDependency = packageJson.dependencies?.next !== undefined;
|
|
26
|
-
const hasDevDependency = packageJson.devDependencies?.next !== undefined;
|
|
27
|
-
if (hasDependency || hasDevDependency)
|
|
28
|
-
return true;
|
|
29
|
-
// Verificações adicionais de estrutura Next.js
|
|
30
|
-
const possibleNextFiles = [
|
|
31
|
-
'next.config.js',
|
|
32
|
-
'next.config.mjs',
|
|
33
|
-
'next.config.ts',
|
|
34
|
-
path_1.default.join('src', 'app', 'layout.tsx'),
|
|
35
|
-
path_1.default.join('app', 'layout.tsx')
|
|
36
|
-
];
|
|
37
|
-
return possibleNextFiles.some(file => fs_1.default.existsSync(path_1.default.join(projectPath, file)));
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
console.error('Erro ao verificar se é um projeto Next.js:', error);
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Verifica se o projeto possui uma pasta src
|
|
46
|
-
* @returns {boolean} true se a pasta src existir, false caso contrário
|
|
47
|
-
*/
|
|
48
|
-
function hasSrcFolder(projectPath = process.cwd()) {
|
|
49
|
-
try {
|
|
50
|
-
const srcPath = path_1.default.join(projectPath, 'src');
|
|
51
|
-
return fs_1.default.existsSync(srcPath) && fs_1.default.statSync(srcPath).isDirectory();
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
console.error('Erro ao verificar a pasta src:', error);
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Retorna o caminho base para o código da aplicação (src/ ou raiz)
|
|
60
|
-
* @returns {string} O caminho base do código
|
|
61
|
-
*/
|
|
62
|
-
function getProjectBasePath(projectPath = process.cwd()) {
|
|
63
|
-
return hasSrcFolder(projectPath) ? path_1.default.join(projectPath, 'src') : projectPath;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Retorna o caminho correto para a API do Next.js (com ou sem pasta src)
|
|
67
|
-
* @returns {string} O caminho para a pasta de API
|
|
68
|
-
*/
|
|
69
|
-
function getNextApiPath(projectPath = process.cwd()) {
|
|
70
|
-
const basePath = getProjectBasePath(projectPath);
|
|
71
|
-
return path_1.default.join(basePath, 'app', 'api');
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Detects the package manager used in the project
|
|
75
|
-
* Priority: packageManager field in package.json > lock files presence
|
|
76
|
-
* @param projectPath Path to the project root
|
|
77
|
-
* @returns The detected package manager or 'npm' as fallback
|
|
78
|
-
*/
|
|
79
|
-
function getPackageManager(projectPath = process.cwd()) {
|
|
80
|
-
try {
|
|
81
|
-
const packageJsonPath = path_1.default.join(projectPath, 'package.json');
|
|
82
|
-
// Check package.json packageManager field first
|
|
83
|
-
if (fs_1.default.existsSync(packageJsonPath)) {
|
|
84
|
-
const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf8'));
|
|
85
|
-
if (packageJson.packageManager) {
|
|
86
|
-
const pm = packageJson.packageManager.split('@')[0];
|
|
87
|
-
if (pm === 'npm' || pm === 'yarn' || pm === 'pnpm' || pm === 'bun') {
|
|
88
|
-
return pm;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
// Check for lock files
|
|
93
|
-
const lockFiles = {
|
|
94
|
-
'bun.lockb': 'bun',
|
|
95
|
-
'yarn.lock': 'yarn',
|
|
96
|
-
'pnpm-lock.yaml': 'pnpm',
|
|
97
|
-
'package-lock.json': 'npm',
|
|
98
|
-
'deno.lock': 'deno'
|
|
99
|
-
};
|
|
100
|
-
for (const [lockFile, manager] of Object.entries(lockFiles)) {
|
|
101
|
-
if (fs_1.default.existsSync(path_1.default.join(projectPath, lockFile))) {
|
|
102
|
-
return manager;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
// Fallback to npm if no lock file is found
|
|
106
|
-
return 'npm';
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
console.error('Error detecting package manager:', error);
|
|
110
|
-
return 'npm';
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function getPackageManagerRunner(packageManager) {
|
|
114
|
-
// Check if the package manager is supported
|
|
115
|
-
const runners = {
|
|
116
|
-
npm: 'npx',
|
|
117
|
-
yarn: 'npx',
|
|
118
|
-
pnpm: 'pnpm dlx',
|
|
119
|
-
bun: 'bunx --bun'
|
|
120
|
-
};
|
|
121
|
-
return runners[packageManager] || 'npx';
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=project-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-utils.js","sourceRoot":"","sources":["../../src/utils/project-utils.ts"],"names":[],"mappings":";;AAOA,0CA6BC;AAMD,oCAQC;AAMD,gDAEC;AAMD,wCAGC;AAaD,8CAoCC;AAED,0DAUC;;AAhID,oDAAmB;AACnB,wDAAuB;AAEvB;;;GAGG;AACH,SAAgB,eAAe,CAAC,cAAsB,OAAO,CAAC,GAAG,EAAE;IACjE,IAAI,CAAC;QACH,qCAAqC;QACrC,MAAM,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;QAC9D,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,eAAe,CAAC;YAAE,OAAO,KAAK,CAAA;QAEjD,4DAA4D;QAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC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KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YAC5D,IAAI,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;gBACpD,OAAO,OAAyB,CAAA;YAClC,CAAC;QACH,CAAC;QAED,2CAA2C;QAC3C,OAAO,KAAK,CAAA;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAA;QACxD,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,SAAgB,uBAAuB,CAAC,cAA+C;IACrF,4CAA4C;IAC5C,MAAM,OAAO,GAAG;QACd,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,YAAY;KAClB,CAAA;IAED,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,KAAK,CAAA;AACzC,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TemplateHandler = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const handlebars_1 = tslib_1.__importDefault(require("handlebars"));
|
|
6
|
-
const fs_1 = require("fs");
|
|
7
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
-
class TemplateHandler {
|
|
9
|
-
static render(templateName, data, customPath) {
|
|
10
|
-
if (!templateName.endsWith('.hbs')) {
|
|
11
|
-
templateName = `${templateName}.hbs`;
|
|
12
|
-
}
|
|
13
|
-
if (customPath) {
|
|
14
|
-
this.templatesPath = path_1.default.join(__dirname, '..', customPath);
|
|
15
|
-
}
|
|
16
|
-
const templatePath = path_1.default.join(this.templatesPath, templateName);
|
|
17
|
-
const templateContent = (0, fs_1.readFileSync)(templatePath, 'utf-8');
|
|
18
|
-
const template = handlebars_1.default.compile(templateContent);
|
|
19
|
-
const result = template(data);
|
|
20
|
-
// If template is for .env file, add an extra line before appending
|
|
21
|
-
if (templateName === '.env' || templateName.endsWith('env')) {
|
|
22
|
-
return '\n' + result;
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
static registerHelper(name, fn) {
|
|
27
|
-
handlebars_1.default.registerHelper(name, fn);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.TemplateHandler = TemplateHandler;
|
|
31
|
-
TemplateHandler.templatesPath = path_1.default.join(__dirname, '..', 'templates');
|
|
32
|
-
//# sourceMappingURL=template-handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template-handler.js","sourceRoot":"","sources":["../../src/utils/template-handler.ts"],"names":[],"mappings":";;;;AAAA,oEAAoC;AACpC,2BAA4C;AAC5C,wDAAwB;AAExB,MAAa,eAAe;IAG1B,MAAM,CAAC,MAAM,CAAC,YAAoB,EAAE,IAAS,EAAE,UAAmB;QAChE,IAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,YAAY,GAAG,GAAG,YAAY,MAAM,CAAA;QACtC,CAAC;QAED,IAAG,UAAU,EAAE,CAAC;YACd,IAAI,CAAC,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,CAAA;QAC7D,CAAC;QAED,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;QACjE,MAAM,eAAe,GAAG,IAAA,iBAAY,EAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAC5D,MAAM,QAAQ,GAAG,oBAAU,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAErD,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAE9B,mEAAmE;QACnE,IAAI,YAAY,KAAK,MAAM,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5D,OAAO,IAAI,GAAG,MAAM,CAAC;QACvB,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,IAAY,EAAE,EAA6B;QAC/D,oBAAU,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;;AA5BH,0CA6BC;AA5BgB,6BAAa,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC"}
|
package/readme.md
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
# Igniter CLI
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
<img src="https://img.shields.io/npm/v/@igniter-js/cli" alt="NPM Version" />
|
|
5
|
-
<img src="https://img.shields.io/npm/dm/@igniter-js/cli" alt="NPM Downloads" />
|
|
6
|
-
<img src="https://img.shields.io/github/license/felipebarcelospro/igniter-js" alt="License" />
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<br />
|
|
10
|
-
|
|
11
|
-
Code generation CLI for Igniter.js projects - the essential tool to boost productivity with [Igniter Framework](https://github.com/felipebarcelospro/igniter-js).
|
|
12
|
-
|
|
13
|
-
## Why Igniter CLI?
|
|
14
|
-
|
|
15
|
-
* **Feature-First Architecture**: Generate complete features with best practices and proper structure
|
|
16
|
-
* **Type Safety**: All generated code is fully typed with TypeScript
|
|
17
|
-
* **Best Practices**: Follows modern development patterns and industry standards
|
|
18
|
-
* **Framework Integration**: Seamlessly integrates with Next.js and the Igniter Framework
|
|
19
|
-
* **Developer Experience**: Intuitive commands and helpful error messages
|
|
20
|
-
* **Productivity Boost**: Automates repetitive tasks and enforces consistency
|
|
21
|
-
* **Cross-Platform**: Works seamlessly on Windows, macOS, and Linux
|
|
22
|
-
|
|
23
|
-
## 📦 Installation
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# Global installation (recommended)
|
|
27
|
-
npm install -g @igniter-js/cli
|
|
28
|
-
|
|
29
|
-
# Or using npx for one-time execution
|
|
30
|
-
npx @igniter-js/cli
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## 🚀 Quick Start
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
# Initialize a new project with Igniter Framework in the current directory
|
|
37
|
-
igniter init
|
|
38
|
-
|
|
39
|
-
# Initialize a new project in a specific directory
|
|
40
|
-
igniter init -d my-igniter-app
|
|
41
|
-
|
|
42
|
-
# Generate a new feature
|
|
43
|
-
igniter generate feature -n users
|
|
44
|
-
|
|
45
|
-
# Generate features from Prisma models
|
|
46
|
-
igniter generate feature
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## 🛠️ Available Commands
|
|
50
|
-
|
|
51
|
-
### `init`
|
|
52
|
-
|
|
53
|
-
Initializes a new Next.js project with the complete Igniter Framework structure:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# Initialize in the current directory
|
|
57
|
-
igniter init
|
|
58
|
-
|
|
59
|
-
# Initialize in a specific directory (creates the directory if it doesn't exist)
|
|
60
|
-
igniter init -d my-igniter-app
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Options:
|
|
64
|
-
- `-d, --dir <directory>`: Directory to initialize the project in
|
|
65
|
-
|
|
66
|
-
This command:
|
|
67
|
-
- Creates a Next.js application with TypeScript, Tailwind, and ESLint
|
|
68
|
-
- Sets up the recommended folder structure for Igniter Framework
|
|
69
|
-
- Initializes Prisma ORM
|
|
70
|
-
- Configures testing environment with Vitest
|
|
71
|
-
- Installs and configures Shadcn/UI
|
|
72
|
-
- Creates necessary Igniter Framework files
|
|
73
|
-
- Sets up Docker for development
|
|
74
|
-
|
|
75
|
-
### `analyze`
|
|
76
|
-
|
|
77
|
-
Analyzes the current project:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
igniter analyze
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
This command checks your project's structure and configuration, providing insights and optimization suggestions.
|
|
84
|
-
|
|
85
|
-
### `generate feature` (alias: `g`)
|
|
86
|
-
|
|
87
|
-
Generates a complete feature:
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
# Generate a specific feature
|
|
91
|
-
igniter generate feature -n users
|
|
92
|
-
|
|
93
|
-
# Generate a feature with specific fields
|
|
94
|
-
igniter generate feature -n products -f name:string price:number
|
|
95
|
-
|
|
96
|
-
# Generate multiple features from Prisma models
|
|
97
|
-
igniter generate feature
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
This command:
|
|
101
|
-
- Creates the feature folder structure
|
|
102
|
-
- Generates base files (controller, procedures, interfaces)
|
|
103
|
-
- Configures the feature based on Prisma model if available
|
|
104
|
-
|
|
105
|
-
## 🏗️ Generated Project Structure
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
src/
|
|
109
|
-
├── app/ # Application routes
|
|
110
|
-
├── configs/ # Global configurations
|
|
111
|
-
├── core/
|
|
112
|
-
│ ├── design-system/ # Shadcn/UI components
|
|
113
|
-
│ ├── utils/ # Utility functions
|
|
114
|
-
│ ├── providers/ # Contexts and providers
|
|
115
|
-
│ ├── factories/ # Base classes
|
|
116
|
-
├── igniter.ts # Core initialization
|
|
117
|
-
├── igniter.client.ts # Client implementation
|
|
118
|
-
├── igniter.context.ts # Context management
|
|
119
|
-
├── igniter.router.ts # Router configuration
|
|
120
|
-
├── features/ # Application features
|
|
121
|
-
│ └── [feature]/
|
|
122
|
-
│ ├── presentation/ # Feature presentation layer
|
|
123
|
-
│ │ ├── components/ # Feature-specific components
|
|
124
|
-
│ │ ├── hooks/ # Custom hooks
|
|
125
|
-
│ │ ├── contexts/ # Feature contexts
|
|
126
|
-
│ │ └── utils/ # Utility functions
|
|
127
|
-
│ ├── controllers/ # Feature controllers
|
|
128
|
-
│ │ └── [feature].controller.ts
|
|
129
|
-
│ ├── procedures/ # Feature procedures/middleware
|
|
130
|
-
│ │ └── [feature].procedure.ts
|
|
131
|
-
│ ├── [feature].interfaces.ts # Type definitions
|
|
132
|
-
│ └── index.ts # Feature exports
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## 🔄 Platform Compatibility
|
|
136
|
-
|
|
137
|
-
Igniter CLI is designed to work seamlessly across different platforms:
|
|
138
|
-
|
|
139
|
-
- **Windows**: Full compatibility with Windows command prompt and PowerShell
|
|
140
|
-
- **macOS/Linux**: Native support for Unix-based terminals
|
|
141
|
-
- **Path handling**: Automatic path normalization across different operating systems
|
|
142
|
-
- **Terminal output**: Adaptive terminal styling based on platform capabilities
|
|
143
|
-
|
|
144
|
-
The CLI automatically detects your operating system and adjusts its behavior accordingly to ensure a consistent experience.
|
|
145
|
-
|
|
146
|
-
## 🔧 Advanced Configuration
|
|
147
|
-
|
|
148
|
-
The Igniter CLI can be configured through environment variables:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
# Example of advanced configuration
|
|
152
|
-
IGNITER_TEMPLATE_DIR=/path/to/templates igniter generate feature -n custom
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
## 📚 Complete Documentation
|
|
156
|
-
|
|
157
|
-
For complete Igniter Framework documentation, visit our [official documentation](https://github.com/felipebarcelospro/igniter-js).
|
|
158
|
-
|
|
159
|
-
## 🤝 Contributing
|
|
160
|
-
|
|
161
|
-
Contributions are welcome! Please read our [contribution guide](CONTRIBUTING.md) to learn how to participate.
|
|
162
|
-
|
|
163
|
-
## 📄 License
|
|
164
|
-
|
|
165
|
-
This project is licensed under the [MIT License](LICENSE).
|