@knighted/jsx 1.6.1 → 1.6.3-rc.1
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.
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.__setNodeRequireForTesting = exports.ensureNodeDom = void 0;
|
|
4
|
+
const node_module_1 = require("node:module");
|
|
5
|
+
const nodeRequire = (0, node_module_1.createRequire)(require("node:url").pathToFileURL(__filename).href);
|
|
3
6
|
let requireOverride = null;
|
|
4
7
|
const resolveRequire = () => requireOverride ?? nodeRequire;
|
|
5
8
|
const DOM_TEMPLATE = '<!doctype html><html><body></body></html>';
|
|
@@ -70,7 +73,7 @@ const createShimWindow = () => {
|
|
|
70
73
|
throw new AggregateError(errors, help);
|
|
71
74
|
};
|
|
72
75
|
let bootstrapped = false;
|
|
73
|
-
|
|
76
|
+
const ensureNodeDom = () => {
|
|
74
77
|
if (hasDom() || bootstrapped) {
|
|
75
78
|
return;
|
|
76
79
|
}
|
|
@@ -78,6 +81,8 @@ export const ensureNodeDom = () => {
|
|
|
78
81
|
assignGlobalTargets(windowObj);
|
|
79
82
|
bootstrapped = true;
|
|
80
83
|
};
|
|
81
|
-
|
|
84
|
+
exports.ensureNodeDom = ensureNodeDom;
|
|
85
|
+
const __setNodeRequireForTesting = (mockRequire) => {
|
|
82
86
|
requireOverride = mockRequire;
|
|
83
87
|
};
|
|
88
|
+
exports.__setNodeRequireForTesting = __setNodeRequireForTesting;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsx = void 0;
|
|
4
|
+
const diagnostics_js_1 = require("../../debug/diagnostics.cjs");
|
|
5
|
+
const bootstrap_js_1 = require("../bootstrap.cjs");
|
|
6
|
+
const jsx_js_1 = require("../../jsx.cjs");
|
|
7
|
+
(0, diagnostics_js_1.enableJsxDebugDiagnostics)({ mode: 'always' });
|
|
8
|
+
(0, bootstrap_js_1.ensureNodeDom)();
|
|
9
|
+
exports.jsx = jsx_js_1.jsx;
|
package/dist/cjs/node/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsx = void 0;
|
|
4
|
+
const bootstrap_js_1 = require("./bootstrap.cjs");
|
|
5
|
+
const jsx_js_1 = require("../jsx.cjs");
|
|
6
|
+
(0, bootstrap_js_1.ensureNodeDom)();
|
|
7
|
+
exports.jsx = jsx_js_1.jsx;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reactJsx = void 0;
|
|
4
|
+
var react_jsx_js_1 = require("../../react/react-jsx.cjs");
|
|
5
|
+
Object.defineProperty(exports, "reactJsx", { enumerable: true, get: function () { return react_jsx_js_1.reactJsx; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knighted/jsx",
|
|
3
|
-
"version": "1.6.1",
|
|
3
|
+
"version": "1.6.3-rc.1",
|
|
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",
|
|
@@ -112,19 +112,23 @@
|
|
|
112
112
|
},
|
|
113
113
|
"engineStrict": true,
|
|
114
114
|
"scripts": {
|
|
115
|
-
"build": "duel && npm run build:lite && npm run build:cli",
|
|
115
|
+
"build": "duel --mode globals && npm run build:lite && npm run build:cli",
|
|
116
116
|
"prepare": "husky",
|
|
117
117
|
"precheck-types": "npm run build",
|
|
118
118
|
"check-types": "npm run check-types:lib && npm run check-types:demo && npm run check-types:test",
|
|
119
119
|
"check-types:lib": "tsc --noEmit --project tsconfig.json",
|
|
120
120
|
"check-types:demo": "tsc --noEmit --project examples/browser/tsconfig.json",
|
|
121
121
|
"check-types:test": "tsc --noEmit --project tsconfig.vitest.json",
|
|
122
|
+
"clean:deps": "rimraf \"**/node_modules\"",
|
|
123
|
+
"clean:dist": "rimraf \"**/dist\"",
|
|
124
|
+
"clean": "npm run clean:deps && npm run clean:dist",
|
|
122
125
|
"lint": "eslint src test",
|
|
126
|
+
"pretest": "npm run build",
|
|
123
127
|
"cycles": "madge src --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json",
|
|
124
128
|
"prettier": "prettier -w .",
|
|
125
129
|
"prettier:check": "prettier --check .",
|
|
126
|
-
"test": "KNIGHTED_JSX_CLI_TEST=1 vitest run --coverage",
|
|
127
|
-
"test:watch": "KNIGHTED_JSX_CLI_TEST=1 vitest",
|
|
130
|
+
"test": "cross-env KNIGHTED_JSX_CLI_TEST=1 vitest run --coverage",
|
|
131
|
+
"test:watch": "cross-env KNIGHTED_JSX_CLI_TEST=1 vitest",
|
|
128
132
|
"test:e2e": "npm run build && npm run setup:wasm && npm run build:fixture && playwright test",
|
|
129
133
|
"build:fixture": "node scripts/build-rspack-fixture.mjs",
|
|
130
134
|
"demo:node-ssr": "node test/fixtures/node-ssr/render.mjs",
|
|
@@ -139,7 +143,7 @@
|
|
|
139
143
|
},
|
|
140
144
|
"devDependencies": {
|
|
141
145
|
"@eslint/js": "^9.39.1",
|
|
142
|
-
"@knighted/duel": "^
|
|
146
|
+
"@knighted/duel": "^4.0.0-rc.5",
|
|
143
147
|
"@oxc-project/types": "^0.105.0",
|
|
144
148
|
"@playwright/test": "^1.57.0",
|
|
145
149
|
"@rspack/core": "^1.0.5",
|
|
@@ -149,6 +153,7 @@
|
|
|
149
153
|
"@types/react-dom": "^19.2.3",
|
|
150
154
|
"@vitest/coverage-v8": "^4.0.14",
|
|
151
155
|
"@vitest/eslint-plugin": "^1.6.4",
|
|
156
|
+
"cross-env": "^10.1.0",
|
|
152
157
|
"eslint": "^9.39.1",
|
|
153
158
|
"eslint-plugin-n": "^17.10.3",
|
|
154
159
|
"eslint-plugin-playwright": "^2.4.0",
|
|
@@ -163,6 +168,7 @@
|
|
|
163
168
|
"prettier": "^3.7.3",
|
|
164
169
|
"react": "^19.0.0",
|
|
165
170
|
"react-dom": "^19.0.0",
|
|
171
|
+
"rimraf": "^6.1.2",
|
|
166
172
|
"tsup": "^8.5.1",
|
|
167
173
|
"typescript": "^5.9.3",
|
|
168
174
|
"typescript-eslint": "^8.48.0",
|
|
@@ -170,6 +176,7 @@
|
|
|
170
176
|
"vitest": "^4.0.14"
|
|
171
177
|
},
|
|
172
178
|
"dependencies": {
|
|
179
|
+
"@napi-rs/wasm-runtime": "^1.1.0",
|
|
173
180
|
"magic-string": "^0.30.21",
|
|
174
181
|
"oxc-parser": "^0.105.0",
|
|
175
182
|
"property-information": "^7.1.0",
|