kaabalah 6.3.0 → 6.4.1

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.
@@ -1,6 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkMJINIICB_js = require('../chunk-MJINIICB.js');
3
+ var chunkUG6HZK3Z_js = require('../chunk-UG6HZK3Z.js');
4
+ require('../chunk-6O7MTBZN.js');
5
+ require('../chunk-PAKYKIZH.js');
6
+ require('../chunk-COPYH3O2.js');
4
7
  require('../chunk-XTE5DSDO.js');
5
8
  require('../chunk-OKZUVGA3.js');
6
9
  require('../chunk-S6KNERP7.js');
@@ -10,27 +13,79 @@ require('../chunk-FM7WUVZV.js');
10
13
 
11
14
  Object.defineProperty(exports, "OCCULT_THEME_STOPWORDS", {
12
15
  enumerable: true,
13
- get: function () { return chunkMJINIICB_js.OCCULT_THEME_STOPWORDS; }
16
+ get: function () { return chunkUG6HZK3Z_js.OCCULT_THEME_STOPWORDS; }
17
+ });
18
+ Object.defineProperty(exports, "buildKaabalisticMapData", {
19
+ enumerable: true,
20
+ get: function () { return chunkUG6HZK3Z_js.buildKaabalisticMapData; }
21
+ });
22
+ Object.defineProperty(exports, "getAngleSymbolMetadata", {
23
+ enumerable: true,
24
+ get: function () { return chunkUG6HZK3Z_js.getAngleSymbolMetadata; }
25
+ });
26
+ Object.defineProperty(exports, "getAstrologyTreeMarkers", {
27
+ enumerable: true,
28
+ get: function () { return chunkUG6HZK3Z_js.getAstrologyTreeMarkers; }
29
+ });
30
+ Object.defineProperty(exports, "getGematriaTreeMarkers", {
31
+ enumerable: true,
32
+ get: function () { return chunkUG6HZK3Z_js.getGematriaTreeMarkers; }
14
33
  });
15
34
  Object.defineProperty(exports, "getHouseThemeProfile", {
16
35
  enumerable: true,
17
- get: function () { return chunkMJINIICB_js.getHouseThemeProfile; }
36
+ get: function () { return chunkUG6HZK3Z_js.getHouseThemeProfile; }
37
+ });
38
+ Object.defineProperty(exports, "getKaabalisticCorrespondenceTargets", {
39
+ enumerable: true,
40
+ get: function () { return chunkUG6HZK3Z_js.getKaabalisticCorrespondenceTargets; }
41
+ });
42
+ Object.defineProperty(exports, "getNodeSymbolMetadata", {
43
+ enumerable: true,
44
+ get: function () { return chunkUG6HZK3Z_js.getNodeSymbolMetadata; }
45
+ });
46
+ Object.defineProperty(exports, "getNumerologyTreeMarkers", {
47
+ enumerable: true,
48
+ get: function () { return chunkUG6HZK3Z_js.getNumerologyTreeMarkers; }
49
+ });
50
+ Object.defineProperty(exports, "getPlanetSymbolMetadata", {
51
+ enumerable: true,
52
+ get: function () { return chunkUG6HZK3Z_js.getPlanetSymbolMetadata; }
18
53
  });
19
54
  Object.defineProperty(exports, "getTarotThemeProfile", {
20
55
  enumerable: true,
21
- get: function () { return chunkMJINIICB_js.getTarotThemeProfile; }
56
+ get: function () { return chunkUG6HZK3Z_js.getTarotThemeProfile; }
57
+ });
58
+ Object.defineProperty(exports, "getZodiacSignSymbolMetadata", {
59
+ enumerable: true,
60
+ get: function () { return chunkUG6HZK3Z_js.getZodiacSignSymbolMetadata; }
61
+ });
62
+ Object.defineProperty(exports, "listAngleSymbolMetadata", {
63
+ enumerable: true,
64
+ get: function () { return chunkUG6HZK3Z_js.listAngleSymbolMetadata; }
22
65
  });
23
66
  Object.defineProperty(exports, "listHouseThemeProfiles", {
24
67
  enumerable: true,
25
- get: function () { return chunkMJINIICB_js.listHouseThemeProfiles; }
68
+ get: function () { return chunkUG6HZK3Z_js.listHouseThemeProfiles; }
69
+ });
70
+ Object.defineProperty(exports, "listNodeSymbolMetadata", {
71
+ enumerable: true,
72
+ get: function () { return chunkUG6HZK3Z_js.listNodeSymbolMetadata; }
73
+ });
74
+ Object.defineProperty(exports, "listPlanetSymbolMetadata", {
75
+ enumerable: true,
76
+ get: function () { return chunkUG6HZK3Z_js.listPlanetSymbolMetadata; }
26
77
  });
