sql-js / sql-js/sql.js

How to extract version number from NPM module in 1.14.1 for CDN loading of WASM?

オープン
#627 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
13.7k
フォーク
1.1k
PR マージ指標
30日以内にマージされた PR はありません

説明

Up to version 1.13.0 I was extracting the version using code:

// Extract sql.js version (to enable use of CDN for loading associated WASM)
import sqlJsPkg from 'sql.js/package.json' with { type: 'json' };
const sql_js_version = sqlJsPkg.version;

I was using this in code built with Vite/Webpack bundlers in order to load the correct WASM version from a CDN at runtime.

However, this no longer works in 1.14.1 due to the new restrictions in package.json of adding:

	"exports": {
		".": {
			"browser": "./dist/sql-wasm-browser.js",
			"default": "./dist/sql-wasm.js"
		},
		"./dist/*": "./dist/*"
	},

It was never a great way for me to extract the version as "import... with {type: 'json'}" depends on support for ES2025 features.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Start by reading package.json, especially the exports map, and compare it with the issue's version import used by Vite and Webpack builds. Check how the package is published in 1.14.1 and how the CDN URL is assembled. Done means identifying a supported way to obtain the package version without relying on the unsupported import path or newer syntax.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, vite, wasm, webpack
領域
build-system, web-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。