@strapi/typescript-utils 0.0.0-next.f45143c5e2a8a9d85691d0abf79a3f42024a0c71 → 0.0.0-next.ff946d2c25a3e577b47132a357cac2932eb8e635

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/.eslintignore CHANGED
@@ -1,2 +1,3 @@
1
1
  node_modules/
2
2
  .eslintrc.js
3
+ index.d.ts
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ // FIXME: to remove when migrating this package to ts
2
+ declare module '@strapi/typescript-utils' {
3
+ const utils: any;
4
+ export = utils;
5
+ }
package/jest.config.js CHANGED
@@ -2,4 +2,5 @@
2
2
 
3
3
  module.exports = {
4
4
  preset: '../../../jest-preset.unit.js',
5
+ displayName: 'Typescript utils',
5
6
  };
@@ -68,7 +68,6 @@ describe('Utils', () => {
68
68
  describe('Get Definition Attributes Count', () => {
69
69
  const createMainNode = (members = []) => {
70
70
  return factory.createInterfaceDeclaration(
71
- undefined,
72
71
  undefined,
73
72
  factory.createIdentifier('Foo'),
74
73
  undefined,
@@ -79,7 +78,6 @@ describe('Utils', () => {
79
78
 
80
79
  const createPropertyDeclaration = (name, type) => {
81
80
  return factory.createPropertyDeclaration(
82
- undefined,
83
81
  undefined,
84
82
  factory.createIdentifier(name),
85
83
  undefined,
@@ -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,
@@ -23,7 +23,6 @@ module.exports = {
23
23
  );
24
24
 
25
25
  return factory.createImportDeclaration(
26
- undefined,
27
26
  undefined,
28
27
  factory.createImportClause(false, undefined, factory.createNamedImports(formattedImports)),
29
28
  factory.createStringLiteral('@strapi/strapi'),
@@ -34,7 +34,7 @@ const emitDefinitions = (definitions) => {
34
34
  ts.ScriptKind.TS
35
35
  );
36
36
 
37
- const printer = ts.createPrinter({ newLine: true, omitTrailingSemicolon: true });
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": "0.0.0-next.f45143c5e2a8a9d85691d0abf79a3f42024a0c71",
3
+ "version": "0.0.0-next.ff946d2c25a3e577b47132a357cac2932eb8e635",
4
4
  "description": "Typescript support for Strapi",
5
5
  "keywords": [
6
6
  "strapi",
@@ -20,6 +20,7 @@
20
20
  }
21
21
  ],
22
22
  "main": "./lib/index.js",
23
+ "types": "index.d.ts",
23
24
  "directories": {
24
25
  "lib": "./lib"
25
26
  },
@@ -34,11 +35,11 @@
34
35
  "fs-extra": "10.0.1",
35
36
  "lodash": "4.17.21",
36
37
  "prettier": "2.8.4",
37
- "typescript": "4.6.2"
38
+ "typescript": "5.0.4"
38
39
  },
39
40
  "engines": {
40
41
  "node": ">=14.19.1 <=18.x.x",
41
42
  "npm": ">=6.0.0"
42
43
  },
43
- "gitHead": "f45143c5e2a8a9d85691d0abf79a3f42024a0c71"
44
+ "gitHead": "ff946d2c25a3e577b47132a357cac2932eb8e635"
44
45
  }