polytypo 1.1.0 → 1.3.0

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 (83) hide show
  1. package/README.md +62 -5
  2. package/dist/chunk-442V6TKI.cjs +31 -0
  3. package/dist/chunk-442V6TKI.cjs.map +1 -0
  4. package/dist/chunk-72GQS2N7.cjs +147 -0
  5. package/dist/chunk-72GQS2N7.cjs.map +1 -0
  6. package/dist/chunk-7S5PZ7T5.cjs +205 -0
  7. package/dist/chunk-7S5PZ7T5.cjs.map +1 -0
  8. package/dist/chunk-7ZJ7YYTQ.js +264 -0
  9. package/dist/chunk-7ZJ7YYTQ.js.map +1 -0
  10. package/dist/chunk-A3VCFDVL.cjs +264 -0
  11. package/dist/chunk-A3VCFDVL.cjs.map +1 -0
  12. package/dist/{chunk-4FZZJB7Y.js → chunk-B3I7VL5E.js} +2 -2
  13. package/dist/chunk-DAUTLRFG.js +33 -0
  14. package/dist/chunk-DAUTLRFG.js.map +1 -0
  15. package/dist/chunk-GLQQOA6T.js +5778 -0
  16. package/dist/chunk-GLQQOA6T.js.map +1 -0
  17. package/dist/{chunk-5BVKKURT.cjs → chunk-KRY73ZPE.cjs} +40 -16
  18. package/dist/chunk-KRY73ZPE.cjs.map +1 -0
  19. package/dist/{chunk-CZRTSOOB.cjs → chunk-M7YWQ47K.cjs} +3 -3
  20. package/dist/{chunk-CZRTSOOB.cjs.map → chunk-M7YWQ47K.cjs.map} +1 -1
  21. package/dist/{chunk-ZBLCAVSM.js → chunk-NT2RADO3.js} +4 -154
  22. package/dist/chunk-NT2RADO3.js.map +1 -0
  23. package/dist/chunk-PLWW5KPC.js +205 -0
  24. package/dist/chunk-PLWW5KPC.js.map +1 -0
  25. package/dist/{chunk-X2B4LIW3.js → chunk-PNX4XW5I.js} +35 -11
  26. package/dist/chunk-PNX4XW5I.js.map +1 -0
  27. package/dist/chunk-QLV5EWGF.cjs +33 -0
  28. package/dist/chunk-QLV5EWGF.cjs.map +1 -0
  29. package/dist/chunk-W3XMTX7Q.js +31 -0
  30. package/dist/chunk-W3XMTX7Q.js.map +1 -0
  31. package/dist/chunk-YX6QTWOV.cjs +5778 -0
  32. package/dist/chunk-YX6QTWOV.cjs.map +1 -0
  33. package/dist/{errors-joZChNws.d.ts → errors-CGFOVO3h.d.cts} +34 -4
  34. package/dist/{errors-joZChNws.d.cts → errors-CGFOVO3h.d.ts} +34 -4
  35. package/dist/html.cjs +15 -7
  36. package/dist/html.cjs.map +1 -1
  37. package/dist/html.d.cts +9 -3
  38. package/dist/html.d.ts +9 -3
  39. package/dist/html.js +12 -4
  40. package/dist/html.js.map +1 -1
  41. package/dist/index.cjs +33 -12
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +14 -3
  44. package/dist/index.d.ts +14 -3
  45. package/dist/index.js +28 -7
  46. package/dist/index.js.map +1 -1
  47. package/dist/markdown.cjs +15 -7
  48. package/dist/markdown.cjs.map +1 -1
  49. package/dist/markdown.d.cts +9 -3
  50. package/dist/markdown.d.ts +9 -3
  51. package/dist/markdown.js +12 -4
  52. package/dist/markdown.js.map +1 -1
  53. package/dist/text.cjs +13 -6
  54. package/dist/text.cjs.map +1 -1
  55. package/dist/text.d.cts +8 -3
  56. package/dist/text.d.ts +8 -3
  57. package/dist/text.js +10 -3
  58. package/dist/text.js.map +1 -1
  59. package/dist/yaml.cjs +29 -0
  60. package/dist/yaml.cjs.map +1 -0
  61. package/dist/yaml.d.cts +27 -0
  62. package/dist/yaml.d.ts +27 -0
  63. package/dist/yaml.js +29 -0
  64. package/dist/yaml.js.map +1 -0
  65. package/package.json +12 -2
  66. package/dist/chunk-3XRMEZDM.js +0 -5620
  67. package/dist/chunk-3XRMEZDM.js.map +0 -1
  68. package/dist/chunk-5BVKKURT.cjs.map +0 -1
  69. package/dist/chunk-A4HNRHBV.cjs +0 -19
  70. package/dist/chunk-A4HNRHBV.cjs.map +0 -1
  71. package/dist/chunk-ADRRRKLB.cjs +0 -5620
  72. package/dist/chunk-ADRRRKLB.cjs.map +0 -1
  73. package/dist/chunk-EWZWHW3B.js +0 -21
  74. package/dist/chunk-EWZWHW3B.js.map +0 -1
  75. package/dist/chunk-ILWDO7FZ.js +0 -19
  76. package/dist/chunk-ILWDO7FZ.js.map +0 -1
  77. package/dist/chunk-IS7WKMGA.cjs +0 -21
  78. package/dist/chunk-IS7WKMGA.cjs.map +0 -1
  79. package/dist/chunk-RNFW7474.cjs +0 -297
  80. package/dist/chunk-RNFW7474.cjs.map +0 -1
  81. package/dist/chunk-X2B4LIW3.js.map +0 -1
  82. package/dist/chunk-ZBLCAVSM.js.map +0 -1
  83. /package/dist/{chunk-4FZZJB7Y.js.map → chunk-B3I7VL5E.js.map} +0 -0
