@gravito/pulse 3.0.0 → 3.2.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/README.md +5 -2
- package/dist/index.js +11246 -9321
- package/package.json +7 -5
- package/stubs/command.stub +10 -0
- package/stubs/model.graphql.stub +44 -0
- package/stubs/model.stub +7 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravito/pulse",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "The official CLI for Gravito Galaxy Architecture. Scaffold projects and manage your universe.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"gravito": "bin/gravito.mjs"
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "bun build ./src/index.ts --outdir ./dist --target bun --external giget --external cac --external @clack/prompts --external picocolors",
|
|
11
11
|
"dev": "bun run ./src/index.ts",
|
|
12
|
-
"test": "bun test",
|
|
13
|
-
"test:coverage": "bun test --coverage --coverage-
|
|
14
|
-
"test:ci": "bun test --coverage --coverage-
|
|
15
|
-
"typecheck": "bun tsc -p tsconfig.json --noEmit --skipLibCheck"
|
|
12
|
+
"test": "bun test --timeout=10000",
|
|
13
|
+
"test:coverage": "bun test --timeout=10000 --coverage --coverage-reporter=lcov --coverage-dir coverage && bun run --bun scripts/check-coverage.ts",
|
|
14
|
+
"test:ci": "bun test --timeout=10000 --coverage --coverage-reporter=lcov --coverage-dir coverage && bun run --bun scripts/check-coverage.ts",
|
|
15
|
+
"typecheck": "bun tsc -p tsconfig.json --noEmit --skipLibCheck",
|
|
16
|
+
"test:unit": "bun test tests/ --timeout=10000",
|
|
17
|
+
"test:integration": "test $(find tests -name '*.integration.test.ts' 2>/dev/null | wc -l) -gt 0 && find tests -name '*.integration.test.ts' -print0 | xargs -0 bun test --timeout=10000 || echo 'No integration tests found'"
|
|
16
18
|
},
|
|
17
19
|
"files": [
|
|
18
20
|
"dist",
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Model, Column, PrimaryKey, HasMany, type HasManyRelation } from '@gravito/atlas'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* {{ Name }} Model
|
|
5
|
+
*
|
|
6
|
+
* This model is configured for automatic GraphQL schema generation.
|
|
7
|
+
*/
|
|
8
|
+
export class {{ Name }} extends Model {
|
|
9
|
+
static table = '{{ name }}s'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Fields that should be hidden from both JSON and GraphQL output.
|
|
13
|
+
*/
|
|
14
|
+
static hidden = ['password']
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Virtual fields to be appended to the model and exposed in GraphQL.
|
|
18
|
+
* Make sure to implement the corresponding getter: get[FieldName]Attribute().
|
|
19
|
+
*/
|
|
20
|
+
static appends = ['full_name']
|
|
21
|
+
|
|
22
|
+
@PrimaryKey()
|
|
23
|
+
id!: number
|
|
24
|
+
|
|
25
|
+
@Column()
|
|
26
|
+
name!: string
|
|
27
|
+
|
|
28
|
+
@Column()
|
|
29
|
+
email!: string
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Example relationship definition.
|
|
33
|
+
* Atlas will automatically resolve this, and OrbitGraphQL will expose it.
|
|
34
|
+
*/
|
|
35
|
+
// @HasMany(() => OtherModel)
|
|
36
|
+
// declare others: HasManyRelation<OtherModel>
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Accessor for the 'full_name' virtual field.
|
|
40
|
+
*/
|
|
41
|
+
getFullNameAttribute(): string {
|
|
42
|
+
return `${this.name} (Virtual)`
|
|
43
|
+
}
|
|
44
|
+
}
|
package/stubs/model.stub
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Model,
|
|
1
|
+
import { Model, column } from '@gravito/atlas'
|
|
2
2
|
|
|
3
3
|
export class {{ Name }} extends Model {
|
|
4
4
|
static table = '{{ name }}s'
|
|
5
5
|
|
|
6
|
-
@
|
|
7
|
-
id
|
|
6
|
+
@column({ isPrimary: true })
|
|
7
|
+
declare id: number
|
|
8
8
|
|
|
9
|
-
@
|
|
10
|
-
name
|
|
9
|
+
@column()
|
|
10
|
+
declare name: string
|
|
11
11
|
|
|
12
|
-
// @
|
|
13
|
-
// createdAt
|
|
12
|
+
// @column()
|
|
13
|
+
// declare createdAt: Date
|
|
14
14
|
}
|