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

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.
Files changed (127) hide show
  1. package/.saltyrc.schema.json +48 -0
  2. package/README.md +469 -26
  3. package/bin/index.cjs +3 -1
  4. package/bin/index.js +2 -2
  5. package/bin/main.cjs +449 -8
  6. package/bin/main.js +427 -135
  7. package/cache/resolve-dynamic-config-cache.cjs +13 -0
  8. package/cache/resolve-dynamic-config-cache.d.ts +1 -0
  9. package/cache/resolve-dynamic-config-cache.js +13 -0
  10. package/compiler/as-class.cjs +674 -0
  11. package/compiler/as-class.d.ts +52 -0
  12. package/compiler/as-class.js +657 -0
  13. package/compiler/get-files.cjs +25 -0
  14. package/compiler/get-files.d.ts +3 -0
  15. package/compiler/get-files.js +25 -0
  16. package/compiler/get-function-range.cjs +22 -0
  17. package/compiler/get-function-range.d.ts +1 -0
  18. package/compiler/get-function-range.js +22 -0
  19. package/compiler/helpers.cjs +25 -0
  20. package/compiler/helpers.d.ts +5 -0
  21. package/compiler/helpers.js +24 -0
  22. package/compiler/index.cjs +668 -11
  23. package/compiler/index.d.ts +22 -11
  24. package/compiler/index.js +630 -153
  25. package/config/define-config.d.ts +1 -1
  26. package/config/index.cjs +16 -1
  27. package/config/index.d.ts +2 -1
  28. package/config/index.js +14 -2
  29. package/css/index.cjs +12 -1
  30. package/css/index.d.ts +4 -1
  31. package/css/index.js +10 -2
  32. package/css/keyframes.cjs +49 -0
  33. package/css/keyframes.d.ts +22 -0
  34. package/css/keyframes.js +49 -0
  35. package/css/media.cjs +93 -0
  36. package/css/media.d.ts +87 -0
  37. package/css/media.js +93 -0
  38. package/css/merge.cjs +15 -0
  39. package/css/merge.d.ts +7 -0
  40. package/css/merge.js +15 -0
  41. package/css/token.cjs +4 -0
  42. package/css/token.d.ts +1 -0
  43. package/css/token.js +4 -0
  44. package/define-templates-CVhhgPnd.js +60 -0
  45. package/define-templates-Deq1aCbN.cjs +59 -0
  46. package/factories/define-global-styles.d.ts +7 -0
  47. package/factories/define-media-query.d.ts +8 -0
  48. package/factories/define-templates.d.ts +27 -0
  49. package/factories/define-variables.d.ts +12 -0
  50. package/factories/index.cjs +37 -0
  51. package/factories/index.d.ts +4 -0
  52. package/factories/index.js +37 -0
  53. package/generators/class-name-generator.d.ts +7 -0
  54. package/generators/index.cjs +125 -0
  55. package/generators/index.d.ts +2 -0
  56. package/generators/index.js +125 -0
  57. package/generators/styled-generator.d.ts +20 -0
  58. package/generators/styles-generator.d.ts +22 -0
  59. package/helpers/color.d.ts +18 -0
  60. package/helpers/index.cjs +53 -0
  61. package/helpers/index.d.ts +2 -0
  62. package/helpers/index.js +53 -0
  63. package/helpers/viewport-clamp.d.ts +9 -0
  64. package/index-ByR0nfaf.cjs +4 -0
  65. package/index-DKz1QXqs.js +4 -0
  66. package/package.json +70 -6
  67. package/parse-styles-CS97_e4S.js +232 -0
  68. package/parse-styles-gRr_iCy7.cjs +231 -0
  69. package/parsers/index.cjs +57 -0
  70. package/parsers/index.d.ts +5 -0
  71. package/parsers/index.js +58 -0
  72. package/parsers/parse-modifiers.d.ts +3 -0
  73. package/parsers/parse-styles.d.ts +13 -0
  74. package/parsers/parse-templates.d.ts +4 -0
  75. package/parsers/parse-tokens.d.ts +3 -0
  76. package/parsers/parser-types.d.ts +8 -0
  77. package/parsers/property-name-check.d.ts +1 -0
  78. package/parsers/unit-check.d.ts +7 -0
  79. package/pascal-case-By_l58S-.cjs +7 -0
  80. package/pascal-case-F3Usi5Wf.js +8 -0
  81. package/{react-styled-file-CGVf5n1B.js → react-styled-file-B99mwk0w.js} +2 -2
  82. package/react-styled-file-U02jek-B.cjs +11 -0
  83. package/react-vanilla-file-Bj6XC8GS.cjs +18 -0
  84. package/react-vanilla-file-D9px70iK.js +18 -0
  85. package/salty-reset-D1VR51zL.js +83 -0
  86. package/salty-reset-zWMaTt2Q.cjs +83 -0
  87. package/salty.config-DjosWdPw.js +4 -0
  88. package/salty.config-cqavVm2t.cjs +4 -0
  89. package/server/index.cjs +4 -0
  90. package/server/index.d.ts +1 -0
  91. package/server/index.js +4 -0
  92. package/server/should-restart.d.ts +1 -0
  93. package/should-restart-5jI-bzz0.js +18 -0
  94. package/should-restart-DoaGoD5T.cjs +17 -0
  95. package/templates/salty-reset.d.ts +2 -0
  96. package/to-hash-DSoCPs8D.js +33 -0
  97. package/to-hash-DT2ImSPA.cjs +32 -0
  98. package/types/cli-types.d.ts +10 -0
  99. package/types/config-types.d.ts +85 -0
  100. package/types/index.d.ts +57 -23
  101. package/util/dot-case.d.ts +1 -0
  102. package/util/index.cjs +13 -1
  103. package/util/index.js +10 -8
  104. package/util/module-type.d.ts +1 -0
  105. package/viewport-clamp-CEmzmcSj.cjs +10 -0
  106. package/viewport-clamp-K553uXu3.js +11 -0
  107. package/config/config-types.d.ts +0 -59
  108. package/dash-case-DKzpenwY.cjs +0 -1
  109. package/dash-case-DMQMcCO6.js +0 -19
  110. package/generator/index.cjs +0 -1
  111. package/generator/index.d.ts +0 -1
  112. package/generator/index.js +0 -61
  113. package/generator/parse-modifiers.d.ts +0 -3
  114. package/generator/parse-styles.d.ts +0 -2
  115. package/generator/parse-templates.d.ts +0 -2
  116. package/generator/parse-tokens.d.ts +0 -2
  117. package/generator/parser-types.d.ts +0 -4
  118. package/generator/style-generator.d.ts +0 -28
  119. package/index-84Wroia-.cjs +0 -1
  120. package/index-D_732b92.js +0 -4
  121. package/parse-templates-D4p3pgQR.js +0 -92
  122. package/parse-templates-W0YfTmOT.cjs +0 -8
  123. package/pascal-case-BQpR5PdN.js +0 -6
  124. package/pascal-case-iWoaJWwT.cjs +0 -1
  125. package/react-styled-file-Dkubsz-U.cjs +0 -8
  126. package/salty.config-BupieCfE.cjs +0 -6
  127. package/salty.config-D9ANEDiH.js +0 -9
