Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #10 from thomasjo/bump-packages
Browse files Browse the repository at this point in the history
Upgrade packages that use old versions of graceful-fs
  • Loading branch information
Nathan Sobo authored Aug 1, 2016
2 parents 98450bc + f73eb31 commit 04bdfca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@
}
],
"dependencies": {
"less": "^1.7.5",
"fs-plus": "2.x",
"less": "^2.7.1",
"underscore-plus": "1.x",
"walkdir": "0.0.7",
"fs-plus": "2.x"
"walkdir": "0.0.11"
},
"devDependencies": {
"fstream": "^1.0.10",
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0",
"grunt-coffeelint": "0.0.16",
"grunt-contrib-coffee": "^1.0.0",
"grunt-shell": "^1.3.0",
"jasmine-focused": "1.x",
"tmp": "0.0.21",
"fstream": "~0.1.24",
"grunt-contrib-coffee": "~0.9.0",
"grunt-cli": "~0.1.9",
"grunt": "~0.4.1",
"grunt-shell": "~0.3.1",
"grunt-coffeelint": "0.0.7"
"tmp": "0.0.28"
}
}
15 changes: 7 additions & 8 deletions src/less-cache.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ crypto = require 'crypto'

_ = require 'underscore-plus'
fs = require 'fs-plus'
less = null # Defer until it is actually used
lessFs = null # Defer until it is actually used
Parser = null # Defer until it is actually used
walkdir = require('walkdir').sync

cacheVersion = 1
Expand Down Expand Up @@ -85,7 +85,7 @@ class LessCache

observeImportedFilePaths: (callback) ->
importedPaths = []
lessFs ?= require 'less/lib/less/fs.js'
lessFs ?= require 'less/lib/less-node/fs.js'
originalFsReadFileSync = lessFs.readFileSync
lessFs.readFileSync = (filePath, args...) =>
content = originalFsReadFileSync(filePath, args...)
Expand Down Expand Up @@ -157,17 +157,16 @@ class LessCache
if @syncCaches and @importsFallbackDir?
@writeJson(@getCachePath(@importsFallbackDir, filePath), cacheEntry)

parseLess: (filePath, less) ->
parseLess: (filePath, contents) ->
css = null
options = filename: filePath, syncImport: true, paths: @importPaths
Parser ?= require('less').Parser
parser = new Parser(options)
imports = @observeImportedFilePaths =>
parser.parse less, (error, tree) =>
less ?= require('less')
imports = @observeImportedFilePaths ->
less.render contents, options, (error, result) ->
if error?
throw error
else
css = tree.toCSS()
{css} = result
{imports, css}

# Read the Less file at the current path and return either the cached CSS or the newly
Expand Down

0 comments on commit 04bdfca

Please sign in to comment.