27
78
  Object.defineProperty(exports, "listTarotThemeProfiles", {
28
79
  enumerable: true,
29
- get: function () { return chunkMJINIICB_js.listTarotThemeProfiles; }
80
+ get: function () { return chunkUG6HZK3Z_js.listTarotThemeProfiles; }
81
+ });
82
+ Object.defineProperty(exports, "listZodiacSignSymbolMetadata", {
83
+ enumerable: true,
84
+ get: function () { return chunkUG6HZK3Z_js.listZodiacSignSymbolMetadata; }
30
85
  });
31
86
  Object.defineProperty(exports, "tokenizeOccultThemeText", {
32
87
  enumerable: true,
33
- get: function () { return chunkMJINIICB_js.tokenizeOccultThemeText; }
88
+ get: function () { return chunkUG6HZK3Z_js.tokenizeOccultThemeText; }
34
89
  });
35
90
  //# sourceMappingURL=index.js.map
36
91
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,7 @@
1
- export { OCCULT_THEME_STOPWORDS, getHouseThemeProfile, getTarotThemeProfile, listHouseThemeProfiles, listTarotThemeProfiles, tokenizeOccultThemeText } from '../chunk-HGGCF2CF.mjs';
1
+ export { OCCULT_THEME_STOPWORDS, buildKaabalisticMapData, getAngleSymbolMetadata, getAstrologyTreeMarkers, getGematriaTreeMarkers, getHouseThemeProfile, getKaabalisticCorrespondenceTargets, getNodeSymbolMetadata, getNumerologyTreeMarkers, getPlanetSymbolMetadata, getTarotThemeProfile, getZodiacSignSymbolMetadata, listAngleSymbolMetadata, listHouseThemeProfiles, listNodeSymbolMetadata, listPlanetSymbolMetadata, listTarotThemeProfiles, listZodiacSignSymbolMetadata, tokenizeOccultThemeText } from '../chunk-UN7QMOMX.mjs';
2
+ import '../chunk-PWYOHULD.mjs';
3
+ import '../chunk-6P2CJUTH.mjs';
4
+ import '../chunk-WIKUOEOB.mjs';
2
5
  import '../chunk-MTI2SOQ6.mjs';
3
6
  import '../chunk-ZKIJAZ6B.mjs';
4
7
  import '../chunk-EFZUZI22.mjs';