@@ -0,0 +1,52 @@
1
+ export declare class SaltyCompiler {
2
+ projectRootDir: string;
3
+ importFile: (path: string) => Promise<any>;
4
+ private cache;
5
+ constructor(projectRootDir: string);
6
+ private get isProduction();
7
+ /**
8
+ * Locate and read the .saltyrc.json file starting from the current directory and moving up the directory tree.
9
+ * Caches the result to avoid redundant file reads.
10
+ */
11
+ private readRCFile;
12
+ /**
13
+ * Get the project configuration from the .saltyrc.json file based on the current directory.
14
+ * If no specific project configuration is found, it falls back to the default project.
15
+ */
16
+ private getRCProjectConfig;
17
+ private getExternalModules;
18
+ /**
19
+ * Get the destination directory for generated files based on the project configuration.
20
+ * Caches the result to avoid redundant computations.
21
+ */
22
+ private getDestDir;
23
+ private generateConfig;
24
+ private addConfigCache;
25
+ private getConfigCache;
26
+ private getConfig;
27
+ /**
28
+ * Generate CSS files based on the Salty CSS configuration and source files.
29
+ */
30
+ generateCss: (clean?: boolean) => Promise<void>;
31
+ private generateConfigStyles;
32
+ compileSaltyFile: (sourceFilePath: string, outputDirectory: string) => Promise<{
33
+ contents: {
34
+ [key: string]: {
35
+ generator: any;
36
+ isClassName?: boolean;
37
+ isMedia?: boolean;
38
+ isGlobalDefine?: boolean;
39
+ isDefineVariables?: boolean;
40
+ isDefineTemplates?: boolean;
41
+ isKeyframes?: boolean;
42
+ animationName?: string;
43
+ css?: Promise<string>;
44
+ styles?: any;
45
+ };
46
+ };
47
+ outputFilePath: string;
48
+ }>;
49
+ minimizeFile: (file: string) => Promise<string | undefined>;
50
+ generateFile: (file: string) => Promise<void>;
51
+ private replaceStyledTag;
52
+ }