Comments (17)
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.
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.
@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.
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.
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.
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.
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.
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.
Woaw, that was quick. Just looked through and it looks good to me. Also templating support is really cool stuff ๐.
from skpm.
If you are up to create a template for typescript, iโd happily linked to it :)
from skpm.
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.
awesome! Do you think we could generate the sketch.d.ts
from the class dump? ๐ค
from skpm.
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.
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.
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.
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.
Oh my, that's impressive! Great starting point for typescript generation. Will definitely use it. Thank you!
from skpm.
Related Issues (20)
- skpm publish does not add or update lastUpdated flag in plugin directory HOT 5
- skpm-build --output๏ผ absolute paths are not supported
- Typescript bug: if I try use typescript file with .ts extension as a manifest script, build incorrectly replace the script name HOT 1
- Confused about skpm versions HOT 1
- Publishing on OSX Big Sur HOT 7
- Webpack 5
- skpm-build --watch doesn't update Sketch plugin folder HOT 2
- ssri vulnerability HOT 5
- Sass-loader not compatible with webpack version
- glob-parent vulnerability HOT 1
- Sketch crushes after trying to load a plugin HOT 1
- TextAlignment mistake on apple silicon HOT 1
- Cannot build project: TypeError: console.log.bind is not a function
- skpm breaking my plugin HOT 2
- null is not an object (evaluating 'NSApplication.sharedApplication().orderedDocuments().firstObject().showMessage') HOT 1
- How to notify in sketch after publishing๏ผ
- Builder is crashing because dependencies are old HOT 6
- [CVE-2023-0842] `xml2js` has vulnerability, needs updated
- Adding webbrowser api libraries to skpm puging
- one error with `babel-loader`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skpm.