Closed maxbaluev closed 4 years ago
I just have run sts api/ -o api_ts/models/
but the components is not generating data:
Here is the strapi web admin:
Here is the generated interfaced, note that the comoponent RegisterData
is typed by any instead other type.
Now the components are in ./components not in api folder.
/**
* Model definition for Register
*/
export interface IRegister {
id: string;
Pictures: any[];
PolicePictures: any[];
createdTime?: Date;
PDFpolice: any[];
PDFgenerated: any[];
PoliceNotified?: boolean;
Printed?: boolean;
RegisterData?: any;
}
I have run with:
Full package.json:
{
"name": "my-project",
"private": true,
"version": "0.1.0",
"description": "A Strapi application",
"scripts": {
"develop": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi",
"gen-ts-interfaces": "sts api/ -o api_ts/models/",
"build-ts": "tsc"
},
"devDependencies": {
"strapi-to-typescript": "^1.0.1"
},
"dependencies": {
"knex": "<0.20.0",
"reflect-metadata": "^0.1.13",
"sqlite3": "latest",
"strapi": "3.0.5",
"strapi-admin": "3.0.5",
"strapi-connector-bookshelf": "3.0.5",
"strapi-plugin-content-manager": "3.0.5",
"strapi-plugin-content-type-builder": "3.0.5",
"strapi-plugin-documentation": "3.0.5",
"strapi-plugin-email": "3.0.5",
"strapi-plugin-entity-relationship-chart": "^0.2.0",
"strapi-plugin-graphql": "3.0.5",
"strapi-plugin-upload": "3.0.5",
"strapi-plugin-users-permissions": "3.0.5",
"strapi-utils": "3.0.5",
"tsyringe": "^4.3.0"
},
"author": {
"name": "A Strapi developer"
},
"strapi": {
"uuid": "a8d8b8f0-49c1-4f74-bf70-dec7530dc4f0"
},
"engines": {
"node": ">=10.0.0",
"npm": ">=6.0.0"
},
"license": "MIT"
}
@Juanmabs22 : Hello, have you try the command line option -g
?
@Juanmabs22 : Hello, have you try the command line option
-g
?
Yes, same result.
@Juanmabs22 : Hello, have you try the command line option
-g
?Yes, same result.
Could you paste the full command used with the option -g
@Juanmabs22 Component with PascalCase/CamelCase naming is converted in snakeCase by strapi. I try to fix this. You can rename registerData
in registerdata
, this should be fix this problem temporally.
@Juanmabs22 : Hello, have you try the command line option
-g
?Yes, same result.
Could you paste the full command used with the option
-g
sts api/ -o api_ts/models/ -g
Thanks for your support.
@Juanmabs22 Component with PascalCase/CamelCase naming is converted in snakeCase by strapi. I try to fix this. You can rename
registerData
inregisterdata
, this should be fix this problem temporally.
Still same result, I think the components is not being processed.
I attach the project if you could check the problem. my-project.zip
Now is not important due I'm working on a personal project :).
@Juanmabs22 : Just add folder of Strapi components. sts api/ -o api_ts/models/ -g components/
@Juanmabs22 : Just add folder of Strapi components.
sts api/ -o api_ts/models/ -g components/
Thanks! It's works like a charm. Thanks for supporting me.
Done in v1.0.0 release