@cheetah.js/cli 0.1.17 → 0.1.19
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/.eslintrc.js +33 -33
- package/.prettierrc +4 -4
- package/LICENSE +673 -673
- package/README.md +26 -26
- package/cheetah.config.ts +15 -15
- package/dist/cli.js +0 -0
- package/package.json +46 -42
- package/.idea/cheetah-cli.iml +0 -8
- package/.idea/git_toolbox_prj.xml +0 -15
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/php.xml +0 -19
- package/.idea/vcs.xml +0 -6
- package/bun.lockb +0 -0
- package/dist/entities/cheetah-migration.entity.d.ts +0 -5
- package/dist/entities/cheetah-migration.entity.js +0 -32
- package/dist/entities/cheetah-migration.entity.js.map +0 -1
- package/dist/run-cli.sh +0 -2
package/README.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
## Cheetah.js CLI
|
|
2
|
-
The CLI (Command Line Interface) for Cheetah.js.
|
|
3
|
-
|
|
4
|
-
### Instalação
|
|
5
|
-
To install, you can use npm or bun:
|
|
6
|
-
```bash
|
|
7
|
-
bun install @cheetahjs/cli
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
### Uso
|
|
11
|
-
Você pode usar a CLI com npx ou bunx.
|
|
12
|
-
|
|
13
|
-
### Gerar uma nova migração
|
|
14
|
-
Para gerar uma nova migração, use o comando
|
|
15
|
-
```bash
|
|
16
|
-
bunx cli migration:generate
|
|
17
|
-
```
|
|
18
|
-
Isso irá gerar um novo arquivo de migração com uma diferença.
|
|
19
|
-
|
|
20
|
-
### Executar todas as migrações pendentes
|
|
21
|
-
Para executar todas as migrações pendentes, use o comando
|
|
22
|
-
```bash
|
|
23
|
-
bunx cli migration:run
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### Contribuição
|
|
1
|
+
## Cheetah.js CLI
|
|
2
|
+
The CLI (Command Line Interface) for Cheetah.js.
|
|
3
|
+
|
|
4
|
+
### Instalação
|
|
5
|
+
To install, you can use npm or bun:
|
|
6
|
+
```bash
|
|
7
|
+
bun install @cheetahjs/cli
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### Uso
|
|
11
|
+
Você pode usar a CLI com npx ou bunx.
|
|
12
|
+
|
|
13
|
+
### Gerar uma nova migração
|
|
14
|
+
Para gerar uma nova migração, use o comando
|
|
15
|
+
```bash
|
|
16
|
+
bunx cli migration:generate
|
|
17
|
+
```
|
|
18
|
+
Isso irá gerar um novo arquivo de migração com uma diferença.
|
|
19
|
+
|
|
20
|
+
### Executar todas as migrações pendentes
|
|
21
|
+
Para executar todas as migrações pendentes, use o comando
|
|
22
|
+
```bash
|
|
23
|
+
bunx cli migration:run
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Contribuição
|
|
27
27
|
Contribuições são bem-vindas. Por favor, abra um problema ou faça um pull request com suas mudanças.
|
package/cheetah.config.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ConnectionSettings, PgDriver } from '@cheetah.js/orm';
|
|
2
|
-
|
|
3
|
-
const config: ConnectionSettings = {
|
|
4
|
-
host: 'localhost',
|
|
5
|
-
port: 5432,
|
|
6
|
-
database: 'postgres',
|
|
7
|
-
username: 'postgres',
|
|
8
|
-
password: 'postgres',
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
driver: PgDriver,
|
|
12
|
-
migrationPath: '/database/migration',
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default config;
|
|
1
|
+
import { ConnectionSettings, PgDriver } from '@cheetah.js/orm';
|
|
2
|
+
|
|
3
|
+
const config: ConnectionSettings = {
|
|
4
|
+
host: 'localhost',
|
|
5
|
+
port: 5432,
|
|
6
|
+
database: 'postgres',
|
|
7
|
+
username: 'postgres',
|
|
8
|
+
password: 'postgres',
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
driver: PgDriver,
|
|
12
|
+
migrationPath: '/database/migration',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default config;
|
package/dist/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,42 +1,46 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cheetah.js/cli",
|
|
3
|
-
"description": "Cheetah.js CLI - Generate migrations, models, controllers and more. (In development)",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"module": "dist/index.js",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"eslint": "^
|
|
21
|
-
"
|
|
22
|
-
"eslint
|
|
23
|
-
"
|
|
24
|
-
"prettier": "^
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@cheetah.js/cli",
|
|
3
|
+
"description": "Cheetah.js CLI - Generate migrations, models, controllers and more. (In development)",
|
|
4
|
+
"version": "0.1.19",
|
|
5
|
+
"module": "dist/index.js",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"prepublishOnly": "npm run build",
|
|
11
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\""
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"commander": "^11.1.0",
|
|
15
|
+
"knex": "^3.0.1",
|
|
16
|
+
"ts-node": "^10.9.1"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
|
20
|
+
"@typescript-eslint/parser": "^6.12.0",
|
|
21
|
+
"bun-types": "latest",
|
|
22
|
+
"eslint": "^8.54.0",
|
|
23
|
+
"eslint-config-prettier": "^9.0.0",
|
|
24
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
25
|
+
"pg": "^8.11.3",
|
|
26
|
+
"prettier": "^3.1.0",
|
|
27
|
+
"reflect-metadata": "^0.1.13"
|
|
28
|
+
},
|
|
29
|
+
"bin": {
|
|
30
|
+
"cheetah": "./dist/run-cli.sh"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@cheetah.js/core": "^0.1.34",
|
|
34
|
+
"@cheetah.js/orm": "^0.1.42",
|
|
35
|
+
"typescript": "^5.0.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependenciesMeta": {
|
|
38
|
+
"pg": {
|
|
39
|
+
"optional": true
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"author": "Lucas Mota"
|
|
46
|
+
}
|
package/.idea/cheetah-cli.iml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$" />
|
|
5
|
-
<orderEntry type="inheritedJdk" />
|
|
6
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
-
</component>
|
|
8
|
-
</module>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="GitToolBoxProjectSettings">
|
|
4
|
-
<option name="commitMessageIssueKeyValidationOverride">
|
|
5
|
-
<BoolValueOverride>
|
|
6
|
-
<option name="enabled" value="true" />
|
|
7
|
-
</BoolValueOverride>
|
|
8
|
-
</option>
|
|
9
|
-
<option name="commitMessageValidationEnabledOverride">
|
|
10
|
-
<BoolValueOverride>
|
|
11
|
-
<option name="enabled" value="true" />
|
|
12
|
-
</BoolValueOverride>
|
|
13
|
-
</option>
|
|
14
|
-
</component>
|
|
15
|
-
</project>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/cheetah-cli.iml" filepath="$PROJECT_DIR$/.idea/cheetah-cli.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/php.xml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="MessDetectorOptionsConfiguration">
|
|
4
|
-
<option name="transferred" value="true" />
|
|
5
|
-
</component>
|
|
6
|
-
<component name="PHPCSFixerOptionsConfiguration">
|
|
7
|
-
<option name="transferred" value="true" />
|
|
8
|
-
</component>
|
|
9
|
-
<component name="PHPCodeSnifferOptionsConfiguration">
|
|
10
|
-
<option name="highlightLevel" value="WARNING" />
|
|
11
|
-
<option name="transferred" value="true" />
|
|
12
|
-
</component>
|
|
13
|
-
<component name="PhpStanOptionsConfiguration">
|
|
14
|
-
<option name="transferred" value="true" />
|
|
15
|
-
</component>
|
|
16
|
-
<component name="PsalmOptionsConfiguration">
|
|
17
|
-
<option name="transferred" value="true" />
|
|
18
|
-
</component>
|
|
19
|
-
</project>
|
package/.idea/vcs.xml
DELETED
package/bun.lockb
DELETED
|
Binary file
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CheetahMigration = void 0;
|
|
13
|
-
const orm_1 = require("@cheetah.js/orm");
|
|
14
|
-
let CheetahMigration = class CheetahMigration extends orm_1.BaseEntity {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
this.createdAt = new Date();
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
exports.CheetahMigration = CheetahMigration;
|
|
21
|
-
__decorate([
|
|
22
|
-
(0, orm_1.PrimaryKey)(),
|
|
23
|
-
__metadata("design:type", String)
|
|
24
|
-
], CheetahMigration.prototype, "migrationFile", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, orm_1.Property)(),
|
|
27
|
-
__metadata("design:type", Date)
|
|
28
|
-
], CheetahMigration.prototype, "createdAt", void 0);
|
|
29
|
-
exports.CheetahMigration = CheetahMigration = __decorate([
|
|
30
|
-
(0, orm_1.Entity)()
|
|
31
|
-
], CheetahMigration);
|
|
32
|
-
//# sourceMappingURL=cheetah-migration.entity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cheetah-migration.entity.js","sourceRoot":"","sources":["../../src/entities/cheetah-migration.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA2E;AAGpE,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,gBAAU;IAAzC;;QAKE,cAAS,GAAS,IAAI,IAAI,EAAE,CAAC;IACtC,CAAC;CAAA,CAAA;AANY,4CAAgB;AAEpB;IADN,IAAA,gBAAU,GAAE;;uDACgB;AAGtB;IADN,IAAA,cAAQ,GAAE;8BACO,IAAI;mDAAc;2BALzB,gBAAgB;IAD5B,IAAA,YAAM,GAAE;GACI,gBAAgB,CAM5B"}
|
package/dist/run-cli.sh
DELETED