prisma-laravel-migrate 3.1.13 → 3.1.14
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/.idea/copilot.data.migration.agent.xml +6 -0
- package/.idea/material_theme_project_new.xml +12 -0
- package/dist/cli/cli.js +14 -11
- package/dist/cli/models.index.js +13 -10
- package/dist/cli/ts.index.js +13 -10
- package/dist/index.js +14 -11
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="MaterialThemeProjectNewConfig">
|
|
4
|
+
<option name="metadata">
|
|
5
|
+
<MTProjectMetadataState>
|
|
6
|
+
<option name="migrated" value="true" />
|
|
7
|
+
<option name="pristineConfig" value="false" />
|
|
8
|
+
<option name="userId" value="-21b54065:19ba513a2b7:-7ffe" />
|
|
9
|
+
</MTProjectMetadataState>
|
|
10
|
+
</option>
|
|
11
|
+
</component>
|
|
12
|
+
</project>
|
package/dist/cli/cli.js
CHANGED
|
@@ -1906,25 +1906,28 @@ function parseTypeDirective(doc) {
|
|
|
1906
1906
|
}
|
|
1907
1907
|
function parseAppendsDirective(doc) {
|
|
1908
1908
|
if (!doc) return void 0;
|
|
1909
|
-
const m = doc.match(/@appends\s*(\{[^}]*\}|\([^)]*\)|[^\r\n]*)/);
|
|
1909
|
+
const m = doc.match(/@appends\s*(?::\s*)?(\{[^}]*\}|\([^)]*\)|[^\r\n]*)/i);
|
|
1910
1910
|
if (!m) return void 0;
|
|
1911
|
-
let body = m[1].trim();
|
|
1911
|
+
let body = (m[1] ?? "").trim();
|
|
1912
1912
|
if (body.startsWith("{") && body.endsWith("}") || body.startsWith("(") && body.endsWith(")")) {
|
|
1913
1913
|
body = body.slice(1, -1).trim();
|
|
1914
1914
|
}
|
|
1915
|
+
if (body.startsWith(":")) body = body.slice(1).trim();
|
|
1915
1916
|
if (!body) return void 0;
|
|
1916
1917
|
const entries = [];
|
|
1917
1918
|
for (const raw of body.split(",")) {
|
|
1918
1919
|
const token = raw.trim();
|
|
1919
1920
|
if (!token) continue;
|
|
1920
|
-
const
|
|
1921
|
-
|
|
1922
|
-
const
|
|
1923
|
-
|
|
1924
|
-
entries.push({
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1921
|
+
const idx = token.indexOf(":");
|
|
1922
|
+
const name = (idx === -1 ? token : token.slice(0, idx)).trim();
|
|
1923
|
+
const type = (idx === -1 ? "" : token.slice(idx + 1)).trim();
|
|
1924
|
+
if (!name) continue;
|
|
1925
|
+
entries.push({
|
|
1926
|
+
name,
|
|
1927
|
+
type: type.length ? type : void 0
|
|
1928
|
+
});
|
|
1929
|
+
}
|
|
1930
|
+
return entries.length ? { entries } : void 0;
|
|
1928
1931
|
}
|
|
1929
1932
|
function getModelTypeDirective(model) {
|
|
1930
1933
|
return parseTypeDirective(model.documentation);
|
|
@@ -1997,7 +2000,7 @@ var PrismaToLaravelModelGenerator = class {
|
|
|
1997
2000
|
type: field.type
|
|
1998
2001
|
};
|
|
1999
2002
|
});
|
|
2000
|
-
const guarded = guardedSet.size || properties.some((p) => p.guarded) ? [...guardedSet, ...properties.filter((p) => p.guarded).map((p) => p.name)] : hasToken("guarded", modelDoc) ? [] : void 0;
|
|
2003
|
+
const guarded = guardedSet.size || properties.some((p) => p.guarded) ? Array.from(/* @__PURE__ */ new Set([...guardedSet, ...properties.filter((p) => p.guarded).map((p) => p.name)])) : hasToken("guarded", modelDoc) ? [] : void 0;
|
|
2001
2004
|
const relations = this.extractRelationsFromModel(model);
|
|
2002
2005
|
const interfaces = {};
|
|
2003
2006
|
for (const prop of properties) {
|
package/dist/cli/models.index.js
CHANGED
|
@@ -736,25 +736,28 @@ function buildRelationsForModel(dmmf, model) {
|
|
|
736
736
|
// src/generator/ts/directives.ts
|
|
737
737
|
function parseAppendsDirective(doc) {
|
|
738
738
|
if (!doc) return void 0;
|
|
739
|
-
const m = doc.match(/@appends\s*(\{[^}]*\}|\([^)]*\)|[^\r\n]*)/);
|
|
739
|
+
const m = doc.match(/@appends\s*(?::\s*)?(\{[^}]*\}|\([^)]*\)|[^\r\n]*)/i);
|
|
740
740
|
if (!m) return void 0;
|
|
741
|
-
let body = m[1].trim();
|
|
741
|
+
let body = (m[1] ?? "").trim();
|
|
742
742
|
if (body.startsWith("{") && body.endsWith("}") || body.startsWith("(") && body.endsWith(")")) {
|
|
743
743
|
body = body.slice(1, -1).trim();
|
|
744
744
|
}
|
|
745
|
+
if (body.startsWith(":")) body = body.slice(1).trim();
|
|
745
746
|
if (!body) return void 0;
|
|
746
747
|
const entries = [];
|
|
747
748
|
for (const raw of body.split(",")) {
|
|
748
749
|
const token = raw.trim();
|
|
749
750
|
if (!token) continue;
|
|
750
|
-
const
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
|
|
754
|
-
entries.push({
|
|
751
|
+
const idx = token.indexOf(":");
|
|
752
|
+
const name = (idx === -1 ? token : token.slice(0, idx)).trim();
|
|
753
|
+
const type = (idx === -1 ? "" : token.slice(idx + 1)).trim();
|
|
754
|
+
if (!name) continue;
|
|
755
|
+
entries.push({
|
|
756
|
+
name,
|
|
757
|
+
type: type.length ? type : void 0
|
|
758
|
+
});
|
|
755
759
|
}
|
|
756
|
-
|
|
757
|
-
return { entries };
|
|
760
|
+
return entries.length ? { entries } : void 0;
|
|
758
761
|
}
|
|
759
762
|
|
|
760
763
|
// src/generator/modeler/generator.ts
|
|
@@ -818,7 +821,7 @@ var PrismaToLaravelModelGenerator = class {
|
|
|
818
821
|
type: field.type
|
|
819
822
|
};
|
|
820
823
|
});
|
|
821
|
-
const guarded = guardedSet.size || properties.some((p) => p.guarded) ? [...guardedSet, ...properties.filter((p) => p.guarded).map((p) => p.name)] : hasToken("guarded", modelDoc) ? [] : void 0;
|
|
824
|
+
const guarded = guardedSet.size || properties.some((p) => p.guarded) ? Array.from(/* @__PURE__ */ new Set([...guardedSet, ...properties.filter((p) => p.guarded).map((p) => p.name)])) : hasToken("guarded", modelDoc) ? [] : void 0;
|
|
822
825
|
const relations = this.extractRelationsFromModel(model);
|
|
823
826
|
const interfaces = {};
|
|
824
827
|
for (const prop of properties) {
|
package/dist/cli/ts.index.js
CHANGED
|
@@ -96,25 +96,28 @@ function parseTypeDirective(doc) {
|
|
|
96
96
|
}
|
|
97
97
|
function parseAppendsDirective(doc) {
|
|
98
98
|
if (!doc) return void 0;
|
|
99
|
-
const m = doc.match(/@appends\s*(\{[^}]*\}|\([^)]*\)|[^\r\n]*)/);
|
|
99
|
+
const m = doc.match(/@appends\s*(?::\s*)?(\{[^}]*\}|\([^)]*\)|[^\r\n]*)/i);
|
|
100
100
|
if (!m) return void 0;
|
|
101
|
-
let body = m[1].trim();
|
|
101
|
+
let body = (m[1] ?? "").trim();
|
|
102
102
|
if (body.startsWith("{") && body.endsWith("}") || body.startsWith("(") && body.endsWith(")")) {
|
|
103
103
|
body = body.slice(1, -1).trim();
|
|
104
104
|
}
|
|
105
|
+
if (body.startsWith(":")) body = body.slice(1).trim();
|
|
105
106
|
if (!body) return void 0;
|
|
106
107
|
const entries = [];
|
|
107
108
|
for (const raw of body.split(",")) {
|
|
108
109
|
const token = raw.trim();
|
|
109
110
|
if (!token) continue;
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
entries.push({
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
const idx = token.indexOf(":");
|
|
112
|
+
const name = (idx === -1 ? token : token.slice(0, idx)).trim();
|
|
113
|
+
const type = (idx === -1 ? "" : token.slice(idx + 1)).trim();
|
|
114
|
+
if (!name) continue;
|
|
115
|
+
entries.push({
|
|
116
|
+
name,
|
|
117
|
+
type: type.length ? type : void 0
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return entries.length ? { entries } : void 0;
|
|
118
121
|
}
|
|
119
122
|
function getModelTypeDirective(model) {
|
|
120
123
|
return parseTypeDirective(model.documentation);
|
package/dist/index.js
CHANGED
|
@@ -1966,25 +1966,28 @@ function parseTypeDirective(doc) {
|
|
|
1966
1966
|
}
|
|
1967
1967
|
function parseAppendsDirective(doc) {
|
|
1968
1968
|
if (!doc) return void 0;
|
|
1969
|
-
const m = doc.match(/@appends\s*(\{[^}]*\}|\([^)]*\)|[^\r\n]*)/);
|
|
1969
|
+
const m = doc.match(/@appends\s*(?::\s*)?(\{[^}]*\}|\([^)]*\)|[^\r\n]*)/i);
|
|
1970
1970
|
if (!m) return void 0;
|
|
1971
|
-
let body = m[1].trim();
|
|
1971
|
+
let body = (m[1] ?? "").trim();
|
|
1972
1972
|
if (body.startsWith("{") && body.endsWith("}") || body.startsWith("(") && body.endsWith(")")) {
|
|
1973
1973
|
body = body.slice(1, -1).trim();
|
|
1974
1974
|
}
|
|
1975
|
+
if (body.startsWith(":")) body = body.slice(1).trim();
|
|
1975
1976
|
if (!body) return void 0;
|
|
1976
1977
|
const entries = [];
|
|
1977
1978
|
for (const raw of body.split(",")) {
|
|
1978
1979
|
const token = raw.trim();
|
|
1979
1980
|
if (!token) continue;
|
|
1980
|
-
const
|
|
1981
|
-
|
|
1982
|
-
const
|
|
1983
|
-
|
|
1984
|
-
entries.push({
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1981
|
+
const idx = token.indexOf(":");
|
|
1982
|
+
const name = (idx === -1 ? token : token.slice(0, idx)).trim();
|
|
1983
|
+
const type = (idx === -1 ? "" : token.slice(idx + 1)).trim();
|
|
1984
|
+
if (!name) continue;
|
|
1985
|
+
entries.push({
|
|
1986
|
+
name,
|
|
1987
|
+
type: type.length ? type : void 0
|
|
1988
|
+
});
|
|
1989
|
+
}
|
|
1990
|
+
return entries.length ? { entries } : void 0;
|
|
1988
1991
|
}
|
|
1989
1992
|
function getModelTypeDirective(model) {
|
|
1990
1993
|
return parseTypeDirective(model.documentation);
|
|
@@ -2057,7 +2060,7 @@ var PrismaToLaravelModelGenerator = class {
|
|
|
2057
2060
|
type: field.type
|
|
2058
2061
|
};
|
|
2059
2062
|
});
|
|
2060
|
-
const guarded = guardedSet.size || properties.some((p) => p.guarded) ? [...guardedSet, ...properties.filter((p) => p.guarded).map((p) => p.name)] : hasToken("guarded", modelDoc) ? [] : void 0;
|
|
2063
|
+
const guarded = guardedSet.size || properties.some((p) => p.guarded) ? Array.from(/* @__PURE__ */ new Set([...guardedSet, ...properties.filter((p) => p.guarded).map((p) => p.name)])) : hasToken("guarded", modelDoc) ? [] : void 0;
|
|
2061
2064
|
const relations = this.extractRelationsFromModel(model);
|
|
2062
2065
|
const interfaces = {};
|
|
2063
2066
|
for (const prop of properties) {
|