@swizzyweb/swerve-manager 0.3.0 → 0.3.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.
- package/deno.lock +1 -2
- package/package.json +2 -2
- package/src/utils/getPackageJson.ts +1 -11
package/deno.lock
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
"version": "5",
|
|
3
3
|
"specifiers": {
|
|
4
4
|
"npm:@swizzyweb/swizzy-common@~0.3.3": "0.3.3",
|
|
5
|
-
"npm:@swizzyweb/swizzy-web-service@0.6": "0.6.0_winston@3.19.0",
|
|
6
5
|
"npm:@types/express@^5.0.6": "5.0.6",
|
|
7
6
|
"npm:@types/node@^22.18.6": "22.19.7",
|
|
8
7
|
"npm:@typescript-eslint/eslint-plugin@^8.54.0": "8.54.0_@typescript-eslint+parser@8.54.0__eslint@9.39.2__typescript@5.9.3_eslint@9.39.2_typescript@5.9.3",
|
|
@@ -1213,7 +1212,7 @@
|
|
|
1213
1212
|
"packageJson": {
|
|
1214
1213
|
"dependencies": [
|
|
1215
1214
|
"npm:@swizzyweb/swizzy-common@~0.3.3",
|
|
1216
|
-
"npm:@swizzyweb/swizzy-web-service
|
|
1215
|
+
"npm:@swizzyweb/swizzy-web-service@~0.6.1",
|
|
1217
1216
|
"npm:@types/express@^5.0.6",
|
|
1218
1217
|
"npm:@types/node@^22.18.6",
|
|
1219
1218
|
"npm:@typescript-eslint/eslint-plugin@^8.54.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swizzyweb/swerve-manager",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "swizzy-swerve is a bootstrapper for swizzy web services. This package will bootstrap and run independent swizzy web services.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@swizzyweb/swizzy-common": "^0.3.3",
|
|
33
|
-
"@swizzyweb/swizzy-web-service": "^0.6.
|
|
33
|
+
"@swizzyweb/swizzy-web-service": "^0.6.1",
|
|
34
34
|
"express": "^5.2.1"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
|
@@ -19,17 +19,12 @@ export function getPackageJson(
|
|
|
19
19
|
): { packageJson: Record<string, any>; servicePath: string } | null {
|
|
20
20
|
try {
|
|
21
21
|
// Step 1: Resolve to an absolute path
|
|
22
|
-
// const resolvedEntry = isPath(packageNameOrPath)
|
|
23
|
-
// ? require.resolve(path.resolve(packageNameOrPath))
|
|
24
|
-
// : // : require.resolve(packageNameOrPath);
|
|
25
|
-
// require.resolve(packageNameOrPath, { paths: [process.cwd()] });
|
|
26
22
|
const resolvedEntry = isPath(packageNameOrPath)
|
|
27
23
|
? pathToFileURL(path.resolve(packageNameOrPath)).href
|
|
28
24
|
: import.meta.resolve(packageNameOrPath);
|
|
29
25
|
|
|
30
26
|
// Step 2: Traverse upward to find the nearest package.json
|
|
31
27
|
let dir = fileURLToPath(resolvedEntry); //path.dirname(resolvedEntry);
|
|
32
|
-
// console.log(dir);
|
|
33
28
|
while (dir !== path.parse(dir).root) {
|
|
34
29
|
const pkgPath = path.join(dir, "package.json");
|
|
35
30
|
if (fs.existsSync(pkgPath)) {
|
|
@@ -40,12 +35,8 @@ export function getPackageJson(
|
|
|
40
35
|
} else if (dir.startsWith(".")) {
|
|
41
36
|
dir = path.join(process.cwd(), dir);
|
|
42
37
|
}
|
|
43
|
-
|
|
38
|
+
|
|
44
39
|
const entrypoint = path.join(dir, packageJson.main);
|
|
45
|
-
// console.log(entrypoint);
|
|
46
|
-
// console.error(`Entrypoint is ${entrypoint}`);
|
|
47
|
-
// throw `Entrypoint is ${entrypoint}`;
|
|
48
|
-
console.log(`dir name in ${entrypoint}`);
|
|
49
40
|
return { packageJson, servicePath: entrypoint };
|
|
50
41
|
}
|
|
51
42
|
dir = path.dirname(dir);
|
|
@@ -85,7 +76,6 @@ export function getPackageJsonOrig(
|
|
|
85
76
|
|
|
86
77
|
return null;
|
|
87
78
|
} catch (error) {
|
|
88
|
-
//console.error(`Failed to resolve package "${packageName}":`, error);
|
|
89
79
|
return null;
|
|
90
80
|
}
|
|
91
81
|
}
|