sheetloaf 1.16.0 → 1.17.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/README.md CHANGED
@@ -41,30 +41,32 @@ Options for use with --dir:
41
41
  in the output directory, for use with --dir
42
42
 
43
43
  Sass options:
44
- -s, --style Output style. Possible values are "expanded", [string]
45
- or "compressed". Default: "expanded".
46
- --[no-]source-map Whether to generate source maps. Default is on. [boolean]
47
- --embed-source-map Tells Sass to embed the contents of the source [boolean]
48
- map file in the generated CSS, rather than
49
- creating a separate file and linking to it
50
- from the CSS.
51
- --embed-sources Embed the entire contents of the Sass files that [boolean]
52
- contributed to the generated CSS in the source map.
53
- This may produce very large source maps, but it
54
- guarantees that the source will be available on
55
- any computer no matter how the CSS is served.
56
- -–source-map-urls Controls how the source maps that Sass generates [string]
57
- link back to the Sass files that contributed to
58
- the generated CSS. Possible values are "relative"
59
- or "absolute". Default: "relative".
60
- --[no-]error-css This flag tells Sass whether to emit a CSS file [boolean]
61
- when an error occurs during compilation. This
62
- CSS file describes the error in a comment and in
63
- the content property of body::before, so that
64
- you can see the error message in the browser
65
- without needing to switch back to the terminal.
66
- -I, --load-path Adds an additional load path for Sass to look [string]
67
- for stylesheets.
44
+ -s, --style Output style. Possible values are "expanded", [string]
45
+ or "compressed". Default: "expanded".
46
+ --[no-]source-map Whether to generate source maps. Default is on. [boolean]
47
+ --embed-source-map Tells Sass to embed the contents of the source [boolean]
48
+ map file in the generated CSS, rather than
49
+ creating a separate file and linking to it
50
+ from the CSS.
51
+ --embed-sources Embed the entire contents of the Sass files that [boolean]
52
+ contributed to the generated CSS in the source map.
53
+ This may produce very large source maps, but it
54
+ guarantees that the source will be available on
55
+ any computer no matter how the CSS is served.
56
+ -–source-map-urls Controls how the source maps that Sass generates [string]
57
+ link back to the Sass files that contributed to
58
+ the generated CSS. Possible values are "relative"
59
+ or "absolute". Default: "relative".
60
+ --[no-]error-css This flag tells Sass whether to emit a CSS file [boolean]
61
+ when an error occurs during compilation. This
62
+ CSS file describes the error in a comment and in
63
+ the content property of body::before, so that
64
+ you can see the error message in the browser
65
+ without needing to switch back to the terminal.
66
+ -I, --load-path Adds an additional load path for Sass to look [string]
67
+ for stylesheets.
68
+ -p, --pkg-importer Built-in importer(s) to use for pkg: URLs. [string]
69
+ [node] Load files like Node.js package resolution.
68
70
 
69
71
  Advanced options:
70
72
  --poll Use polling for file watching. Can optionally pass polling [boolean]
package/dist/configs.js CHANGED
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.generateSassOptionsAsync = exports.generateSassOptions = exports.generatePostcssConfigFromUse = exports.generatePostcssConfigFromFile = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const fs_1 = __importDefault(require("fs"));
9
+ const sass_1 = require("sass");
9
10
  function generatePostcssConfigFromFile(configPath = '') {
10
11
  let obj = {
11
12
  plugins: []
@@ -36,7 +37,8 @@ function generateSassOptions(opts) {
36
37
  style: opts.style,
37
38
  loadPaths: opts.loadPath ? opts.loadPath.split(',') : [],
38
39
  sourceMap: opts.sourceMap === false ? false : true,
39
- sourceMapIncludeSources: opts.sourceMap === false ? false : true
40
+ sourceMapIncludeSources: opts.sourceMap === false ? false : true,
41
+ importers: opts.pkgImporter === 'node' ? [new sass_1.NodePackageImporter()] : []
40
42
  };
41
43
  }
42
44
  exports.generateSassOptions = generateSassOptions;
@@ -45,7 +47,8 @@ function generateSassOptionsAsync(opts) {
45
47
  style: opts.style,
46
48
  loadPaths: opts.loadPath ? opts.loadPath.split(',') : [],
47
49
  sourceMap: opts.sourceMap === false ? false : true,
48
- sourceMapIncludeSources: opts.sourceMap === false ? false : true
50
+ sourceMapIncludeSources: opts.sourceMap === false ? false : true,
51
+ importers: opts.pkgImporter === 'node' ? [new sass_1.NodePackageImporter()] : []
49
52
  };
50
53
  }
