create-rakomi-app 0.1.1 → 0.1.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.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  // SPDX-License-Identifier: MIT
3
- import { readFileSync } from 'node:fs';
3
+ import { readFileSync, realpathSync } from 'node:fs';
4
4
  import { appendFile, readFile } from 'node:fs/promises';
5
5
  import { isAbsolute, join, relative, resolve } from 'node:path';
6
6
  import process from 'node:process';
@@ -160,6 +160,23 @@ async function main() {
160
160
  ask: createTtyAsk(),
161
161
  });
162
162
  }
163
- if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
163
+ /**
164
+ * Whether this module is the process entry point. npm/npx invoke the bin through a symlink in
165
+ * `node_modules/.bin`, and `pathToFileURL` does not resolve symlinks — comparing against the raw
166
+ * `argv[1]` is false under npx, so the CLI exits 0 having done nothing. Resolve the real path
167
+ * first; fall back to the raw path when it cannot be resolved.
168
+ */
169
+ function isProcessEntry(argv1) {
170
+ if (!argv1)
171
+ return false;
172
+ let real = argv1;
173
+ try {
174
+ real = realpathSync(argv1);
175
+ }
176
+ catch {
177
+ }
178
+ return import.meta.url === pathToFileURL(real).href || import.meta.url === pathToFileURL(argv1).href;
179
+ }
180
+ if (isProcessEntry(process.argv[1])) {
164
181
  void main();
165
182
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rakomi-app",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Scaffold a Rakomi quickstart app. EU-native auth-as-a-service. npx create-rakomi-app --template <slug>",
5
5
  "keywords": [
6
6
  "rakomi",
package/sbom.cdx.json CHANGED
@@ -26,10 +26,10 @@
26
26
  },
27
27
  "component": {
28
28
  "type": "library",
29
- "bom-ref": "pkg:npm/create-rakomi-app@0.1.1",
29
+ "bom-ref": "pkg:npm/create-rakomi-app@0.1.2",
30
30
  "name": "create-rakomi-app",
31
- "version": "0.1.1",
32
- "purl": "pkg:npm/create-rakomi-app@0.1.1",
31
+ "version": "0.1.2",
32
+ "purl": "pkg:npm/create-rakomi-app@0.1.2",
33
33
  "licenses": [
34
34
  {
35
35
  "license": {