create-akan-workspace 2.0.0-rc.7 → 2.0.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.
Files changed (2) hide show
  1. package/index.js +11 -3
  2. package/package.json +4 -2
package/index.js CHANGED
@@ -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.1",
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"