Giter Site home page Giter Site logo

Update README: synthwave84.css doesn't need to be copied to another location if it's already present in the extensions folder about synthwave-vscode HOT 5 OPEN

robb0wen avatar robb0wen commented on June 2, 2024 5
Update README: synthwave84.css doesn't need to be copied to another location if it's already present in the extensions folder

from synthwave-vscode.

Comments (5)

hadriengerard avatar hadriengerard commented on June 2, 2024 5

Update: I've done some tests and I realized that we have access to window.nodeRequire which gives us access to the FileSystem thanks to nodeRequire('fs').

So I updated the script and it now finds the right extension directory whatever the version number is.

No more need for tags names or internet access! It should load the synthwave84.css file from the extension directory after each update without having to change the path.

It also gets the user home directory with nodeRequire('os').homedir() and no more config is required except the declaration in settings.json like:

"vscode_custom_css.imports": [
    "file:///Users/username/.vscode/loadResourcesFromExtensionsDirectory.js" 
],

Let me know what you think of it ๐Ÿ™‚

from synthwave-vscode.

robb0wen avatar robb0wen commented on June 2, 2024 3

I originally wanted to do it this way. The issue I see though, is that the file-path to the extension changes every time it updates a version number. This means that any update to the extension will break the glow, regardless of whether or not the CSS file has changed.

Currently, copying it means that unless the glow CSS has been updated, it will persist as it was prior to the update.

There are definitely pros and cons to both methods.

I'd be interested to get more feedback as to which was preferred.

from synthwave-vscode.

robb0wen avatar robb0wen commented on June 2, 2024 2

Nice! very cool work. I'll look to incorporate it in the next version.

from synthwave-vscode.

hadriengerard avatar hadriengerard commented on June 2, 2024 1

I also prefer @ranolfi's method because the css will remain up to date with the next updates of the extension.

Regarding the version number issue, I have made this little script which is load instead of the css file in vscode_custom_css.imports. It fetches the tag names from the repo and then look for a matching directory/file with the file:/// protocol, allowing to not worry about future updates.

This is probably not the best solution, plus it will not work without internet connection (I can probably add a fallback for this), but It should work with any extension.

from synthwave-vscode.

snd3r avatar snd3r commented on June 2, 2024

@hadriengerard works great!
I think the right place for this script is the Readme.md file.

from synthwave-vscode.

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.