package/dist/markdown.js CHANGED
@@ -1,13 +1,15 @@
1
1
  import {
2
+ analyzeMarkdownPipeline,
2
3
  runMarkdownPipeline
3
- } from "./chunk-X2B4LIW3.js";
4
- import "./chunk-ZBLCAVSM.js";
4
+ } from "./chunk-PNX4XW5I.js";
5
+ import "./chunk-NT2RADO3.js";
6
+ import "./chunk-PLWW5KPC.js";
5
7
  import {
6
8
  assertFixedMode
7
- } from "./chunk-4FZZJB7Y.js";
9
+ } from "./chunk-B3I7VL5E.js";
8
10
  import {
9
11
  PolytypoError
10
- } from "./chunk-3XRMEZDM.js";
12
+ } from "./chunk-GLQQOA6T.js";
11
13
 
12
14
  // src/index.markdown.ts
13
15
  function transform(input, options) {
@@ -15,8 +17,14 @@ function transform(input, options) {
15
17
  assertFixedMode(given.mode, "markdown", "polytypo/markdown");
16
18
  return runMarkdownPipeline(input, given);
17
19
  }
20
+ function analyze(input, options) {
21
+ const given = options ?? {};
22
+ assertFixedMode(given.mode, "markdown", "polytypo/markdown");
23
+ return analyzeMarkdownPipeline(input, given);
24
+ }
18
25
  export {
19
26
  PolytypoError,
27
+ analyze,
20
28
  transform
21
29
  };
22
30
  //# sourceMappingURL=markdown.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.markdown.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { runMarkdownPipeline } from \"./engine/markdown-pipeline.js\";\nimport type { Dialect, Options } from \"./types.js\";\n\n/**\n * `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX\n * stack and `parse5` (the latter via `./modes/markdown.js` importing `./modes/html.js` for\n * normative embedded-HTML handling, modes.md 3.7) — both are legitimately reachable here\n * (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1). It imports `./engine/markdown-pipeline.js`\n * directly and never `./engine/pipeline.js`.\n *\n * `mode` is absent from `MarkdownOptions`, since this entry only ever runs `markdown` mode.\n * `dialect` keeps the aggregate entry's contract: required, no default (types.ts).\n */\nexport type MarkdownOptions = Omit<Options, \"mode\"> & {\n dialect: Dialect;\n};\n\nexport function transform(input: string, options: MarkdownOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"markdown\", \"polytypo/markdown\");\n return runMarkdownPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type {\n Dialect,\n LocaleData,\n LocaleSource,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;AAkBO,SAAS,UAAU,OAAe,SAAkC;AACzE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,YAAY,mBAAmB;AAC3D,SAAO,oBAAoB,OAAO,KAAK;AACzC;","names":[]}
1
+ {"version":3,"sources":["../src/index.markdown.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./engine/markdown-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Dialect, Options } from \"./types.js\";\n\n/**\n * `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX\n * stack and `parse5` (the latter via `./modes/markdown.js` importing `./modes/html.js` for\n * normative embedded-HTML handling, modes.md 3.7) — both are legitimately reachable here\n * (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1). It imports `./engine/markdown-pipeline.js`\n * directly and never `./engine/pipeline.js`.\n *\n * `mode` is absent from `MarkdownOptions`, since this entry only ever runs `markdown` mode.\n * `dialect` keeps the aggregate entry's contract: required, no default (types.ts).\n */\nexport type MarkdownOptions = Omit<Options, \"mode\"> & {\n dialect: Dialect;\n};\n\nexport function transform(input: string, options: MarkdownOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"markdown\", \"polytypo/markdown\");\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` — into the document,\n * not into a span (analyze.md §6).\n */\nexport function analyze(input: string, options: MarkdownOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"markdown\", \"polytypo/markdown\");\n return analyzeMarkdownPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type {\n Dialect,\n LocaleData,\n LocaleSource,\n NarrowNbsp,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;;AAmBO,SAAS,UAAU,OAAe,SAAkC;AACzE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,YAAY,mBAAmB;AAC3D,SAAO,oBAAoB,OAAO,KAAK;AACzC;AAOO,SAAS,QAAQ,OAAe,SAAoC;AACzE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,YAAY,mBAAmB;AAC3D,SAAO,wBAAwB,OAAO,KAAK;AAC7C;","names":[]}
package/dist/text.cjs CHANGED
@@ -1,21 +1,28 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkA4HNRHBVcjs = require('./chunk-A4HNRHBV.cjs');
4
3
 
4
+ var _chunk442V6TKIcjs = require('./chunk-442V6TKI.cjs');
5
5
 
6
- var _chunkCZRTSOOBcjs = require('./chunk-CZRTSOOB.cjs');
7
6
 
7
+ var _chunkM7YWQ47Kcjs = require('./chunk-M7YWQ47K.cjs');
8
8
 
9
- var _chunkADRRRKLBcjs = require('./chunk-ADRRRKLB.cjs');
9
+
10
+ var _chunkYX6QTWOVcjs = require('./chunk-YX6QTWOV.cjs');
10
11
 
11
12
  // src/index.text.ts
12
13
  function transform(input, options) {
13
14
  const given = _nullishCoalesce(options, () => ( {}));
14
- _chunkCZRTSOOBcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
15
- return _chunkA4HNRHBVcjs.runTextPipeline.call(void 0, input, given);
15
+ _chunkM7YWQ47Kcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
16
+ return _chunk442V6TKIcjs.runTextPipeline.call(void 0, input, given);
17
+ }
18
+ function analyze(input, options) {
19
+ const given = _nullishCoalesce(options, () => ( {}));
20
+ _chunkM7YWQ47Kcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
21
+ return _chunk442V6TKIcjs.analyzeTextPipeline.call(void 0, input, given);
16
22
  }
17
23
 
18
24
 
19
25
 
20
- exports.PolytypoError = _chunkADRRRKLBcjs.PolytypoError; exports.transform = transform;
26
+
27
+ exports.PolytypoError = _chunkYX6QTWOVcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
21
28
  //# sourceMappingURL=text.cjs.map
package/dist/text.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/text.cjs","../src/index.text.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACMO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAA8B;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACrC;ADJA;AACE;AACA;AACF,uFAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/text.cjs","sourcesContent":[null,"import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { runTextPipeline } from \"./engine/text-pipeline.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the\n * Micromark/MDX stack entirely (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/text-pipeline.js` directly and never `./engine/pipeline.js`, `./modes/html.js` or\n * `./modes/markdown.js`.\n *\n * `mode` is absent from `TextOptions`, since this entry only ever runs `text` mode. `dialect` is\n * likewise absent — it has no effect in `text` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type TextOptions = Omit<Options, \"mode\" | \"dialect\">;\n\nexport function transform(input: string, options: TextOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return runTextPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"]}
1
+ {"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/text.cjs","../src/index.text.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACMO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAA8B;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACrC;AAMO,SAAS,OAAA,CAAQ,KAAA,EAAe,OAAA,EAAgC;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AACzC;ADTA;AACE;AACA;AACA;AACF,kHAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/text.cjs","sourcesContent":[null,"import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./engine/text-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the\n * Micromark/MDX stack entirely (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/text-pipeline.js` directly and never `./engine/pipeline.js`, `./modes/html.js` or\n * `./modes/markdown.js`.\n *\n * `mode` is absent from `TextOptions`, since this entry only ever runs `text` mode. `dialect` is\n * likewise absent — it has no effect in `text` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type TextOptions = Omit<Options, \"mode\" | \"dialect\">;\n\nexport function transform(input: string, options: TextOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return runTextPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`.\n */\nexport function analyze(input: string, options: TextOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return analyzeTextPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"]}
package/dist/text.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as Options } from './errors-joZChNws.cjs';
2
- export { L as LocaleData, a as LocaleSource, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-joZChNws.cjs';
1
+ import { O as Options, C as Change } from './errors-CGFOVO3h.cjs';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CGFOVO3h.cjs';
3
3
 
4
4
  /**
5
5
  * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the
@@ -13,5 +13,10 @@ export { L as LocaleData, a as LocaleSource, P as PolytypoError, b as PolytypoEr
13
13
  */
14
14
  type TextOptions = Omit<Options, "mode" | "dialect">;
15
15
  declare function transform(input: string, options: TextOptions): string;
16
+ /**
17
+ * The same pipeline as this entry's `transform`, reporting instead of applying
18
+ * (spec/rules/analyze.md). Offsets are code-point offsets into `input`.
19
+ */
20
+ declare function analyze(input: string, options: TextOptions): Change[];
16
21
 
17
- export { type TextOptions, transform };
22
+ export { Change, type TextOptions, analyze, transform };
package/dist/text.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as Options } from './errors-joZChNws.js';
2
- export { L as LocaleData, a as LocaleSource, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-joZChNws.js';
1
+ import { O as Options, C as Change } from './errors-CGFOVO3h.js';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CGFOVO3h.js';
3
3
 
4
4
  /**
5
5
  * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the
@@ -13,5 +13,10 @@ export { L as LocaleData, a as LocaleSource, P as PolytypoError, b as PolytypoEr
13
13
  */
14
14
  type TextOptions = Omit<Options, "mode" | "dialect">;
15
15
  declare function transform(input: string, options: TextOptions): string;
16
+ /**
17
+ * The same pipeline as this entry's `transform`, reporting instead of applying
18
+ * (spec/rules/analyze.md). Offsets are code-point offsets into `input`.
19
+ */
20
+ declare function analyze(input: string, options: TextOptions): Change[];
16
21
 
17
- export { type TextOptions, transform };
22
+ export { Change, type TextOptions, analyze, transform };
package/dist/text.js CHANGED
@@ -1,12 +1,13 @@
1
1
  import {
2
+ analyzeTextPipeline,
2
3
  runTextPipeline
3
- } from "./chunk-ILWDO7FZ.js";
4
+ } from "./chunk-W3XMTX7Q.js";
4
5
  import {
5
6
  assertFixedMode
6
- } from "./chunk-4FZZJB7Y.js";
7
+ } from "./chunk-B3I7VL5E.js";
7
8
  import {
8
9
  PolytypoError
9
- } from "./chunk-3XRMEZDM.js";
10
+ } from "./chunk-GLQQOA6T.js";
10
11
 
