syncular 0.1.1 → 0.1.3
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/cli.js +14 -3
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
constants,
|
|
8
8
|
existsSync,
|
|
9
9
|
mkdirSync,
|
|
10
|
-
readFileSync
|
|
10
|
+
readFileSync,
|
|
11
|
+
realpathSync
|
|
11
12
|
} from "node:fs";
|
|
12
13
|
import { homedir } from "node:os";
|
|
13
14
|
import { delimiter, dirname, join, resolve, sep } from "node:path";
|
|
@@ -456,9 +457,18 @@ async function runSyncularCli(argv = process.argv.slice(2)) {
|
|
|
456
457
|
return 1;
|
|
457
458
|
}
|
|
458
459
|
}
|
|
460
|
+
function isMainModuleEntrypoint(entrypoint, moduleUrl = import.meta.url) {
|
|
461
|
+
if (entrypoint === undefined) {
|
|
462
|
+
return false;
|
|
463
|
+
}
|
|
464
|
+
try {
|
|
465
|
+
return realpathSync(entrypoint) === realpathSync(fileURLToPath(moduleUrl));
|
|
466
|
+
} catch {
|
|
467
|
+
return pathToFileURL(entrypoint).href === moduleUrl;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
459
470
|
function isMainModule() {
|
|
460
|
-
|
|
461
|
-
return entrypoint !== undefined && import.meta.url === pathToFileURL(entrypoint).href;
|
|
471
|
+
return isMainModuleEntrypoint(process.argv[1]);
|
|
462
472
|
}
|
|
463
473
|
if (isMainModule()) {
|
|
464
474
|
process.exitCode = await runSyncularCli();
|
|
@@ -468,6 +478,7 @@ export {
|
|
|
468
478
|
runGenerateCommand,
|
|
469
479
|
runCodegenInstallCommand,
|
|
470
480
|
parseSyncularCliArgs,
|
|
481
|
+
isMainModuleEntrypoint,
|
|
471
482
|
buildGenerateSteps,
|
|
472
483
|
buildCodegenInstallArgs
|
|
473
484
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syncular",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Syncular CLI (`npx syncular generate`) for the @syncular/* packages",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Benjamin Kniffler",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@syncular/typegen": "0.1.
|
|
41
|
+
"@syncular/typegen": "0.1.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@syncular/config": "0.0.0"
|