@strapi/typescript-utils 4.10.0-beta.1 → 4.10.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.
|
@@ -36,17 +36,14 @@ const generateGlobalDefinition = (schemasDefinitions = []) => {
|
|
|
36
36
|
const properties = schemasDefinitions.map(schemaDefinitionToPropertySignature);
|
|
37
37
|
|
|
38
38
|
return factory.createModuleDeclaration(
|
|
39
|
-
undefined,
|
|
40
39
|
[factory.createModifier(ts.SyntaxKind.DeclareKeyword)],
|
|
41
40
|
factory.createIdentifier('global'),
|
|
42
41
|
factory.createModuleBlock([
|
|
43
42
|
factory.createModuleDeclaration(
|
|
44
|
-
undefined,
|
|
45
43
|
undefined,
|
|
46
44
|
factory.createIdentifier('Strapi'),
|
|
47
45
|
factory.createModuleBlock([
|
|
48
46
|
factory.createInterfaceDeclaration(
|
|
49
|
-
undefined,
|
|
50
47
|
undefined,
|
|
51
48
|
factory.createIdentifier('Schemas'),
|
|
52
49
|
undefined,
|
|
@@ -34,7 +34,7 @@ const emitDefinitions = (definitions) => {
|
|
|
34
34
|
ts.ScriptKind.TS
|
|
35
35
|
);
|
|
36
36
|
|
|
37
|
-
const printer = ts.createPrinter({
|
|
37
|
+
const printer = ts.createPrinter({ omitTrailingSemicolon: true });
|
|
38
38
|
|
|
39
39
|
return printer.printList(ts.ListFormat.MultiLine, nodeArray, sourceFile);
|
|
40
40
|
};
|
|
@@ -69,7 +69,6 @@ const generateSchemaDefinition = (schema) => {
|
|
|
69
69
|
|
|
70
70
|
// Generate the schema's interface declaration
|
|
71
71
|
const schemaType = factory.createInterfaceDeclaration(
|
|
72
|
-
undefined,
|
|
73
72
|
[factory.createModifier(ts.SyntaxKind.ExportKeyword)],
|
|
74
73
|
factory.createIdentifier(interfaceName),
|
|
75
74
|
undefined,
|
|
@@ -120,13 +120,7 @@ const toTypeLiteral = (data) => {
|
|
|
120
120
|
|
|
121
121
|
return [
|
|
122
122
|
...acc,
|
|
123
|
-
factory.createPropertyDeclaration(
|
|
124
|
-
undefined,
|
|
125
|
-
undefined,
|
|
126
|
-
identifier,
|
|
127
|
-
undefined,
|
|
128
|
-
toTypeLiteral(value)
|
|
129
|
-
),
|
|
123
|
+
factory.createPropertyDeclaration(undefined, identifier, undefined, toTypeLiteral(value)),
|
|
130
124
|
];
|
|
131
125
|
}, []);
|
|
132
126
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/typescript-utils",
|
|
3
|
-
"version": "4.10.0
|
|
3
|
+
"version": "4.10.0",
|
|
4
4
|
"description": "Typescript support for Strapi",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"fs-extra": "10.0.1",
|
|
35
35
|
"lodash": "4.17.21",
|
|
36
36
|
"prettier": "2.8.4",
|
|
37
|
-
"typescript": "
|
|
37
|
+
"typescript": "5.0.4"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": ">=14.19.1 <=18.x.x",
|
|
41
41
|
"npm": ">=6.0.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "9b5519778faaedfb837879f9c6f7e28fdfd6750d"
|
|
44
44
|
}
|