added vscode extensions

This commit is contained in:
tomit4 2021-11-05 11:26:45 -07:00
parent 7cde0829be
commit 26e2a50441
316 changed files with 37301 additions and 0 deletions

View file

@ -0,0 +1,42 @@
language: node_js
node_js:
- "7.9.0"
cache:
directories:
- node_modules
yarn: true
os:
- linux
- osx
addons:
apt:
packages:
- libsecret-1-dev
before_install:
- if [ $TRAVIS_OS_NAME == "linux" ]; then
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
sleep 3;
fi
install:
- export CI=true
- npm i -g vsce
- npm install
- npm run vscode:prepublish
script:
- vsce package -o LiveSassCompiler-$TRAVIS_TAG-$TRAVIS_OS_NAME.vsix
deploy:
provider: releases
api_key: $github_token
file: "*.vsix"
file_glob: true
skip_cleanup: true
on:
tags: true

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Language="en-US" Id="live-sass" Version="3.0.0" Publisher="ritwickdey"/>
<DisplayName>Live Sass Compiler</DisplayName>
<Description xml:space="preserve">Compile Sass or Scss to CSS at realtime with live browser reload.</Description>
<Tags>SASS,SCSS,Compiler,Transpiler,SASS Compiler,scss,sass,css</Tags>
<Categories>Other,Extension Packs</Categories>
<GalleryFlags>Public Preview</GalleryFlags>
<Badges></Badges>
<Properties>
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.0.0" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="ritwickdey.LiveServer" />
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/ritwickdey/vscode-live-sass-compiler.git" />
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/ritwickdey/vscode-live-sass-compiler.git" />
<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/ritwickdey/vscode-live-sass-compiler.git" />
<Property Id="Microsoft.VisualStudio.Services.Links.Support" Value="https://github.com/ritwickdey/vscode-live-sass-compiler/issues" />
<Property Id="Microsoft.VisualStudio.Services.Links.Learn" Value="https://ritwickdey.github.io/vscode-live-sass-compiler/" />
<Property Id="Microsoft.VisualStudio.Services.Branding.Color" Value="#41205f" />
<Property Id="Microsoft.VisualStudio.Services.Branding.Theme" Value="dark" />
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />
</Properties>
<License>extension/LICENSE.txt</License>
<Icon>extension/images/icon2.png</Icon>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
</Installation>
<Dependencies/>
<Assets>
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.Changelog" Path="extension/CHANGELOG.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.License" Path="extension/LICENSE.txt" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/images/icon2.png" Addressable="true" />
</Assets>
</PackageManifest>

View file

