zss-engine 0.2.24 → 0.2.25

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.
@@ -1,22 +1,19 @@
1
1
  'use server';
2
2
  "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
3
  Object.defineProperty(exports, "__esModule", { value: true });
7
4
  exports.build = void 0;
8
- const fs_1 = __importDefault(require("fs"));
9
- const util_1 = require("util");
10
5
  const helper_js_1 = require("./helper.js");
11
6
  const build = async (styleSheet, filePath, global) => {
12
7
  if (!helper_js_1.isServer)
13
8
  return;
14
- const message = global === '--global' ? (0, util_1.styleText)('underline', `✅Generated global CSS\n\n`) : (0, util_1.styleText)('underline', `✅Generated create CSS\n\n`);
9
+ const fs = await import('fs');
10
+ const { styleText } = await import('util');
11
+ const message = global === '--global' ? styleText('underline', `✅Generated global CSS\n\n`) : styleText('underline', `✅Generated create CSS\n\n`);
15
12
  try {
16
- if (fs_1.default.existsSync(filePath)) {
17
- const cssData = fs_1.default.readFileSync(filePath, 'utf-8');
13
+ if (fs.existsSync(filePath)) {
14
+ const cssData = fs.readFileSync(filePath, 'utf-8');
18
15
  if (!cssData.includes(styleSheet)) {
19
- fs_1.default.appendFileSync(filePath, styleSheet, 'utf-8');
16
+ fs.appendFileSync(filePath, styleSheet, 'utf-8');
20
17
  if (process.argv.includes('--log'))
21
18
  console.log(message + styleSheet);
22
19
  }
@@ -1,10 +1,10 @@
1
1
  'use server';
2
- import fs from 'fs';
3
- import { styleText } from 'util';
4
2
  import { isServer } from './helper.js';
5
3
  export const build = async (styleSheet, filePath, global) => {
6
4
  if (!isServer)
7
5
  return;
6
+ const fs = await import('fs');
7
+ const { styleText } = await import('util');
8
8
  const message = global === '--global' ? styleText('underline', `✅Generated global CSS\n\n`) : styleText('underline', `✅Generated create CSS\n\n`);
9
9
  try {
10
10
  if (fs.existsSync(filePath)) {
package/license CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 zss-in-js contributor
3
+ Copyright (c) zss-in-js contributor
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zss-engine",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "description": "Zero-runtime Style Sheet Engine",
5
5
  "keywords": [
6
6
  "zero-runtime",