@swizzyweb/swerve-manager 0.3.1 → 0.3.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/deno.lock +1 -1
- package/dist/swerve.js +1 -0
- package/dist/utils/getPackageJson.js +0 -11
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +2 -2
- package/src/swerve.ts +1 -0
- package/src/utils/index.ts +1 -0
package/deno.lock
CHANGED
|
@@ -1212,7 +1212,7 @@
|
|
|
1212
1212
|
"packageJson": {
|
|
1213
1213
|
"dependencies": [
|
|
1214
1214
|
"npm:@swizzyweb/swizzy-common@~0.3.3",
|
|
1215
|
-
"npm:@swizzyweb/swizzy-web-service
|
|
1215
|
+
"npm:@swizzyweb/swizzy-web-service@0.6.2",
|
|
1216
1216
|
"npm:@types/express@^5.0.6",
|
|
1217
1217
|
"npm:@types/node@^22.18.6",
|
|
1218
1218
|
"npm:@typescript-eslint/eslint-plugin@^8.54.0",
|
package/dist/swerve.js
CHANGED
|
@@ -15,16 +15,11 @@ function isPath(input) {
|
|
|
15
15
|
export function getPackageJson(packageNameOrPath) {
|
|
16
16
|
try {
|
|
17
17
|
// Step 1: Resolve to an absolute path
|
|
18
|
-
// const resolvedEntry = isPath(packageNameOrPath)
|
|
19
|
-
// ? require.resolve(path.resolve(packageNameOrPath))
|
|
20
|
-
// : // : require.resolve(packageNameOrPath);
|
|
21
|
-
// require.resolve(packageNameOrPath, { paths: [process.cwd()] });
|
|
22
18
|
const resolvedEntry = isPath(packageNameOrPath)
|
|
23
19
|
? pathToFileURL(path.resolve(packageNameOrPath)).href
|
|
24
20
|
: import.meta.resolve(packageNameOrPath);
|
|
25
21
|
// Step 2: Traverse upward to find the nearest package.json
|
|
26
22
|
let dir = fileURLToPath(resolvedEntry); //path.dirname(resolvedEntry);
|
|
27
|
-
// console.log(dir);
|
|
28
23
|
while (dir !== path.parse(dir).root) {
|
|
29
24
|
const pkgPath = path.join(dir, "package.json");
|
|
30
25
|
if (fs.existsSync(pkgPath)) {
|
|
@@ -36,12 +31,7 @@ export function getPackageJson(packageNameOrPath) {
|
|
|
36
31
|
else if (dir.startsWith(".")) {
|
|
37
32
|
dir = path.join(process.cwd(), dir);
|
|
38
33
|
}
|
|
39
|
-
// console.log(dir);
|
|
40
34
|
const entrypoint = path.join(dir, packageJson.main);
|
|
41
|
-
// console.log(entrypoint);
|
|
42
|
-
// console.error(`Entrypoint is ${entrypoint}`);
|
|
43
|
-
// throw `Entrypoint is ${entrypoint}`;
|
|
44
|
-
console.log(`dir name in ${entrypoint}`);
|
|
45
35
|
return { packageJson, servicePath: entrypoint };
|
|
46
36
|
}
|
|
47
37
|
dir = path.dirname(dir);
|
|
@@ -73,7 +63,6 @@ export function getPackageJsonOrig(packageName) {
|
|
|
73
63
|
return null;
|
|
74
64
|
}
|
|
75
65
|
catch (error) {
|
|
76
|
-
//console.error(`Failed to resolve package "${packageName}":`, error);
|
|
77
66
|
return null;
|
|
78
67
|
}
|
|
79
68
|
}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swizzyweb/swerve-manager",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
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": "
|
|
33
|
+
"@swizzyweb/swizzy-web-service": "0.6.2",
|
|
34
34
|
"express": "^5.2.1"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
package/src/swerve.ts
CHANGED
package/src/utils/index.ts
CHANGED