@ -0,0 +1,41 @@
# Changelog
| Version | Date | Changelog|
| ------- | -------- | ------ |
|3.0.0 | 11.07.2018 | &mdash; Upgrade `sass.js` library that included fixes for 8 digit Hex code & grid name. [Fixes [#39](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/39), [#40](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/40), [#78](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/77)] |
|2.2.1 | 29.06.2018 | &mdash; ***[Fixes [#77](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/77)]*** Rebuild the package |
|2.2.0 | 29.06.2018 | &mdash; ***[Fixes [#76](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/76)]*** (That was library issue. Sass.js is downgraded to `v0.10.8`)|
|2.1.0| 28.06.2018 | &mdash; ***[Fixes [#73](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/73)]*** Change detection of Partial Sass was missing in `v2.0.0` |
|2.0.0|27.06.2018| &mdash; Fixes [#6](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/6) [#62](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/62) <br>&mdash; Include Path Fixes <br>&mdash; Grid Autoprefix <br>&mdash; Autoprefix is now on by default|
|1.3.0|19.02.2018| &mdash; ***[NEW [#41](https://github.com/ritwickdey/vscode-live-sass-compiler/pull/41)]*** <br> - added ability to suppress the output window<br> - Statusbar button Color change based on `Success` and `error`.<br><br>_[Thanks a lot to [Brandon Baker](https://github.com/bmwigglestein) for sumitting the PR ]_|
|1.2.0|21.12.17| &mdash; ***[New Features [#26](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/26)]*** `savePath` setting updated. You can now specify `savePath` location relative to your Sass files. *See Settings section for more details* *[Thanks [Marius](https://github.com/morsanu)]* <br><br>&mdash; ***[Bug Fixed [#25](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/25)]*** No more extra new line in generated CSS. *[Thanks [Shahril Amri](https://github.com/redemption024)]* <br><br>&mdash;**[Bug Fixed [#33](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/33)]** Now firefox is recognizing source scss file. *[Thanks [Felix](https://github.com/felix007)]*|
|1.1.0| 01.11.17 | &mdash; ***[NEW [#19](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/19)]*** Support for autoprefix in generated CSS. (see settings section for more) _[Thanks a lot to [boyum](https://github.com/boyum) for sumitting the PR [#22](https://github.com/ritwickdey/vscode-live-sass-compiler/pull/22)]_ <br><br>&mdash; ***[Bug fixed [#20](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/20)]*** : Fixed `liveSassCompile.settings.includeItems` settings. *[Thanks [Hoàng Nam](https://github.com/hoangnamitc)]* |
| 1.0.1 | 10.10.17| &mdash; ***[Fixes [#17](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/17)]*** Default value `savePath` from new settings (`.formats`) is revised. If you don't set any value it will generate CSS at the same location of sass/scss as it was before. _(See settings section for more details)_ *[Thanks [2289034325](https://github.com/2289034325) & [Ibsenleo](https://github.com/ibsenleo) for the feedback]* |
| 1.0.0 |10.10.17 | &mdash; ***[New Features/settings [#10](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/10)]*** Support for multiple extensionName, formats & save locations . *[Thanks to [Trinh Xuan Manh](https://github.com/ShadowFoOrm) for the suggestion and a Special Thanks to [Ibsenleo](https://github.com/ibsenleo) for the PR [#16](https://github.com/ritwickdey/vscode-live-sass-compiler/pull/16).]* <br><br>&mdash;***NOTE : Due to enable this feature, the `liveSassCompile.settings.format`, `.savePath`, `.extensionName` settings are dropped. [See settings section for the new setting.]*** |
|0.5.1|23.09.17| &mdash; ***[Bug Fixed [#12](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/12)]*** Sass files from excluded list was compiled on individual savings. _[Thanks [Braedin Jared](https://github.com/ImBaedin)]_ |
|0.5.0|25.08.17| &mdash; ***[New Settings]*** `liveSassCompile.settings.generateMap` : Set it as `false` if you don't want `.map` file for compiled CSS. Default is `true`. *[[#9](https://github.com/ritwickdey/vscode-live-sass-compiler/pull/9) Thanks [Mark Hewitt](https://github.com/mhco) for the PR].*|
|0.4.0|21.08.17|&mdash; ***[Renamed]*** `liveSassCompile.settings.excludeFolders` is renamed to `liveSassCompile.settings.excludeList`. <br><br>&mdash; ***[Fixed]*** You can set glob pattern to exclude files through `liveSassCompile.settings.excludeList` settings. You can also use negative glob pattern.*[For More details, follow settings section]* <br><br>&mdash; ***[New Settings [#8](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/8) ]*** `liveSassCompile.settings.includeItems` : This setting is useful when you deals with only few of sass files. Only mentioned Sass files will be included. NOTE: No need to include partial sass files. *[Thanks [PatrickPahlke](https://github.com/PatrickPahlke)]*.|
|0.3.4|15.08.17|**[Fixed [#7](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/7)]** Duplicate Output. _[Thanks [Tomekk-hnm](https://github.com/tomekk-hnm)]_.|
|0.3.3|01.08.17|[[#5](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/5)] Critical Fix Update for Linux & macOS. (Thanks a lot to [Shea Fitzek](https://github.com/sheafitzek)). |
|0.3.2 | 01.08.17 | [Hot Fix] CSS & map link was broken. |
|0.3.1 | 30.07.17 | &mdash; Ordering of Output log is fixed.<br><br>NOTE : Lot of code (almost full code) is changed as I've refactored the source code. So, if anything is broken (Hopefully NOT :D ), feel free to open a issue request on GitHub. I'm happy to resolve the bugs. |
|0.3.0|29.07.17| &mdash; This update does not include any new feature or major fix but a big fix in source code setup. I was facing a big configuration issue between TypeScript and non-NPM third-party library since I released the extension - even I was not able to debug extension directly from TypeScript codes. Finally I am able to fix it. (I promise, more updates are coming soon...).<br> &mdash; Statusbar text (at watching mode) has been changed.<br>&mdash;Package size reduced to more than 50%.|
|0.2.2|25.07.17|New Command added for one time Sass/Scss compilation. - Press `F1` or `ctrl+shift+p` and enter `Compile Sass - Without Watch Mode`.|
| 0.2.1 | 21.07.17 |[[#4](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/4)] Critical Bug Fixed update. [Thanks _[Cassio Cabral](https://github.com/cassioscabral)_].|
|0.2.0|20.07.17|[[#3](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/3)] New settings added to exclude specific folders from workspace. All Sass/Scss files inside the folders will be ignored. [Thanks _[Cassio Cabral](https://github.com/cassioscabral) for the suggestion_]. |
|0.1.2|19.07.17| Small Fix (Rename) update.|
| 0.1.1 | 14.07.17 | Fixed [#2](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/2) - Partial Sass/Sass files are not compiling in watching mode. (Thanks again, _[Kerry Smyth](https://github.com/Kerrys7777) :p_) |
|0.1.0| 13.07.17| Feature Added [#1](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/1) - Now the extesion will also generate `Linker Address Map (.map)` files in the same directory of `.css` (Thanks, _[Kerry Smyth](https://github.com/Kerrys7777)_). |
|0.0.5| 11.07.17 |`liveSassCompile.settings.extensionName` settings added. |
|0.0.4 | 11.07.17 | Icon updated.|
|0.0.3 | 11.07.17 | Fix update for Linux environment.|
|0.0.2 | 11.07.17 | Small description updated.|
| 0.0.1 | 11.07.17 | Initial Preview Release with following key features. <br> &mdash; Live SASS & SCSS Compile. <br> &mdash; Customizable file location of exported CSS. <br> &mdash; Customizable exported CSS Style (`expanded`, `compact`, `compressed`, `nested`.)<br> &mdash; Quick Status bar control.<br> &mdash; Live Reload to browser (`Live Server` extension dependency). |
<br>
>#### [Released] (11.07.2017)
>#### [Unreleased] (09.07.17 - 10.07.2017)

View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Ritwick Dey
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,52 @@
# Live Sass Compiler
**_[If you like the extension, [please leave a review](https://marketplace.visualstudio.com/items?itemName=ritwickdey.live-sass#review-details), it puts a smile on my face.]_**
**_[If you found any bug or if you have any suggestion, feel free to report or suggest me.]_**
[![VSCode Marketplace Badge](https://img.shields.io/vscode-marketplace/v/ritwickdey.live-sass.svg?label=VSCode%20Marketplace&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=ritwickdey.live-sass) [![Total Install](https://img.shields.io/vscode-marketplace/d/ritwickdey.live-sass.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=ritwickdey.live-sass) [![Avarage Rating Badge](https://img.shields.io/vscode-marketplace/r/ritwickdey.live-sass.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=ritwickdey.live-sass) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/ritwickdey/vscode-live-sass-compiler/)
A VSCode Extension that help you to compile/transpile your SASS/SCSS files to CSS files at realtime with live browser reload.
![App Preview](https://github.com/ritwickdey/vscode-live-sass-compiler/raw/master/./images/Screenshot/AnimatedPreview.gif)
## Usage/Shortcuts
1. Click to `Watch Sass` from Statusbar to turn on the live compilation and then click to `Stop Watching Sass` from Statusbar to turn on live compilation .
![Statusbar control](https://github.com/ritwickdey/vscode-live-sass-compiler/raw/master/./images/Screenshot/statusbar.jpg)
2. Press `F1` or `ctrl+shift+P` and type `Live Sass: Watch Sass` to start live compilation or, type `Live Sass: Stop Watching Sass` to stop a live compilation.
3. Press `F1` or `ctrl+shift+P` and type `Live Sass: Compile Sass - Without Watch Mode ` to compile Sass or Scss for one time.
## Features
* Live SASS & SCSS Compile.
* Customizable file location of exported CSS.
* Customizable exported CSS Style (`expanded`, `compact`, `compressed`, `nested`).
* Customizable extension name (`.css` or `.min.css`).
* Quick Status bar control.
* Exclude Specific Folders by settings.
* Live Reload to browser (Dependency on `Live Server` extension).
* Autoprefix Supported (See setting section)
## Installation
Open VSCode Editor and Press `ctrl+P`, type `ext install live-sass`.
## Settings
All settings are now listed here [Settings Docs](https://github.com/ritwickdey/vscode-live-sass-compiler/blob/master/./docs/settings.md).
## FAQ
*All FAQs are now listed here [FAQ Docs](https://github.com/ritwickdey/vscode-live-sass-compiler/blob/master/./docs/faqs.md)*
## Extension Dependency
This extension has dependency on _[Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)_ extension for live browser reload.
## What's new ?
* #### Version 3.0.0 (11.07.2018)
* Upgrade `sass.js` library that included fixes for 8 digit Hex code & grid name. [Fixes [#39](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/39), [#40](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/40), [#78](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/77)]
## Changelog
To check full changelog click here [changelog](https://github.com/ritwickdey/vscode-live-sass-compiler/blob/master/CHANGELOG.md).
## LICENSE
This extension is licensed under the [MIT License](https://github.com/ritwickdey/vscode-live-sass-compiler/blob/master/LICENSE)

View file

@ -0,0 +1,33 @@
## FAQ (For Beginners)
### How to config the settings in my project?
Create a `.vscode` folder in the root of project. Inside of `.vscode` folder create a json file named `settings.json`.
Inside of the `settings.json`, type following key-value pairs. By the way you'll get intelli-sense.
```json
{
"liveSassCompile.settings.formats":[
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/css"
},
{
"extensionName": ".min.css",
"format": "compressed",
"savePath": "/dist/css"
}
],
"liveSassCompile.settings.excludeList": [
"**/node_modules/**",
".vscode/**"
],
"liveSassCompile.settings.generateMap": true,
"liveSassCompile.settings.autoprefix": [
"> 1%",
"last 2 versions"
]
}
```

View file

@ -0,0 +1,100 @@
## Settings
* ~~**`liveSassCompile.settings.format`**~~
<hr>
* ~~**`liveSassCompile.settings.savePath`**~~
<hr>
* ~~**`liveSassCompile.settings.extensionName`**~~
<hr>
* ***[NEW]*** **`liveSassCompile.settings.formats`** : To setup Format (style), Extension Name & Save location for exported css [Multiple Format Supported].
* *Format can be _`expanded`_, _`compact`_, _`compressed`_ or _`nested`_. _Default is `expanded`._*
* *Extension Name can be `.css` or `.min.css`. Default is `.css`.*
* ***[New]*** Save location is relative from workspace root or your Sass files.
* Default value is `null`. (`null` means, it will generate CSS in the location of scss/sass. By The Way, It is `null`, NOT `"null"`).
* "`/`" denotes relative to root.
* "`~`" denotes relative to every sass file. - Complex Scenario. *([Checkout the example](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/26#issue-274641546))*
* *Example :*
```js
"liveSassCompile.settings.formats":[
// This is Default.
{
"format": "expanded",
"extensionName": ".css",
"savePath": null
},
// You can add more
{
"format": "compressed",
"extensionName": ".min.css",
"savePath": "/dist/css"
},
// More Complex
{
"format": "compressed",
"extensionName": ".min.css",
"savePath": "~/../css/"
}
]
```
<hr>
* **`liveSassCompile.settings.excludeList`:** To Exclude specific folders. All Sass/Scss files inside the folders will be ignored.
* _default value :_
```json
"liveSassCompile.settings.excludeList": [
"**/node_modules/**",
".vscode/**"
]
```
* You can use negative glob pattern.
* _Example : if you want exclude all file except `file1.scss` & `file2.scss` from `path/subpath` directory, you can use the expression -_
```json
"liveSassCompile.settings.excludeList": [
"path/subpath/*[!(file1|file2)].scss"
]
```
<hr>
* **`liveSassCompile.settings.includeItems`:** This setting is useful when you deals with only few of sass files. Only mentioned Sass files will be included.
* *NOTE: No need to include partial sass files.*
* *Default value is `null`*
* Example :
```json
"liveSassCompile.settings.includeItems": [
"path/subpath/a.scss",
"path/subpath/b.scss",
]
```
<hr>
* **`liveSassCompile.settings.generateMap`:** Set it as `false` if you don't want `.map` file for compiled CSS.
* _Default is `true`._
<hr>
* **`liveSassCompile.settings.autoprefix` :**
Automatically add vendor prefixes to unsupported CSS properties (e. g. `transform` -> `-ms-transform`).
* _Specify what browsers to target with an array of strings (uses [Browserslist](https://github.com/ai/browserslist))._
* _Set `null` to turn off. (Default is `null`)_
* Example:
```json
"liveSassCompile.settings.autoprefix": [
"> 1%",
"last 2 versions"
]
```
<hr>
* **`liveSassCompile.settings.showOutputWindow` :** Set this to `false` if you do not want the output window to show.
* *NOTE: You can use the command palette to open the Live Sass output window.*
* *Default value is `true`*
<hr>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,12 @@
{
"name": "sasslib",
"version": "1.1.0",
"description": "",
"main": "sass.node.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"private": true
}

View file

@ -0,0 +1,202 @@
/*! sass.js - v0.10.5 (2cd3782) - built 2017-06-25
providing libsass 3.4.5 (31573210)
via emscripten 1.37.0 ()
*/
(function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.Sass = factory();
}
}(this, function () {/*global document*/
// identify the path sass.js is located at in case we're loaded by a simple
// <script src="path/to/sass.js"></script>
// this path can be used to identify the location of
// * sass.worker.js from sass.js
// * libsass.js.mem from sass.sync.js
// see https://github.com/medialize/sass.js/pull/32#issuecomment-103142214
// see https://github.com/medialize/sass.js/issues/33
var SASSJS_RELATIVE_PATH = (function() {
'use strict';
// in Node things are rather simple
if (typeof __dirname !== 'undefined') {
return __dirname;
}
// we can only run this test in the browser,
// so make sure we actually have a DOM to work with.
if (typeof document === 'undefined' || !document.getElementsByTagName) {
return null;
}
// http://www.2ality.com/2014/05/current-script.html
var currentScript = document.currentScript || (function() {
var scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1];
})();
var path = currentScript && currentScript.src;
if (!path) {
return null;
}
// [worker] make sure we're not running in some concatenated thing
if (path.slice(-8) === '/sass.js') {
return path.slice(0, -8);
}
// [sync] make sure we're not running in some concatenated thing
if (path.slice(-13) === '/sass.sync.js') {
return path.slice(0, -13);
}
return null;
})() || '.';
/*global Worker, SASSJS_RELATIVE_PATH*/
'use strict';
var noop = function(){};
var slice = [].slice;
// defined upon first Sass.initialize() call
var globalWorkerUrl;
function Sass(workerUrl) {
if (!workerUrl && !globalWorkerUrl) {
/*jshint laxbreak:true */
throw new Error(
'Sass needs to be initialized with the URL of sass.worker.js - '
+ 'either via Sass.setWorkerUrl(url) or by new Sass(url)'
);
/*jshint laxbreak:false */
}
if (!globalWorkerUrl) {
globalWorkerUrl = workerUrl;
}
// bind all functions
// we're doing this because we used to have a single hard-wired instance that allowed
// [].map(Sass.removeFile) and we need to maintain that for now (at least until 1.0.0)
for (var key in this) {
if (typeof this[key] === 'function') {
this[key] = this[key].bind(this);
}
}
this._callbacks = {};
this._worker = new Worker(workerUrl || globalWorkerUrl);
this._worker.addEventListener('message', this._handleWorkerMessage, false);
}
// allow setting the workerUrl before the first Sass instance is initialized,
// where registering the global workerUrl would've happened automatically
Sass.setWorkerUrl = function(workerUrl) {
globalWorkerUrl = workerUrl;
};
Sass.style = {
nested: 0,
expanded: 1,
compact: 2,
compressed: 3
};
Sass.comments = {
'none': 0,
'default': 1
};
Sass.prototype = {
style: Sass.style,
comments: Sass.comments,
destroy: function() {
this._worker && this._worker.terminate();
this._worker = null;
this._callbacks = {};
this._importer = null;
},
_handleWorkerMessage: function(event) {
if (event.data.command) {
this[event.data.command](event.data.args);
}
this._callbacks[event.data.id] && this._callbacks[event.data.id](event.data.result);
delete this._callbacks[event.data.id];
},
_dispatch: function(options, callback) {
if (!this._worker) {
throw new Error('Sass worker has been terminated');
}
options.id = 'cb' + Date.now() + Math.random();
this._callbacks[options.id] = callback;
this._worker.postMessage(options);
},
_importerInit: function(args) {
// importer API done callback pushing results
// back to the worker
var done = function done(result) {
this._worker.postMessage({
command: '_importerFinish',
args: [result]
});
}.bind(this);
try {
this._importer(args[0], done);
} catch(e) {
done({ error: e.message });
throw e;
}
},
importer: function(importerCallback, callback) {
if (typeof importerCallback !== 'function' && importerCallback !== null) {
throw new Error('importer callback must either be a function or null');
}
// callback is executed in the main EventLoop
this._importer = importerCallback;
// tell worker to activate importer callback
this._worker.postMessage({
command: 'importer',
args: [Boolean(importerCallback)]
});
callback && callback();
},
};
var commands = 'writeFile readFile listFiles removeFile clearFiles lazyFiles preloadFiles options compile compileFile';
commands.split(' ').forEach(function(command) {
Sass.prototype[command] = function() {
var callback = slice.call(arguments, -1)[0];
var args = slice.call(arguments, 0, -1);
if (typeof callback !== 'function') {
args.push(callback);
callback = noop;
}
this._dispatch({
command: command,
args: args
}, callback);
};
});
// automatically set the workerUrl in case we're loaded by a simple
// <script src="path/to/sass.js"></script>
// see https://github.com/medialize/sass.js/pull/32#issuecomment-103142214
Sass.setWorkerUrl(SASSJS_RELATIVE_PATH + '/sass.worker.js');
return Sass;
}));

View file

@ -0,0 +1,77 @@
/*! sass.js - v0.10.5 (2cd3782) - built 2017-06-25
providing libsass 3.4.5 (31573210)
via emscripten 1.37.0 ()
*/
var fs = require('fs');
var Sass = require('./sass.sync.js');
var pathModule = require('path');
function fileExists(path) {
var stat = fs.statSync(path);
return stat && stat.isFile();
}
function importFileToSass(originalPath, path, done) {
var requestedPath = pathModule.resolve(originalPath, path);
// figure out the *actual* path of the file
var filesystemPath = Sass.findPathVariation(fileExists, requestedPath);
if (!filesystemPath) {
done({
error: 'File "' + requestedPath + '" not found',
});
return;
}
// write the file to emscripten FS so libsass internal FS handling
// can engage the scss/sass switch, which apparently does not happen
// for content provided through the importer callback directly
var content = fs.readFileSync(filesystemPath, {
encoding: 'utf8'
});
Sass.writeFile(filesystemPath, content, function () {
done({
path: filesystemPath,
});
});
}
function importerCallback(originalPath, request, done) {
//EDITED
// sass.js works in the "/sass/" directory, make that relative to CWD
// var requestedPath = request.resolved.replace(/^\/sass\//, '' );
// importFileToSass(requestedPath, done);
//var requestedPath = request.current.replace(/^\/sass/, '');
var requestedPath;
var indexOfSlash;
if (process.platform === "win32") {
requestedPath = pathModule.resolve(pathModule.dirname(request.previous.replace(/^\/sass\//, '')), request.current);
indexOfSlash = requestedPath.lastIndexOf("\\");
}
else {
requestedPath = request.resolved.replace(/^\/sass/, '');
indexOfSlash = requestedPath.lastIndexOf("/");
}
var fullTempRequestedPath = requestedPath.substring(0, indexOfSlash + 1) + '_' + requestedPath.substring(indexOfSlash + 1);
if (fs.existsSync(fullTempRequestedPath + '.scss')
|| fs.existsSync(fullTempRequestedPath + '.sass')) {
requestedPath = fullTempRequestedPath;
}
else {
console.error("not found", fullTempRequestedPath);
}
importFileToSass(originalPath, requestedPath, done);
}
function compileFile(path, options, callback) {
if (!callback) {
callback = options;
options = {};
}
var originalFilePath = pathModule.dirname(path);
var originalFileName = pathModule.basename(path);
Sass.importer((requestPath, done) => {
importerCallback(originalFilePath, requestPath, done);
});
importFileToSass(originalFilePath, originalFileName, function () {
Sass.compileFile(path, options, callback);
});
}
compileFile.importFileToSass = importFileToSass;
compileFile.Sass = Sass;
module.exports = compileFile;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const path = require("path");
class FileHelper {
static get Instance() {
return new FileHelper();
}
writeToOneFile(targetFileUri, data) {
return new Promise((resolve) => {
fs.writeFile(targetFileUri, data, 'utf8', (err) => {
resolve({
FileUri: targetFileUri,
Exception: err
});
});
});
}
writeToMultipleFile(targetFileUris, data) {
return new Promise((resolve) => {
let promises = [];
for (let i = 0; i < targetFileUris.length; i++) {
promises.push(this.writeToOneFile(targetFileUris[i], data[i]));
}
Promise.all(promises).then((errList) => resolve(errList));
});
}
MakeDirIfNotAvailable(dir) {
if (fs.existsSync(dir))
return;
if (!fs.existsSync(path.dirname(dir))) {
this.MakeDirIfNotAvailable(path.dirname(dir));
}
fs.mkdirSync(dir);
}
}
exports.FileHelper = FileHelper;
//# sourceMappingURL=FileHelper.js.map

View file

@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vscode = require("vscode");
class OutputWindow {
static get MsgChannel() {
if (!OutputWindow._msgChannel) {
OutputWindow._msgChannel = vscode.window.createOutputChannel('Live Sass Compile');
}
return OutputWindow._msgChannel;
}
static Show(msgHeadline, MsgBody, popUpToUI = false, addEndLine = true) {
if (msgHeadline) {
OutputWindow.MsgChannel.appendLine(msgHeadline);
}
if (MsgBody) {
MsgBody.forEach(msg => {
OutputWindow.MsgChannel.appendLine(msg);
});
}
if (popUpToUI) {
OutputWindow.MsgChannel.show(true);
}
if (addEndLine) {
OutputWindow.MsgChannel.appendLine('--------------------');
}
}
static dispose() {
this.MsgChannel.dispose();
}
}
exports.OutputWindow = OutputWindow;
//# sourceMappingURL=OuputWindow.js.map

View file

@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const SassCompiler = require("sasslib/sass.node.js");
class SassHelper {
static get instance() {
return new SassHelper();
}
static targetCssFormat(format) {
return {
style: SassCompiler.Sass.style[format],
};
}
compileOne(SassPath, options) {
return new Promise((resolve, reject) => {
SassCompiler(SassPath, options, (result) => {
if (result.status === 0) {
if (!result.text) {
result.text = '/* No CSS */';
}
}
else {
result.text = `/* \n Error: ${result.formatted} \n */`;
}
resolve(result);
});
});
}
compileMultiple(sassPaths, option) {
return new Promise((resolve, reject) => {
let promises = [];
sassPaths.forEach(sassPath => {
promises.push(this.compileOne(sassPath, option));
});
Promise.all(promises).then(results => resolve(results));
});
}
}
exports.SassHelper = SassHelper;
//# sourceMappingURL=SassCompileHelper.js.map

View file

@ -0,0 +1,69 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vscode = require("vscode");
class StatusBarUi {
static get statusBarItem() {
if (!StatusBarUi._statusBarItem) {
StatusBarUi._statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 200);
this.statusBarItem.show();
}
return StatusBarUi._statusBarItem;
}
static init() {
StatusBarUi.working("Starting...");
setTimeout(function () {
StatusBarUi.notWatching();
}, 1000);
}
static watching() {
StatusBarUi.statusBarItem.text = `$(telescope) Watching...`;
StatusBarUi.statusBarItem.color = 'inherit';
StatusBarUi.statusBarItem.command = 'liveSass.command.donotWatchMySass';
StatusBarUi.statusBarItem.tooltip = 'Stop live compilation of SASS or SCSS to CSS';
}
static notWatching() {
StatusBarUi.statusBarItem.text = `$(eye) Watch Sass`;
StatusBarUi.statusBarItem.color = 'inherit';
StatusBarUi.statusBarItem.command = 'liveSass.command.watchMySass';
StatusBarUi.statusBarItem.tooltip = 'live compilation of SASS or SCSS to CSS';
}
static working(workingMsg = "Working on it...") {
StatusBarUi.statusBarItem.text = `$(pulse) ${workingMsg}`;
StatusBarUi.statusBarItem.tooltip = 'In case if it takes long time, Show output window and report.';
StatusBarUi.statusBarItem.command = null;
}
// Quick status bar messages after compile success or error
static compilationSuccess(isWatching) {
StatusBarUi.statusBarItem.text = `$(check) Success`;
StatusBarUi.statusBarItem.color = '#33ff00';
StatusBarUi.statusBarItem.command = null;
if (isWatching) {
setTimeout(function () {
StatusBarUi.statusBarItem.color = 'inherit';
StatusBarUi.watching();
}, 4500);
}
else {
StatusBarUi.notWatching();
}
}
static compilationError(isWatching) {
StatusBarUi.statusBarItem.text = `$(x) Error`;
StatusBarUi.statusBarItem.color = '#ff0033';
StatusBarUi.statusBarItem.command = null;
if (isWatching) {
setTimeout(function () {
StatusBarUi.statusBarItem.color = 'inherit';
StatusBarUi.watching();
}, 4500);
}
else {
StatusBarUi.notWatching();
}
}
static dispose() {
StatusBarUi.statusBarItem.dispose();
}
}
exports.StatusBarUi = StatusBarUi;
//# sourceMappingURL=StatubarUi.js.map

View file

@ -0,0 +1,33 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const vscode_1 = require("vscode");
const SETUP_STRING = 'liveSassCompiler.setup.version';
function checkNewAnnouncement(memento) {
return __awaiter(this, void 0, void 0, function* () {
const packageJSON = vscode_1.extensions.getExtension('ritwickdey.live-sass').packageJSON;
const announment = packageJSON.announcement;
if (!announment && Object.keys(announment).length === 0)
return;
const stateVersion = (yield memento.get(SETUP_STRING)) || '0.0.0';
const installedVersion = packageJSON.version;
if (stateVersion !== installedVersion && installedVersion === announment.onVersion) {
yield memento.update(SETUP_STRING, installedVersion);
const showMore = 'Show Details';
const choice = yield vscode_1.window.showInformationMessage(announment.message, showMore);
if (choice === showMore) {
const url = announment.url || 'https://github.com/ritwickdey/vscode-live-sass-compiler/';
vscode_1.commands.executeCommand('vscode.open', vscode_1.Uri.parse(url));
}
}
});
}
exports.checkNewAnnouncement = checkNewAnnouncement;
//# sourceMappingURL=index.js.map

View file

@ -0,0 +1,324 @@
'use strict';
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const vscode = require("vscode");
const path = require("path");
const glob = require("glob");
const autoprefixer = require("autoprefixer");
const postcss = require("postcss");
const FileHelper_1 = require("./FileHelper");
const SassCompileHelper_1 = require("./SassCompileHelper");
const OuputWindow_1 = require("./OuputWindow");
const helper_1 = require("./helper");
const StatubarUi_1 = require("./StatubarUi");
class AppModel {
constructor() {
this.isWatching = false;
StatubarUi_1.StatusBarUi.init();
}
static get basePath() {
return vscode.workspace.rootPath || path.basename(vscode.window.activeTextEditor.document.fileName);
}
/**
* Compile All file with watch mode.
* @param WatchingMode WatchingMode = false for without watch mode.
*/
compileAllFiles(WatchingMode = true) {
if (this.isWatching) {
vscode.window.showInformationMessage('already watching...');
return;
}
StatubarUi_1.StatusBarUi.working();
let showOutputWindow = helper_1.Helper.getConfigSettings('showOutputWindow');
this.GenerateAllCssAndMap(showOutputWindow).then(() => {
if (!WatchingMode) {
this.isWatching = true; // tricky to toggle status
}
this.toggleStatusUI();
});
}
openOutputWindow() {
OuputWindow_1.OutputWindow.Show(null, null, true);
}
compileOnSave() {
return __awaiter(this, void 0, void 0, function* () {
if (!this.isWatching)
return;
let currentFile = vscode.window.activeTextEditor.document.fileName;
if (!this.isASassFile(currentFile, true))
return;
// if (!(await this.isSassFileIncluded(fileUri, '**/*.s[a|c]ss'))) return;
OuputWindow_1.OutputWindow.Show('Change Detected...', [path.basename(currentFile)]);
if (!this.isASassFile(currentFile)) {
this.GenerateAllCssAndMap(false).then(() => {
OuputWindow_1.OutputWindow.Show('Watching...', null);
});
}
else {
let formats = helper_1.Helper.getConfigSettings('formats');
let sassPath = currentFile;
formats.forEach(format => {
let options = this.getCssStyle(format.format);
let cssMapPath = this.generateCssAndMapUri(sassPath, format.savePath, format.extensionName);
this.GenerateCssAndMap(sassPath, cssMapPath.css, cssMapPath.map, options)
.then(() => {
OuputWindow_1.OutputWindow.Show('Watching...', null);
});
});
}
});
}
StopWaching() {
if (this.isWatching) {
this.toggleStatusUI();
}
else {
vscode.window.showInformationMessage('not watching...');
}
}
toggleStatusUI() {
this.isWatching = !this.isWatching;
let showOutputWindow = helper_1.Helper.getConfigSettings('showOutputWindow');
if (!this.isWatching) {
StatubarUi_1.StatusBarUi.notWatching();
OuputWindow_1.OutputWindow.Show('Not Watching...', null, showOutputWindow);
}
else {
StatubarUi_1.StatusBarUi.watching();
OuputWindow_1.OutputWindow.Show('Watching...', null, showOutputWindow);
}
}
isSassFileIncluded(sassPath, queryPatten = '**/[^_]*.s[a|c]ss') {
return __awaiter(this, void 0, void 0, function* () {
let files = yield this.getSassFiles(queryPatten);
return files.find(e => e === sassPath) ? true : false;
});
}
isASassFile(pathUrl, partialSass = false) {
const filename = path.basename(pathUrl);
return (partialSass || !filename.startsWith('_')) && (filename.endsWith('sass') || filename.endsWith('scss'));
}
getSassFiles(queryPatten = '**/[^_]*.s[a|c]ss') {
let excludedList = helper_1.Helper.getConfigSettings('excludeList');
let includeItems = helper_1.Helper.getConfigSettings('includeItems');
let options = {
ignore: excludedList,
mark: true,
cwd: AppModel.basePath
};
if (includeItems && includeItems.length) {
if (includeItems.length === 1) {
queryPatten = includeItems[0];
}
else {
queryPatten = `{${includeItems.join(',')}}`;
}
}
return new Promise(resolve => {
glob(queryPatten, options, (err, files) => {
if (err) {
OuputWindow_1.OutputWindow.Show('Error To Seach Files', err, true);
resolve([]);
return;
}
const filePaths = files
.filter(file => this.isASassFile(file))
.map(file => path.join(AppModel.basePath, file));
return resolve(filePaths || []);
});
});
}
/**
* [Deprecated]
* Find ALL Sass & Scss from workspace & It also exclude Sass/Scss from exclude list settings
* @param callback - callback(filepaths) with be called with Uri(s) of Sass/Scss(s) (string[]).
*/
findAllSaasFilesAsync(callback) {
this.getSassFiles().then(files => callback(files));
}
/**
* To Generate one One Css & Map file from Sass/Scss
* @param SassPath Sass/Scss file URI (string)
* @param targetCssUri Target CSS file URI (string)
* @param mapFileUri Target MAP file URI (string)
* @param options - Object - It includes target CSS style and some more.
*/
GenerateCssAndMap(SassPath, targetCssUri, mapFileUri, options) {
let generateMap = helper_1.Helper.getConfigSettings('generateMap');
let autoprefixerTarget = helper_1.Helper.getConfigSettings('autoprefix');
let showOutputWindow = helper_1.Helper.getConfigSettings('showOutputWindow');
return new Promise(resolve => {
SassCompileHelper_1.SassHelper.instance.compileOne(SassPath, options)
.then((result) => __awaiter(this, void 0, void 0, function* () {
if (result.status !== 0) {
OuputWindow_1.OutputWindow.Show('Compilation Error', [result.formatted], showOutputWindow);
StatubarUi_1.StatusBarUi.compilationError(this.isWatching);
if (!showOutputWindow) {
vscode.window.setStatusBarMessage(result.formatted.split('\n')[0], 4500);
}
resolve(true);
}
else {
let promises = [];
let mapFileTag = `/*# sourceMappingURL=${path.basename(targetCssUri)}.map */`;
if (autoprefixerTarget) {
result.text = yield this.autoprefix(result.text, autoprefixerTarget);
}
if (!generateMap) {
promises.push(FileHelper_1.FileHelper.Instance.writeToOneFile(targetCssUri, `${result.text}`));
}
else {
promises.push(FileHelper_1.FileHelper.Instance.writeToOneFile(targetCssUri, `${result.text}${mapFileTag}`));
let map = this.GenerateMapObject(result.map, targetCssUri);
promises.push(FileHelper_1.FileHelper.Instance.writeToOneFile(mapFileUri, JSON.stringify(map, null, 4)));
}
Promise.all(promises).then(fileResolvers => {
OuputWindow_1.OutputWindow.Show('Generated :', null, false, false);
StatubarUi_1.StatusBarUi.compilationSuccess(this.isWatching);
fileResolvers.forEach(fileResolver => {
if (fileResolver.Exception) {
OuputWindow_1.OutputWindow.Show('Error:', [
fileResolver.Exception.errno.toString(),
fileResolver.Exception.path,
fileResolver.Exception.message
], true);
console.error('error :', fileResolver);
}
else {
OuputWindow_1.OutputWindow.Show(null, [fileResolver.FileUri], false, false);
}
});
OuputWindow_1.OutputWindow.Show(null, null, false, true);
resolve(true);
});
}
}));
});
}
/**
* To compile all Sass/scss files
* @param popUpOutputWindow To control output window.
*/
GenerateAllCssAndMap(popUpOutputWindow) {
let formats = helper_1.Helper.getConfigSettings('formats');
return new Promise((resolve) => {
this.findAllSaasFilesAsync((sassPaths) => {
OuputWindow_1.OutputWindow.Show('Compiling Sass/Scss Files: ', sassPaths, popUpOutputWindow);
let promises = [];
sassPaths.forEach((sassPath) => {
formats.forEach(format => {
let options = this.getCssStyle(format.format);
let cssMapUri = this.generateCssAndMapUri(sassPath, format.savePath, format.extensionName);
promises.push(this.GenerateCssAndMap(sassPath, cssMapUri.css, cssMapUri.map, options));
});
});
Promise.all(promises).then((e) => resolve(e));
});
});
}
/**
* Generate Map Object
* @param mapObject Generated Map object form Sass.js library
* @param targetCssUri Css URI
*/
GenerateMapObject(mapObject, targetCssUri) {
let map = {
'version': 3,
'mappings': '',
'sources': [],
'names': [],
'file': ''
};
map.mappings = mapObject.mappings;
map.file = path.basename(targetCssUri);
mapObject.sources.forEach((source) => {
// path starts with ../saas/<path> or ../< path>
if (source.startsWith('../sass/')) {
source = source.substring('../sass/'.length);
}
else if (source.startsWith('../')) {
source = source.substring('../'.length);
}
if (process.platform !== 'win32') {
source = '/' + source; // for linux, maybe for MAC too
}
let testpath = path.relative(path.dirname(targetCssUri), source);
testpath = testpath.replace(/\\/gi, '/');
map.sources.push(testpath);
});
return map;
// this.writeToFileAsync(mapFileUri, JSON.stringify(map, null, 4));
}
generateCssAndMapUri(filePath, savePath, _extensionName) {
let extensionName = _extensionName || '.css'; // Helper.getConfigSettings<string>('extensionName');
// If SavePath is NULL, CSS uri will be same location of SASS.
if (savePath) {
try {
let workspaceRoot = vscode.workspace.rootPath;
let generatedUri = null;
if (savePath.startsWith('~'))
generatedUri = path.join(path.dirname(filePath), savePath.substring(1));
else
generatedUri = path.join(workspaceRoot, savePath);
FileHelper_1.FileHelper.Instance.MakeDirIfNotAvailable(generatedUri);
filePath = path.join(generatedUri, path.basename(filePath));
}
catch (err) {
console.log(err);
OuputWindow_1.OutputWindow.Show('Error:', [
err.errno.toString(),
err.path,
err.message
], true);
throw Error('Something Went Wrong.');
}
}
let cssUri = filePath.substring(0, filePath.lastIndexOf('.')) + extensionName;
return {
css: cssUri,
map: cssUri + '.map'
};
}
getCssStyle(format) {
let outputStyleFormat = format || 'expanded'; // Helper.getConfigSettings<string>('format');
return SassCompileHelper_1.SassHelper.targetCssFormat(outputStyleFormat);
}
/**
* Autoprefixes CSS properties
*
* @param css String representation of CSS to transform
* @param target What browsers to be targeted, as supported by [Browserslist](https://github.com/ai/browserslist)
*/
autoprefix(css, browsers) {
return __awaiter(this, void 0, void 0, function* () {
let showOutputWindow = helper_1.Helper.getConfigSettings('showOutputWindow');
const prefixer = postcss([
autoprefixer({
browsers,
grid: true
})
]);
return yield prefixer
.process(css)
.then(res => {
res.warnings().forEach(warn => {
OuputWindow_1.OutputWindow.Show('Autoprefix Error', [warn.text], showOutputWindow);
});
return res.css;
});
});
}
dispose() {
StatubarUi_1.StatusBarUi.dispose();
OuputWindow_1.OutputWindow.dispose();
}
}
exports.AppModel = AppModel;
//# sourceMappingURL=appModel.js.map

View file

@ -0,0 +1,31 @@
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const vscode = require("vscode");
const appModel_1 = require("./appModel");
const index_1 = require("./announcement/index");
function activate(context) {
console.log('"live-sass-compiler" is now actived! Go and Debug :P ');
let appModel = new appModel_1.AppModel();
index_1.checkNewAnnouncement(context.globalState);
let disposablecompileAll = vscode.commands.registerCommand('liveSass.command.watchMySass', () => {
appModel.compileAllFiles();
});
let disposableStopWaching = vscode.commands.registerCommand('liveSass.command.donotWatchMySass', () => {
appModel.StopWaching();
});
let disposableOneTimeCompileSass = vscode.commands.registerCommand('liveSass.command.oneTimeCompileSass', () => {
appModel.compileAllFiles(false);
});
let disposableOpenOutputWindow = vscode.commands.registerCommand('liveSass.command.openOutputWindow', () => {
appModel.openOutputWindow();
});
let disposableOnDivSave = vscode.workspace.onDidSaveTextDocument(() => {
appModel.compileOnSave();
});
context.subscriptions.push(disposablecompileAll, disposableStopWaching, disposableOnDivSave, disposableOneTimeCompileSass, disposableOpenOutputWindow, appModel);
}
exports.activate = activate;
function deactivate() {
}
exports.deactivate = deactivate;
//# sourceMappingURL=extension.js.map

View file

@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vscode = require("vscode");
class Helper {
static get configSettings() {
return vscode.workspace.getConfiguration('liveSassCompile.settings');
}
static getConfigSettings(val) {
return this.configSettings.get(val);
}
}
exports.Helper = Helper;
//# sourceMappingURL=helper.js.map

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,199 @@
{
"name": "live-sass",
"displayName": "Live Sass Compiler",
"description": "Compile Sass or Scss to CSS at realtime with live browser reload.",
"version": "3.0.0",
"publisher": "ritwickdey",
"author": {
"name": "Ritwick Dey",
"email": "ritwickdey@outlook.com",
"url": "http://twitter.com/Dey_Ritwick"
},
"engines": {
"vscode": "^1.0.0"
},
"keywords": [
"SASS",
"SCSS",
"Compiler",
"Transpiler",
"SASS Compiler"
],
"categories": [
"Other",
"Extension Packs"
],
"preview": true,
"galleryBanner": {
"color": "#41205f",
"theme": "dark"
},
"activationEvents": [
"workspaceContains:**/*.s[ac]ss",
"onLanguage:scss",
"onLanguage:sass"
],
"main": "./out/src/extension",
"contributes": {
"commands": [
{
"command": "liveSass.command.watchMySass",
"title": "Watch Sass",
"category": "Live Sass"
},
{
"command": "liveSass.command.donotWatchMySass",
"title": "Stop Watching",
"category": "Live Sass"
},
{
"command": "liveSass.command.oneTimeCompileSass",
"title": "Compile Sass - Without Watch Mode",
"category": "Live Sass"
},
{
"command": "liveSass.command.openOutputWindow",
"title": "Open Live Sass Output Window",
"category": "Live Sass"
}
],
"configuration": {
"title": "Live Sass Compile Config",
"properties": {
"liveSassCompile.settings.formats": {
"type": "array",
"default": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": null
}
],
"minItems": 1,
"items": {
"type": "object",
"properties": {
"format": {
"description": "Style of exported css",
"type": "string",
"enum": [
"expanded",
"compact",
"compressed",
"nested"
],
"default": "expanded"
},
"extensionName": {
"description": "Extension Name of exported css",
"type": "string",
"enum": [
".css",
".min.css"
],
"default": ".css"
},
"savePath": {
"description": "Set the save location of exported CSS.\n Set the relative path from Workspace Root.\n '/' stands for your workspace root. \n Example: /subfolder1/subfolder2. (NOTE: if folder does not exist, folder will be created as well).",
"type": [
"string",
"null"
],
"pattern": "^[\\~|/|\\\\]",
"default": null
}
},
"additionalProperties": false,
"required": [
"format",
"extensionName"
]
},
"description": "Set your exported CSS Styles, Formats & save location."
},
"liveSassCompile.settings.excludeList": {
"type": "array",
"default": [
"**/node_modules/**",
".vscode/**"
],
"description": "All Sass/Scss files inside the folders will be excluded. \n\nExamples: \n'**/node_modules/**',\n'.vscode/**', \n'.history/**' \n\nGlob Patterns are accepted."
},
"liveSassCompile.settings.includeItems": {
"type": [
"array",
"null"
],
"default": null,
"description": "This setting is useful when you deals with only few of sass files. Only mentioned Sass files will be included. \nNOTE: No need to include partial sass files."
},
"liveSassCompile.settings.generateMap": {
"type": [
"boolean"
],
"default": true,
"description": "Set it as `false` if you don't want `.map` file for compiled CSS. \nDefault is `true`"
},
"liveSassCompile.settings.autoprefix": {
"type": [
"array",
"null"
],
"default": [
"> 1%",
"last 2 versions"
],
"description": "Automatically add vendor prefixes to unsupported CSS properties (e. g. transform -> -ms-transform). Specify what browsers to target with an array of strings (uses [Browserslist](https://github.com/ai/browserslist)). Pass `null` to turn off. \nDefault is `null`"
},
"liveSassCompile.settings.showOutputWindow": {
"type": "boolean",
"default": true,
"description": "Set this to `false` if you do not want the output window to show.\nNote: You can use the command palette to open the Live Sass output window.\nDefault is `true`"
}
}
}
},
"license": "MIT",
"icon": "images/icon2.png",
"bugs": {
"url": "https://github.com/ritwickdey/vscode-live-sass-compiler/issues",
"email": "ritwickdey@outlook.com"
},
"repository": {
"type": "git",
"url": "https://github.com/ritwickdey/vscode-live-sass-compiler.git"
},
"homepage": "https://ritwickdey.github.io/vscode-live-sass-compiler/",
"extensionDependencies": [
"ritwickdey.LiveServer"
],
"scripts": {
"vscode:prepublish": "tsc -p ./",
"compile": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "node ./node_modules/vscode/bin/test"
},
"dependencies": {
"autoprefixer": "^7.2.6",
"glob": "^7.1.2",
"postcss": "^6.0.23",
"sasslib": "file:lib\\sasslib"
},
"devDependencies": {
"typescript": "^2.4.1",
"vscode": "^1.0.0",
"mocha": "^2.3.3",
"@types/node": "^6.0.40",
"@types/mocha": "^2.2.32"
},
"announcement": {
"onVersion": "3.0.0",
"message": "SassCompiler@3.0.0: Fixes 8 digit Hex, grid names and many more."
},
"__metadata": {
"id": "ad94b437-b5a7-4249-bf5f-df472ae0d084",
"publisherId": "17fd9a78-e430-4a78-add2-ade4a8830352",
"publisherDisplayName": "Ritwick Dey",
"installedTimestamp": 1632235283445
}
}

View file

@ -0,0 +1,131 @@
{
"rulesDirectory": [
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": false,
"eofline": true,
"forin": true,
"import-blacklist": [
true,
"rxjs"
],
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
"static-before-instance",
"variables-before-functions"
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-misused-new": true,
"no-non-null-assertion": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"prefer-const": false,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"typeof-compare": true,
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"directive-selector": [
true,
"attribute",
"camelCase"
],
"component-selector": [
true,
"element",
"kebab-case"
],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true,
"no-access-missing-member": true,
"templates-use-public": true,
"invoke-injectable": true
}
}