create-akan-workspace 2.0.0-rc.7 → 2.0.0

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.
Files changed (2) hide show
  1. package/index.js +19 -11
  2. package/package.json +4 -2
package/index.js CHANGED
@@ -33,7 +33,7 @@ var __toESM = (mod, isNodeMode, target) => {
33
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
34
  var __require = import.meta.require;
35
35
 
36
- // node_modules/.bun/commander@14.0.3/node_modules/commander/lib/error.js
36
+ // node_modules/commander/lib/error.js
37
37
  var require_error = __commonJS((exports) => {
38
38
  class CommanderError extends Error {
39
39
  constructor(exitCode, code, message) {
@@ -57,7 +57,7 @@ var require_error = __commonJS((exports) => {
57
57
  exports.InvalidArgumentError = InvalidArgumentError;
58
58
  });
59
59
 
60
- // node_modules/.bun/commander@14.0.3/node_modules/commander/lib/argument.js
60
+ // node_modules/commander/lib/argument.js
61
61
  var require_argument = __commonJS((exports) => {
62
62
  var { InvalidArgumentError } = require_error();
63
63
 
@@ -137,7 +137,7 @@ var require_argument = __commonJS((exports) => {
137
137
  exports.humanReadableArgName = humanReadableArgName;
138
138
  });
139
139
 
140
- // node_modules/.bun/commander@14.0.3/node_modules/commander/lib/help.js
140
+ // node_modules/commander/lib/help.js
141
141
  var require_help = __commonJS((exports) => {
142
142
  var { humanReadableArgName } = require_argument();
143
143
 
@@ -494,7 +494,7 @@ ${itemIndentStr}`);
494
494
  exports.stripColor = stripColor;
495
495
  });
496
496
 
497
- // node_modules/.bun/commander@14.0.3/node_modules/commander/lib/option.js
497
+ // node_modules/commander/lib/option.js
498
498
  var require_option = __commonJS((exports) => {
499
499
  var { InvalidArgumentError } = require_error();
500
500
 
@@ -678,7 +678,7 @@ var require_option = __commonJS((exports) => {
678
678
  exports.DualOptions = DualOptions;
679
679
  });
680
680
 
681
- // node_modules/.bun/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js
681
+ // node_modules/commander/lib/suggestSimilar.js
682
682
  var require_suggestSimilar = __commonJS((exports) => {
683
683
  var maxDistance = 3;
684
684
  function editDistance(a, b) {
@@ -751,7 +751,7 @@ var require_suggestSimilar = __commonJS((exports) => {
751
751
  exports.suggestSimilar = suggestSimilar;
752
752
  });
753
753
 
754
- // node_modules/.bun/commander@14.0.3/node_modules/commander/lib/command.js
754
+ // node_modules/commander/lib/command.js
755
755
  var require_command = __commonJS((exports) => {
756
756
  var EventEmitter = __require("events").EventEmitter;
757
757
  var childProcess = __require("child_process");
@@ -2106,7 +2106,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2106
2106
  exports.useColor = useColor;
2107
2107
  });
2108
2108
 
2109
- // node_modules/.bun/commander@14.0.3/node_modules/commander/index.js
2109
+ // node_modules/commander/index.js
2110
2110
  var require_commander = __commonJS((exports) => {
2111
2111
  var { Argument } = require_argument();
2112
2112
  var { Command } = require_command();
@@ -2129,7 +2129,7 @@ var require_commander = __commonJS((exports) => {
2129
2129
  // pkgs/create-akan-workspace/run.ts
2130
2130
  import { spawn } from "child_process";
2131
2131
 
2132
- // node_modules/.bun/commander@14.0.3/node_modules/commander/esm.mjs
2132
+ // node_modules/commander/esm.mjs
2133
2133
  var import__ = __toESM(require_commander(), 1);
2134
2134
  var {
2135
2135
  program,
@@ -2157,19 +2157,27 @@ var spawnProcess = (spawnCommand, command, args, options = {}) => {
2157
2157
  });
2158
2158
  });
2159
2159
  };
2160
+ var getPackageVersion = async () => {
2161
+ const packageJson = await Bun.file(new URL("./package.json", import.meta.url)).json();
2162
+ if (!packageJson.version)
2163
+ throw new Error("create-akan-workspace package version is missing");
2164
+ return packageJson.version;
2165
+ };
2160
2166
  var run = async ({
2161
2167
  argv = process.argv,
2162
2168
  spawnCommand = spawn
2163
2169
  } = {}) => {
2164
2170
  const program2 = new Command().name("create-akan-workspace");
2165
2171
  program2.argument("[org]", "organization name").option("-a, --app <string>", "application name").option("-d, --dir <string>", "directory").option("-l, --libs <boolean>", "install shared and util libraries", false).action(async (org, options) => {
2166
- await spawnProcess(spawnCommand, "bun", ["install", "-g", "akanjs", "--latest"]);
2167
- await spawnProcess(spawnCommand, "akan2", [
2172
+ const packageVersion = await getPackageVersion();
2173
+ await spawnProcess(spawnCommand, "bun", ["install", "-g", `akanjs@${packageVersion}`]);
2174
+ const libs = options.libs === true || options.libs === "true";
2175
+ await spawnProcess(spawnCommand, "akan", [
2168
2176
  "create-workspace",
2169
2177
  ...org ? [org] : [],
2170
2178
  ...options.app ? [`--app=${options.app}`] : [],
2171
2179
  ...options.dir ? [`--dir=${options.dir}`] : [],
2172
- ...options.libs ? [`--libs=${options.libs}`] : []
2180
+ `--libs=${libs}`
2173
2181
  ]);
2174
2182
  });
2175
2183
  await program2.parseAsync(argv);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sourceType": "module",
3
3
  "name": "create-akan-workspace",
4
- "version": "2.0.0-rc.7",
4
+ "version": "2.0.0",
5
5
  "bin": {
6
6
  "create-akan-workspace": "index.js"
7
7
  },
@@ -16,7 +16,9 @@
16
16
  "directory": "pkgs/akanjs/cli"
17
17
  },
18
18
  "main": "./index.js",
19
- "dependencies": {},
19
+ "dependencies": {
20
+ "commander": "^14.0.3"
21
+ },
20
22
  "type": "module",
21
23
  "engines": {
22
24
  "bun": ">=1.3.13"