@swizzyweb/swerve-manager 0.1.8 → 0.1.9

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/LICENSE CHANGED
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright [yyyy] [name of copyright owner]
190
+ Copyright 2025 SwizzyWeb
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
package/dist/swerve.js CHANGED
@@ -161,8 +161,15 @@ export class SwerveManager {
161
161
  else {
162
162
  gLogger.debug(`Getting webservice with path: ${servicePath}`);
163
163
  }
164
+ let firstTool;
165
+ try {
166
+ firstTool = await import(packageName ?? servicePath);
167
+ }
168
+ 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
+ }
164
171
  const fullPath = await this.getImportName(packageName, servicePath);
165
- const tool = await import(fullPath);
172
+ const tool = firstTool ?? (await import(fullPath));
166
173
  gLogger.debug(`Got service with require: ${JSON.stringify(tool)}`);
167
174
  gLogger.debug(`Getting web service from tool...`);
168
175
  const appDataPath = path.join(appDataRoot, "appdata", serviceKey);
@@ -0,0 +1,32 @@
1
+ // eslint.config.js
2
+ import tsParser from "@typescript-eslint/parser";
3
+ import tsPlugin from "@typescript-eslint/eslint-plugin";
4
+
5
+ export default [
6
+ {
7
+ ignores: [
8
+ "dist/**", // Now ignores all of dist
9
+ "coverage/**", // Resolves unused eslint-disable warnings
10
+ "test/**",
11
+ ],
12
+ },
13
+ {
14
+ files: ["**/*.ts", "**/*.tsx"],
15
+ plugins: {
16
+ "@typescript-eslint": tsPlugin,
17
+ },
18
+ languageOptions: {
19
+ parser: tsParser,
20
+ parserOptions: {
21
+ // Update the project to point to your new file
22
+ project: "./tsconfig.eslint.json",
23
+ ecmaVersion: "latest",
24
+ sourceType: "module",
25
+ },
26
+ },
27
+ rules: {
28
+ "@typescript-eslint/no-floating-promises": "error",
29
+ // ... other TypeScript rules
30
+ },
31
+ },
32
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swizzyweb/swerve-manager",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
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",
@@ -22,8 +22,8 @@
22
22
  "typescript": "^5.9.2"
23
23
  },
24
24
  "dependencies": {
25
- "@swizzyweb/swizzy-common": "^0.3.2",
26
- "@swizzyweb/swizzy-web-service": "^0.5.4",
25
+ "@swizzyweb/swizzy-common": "^0.3.3",
26
+ "@swizzyweb/swizzy-web-service": "^0.5.5",
27
27
  "bun": "^1.2.22",
28
28
  "deno": "^2.5.2"
29
29
  },
package/src/swerve.ts CHANGED
@@ -274,9 +274,16 @@ export class SwerveManager implements ISwerveManager {
274
274
  } else {
275
275
  gLogger.debug(`Getting webservice with path: ${servicePath}`);
276
276
  }
277
-
277
+ let firstTool;
278
+ try {
279
+ firstTool = await import(packageName ?? servicePath);
280
+ } catch (e: any) {
281
+ gLogger.warn(
282
+ `Unable to import from raw tool path ${packageName ?? servicePath}, trying with import name. Err: ${e?.message}. Stack: ${e?.stack}`,
283
+ );
284
+ }
278
285
  const fullPath = await this.getImportName(packageName, servicePath);
279
- const tool = await import(fullPath);
286
+ const tool = firstTool ?? (await import(fullPath));
280
287
 
281
288
  gLogger.debug(`Got service with require: ${JSON.stringify(tool)}`);
282
289
  gLogger.debug(`Getting web service from tool...`);
@@ -0,0 +1,13 @@
1
+ // tsconfig.eslint.json
2
+ {
3
+ "extends": "./tsconfig.json",
4
+ "include": [
5
+ "test/**/*", // Include your test files
6
+ "src/**/*" // Include your source files
7
+ ],
8
+ "exclude": [
9
+ // Ensure you exclude the dist folder, test files from build, etc.
10
+ "dist/**/*",
11
+ "**/*.spec.ts"
12
+ ]
13
+ }