Skip to content

Commit

Permalink
v5.1.0 - PR #112 from glenn2223
Browse files Browse the repository at this point in the history
# 5.1.0 - 2021-08-06

### Fixed
- The UI description for `showOutputWindowOn` was stating the default is `Warning` when, in fact, it is `Information`
- File searching is no longer case sensitive - it is still accent sensitive
- Stopped outputting `Watching...` twice when compilation happens on watching
- A single file - that is a window without a workspace - would error and not compile
- `Change detected - {DateTime}` is now output when `showOutputOn` is set to `"Information"`. This better reflects the functionality of the original extension

### Added
- New settings to support all other SASS output formatting options - Closes [#82](#82)  
The new settings are:
  - `liveSassCompile.settings.formats.linefeed` - control the line terminator used
  - `liveSassCompile.settings.formats.indentType` - control whether indents are spaces or tabs
  - `liveSassCompile.settings.formats.indentWidth` - control the width of the indentation
- New commands to change the `showOutputOn` from the command pallete - Closes [#63](#63)  
Having these commands in the pallete also means that key combos can be set for each  
The new commands are:
  - `liveSass.command.showOutputOn.trace`
  - `liveSass.command.showOutputOn.debug`
  - `liveSass.command.showOutputOn.information`
  - `liveSass.command.showOutputOn.warning`
  - `liveSass.command.showOutputOn.error`
  - `liveSass.command.showOutputOn.none`

### Changes
- Added more and adjusted some logging messages *(primarily to `Trace` levels)*
- A lot of documentation tweaks
- Some linting tweaks *(nothing user facing)*

### Updated
- `sass` from `1.32.12` to `1.37.5`
  - **Potentially breaking bug fix:** Properly throw an error for Unicode ranges that have too many `?`s after hexadecimal digits, such as `U+12345??`
  - **Potentially breaking bug fix:** Fixed a bug where certain local variable declarations nested within multiple `@if` statements would incorrectly override a global variable. It's unlikely that any real stylesheets were relying on this bug, but if so they can simply add `!global` to the variable declaration to preserve the old behaviour
  - Fix an edge case where `@extend` wouldn't affect a selector within a pseudo-selector such as `:is()` that itself extended other selectors
  - Fix a couple bugs that could prevent some members from being found in certain files that use a mix of imports and the module system.
  - Fix incorrect recommendation for migrating division expressions that reference namespace variables.
  - **Potentially breaking bug fix:** Null values in `@use` and `@forward` configurations no longer override the `!default` variable, matching the behaviour of the equivalent code using `@import`.
  - Use the proper parameter names in error messages about `string.slice`
  - Deprecate the use of `/` for division. The new `math.div()` function should be used instead. See [this page](https://sass-lang.com/documentation/breaking-changes/slash-div) for details.
  - Add a `list.slash()` function that returns a slash-separated list.
  - **Potentially breaking bug fix:** The heuristics around when potentially slash-separated numbers are converted to slash-free numbers—for example, when `1/2` will be printed as `0.5` rather than `1/2`—have been slightly expanded. Previously, a number would be made slash-free if it was passed as an argument to a user-defined function, but not to a built-in function. Now it will be made slash-free in both cases. This is a behavioural change, but it's unlikely to affect any real-world stylesheets.
  - `:is()` now behaves identically to `:matches()`.
  - Fix a bug where non-integer numbers that were very close to integer values would be incorrectly formatted in CSS.
  - Fix a bug where very small number and very large negative numbers would be incorrectly formatted in CSS.
  - Fix the URL for the `@-moz-document` deprecation message.
  - Fix a bug with `@for` loops nested inside property declarations.`
  - Fix a couple bugs that could prevent some members from being found in certain files that use a mix of imports and the module system.
  - Fix incorrect recommendation for migrating division expressions that reference namespace variables
  - Fix a bug where the quiet dependency flag didn't silence warnings in some stylesheets loaded using `@import`
  - Other changes  *(nothing user facing)*
- `autoprefixer` from `10.2.5` to `10.3.1`
  - Added `::file-selector-button` support
  - Fixed adding wrong prefixes to `content`
  - Fixed “no prefixes needed” warning 
- `postcss` from `8.2.14` to `8.3.6`
  - Fixed column in `missed semicolon` error 
  - Source map performance improvements
  - Fixed broken AST detection
  - Other changes  *(nothing user facing)*
- `fdir` from `5.0.0` to `5.1.0`
  - Performance & memory usage has also been greatly improved due to the many internal refactoring
  - Other changes  *(nothing user facing)*
- `picomatch` from `2.2.3` to `2.3.0`
  - Fixes bug where file names with two dots were not being matched consistently with negation `extglobs` containing a star
- Various dev dependency updates *(nothing user facing)*
  • Loading branch information
glenn2223 authored Aug 6, 2021
2 parents 948802b + 2613ce4 commit 0cd110c
Show file tree
Hide file tree
Showing 13 changed files with 1,359 additions and 1,068 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
rules: {
// enable additional rules
semi: ["error", "always"],
curly: "error",

// override default options for rules from base configurations
"no-cond-assign": ["error", "always"],
Expand Down
37 changes: 14 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- id: Info
uses: actions/[email protected]
with:
script: |
console.log('Github Info', { ref: github.ref, event: github.event })

- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install the package dependencies
run: npm install

- name: Install vsce
run: npm i vsce -g

# TESTS ARE FAILING - DOING MORE RESEARCH
# - run: xvfb-run -a npm test
Expand All @@ -49,36 +40,36 @@ jobs:
# if: runner.os != 'Linux'
# name: Test extension

# Removed && startsWith( github.ref, 'refs/tags/')
- id: get-name
if: success() && startsWith( github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
uses: actions/[email protected]
with:
script: |
const ver = github.event.release.tag_name.substr(1)
core.setOutput('name', `live-sass-${ver}.vsix`)
if: success() && matrix.os == 'ubuntu-latest'
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/v}

- name: Install vsce
run: npm i vsce -g

- name: Package
run: vsce package --yarn

- name: Publish - vsce
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
run: vsce publish ${{ steps.get-name.outputs.name }} --yarn
if: success() && matrix.os == 'ubuntu-latest' && !github.event.release.prerelease
run: vsce publish live-sass-${{ steps.get-name.outputs.tag }}.vsix --yarn
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

- name: Install ovsx
run: npm i ovsx -g

- name: Publish - ovsx
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
run: ovsx publish ${{ steps.get-name.outputs.name }}
if: success() && matrix.os == 'ubuntu-latest'
run: ovsx publish live-sass-${{ steps.get-name.outputs.tag }}.vsix
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}

- name: Upload asset
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-latest'
uses: softprops/[email protected]
with:
files: ${{ steps.get-name.outputs.name }}
files: live-sass-${{ steps.get-name.outputs.tag }}.vsix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78 changes: 73 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,73 @@ Types of changes
# Changelog
All notable changes to this project will be documented in this file.

## [5.1.0] - 2021-08-06

### Fixed
- The UI description for `showOutputWindowOn` was stating the default is `Warning` when, in fact, it is `Information`
- File searching is no longer case sensitive - it is still accent sensitive
- Stopped outputting `Watching...` twice when compilation happens on watching
- A single file - that is a window without a workspace - would error and not compile
- `Change detected - {DateTime}` is now output when `showOutputOn` is set to `"Information"`. This better reflects the functionality of the original extension

### Added
- New settings to support all other SASS output formatting options - Closes [#82](https://github.com/glenn2223/vscode-live-sass-compiler/issues/82)
The new settings are:
- `liveSassCompile.settings.formats.linefeed` - control the line terminator used
- `liveSassCompile.settings.formats.indentType` - control whether indents are spaces or tabs
- `liveSassCompile.settings.formats.indentWidth` - control the width of the indentation
- New commands to change the `showOutputOn` from the command pallete - Closes [#63](https://github.com/glenn2223/vscode-live-sass-compiler/issues/63)
Having these commands in the pallete also means that key combos can be set for each
The new commands are:
- `liveSass.command.showOutputOn.trace`
- `liveSass.command.showOutputOn.debug`
- `liveSass.command.showOutputOn.information`
- `liveSass.command.showOutputOn.warning`
- `liveSass.command.showOutputOn.error`
- `liveSass.command.showOutputOn.none`

### Changes
- Added more and adjusted some logging messages *(primarily to `Trace` levels)*
- A lot of documentation tweaks
- Some linting tweaks *(nothing user facing)*

### Updated
- `sass` from `1.32.12` to `1.37.5`
- **Potentially breaking bug fix:** Properly throw an error for Unicode ranges that have too many `?`s after hexadecimal digits, such as `U+12345??`
- **Potentially breaking bug fix:** Fixed a bug where certain local variable declarations nested within multiple `@if` statements would incorrectly override a global variable. It's unlikely that any real stylesheets were relying on this bug, but if so they can simply add `!global` to the variable declaration to preserve the old behaviour
- Fix an edge case where `@extend` wouldn't affect a selector within a pseudo-selector such as `:is()` that itself extended other selectors
- Fix a couple bugs that could prevent some members from being found in certain files that use a mix of imports and the module system.
- Fix incorrect recommendation for migrating division expressions that reference namespace variables.
- **Potentially breaking bug fix:** Null values in `@use` and `@forward` configurations no longer override the `!default` variable, matching the behaviour of the equivalent code using `@import`.
- Use the proper parameter names in error messages about `string.slice`
- Deprecate the use of `/` for division. The new `math.div()` function should be used instead. See [this page](https://sass-lang.com/documentation/breaking-changes/slash-div) for details.
- Add a `list.slash()` function that returns a slash-separated list.
- **Potentially breaking bug fix:** The heuristics around when potentially slash-separated numbers are converted to slash-free numbers—for example, when `1/2` will be printed as `0.5` rather than `1/2`—have been slightly expanded. Previously, a number would be made slash-free if it was passed as an argument to a user-defined function, but not to a built-in function. Now it will be made slash-free in both cases. This is a behavioural change, but it's unlikely to affect any real-world stylesheets.
- `:is()` now behaves identically to `:matches()`.
- Fix a bug where non-integer numbers that were very close to integer values would be incorrectly formatted in CSS.
- Fix a bug where very small number and very large negative numbers would be incorrectly formatted in CSS.
- Fix the URL for the `@-moz-document` deprecation message.
- Fix a bug with `@for` loops nested inside property declarations.`
- Fix a couple bugs that could prevent some members from being found in certain files that use a mix of imports and the module system.
- Fix incorrect recommendation for migrating division expressions that reference namespace variables
- Fix a bug where the quiet dependency flag didn't silence warnings in some stylesheets loaded using `@import`
- Other changes *(nothing user facing)*
- `autoprefixer` from `10.2.5` to `10.3.1`
- Added `::file-selector-button` support
- Fixed adding wrong prefixes to `content`
- Fixed “no prefixes needed” warning
- `postcss` from `8.2.14` to `8.3.6`
- Fixed column in `missed semicolon` error
- Source map performance improvements
- Fixed broken AST detection
- Other changes *(nothing user facing)*
- `fdir` from `5.0.0` to `5.1.0`
- Performance & memory usage has also been greatly improved due to the many internal refactoring
- Other changes *(nothing user facing)*
- `picomatch` from `2.2.3` to `2.3.0`
- Fixes bug where file names with two dots were not being matched consistently with negation `extglobs` containing a star
- Various dev dependency updates *(nothing user facing)*

## [5.0.4] - 2021-06-22

### Security
Expand All @@ -30,7 +97,7 @@ All notable changes to this project will be documented in this file.

## [5.0.3] - 2021-05-05

### Changed
### Changes
- The default for `liveSassCompile.settings.showOutputWindowOn` is now `Information`
- To prevent future issues like [#70](https://github.com/glenn2223/vscode-live-sass-compiler/issues/70) & [#76](https://github.com/glenn2223/vscode-live-sass-compiler/issues/76). *Where issues are created because, by default, compiling didn't output the same details that the original extension did*
- Updated the documentation to match the above change - and also sorted a couple of typos
Expand Down Expand Up @@ -171,9 +238,9 @@ All notable changes to this project will be documented in this file.
## [4.3.3] - 2021-01-18

### Fixed
- Fixed [#15](https://github.com/glenn2223/vscode-live-sass-compiler/issues/15): No longer outputs absolute path in map file and map link in css output
- Fixed [#15](https://github.com/glenn2223/vscode-live-sass-compiler/issues/15): No longer outputs absolute path in map file and map link in CSS output
- Reinstated feature of partial files being checked for exclusion
- Autoprefixer map lines now relate to actual SASS files rather than the css file generated
- Autoprefixer map lines now relate to actual SASS files rather than the CSS file generated
- When there's an include list, a non partial file that's not "included" would still be processed
- Now gets the correct list of included partial files

Expand Down Expand Up @@ -245,7 +312,7 @@ All notable changes to this project will be documented in this file.
- Now using webpack to minify and speed up the extension

### Other
- Doc changes/general tidy up, updated .vscodeignore, update license, update .gitignore
- Doc changes/general tidy up, updated `.vscodeignore`, update license, update `.gitignore`


## [4.0.0] - 2020-12-20
Expand Down Expand Up @@ -304,7 +371,8 @@ All notable changes to this project will be documented in this file.
| 0.0.1 | 11.07.17 | Initial Preview Release with following key features. <br> – Live SASS & SCSS Compile. <br> – Customizable file location of exported CSS. <br> – Customizable exported CSS Style (`expanded`, `compact`, `compressed`, `nested`.)<br> – Quick Status bar control.<br> – Live Reload to browser (`Live Server` extension dependency). |


[Unreleased]: https://github.com/glenn2223/vscode-live-sass-compiler/compare/v5.0.3...HEAD
[Unreleased]: https://github.com/glenn2223/vscode-live-sass-compiler/compare/v5.1.0...HEAD
[5.1.0]: https://github.com/glenn2223/vscode-live-sass-compiler/compare/v5.0.4...v5.1.0
[5.0.4]: https://github.com/glenn2223/vscode-live-sass-compiler/compare/v5.0.3...v5.0.4
[5.0.3]: https://github.com/glenn2223/vscode-live-sass-compiler/compare/v5.0.2...v5.0.3
[5.0.2]: https://github.com/glenn2223/vscode-live-sass-compiler/compare/v5.0.1...v5.0.2
Expand Down
101 changes: 67 additions & 34 deletions docs/faqs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@

# FAQs

### Q. How do I change the settings?
## Q. I'm migrating from Ritwick Dey's extension, what do I need to know?

<details>
<summary>Answer</summary>

Well, **lots of things**.

Firstly, welcome! I'm glad you're here!

Here's some of the most important changes:
- We now require VS Code version 1.52
- We are no longer dependant on `ritwickdey.LiveServer`. You can manually add this package to VS Code, if you need it
- Some settings have been changed
- `formats[].format` only accepts `compressed` or `expanded`
- `autoprefix`:
- The default is `defaults`
- `null` is no longer accepted, use `false` instead
- When `true` we will find a `.browserslistrc` file or `browserslist` in your `package.json`. No more duplicating settings!
- `showOutputWindow` is now `showOutputWindowOn` and uses log values (`Debug`, `Error`, etc.). It's default log level is `Information` - at this level it will output the same information that the original extension does
- Some settings are new!
- `savePathSegmentKeys` and `savePathReplaceSegmentsWith`: when used in combination you can choose to replace folder segments in the save path
- `watchOnLaunch`: state whether you want to watch files upon launch
- `compileOnWatch`: state if files should be compiled upon watching
- `forceBaseDirectory`: state the base directory of all you SASS files. Aids in reducing wasted resources while searching for files

Here are some things you probably won't care about as much
- The extension has had a massive overhaul. Performance optimisation, and new features!
- We abandoned `glob` (the package, not the patterns) and we now use `fdir` which is blazingly fast
- New commands!
- `liveSass.command.compileCurrentSass`: perform a one-time compilation of the current SASS file
- `liveSass.command.createIssue`: opens a link to create a new issue in GutHub. If an unexpected error occurred then error information is readily available to paste into the new issue
- `liveSass.command.debugInclusion`: check if the current SASS file will be included, based on your settings
- `liveSass.command.debugFileList`: get a full list of files that are included and excluded
- We support multi-root/multi-folder workspaces
- Map files now link back to the correct line after `autoprefixer` has been applied
- Clicking the status bar icon while in the `Success` or `Error` state will show the output window

</details>

---

## Q. How do I change the settings?

<details>
<summary>Answer</summary>
Expand Down Expand Up @@ -39,7 +79,7 @@ Open the `settings.json` file and type following key-value pairs. *By the way, y

---

### Q. Why isn't it starting?
## Q. Why isn't it starting?

<details>
<summary>Answer</summary>
Expand All @@ -52,7 +92,7 @@ Just create a SASS file, or open one, and the extension will activate

---

### Q. Why isn't it compiling my files?
## Q. Why isn't it compiling my files?

<details>
<summary>Answers</summary>
Expand All @@ -75,41 +115,34 @@ Still no luck?

---

### Q. I'm migrating from Ritwick Dey's extension, what do I need to know?

## Q. So... about multi-root workspaces?

<details>
<summary>Answer</summary>
<summary>Answers</summary>

Well, **lots of things**.
### What is it?

Firstly, welcome! I'm glad you're here!
A multi-root workspaces is a project that gives you access to a folder at `C:/a/b/c` and `C:/x/y/z` - all from one VS Code window!

Here's some of the most important changes:
- We now require VS Code version 1.52
- We are no longer dependant on `ritwickdey.LiveServer`. You can manually add this package to VS Code, if you need it
- Some settings have been changed
- `formats[].format` only accepts `compressed` or `expanded`
- `autoprefix`:
- The default is `defaults`
- `null` is no longer accepted, use `false` instead
- When `true` we will find a `.browserslistrc` file or `browserslist` in your `package.json`. No more duplicating settings!
- `showOutputWindow` is now `showOutputWindowOn` and uses log values (`Debug`, `Error`, etc.). It's default log level is `Information` - at this level it will output the same information that the original extension does
- Some settings are new!
- `savePathSegmentKeys` and `savePathReplaceSegmentsWith`: when used in combination you can choose to replace folder segments in the save path
- `watchOnLaunch`: state whether you want to watch files upon launch
- `compileOnWatch`: state if files should be compiled upon watching
- `forceBaseDirectory`: state the base directory of all you SASS files. Aids in reducing wasted resources while searching for files
By doing this, and when an extension is configured for it, you can have independent settings for each project. But don't worry, you don't need to duplicate settings! Default settings can be placed in the `.code-workspace` - these are then ignored if the same settings exists in a workspace folder's `settings.json`.

Here are some things you probably won't care about as much
- The extension has had a massive overhaul. Performance optimisation, and new features!
- We abandoned `glob` (the package, not the patterns) and we now use `fdir` which is blazingly fast
- New commands!
- `liveSass.command.compileCurrentSass`: perform a one-time compilation of the current SASS file
- `liveSass.command.createIssue`: opens a link to create a new issue in GutHub. If an unexpected error occurred then error information is readily available to paste into the new issue
- `liveSass.command.debugInclusion`: check if the current SASS file will be included, based on your settings
- `liveSass.command.debugFileList`: get a full list of files that are included and excluded
- We support multi-root/multi-folder workspaces
- Map files now link back to the correct line after `autoprefixer` has been applied
- Clicking the status bar icon while in the `Success` or `Error` state will show the output window
*Note: Each workspace folder must have a `.vscode` folder with a `settings.json` file for the settings to overwrite the workspace defaults.*

### I like it! how do I set one up?

When you open any folder in VS Code it is essentially a "single-root" workspace.

First, right click (left click on mac) in some open space on the `Explorer` tab. You will see an option to `Add folder to workspace`. After you click this, you can choose to add a folder to your project that's in any location on your machine. By doing this VS Code will create a `.code-workspace` file. This creates an actual workspace - well, in this case, a "multi-root" workspace.

### Okay, so what settings can I use?

The following settings can all be made available to each workspaces `settings.json` file.
- `liveSassCompile.settings.formats`
- `liveSassCompile.settings.excludeList`
- `liveSassCompile.settings.includeItems`
- `liveSassCompile.settings.generateMap`
- `liveSassCompile.settings.autoprefix`
- `liveSassCompile.settings.forceBaseDirectory`

</details>
Loading

0 comments on commit 0cd110c

Please sign in to comment.