Giter Club home page Giter Club logo

Comments (17)

romansp avatar romansp commented on May 25, 2024 1

Just pushed template for skpm with TypeScript and TSLint here: https://github.com/romansp/skpm-typescript.
That was really easy to do. Thanks a lot for your efforts adding support for custom templates and skpm in general. ๐Ÿ‘

from skpm.

mathieudutour avatar mathieudutour commented on May 25, 2024

My guess is that when multiple "script" files are run through 'webpack' userDefinedWebpackConfig.plugins becomes mutated.

oh yes, of course, silly me.

I'd love a PR yes, can you make sure it's compatible with node 6 (don't remember when [...] was introduced)?

from skpm.

romansp avatar romansp commented on May 25, 2024

@mathieudutour, while we are here, what do you think of similar support for webpack's module.rules or maybe even more stuff?

I'm currently using typescript and vue.js for Sketch plugin development and can't use skpm's preconfigured staticResourceLoader and babelLoader, as I'm overriding those completely with my own rules for loaders.

That's shouldn't be very hard to implement. Can do it in my spare time, if you find it useful.

from skpm.

mathieudutour avatar mathieudutour commented on May 25, 2024

I'm all for more support of custom webpack config. I was just a bit concerned that if I added to skpm rules to the custom rules, there would be some conflicts and that would be really hard to debug and understand for the user

from skpm.

mathieudutour avatar mathieudutour commented on May 25, 2024

Thinking a bit more about the webpack config: what do you think about having a special file webpack.config.skpm.js which should expose a function taking the default config as an argument? The user can do whatever they want with it and it's clear that if something breaks, it's their config so it's easier to debug and fix. (that's what preact is doing: https://github.com/developit/preact-cli#webpack)

from skpm.

romansp avatar romansp commented on May 25, 2024

That sounds good. I like it.

Want to share my current experience. At first, I was happily surprised that I can add webpack.config.js or .babelrc and it will go right into the skpm build process, so I can easily add support for typescript, vue, whatever. After I added rules and tried building I was pretty much confused of where did skpm rules go and why babel stopped doing its thing. It wasn't clear at all.

So, yeah I definitely like that approach more than the current. I'm also starting to think about dev/prod builds: tree shaking, minification, etc. With the approach of having a special file it will be easier to setup dev/prod builds, I guess at least.

I saw your comment mentioning that skpm is in the finished state and it definitely is, so I'm not quite sure if you are in the mood to implement new features. I like working with it anyway, but making some additional knobs will be a huge ๐Ÿ‘.

from skpm.

mathieudutour avatar mathieudutour commented on May 25, 2024

I'm actually completely re-writing it to split the build process from everything because I don't want to bloat plugin with unnecessary stuff ๐Ÿ˜„
I'll see if I can integrate that during the rewrite

from skpm.

mathieudutour avatar mathieudutour commented on May 25, 2024

I'd love it if you could check out the new readmes before I merge ๐Ÿ˜„
https://github.com/skpm/skpm/blob/9c57129bd8e21ad9692e11611617db1920185dde/README.md
https://github.com/skpm/skpm/blob/4449179a278452a7ea23df531aa1e3a9ba68170e/template/README.md

from skpm.

romansp avatar romansp commented on May 25, 2024

Woaw, that was quick. Just looked through and it looks good to me. Also templating support is really cool stuff ๐Ÿ‘.

from skpm.

mathieudutour avatar mathieudutour commented on May 25, 2024

If you are up to create a template for typescript, iโ€™d happily linked to it :)

from skpm.

romansp avatar romansp commented on May 25, 2024

I would really like to do it. However my current setup is far from ideal, and I need to integrate recent changes to skpm first. Anyway, will try to find some time to contribute back :)

from skpm.

mathieudutour avatar mathieudutour commented on May 25, 2024

awesome! Do you think we could generate the sketch.d.ts from the class dump? ๐Ÿค”

from skpm.

romansp avatar romansp commented on May 25, 2024

I was thinking about generation of sketch.d.ts automatically and maybe starting it as a next pet-project. Unfortunately, I'm out of ideas from where do I even start. If you have some thoughts I will be happy to discuss this.

For Sketch plugin that's currently in development I manually fill sketch.d.ts using class-dump as a reference. I also have globals.d.ts where I put things relevant to NS* and Mocha. But decided to keep template clean and didn't include it.

I already benefited a lot from doing types both for refactoring and overall development purposes. Of course it requires initial efforts, but I don't regret it at all.

from skpm.

mathieudutour avatar mathieudutour commented on May 25, 2024

it should be possible to parse a header file (something similar to this: https://github.com/subh007/ObjCParser) and then generate a types file from that object. A first step could be just getting the methods without the types of the arguments.

Probably won't have time to look into it just right now but maybe in a couple of weeks

from skpm.

romansp avatar romansp commented on May 25, 2024

Thanks for the link, that's the approach I'm thinking of. Will look into this particular tool (or maybe other alternatives) in my spare time. Will keep you updated, if there will be any progress ๐Ÿ˜„ .

from skpm.

mathieudutour avatar mathieudutour commented on May 25, 2024

We've got the headers parsed here https://github.com/skpm/sketch-headers if you want to use them to generate a typescript types file

from skpm.

romansp avatar romansp commented on May 25, 2024

Oh my, that's impressive! Great starting point for typescript generation. Will definitely use it. Thank you!

from skpm.

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.