@knighted/jsx 1.6.0 → 1.6.2
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/cjs/cli/init.cjs +15 -0
- package/dist/cjs/node/bootstrap.cjs +1 -1
- package/dist/cli/init.js +17 -0
- package/package.json +3 -2
package/dist/cjs/cli/init.cjs
CHANGED
|
@@ -165,6 +165,21 @@ function parsePackageName(spec) {
|
|
|
165
165
|
return { name, version };
|
|
166
166
|
}
|
|
167
167
|
function readLocalOxcParserVersion(resolver = CLI_REQUIRE) {
|
|
168
|
+
try {
|
|
169
|
+
// Prefer the version installed alongside this CLI package, not a hoisted sibling.
|
|
170
|
+
const jsxPkgPath = resolver.resolve('@knighted/jsx/package.json');
|
|
171
|
+
const jsxRoot = node_path_1.default.dirname(jsxPkgPath);
|
|
172
|
+
const localParserPkg = node_path_1.default.join(jsxRoot, 'node_modules', 'oxc-parser', 'package.json');
|
|
173
|
+
if (node_fs_1.default.existsSync(localParserPkg)) {
|
|
174
|
+
const pkgJson = JSON.parse(node_fs_1.default.readFileSync(localParserPkg, 'utf8'));
|
|
175
|
+
if (pkgJson && typeof pkgJson.version === 'string') {
|
|
176
|
+
return pkgJson.version;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
// Ignore resolution failures and fall back below.
|
|
182
|
+
}
|
|
168
183
|
try {
|
|
169
184
|
const pkg = resolver('oxc-parser/package.json');
|
|
170
185
|
if (pkg && typeof pkg.version === 'string') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
|
-
const nodeRequire = createRequire(
|
|
2
|
+
const nodeRequire = createRequire(require("node:url").pathToFileURL(__filename).href);
|
|
3
3
|
let requireOverride = null;
|
|
4
4
|
const resolveRequire = () => requireOverride ?? nodeRequire;
|
|
5
5
|
const DOM_TEMPLATE = '<!doctype html><html><body></body></html>';
|
package/dist/cli/init.js
CHANGED
|
@@ -143,6 +143,23 @@ function parsePackageName(spec) {
|
|
|
143
143
|
return { name, version };
|
|
144
144
|
}
|
|
145
145
|
function readLocalOxcParserVersion(resolver = CLI_REQUIRE) {
|
|
146
|
+
try {
|
|
147
|
+
const jsxPkgPath = resolver.resolve("@knighted/jsx/package.json");
|
|
148
|
+
const jsxRoot = path.dirname(jsxPkgPath);
|
|
149
|
+
const localParserPkg = path.join(
|
|
150
|
+
jsxRoot,
|
|
151
|
+
"node_modules",
|
|
152
|
+
"oxc-parser",
|
|
153
|
+
"package.json"
|
|
154
|
+
);
|
|
155
|
+
if (fs.existsSync(localParserPkg)) {
|
|
156
|
+
const pkgJson = JSON.parse(fs.readFileSync(localParserPkg, "utf8"));
|
|
157
|
+
if (pkgJson && typeof pkgJson.version === "string") {
|
|
158
|
+
return pkgJson.version;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
} catch {
|
|
162
|
+
}
|
|
146
163
|
try {
|
|
147
164
|
const pkg = resolver("oxc-parser/package.json");
|
|
148
165
|
if (pkg && typeof pkg.version === "string") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knighted/jsx",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Runtime JSX tagged template that renders DOM or React trees anywhere without a build step.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx runtime",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@eslint/js": "^9.39.1",
|
|
142
|
-
"@knighted/duel": "^2.
|
|
142
|
+
"@knighted/duel": "^3.2.0",
|
|
143
143
|
"@oxc-project/types": "^0.105.0",
|
|
144
144
|
"@playwright/test": "^1.57.0",
|
|
145
145
|
"@rspack/core": "^1.0.5",
|
|
@@ -170,6 +170,7 @@
|
|
|
170
170
|
"vitest": "^4.0.14"
|
|
171
171
|
},
|
|
172
172
|
"dependencies": {
|
|
173
|
+
"@napi-rs/wasm-runtime": "^1.1.0",
|
|
173
174
|
"magic-string": "^0.30.21",
|
|
174
175
|
"oxc-parser": "^0.105.0",
|
|
175
176
|
"property-information": "^7.1.0",
|