@@ -0,0 +1,127 @@
1
+ # Swiss Ephemeris WebAssembly Integration
2
+
3
+ This document explains how to set up and use the Swiss Ephemeris WebAssembly integration in the Kaabalah library.
4
+
5
+ ## Overview
6
+
7
+ The Swiss Ephemeris is a high-precision astronomical calculation library written in C that is widely used for astrological calculations. To use it in web browsers via our JavaScript/TypeScript library, we've created a WebAssembly wrapper.
8
+
9
+ ## Prerequisites
10
+
11
+ To compile the Swiss Ephemeris to WebAssembly, you will need:
12
+
13
+ 1. **Emscripten SDK (emsdk)**: The compiler toolchain for WebAssembly
14
+ - Installation instructions: https://emscripten.org/docs/getting_started/downloads.html
15
+
16
+ 2. **Swiss Ephemeris Source Code**: The C code that will be compiled
17
+ - Download from: https://www.astro.com/swisseph/swesrc.htm
18
+
19
+ 3. **Ephemeris Files**: Data files used by Swiss Ephemeris for calculations
20
+ - Download from: https://www.astro.com/ftp/swisseph/ephe/
21
+
22
+ ## Compilation Process
23
+
24
+ 1. **Download the Swiss Ephemeris source code** and extract it to the `wasm/swisseph` directory
25
+
26
+ 2. **Install Emscripten SDK** by following their installation instructions
27
+
28
+ 3. **Compile the code** using the provided script:
29
+ ```bash
30
+ cd wasm/scripts
31
+ chmod +x compile.sh
32
+ ./compile.sh
33
+ ```
34
+
35
+ 4. **Verify the output files**:
36
+ - `wasm/build/swisseph.js`: JavaScript glue code
37
+ - `wasm/build/swisseph.wasm`: WebAssembly binary
38
+
39
+ ## Integration with the Library
40
+
41
+ The Swiss Ephemeris WebAssembly integration is used by the astrology module to perform accurate astronomical calculations.
42
+
43
+ ### Module Structure
44
+
45
+ - `src/astrology/swisseph.ts`: Wrapper that interfaces with the WebAssembly module
46
+ - `src/astrology/index.ts`: Main astrology functionality that uses the wrapper
47
+
48
+ ### Dynamic Loading
49
+
50
+ The WebAssembly module is loaded dynamically at runtime, making it compatible with both Node.js and browser environments. This approach ensures that:
51
+
52
+ 1. The heavy WebAssembly code is only loaded when needed
53
+ 2. The same code works in both Node.js and browsers
54
+ 3. The library can gracefully fall back if WebAssembly is not available
55
+
56
+ ## Usage in Browser
57
+
58
+ To use the Swiss Ephemeris in a browser environment:
59
+
60
+ 1. **Copy the WebAssembly files** to a location accessible by your web application:
61
+ - `swisseph.js`
62
+ - `swisseph.wasm`
63
+
64
+ 2. **Handle cross-origin issues**: Ensure your web server is configured to serve WebAssembly files with the correct MIME type (`application/wasm`)
65
+
66
+ 3. **Provide the ephemeris files** that Swiss Ephemeris needs for calculations:
67
+ - Create a directory accessible by your web application
68
+ - Place the ephemeris files (*.se1) in that directory
69
+ - Specify the path when initializing the Swiss Ephemeris module
70
+
71
+ ## Usage in Node.js
72
+
73
+ For Node.js environments:
74
+
75
+ 1. **Include the built WebAssembly files** in your published package:
76
+ - Add them to the `files` array in `package.json`
77
+ - Make sure they're copied to the `dist` directory during build
78
+
79
+ 2. **Place ephemeris files** in a known location:
80
+ - For example, in a subdirectory named `ephe` within your package
81
+ - Set the ephemeris path when initializing the module
82
+
83
+ ## Fallback Mechanism
84
+
85
+ The astrology module includes a fallback mechanism to handle situations where the WebAssembly module might not be available:
86
+
87
+ 1. If compilation fails or the WebAssembly files are missing, the module gracefully degrades
88
+ 2. Placeholder values are returned instead of throwing errors
89
+ 3. A warning is logged to the console
90
+
91
+ ## Example Implementation
92
+
93
+ ```typescript
94
+ import { getBirthChart } from 'kaabalah/astrology';
95
+
96
+ // Calculate a birth chart
97
+ const chart = await getBirthChart({
98
+ date: new Date('1990-06-15T12:30:00'),
99
+ latitude: 40.7128,
100
+ longitude: -74.0060,
101
+ timezone: -4
102
+ });
103
+
104
+ console.log(`Ascendant: ${chart.ascendant}`);
105
+ console.log(`Sun position: ${chart.planets.sun.longitude}`);
106
+ ```
107
+
108
+ ## Troubleshooting
109
+
110
+ ### Common Issues
111
+
112
+ 1. **"WebAssembly module not found"**:
113
+ - Ensure the .wasm and .js files are properly included in your distribution
114
+ - Check the paths in your code
115
+
116
+ 2. **"Cannot find ephemeris files"**:
117
+ - Make sure the ephemeris files are available at the specified path
118
+ - Check file permissions
119
+
120
+ 3. **"Calculation error"**:
121
+ - Verify the input parameters (date, location) are valid
122
+ - Ensure you have the correct ephemeris files for the date range
123
+
124
+ ### Debugging Tools
125
+
126
+ - Use browser developer tools to check for WASM-related errors in the console
127
+ - Enable the `ASSERTIONS=1` flag during compilation for more verbose error messages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaabalah",
3
- "version": "6.3.0",
3
+ "version": "6.4.1",
4
4
  "description": "The de-facto library for any esoteric calculations and tooling",
