@css-hooks/core 4.0.0-next.0 → 4.0.0-next.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
@@ -1,16 +1,16 @@
1
1
  <div align="center">
2
- <a id="logomark" href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.0/.github/logomark.svg" height="128" /></a><br/><br/>
2
+ <a id="logomark" href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.1/.github/logomark.svg" height="128" /></a><br/><br/>
3
3
  <div id="wordmark">
4
- <a href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.0/.github/wordmark-dark.svg" width="256"></a>
4
+ <a href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.1/.github/wordmark-dark.svg" width="256"></a>
5
5
  </div>
6
6
  </div>
7
7
 
8
8
  <br/>
9
9
 
10
10
  <div align="center" id="badges">
11
- <a href="https://github.com/css-hooks/css-hooks/tree/v4.0.0-next.0"><img src="https://img.shields.io/badge/tag-v4.0.0--next.0-ffd700" alt="tag v4.0.0-next.0"></a>
12
- <a href="https://www.npmjs.com/package/@css-hooks/core/v/4.0.0-next.0"><img src="https://img.shields.io/badge/npm-v4.0.0--next.0-ffd700" alt="npm version"></a>
13
- <a href="https://github.com/css-hooks/css-hooks/blob/v4.0.0-next.0/LICENSE"><img src="https://img.shields.io/badge/license-MIT-ffd700" alt="license"></a>
11
+ <a href="https://github.com/css-hooks/css-hooks/tree/v4.0.0-next.1"><img src="https://img.shields.io/badge/tag-v4.0.0--next.1-ffd700" alt="tag v4.0.0-next.1"></a>
12
+ <a href="https://www.npmjs.com/package/@css-hooks/core/v/4.0.0-next.1"><img src="https://img.shields.io/badge/npm-v4.0.0--next.1-ffd700" alt="npm version"></a>
13
+ <a href="https://github.com/css-hooks/css-hooks/blob/v4.0.0-next.1/LICENSE"><img src="https://img.shields.io/badge/license-MIT-ffd700" alt="license"></a>
14
14
  </div>
15
15
 
16
16
  ---
package/cjs/index.js CHANGED
@@ -28,9 +28,18 @@ exports.buildHooksSystem = buildHooksSystem;
28
28
  */
29
29
  function buildHooksSystem(stringify = String) {
30
30
  return (...selectors) => {
31
- const [space, newline] =
32
- // @ts-expect-error bundler expected to replace `process.env.NODE_ENV` expression
33
- process.env.NODE_ENV === "development" ? [" ", "\n"] : ["", ""];
31
+ let space = "";
32
+ let newline = "";
33
+ try {
34
+ // @ts-expect-error bundler expected to replace `process.env.NODE_ENV` expression
35
+ if (process.env.NODE_ENV === "development") {
36
+ space = " ";
37
+ newline = "\n";
38
+ }
39
+ }
40
+ catch {
41
+ // `process.env.NODE_ENV` is absent in unbundled browser environments
42
+ }
34
43
  return {
35
44
  styleSheet() {
36
45
  const indent = Array(2).fill(space).join("");
package/esm/index.js CHANGED
@@ -25,9 +25,18 @@
25
25
  */
26
26
  export function buildHooksSystem(stringify = String) {
27
27
  return (...selectors) => {
28
- const [space, newline] =
29
- // @ts-expect-error bundler expected to replace `process.env.NODE_ENV` expression
30
- process.env.NODE_ENV === "development" ? [" ", "\n"] : ["", ""];
28
+ let space = "";
29
+ let newline = "";
30
+ try {
31
+ // @ts-expect-error bundler expected to replace `process.env.NODE_ENV` expression
32
+ if (process.env.NODE_ENV === "development") {
33
+ space = " ";
34
+ newline = "\n";
35
+ }
36
+ }
37
+ catch {
38
+ // `process.env.NODE_ENV` is absent in unbundled browser environments
39
+ }
31
40
  return {
32
41
  styleSheet() {
33
42
  const indent = Array(2).fill(space).join("");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@css-hooks/core",
3
3
  "description": "CSS Hooks core library",
4
- "version": "4.0.0-next.0",
4
+ "version": "4.0.0-next.1",
5
5
  "author": "Nick Saunders",
6
6
  "devDependencies": {
7
7
  "color": "^5.0.3",