@knighted/jsx 1.5.0-rc.0 → 1.5.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.
- package/README.md +1 -1
- package/dist/cjs/cli/init.cjs +3 -2
- package/dist/cli/init.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -304,7 +304,7 @@ document.querySelector('header')!.append(header)
|
|
|
304
304
|
document.querySelector('footer')!.append(header) // footer stays empty
|
|
305
305
|
```
|
|
306
306
|
|
|
307
|
-
When you need multiple copies, call the template again, wrap it in a helper (
|
|
307
|
+
When you need multiple copies, call the template again, wrap it in a helper (``const makeHeader = () => jsx`<...>`; makeHeader()``), or clone the fragment before reusing it (`footer.append(header.cloneNode(true))`). Components that return fragments are unaffected because every invocation produces a fresh fragment.
|
|
308
308
|
|
|
309
309
|
## Limitations
|
|
310
310
|
|
package/dist/cjs/cli/init.cjs
CHANGED
|
@@ -286,8 +286,9 @@ function persistBindingSpec(cwd, name, version, dryRun, verbose) {
|
|
|
286
286
|
const pkgRaw = node_fs_1.default.readFileSync(pkgPath, 'utf8');
|
|
287
287
|
const pkgJson = JSON.parse(pkgRaw);
|
|
288
288
|
pkgJson.optionalDependencies = pkgJson.optionalDependencies ?? {};
|
|
289
|
-
|
|
290
|
-
|
|
289
|
+
const semver = version.startsWith('^') || version.startsWith('~') ? version : `^${version}`;
|
|
290
|
+
pkgJson.optionalDependencies[name] = semver;
|
|
291
|
+
log(`> Recording optionalDependency ${name}@${semver}`);
|
|
291
292
|
if (!dryRun) {
|
|
292
293
|
node_fs_1.default.writeFileSync(pkgPath, `${JSON.stringify(pkgJson, null, 2)}\n`, 'utf8');
|
|
293
294
|
}
|
package/dist/cli/init.js
CHANGED
|
@@ -256,8 +256,9 @@ function persistBindingSpec(cwd, name, version, dryRun, verbose) {
|
|
|
256
256
|
const pkgRaw = fs.readFileSync(pkgPath, "utf8");
|
|
257
257
|
const pkgJson = JSON.parse(pkgRaw);
|
|
258
258
|
pkgJson.optionalDependencies = pkgJson.optionalDependencies ?? {};
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
const semver = version.startsWith("^") || version.startsWith("~") ? version : `^${version}`;
|
|
260
|
+
pkgJson.optionalDependencies[name] = semver;
|
|
261
|
+
log(`> Recording optionalDependency ${name}@${semver}`);
|
|
261
262
|
if (!dryRun) {
|
|
262
263
|
fs.writeFileSync(pkgPath, `${JSON.stringify(pkgJson, null, 2)}
|
|
263
264
|
`, "utf8");
|