@jungvonmatt/contentful-fakes 1.8.0 → 1.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jungvonmatt/contentful-fakes",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Create fake data based on contentful data models",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -24,6 +24,10 @@
24
24
  "type": "git",
25
25
  "url": "git+https://github.com/jungvonmatt/contentful-ssg.git"
26
26
  },
27
+ "files": [
28
+ "src",
29
+ "dist"
30
+ ],
27
31
  "keywords": [
28
32
  "fake",
29
33
  "data",
@@ -36,10 +40,10 @@
36
40
  },
37
41
  "homepage": "https://github.com/jungvonmatt/contentful-ssg#readme",
38
42
  "dependencies": {
43
+ "@faker-js/faker": "^7.3.0",
39
44
  "@jungvonmatt/contentful-ssg": "^1.8.0",
40
45
  "casual": "^1.6.2",
41
46
  "chalk": "^4.1.2",
42
- "faker": "^5.5.3",
43
47
  "fs-extra": "^10.1.0",
44
48
  "randexp": "^0.5.3"
45
49
  },
@@ -48,5 +52,5 @@
48
52
  "@types/faker": "^6.6.9",
49
53
  "contentful-management": "^7.45.0"
50
54
  },
51
- "gitHead": "11b24dfe60c4ac028368f1e55371c443bc79f35f"
55
+ "gitHead": "67a6a829dc6ebba0188177fd1b4e5205c565c331"
52
56
  }
