rapier-math 2.7.0 → 3.1.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.
@@ -12,10 +12,10 @@ import {mathModules, mathClassicSource} from '../math/package-build.mjs';
12
12
  import {mathReadme} from '../math/package-readme.mjs';
13
13
 
14
14
  const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
15
- export const MATH_VERSION = '2.7.0';
15
+ export const MATH_VERSION = '3.1.0';
16
16
  export const MATH_BUNDLE = 'rapier-math-' + MATH_VERSION + '.js';
17
17
  export const MATH_SOURCES = ['font.js', 'symbols.js', 'parser.js', 'source.js', 'variants.js', 'layout.js', 'fallbacks.js', 'responsive.js', 'api.js', 'browser.js', 'mathml.js', 'semantic-api.js', 'combined.js', 'classic.js'].map(name => 'math/' + name);
18
- export const MATH_RECIPE = ['math/build-font.py', 'math/FONT-SOURCE.md', 'math/FONT-LICENSE.txt', 'math/package-verify.mjs', 'tools/build-math.mjs', 'math/LICENSE-MIT', 'math/adoption-verify.mjs', 'math/package-build.mjs', 'math/package-layout.mjs', 'math/package-check.mjs', 'math/package-readme.mjs', 'math/README.md', 'math/CHANGELOG.md', 'math/SEMANTICS.md', 'math/semantic-verify.mjs', 'math/typeset-verify.mjs'];
18
+ export const MATH_RECIPE = ['math/build-font.py', 'math/FONT-SOURCE.md', 'math/FONT-LICENSE.txt', 'math/package-verify.mjs', 'tools/build-math.mjs', 'math/LICENSE-MIT', 'math/adoption-verify.mjs', 'math/package-build.mjs', 'math/package-layout.mjs', 'math/package-check.mjs', 'math/package-readme.mjs', 'math/README.md', 'math/SEMANTICS.md', 'math/semantic-verify.mjs', 'math/typeset-verify.mjs', 'math/cli.mjs', 'math/skills/rapier-math/SKILL.md'];
19
19
  export const MATH_ADOPTION = ['delimiters.mjs', 'markdown-rules.mjs', 'reuse.mjs', 'integration.mjs', 'markdown-it.mjs', 'rehype.mjs', 'stream.mjs',
20
20
  'accessible.mjs', 'accessible.css', 'mathml.d.ts', 'combined.d.ts', 'accessible.d.ts',
21
21
  'index.d.ts', 'classic.d.ts', 'delimiters.d.ts', 'integration.d.ts', 'markdown-it.d.ts', 'rehype.d.ts', 'stream.d.ts',
@@ -69,6 +69,9 @@ export async function assembleMath({root = ROOT, packageLayout = false} = {}) {
69
69
  const bytes = await read(file);
70
70
  inputs.push({file, bytes, text: bytes.toString('utf8')});
71
71
  }
72
+ // Keep the self-contained browser API's version equal to the package identity.
73
+ const classicVersion = /version:\s*'([^']+)'/.exec(inputs.find(input => input.file === 'math/classic.js')?.text || '')?.[1];
74
+ if (classicVersion !== MATH_VERSION) throw new Error('The classic Math API version differs from its package version');
72
75
  const license = await fontLicense(root, packageLayout);
73
76
  if (!inputs[0].text.includes(FONT.copyright) || !inputs[0].text.includes('Complete license: FONT-LICENSE.txt')) throw new Error('The embedded math font is missing its notice');
74
77
  // The single-file bundle travels alone, so it carries both complete licenses itself.
@@ -80,6 +83,7 @@ export async function assembleMath({root = ROOT, packageLayout = false} = {}) {
80
83
  const sha256 = digest(bytes), sha384 = digest(bytes, 'sha384', 'base64');
81
84
  const recipe = [];
82
85
  for (const file of MATH_RECIPE) {
86
+ if (packageLayout && mathPackagePath(file).startsWith('tests/')) continue;
83
87
  const content = await read(file);
84
88
  recipe.push({file, packageFile: mathPackagePath(file), bytes: content.length, sha256: digest(content)});
85
89
  }
@@ -108,11 +112,14 @@ export async function buildMath({root = ROOT, updatePins = true, packageLayout =
108
112
  await mkdir(dirname(resolve(root, file)), {recursive: true});
109
113
  await writeFile(resolve(root, file), content);
110
114
  }
111
- await writeFile(resolve(root, 'docs/math-resources.json'), JSON.stringify(resources, null, 2) + '\n');
115
+ const publicReceipt = JSON.stringify(resources, null, 2) + '\n';
116
+ await writeFile(resolve(root, 'docs/math-resources.json'), publicReceipt);
112
117
  await writeFile(resolve(root, 'README.md'), mathReadme(resources));
113
118
  const sbomPath = resolve(root, 'docs/math-components.json');
114
119
  const sbom = JSON.parse(await readFile(sbomPath, 'utf8'));
115
120
  sbom.packages.find(item => item.name === 'rapier-math').checksums = [{algorithm: 'SHA256', checksumValue: resources.sha256}];
121
+ sbom.packages.find(item => item.name === 'rapier-math').sourceInfo =
122
+ 'Verified public build inputs: docs/math-resources.json (SHA-256 ' + digest(publicReceipt) + ').';
116
123
  sbom.documentNamespace = 'https://rapier.website/spdx/rapier-math-' + resources.version + '-' + resources.sha256;
117
124
  await writeFile(sbomPath, JSON.stringify(sbom, null, 2) + '\n');
118
125
  return {bundle: MATH_CLASSIC, bytes: bytes.length, sha256: resources.sha256};
package/CHANGELOG.md DELETED
@@ -1,10 +0,0 @@
1
- # Changelog
2
-
3
- ## 2.6.1
4
-
5
- - Use the font's ellipses and correct extensible arrow sizes.
6
- - Match amscd row spacing and under-accent attachment points.
7
- - Correct chemistry labels, state spacing and superscripts. Keep chemistry arrows at least 2 em wide in MathML.
8
- - Include the Latin Modern Mono sharp s outline for monospace text.
9
- - Preserve exact math fence source in shared Markdown rules.
10
-