sheetloaf 1.3.1-beta.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -5
- package/dist/sources.js +9 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const configs = __importStar(require("./configs"));
|
|
|
47
47
|
const fileFinder = __importStar(require("./fileFinder"));
|
|
48
48
|
const sources = __importStar(require("./sources"));
|
|
49
49
|
const sheetloaf = new commander_1.Command();
|
|
50
|
-
sheetloaf.version("1.3.1
|
|
50
|
+
sheetloaf.version("1.3.1", '-v, --version', 'Print the version of Sheetloaf.');
|
|
51
51
|
let usingStdin = false;
|
|
52
52
|
let postcssConfig = {
|
|
53
53
|
plugins: []
|
|
@@ -115,14 +115,16 @@ function renderPartially(source, fileName) {
|
|
|
115
115
|
}
|
|
116
116
|
else {
|
|
117
117
|
let partialExistsInSassSources = false;
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
let ind = 0;
|
|
119
|
+
while (ind < sources.getChecker().length) {
|
|
120
|
+
const toCheck = sources.getChecker()[ind];
|
|
121
|
+
if (toCheck.containsPartial(fileName)) {
|
|
120
122
|
partialExistsInSassSources = true;
|
|
121
|
-
renderSass(
|
|
123
|
+
renderSass(toCheck.getMain());
|
|
122
124
|
}
|
|
125
|
+
ind = ind + 1;
|
|
123
126
|
}
|
|
124
127
|
if (partialExistsInSassSources === false) {
|
|
125
|
-
console.log(fileName);
|
|
126
128
|
sources.clearSourcesChecker();
|
|
127
129
|
renderAllFiles(source);
|
|
128
130
|
}
|
package/dist/sources.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.addResultToSourcesChecker = exports.clearSourcesChecker = exports.getChecker = exports.SassSources = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const url_1 = require("url");
|
|
8
9
|
let sourcesChecker = [];
|
|
9
10
|
class SassSources {
|
|
10
11
|
constructor(fileName, sassResult) {
|
|
@@ -16,8 +17,8 @@ class SassSources {
|
|
|
16
17
|
setSources(urls) {
|
|
17
18
|
this.sources.splice(0, this.sources.length);
|
|
18
19
|
urls.forEach(url => {
|
|
19
|
-
if (url.
|
|
20
|
-
this.sources.push(url.
|
|
20
|
+
if ((0, url_1.fileURLToPath)(url.href) !== this.absoluteMain) {
|
|
21
|
+
this.sources.push((0, url_1.fileURLToPath)(url.href));
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
24
|
}
|
|
@@ -50,13 +51,14 @@ function clearSourcesChecker() {
|
|
|
50
51
|
exports.clearSourcesChecker = clearSourcesChecker;
|
|
51
52
|
function addResultToSourcesChecker(fileName, result) {
|
|
52
53
|
let resultExistsInChecker = false;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
let ind = 0;
|
|
55
|
+
while (ind < sourcesChecker.length && resultExistsInChecker === false) {
|
|
56
|
+
if (sourcesChecker[ind].getAbsoluteMain() === path_1.default.resolve(fileName)) {
|
|
57
|
+
sourcesChecker[ind].setSources(result.loadedUrls);
|
|
56
58
|
resultExistsInChecker = true;
|
|
57
|
-
return false;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
ind = ind + 1;
|
|
61
|
+
}
|
|
60
62
|
if (resultExistsInChecker === false) {
|
|
61
63
|
sourcesChecker.push(new SassSources(fileName, result));
|
|
62
64
|
}
|