sheetloaf 1.26.1-beta.0 → 1.26.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/README.md CHANGED
@@ -69,7 +69,7 @@ Advanced options:
69
69
  --poll Use polling for file watching. Can optionally pass [boolean]
70
70
  polling interval; default 100 ms
71
71
  --async Use Sass's compileAsyc/compileStringAsync functions. [boolean]
72
- This will be slower in most cases.
72
+ This will improve performance for multiple files.
73
73
  --[no-]error-css This flag tells Sass whether to emit a CSS file [boolean]
74
74
  when an error occurs during compilation. This
75
75
  CSS file describes the error in a comment and in
package/dist/index.js CHANGED
@@ -51,6 +51,23 @@ class CompWrapper {
51
51
  }
52
52
  });
53
53
  }
54
+ else {
55
+ this.usingStdin = true;
56
+ if (this.options.async === true) {
57
+ initAsyncCompiler().then((compiler) => {
58
+ this.compiler.async = compiler;
59
+ this.initialized = true;
60
+ resolve("Compiler initialized.");
61
+ }).catch((e) => {
62
+ reject(e);
63
+ });
64
+ }
65
+ else {
66
+ this.compiler.sync = initCompiler();
67
+ this.initialized = true;
68
+ resolve("Compiler initialized.");
69
+ }
70
+ }
54
71
  });
55
72
  }
56
73
  dispose() {
@@ -160,7 +177,7 @@ class CompWrapper {
160
177
  resolve(result);
161
178
  }
162
179
  else {
163
- const result = this.compiler.sync.compile(fileNameOrString, options);
180
+ const result = this.compiler.sync.compileString(fileNameOrString, options);
164
181
  resolve(result);
165
182
  }
166
183
  }
@@ -368,7 +385,7 @@ sheetloaf
368
385
  });
369
386
  }
370
387
  else if (!process.stdin.isTTY) {
371
- compiler.init(sheetloaf.opts).then(() => {
388
+ compiler.init(sheetloaf.opts()).then(() => {
372
389
  //see github.com/tj/commander.js/issues/137
373
390
  let stdin = '';
374
391
  process.stdin.on('readable', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sheetloaf",
3
- "version": "1.26.1-beta.0",
3
+ "version": "1.26.1",
4
4
  "description": "freshmade stylesheets for the whole family.",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "build:development": "tsc --watch",
11
11
  "build:production": "tsc",
12
- "test": "mocha -r ts-node/register test/*.test.ts",
12
+ "test": "node --import tsx --test test/*.test.ts",
13
13
  "test2": "node . \"test/samples/styles/**/*.scss\" --dir \"test/samples/render/\" --load-path \"test/samples/lib\" --style compressed --base test/samples/styles/ --use autoprefixer,postcss-custom-properties --watch --pkg-importer node --silence-deprecation global-builtin",
14
14
  "test3": "cat test/samples/styles/file.scss | node . --style compressed --use autoprefixer --load-path test/samples/styles > test/samples/render/file.css",
15
15
  "test4": "cat test/samples/styles/file-with-error.scss | node . --style compressed --use autoprefixer > test/samples/render/file.css 2> test/samples/logs/error.log"
@@ -21,7 +21,6 @@
21
21
  "files": [
22
22
  "dist/*.js"
23
23
  ],
24
-
25
24
  "keywords": [
26
25
  "scss",
27
26
  "css",
@@ -36,18 +35,16 @@
36
35
  },
37
36
  "homepage": "https://github.com/benfuddled/sheetloaf#readme",
38
37
  "devDependencies": {
39
- "@types/mocha": "^10.0.10",
40
- "@types/node": "^18.6.3",
38
+ "@types/node": "^18.19.130",
41
39
  "autoprefixer": "^10.4.22",
42
40
  "bootstrap": "^5.3.8",
43
- "mocha": "^11.7.5",
44
41
  "postcss": "^8.5.15",
45
42
  "postcss-custom-properties": "^13.3.10",
46
- "ts-node": "^10.9.2",
43
+ "tsx": "^4.22.4",
47
44
  "typescript": "^6.0.3"
48
45
  },
49
46
  "peerDependencies": {
50
- "postcss": "^8.5.15"
47
+ "postcss": "^8.5.0"
51
48
  },
52
49
  "dependencies": {
53
50
  "chokidar": "^5.0.0",
@@ -56,4 +53,4 @@
56
53
  "picocolors": "^1.1.1",
57
54
  "sass-embedded": "1.100.0"
58
55
  }
59
- }
56
+ }