@knighted/jsx 1.5.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/dist/cjs/cli/init.cjs +3 -2
- package/dist/cli/init.js +3 -2
- package/package.json +1 -1
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");
|