@anu8151/adonisjs-blueprint 0.4.5 → 0.4.7

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.
@@ -23,7 +23,8 @@ var MigrationGenerator = class extends BaseGenerator {
23
23
  ...entity,
24
24
  tableName: string.plural(string.snakeCase(entity.name))
25
25
  },
26
- attributes: attributes.map((a) => a.migrationLine).join("\n ")
26
+ attributes,
27
+ attributesLines: attributes.map((a) => a.migrationLine).join("\n ")
27
28
  });
28
29
  if (definition.relationships) {
29
30
  for (const [relName, relType] of Object.entries(definition.relationships)) if (relType === "belongsToMany") await this.generatePivotMigration(entity.name, relName);
@@ -8,7 +8,8 @@ var SeederGenerator = class extends BaseGenerator {
8
8
  await this.generateStub("make/seeder/main.stub", {
9
9
  entity,
10
10
  count,
11
- data
11
+ data,
12
+ dataString: data ? JSON.stringify(data, null, 2) : null
12
13
  });
13
14
  }
14
15
  };
@@ -13,7 +13,7 @@ import { {{ entity.className }}Factory } from '#database/factories/{{ entity.nam
13
13
  export default class extends BaseSeeder {
14
14
  async run() {
15
15
  @if(data)
16
- await {{ entity.className }}.createMany({{ inspect(data) }})
16
+ await {{ entity.className }}.createMany({{{ dataString }}})
17
17
  @else
18
18
  await {{ entity.className }}Factory.createMany({{ count }})
19
19
  @end
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@anu8151/adonisjs-blueprint",
3
3
  "description": "Blueprint for AdonisJS 7",
4
- "version": "0.4.5",
4
+ "version": "0.4.7",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },
@@ -13,7 +13,7 @@ import { {{ entity.className }}Factory } from '#database/factories/{{ entity.nam
13
13
  export default class extends BaseSeeder {
14
14
  async run() {
15
15
  @if(data)
16
- await {{ entity.className }}.createMany({{ inspect(data) }})
16
+ await {{ entity.className }}.createMany({{{ dataString }}})
17
17
  @else
18
18
  await {{ entity.className }}Factory.createMany({{ count }})
19
19
  @end