feat: create success stubs json with type generation (#33)

This commit is contained in:
RustamRu 2024-11-17 18:06:55 +03:00
parent f67abf5e46
commit 2fb59303d2
4 changed files with 144 additions and 0 deletions

88
package-lock.json generated
View File

@ -34,6 +34,7 @@
"eslint-plugin-react": "^7.37.2",
"globals": "^15.11.0",
"prettier": "3.3.3",
"ts-json-as-const": "^1.0.7",
"typescript-eslint": "^8.12.2"
}
},
@ -2863,6 +2864,13 @@
"react": ">=18"
}
},
"node_modules/@dfoverdx/tocamelcase": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@dfoverdx/tocamelcase/-/tocamelcase-1.0.7.tgz",
"integrity": "sha512-QDlMJqwcE4eVCvxxQXp8nh7Nw9m5VQHPCAiyTD+W86Tl89VGhVJRb//RJRZKpn5A/Bq3EQNYDYlepurQ805MOQ==",
"dev": true,
"license": "ISC"
},
"node_modules/@emotion/babel-plugin": {
"version": "11.12.0",
"resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.12.0.tgz",
@ -6777,6 +6785,13 @@
"node": ">=6"
}
},
"node_modules/get-own-enumerable-property-symbols": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz",
"integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==",
"dev": true,
"license": "ISC"
},
"node_modules/get-symbol-description": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz",
@ -7573,6 +7588,19 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-obj": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-3.0.0.tgz",
"integrity": "sha512-IlsXEHOjtKhpN8r/tRFj2nDyTmHvcfNeu/nrRIcXE17ROeatXchkojffa1SpdqW4cr/Fj6QkEf/Gn4zf6KKvEQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-path-cwd": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz",
@ -7635,6 +7663,19 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-regexp": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz",
"integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-root": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-root/-/is-root-2.1.0.tgz",
@ -7783,6 +7824,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/isbinaryfile": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz",
"integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 8.0.0"
},
"funding": {
"url": "https://github.com/sponsors/gjtorikian/"
}
},
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@ -10123,6 +10177,21 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/stringify-object": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-4.0.1.tgz",
"integrity": "sha512-qpV1FBpN0R1gDAhCHIU71SYGZb35Te+gOQbQ6lYRmVJT7pF1NB8mkHeEJvyYNiHXw+fB4KIbeIjQl1rgiIijiA==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
"get-own-enumerable-property-symbols": "^3.0.2",
"is-obj": "^3.0.0",
"is-regexp": "^3.0.0"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
}
},
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
@ -10413,6 +10482,25 @@
"typescript": ">=4.2.0"
}
},
"node_modules/ts-json-as-const": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/ts-json-as-const/-/ts-json-as-const-1.0.7.tgz",
"integrity": "sha512-UMM24g4uBevqBuEqeMUNm2yBEd6VrpJt2hhGWSpmr3nGuhQYwYcLpmxUjsAh5qxJbafF+ICrHvOvHn16zh9Ojg==",
"dev": true,
"license": "ISC",
"dependencies": {
"@dfoverdx/tocamelcase": "^1.0.7",
"isbinaryfile": "^4.0.8",
"json5": "^2.2.0",
"stringify-object": "^4.0.0"
},
"bin": {
"ts-json-as-const": "index.js"
},
"peerDependencies": {
"typescript": ">=3"
}
},
"node_modules/tslib": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz",

View File

@ -42,6 +42,7 @@
"eslint-plugin-react": "^7.37.2",
"globals": "^15.11.0",
"prettier": "3.3.3",
"ts-json-as-const": "^1.0.7",
"typescript-eslint": "^8.12.2"
}
}

View File

@ -0,0 +1,27 @@
{
"success": true,
"body": {
"hero-section": {
"headline": "hero-section.headline",
"description": "hero-section.description",
"video": "demo.mp4"
},
"sections": [
{
"type": "benefits-section",
"heading": "benefits-section.heading",
"description": "benefits-section.description",
"list": [
"benefits-section.list.0",
"benefits-section.list.1",
"benefits-section.list.2",
"benefits-section.list.3"
]
},
{
"type": "social-proof-section",
"heading": "social-proof-section.heading"
}
]
}
}

View File

@ -0,0 +1,28 @@
interface LandingSuccess {
success: true,
body: {
'hero-section': {
headline: 'hero-section.headline',
description: 'hero-section.description',
video: 'demo.mp4'
},
sections: [
{
type: 'benefits-section',
heading: 'benefits-section.heading',
description: 'benefits-section.description',
list: [
'benefits-section.list.0',
'benefits-section.list.1',
'benefits-section.list.2',
'benefits-section.list.3'
]
},
{type: 'social-proof-section', heading: 'social-proof-section.heading'}
]
}
}
declare const LandingSuccess: LandingSuccess;
export = LandingSuccess;