@swizzyweb/swerve-manager 0.1.9 → 0.2.0

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/swerve.js CHANGED
@@ -155,7 +155,7 @@ export class SwerveManager {
155
155
  const { app, appDataRoot, packageName, port, gLogger, serviceArgs, servicePath, serviceKey, } = props;
156
156
  try {
157
157
  gLogger.info(`Getting webservice package ${packageName} and will run on port ${port}`);
158
- if (packageName) {
158
+ if (servicePath ?? packageName) {
159
159
  gLogger.debug(`Getting web service with name ${packageName}`);
160
160
  }
161
161
  else {
@@ -163,10 +163,11 @@ export class SwerveManager {
163
163
  }
164
164
  let firstTool;
165
165
  try {
166
- firstTool = await import(packageName ?? servicePath);
166
+ firstTool = await import(servicePath ?? packageName);
167
+ gLogger.info(`Imported from raw path ${servicePath}`);
167
168
  }
168
169
  catch (e) {
169
- gLogger.warn(`Unable to import from raw tool path ${packageName ?? servicePath}, trying with import name. Err: ${e?.message}. Stack: ${e?.stack}`);
170
+ gLogger.warn(`Unable to import from raw tool path ${servicePath ?? packageName}, trying with import name. Err: ${e?.message}. Stack: ${e?.stack}`);
170
171
  }
171
172
  const fullPath = await this.getImportName(packageName, servicePath);
172
173
  const tool = firstTool ?? (await import(fullPath));
@@ -41,6 +41,7 @@ export function getPackageJson(packageNameOrPath) {
41
41
  // console.log(entrypoint);
42
42
  // console.error(`Entrypoint is ${entrypoint}`);
43
43
  // throw `Entrypoint is ${entrypoint}`;
44
+ console.log(`dir name in ${entrypoint}`);
44
45
  return { packageJson, servicePath: entrypoint };
45
46
  }
46
47
  dir = path.dirname(dir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swizzyweb/swerve-manager",
3
- "version": "0.1.9",
3
+ "version": "0.2.0",
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",
package/src/swerve.ts CHANGED
@@ -269,17 +269,18 @@ export class SwerveManager implements ISwerveManager {
269
269
  `Getting webservice package ${packageName} and will run on port ${port}`,
270
270
  );
271
271
 
272
- if (packageName) {
272
+ if (servicePath ?? packageName) {
273
273
  gLogger.debug(`Getting web service with name ${packageName}`);
274
274
  } else {
275
275
  gLogger.debug(`Getting webservice with path: ${servicePath}`);
276
276
  }
277
277
  let firstTool;
278
278
  try {
279
- firstTool = await import(packageName ?? servicePath);
279
+ firstTool = await import(servicePath ?? packageName);
280
+ gLogger.info(`Imported from raw path ${servicePath}`);
280
281
  } catch (e: any) {
281
282
  gLogger.warn(
282
- `Unable to import from raw tool path ${packageName ?? servicePath}, trying with import name. Err: ${e?.message}. Stack: ${e?.stack}`,
283
+ `Unable to import from raw tool path ${servicePath ?? packageName}, trying with import name. Err: ${e?.message}. Stack: ${e?.stack}`,
283
284
  );
284
285
  }
285
286
  const fullPath = await this.getImportName(packageName, servicePath);
@@ -45,6 +45,7 @@ export function getPackageJson(
45
45
  // console.log(entrypoint);
46
46
  // console.error(`Entrypoint is ${entrypoint}`);
47
47
  // throw `Entrypoint is ${entrypoint}`;
48
+ console.log(`dir name in ${entrypoint}`);
48
49
  return { packageJson, servicePath: entrypoint };
49
50
  }
50
51
  dir = path.dirname(dir);