sommark 5.0.0 → 5.0.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.
package/README.md CHANGED
@@ -418,7 +418,7 @@ export default {
418
418
  removeComments: true,
419
419
  placeholders: {},
420
420
  importAliases: { "@": "./" },
421
- fallbackTarget: "style",
421
+ fallbackTarget: true,
422
422
  outputValidator: null,
423
423
  baseDir: null,
424
424
  showSpinner: true,
@@ -26,7 +26,7 @@ export default {
26
26
  importAliases: { // Custom path aliases for modules (e.g. { "@": "./src/components" })
27
27
  "@": "./"
28
28
  },
29
- fallbackTarget: "style", // Where unrecognized attributes go: "style", "class", or false to disable
29
+ fallbackTarget: true, // Enable style fallback for unrecognized attributes (true or false)
30
30
  outputValidator: null, // Custom callback function: async (transpiledOutput) => { ... }
31
31
  baseDir: null, // Base directory for resolving relative module imports
32
32
  showSpinner: true, // Display a dynamic spinner in the terminal during transpilation
@@ -150,10 +150,6 @@ export const HTML_PROPS = new Set([
150
150
  "optimum",
151
151
 
152
152
  // Deprecated (still valid)
153
- "align",
154
- "bgcolor",
155
- "border",
156
- "color",
157
153
  "coords",
158
154
  "shape",
159
155
  "summary",
@@ -161,6 +157,5 @@ export const HTML_PROPS = new Set([
161
157
  // Experimental
162
158
  "elementtiming",
163
159
  "colorspace",
164
- "alpha",
165
160
  "csp",
166
161
  ]);
@@ -83,7 +83,7 @@ export async function findAndLoadConfig(targetPath) {
83
83
  placeholders: {},
84
84
  customProps: [],
85
85
  importAliases: {},
86
- fallbackTarget: "style",
86
+ fallbackTarget: true,
87
87
  outputValidator: null,
88
88
  baseDir: null,
89
89
  showSpinner: true,
@@ -18,7 +18,7 @@ export function registerHostSettings(settings) {
18
18
  hostSettings = settings || {};
19
19
  }
20
20
 
21
- const version = "5.0.0";
21
+ const version = "5.0.1";
22
22
 
23
23
  const SomMark = {
24
24
  version,
@@ -8587,7 +8587,7 @@ function registerHostSettings(settings) {
8587
8587
  hostSettings = settings || {};
8588
8588
  }
8589
8589
 
8590
- const version = "5.0.0";
8590
+ const version = "5.0.1";
8591
8591
 
8592
8592
  const SomMark$1 = {
8593
8593
  version,
@@ -10794,10 +10794,6 @@ const HTML_PROPS = new Set([
10794
10794
  "optimum",
10795
10795
 
10796
10796
  // Deprecated (still valid)
10797
- "align",
10798
- "bgcolor",
10799
- "border",
10800
- "color",
10801
10797
  "coords",
10802
10798
  "shape",
10803
10799
  "summary",
@@ -10805,7 +10801,6 @@ const HTML_PROPS = new Set([
10805
10801
  // Experimental
10806
10802
  "elementtiming",
10807
10803
  "colorspace",
10808
- "alpha",
10809
10804
  "csp",
10810
10805
  ]);
10811
10806
 
@@ -13908,7 +13903,7 @@ class SomMark {
13908
13903
  * @param {string} [options.baseDir=null] - The base directory for resolving relative paths.
13909
13904
  */
13910
13905
  constructor(options = {}) {
13911
- const { src, ast = null, format, mapperFile = null, filename = "anonymous", removeComments = true, placeholders = {}, customProps = [], fallbackTarget = "style", outputValidator = null, importAliases = {}, importStack = [], baseDir = null, moduleCache = null, showSpinner = true, security = {}, dualOutput = false, moduleIdentityToken = null } = options;
13906
+ const { src, ast = null, format, mapperFile = null, filename = "anonymous", removeComments = true, placeholders = {}, customProps = [], fallbackTarget = true, outputValidator = null, importAliases = {}, importStack = [], baseDir = null, moduleCache = null, showSpinner = true, security = {}, dualOutput = false, moduleIdentityToken = null } = options;
13912
13907
  this.rawSettings = options;
13913
13908
  this.src = src;
13914
13909
  this.ast = ast;
@@ -13924,15 +13919,15 @@ class SomMark {
13924
13919
  || (options.files ? new VirtualFS(options.files) : null)
13925
13920
  || (isURL(options.baseDir) ? new FetchFS(options.baseDir) : defaultFs);
13926
13921
 
13927
- // Validate fallbackTarget
13928
- const VALID_FALLBACK_TARGETS = new Set(["style", "class", false]);
13922
+ // Validate fallbackTarget — "style" is accepted as an alias for true (backward compat)
13923
+ const VALID_FALLBACK_TARGETS = new Set([true, false, "style"]);
13929
13924
  if (!VALID_FALLBACK_TARGETS.has(fallbackTarget)) {
13930
13925
  runtimeError([
13931
13926
  `{line}<$red:Invalid fallbackTarget$>: <$green:'${fallbackTarget}'$> <$yellow:is not a valid value.$>`,
13932
- `{N}<$yellow:Use$> <$green:'style'$><$yellow:,$> <$green:'class'$><$yellow:, or$> <$green:false$><$yellow:.$>{line}`
13927
+ `{N}<$yellow:Use$> <$green:true$> <$yellow:or$> <$green:false$><$yellow:.$>{line}`
13933
13928
  ]);
13934
13929
  }
13935
- this.fallbackTarget = fallbackTarget;
13930
+ this.fallbackTarget = fallbackTarget === "style" ? true : fallbackTarget;
13936
13931
  this.outputValidator = outputValidator;
13937
13932
  this.importAliases = importAliases;
13938
13933
  this.importStack = importStack;
@@ -9703,10 +9703,6 @@ const HTML_PROPS = new Set([
9703
9703
  "optimum",
9704
9704
 
9705
9705
  // Deprecated (still valid)
9706
- "align",
9707
- "bgcolor",
9708
- "border",
9709
- "color",
9710
9706
  "coords",
9711
9707
  "shape",
9712
9708
  "summary",
@@ -9714,7 +9710,6 @@ const HTML_PROPS = new Set([
9714
9710
  // Experimental
9715
9711
  "elementtiming",
9716
9712
  "colorspace",
9717
- "alpha",
9718
9713
  "csp",
9719
9714
  ]);
9720
9715
 
@@ -12817,7 +12812,7 @@ class SomMark {
12817
12812
  * @param {string} [options.baseDir=null] - The base directory for resolving relative paths.
12818
12813
  */
12819
12814
  constructor(options = {}) {
12820
- const { src, ast = null, format, mapperFile = null, filename = "anonymous", removeComments = true, placeholders = {}, customProps = [], fallbackTarget = "style", outputValidator = null, importAliases = {}, importStack = [], baseDir = null, moduleCache = null, showSpinner = true, security = {}, dualOutput = false, moduleIdentityToken = null } = options;
12815
+ const { src, ast = null, format, mapperFile = null, filename = "anonymous", removeComments = true, placeholders = {}, customProps = [], fallbackTarget = true, outputValidator = null, importAliases = {}, importStack = [], baseDir = null, moduleCache = null, showSpinner = true, security = {}, dualOutput = false, moduleIdentityToken = null } = options;
12821
12816
  this.rawSettings = options;
12822
12817
  this.src = src;
12823
12818
  this.ast = ast;
@@ -12833,15 +12828,15 @@ class SomMark {
12833
12828
  || (options.files ? new VirtualFS(options.files) : null)
12834
12829
  || (isURL(options.baseDir) ? new FetchFS(options.baseDir) : defaultFs);
12835
12830
 
12836
- // Validate fallbackTarget
12837
- const VALID_FALLBACK_TARGETS = new Set(["style", "class", false]);
12831
+ // Validate fallbackTarget — "style" is accepted as an alias for true (backward compat)
12832
+ const VALID_FALLBACK_TARGETS = new Set([true, false, "style"]);
12838
12833
  if (!VALID_FALLBACK_TARGETS.has(fallbackTarget)) {
12839
12834
  runtimeError([
12840
12835
  `{line}<$red:Invalid fallbackTarget$>: <$green:'${fallbackTarget}'$> <$yellow:is not a valid value.$>`,
12841
- `{N}<$yellow:Use$> <$green:'style'$><$yellow:,$> <$green:'class'$><$yellow:, or$> <$green:false$><$yellow:.$>{line}`
12836
+ `{N}<$yellow:Use$> <$green:true$> <$yellow:or$> <$green:false$><$yellow:.$>{line}`
12842
12837
  ]);
12843
12838
  }
12844
- this.fallbackTarget = fallbackTarget;
12839
+ this.fallbackTarget = fallbackTarget === "style" ? true : fallbackTarget;
12845
12840
  this.outputValidator = outputValidator;
12846
12841
  this.importAliases = importAliases;
12847
12842
  this.importStack = importStack;
package/index.shared.js CHANGED
@@ -74,7 +74,7 @@ class SomMark {
74
74
  * @param {string} [options.baseDir=null] - The base directory for resolving relative paths.
75
75
  */
76
76
  constructor(options = {}) {
77
- const { src, ast = null, format, mapperFile = null, filename = "anonymous", removeComments = true, placeholders = {}, customProps = [], fallbackTarget = "style", outputValidator = null, importAliases = {}, importStack = [], baseDir = null, moduleCache = null, showSpinner = true, security = {}, dualOutput = false, moduleIdentityToken = null } = options;
77
+ const { src, ast = null, format, mapperFile = null, filename = "anonymous", removeComments = true, placeholders = {}, customProps = [], fallbackTarget = true, outputValidator = null, importAliases = {}, importStack = [], baseDir = null, moduleCache = null, showSpinner = true, security = {}, dualOutput = false, moduleIdentityToken = null } = options;
78
78
  this.rawSettings = options;
79
79
  this.src = src;
80
80
  this.ast = ast;
@@ -90,15 +90,15 @@ class SomMark {
90
90
  || (options.files ? new VirtualFS(options.files) : null)
91
91
  || (isURL(options.baseDir) ? new FetchFS(options.baseDir) : defaultFs);
92
92
 
93
- // Validate fallbackTarget
94
- const VALID_FALLBACK_TARGETS = new Set(["style", "class", false]);
93
+ // Validate fallbackTarget — "style" is accepted as an alias for true (backward compat)
94
+ const VALID_FALLBACK_TARGETS = new Set([true, false, "style"]);
95
95
  if (!VALID_FALLBACK_TARGETS.has(fallbackTarget)) {
96
96
  runtimeError([
97
97
  `{line}<$red:Invalid fallbackTarget$>: <$green:'${fallbackTarget}'$> <$yellow:is not a valid value.$>`,
98
- `{N}<$yellow:Use$> <$green:'style'$><$yellow:,$> <$green:'class'$><$yellow:, or$> <$green:false$><$yellow:.$>{line}`
98
+ `{N}<$yellow:Use$> <$green:true$> <$yellow:or$> <$green:false$><$yellow:.$>{line}`
99
99
  ]);
100
100
  }
101
- this.fallbackTarget = fallbackTarget;
101
+ this.fallbackTarget = fallbackTarget === "style" ? true : fallbackTarget;
102
102
  this.outputValidator = outputValidator;
103
103
  this.importAliases = importAliases;
104
104
  this.importStack = importStack;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sommark",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "SomMark is a template language that compiles to multiple output formats — HTML, JSON, YAML, TOML, CSV, Markdown, XML, and more.",
5
5
  "main": "index.js",
6
6
  "files": [