Azure / autorest.azure-functions-typescript

Typescript Azure Functions code generator using autorest
MIT License
4 stars 6 forks source link

deps: upgrading libraries so the tool works #3

Closed mdelarocha closed 8 months ago

mdelarocha commented 2 years ago

Should address #2, the main issue was that js-yaml was pinned at v3 and Autorest uses v4+. There were also other modules, specifically the @azure-tools ones that got renamed that I also upgraded. Got it to work in my local with the following command:

autorest  --use:path/to/cloned/repo/autorest.azure-functions-typescript \
          --input-file:path/to/spec/spec.yaml \
          --output-folder:folder/to/output/ \
          --no-namespace-folders:True \
          --clear-output-folder

Hope this helps some folks waiting for this to work!

ghost commented 2 years ago

CLA assistant check
All CLA requirements met.

maisnamraju commented 2 years ago

hi @mdelarocha I tried building your file but received the following error


node_modules/@autorest/codemodel/dist/model/http/http.d.ts:15:9 - error TS1110: Type expected.

15     in: `${ParameterLocation}`;
           ~~~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:17:11 - error TS1109: Expression expected.

17     style?: SerializationStyle;
             ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:19:13 - error TS1109: Expression expected.

19     explode?: boolean;
               ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:21:21 - error TS1109: Expression expected.

21     skipUriEncoding?: boolean;
                       ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:22:1 - error TS1128: Declaration or statement expected.

22 }
   ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:24:27 - error TS1110: Type expected.

24     constructor(location: `${ParameterLocation}`, objectInitializer?: DeepPartial<HttpParameter>);
                             ~~~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:24:69 - error TS1109: Expression expected.

24     constructor(location: `${ParameterLocation}`, objectInitializer?: DeepPartial<HttpParameter>);
                                                                       ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:24:97 - error TS1005: '(' expected.

24     constructor(location: `${ParameterLocation}`, objectInitializer?: DeepPartial<HttpParameter>);
                                                                                                   ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:25:1 - error TS1128: Declaration or statement expected.

25 }
   ~

Found 9 errors.
mdelarocha commented 2 years ago

hi @mdelarocha I tried building your file but received the following error


node_modules/@autorest/codemodel/dist/model/http/http.d.ts:15:9 - error TS1110: Type expected.

15     in: `${ParameterLocation}`;
           ~~~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:17:11 - error TS1109: Expression expected.

17     style?: SerializationStyle;
             ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:19:13 - error TS1109: Expression expected.

19     explode?: boolean;
               ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:21:21 - error TS1109: Expression expected.

21     skipUriEncoding?: boolean;
                       ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:22:1 - error TS1128: Declaration or statement expected.

22 }
   ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:24:27 - error TS1110: Type expected.

24     constructor(location: `${ParameterLocation}`, objectInitializer?: DeepPartial<HttpParameter>);
                             ~~~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:24:69 - error TS1109: Expression expected.

24     constructor(location: `${ParameterLocation}`, objectInitializer?: DeepPartial<HttpParameter>);
                                                                       ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:24:97 - error TS1005: '(' expected.

24     constructor(location: `${ParameterLocation}`, objectInitializer?: DeepPartial<HttpParameter>);
                                                                                                   ~

node_modules/@autorest/codemodel/dist/model/http/http.d.ts:25:1 - error TS1128: Declaration or statement expected.

25 }
   ~

Found 9 errors.

Hi @maisnamraju, thanks for your comment. What version of tsc do you have installed? I am testing this with version 4.6.3. If you run tsc -p . from the root directory it builds your dist folder for the plugin to work. For some reason when running through npm it doesn't ignore the node_modules directory where those errors are coming from and we have no control over the structure/linting of those folders therefore why its erroring out. The code inside the project itself is fine however.