@akanjs/devkit 0.0.63 → 0.0.65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/devkit",
3
- "version": "0.0.63",
3
+ "version": "0.0.65",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/executors.cjs CHANGED
@@ -491,6 +491,25 @@ class SysExecutor extends Executor {
491
491
  if (this.type === "lib")
492
492
  await this.applyTemplate({ basePath: ".", template: "index.ts", scanResult });
493
493
  this.writeJson(`akan.${this.type}.json`, scanResult);
494
+ if (this.type === "app")
495
+ return scanResult;
496
+ const libPackageJson = this.readJson("package.json");
497
+ const libPkgJsonWithDeps = {
498
+ ...libPackageJson,
499
+ dependencies: {
500
+ ...libPackageJson.dependencies,
501
+ ...Object.fromEntries(
502
+ scanResult.dependencies.filter((dep) => rootPackageJson.dependencies?.[dep]).sort().map((dep) => [dep, rootPackageJson.dependencies?.[dep]])
503
+ )
504
+ },
505
+ devDependencies: {
506
+ ...libPackageJson.devDependencies,
507
+ ...Object.fromEntries(
508
+ scanResult.dependencies.filter((dep) => rootPackageJson.devDependencies?.[dep]).sort().map((dep) => [dep, rootPackageJson.devDependencies?.[dep]])
509
+ )
510
+ }
511
+ };
512
+ this.writeJson("package.json", libPkgJsonWithDeps);
494
513
  return scanResult;
495
514
  }
496
515
  getLocalFile(filePath) {
package/src/executors.js CHANGED
@@ -455,6 +455,25 @@ class SysExecutor extends Executor {
455
455
  if (this.type === "lib")
456
456
  await this.applyTemplate({ basePath: ".", template: "index.ts", scanResult });
457
457
  this.writeJson(`akan.${this.type}.json`, scanResult);
458
+ if (this.type === "app")
459
+ return scanResult;
460
+ const libPackageJson = this.readJson("package.json");
461
+ const libPkgJsonWithDeps = {
462
+ ...libPackageJson,
463
+ dependencies: {
464
+ ...libPackageJson.dependencies,
465
+ ...Object.fromEntries(
466
+ scanResult.dependencies.filter((dep) => rootPackageJson.dependencies?.[dep]).sort().map((dep) => [dep, rootPackageJson.dependencies?.[dep]])
467
+ )
468
+ },
469
+ devDependencies: {
470
+ ...libPackageJson.devDependencies,
471
+ ...Object.fromEntries(
472
+ scanResult.dependencies.filter((dep) => rootPackageJson.devDependencies?.[dep]).sort().map((dep) => [dep, rootPackageJson.devDependencies?.[dep]])
473
+ )
474
+ }
475
+ };
476
+ this.writeJson("package.json", libPkgJsonWithDeps);
458
477
  return scanResult;
459
478
  }
460
479
  getLocalFile(filePath) {