sveetch/boussole

Mind about old sass syntax support

Closed this issue · 4 comments

After following the docs for a basic installation, I can't seem to get Boussole to recognize .sass files. Am I missing something?

Boussole: 1.2.3 (libsass-python 0.14.5) (libsass 3.5.4)
Python: 3.6.6

$ ls -r *
sass:
test.sass

compiled:
$ boussole startproject 
Project base directory [.]: 
Sources directory [scss]: sass
Target directory [css]: compiled
Settings format name [json]: 
17:08:42 - Project directory structure and configuration file have been created.
17:08:42 - Now you should start to create some Sass sources into '/Users/tehfink/…/my_project/static/css/sass', then compile them using:
17:08:42 -     boussole compile --config=/Users/tehfink/…/my_project/static/css/settings.json
$ boussole -v 5 compile
17:10:11 - Building project
17:10:11 - Settings file: settings.json (json)
17:10:11 - Project sources directory: /Users/tehfink/…/my_project/static/css/sass
17:10:11 - Project destination directory: /Users/tehfink/…/my_project/static/css/compiled
17:10:11 - Exclude patterns: []

It seems the .sass file is ignored? Replacing it with a .scss file works:

$ boussole -v 5 compile
17:10:48 - Building project
17:10:48 - Settings file: settings.json (json)
17:10:48 - Project sources directory: /Users/tehfink/…/my_project/static/css/sass
17:10:48 - Project destination directory: /Users/tehfink/…/my_project/static/css/compiled
17:10:48 - Exclude patterns: []
17:10:48 - Compile: /Users/tehfink/…/my_project/static/css/sass/test.scss
17:10:48 - Output: /Users/tehfink/…/my_project/static/css/compiled/test.css

And manually calling sassc works:

$ sassc sass/test.sass compiled/test.css
$ cat compiled/test.css 
body {
  font: 100% Helvetica, sans-serif;
  color: #333; }

Contents of both files take from here:
https://sass-lang.com/guide

test.sass:

$font-stack:    Helvetica, sans-serif
$primary-color: #333

body
  font: 100% $font-stack
  color: $primary-color

test.scss:

$font-stack:    Helvetica, sans-serif;
$primary-color: #333;

body {
  font: 100% $font-stack;
  color: $primary-color;
}

Boussole does not support old legacy Sass syntax (aka *.sass) because i'm not sure about it will work with watcher that make extra job to inspect source to know about path to watch for.

Still it would work with the simple compile command since it just pass source to libsass, but with inspector it's another thing.

Some time ago, someone added a pull request just changing a settings and thought it would be ok, but Boussole is Test driven development and i don't have any one test about old legacy Sass syntax. I may have another idea about to maintain *.sass support if some one could bring me some tests to cover up everything like i did for *.scss

Thanks for the reply, and a cool project!

Boussole does not support old legacy Sass syntax (aka *.sass)…

I was hoping to use Boussole to work on Bulma, which uses .sass files: https://github.com/jgthms/bulma

After making the change to finder.py in @dansamara's PR, the compile command works for .sass files:

$ boussole -v 5 compile
17:23:16 - Building project
17:23:16 - Settings file: settings.json (json)
17:23:16 - Project sources directory: /Users/tehfink/…/my_project/static/css/sass
17:23:16 - Project destination directory: /Users/tehfink/…/my_project/static/css/compiled
17:23:16 - Exclude patterns: []
17:23:16 - Compile: /Users/tehfink/…/my_project/static/css/sass/test.sass
17:23:16 - Output: /Users/tehfink/…/my_project/static/css/compiled/test.css

After making a similar change in watch.py, changing line 74 to:

        'patterns': ['*.scss', '*.sass'],

now the watch command works with .sass files:

$ boussole -v 5 watch 
17:28:13 - Watching project
17:28:13 - Project sources directory: /Users/tehfink/…/my_project/static/css/sass
17:28:13 - Project destination directory: /Users/tehfink/…/my_project/static/css/compiled
17:28:13 - Exclude patterns: []
17:28:13 - Using Watchdog native platform observer
17:28:13 - Launching the watcher, use CTRL+C to stop it
17:28:38 - Change detected from an edit on: /Users/tehfink/…/my_project/static/css/sass/test.sass
17:28:38 - Compile: /Users/tehfink/…/my_project/static/css/sass/test.sass
17:28:38 - Output: /Users/tehfink/…/my_project/static/css/compiled/test.css

Thanks for the report but i still need to duplicate inspector+scss tests for sass files support to check everything is ok.

Note that if you use Bulma as a library, you may be able to write your project sources with scss since Bulma library is given "as it" to libsass compiler and libsass is able to manage sources with mixed syntax.

Added old indented Sass syntax in v1.5.0-pre.1 (3d5a089), not yet released as package.