@peakfinder/headless 1.0.7 → 1.0.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/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ const native=require("./native/index.js"),{getDataDir:getDataDir,getCacheDir:getCacheDir}=require("./util/paths.js"),APP_NAME="PeakFinder",paths={dataDir:getDataDir(APP_NAME),cacheDir:getCacheDir(APP_NAME)};console.log(paths),native.init(paths),module.exports=native;
@@ -0,0 +1 @@
1
+ "use strict";const path=require("path"),load=require("node-gyp-build");module.exports=load(path.join(__dirname,"..",".."));
@@ -0,0 +1 @@
1
+ "use strict";const os=require("os"),path=require("path"),fs=require("fs");function ensureDir(e){return fs.mkdirSync(e,{recursive:!0}),e+path.sep}function getDataDir(e){let r;if("win32"===process.platform){const o=process.env.APPDATA;if(!o)throw new Error("APPDATA is not set");r=path.join(o,e)}else if("darwin"===process.platform)r=path.join(os.homedir(),"Library","Application Support",e);else{const o=process.env.XDG_DATA_HOME||path.join(os.homedir(),".local","share");r=path.join(o,e)}return ensureDir(r)}function getCacheDir(e){let r;if("win32"===process.platform){const o=process.env.LOCALAPPDATA;if(!o)throw new Error("LOCALAPPDATA is not set");r=path.join(o,e,"Cache")}else if("darwin"===process.platform)r=path.join(os.homedir(),"Library","Caches",e);else{const o=process.env.XDG_CACHE_HOME||path.join(os.homedir(),".cache");r=path.join(o,e)}return ensureDir(r)}module.exports={getDataDir:getDataDir,getCacheDir:getCacheDir};
package/package.json CHANGED
@@ -1,30 +1,39 @@
1
1
  {
2
2
  "name": "@peakfinder/headless",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "PeakFinder headless functions for getting 'true' sun and moon times by using a digital elevation model for the calculations.",
5
5
  "author": "Fabio Soldati <info@peakfinder.com> (https://www.peakfinder.com/about/)",
6
- "os": ["linux", "darwin", "win32"],
7
- "cpu": ["x64", "arm64"],
6
+ "os": [
7
+ "linux",
8
+ "darwin",
9
+ "win32"
10
+ ],
11
+ "cpu": [
12
+ "x64",
13
+ "arm64"
14
+ ],
8
15
  "license": "SEE LICENSE IN LICENSE.txt",
9
16
  "scripts": {
10
- "prebuild": "prebuildify --napi --strip",
11
- "test": "node --napi-modules ./test/test_index.js",
17
+ "minify": "node scripts/minify.js",
18
+ "test": "node scripts/minify.js && node --napi-modules ./test/test_index.js",
19
+ "testonly": "node --napi-modules ./test/test_index.js",
20
+ "prettier": "prettier --write '**/*.js'",
12
21
  "publishtonodejs": "npm publish --access public"
13
22
  },
14
- "main": "index.js",
23
+ "main": "dist/index.js",
15
24
  "files": [
16
- "index.js",
25
+ "dist/**/*",
17
26
  "prebuilds/**/*",
18
- "LICENSSE.txt"
27
+ "LICENSE.txt"
19
28
  ],
20
29
  "dependencies": {
21
30
  "node-addon-api": "^7.0.0",
22
31
  "node-gyp-build": "^4.8.0"
23
32
  },
24
33
  "devDependencies": {
34
+ "node-gyp": "^10.0.0",
25
35
  "prebuildify": "^6.0.0",
26
- "node-gyp": "^10.0.0"
36
+ "prettier": "^3.7.4",
37
+ "terser": "^5.44.1"
27
38
  }
28
39
  }
29
-
30
-
package/index.js DELETED
@@ -1,8 +0,0 @@
1
- 'use strict'
2
-
3
- // const path = require('path')
4
- // const load = require('node-gyp-build')
5
-
6
- // module.exports = load(path.join(__dirname))
7
-
8
- module.exports = require('node-gyp-build')(__dirname)