@prosopo/detector 2.6.1 → 3.0.2

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/package.json CHANGED
@@ -1,41 +1,46 @@
1
1
  {
2
2
  "name": "@prosopo/detector",
3
- "version": "2.6.1",
4
- "main": "src/index.js",
3
+ "version": "3.0.2",
4
+ "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
5
6
  "engines": {
6
7
  "node": "20",
7
8
  "npm": "10.8.2"
8
9
  },
9
10
  "exports": {
10
11
  ".": {
12
+ "types": "./dist/index.d.ts",
11
13
  "import": "./dist/index.js",
12
14
  "require": "./dist/cjs/index.cjs"
13
15
  }
14
16
  },
15
17
  "scripts": {
16
- "test": "echo \"No test specified\"",
17
- "build": "tsc --build --verbose",
18
- "build:cjs": "npx vite --config vite.cjs.config.ts build",
19
- "clean": "tsc --build --clean"
18
+ "clean": "del-cli --verbose dist tsconfig.tsbuildinfo",
19
+ "build": "npm run clean && cp -r src dist",
20
+ "build:tsc": "tsc --build --verbose",
21
+ "build:cjs": "npm run build",
22
+ "typecheck": "echo no typecheck",
23
+ "test": "echo no tests"
20
24
  },
21
25
  "devDependencies": {
22
26
  "@vitest/coverage-v8": "3.0.9",
23
27
  "concurrently": "9.0.1",
24
28
  "del-cli": "6.0.0",
25
- "npm-run-all": "2.1.0",
29
+ "npm-run-all": "4.1.5",
26
30
  "tslib": "2.7.0",
27
- "tsx": "4.19.1",
31
+ "tsx": "4.20.3",
28
32
  "typescript": "5.6.2",
29
- "vite": "6.2.3",
33
+ "vite": "6.3.5",
30
34
  "vitest": "3.0.9"
31
35
  },
32
36
  "type": "module",
33
37
  "dependencies": {
34
- "express": "4.21.2"
35
- },
36
- "repository": {
37
- "type": "git",
38
- "url": "git+https://github.com/prosopo/captcha.git",
39
- "directory": "packages/detector"
38
+ "@typegoose/auto-increment": "4.13.0",
39
+ "axios": "1.10.0",
40
+ "esbuild": "0.25.6",
41
+ "express": "4.21.2",
42
+ "openpgp": "5.11.3",
43
+ "webpack-dev-server": "5.2.2",
44
+ "@prosopo/config": "3.1.2"
40
45
  }
41
46
  }
@@ -1,3 +1,4 @@
1
+ import path from "node:path";
1
2
  // Copyright 2021-2025 Prosopo (UK) Ltd.
2
3
  //
3
4
  // Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,13 +12,11 @@
11
12
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
13
  // See the License for the specific language governing permissions and
13
14
  // limitations under the License.
14
- import path from "node:path";
15
15
  import { ViteCommonJSConfig } from "@prosopo/config";
16
16
 
17
17
  export default function () {
18
18
  return ViteCommonJSConfig(
19
- "detector",
20
- path.resolve("./tsconfig.cjs.json"),
21
- "src/index.js",
19
+ path.basename("."),
20
+ path.resolve("./tsconfig.json"),
22
21
  );
23
22
  }
@@ -12,7 +12,9 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
 
15
- export function detect(): Promise<{
16
- token: string;
17
- }>;
18
- //# sourceMappingURL=index.d.ts.map
15
+ import path from "node:path";
16
+ import { ViteEsmConfig } from "@prosopo/config";
17
+
18
+ export default function () {
19
+ return ViteEsmConfig(path.basename("."), path.resolve("./tsconfig.json"));
20
+ }
@@ -0,0 +1,32 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ // Copyright 2021-2025 Prosopo (UK) Ltd.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 (the "License");
6
+ // you may not use this file except in compliance with the License.
7
+ // You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing, software
12
+ // distributed under the License is distributed on an "AS IS" BASIS,
13
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ // See the License for the specific language governing permissions and
15
+ // limitations under the License.
16
+ import { ViteTestConfig } from "@prosopo/config";
17
+ import dotenv from "dotenv";
18
+ process.env.NODE_ENV = "test";
19
+ // if .env.test exists at this level, use it, otherwise use the one at the root
20
+ const envFile = `.env.${process.env.NODE_ENV || "development"}`;
21
+ let envPath = envFile;
22
+ if (fs.existsSync(envFile)) {
23
+ envPath = path.resolve(envFile);
24
+ } else if (fs.existsSync(`../../${envFile}`)) {
25
+ envPath = path.resolve(`../../${envFile}`);
26
+ } else {
27
+ throw new Error(`No ${envFile} file found`);
28
+ }
29
+
30
+ dotenv.config({ path: envPath });
31
+
32
+ export default ViteTestConfig();