@localnerve/sass-asset-functions 4.3.0 → 4.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Sass Asset Functions Change Log
2
2
 
3
+ ## 4.4.0
4
+ * sass 1.67.0
5
+ * Development dependency updates
6
+ * Rename and update package testing suite
7
+
3
8
  ## 4.3.0
4
9
  * sass 1.66.1
5
10
  * Development dependency updates
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@localnerve/sass-asset-functions",
3
- "version": "4.3.0",
3
+ "version": "4.5.0",
4
4
  "description": "compass-style asset functions for dart-sass or other sass compilers",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -10,12 +10,12 @@
10
10
  },
11
11
  "type": "module",
12
12
  "scripts": {
13
- "test-package": "node ./test-package/index.js",
13
+ "test-package": "node ./__test-package__/index.js",
14
14
  "test": "jest && npm run test-package",
15
15
  "lint": "eslint .",
16
16
  "pretranspile": "rimraf ./cjs",
17
17
  "transpile": "babel index.js -o ./cjs/index.cjs && babel ./lib/processor.js -o ./cjs/lib/processor.cjs",
18
- "posttranspile": "node posttranspile.cjs",
18
+ "posttranspile": "node posttranspile.js",
19
19
  "prepublishOnly": "npm run transpile"
20
20
  },
21
21
  "repository": {
@@ -50,17 +50,17 @@
50
50
  "dependencies": {
51
51
  "image-size": "^1.0.2",
52
52
  "mime": "^3.0.0",
53
- "sass": "^1.66.1"
53
+ "sass": "^1.68.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@babel/cli": "^7.22.10",
57
- "@babel/preset-env": "^7.22.14",
56
+ "@babel/cli": "^7.23.0",
57
+ "@babel/preset-env": "^7.22.20",
58
58
  "rimraf": "^5.0.1",
59
- "jest": "^29.6.4",
60
- "eslint": "^8.48.0",
59
+ "jest": "^29.7.0",
60
+ "eslint": "^8.50.0",
61
61
  "node-sass": "^9.0.0",
62
- "tar": "^6.1.15",
63
- "glob": "^10.3.3"
62
+ "tar": "^6.2.0",
63
+ "glob": "^10.3.7"
64
64
  },
65
65
  "engines": {
66
66
  "node": ">= 16"
@@ -0,0 +1,25 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+
4
+ async function processFile (filename) {
5
+ const data = await fs.readFile(filename, 'utf8');
6
+ const newData = data.replace(/(require\("[a-z./]+)(\.js")(.+)$/mg, (m, req, repl, rest) => {
7
+ return `${req}.cjs"${rest}`;
8
+ });
9
+ await fs.writeFile(filename, newData);
10
+ }
11
+
12
+ async function processDirectory (dir) {
13
+ const files = await fs.readdir(dir);
14
+ for (const file of files) {
15
+ const name = `${dir}${path.sep}${file}`;
16
+ const stats = await fs.stat(name);
17
+ if (stats.isDirectory()) {
18
+ processDirectory(name);
19
+ } else {
20
+ processFile(name);
21
+ }
22
+ }
23
+ }
24
+
25
+ await processDirectory('./cjs');
package/posttranspile.cjs DELETED
@@ -1,9 +0,0 @@
1
- const fs = require('node:fs');
2
- const fileToChange = './cjs/index.cjs';
3
- fs.readFile(fileToChange, 'utf8', (err, data) => {
4
- if (err) throw err;
5
- const newData = data.replace('./lib/processor.js', './lib/processor.cjs');
6
- fs.writeFile(fileToChange, newData, err => {
7
- if (err) throw err;
8
- });
9
- });