@adukiorg/create-anza 0.2.4 → 0.2.5

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 +14 -2
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -12,8 +12,20 @@ import { dirname, join, resolve, basename } from 'path';
12
12
  import { existsSync } from 'fs';
13
13
 
14
14
  const require = createRequire(import.meta.url);
15
- const anzaPkg = require.resolve('@adukiorg/anza/package.json');
16
- const library = dirname(anzaPkg);
15
+
16
+ let library;
17
+ try {
18
+ const anzaPkg = require.resolve('@adukiorg/anza/package.json');
19
+ library = dirname(anzaPkg);
20
+ } catch (_) {
21
+ // Fallback for local development — resolve relative to this script in the repo
22
+ library = dirname(dirname(new URL(import.meta.url).pathname));
23
+ }
24
+
25
+ if (!library || !existsSync(join(library, 'package.json'))) {
26
+ console.error('@adukiorg/anza not found. Is it installed?');
27
+ process.exit(1);
28
+ }
17
29
 
18
30
  const { run } = await import(join(library, 'bin', 'create', 'index.js'));
19
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adukiorg/create-anza",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Create a new anza app — `npm create @adukiorg/anza`",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,7 +10,7 @@
10
10
  "index.js"
11
11
  ],
12
12
  "dependencies": {
13
- "@adukiorg/anza": "0.2.4"
13
+ "@adukiorg/anza": "0.2.5"
14
14
  },
15
15
  "keywords": [
16
16
  "anza",