51
54
  exports.generateSassOptionsAsync = generateSassOptionsAsync;
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.16.0", '-v, --version', 'Print the version of Sheetloaf.');
50
+ sheetloaf.version("1.17.0", '-v, --version', 'Print the version of Sheetloaf.');
51
51
  let usingStdin = false;
52
52
  let postcssConfig = {
53
53
  plugins: []
@@ -98,10 +98,11 @@ sheetloaf
98
98
  .option('--no-source-map', 'Do not generate a source map.')
99
99
  .option('--embed-source-map', 'Embed the contents of the source map file in the generated CSS, rather than creating a separate file and linking to it from the CSS.')
100
100
  .option('--embed-sources', 'Embed the entire contents of the Sass files that contributed to the generated CSS in the source map.')
101
- .option('--source-map-urls <TYPE>', 'Controls how the source maps that Sass generates link back to the Sass files that contributed to the generated CSS. ["relative", "absolute"]', 'relative')
101
+ .option('--source-map-urls <TYPE>', 'Controls how the source maps that Sass generates link back to the Sass files that contributed to the generated CSS. ["relative", "absolute"]', 'relative')
102
102
  .option('--error-css', 'Emit a CSS file when an error occurs during compilation (this is the default option).')
103
103
  .option('--no-error-css', 'Do not emit a CSS file when an error occurs during compilation.')
104
104
  .option('-I, --load-path <PATHS>', 'Adds an additional load path for Sass to look for stylesheets.')
105
+ .option('-p, --pkg-importer <TYPE>', `Built-in importer(s) to use for pkg: URLs.\n[node] - Load files like Node.js package resolution.`)
105
106
  .option('-w, --watch', 'Watch stylesheets and recompile when they change.')
106
107
  .option('--config <LOCATION>', 'Set a custom directory to look for a postcss config file.')
107
108
  .option('--poll [DURATION]', 'Use polling for file watching. Can optionally pass polling interval; default 100 ms')
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "sheetloaf",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "freshmade stylesheets for the whole family.",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
7
- "sheetloaf": "./dist/index.js"
7
+ "sheetloaf": "dist/index.js"
8
8
  },
9
9
  "scripts": {
10
10
  "build:development": "tsc --watch",
11
11
  "build:production": "tsc",
12
12
  "test": "mocha -r ts-node/register test/*.test.ts",
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",
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",
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"
16
16
  },
@@ -37,12 +37,12 @@
37
37
  "@types/mocha": "^9.1.1",
38
38
  "@types/node": "^18.6.3",
39
39
  "@types/picomatch": "^2.3.0",
40
- "@types/sass": "^1.43.1",
41
40
  "autoprefixer": "^10.4.13",
42
41
  "mocha": "^9.2.2",
43
42
  "postcss": "^8.4.14",
44
43
  "postcss-custom-properties": "^12.1.8",
45
44
  "ts-node": "^10.9.1",
45
+ "bootstrap": "^5.3.3",
46
46
  "typescript": "^4.7.4"
47
47
  },
48
48
  "peerDependencies": {
@@ -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.70.0"
57
+ "sass": "^1.71.1"
58
58
  }
59
- }
59
+ }