@genexus/mercury 0.13.0 → 0.13.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.
|
@@ -4,7 +4,7 @@ export const ensureDirectoryExistsAndItsClear = (dirPath) => {
|
|
|
4
4
|
if (fs.existsSync(dirPath)) {
|
|
5
5
|
fs.rmSync(dirPath, { recursive: true });
|
|
6
6
|
}
|
|
7
|
-
fs.mkdirSync(dirPath);
|
|
7
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
8
8
|
};
|
|
9
9
|
export function* walkSync(dir) {
|
|
10
10
|
const files = fs.readdirSync(dir, { withFileTypes: true });
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import * as sass from "sass";
|
|
3
4
|
import { BASE_BUNDLE_WITH_BACK_SLASH, BASE_GLOBANT_CSS_FILE, BASE_GLOBANT_FILE, BASE_GLOBANT_JS_FILE, BASE_GLOBANT_SCSS_FILE, BASE_SCSS_FILE, BUNDLE_MAPPING_ENTRIES, BUNDLE_MAPPING_FILE, CSS_BUNDLES_OUT_DIR, DEFAULT_FONT_FACE_PATH, DEFAULT_ICONS_PATH, JS_BUNDLES_OUT_DIR, SCSS_BUNDLES_OUT_DIR } from "./constants.js";
|
|
4
|
-
import { getBundleNameWithoutSpecialChars, replacePlaceholdersInBundle
|
|
5
|
+
import { getBundleNameWithoutSpecialChars, replacePlaceholdersInBundle } from "./utils.js";
|
|
5
6
|
import { printBundleWasTranspiled } from "./print-utils.js";
|
|
7
|
+
const transpileBundle = (filePath, globant) => sass.compile(filePath, {
|
|
8
|
+
loadPaths: [globant ? "src/config/globant" : "src/config/default"],
|
|
9
|
+
style: "compressed"
|
|
10
|
+
}).css;
|
|
6
11
|
const CSS_CREATED_DIRS = new Set();
|
|
7
12
|
const JS_CREATED_DIRS = new Set();
|
|
8
13
|
const BUNDLES = [];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare const getFileSize: (fileContent: string) => string;
|
|
2
|
-
export declare const transpileBundle: (filePath: string, globant: boolean) => string;
|
|
3
2
|
export declare const getHash: (fileContent: string) => string;
|
|
4
3
|
export declare const getBundleNameWithHash: <B extends string, H extends string>(bundleName: B, hash: H) => `${B}-${H}`;
|
|
5
4
|
export declare const replacePlaceholdersInBundle: (transpiledBundle: string, fontFaceValue: string, iconsValue: string) => string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
import { styleText } from "node:util";
|
|
3
|
-
import * as sass from "sass";
|
|
4
3
|
import { FONT_FACE_PATH_PLACEHOLDER, ICONS_PATH_PLACEHOLDER, KB, SPECIAL_CHARS_IN_BUNDLE_NAME_REGEX } from "./constants.js";
|
|
5
4
|
export const getFileSize = (fileContent) => {
|
|
6
5
|
const fileLength = fileContent.length;
|
|
@@ -18,10 +17,6 @@ export const getFileSize = (fileContent) => {
|
|
|
18
17
|
const fileLengthInGB = fileLengthInMB / KB;
|
|
19
18
|
return fileLengthInGB.toFixed(3) + "GB";
|
|
20
19
|
};
|
|
21
|
-
export const transpileBundle = (filePath, globant) => sass.compile(filePath, {
|
|
22
|
-
loadPaths: [globant ? "src/config/globant" : "src/config/default"],
|
|
23
|
-
style: "compressed"
|
|
24
|
-
}).css;
|
|
25
20
|
export const getHash = (fileContent) => crypto.createHash("md5").update(fileContent).digest("hex").substring(16);
|
|
26
21
|
export const getBundleNameWithHash = (bundleName, hash) => `${bundleName}-${hash}`;
|
|
27
22
|
export const replacePlaceholdersInBundle = (transpiledBundle, fontFaceValue, iconsValue) => transpiledBundle
|