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,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