boxwood 0.79.0 → 0.80.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.
Files changed (2) hide show
  1. package/index.js +7 -3
  2. package/package.json +6 -7
package/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  const { join } = require("path")
2
2
  const { readFileSync } = require("fs")
3
3
  const csstree = require("css-tree")
4
- const toHash = require("string-hash")
5
4
 
6
5
  function compile(path) {
7
6
  const fn = require(path)
@@ -268,6 +267,11 @@ const tag = (a, b, c) => {
268
267
  }
269
268
  }
270
269
 
270
+ let number = 1
271
+ function sequence() {
272
+ return number++
273
+ }
274
+
271
275
  function css(inputs) {
272
276
  let result = ""
273
277
  for (let i = 0, ilen = inputs.length; i < ilen; i += 1) {
@@ -279,13 +283,13 @@ function css(inputs) {
279
283
  result += input
280
284
  }
281
285
  }
282
- const hash = toHash(result).toString(36).substr(0, 5)
286
+ const hash = sequence()
283
287
  const tree = csstree.parse(result)
284
288
  const classes = {}
285
289
 
286
290
  csstree.walk(tree, (node) => {
287
291
  if (node.type === "ClassSelector") {
288
- const name = `__${node.name}__${hash}`
292
+ const name = `${node.name}_${hash}`
289
293
  classes[node.name] = name
290
294
  node.name = name
291
295
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boxwood",
3
- "version": "0.79.0",
3
+ "version": "0.80.0",
4
4
  "description": "Compile HTML templates into JS",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -47,12 +47,12 @@
47
47
  "homepage": "https://github.com/buxlabs/boxwood#readme",
48
48
  "devDependencies": {
49
49
  "benchmark": "2.1.4",
50
- "c8": "^9.1.0",
51
- "express": "^4.19.2",
50
+ "c8": "^10.1.2",
51
+ "express": "^4.21.0",
52
52
  "handlebars": "^4.7.8",
53
- "jsdom": "^24.0.0",
53
+ "jsdom": "^25.0.0",
54
54
  "mustache": "^4.2.0",
55
- "underscore": "^1.13.6"
55
+ "underscore": "^1.13.7"
56
56
  },
57
57
  "standard": {
58
58
  "ignore": [
@@ -62,8 +62,7 @@
62
62
  ]
63
63
  },
64
64
  "dependencies": {
65
- "css-tree": "^2.3.1",
66
- "string-hash": "^1.1.3"
65
+ "css-tree": "^3.0.0"
67
66
  },
68
67
  "prettier": {
69
68
  "semi": false