make-mp-data 2.0.0 → 2.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.
Files changed (64) hide show
  1. package/dungeons/adspend.js +96 -0
  2. package/dungeons/anon.js +104 -0
  3. package/dungeons/big.js +225 -0
  4. package/dungeons/business.js +345 -0
  5. package/dungeons/complex.js +396 -0
  6. package/dungeons/experiments.js +125 -0
  7. package/dungeons/foobar.js +241 -0
  8. package/dungeons/funnels.js +272 -0
  9. package/dungeons/gaming.js +315 -0
  10. package/dungeons/media.js +7 -7
  11. package/dungeons/mirror.js +129 -0
  12. package/dungeons/sanity.js +113 -0
  13. package/dungeons/scd.js +205 -0
  14. package/dungeons/simple.js +195 -0
  15. package/dungeons/userAgent.js +190 -0
  16. package/entry.js +57 -0
  17. package/index.js +96 -68
  18. package/lib/cli/cli.js +10 -5
  19. package/lib/core/config-validator.js +28 -12
  20. package/lib/core/context.js +147 -130
  21. package/lib/core/storage.js +45 -31
  22. package/lib/data/defaults.js +2 -2
  23. package/lib/generators/adspend.js +1 -2
  24. package/lib/generators/events.js +35 -24
  25. package/lib/generators/funnels.js +1 -2
  26. package/lib/generators/mirror.js +1 -2
  27. package/lib/orchestrators/mixpanel-sender.js +15 -7
  28. package/lib/orchestrators/user-loop.js +21 -10
  29. package/lib/orchestrators/worker-manager.js +5 -2
  30. package/lib/utils/ai.js +36 -63
  31. package/lib/utils/chart.js +5 -0
  32. package/lib/utils/instructions.txt +593 -0
  33. package/lib/utils/utils.js +162 -38
  34. package/package.json +23 -9
  35. package/types.d.ts +376 -376
  36. package/.claude/settings.local.json +0 -20
  37. package/.gcloudignore +0 -18
  38. package/.gitattributes +0 -2
  39. package/.prettierrc +0 -0
  40. package/.vscode/launch.json +0 -80
  41. package/.vscode/settings.json +0 -69
  42. package/.vscode/tasks.json +0 -12
  43. package/dungeons/customers/.gitkeep +0 -0
  44. package/env.yaml +0 -1
  45. package/lib/cloud-function.js +0 -20
  46. package/scratch.mjs +0 -62
  47. package/scripts/dana.mjs +0 -137
  48. package/scripts/deploy.sh +0 -15
  49. package/scripts/jsdoctest.js +0 -5
  50. package/scripts/new-dungeon.sh +0 -98
  51. package/scripts/new-project.mjs +0 -14
  52. package/scripts/run-index.sh +0 -2
  53. package/scripts/update-deps.sh +0 -5
  54. package/tests/benchmark/concurrency.mjs +0 -52
  55. package/tests/cli.test.js +0 -124
  56. package/tests/coverage/.gitkeep +0 -0
  57. package/tests/e2e.test.js +0 -379
  58. package/tests/int.test.js +0 -715
  59. package/tests/testCases.mjs +0 -229
  60. package/tests/testSoup.mjs +0 -28
  61. package/tests/unit.test.js +0 -910
  62. package/tmp/.gitkeep +0 -0
  63. package/tsconfig.json +0 -18
  64. package/vitest.config.js +0 -47
