sheetloaf 1.15.1 → 1.16.0-beta.0
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 +15 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -47,21 +47,29 @@ 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.
|
|
50
|
+
sheetloaf.version("1.16.0", '-v, --version', 'Print the version of Sheetloaf.');
|
|
51
51
|
let usingStdin = false;
|
|
52
52
|
let postcssConfig = {
|
|
53
53
|
plugins: []
|
|
54
54
|
};
|
|
55
|
+
let sassCompiler;
|
|
56
|
+
let sassAsyncCompiler;
|
|
55
57
|
sheetloaf
|
|
56
58
|
.arguments('[sources...]')
|
|
57
59
|
.description('📃🍞 Compile Sass to CSS and transform the output using PostCSS, all in one command.')
|
|
58
|
-
.action((source) => {
|
|
60
|
+
.action((source) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
61
|
if (sheetloaf.opts().use) {
|
|
60
62
|
postcssConfig = configs.generatePostcssConfigFromUse(sheetloaf.opts().use);
|
|
61
63
|
}
|
|
62
64
|
else {
|
|
63
65
|
postcssConfig = configs.generatePostcssConfigFromFile(sheetloaf.opts().config);
|
|
64
66
|
}
|
|
67
|
+
if (sheetloaf.opts().async === true) {
|
|
68
|
+
sassAsyncCompiler = yield sass_1.default.initAsyncCompiler();
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
sassCompiler = sass_1.default.initCompiler();
|
|
72
|
+
}
|
|
65
73
|
if (source.length > 0) {
|
|
66
74
|
renderAllFiles(source);
|
|
67
75
|
watch(source);
|
|
@@ -79,7 +87,7 @@ sheetloaf
|
|
|
79
87
|
renderSassFromStdin(stdin);
|
|
80
88
|
});
|
|
81
89
|
}
|
|
82
|
-
});
|
|
90
|
+
}));
|
|
83
91
|
sheetloaf
|
|
84
92
|
.option('-o, --output <LOCATION>', 'Output file.')
|
|
85
93
|
.option('--dir <LOCATION>', 'Output directory.')
|
|
@@ -160,13 +168,13 @@ function renderSass(fileName) {
|
|
|
160
168
|
try {
|
|
161
169
|
if (sheetloaf.opts().async === true) {
|
|
162
170
|
const options = configs.generateSassOptionsAsync(sheetloaf.opts());
|
|
163
|
-
const result = yield
|
|
171
|
+
const result = yield sassAsyncCompiler.compileAsync(fileName, options);
|
|
164
172
|
renderPost(fileName, destination, result);
|
|
165
173
|
sources.addResultToSourcesChecker(fileName, result);
|
|
166
174
|
}
|
|
167
175
|
else {
|
|
168
176
|
const options = configs.generateSassOptions(sheetloaf.opts());
|
|
169
|
-
const result =
|
|
177
|
+
const result = sassCompiler.compile(fileName, options);
|
|
170
178
|
renderPost(fileName, destination, result);
|
|
171
179
|
sources.addResultToSourcesChecker(fileName, result);
|
|
172
180
|
}
|
|
@@ -182,12 +190,12 @@ function renderSassFromStdin(text) {
|
|
|
182
190
|
try {
|
|
183
191
|
if (sheetloaf.opts().async === true) {
|
|
184
192
|
const options = configs.generateSassOptionsAsync(sheetloaf.opts());
|
|
185
|
-
const result = yield
|
|
193
|
+
const result = yield sassAsyncCompiler.compileStringAsync(text, options);
|
|
186
194
|
renderPost('', destination, result);
|
|
187
195
|
}
|
|
188
196
|
else {
|
|
189
197
|
const options = configs.generateSassOptions(sheetloaf.opts());
|
|
190
|
-
const result =
|
|
198
|
+
const result = sassCompiler.compileString(text, options);
|
|
191
199
|
renderPost('', destination, result);
|
|
192
200
|
}
|
|
193
201
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sheetloaf",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0-beta.0",
|
|
4
4
|
"description": "freshmade stylesheets for the whole family.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"fast-glob": "^3.2.12",
|
|
55
55
|
"picocolors": "^1.0.0",
|
|
56
56
|
"picomatch": "^2.3.1",
|
|
57
|
-
"sass": "^1.
|
|
57
|
+
"sass": "^1.70.0"
|
|
58
58
|
}
|
|
59
59
|
}
|