@jungvonmatt/contentful-typings 3.0.6 → 4.0.1
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/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/index.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
+
import pico from 'picocolors';
|
|
2
3
|
import { loadContentfulConfig } from '@jungvonmatt/contentful-config';
|
|
3
4
|
import { getEnvironment, pagedGet } from '@jungvonmatt/contentful-ssg/lib/contentful';
|
|
4
5
|
import { CFDefinitionsBuilder } from 'cf-content-types-generator';
|
|
@@ -24,6 +25,7 @@ export const generateTypings = async (options = {}) => {
|
|
|
24
25
|
required: ['managementToken', 'environmentId', 'spaceId'],
|
|
25
26
|
});
|
|
26
27
|
const client = await getEnvironment(loaderResult.config);
|
|
28
|
+
console.log(`Generating typescript definitions for: ${pico.gray('spaces/')}${pico.green(loaderResult.config.spaceId)}${pico.gray('/environments/')}${pico.green(loaderResult.config.environmentId)}`);
|
|
27
29
|
const { items: contentTypes } = await pagedGet(client, {
|
|
28
30
|
method: 'getContentTypes',
|
|
29
31
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAA4B,MAAM,4BAA4B,CA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"name": "@jungvonmatt/contentful-typings",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=20"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"clean": "rimraf ./dist",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"homepage": "https://github.com/jungvonmatt/contentful-ssg#readme",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@faker-js/faker": "^8.3.1",
|
|
42
|
-
"@jungvonmatt/contentful-ssg": "^
|
|
43
|
-
"cf-content-types-generator": "^2.
|
|
42
|
+
"@jungvonmatt/contentful-ssg": "^4.0.1",
|
|
43
|
+
"cf-content-types-generator": "^2.16.0",
|
|
44
44
|
"change-case": "^5.4.2",
|
|
45
45
|
"commander": "^11.1.0",
|
|
46
|
-
"contentful": "^
|
|
47
|
-
"contentful-management": "^11.
|
|
46
|
+
"contentful": "^11.7.15",
|
|
47
|
+
"contentful-management": "^11.54.4",
|
|
48
48
|
"dotenv": "^16.3.1",
|
|
49
49
|
"dotenv-expand": "^10.0.0",
|
|
50
50
|
"exit-hook": "^4.0.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/chance": "^1.1.6",
|
|
59
|
-
"ts-morph": "^
|
|
59
|
+
"ts-morph": "^23.0.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "1b42ea25fd3927091cd850c7aee8ba1c23591fdc"
|
|
62
62
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* _eslint-disable @typescript-eslint/no-unsafe-call */
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import pico from 'picocolors';
|
|
3
4
|
import { type ContentfulConfig, type ContentType } from '@jungvonmatt/contentful-ssg';
|
|
4
5
|
import { loadContentfulConfig } from '@jungvonmatt/contentful-config';
|
|
5
6
|
import { getEnvironment, pagedGet } from '@jungvonmatt/contentful-ssg/lib/contentful';
|
|
@@ -51,6 +52,10 @@ export const generateTypings = async (options: Options = {}) => {
|
|
|
51
52
|
|
|
52
53
|
const client = await getEnvironment(loaderResult.config);
|
|
53
54
|
|
|
55
|
+
console.log(
|
|
56
|
+
`Generating typescript definitions for: ${pico.gray('spaces/')}${pico.green(loaderResult.config.spaceId)}${pico.gray('/environments/')}${pico.green(loaderResult.config.environmentId)}`,
|
|
57
|
+
);
|
|
58
|
+
|
|
54
59
|
const { items: contentTypes } = await pagedGet<ContentType>(client, {
|
|
55
60
|
method: 'getContentTypes',
|
|
56
61
|
});
|