@salty-css/core 0.0.1-alpha.310 → 0.0.1-alpha.311

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,83 +0,0 @@
1
- import { createLogger, transports, format } from "winston";
2
- import { getPackageJson } from "./compiler/get-files.js";
3
- const logger = createLogger({
4
- level: "debug",
5
- format: format.combine(format.colorize(), format.cli()),
6
- transports: [new transports.Console({})]
7
- });
8
- const logError = (message) => {
9
- logger.error(message);
10
- };
11
- const readPackageJsonModule = async (dirname) => {
12
- const packageJsonContent = await getPackageJson(dirname);
13
- if (!packageJsonContent) return void 0;
14
- return packageJsonContent.type;
15
- };
16
- let cachedModuleType;
17
- const detectCurrentModuleType = async (dirname) => {
18
- if (cachedModuleType) return cachedModuleType;
19
- const packageJsonModule = await readPackageJsonModule(dirname);
20
- if (packageJsonModule === "module") cachedModuleType = "esm";
21
- else if (packageJsonModule === "commonjs") cachedModuleType = "cjs";
22
- else if (import.meta.url.endsWith(".cjs")) cachedModuleType = "cjs";
23
- return cachedModuleType || "esm";
24
- };
25
- function dotCase(str) {
26
- if (!str) return "";
27
- if (typeof str !== "string") return dotCase(String(str));
28
- return str.replace(/[^\d\w]/g, ".");
29
- }
30
- const saltyReset = {
31
- /** Set box model to border-box */
32
- "*, *::before, *::after": {
33
- boxSizing: "border-box"
34
- },
35
- /** Remove default margin and padding */
36
- "*": {
37
- margin: 0
38
- },
39
- /** Remove adjust font properties */
40
- html: {
41
- lineHeight: 1.15,
42
- textSizeAdjust: "100%",
43
- WebkitFontSmoothing: "antialiased"
44
- },
45
- /** Make media elements responsive */
46
- "img, picture, video, canvas, svg": {
47
- display: "block",
48
- maxWidth: "100%"
49
- },
50
- /** Avoid overflow of text */
51
- "p, h1, h2, h3, h4, h5, h6": {
52
- overflowWrap: "break-word"
53
- },
54
- /** Improve text wrapping */
55
- p: {
56
- textWrap: "pretty"
57
- },
58
- "h1, h2, h3, h4, h5, h6": {
59
- textWrap: "balance"
60
- },
61
- /** Improve link color */
62
- a: {
63
- color: "currentColor"
64
- },
65
- /** Improve button line height */
66
- button: {
67
- lineHeight: "1em",
68
- color: "currentColor"
69
- },
70
- /** Improve form elements */
71
- "input, optgroup, select, textarea": {
72
- fontFamily: "inherit",
73
- fontSize: "100%",
74
- lineHeight: "1.15em"
75
- }
76
- };
77
- export {
78
- dotCase as a,
79
- logError as b,
80
- detectCurrentModuleType as d,
81
- logger as l,
82
- saltyReset as s
83
- };
@@ -1,83 +0,0 @@
1
- "use strict";
2
- const winston = require("winston");
3
- const compiler_getFiles = require("./compiler/get-files.cjs");
4
- var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
5
- const logger = winston.createLogger({
6
- level: "debug",
7
- format: winston.format.combine(winston.format.colorize(), winston.format.cli()),
8
- transports: [new winston.transports.Console({})]
9
- });
10
- const logError = (message) => {
11
- logger.error(message);
12
- };
13
- const readPackageJsonModule = async (dirname) => {
14
- const packageJsonContent = await compiler_getFiles.getPackageJson(dirname);
15
- if (!packageJsonContent) return void 0;
16
- return packageJsonContent.type;
17
- };
18
- let cachedModuleType;
19
- const detectCurrentModuleType = async (dirname) => {
20
- if (cachedModuleType) return cachedModuleType;
21
- const packageJsonModule = await readPackageJsonModule(dirname);
22
- if (packageJsonModule === "module") cachedModuleType = "esm";
23
- else if (packageJsonModule === "commonjs") cachedModuleType = "cjs";
24
- else if ((typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("salty-reset-zWMaTt2Q.cjs", document.baseURI).href).endsWith(".cjs")) cachedModuleType = "cjs";
25
- return cachedModuleType || "esm";
26
- };
27
- function dotCase(str) {
28
- if (!str) return "";
29
- if (typeof str !== "string") return dotCase(String(str));
30
- return str.replace(/[^\d\w]/g, ".");
31
- }
32
- const saltyReset = {
33
- /** Set box model to border-box */
34
- "*, *::before, *::after": {
35
- boxSizing: "border-box"
36
- },
37
- /** Remove default margin and padding */
38
- "*": {
39
- margin: 0
40
- },
41
- /** Remove adjust font properties */
42
- html: {
43
- lineHeight: 1.15,
44
- textSizeAdjust: "100%",
45
- WebkitFontSmoothing: "antialiased"
46
- },
47
- /** Make media elements responsive */
48
- "img, picture, video, canvas, svg": {
49
- display: "block",
50
- maxWidth: "100%"
51
- },
52
- /** Avoid overflow of text */
53
- "p, h1, h2, h3, h4, h5, h6": {
54
- overflowWrap: "break-word"
55
- },
56
- /** Improve text wrapping */
57
- p: {
58
- textWrap: "pretty"
59
- },
60
- "h1, h2, h3, h4, h5, h6": {
61
- textWrap: "balance"
62
- },
63
- /** Improve link color */
64
- a: {
65
- color: "currentColor"
66
- },
67
- /** Improve button line height */
68
- button: {
69
- lineHeight: "1em",
70
- color: "currentColor"
71
- },
72
- /** Improve form elements */
73
- "input, optgroup, select, textarea": {
74
- fontFamily: "inherit",
75
- fontSize: "100%",
76
- lineHeight: "1.15em"
77
- }
78
- };
79
- exports.detectCurrentModuleType = detectCurrentModuleType;
80
- exports.dotCase = dotCase;
81
- exports.logError = logError;
82
- exports.logger = logger;
83
- exports.saltyReset = saltyReset;