harnspec 0.0.1 → 0.0.2

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/bin/harnspec.js +12 -5
  2. package/package.json +2 -2
package/bin/harnspec.js CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
+ import { pathToFileURL } from 'node:url';
4
+
3
5
  const require = createRequire(import.meta.url);
4
6
 
5
7
  /**
@@ -10,11 +12,16 @@ const require = createRequire(import.meta.url);
10
12
  */
11
13
  try {
12
14
  const cliPath = require.resolve('@harnspec/cli/bin/harnspec.js');
13
- await import(cliPath);
15
+ const cliUrl = pathToFileURL(cliPath).href;
16
+ await import(cliUrl);
14
17
  } catch (err) {
15
- console.error('Error: Failed to find @harnspec/cli. Make sure it is installed.');
16
- console.error('If you installed this package globally, try:');
17
- console.error(' npm install -g @harnspec/cli');
18
- console.debug(err);
18
+ if (err.code === 'MODULE_NOT_FOUND') {
19
+ console.error('Error: Failed to find @harnspec/cli. Make sure it is installed.');
20
+ console.error('If you installed this package globally, try:');
21
+ console.error(' npm install -g @harnspec/cli');
22
+ } else {
23
+ console.error('Error: Failed to load @harnspec/cli.');
24
+ console.error(err);
25
+ }
19
26
  process.exit(1);
20
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harnspec",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Specification-driven development made simple (Main entry for HarnSpec CLI)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,7 +10,7 @@
10
10
  "typecheck": "echo 'No TypeScript source to check'"
11
11
  },
12
12
  "dependencies": {
13
- "@harnspec/cli": "0.0.1"
13
+ "@harnspec/cli": "0.0.2"
14
14
  },
15
15
  "keywords": [
16
16
  "spec",