package/src/lib/faker.ts CHANGED
@@ -23,7 +23,7 @@ import {
23
23
 
24
24
  import { ContentFields, KeyValueMap, Control } from 'contentful-management/types';
25
25
 
26
- import faker from 'faker';
26
+ import { faker } from '@faker-js/faker';
27
27
  import casual from 'casual';
28
28
  import RandExp from 'randexp';
29
29
  import { oneOf, randomInt } from './helper.js';
@@ -128,7 +128,7 @@ export const getRegexValue = (regex: RegexType) => {
128
128
 
129
129
  // US Phone number
130
130
  if (pattern === '^\\d[ -.]?\\(?\\d\\d\\d\\)?[ -.]?\\d\\d\\d[ -.]?\\d\\d\\d\\d$') {
131
- return faker.phone.phoneNumber('#-(###)-###-####');
131
+ return faker.phone.number('#-(###)-###-####');
132
132
  }
133
133
 
134
134
  // US Zip code
@@ -261,7 +261,7 @@ export const getSymbolFake = async (field: FieldInfo): Promise<string> => {
261
261
  result = result.slice(0, count);
262
262
 
263
263
  while (result.length < min) {
264
- result = `${result} ${faker.lorem.sentence() as string}`.slice(0, count);
264
+ result = `${result} ${faker.lorem.sentence()}`.slice(0, count);
265
265
  }
266
266
  }
267
267
 
@@ -298,7 +298,7 @@ export const getTextFake = async (field: FieldInfo): Promise<string> => {
298
298
  result = result.slice(0, count);
299
299
 
300
300
  while (result.length < min) {
301
- result = `${result} ${faker.lorem.paragraphs(5) as string}`.slice(0, count);
301
+ result = `${result} ${faker.lorem.paragraphs(5)}`.slice(0, count);
302
302
  }
303
303
  }
304
304
 
package/.eslintrc.cjs DELETED
@@ -1,16 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- plugins: ['prettier'],
4
- extends: ['xo', 'xo-typescript/space', 'plugin:prettier/recommended'],
5
- parser: '@typescript-eslint/parser',
6
- parserOptions: {
7
- project: ['./tsconfig.json'],
8
- tsconfigRootDir: __dirname,
9
- extraFileExtensions: ['.cjs'],
10
- },
11
- ignorePatterns: ['**/jest.config.js', '**/*.cjs', 'src/**/*.test.ts', 'src/__test__/*'],
12
- env: {
13
- node: true,
14
- jest: true,
15
- },
16
- };
@@ -1,17 +0,0 @@
1
- @jungvonmatt/contentful-fakes:compile: cache hit, replaying output 6e67c6362ffc51bb
2
- @jungvonmatt/contentful-fakes:compile: 
3
- @jungvonmatt/contentful-fakes:compile: > @jungvonmatt/contentful-fakes@1.8.0-alpha.6 precompile
4
- @jungvonmatt/contentful-fakes:compile: > npm run clean
5
- @jungvonmatt/contentful-fakes:compile: 
6
- @jungvonmatt/contentful-fakes:compile: 
7
- @jungvonmatt/contentful-fakes:compile: > @jungvonmatt/contentful-fakes@1.8.0-alpha.6 clean
8
- @jungvonmatt/contentful-fakes:compile: > rimraf ./dist
9
- @jungvonmatt/contentful-fakes:compile: 
10
- @jungvonmatt/contentful-fakes:compile: 
11
- @jungvonmatt/contentful-fakes:compile: > @jungvonmatt/contentful-fakes@1.8.0-alpha.6 compile
12
- @jungvonmatt/contentful-fakes:compile: > tsc --build
13
- @jungvonmatt/contentful-fakes:compile: 
14
- @jungvonmatt/contentful-fakes:compile: 
15
- @jungvonmatt/contentful-fakes:compile: > @jungvonmatt/contentful-fakes@1.8.0-alpha.6 postcompile
16
- @jungvonmatt/contentful-fakes:compile: > chmod +x ./dist/cli.js
17
- @jungvonmatt/contentful-fakes:compile: 
@@ -1,5 +0,0 @@
1
- @jungvonmatt/contentful-fakes:lint: cache hit, replaying output 4bd5fb68a2242fc5
2
- @jungvonmatt/contentful-fakes:lint: 
3
- @jungvonmatt/contentful-fakes:lint: > @jungvonmatt/contentful-fakes@1.8.0-alpha.6 lint
4
- @jungvonmatt/contentful-fakes:lint: > eslint --color src --fix --ext .ts
5
- @jungvonmatt/contentful-fakes:lint: 
@@ -1,54 +0,0 @@
1
- @jungvonmatt/contentful-fakes:test: cache hit, replaying output 6a5969cfbf4fcbe2
2
- @jungvonmatt/contentful-fakes:test: 
3
- @jungvonmatt/contentful-fakes:test: > @jungvonmatt/contentful-fakes@1.8.0-alpha.6 test
4
- @jungvonmatt/contentful-fakes:test: > jest
5
- @jungvonmatt/contentful-fakes:test: 
6
- @jungvonmatt/contentful-fakes:test: PASS contentful-fakes src/lib/faker.test.ts
7
- @jungvonmatt/contentful-fakes:test:  contentful-fakes
8
- @jungvonmatt/contentful-fakes:test:  ✓ getTextFake (validation: in) (1 ms)
9
- @jungvonmatt/contentful-fakes:test:  ✓ getTextFake (validation: regexp) (1 ms)
10
- @jungvonmatt/contentful-fakes:test:  ✓ getTextFake (validation: size) (12 ms)
11
- @jungvonmatt/contentful-fakes:test:  ✓ getIntegerFake (validation: in)
12
- @jungvonmatt/contentful-fakes:test:  ✓ getIntegerFake (validation: min) (1 ms)
13
- @jungvonmatt/contentful-fakes:test:  ✓ getIntegerFake (validation: max)
14
- @jungvonmatt/contentful-fakes:test:  ✓ getIntegerFake (validation: range)
15
- @jungvonmatt/contentful-fakes:test:  ✓ getNumberFake (validation: in) (1 ms)
16
- @jungvonmatt/contentful-fakes:test:  ✓ getNumberFake (validation: min)
17
- @jungvonmatt/contentful-fakes:test:  ✓ getNumberFake (validation: max)
18
- @jungvonmatt/contentful-fakes:test:  ✓ getNumberFake (validation: range)
19
- @jungvonmatt/contentful-fakes:test:  ✓ getSymbolFake (validation: in) (1 ms)
20
- @jungvonmatt/contentful-fakes:test:  ✓ getSymbolFake (validation: regex)
21
- @jungvonmatt/contentful-fakes:test:  ✓ getSymbolFake (interface: urlEditor)
22
- @jungvonmatt/contentful-fakes:test:  ✓ getSymbolFake (interface: slugEditor)
23
- @jungvonmatt/contentful-fakes:test:  ✓ getSymbolFake (special ids) (1 ms)
24
- @jungvonmatt/contentful-fakes:test:  ✓ getSymbolFake (dropdown/radio)
25
- @jungvonmatt/contentful-fakes:test:  ✓ getSymbolFake (min)
26
- @jungvonmatt/contentful-fakes:test:  ✓ getSymbolFake (max)
27
- @jungvonmatt/contentful-fakes:test:  ✓ getSymbolFake (min/max)
28
- @jungvonmatt/contentful-fakes:test:  ✓ getAssetFake (1 ms)
29
- @jungvonmatt/contentful-fakes:test:  ✓ getEntryScheme
30
- @jungvonmatt/contentful-fakes:test:  ✓ getLinkFake (asset)
31
- @jungvonmatt/contentful-fakes:test:  ✓ getLinkFake (entry)
32
- @jungvonmatt/contentful-fakes:test:  ✓ getRichtextFake min (1 ms)
33
- @jungvonmatt/contentful-fakes:test:  ✓ getRichtextFake max
34
- @jungvonmatt/contentful-fakes:test:  ✓ getTextFake (special ids) (1 ms)
35
- @jungvonmatt/contentful-fakes:test:  ✓ getRegexValue (preset: email)
36
- @jungvonmatt/contentful-fakes:test:  ✓ getRegexValue (preset: url)
37
- @jungvonmatt/contentful-fakes:test:  ✓ getRegexValue (preset: Date US) (2 ms)
38
- @jungvonmatt/contentful-fakes:test:  ✓ getRegexValue (preset: Date European)
39
- @jungvonmatt/contentful-fakes:test:  ✓ getRegexValue (preset: 12h Time)
40
- @jungvonmatt/contentful-fakes:test:  ✓ getRegexValue (preset: 24h Time) (1 ms)
41
- @jungvonmatt/contentful-fakes:test:  ✓ getRegexValue (preset: US Phone number)
42
- @jungvonmatt/contentful-fakes:test:  ✓ getRegexValue (preset: US Zip code)
43
- @jungvonmatt/contentful-fakes:test:  ✓ getRegexValue (custom regex) (1 ms)
44
- @jungvonmatt/contentful-fakes:test:  ✓ getMockData (1 ms)
45
- @jungvonmatt/contentful-fakes:test:  ✓ getArrayFake (type: symbbol)
46
- @jungvonmatt/contentful-fakes:test:  ✓ getArrayFake (type: text) (1 ms)
47
- @jungvonmatt/contentful-fakes:test:  ✓ getArrayFake (type: asset link) (1 ms)
48
- @jungvonmatt/contentful-fakes:test:  ✓ getArrayFake (type: entry link)
49
- @jungvonmatt/contentful-fakes:test: 
50
- @jungvonmatt/contentful-fakes:test: Test Suites: 1 passed, 1 total
51
- @jungvonmatt/contentful-fakes:test: Tests: 41 passed, 41 total
52
- @jungvonmatt/contentful-fakes:test: Snapshots: 0 total
53
- @jungvonmatt/contentful-fakes:test: Time: 2.635 s, estimated 3 s
54
- @jungvonmatt/contentful-fakes:test: Ran all test suites.
package/CHANGELOG.md DELETED
@@ -1,160 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [1.8.0](https://github.com/jungvonmatt/contentful-ssg/compare/v1.7.4...v1.8.0) (2022-06-21)
7
-
8
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
9
-
10
-
11
-
12
-
13
-
14
- # [1.8.0-alpha.6](https://github.com/jungvonmatt/contentful-ssg/compare/v1.8.0-alpha.5...v1.8.0-alpha.6) (2022-06-07)
15
-
16
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
17
-
18
-
19
-
20
-
21
-
22
- # [1.8.0-alpha.5](https://github.com/jungvonmatt/contentful-ssg/compare/v1.8.0-alpha.4...v1.8.0-alpha.5) (2022-06-02)
23
-
24
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
25
-
26
-
27
-
28
-
29
-
30
- # [1.8.0-alpha.4](https://github.com/jungvonmatt/contentful-ssg/compare/v1.8.0-alpha.2...v1.8.0-alpha.4) (2022-06-02)
31
-
32
-
33
- ### Bug Fixes
34
-
35
- * **sonar:** fix coverage stats ([a1f2538](https://github.com/jungvonmatt/contentful-ssg/commit/a1f2538b892029f36ab4af57e9ca311b12320b58))
36
-
37
-
38
-
39
-
40
-
41
- # [1.8.0-alpha.3](https://github.com/jungvonmatt/contentful-ssg/compare/v1.8.0-alpha.2...v1.8.0-alpha.3) (2022-06-02)
42
-
43
-
44
- ### Bug Fixes
45
-
46
- * **sonar:** fix coverage stats ([a1f2538](https://github.com/jungvonmatt/contentful-ssg/commit/a1f2538b892029f36ab4af57e9ca311b12320b58))
47
-
48
-
49
-
50
-
51
-
52
- # [1.8.0-alpha.2](https://github.com/jungvonmatt/contentful-ssg/compare/v1.8.0-alpha.1...v1.8.0-alpha.2) (2022-05-25)
53
-
54
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
55
-
56
-
57
-
58
-
59
-
60
- # [1.8.0-alpha.1](https://github.com/jungvonmatt/contentful-ssg/compare/v1.8.0-alpha.0...v1.8.0-alpha.1) (2022-05-24)
61
-
62
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
63
-
64
-
65
-
66
-
67
-
68
- # [1.8.0-alpha.0](https://github.com/jungvonmatt/contentful-ssg/compare/v1.7.4...v1.8.0-alpha.0) (2022-05-24)
69
-
70
-
71
- ### Bug Fixes
72
-
73
- * bumps fs-extra ([42cb100](https://github.com/jungvonmatt/contentful-ssg/commit/42cb100df8d47ca11bfa0834cf7610d9cdbe2931))
74
-
75
-
76
-
77
-
78
-
79
- ## [1.7.4](https://github.com/jungvonmatt/contentful-ssg/compare/v1.7.3...v1.7.4) (2022-05-18)
80
-
81
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
82
-
83
-
84
-
85
-
86
-
87
- ## [1.7.3](https://github.com/jungvonmatt/contentful-ssg/compare/v1.7.2...v1.7.3) (2022-05-02)
88
-
89
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
90
-
91
-
92
-
93
-
94
-
95
- ## [1.7.1](https://github.com/jungvonmatt/contentful-ssg/compare/v1.7.0...v1.7.1) (2022-04-27)
96
-
97
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
98
-
99
-
100
-
101
-
102
-
103
- # [1.7.0](https://github.com/jungvonmatt/contentful-ssg/compare/v1.6.1...v1.7.0) (2022-04-26)
104
-
105
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
106
-
107
-
108
-
109
-
110
-
111
- ## [1.4.9](https://github.com/jungvonmatt/contentful-ssg/compare/v1.4.8...v1.4.9) (2022-02-11)
112
-
113
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
114
-
115
-
116
-
117
-
118
-
119
- ## [1.4.8](https://github.com/jungvonmatt/contentful-ssg/compare/v1.4.7...v1.4.8) (2022-02-09)
120
-
121
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
122
-
123
-
124
-
125
-
126
-
127
- ## [1.4.5](https://github.com/jungvonmatt/contentful-ssg/compare/v1.4.4...v1.4.5) (2022-01-31)
128
-
129
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
130
-
131
-
132
-
133
-
134
-
135
- ## [1.4.2](https://github.com/jungvonmatt/contentful-ssg/compare/v1.4.1...v1.4.2) (2022-01-20)
136
-
137
-
138
- ### Bug Fixes
139
-
140
- * 🐛 Don't ask for delivery & preview token ([10a9a74](https://github.com/jungvonmatt/contentful-ssg/commit/10a9a74f24fecca9d8866d39e2ca9095e9a4d638))
141
- * 🐛 lint ([22c8b38](https://github.com/jungvonmatt/contentful-ssg/commit/22c8b38fbe1f62e20a597545808181fc488d04c6))
142
-
143
-
144
-
145
-
146
-
147
- ## [1.4.1](https://github.com/jungvonmatt/contentful-ssg/compare/v1.4.0...v1.4.1) (2022-01-20)
148
-
149
- **Note:** Version bump only for package @jungvonmatt/contentful-fakes
150
-
151
-
152
-
153
-
154
-
155
- # [1.4.0](https://github.com/jungvonmatt/contentful-ssg/compare/v1.3.2...v1.4.0) (2022-01-19)
156
-
157
-
158
- ### Features
159
-
160
- * 🎸 Adds new contentful-fakes package ([bb67694](https://github.com/jungvonmatt/contentful-ssg/commit/bb676946532281864c6355f294e984f792f9cfa3))
@@ -1,46 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <testExecutions version="1">
3
- <file path="/Users/benjamin.zoerb/Github/contentful-ssg/packages/contentful-fakes/src/lib/faker.test.ts">
4
- <testCase name="contentful-fakes getTextFake (validation: in)" duration="0"/>
5
- <testCase name="contentful-fakes getTextFake (validation: regexp)" duration="1"/>
6
- <testCase name="contentful-fakes getTextFake (validation: size)" duration="12"/>
7
- <testCase name="contentful-fakes getIntegerFake (validation: in)" duration="0"/>
8
- <testCase name="contentful-fakes getIntegerFake (validation: min)" duration="1"/>
9
- <testCase name="contentful-fakes getIntegerFake (validation: max)" duration="0"/>
10
- <testCase name="contentful-fakes getIntegerFake (validation: range)" duration="0"/>
11
- <testCase name="contentful-fakes getNumberFake (validation: in)" duration="0"/>
12
- <testCase name="contentful-fakes getNumberFake (validation: min)" duration="0"/>
13
- <testCase name="contentful-fakes getNumberFake (validation: max)" duration="0"/>
14
- <testCase name="contentful-fakes getNumberFake (validation: range)" duration="0"/>
15
- <testCase name="contentful-fakes getSymbolFake (validation: in)" duration="0"/>
16
- <testCase name="contentful-fakes getSymbolFake (validation: regex)" duration="0"/>
17
- <testCase name="contentful-fakes getSymbolFake (interface: urlEditor)" duration="0"/>
18
- <testCase name="contentful-fakes getSymbolFake (interface: slugEditor)" duration="0"/>
19
- <testCase name="contentful-fakes getSymbolFake (special ids)" duration="1"/>
20
- <testCase name="contentful-fakes getSymbolFake (dropdown/radio)" duration="0"/>
21
- <testCase name="contentful-fakes getSymbolFake (min)" duration="0"/>
22
- <testCase name="contentful-fakes getSymbolFake (max)" duration="0"/>
23
- <testCase name="contentful-fakes getSymbolFake (min/max)" duration="0"/>
24
- <testCase name="contentful-fakes getAssetFake" duration="1"/>
25
- <testCase name="contentful-fakes getEntryScheme" duration="0"/>
26
- <testCase name="contentful-fakes getLinkFake (asset)" duration="0"/>
27
- <testCase name="contentful-fakes getLinkFake (entry)" duration="0"/>
28
- <testCase name="contentful-fakes getRichtextFake min" duration="1"/>
29
- <testCase name="contentful-fakes getRichtextFake max" duration="0"/>
30
- <testCase name="contentful-fakes getTextFake (special ids)" duration="1"/>
31
- <testCase name="contentful-fakes getRegexValue (preset: email)" duration="0"/>
32
- <testCase name="contentful-fakes getRegexValue (preset: url)" duration="0"/>
33
- <testCase name="contentful-fakes getRegexValue (preset: Date US)" duration="2"/>
34
- <testCase name="contentful-fakes getRegexValue (preset: Date European)" duration="0"/>
35
- <testCase name="contentful-fakes getRegexValue (preset: 12h Time)" duration="0"/>
36
- <testCase name="contentful-fakes getRegexValue (preset: 24h Time)" duration="1"/>
37
- <testCase name="contentful-fakes getRegexValue (preset: US Phone number)" duration="0"/>
38
- <testCase name="contentful-fakes getRegexValue (preset: US Zip code)" duration="0"/>
39
- <testCase name="contentful-fakes getRegexValue (custom regex)" duration="1"/>
40
- <testCase name="contentful-fakes getMockData" duration="1"/>
41
- <testCase name="contentful-fakes getArrayFake (type: symbbol)" duration="1"/>
42
- <testCase name="contentful-fakes getArrayFake (type: text)" duration="0"/>
43
- <testCase name="contentful-fakes getArrayFake (type: asset link)" duration="0"/>
44
- <testCase name="contentful-fakes getArrayFake (type: entry link)" duration="0"/>
45
- </file>
46
- </testExecutions>
package/jest.config.js DELETED
@@ -1,10 +0,0 @@
1
- export default {
2
- displayName: 'contentful-fakes',
3
- preset: '../../jest.preset.js',
4
- globals: {
5
- 'ts-jest': {
6
- tsconfig: '<rootDir>/tsconfig.test.json',
7
- },
8
- },
9
- moduleFileExtensions: ['ts', 'js'],
10
- };
package/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "dist"
6
- },
7
- "include": ["./src/index.ts", "./src/**/*.ts"],
8
- "exclude": ["./src/**/*.test.ts"],
9
-
10
- }
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "rootDir": "../..",
5
- }
6
- }