@prosopo/datasets-fs 0.3.4 → 0.3.36

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/datasets-fs",
3
- "version": "0.3.4",
3
+ "version": "0.3.36",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
6
  "private": false,
@@ -12,14 +12,14 @@
12
12
  "clean": "tsc --build --clean",
13
13
  "build": "tsc --build --verbose tsconfig.json",
14
14
  "build:cjs": "npx vite --config vite.cjs.config.ts build",
15
+ "test": "npx vitest run --config ./vite.test.config.ts",
15
16
  "eslint": "npx eslint . --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
16
17
  "eslint:fix": "npm run eslint -- --fix",
17
18
  "prettier": "npx prettier . --check --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
18
19
  "prettier:fix": "npm run prettier -- --write",
19
20
  "lint": "npm run eslint && npm run prettier",
20
21
  "lint:fix": "npm run eslint:fix && npm run prettier:fix",
21
- "cli": "node ./dist/cli.js",
22
- "test": "NODE_ENV=test vitest --run"
22
+ "cli": "node ./dist/cli.js"
23
23
  },
24
24
  "main": "./dist/index.js",
25
25
  "type": "module",
@@ -32,10 +32,10 @@
32
32
  "types": "./dist/index.d.ts",
33
33
  "dependencies": {
34
34
  "@polkadot/util": "12.6.1",
35
- "@prosopo/common": "0.3.4",
36
- "@prosopo/config": "0.3.4",
37
- "@prosopo/types": "0.3.4",
38
- "@prosopo/util": "0.3.4",
35
+ "@prosopo/common": "0.3.36",
36
+ "@prosopo/config": "0.3.36",
37
+ "@prosopo/types": "0.3.36",
38
+ "@prosopo/util": "0.3.36",
39
39
  "bcrypt": "^5.1.0",
40
40
  "cli-progress": "^3.12.0",
41
41
  "fs": "^0.0.1-security",
@@ -51,6 +51,7 @@
51
51
  "@types/bcrypt": "^5.0.0",
52
52
  "@types/cli-progress": "^3.11.2",
53
53
  "@types/node-fetch": "^3.0.2",
54
+ "dotenv": "^16.0.1",
54
55
  "tslib": "2.6.2",
55
56
  "typescript": "5.1.6"
56
57
  },
@@ -0,0 +1,32 @@
1
+ // Copyright 2021-2024 Prosopo (UK) Ltd.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { ViteTestConfig } from '@prosopo/config'
15
+ import dotenv from 'dotenv'
16
+ import fs from 'fs'
17
+ import path from 'path'
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