postcss / sugarss

Indent-based CSS syntax for PostCSS
MIT License
707 stars 39 forks source link

CLI usage? #41

Closed mikeerickson closed 8 years ago

mikeerickson commented 8 years ago

I am trying to use this plugin and activate via CLI, is this possible

The following does NOT work

$ postcss -u sugarss -o ./css/app.css ./sass/app.sass

or

$ postcss --use sugarss -o ./css/app.css ./sass/app.sass
ai commented 8 years ago

You need add sugared as parser, not plugin. But vIsiting will try to add good docs about it.

ai commented 8 years ago

Waiting for this issue: https://github.com/postcss/postcss-cli/issues/33

ai commented 8 years ago

I added example with Atuoprefixer plugin ece8c24

But we still waiting for postcss-cli fix to be able to run it without any plugins

mikeerickson commented 8 years ago

I have tried to use it as a parser instead of plugin

$ postcss --use autoprefixer -c postcss.config.json -p sugarss

As there been any other updates beyond the --use parameter (I have installed autoprefixer to get passed the above mentioned error)

Is there something else I should be doing?

ai commented 8 years ago

Nope, everything should work. What problem do you have and what is config content?

mikeerickson commented 8 years ago

Here is config (see error below).

{
  "use": [
    "sugarss"
  ],
  "input": "./sass/bootstrap.sass",
  "output": "./dist/css/app.css",
  "local-plugins": true,
  "autoprefixer": {
    "browsers": "> 5%"
  }
}

Here is error

 $ /Users/mikeerickson/.nvm/versions/node/v5.9.1/bin/postcss --use autoprefixer -c postcss.config.json -p sugarss
module.js:341
    throw err;
    ^

Error: Cannot find module 'sugarss'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at /Users/mikeerickson/.nvm/versions/node/v5.9.1/lib/node_modules/postcss-cli/index.js:117:18
    at Array.reduce (native)
    at Object.<anonymous> (/Users/mikeerickson/.nvm/versions/node/v5.9.1/lib/node_modules/postcss-cli/index.js:115:4)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
 ✘  ~/Documents/Projects/sandbox   master ●✚ 
mikeerickson commented 8 years ago

And yes, sugarss is installed in node_modules (see portion below)

drwxr-xr-x@   6 mikeerickson  staff   204 Jul 25 09:55 strip-bom
drwxr-xr-x@   9 mikeerickson  staff   306 Jul 20 13:28 subarg
drwxr-xr-x@  15 mikeerickson  staff   510 Jul 25 12:14 sugarss
drwxr-xr-x@   7 mikeerickson  staff   238 Jul 22 10:38 supports-color
drwxr-xr-x@  10 mikeerickson  staff   340 Jul 20 13:28 syntax-error
drwxr-xr-x@   9 mikeerickson  staff   306 Jul 20 13:28 through
drwxr-xr-x@   8 mikeerickson  staff   272 Jul 20 13:28 through2
ai commented 8 years ago

It is postcss-cli issue, sorry

mikeerickson commented 8 years ago

sorry for confusion :-)

mikeerickson commented 8 years ago

@ai First of all, I got it working and I believe it is now working as intended

The process is converting any .sass file I supply, converting it to .scss format

What I am ultimately trying to accomplish is using sugarss within postcss to lint my .sass files. Am I doing the correct thing? I have intentionally left "errors" in the file to see what the output produces (in my case, it is just converting the files).

Is there another step I should be running to actually "lint" the files (must I run through stylelint, supplying the converted files)?