Giter Club home page Giter Club logo

Comments (5)

Clovel avatar Clovel commented on May 27, 2024 2

If fixed this using a JS script that patches the files after having generated the code. It's more of a workaround than a real fix of the wsdl-tsclient library.

I can share the script if you want to. I used regular expressions to find and replace the duplicates.

const lServiceExportRegEx = /export { ([A-Za-z]*) } from ".\/services\/\1";/gm;
const lPortExportRegEx = /export { ([A-Za-z]*) } from ".\/ports\/\1";/gm;
const lPortImportRegEx = /import { ([A-Za-z]*) } from "..\/ports\/\1";/gm;
const lServiceInterfaceRegEx = /readonly ([A-Za-z]*): \1;/gm;

const lServiceSubValue = `export { $1 as $1Service } from "./services/$1";`;
const lPortSubValue = `export { $1 as $1Port } from "./ports/$1";`;
const lPortImportSubValue = `import { $1 as $1Port } from "../ports/$1";`;
const lServiceInterfaceSubValue = `readonly $1: $1Port;`;

from wsdl-tsclient.

Clovel avatar Clovel commented on May 27, 2024

Any news on this or #46 ? Have any maintainers went through this ?

from wsdl-tsclient.

Clovel avatar Clovel commented on May 27, 2024

I have a similar situation where the wsdl-tsclient CLI made duplicates :

image

Any idea how I could fix this ?

from wsdl-tsclient.

pazoozooCH avatar pazoozooCH commented on May 27, 2024

I ended up just manually adding aliases for the clashing names, like:

export { WebPaymentApi as WebPaymentApiService } from "./services/WebPaymentApi";
export { WebPaymentApi as WebPaymentApiPort } from "./ports/WebPaymentApi";

Same in the services/WebPaymentApi.ts file (alias for port).

I don't mind that much as I only have one service and my wsdl is quite stable. But would be nice if the the tool would detect those kind of duplications itself - or at least provide a standardized way to provide aliases. It seems like it's not very unlikely that a real-life wsdl would result in duplications like that...

If it would bother me more and/or I had the time, I might try to fix it myself with a pull request...

from wsdl-tsclient.

extradosages avatar extradosages commented on May 27, 2024

Still an issue for us.

from wsdl-tsclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.