5
5
  "engines": {
6
6
  "node": ">=18.18.0"
@@ -0,0 +1,127 @@
1
+ # Swiss Ephemeris WebAssembly Integration
2
+
3
+ This document explains how to set up and use the Swiss Ephemeris WebAssembly integration in the Kaabalah library.
4
+
5
+ ## Overview
6
+
7
+ The Swiss Ephemeris is a high-precision astronomical calculation library written in C that is widely used for astrological calculations. To use it in web browsers via our JavaScript/TypeScript library, we've created a WebAssembly wrapper.
8
+
9
+ ## Prerequisites
10
+
11
+ To compile the Swiss Ephemeris to WebAssembly, you will need:
12
+
13
+ 1. **Emscripten SDK (emsdk)**: The compiler toolchain for WebAssembly
14
+ - Installation instructions: https://emscripten.org/docs/getting_started/downloads.html
15
+
16
+ 2. **Swiss Ephemeris Source Code**: The C code that will be compiled
17
+ - Download from: https://www.astro.com/swisseph/swesrc.htm
18
+
19
+ 3. **Ephemeris Files**: Data files used by Swiss Ephemeris for calculations
20
+ - Download from: https://www.astro.com/ftp/swisseph/ephe/
21
+
22
+ ## Compilation Process
23
+
24
+ 1. **Download the Swiss Ephemeris source code** and extract it to the `wasm/swisseph` directory
25
+
26
+ 2. **Install Emscripten SDK** by following their installation instructions
27
+
28
+ 3. **Compile the code** using the provided script:
29
+ ```bash
30
+ cd wasm/scripts
31
+ chmod +x compile.sh
32
+ ./compile.sh
33
+ ```
34
+
35
+ 4. **Verify the output files**:
36
+ - `wasm/build/swisseph.js`: JavaScript glue code
37
+ - `wasm/build/swisseph.wasm`: WebAssembly binary
38
+
39
+ ## Integration with the Library
40
+
41
+ The Swiss Ephemeris WebAssembly integration is used by the astrology module to perform accurate astronomical calculations.
42
+
43
+ ### Module Structure
44
+
45
+ - `src/astrology/swisseph.ts`: Wrapper that interfaces with the WebAssembly module
46
+ - `src/astrology/index.ts`: Main astrology functionality that uses the wrapper
47
+
48
+ ### Dynamic Loading
49
+
50
+ The WebAssembly module is loaded dynamically at runtime, making it compatible with both Node.js and browser environments. This approach ensures that:
51
+
52
+ 1. The heavy WebAssembly code is only loaded when needed
53
+ 2. The same code works in both Node.js and browsers
54
+ 3. The library can gracefully fall back if WebAssembly is not available
55
+
56
+ ## Usage in Browser
57
+
58
+ To use the Swiss Ephemeris in a browser environment:
59
+
60
+ 1. **Copy the WebAssembly files** to a location accessible by your web application:
61
+ - `swisseph.js`
62
+ - `swisseph.wasm`
63
+
64
+ 2. **Handle cross-origin issues**: Ensure your web server is configured to serve WebAssembly files with the correct MIME type (`application/wasm`)
65
+
66
+ 3. **Provide the ephemeris files** that Swiss Ephemeris needs for calculations:
67
+ - Create a directory accessible by your web application
68
+ - Place the ephemeris files (*.se1) in that directory
69
+ - Specify the path when initializing the Swiss Ephemeris module
70
+
71
+ ## Usage in Node.js
72
+
73
+ For Node.js environments:
74
+
75
+ 1. **Include the built WebAssembly files** in your published package:
76
+ - Add them to the `files` array in `package.json`
77
+ - Make sure they're copied to the `dist` directory during build
78
+
79
+ 2. **Place ephemeris files** in a known location:
80
+ - For example, in a subdirectory named `ephe` within your package
81
+ - Set the ephemeris path when initializing the module
82
+
83
+ ## Fallback Mechanism
84
+
85
+ The astrology module includes a fallback mechanism to handle situations where the WebAssembly module might not be available:
86
+
87
+ 1. If compilation fails or the WebAssembly files are missing, the module gracefully degrades
88
+ 2. Placeholder values are returned instead of throwing errors
89
+ 3. A warning is logged to the console
90
+
91
+ ## Example Implementation
92
+
93
+ ```typescript
94
+ import { getBirthChart } from 'kaabalah/astrology';
95
+
96
+ // Calculate a birth chart
97
+ const chart = await getBirthChart({
98
+ date: new Date('1990-06-15T12:30:00'),
99
+ latitude: 40.7128,
100
+ longitude: -74.0060,
101
+ timezone: -4
102
+ });
103
+
104
+ console.log(`Ascendant: ${chart.ascendant}`);
105
+ console.log(`Sun position: ${chart.planets.sun.longitude}`);
106
+ ```
107
+
108
+ ## Troubleshooting
109
+
110
+ ### Common Issues
111
+
112
+ 1. **"WebAssembly module not found"**:
113
+ - Ensure the .wasm and .js files are properly included in your distribution
114
+ - Check the paths in your code
115
+
116
+ 2. **"Cannot find ephemeris files"**:
117
+ - Make sure the ephemeris files are available at the specified path
118
+ - Check file permissions
119
+
120
+ 3. **"Calculation error"**:
121
+ - Verify the input parameters (date, location) are valid
122
+ - Ensure you have the correct ephemeris files for the date range
123
+
124
+ ### Debugging Tools
125
+
126
+ - Use browser developer tools to check for WASM-related errors in the console
127
+ - Enable the `ASSERTIONS=1` flag during compilation for more verbose error messages