node-karin 1.3.3 → 1.3.4-pr.257.04e45b2

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.
@@ -275,17 +275,23 @@ var createConfig = () => {
275
275
  fs2__default.default.writeFileSync(targetFile, JSON.stringify(mergedData, null, 2));
276
276
  });
277
277
  };
278
- var modifyPackageJson = () => {
278
+ var modifyPackageJson = async () => {
279
279
  const pkg = fs2__default.default.readFileSync(path2__default.default.join(dir, "package.json"), "utf-8");
280
280
  const data = JSON.parse(pkg);
281
281
  data.type = "module";
282
282
  if (!data.scripts) data.scripts = {};
283
283
  data.scripts.karin = "karin";
284
- data.pnpm = {};
285
- data.pnpm.onlyBuiltDependenciesFile = [
286
- "sqlite3",
287
- "classic-level"
288
- ];
284
+ const { stdout: pnpmVersion } = execSync("pnpm -v");
285
+ const majorVersion = parseInt(pnpmVersion.split(".")[0]);
286
+ if (majorVersion < 10 && data.pnpm) {
287
+ delete data.pnpm;
288
+ } else if (majorVersion >= 10) {
289
+ if (typeof data.pnpm !== "object") data.pnpm = {};
290
+ data.pnpm.onlyBuiltDependenciesFile = [
291
+ "sqlite3",
292
+ "classic-level"
293
+ ];
294
+ }
289
295
  const list = ["app", "start", "pm2", "stop", "rs", "log"];
290
296
  if (!isDev) {
291
297
  list.forEach((v) => {
@@ -300,7 +306,7 @@ var init = async () => {
300
306
  createDir();
301
307
  await createOtherFile();
302
308
  createConfig();
303
- modifyPackageJson();
309
+ await modifyPackageJson();
304
310
  process.exit(0);
305
311
  };
306
312
  var parseEnvFiles = (env) => {
package/dist/cli/index.js CHANGED
@@ -266,17 +266,23 @@ var createConfig = () => {
266
266
  fs2.writeFileSync(targetFile, JSON.stringify(mergedData, null, 2));
267
267
  });
268
268
  };
269
- var modifyPackageJson = () => {
269
+ var modifyPackageJson = async () => {
270
270
  const pkg = fs2.readFileSync(path2.join(dir, "package.json"), "utf-8");
271
271
  const data = JSON.parse(pkg);
272
272
  data.type = "module";
273
273
  if (!data.scripts) data.scripts = {};
274
274
  data.scripts.karin = "karin";
275
- data.pnpm = {};
276
- data.pnpm.onlyBuiltDependenciesFile = [
277
- "sqlite3",
278
- "classic-level"
279
- ];
275
+ const { stdout: pnpmVersion } = execSync("pnpm -v");
276
+ const majorVersion = parseInt(pnpmVersion.split(".")[0]);
277
+ if (majorVersion < 10 && data.pnpm) {
278
+ delete data.pnpm;
279
+ } else if (majorVersion >= 10) {
280
+ if (typeof data.pnpm !== "object") data.pnpm = {};
281
+ data.pnpm.onlyBuiltDependenciesFile = [
282
+ "sqlite3",
283
+ "classic-level"
284
+ ];
285
+ }
280
286
  const list = ["app", "start", "pm2", "stop", "rs", "log"];
281
287
  if (!isDev) {
282
288
  list.forEach((v) => {
@@ -291,7 +297,7 @@ var init = async () => {
291
297
  createDir();
292
298
  await createOtherFile();
293
299
  createConfig();
294
- modifyPackageJson();
300
+ await modifyPackageJson();
295
301
  process.exit(0);
296
302
  };
297
303
  var parseEnvFiles = (env) => {
package/dist/index.js CHANGED
@@ -17049,7 +17049,7 @@ var init_input2 = __esm({
17049
17049
  _type(dataType) {
17050
17050
  const typeMap = {
17051
17051
  ["string" /* STRING */]: "text",
17052
- ["number" /* NUMBER */]: "text",
17052
+ ["number" /* NUMBER */]: "number",
17053
17053
  ["boolean" /* BOOLEAN */]: "text",
17054
17054
  ["date" /* DATE */]: "text",
17055
17055
  ["time" /* TIME */]: "text",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "1.3.3",
3
+ "version": "1.3.4-pr.257.04e45b2",
4
4
  "description": "Lightweight, efficient, concise, and stable robot framework.",
5
5
  "keywords": [
6
6
  "node",