@azx-pbc/axiom-runtime 0.0.5 → 0.0.6

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/dist/version.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  * outside it is refused by the caller rather than coerced.
17
17
  */
18
18
  /** The version all eight Axiom packages publish at. */
19
- export declare const AXIOM_VERSION = "0.0.5";
19
+ export declare const AXIOM_VERSION = "0.0.6";
20
20
  /** Whether `text` is a release version, as an artifact's producer stamp must be. */
21
21
  export declare function isVersionText(text: string): boolean;
22
22
  /**
package/dist/version.js CHANGED
@@ -16,7 +16,7 @@
16
16
  * outside it is refused by the caller rather than coerced.
17
17
  */
18
18
  /** The version all eight Axiom packages publish at. */
19
- export const AXIOM_VERSION = '0.0.5'; // x-release-please-version
19
+ export const AXIOM_VERSION = '0.0.6'; // x-release-please-version
20
20
  /**
21
21
  * A semantic version's text.
22
22
  *
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,2BAA2B;AAUjE;;;;;;GAMG;AACH,MAAM,eAAe,GACnB,sIAAsI,CAAC;AAEzI,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,2FAA2F;IAC3F,qFAAqF;IACr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,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,KAAa;IACzD,MAAM,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,MAAM,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzD,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QAAE,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QAAE,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QAAE,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,OAAO,iBAAiB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;AACvD,CAAC","sourcesContent":["/**\n * The release version this build reports, and the comparison an artifact's producer stamp is\n * admitted by.\n *\n * `AXIOM_VERSION` is the version all eight packages publish at. It lives in source rather than\n * being read from `package.json` because the runtime ships to browsers and Hermes: neither has a\n * filesystem to read a manifest from, and a build-time define would make the published tarball's\n * version depend on which bundler assembled it. The value is kept equal to all eight manifests by\n * release-please's generic `extra-files` updater (the `x-release-please-version` marker below) and\n * is asserted by `test/release/manifest-lockstep.test.ts`.\n *\n * `compareVersions` is hand-rolled rather than delegating to `semver`, which is a root\n * devDependency: the runtime's device bundle may not grow a dependency that is not already one of\n * its three (§ Dependencies: buy before build). The grammar is the subset a release version uses:\n * the three numeric components, an optional prerelease and ignored build metadata, and a value\n * outside it is refused by the caller rather than coerced.\n */\n\n/** The version all eight Axiom packages publish at. */\nexport const AXIOM_VERSION = '0.0.5'; // x-release-please-version\n\n/** A parsed release version. `prerelease` is empty for a final release. */\ninterface ParsedVersion {\n readonly major: number;\n readonly minor: number;\n readonly patch: number;\n readonly prerelease: readonly string[];\n}\n\n/**\n * A semantic version's text.\n *\n * Numeric components carry no leading zero, which is what makes the comparison total once each\n * component has been read as a number. Build metadata is accepted and discarded because semver\n * precedence ignores it.\n */\nconst VERSION_PATTERN =\n /^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$/;\n\nfunction parseVersion(text: string): ParsedVersion | undefined {\n const match = VERSION_PATTERN.exec(text);\n if (match === null) return undefined;\n const major = Number(match[1]);\n const minor = Number(match[2]);\n const patch = Number(match[3]);\n // A component beyond the safe integer range is not a version this repository produces, and\n // reading it as an imprecise number could make two different versions compare equal.\n if (\n !Number.isSafeInteger(major) ||\n !Number.isSafeInteger(minor) ||\n !Number.isSafeInteger(patch)\n ) {\n return undefined;\n }\n const prerelease = match[4] === undefined ? [] : match[4].split('.');\n // A numeric prerelease identifier carries no leading zero, so `1.0.0-01` is not a version\n // semver precedence orders. The pattern admits the characters; this is the rule it cannot.\n for (const identifier of prerelease) {\n if (/^[0-9]+$/.test(identifier) && identifier.length > 1 && identifier.startsWith('0')) {\n return undefined;\n }\n }\n return { major, minor, patch, prerelease };\n}\n\n/** Whether `text` is a release version, as an artifact's producer stamp must be. */\nexport function isVersionText(text: string): boolean {\n return parseVersion(text) !== undefined;\n}\n\n/**\n * Semver precedence between two prerelease identifier lists.\n *\n * A numeric identifier is always lower than an alphanumeric one, numeric identifiers compare as\n * numbers, alphanumeric identifiers compare by ASCII code point, and a shorter list that is a\n * prefix of a longer one sorts first.\n */\nfunction comparePrerelease(left: readonly string[], right: readonly string[]): number {\n if (left.length === 0 && right.length === 0) return 0;\n // A final release outranks any prerelease of the same numeric triple.\n if (left.length === 0) return 1;\n if (right.length === 0) return -1;\n const length = Math.min(left.length, right.length);\n for (let index = 0; index < length; index += 1) {\n const a = left[index];\n const b = right[index];\n if (a === undefined || b === undefined) continue;\n const aNumeric = /^[0-9]+$/.test(a);\n const bNumeric = /^[0-9]+$/.test(b);\n if (aNumeric && bNumeric) {\n // Numeric identifiers carry no leading zero, so the longer text is the larger number and\n // equal-length texts compare as integers. Reading them through `Number` would compare two\n // identifiers beyond the safe range imprecisely.\n if (a.length !== b.length) return a.length < b.length ? -1 : 1;\n if (a !== b) return a < b ? -1 : 1;\n continue;\n }\n if (aNumeric !== bNumeric) return aNumeric ? -1 : 1;\n if (a !== b) return a < b ? -1 : 1;\n }\n return left.length === right.length ? 0 : left.length < right.length ? -1 : 1;\n}\n\n/**\n * The semver precedence of `left` against `right`: negative when `left` is older, zero when they\n * are the same release, positive when it is newer, and `undefined` when either is not a version.\n *\n * The undefined arm exists so a malformed producer stamp is a refusal at the boundary rather than\n * a comparison that happens to fall one way.\n */\nexport function compareVersions(left: string, right: string): number | undefined {\n const a = parseVersion(left);\n const b = parseVersion(right);\n if (a === undefined || b === undefined) return undefined;\n if (a.major !== b.major) return a.major < b.major ? -1 : 1;\n if (a.minor !== b.minor) return a.minor < b.minor ? -1 : 1;\n if (a.patch !== b.patch) return a.patch < b.patch ? -1 : 1;\n return comparePrerelease(a.prerelease, b.prerelease);\n}\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,2BAA2B;AAUj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AAC,CAAC,CAAC,CAAC,CAAC;IAC3D,OAAO,iBAAiB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;AACvD,CAAC","sourcesContent":["/**\n * The release version this build reports, and the comparison an artifact's producer stamp is\n * admitted by.\n *\n * `AXIOM_VERSION` is the version all eight packages publish at. It lives in source rather than\n * being read from `package.json` because the runtime ships to browsers and Hermes: neither has a\n * filesystem to read a manifest from, and a build-time define would make the published tarball's\n * version depend on which bundler assembled it. The value is kept equal to all eight manifests by\n * release-please's generic `extra-files` updater (the `x-release-please-version` marker below) and\n * is asserted by `test/release/manifest-lockstep.test.ts`.\n *\n * `compareVersions` is hand-rolled rather than delegating to `semver`, which is a root\n * devDependency: the runtime's device bundle may not grow a dependency that is not already one of\n * its three (§ Dependencies: buy before build). The grammar is the subset a release version uses:\n * the three numeric components, an optional prerelease and ignored build metadata, and a value\n * outside it is refused by the caller rather than coerced.\n */\n\n/** The version all eight Axiom packages publish at. */\nexport const AXIOM_VERSION = '0.0.6'; // x-release-please-version\n\n/** A parsed release version. `prerelease` is empty for a final release. */\ninterface ParsedVersion {\n readonly major: number;\n readonly minor: number;\n readonly patch: number;\n readonly prerelease: readonly string[];\n}\n\n/**\n * A semantic version's text.\n *\n * Numeric components carry no leading zero, which is what makes the comparison total once each\n * component has been read as a number. Build metadata is accepted and discarded because semver\n * precedence ignores it.\n */\nconst VERSION_PATTERN =\n /^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$/;\n\nfunction parseVersion(text: string): ParsedVersion | undefined {\n const match = VERSION_PATTERN.exec(text);\n if (match === null) return undefined;\n const major = Number(match[1]);\n const minor = Number(match[2]);\n const patch = Number(match[3]);\n // A component beyond the safe integer range is not a version this repository produces, and\n // reading it as an imprecise number could make two different versions compare equal.\n if (\n !Number.isSafeInteger(major) ||\n !Number.isSafeInteger(minor) ||\n !Number.isSafeInteger(patch)\n ) {\n return undefined;\n }\n const prerelease = match[4] === undefined ? [] : match[4].split('.');\n // A numeric prerelease identifier carries no leading zero, so `1.0.0-01` is not a version\n // semver precedence orders. The pattern admits the characters; this is the rule it cannot.\n for (const identifier of prerelease) {\n if (/^[0-9]+$/.test(identifier) && identifier.length > 1 && identifier.startsWith('0')) {\n return undefined;\n }\n }\n return { major, minor, patch, prerelease };\n}\n\n/** Whether `text` is a release version, as an artifact's producer stamp must be. */\nexport function isVersionText(text: string): boolean {\n return parseVersion(text) !== undefined;\n}\n\n/**\n * Semver precedence between two prerelease identifier lists.\n *\n * A numeric identifier is always lower than an alphanumeric one, numeric identifiers compare as\n * numbers, alphanumeric identifiers compare by ASCII code point, and a shorter list that is a\n * prefix of a longer one sorts first.\n */\nfunction comparePrerelease(left: readonly string[], right: readonly string[]): number {\n if (left.length === 0 && right.length === 0) return 0;\n // A final release outranks any prerelease of the same numeric triple.\n if (left.length === 0) return 1;\n if (right.length === 0) return -1;\n const length = Math.min(left.length, right.length);\n for (let index = 0; index < length; index += 1) {\n const a = left[index];\n const b = right[index];\n if (a === undefined || b === undefined) continue;\n const aNumeric = /^[0-9]+$/.test(a);\n const bNumeric = /^[0-9]+$/.test(b);\n if (aNumeric && bNumeric) {\n // Numeric identifiers carry no leading zero, so the longer text is the larger number and\n // equal-length texts compare as integers. Reading them through `Number` would compare two\n // identifiers beyond the safe range imprecisely.\n if (a.length !== b.length) return a.length < b.length ? -1 : 1;\n if (a !== b) return a < b ? -1 : 1;\n continue;\n }\n if (aNumeric !== bNumeric) return aNumeric ? -1 : 1;\n if (a !== b) return a < b ? -1 : 1;\n }\n return left.length === right.length ? 0 : left.length < right.length ? -1 : 1;\n}\n\n/**\n * The semver precedence of `left` against `right`: negative when `left` is older, zero when they\n * are the same release, positive when it is newer, and `undefined` when either is not a version.\n *\n * The undefined arm exists so a malformed producer stamp is a refusal at the boundary rather than\n * a comparison that happens to fall one way.\n */\nexport function compareVersions(left: string, right: string): number | undefined {\n const a = parseVersion(left);\n const b = parseVersion(right);\n if (a === undefined || b === undefined) return undefined;\n if (a.major !== b.major) return a.major < b.major ? -1 : 1;\n if (a.minor !== b.minor) return a.minor < b.minor ? -1 : 1;\n if (a.patch !== b.patch) return a.patch < b.patch ? -1 : 1;\n return comparePrerelease(a.prerelease, b.prerelease);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azx-pbc/axiom-runtime",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "A target-neutral evaluator for a compiled artifact: exact decimal arithmetic, civil dates and restricted canonical hashing, so Node, a browser and Hermes reach the same verdict.",
5
5
  "license": "MIT",
6
6
  "author": "AZX, PBC",