11
12
  // src/index.text.ts
12
13
  function transform(input, options) {
@@ -14,8 +15,14 @@ function transform(input, options) {
14
15
  assertFixedMode(given.mode, "text", "polytypo/text");
15
16
  return runTextPipeline(input, given);
16
17
  }
18
+ function analyze(input, options) {
19
+ const given = options ?? {};
20
+ assertFixedMode(given.mode, "text", "polytypo/text");
21
+ return analyzeTextPipeline(input, given);
22
+ }
17
23
  export {
18
24
  PolytypoError,
25
+ analyze,
19
26
  transform
20
27
  };
21
28
  //# sourceMappingURL=text.js.map
package/dist/text.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.text.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { runTextPipeline } from \"./engine/text-pipeline.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the\n * Micromark/MDX stack entirely (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/text-pipeline.js` directly and never `./engine/pipeline.js`, `./modes/html.js` or\n * `./modes/markdown.js`.\n *\n * `mode` is absent from `TextOptions`, since this entry only ever runs `text` mode. `dialect` is\n * likewise absent — it has no effect in `text` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type TextOptions = Omit<Options, \"mode\" | \"dialect\">;\n\nexport function transform(input: string, options: TextOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return runTextPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":";;;;;;;;;;;AAgBO,SAAS,UAAU,OAAe,SAA8B;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,gBAAgB,OAAO,KAAK;AACrC;","names":[]}
1
+ {"version":3,"sources":["../src/index.text.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./engine/text-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the\n * Micromark/MDX stack entirely (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/text-pipeline.js` directly and never `./engine/pipeline.js`, `./modes/html.js` or\n * `./modes/markdown.js`.\n *\n * `mode` is absent from `TextOptions`, since this entry only ever runs `text` mode. `dialect` is\n * likewise absent — it has no effect in `text` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type TextOptions = Omit<Options, \"mode\" | \"dialect\">;\n\nexport function transform(input: string, options: TextOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return runTextPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`.\n */\nexport function analyze(input: string, options: TextOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return analyzeTextPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;AAiBO,SAAS,UAAU,OAAe,SAA8B;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,gBAAgB,OAAO,KAAK;AACrC;AAMO,SAAS,QAAQ,OAAe,SAAgC;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,oBAAoB,OAAO,KAAK;AACzC;","names":[]}
package/dist/yaml.cjs ADDED
@@ -0,0 +1,29 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
+
3
+
4
+ var _chunkA3VCFDVLcjs = require('./chunk-A3VCFDVL.cjs');
5
+ require('./chunk-7S5PZ7T5.cjs');
6
+
7
+
8
+ var _chunkM7YWQ47Kcjs = require('./chunk-M7YWQ47K.cjs');
9
+
10
+
11
+ var _chunkYX6QTWOVcjs = require('./chunk-YX6QTWOV.cjs');
12
+
13
+ // src/index.yaml.ts
14
+ function transform(input, options) {
15
+ const given = _nullishCoalesce(options, () => ( {}));
16
+ _chunkM7YWQ47Kcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
17
+ return _chunkA3VCFDVLcjs.runYamlPipeline.call(void 0, input, given);
18
+ }
19
+ function analyze(input, options) {
20
+ const given = _nullishCoalesce(options, () => ( {}));
21
+ _chunkM7YWQ47Kcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
22
+ return _chunkA3VCFDVLcjs.analyzeYamlPipeline.call(void 0, input, given);
23
+ }
24
+
25
+
26
+
27
+
28
+ exports.PolytypoError = _chunkYX6QTWOVcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
29
+ //# sourceMappingURL=yaml.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/yaml.cjs","../src/index.yaml.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACUO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAA8B;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACrC;AAMO,SAAS,OAAA,CAAQ,KAAA,EAAe,OAAA,EAAgC;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AACzC;ADbA;AACE;AACA;AACA;AACF,kHAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/yaml.cjs","sourcesContent":[null,"import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./engine/yaml-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no\n * parser at all (spec/rules/modes.md 3.8.1), so this entry's module graph excludes `parse5` and\n * the Micromark/MDX stack for the same reason `polytypo/text` does — it has nothing to import.\n * `scripts/check-entry-reach.mjs` asserts that against the real module graph, which is what\n * turns \"parser-free\" from a claim in the spec into a fact this package can be held to.\n *\n * `mode` is absent from `YamlOptions`, since this entry only ever runs `yaml` mode. `dialect` is\n * likewise absent — it belongs to `markdown` alone (types.ts). `keys` goes the other way: it is\n * optional on the aggregate `Options` because the other three modes ignore it, and **required**\n * here, where the mode is fixed and the option always applies.\n */\nexport type YamlOptions = Omit<Options, \"mode\" | \"dialect\" | \"keys\"> & {\n /** Required here, with no default — modes.md §3.8.2. An empty list processes nothing. */\n readonly keys: readonly string[];\n};\n\nexport function transform(input: string, options: YamlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"yaml\", \"polytypo/yaml\");\n return runYamlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`, not into a span.\n */\nexport function analyze(input: string, options: YamlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"yaml\", \"polytypo/yaml\");\n return analyzeYamlPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"]}
@@ -0,0 +1,27 @@
1
+ import { O as Options, C as Change } from './errors-CGFOVO3h.cjs';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CGFOVO3h.cjs';
3
+
4
+ /**
5
+ * `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no
6
+ * parser at all (spec/rules/modes.md 3.8.1), so this entry's module graph excludes `parse5` and
7
+ * the Micromark/MDX stack for the same reason `polytypo/text` does — it has nothing to import.
8
+ * `scripts/check-entry-reach.mjs` asserts that against the real module graph, which is what
9
+ * turns "parser-free" from a claim in the spec into a fact this package can be held to.
10
+ *
11
+ * `mode` is absent from `YamlOptions`, since this entry only ever runs `yaml` mode. `dialect` is
12
+ * likewise absent — it belongs to `markdown` alone (types.ts). `keys` goes the other way: it is
13
+ * optional on the aggregate `Options` because the other three modes ignore it, and **required**
14
+ * here, where the mode is fixed and the option always applies.
15
+ */
16
+ type YamlOptions = Omit<Options, "mode" | "dialect" | "keys"> & {
17
+ /** Required here, with no default — modes.md §3.8.2. An empty list processes nothing. */
18
+ readonly keys: readonly string[];
19
+ };
20
+ declare function transform(input: string, options: YamlOptions): string;
21
+ /**
22
+ * The same pipeline as this entry's `transform`, reporting instead of applying
23
+ * (spec/rules/analyze.md). Offsets are code-point offsets into `input`, not into a span.
24
+ */
25
+ declare function analyze(input: string, options: YamlOptions): Change[];
26
+
27
+ export { Change, type YamlOptions, analyze, transform };
package/dist/yaml.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ import { O as Options, C as Change } from './errors-CGFOVO3h.js';
2
+ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-CGFOVO3h.js';
3
+
4
+ /**
5
+ * `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no
6
+ * parser at all (spec/rules/modes.md 3.8.1), so this entry's module graph excludes `parse5` and
7
+ * the Micromark/MDX stack for the same reason `polytypo/text` does — it has nothing to import.
8
+ * `scripts/check-entry-reach.mjs` asserts that against the real module graph, which is what
9
+ * turns "parser-free" from a claim in the spec into a fact this package can be held to.
10
+ *
11
+ * `mode` is absent from `YamlOptions`, since this entry only ever runs `yaml` mode. `dialect` is
12
+ * likewise absent — it belongs to `markdown` alone (types.ts). `keys` goes the other way: it is
13
+ * optional on the aggregate `Options` because the other three modes ignore it, and **required**
14
+ * here, where the mode is fixed and the option always applies.
15
+ */
16
+ type YamlOptions = Omit<Options, "mode" | "dialect" | "keys"> & {
17
+ /** Required here, with no default — modes.md §3.8.2. An empty list processes nothing. */
18
+ readonly keys: readonly string[];
19
+ };
20
+ declare function transform(input: string, options: YamlOptions): string;
21
+ /**
22
+ * The same pipeline as this entry's `transform`, reporting instead of applying
23
+ * (spec/rules/analyze.md). Offsets are code-point offsets into `input`, not into a span.
24
+ */
25
+ declare function analyze(input: string, options: YamlOptions): Change[];
26
+
27
+ export { Change, type YamlOptions, analyze, transform };
package/dist/yaml.js ADDED
@@ -0,0 +1,29 @@
1
+ import {
2
+ analyzeYamlPipeline,
3
+ runYamlPipeline
4
+ } from "./chunk-7ZJ7YYTQ.js";
5
+ import "./chunk-PLWW5KPC.js";
6
+ import {
7
+ assertFixedMode
8
+ } from "./chunk-B3I7VL5E.js";
9
+ import {
10
+ PolytypoError
11
+ } from "./chunk-GLQQOA6T.js";
12
+
13
+ // src/index.yaml.ts
14
+ function transform(input, options) {
15
+ const given = options ?? {};
16
+ assertFixedMode(given.mode, "yaml", "polytypo/yaml");
17
+ return runYamlPipeline(input, given);
18
+ }
19
+ function analyze(input, options) {
20
+ const given = options ?? {};
21
+ assertFixedMode(given.mode, "yaml", "polytypo/yaml");
22
+ return analyzeYamlPipeline(input, given);
23
+ }
24
+ export {
25
+ PolytypoError,
26
+ analyze,
27
+ transform
28
+ };
29
+ //# sourceMappingURL=yaml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.yaml.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./engine/yaml-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no\n * parser at all (spec/rules/modes.md 3.8.1), so this entry's module graph excludes `parse5` and\n * the Micromark/MDX stack for the same reason `polytypo/text` does — it has nothing to import.\n * `scripts/check-entry-reach.mjs` asserts that against the real module graph, which is what\n * turns \"parser-free\" from a claim in the spec into a fact this package can be held to.\n *\n * `mode` is absent from `YamlOptions`, since this entry only ever runs `yaml` mode. `dialect` is\n * likewise absent — it belongs to `markdown` alone (types.ts). `keys` goes the other way: it is\n * optional on the aggregate `Options` because the other three modes ignore it, and **required**\n * here, where the mode is fixed and the option always applies.\n */\nexport type YamlOptions = Omit<Options, \"mode\" | \"dialect\" | \"keys\"> & {\n /** Required here, with no default — modes.md §3.8.2. An empty list processes nothing. */\n readonly keys: readonly string[];\n};\n\nexport function transform(input: string, options: YamlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"yaml\", \"polytypo/yaml\");\n return runYamlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`, not into a span.\n */\nexport function analyze(input: string, options: YamlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"yaml\", \"polytypo/yaml\");\n return analyzeYamlPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;AAsBO,SAAS,UAAU,OAAe,SAA8B;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,gBAAgB,OAAO,KAAK;AACrC;AAMO,SAAS,QAAQ,OAAe,SAAgC;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,oBAAoB,OAAO,KAAK;AACzC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polytypo",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Normalize typography across languages: locale-correct quotes, dashes, ellipses and no-break spaces.",
5
5
  "keywords": [
6
6
  "typography",
@@ -79,6 +79,16 @@
79
79
  "default": "./dist/markdown.cjs"
80
80
  }
81
81
  },
82
+ "./yaml": {
83
+ "import": {
84
+ "types": "./dist/yaml.d.ts",
85
+ "default": "./dist/yaml.js"
86
+ },
87
+ "require": {
88
+ "types": "./dist/yaml.d.cts",
89
+ "default": "./dist/yaml.cjs"
90
+ }
91
+ },
82
92
  "./package.json": "./package.json"
83
93
  },
84
94
  "files": [
@@ -122,7 +132,7 @@
122
132
  "typescript": "^6.0.3",
123
133
  "typescript-eslint": "^8.67.0",
124
134
  "vitest": "^4.1.10",
125
- "yaml": "^2.9.0"
135
+ "yaml": "^2.9.1"
126
136
  },
127
137
  "dependencies": {
128
138
  "micromark": "^4.0.2",