@ecopages/core 0.7.1 → 0.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecopages/core",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "Core package for Ecopages",
5
5
  "keywords": [
6
6
  "ecopages",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@clack/prompts": "^1.7.0",
27
- "@ecopages/file-system": "0.7.1",
27
+ "@ecopages/file-system": "0.8.0",
28
28
  "@ecopages/logger": "^0.2.3",
29
29
  "@ecopages/scripts-injector": "^0.1.5",
30
30
  "@jridgewell/remapping": "^2.3.5",
@@ -37,7 +37,7 @@
37
37
  "ws": "^8.20.1"
38
38
  },
39
39
  "peerDependencies": {
40
- "@ecopages/dev-toolbar": "0.7.1"
40
+ "@ecopages/dev-toolbar": "0.8.0"
41
41
  },
42
42
  "peerDependenciesMeta": {
43
43
  "@ecopages/dev-toolbar": {
@@ -1,5 +1,7 @@
1
1
  import { wrapInConditions } from './css-scanner.js';
2
- const PLACEHOLDER = /\u0000(h?)(\d+)\u0000/g;
2
+ /** A character CSS cannot contain, so a placeholder never clashes with the text around it. */
3
+ const NUL = String.fromCharCode(0);
4
+ const PLACEHOLDER = new RegExp(`${NUL}(h?)(\\d+)${NUL}`, 'g');
3
5
  /**
4
6
  * Orders inlined `@import`s the way the cascade does: a stylesheet imported more than once keeps only its last
5
7
  * instance, where Lightning CSS and `postcss-import`-style bundlers place it.
@@ -17,7 +19,7 @@ export class ImportOrder {
17
19
  /** Records an inlined `@import` and returns the placeholder that stands for it in the importing CSS. */
18
20
  add(stylesheet, css, conditions) {
19
21
  this.occurrences.push({ stylesheet, css, conditions });
20
- return `\u0000${this.occurrences.length - 1}\u0000`;
22
+ return `${NUL}${this.occurrences.length - 1}${NUL}`;
21
23
  }
22
24
  /**
23
25
  * Records an `@import` that moves to the top of the output (root-relative, `data:` or remote) and returns the
@@ -25,7 +27,7 @@ export class ImportOrder {
25
27
  */
26
28
  hoist(statement) {
27
29
  this.hoistable.push(statement);
28
- return `\u0000h${this.hoistable.length - 1}\u0000`;
30
+ return `${NUL}h${this.hoistable.length - 1}${NUL}`;
29
31
  }
30
32
  /** Whether any `@import` was recorded. */
31
33
  get isEmpty() {