SPB Git

Repository Public

patch-glue.mjs 2.4 KB 56 lines javascript

1/**2 * =============================================================================3 *                  SP BOUCHER | SOFTWARE & RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : KA Maps Engine8 * File             : sdk/web/scripts/patch-glue.mjs9 * Module           : sdk10 * Repository       : https://git.spboucher.ai/ka-maps-engine11 * Created          : 2026-12-0112 * Last Modified    : 2026-12-0113 *14 * Author           : Simon-Pierre Boucher15 * Position         : Professor of Finance16 * Institution      : Université du Québec en Outaouais (UQO)17 * Organization     : SP Boucher18 * Website          : https://spboucher.ai19 * Git              : https://git.spboucher.ai20 *21 * Preferred Contact: support@spboucher.ai22 * Development      : dev@spboucher.ai23 * Support          : support@spboucher.ai24 * Security/Admin   : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License          : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142// Retire de la colle wasm-bindgen le chemin par défaut `new URL('km_wasm_bg.wasm', import.meta.url)` :43// le SDK passe toujours un WebAssembly.Module compilé, et les empaqueteurs (Vite, Turbopack) n'ont44// ainsi aucun fichier à résoudre dans le paquet.45import { readFileSync, writeFileSync } from 'node:fs';4647const [, , src, dst] = process.argv;48let js = readFileSync(src, 'utf8');49const before = js;50js = js.replace(/module_or_path = new URL\('km_wasm_bg\.wasm', import\.meta\.url\);/, "throw new Error('@ka/maps : module wasm requis');");51if (js === before) {52  console.error('patch-glue : motif `new URL(…, import.meta.url)` introuvable (version de wasm-bindgen ?)');53  process.exit(1);54}55writeFileSync(dst, '/* eslint-disable */\n// Généré par wasm-bindgen (scripts/build.sh). Ne pas modifier.\n' + js);56
Files main
Menu

Theme