zss-engine 0.2.20 → 0.2.22
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/dist/cjs/utils/build.js +10 -10
- package/dist/esm/utils/build.js +5 -9
- package/package.json +3 -2
package/dist/cjs/utils/build.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
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
|
+
};
|
|
3
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
7
|
exports.build = void 0;
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const util_1 = require("util");
|
|
5
10
|
const helper_js_1 = require("./helper.js");
|
|
6
11
|
const build = async (styleSheet, filePath, global) => {
|
|
7
12
|
if (!helper_js_1.isServer)
|
|
8
13
|
return;
|
|
9
|
-
const
|
|
10
|
-
const { styleText } = require('util');
|
|
11
|
-
const message = global === '--global' ? styleText('underline', `✅Generated global CSS\n\n`) : styleText('underline', `✅Generated create CSS\n\n`);
|
|
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`);
|
|
12
15
|
try {
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
if (process.argv.includes('--log'))
|
|
18
|
-
console.log(message + styleSheet);
|
|
19
|
-
}
|
|
16
|
+
if (fs_1.default.existsSync(filePath)) {
|
|
17
|
+
fs_1.default.appendFileSync(filePath, styleSheet, 'utf-8');
|
|
18
|
+
if (process.argv.includes('--log'))
|
|
19
|
+
console.log(message + styleSheet);
|
|
20
20
|
}
|
|
21
21
|
return;
|
|
22
22
|
}
|
package/dist/esm/utils/build.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import { styleText } from 'util';
|
|
2
3
|
import { isServer } from './helper.js';
|
|
3
4
|
export const build = async (styleSheet, filePath, global) => {
|
|
4
5
|
if (!isServer)
|
|
5
6
|
return;
|
|
6
|
-
const fs = require('fs');
|
|
7
|
-
const { styleText } = require('util');
|
|
8
7
|
const message = global === '--global' ? styleText('underline', `✅Generated global CSS\n\n`) : styleText('underline', `✅Generated create CSS\n\n`);
|
|
9
8
|
try {
|
|
10
9
|
if (fs.existsSync(filePath)) {
|
|
11
|
-
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
if (process.argv.includes('--log'))
|
|
15
|
-
console.log(message + styleSheet);
|
|
16
|
-
}
|
|
10
|
+
fs.appendFileSync(filePath, styleSheet, 'utf-8');
|
|
11
|
+
if (process.argv.includes('--log'))
|
|
12
|
+
console.log(message + styleSheet);
|
|
17
13
|
}
|
|
18
14
|
return;
|
|
19
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zss-engine",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"description": "Zero-runtime Style Sheet Engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zero-runtime",
|
|
@@ -27,9 +27,10 @@
|
|
|
27
27
|
"dist/"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
-
"build": "rimraf dist && pnpm esm && pnpm cjs",
|
|
30
|
+
"build": "rimraf dist && pnpm esm && pnpm cjs && pnpm use:remove",
|
|
31
31
|
"cjs": "tsc --project tsconfig.cjs.json",
|
|
32
32
|
"esm": "tsc --project tsconfig.esm.json",
|
|
33
|
+
"use:remove": "node ./use-directive.mjs",
|
|
33
34
|
"test": "jest"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|