prisma-laravel-migrate 0.2.8 → 0.2.9

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.
@@ -7,7 +7,7 @@ import { spawn } from "child_process";
7
7
  import * as dmf from "@prisma/internals";
8
8
  import { loadConfig } from "../utils/config.js";
9
9
  // utility: load/merge ALL *.prisma files under prisma/ (schema first, then the rest)
10
- async function loadMergedDatamodel(schemaPrismaPath) {
10
+ export async function loadMergedDatamodel(schemaPrismaPath) {
11
11
  const schemaDir = path.dirname(schemaPrismaPath);
12
12
  const entries = readdirSync(schemaDir).filter(f => f.endsWith(".prisma"));
13
13
  const order = [
@@ -18,7 +18,7 @@ async function loadMergedDatamodel(schemaPrismaPath) {
18
18
  return chunks.join("\n\n");
19
19
  }
20
20
  /** extract our generator blocks' configs right from the datamodel */
21
- async function getLaravelGeneratorConfigs(datamodel) {
21
+ export async function getLaravelGeneratorConfigs(datamodel) {
22
22
  const sdk = dmf.default ?? dmf;
23
23
  const { generators } = await sdk.getConfig({ datamodel });
24
24
  const findCfg = (provider) => (generators ?? []).find((g) => (g.provider?.value ?? "") === provider)?.config ?? {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prisma-laravel-migrate",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Generate laravel migrations and/or models using prisma files",
5
5
  "bin": {
6
6
  "prisma-laravel-migrations": "./dist/cli/migrator.index.js",
package/stubs/model.stub CHANGED
@@ -1,6 +1,6 @@
1
1
  <?php
2
2
 
3
- namespace {model.namespace}\\Models;
3
+ namespace ${model.namespace}\\Models;
4
4
 
5
5
  ${model.imports.join('\n')}${model.extends && model.extends !== 'Illuminate\Database\Eloquent\Model'
6
6
  ? ''