@@ -1,229 +0,0 @@
1
- const TEST_CASES = [
2
- //defaults
3
- {
4
- name: "default",
5
- mean: 0,
6
- deviation: 2,
7
- peaks: 5,
8
- },
9
-
10
- // test deviation low to high
11
- {
12
- name: "dev-negative",
13
- mean: 0,
14
- deviation: -2,
15
- peaks: 5,
16
- },
17
- {
18
- name: "dev-one",
19
- mean: 0,
20
- deviation: 1,
21
- peaks: 5,
22
- },
23
- {
24
- name: "dev-high",
25
- mean: 0,
26
- deviation: 10,
27
- peaks: 5,
28
- },
29
- {
30
- name: "dev-one-half",
31
- mean: 0,
32
- deviation: .5,
33
- peaks: 5,
34
- },
35
- {
36
- name: "dev-small-decimal",
37
- mean: 0,
38
- deviation: .01,
39
- peaks: 5,
40
- },
41
-
42
- // test mean low to high
43
- {
44
- name: "mean-negative",
45
- mean: -2,
46
- deviation: 2,
47
- peaks: 5,
48
- },
49
- {
50
- name: "mean-zero",
51
- mean: 0,
52
- deviation: 2,
53
- peaks: 5,
54
- },
55
- {
56
- name: "mean-positive",
57
- mean: 2,
58
- deviation: 2,
59
- peaks: 5,
60
- },
61
- {
62
- name: "mean-high",
63
- mean: 10,
64
- deviation: 2,
65
- peaks: 5,
66
- },
67
- {
68
- name: "mean-decimal",
69
- mean: .01,
70
- deviation: 2,
71
- peaks: 5,
72
- },
73
- {
74
- name: "mean-one-half",
75
- mean: .05,
76
- deviation: 2,
77
- peaks: 5,
78
- },
79
-
80
- // test peaks low to high
81
- {
82
- name: "peaks-zero",
83
- mean: 0,
84
- deviation: 2,
85
- peaks: 0,
86
- },
87
- {
88
- name: "peaks-positive",
89
- mean: 0,
90
- deviation: 2,
91
- peaks: 5,
92
- },
93
- {
94
- name: "peaks-high",
95
- mean: 0,
96
- deviation: 2,
97
- peaks: 10,
98
- },
99
- // Extreme Deviation and Low Peaks
100
- {
101
- name: "extreme-deviation-low-peaks",
102
- mean: 0,
103
- deviation: 50,
104
- peaks: 2,
105
- },
106
-
107
- // Negative Mean and Low Deviation
108
- {
109
- name: "negative-mean-low-deviation",
110
- mean: -10,
111
- deviation: 0.5,
112
- peaks: 3,
113
- },
114
-
115
- // Positive Mean and High Peaks
116
- {
117
- name: "positive-mean-high-peaks",
118
- mean: 10,
119
- deviation: 2,
120
- peaks: 20,
121
- },
122
-
123
- // Small Decimal Mean and Deviation
124
- {
125
- name: "small-decimal-mean-deviation",
126
- mean: 0.01,
127
- deviation: 0.01,
128
- peaks: 10,
129
- },
130
-
131
- // Large Mean and One Peak
132
- {
133
- name: "large-mean-one-peak",
134
- mean: 100,
135
- deviation: 1,
136
- peaks: 1,
137
- },
138
-
139
- // Multiple Peaks with Moderate Deviation
140
- {
141
- name: "multiple-peaks-moderate-deviation",
142
- mean: 5,
143
- deviation: 5,
144
- peaks: 10,
145
- },
146
-
147
- // High Mean with High Deviation
148
- {
149
- name: "high-mean-high-deviation",
150
- mean: 50,
151
- deviation: 25,
152
- peaks: 5,
153
- },
154
-
155
- // Zero Mean with High Deviation and High Peaks
156
- {
157
- name: "zero-mean-high-deviation-high-peaks",
158
- mean: 0,
159
- deviation: 10,
160
- peaks: 30,
161
- },
162
-
163
- // Negative Mean with High Deviation and Low Peaks
164
- {
165
- name: "negative-mean-high-deviation-low-peaks",
166
- mean: -20,
167
- deviation: 15,
168
- peaks: 2,
169
- },
170
-
171
- // Mixed Values
172
- {
173
- name: "mixed-values",
174
- mean: 3,
175
- deviation: 7,
176
- peaks: 12,
177
- },
178
-
179
- // Minimal Deviation and Numerous Peaks
180
- {
181
- name: "minimal-deviation-numerous-peaks",
182
- mean: 0,
183
- deviation: 0.1,
184
- peaks: 50,
185
- },
186
-
187
- // Single Peak with Zero Deviation
188
- {
189
- name: "single-peak-huge-deviation",
190
- mean: 0,
191
- deviation: 20,
192
- peaks: 1,
193
- },
194
-
195
- // Negative Mean, High Deviation, Multiple Peaks
196
- {
197
- name: "negative-mean-high-deviation-multiple-peaks",
198
- mean: -5,
199
- deviation: 20,
200
- peaks: 8,
201
- },
202
-
203
- // Positive Mean, Low Deviation, Single Peak
204
- {
205
- name: "positive-mean-low-deviation-single-peak",
206
- mean: 5,
207
- deviation: 0.5,
208
- peaks: 1,
209
- },
210
-
211
- // Very High Mean and Peaks
212
- {
213
- name: "very-high-mean-and-peaks",
214
- mean: 100,
215
- deviation: 10,
216
- peaks: 100,
217
- },
218
-
219
- // High Mean with Low Peaks
220
- {
221
- name: "high-mean-low-peaks",
222
- mean: 25,
223
- deviation: 5,
224
- peaks: 3,
225
- }
226
-
227
- ];
228
-
229
- export default TEST_CASES;
@@ -1,28 +0,0 @@
1
- import { generateLineChart } from '../components/chart.js';
2
- import { TimeSoup } from '../lib/utils/utils.js';
3
- import dayjs from 'dayjs';
4
- import { progress } from 'ak-tools';
5
- import TEST_CASES from './testCases.mjs';
6
-
7
- import execSync from 'child_process';
8
-
9
- async function genViz(soup) {
10
- const { mean = 0, deviation = 2, peaks = 5, name } = soup;
11
- const data = [];
12
- const start = dayjs().subtract(90, 'd').unix();
13
- const end = dayjs().unix();
14
- console.log(`\n\nTEST CASE: ${name}\n\n`);
15
- for (let i = 0; i < 100_000; i++) {
16
- progress([['processing', i]]);
17
- const time = TimeSoup(start, end, peaks, deviation, mean);
18
- data.push({ time });
19
- }
20
-
21
- const chart = await generateLineChart(data, [], name);
22
- return chart;
23
- }
24
-
25
- execSync.execSync('npm run prune');
26
- // @ts-ignore
27
- await Promise.all(TEST_CASES.map(genViz));
28
- console.log('done');