zss-engine 1.2.1 → 1.2.2
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
CHANGED
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.build = void 0;
|
|
5
5
|
const helper_js_1 = require("./helper.js");
|
|
6
|
-
const build = async (styleSheet, filePath
|
|
6
|
+
const build = async (styleSheet, filePath) => {
|
|
7
7
|
if (!helper_js_1.isServer)
|
|
8
8
|
return;
|
|
9
9
|
const fs = await import('fs');
|
|
10
|
-
const message = global === '--global' ? `defines💫:\n\n` : `props💫:\n\n`;
|
|
11
10
|
try {
|
|
12
11
|
if (fs.existsSync(filePath)) {
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
12
|
+
const css = fs.readFileSync(filePath, 'utf-8');
|
|
13
|
+
if (!css.includes(styleSheet)) {
|
|
15
14
|
fs.appendFileSync(filePath, styleSheet, 'utf-8');
|
|
16
|
-
if (process.argv.includes('--view'))
|
|
17
|
-
|
|
15
|
+
if (process.argv.includes('--view')) {
|
|
16
|
+
const { styleText } = await import('util');
|
|
17
|
+
const line = styleText('gray', '─'.repeat(60));
|
|
18
|
+
console.log('\n' + styleText(['green', 'bold'], '✓ extract...') + '\n\n' + styleText('cyan', styleSheet) + '\n' + line);
|
|
19
|
+
}
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
return;
|
package/dist/esm/utils/build.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
import { isServer } from './helper.js';
|
|
3
|
-
export const build = async (styleSheet, filePath
|
|
3
|
+
export const build = async (styleSheet, filePath) => {
|
|
4
4
|
if (!isServer)
|
|
5
5
|
return;
|
|
6
6
|
const fs = await import('fs');
|
|
7
|
-
const message = global === '--global' ? `defines💫:\n\n` : `props💫:\n\n`;
|
|
8
7
|
try {
|
|
9
8
|
if (fs.existsSync(filePath)) {
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
9
|
+
const css = fs.readFileSync(filePath, 'utf-8');
|
|
10
|
+
if (!css.includes(styleSheet)) {
|
|
12
11
|
fs.appendFileSync(filePath, styleSheet, 'utf-8');
|
|
13
|
-
if (process.argv.includes('--view'))
|
|
14
|
-
|
|
12
|
+
if (process.argv.includes('--view')) {
|
|
13
|
+
const { styleText } = await import('util');
|
|
14
|
+
const line = styleText('gray', '─'.repeat(60));
|
|
15
|
+
console.log('\n' + styleText(['green', 'bold'], '✓ extract...') + '\n\n' + styleText('cyan', styleSheet) + '\n' + line);
|
|
16
|
+
}
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const build: (styleSheet: string, filePath: string
|
|
1
|
+
export declare const build: (styleSheet: string, filePath: string) => Promise<void>;
|