alchemymvc 1.4.0 → 1.4.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 (44) hide show
  1. package/lib/app/behaviour/revision_behaviour.js +1 -1
  2. package/lib/app/behaviour/sluggable_behaviour.js +2 -2
  3. package/lib/app/datasource/mongo_datasource.js +19 -3
  4. package/lib/app/helper/cron.js +2 -2
  5. package/lib/app/helper_datasource/00-nosql_datasource.js +9 -3
  6. package/lib/app/helper_datasource/05-fallback_datasource.js +10 -13
  7. package/lib/app/helper_datasource/idb_datasource.js +7 -5
  8. package/lib/app/helper_datasource/remote_datasource.js +1 -1
  9. package/lib/app/helper_field/password_field.js +4 -2
  10. package/lib/app/helper_field/schema_field.js +3 -2
  11. package/lib/app/helper_field/time_field.js +1 -1
  12. package/lib/app/helper_model/00-base_criteria.js +14 -0
  13. package/lib/app/helper_model/05-criteria_expressions.js +30 -7
  14. package/lib/app/helper_model/10-model_criteria.js +47 -8
  15. package/lib/app/helper_model/document.js +11 -2
  16. package/lib/app/helper_model/model.js +6 -3
  17. package/lib/app/model/system_task_history_model.js +134 -0
  18. package/lib/class/conduit.js +5 -2
  19. package/lib/class/controller.js +1 -0
  20. package/lib/class/datasource.js +14 -2
  21. package/lib/class/document.js +40 -12
  22. package/lib/class/import_stream_parser.js +299 -0
  23. package/lib/class/inode_file.js +2 -0
  24. package/lib/class/migration.js +5 -2
  25. package/lib/class/model.js +12 -142
  26. package/lib/class/plugin.js +32 -3
  27. package/lib/class/postponement.js +1 -1
  28. package/lib/class/router.js +26 -28
  29. package/lib/class/schema_client.js +39 -8
  30. package/lib/class/sitemap.js +2 -2
  31. package/lib/class/task.js +42 -24
  32. package/lib/core/alchemy.js +110 -162
  33. package/lib/core/alchemy_load_functions.js +64 -5
  34. package/lib/core/base.js +2 -2
  35. package/lib/core/middleware.js +31 -5
  36. package/lib/core/prefix.js +1 -1
  37. package/lib/core/setting.js +12 -9
  38. package/lib/scripts/create_constants.js +5 -1
  39. package/lib/stages/00-load_core.js +8 -2
  40. package/lib/testing/browser.js +1164 -0
  41. package/lib/testing/harness.js +922 -0
  42. package/package.json +13 -6
  43. package/testing/browser.js +27 -0
  44. package/testing.js +37 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "alchemymvc",
3
3
  "description": "MVC framework for Node.js",
4
- "version": "1.4.0",
4
+ "version": "1.4.2",
5
5
  "author": "Jelle De Loecker <jelle@elevenways.be>",
6
6
  "keywords": [
7
7
  "alchemy",
@@ -32,7 +32,7 @@
32
32
  "ncp" : "~2.0.0",
33
33
  "postcss" : "~8.5.6",
34
34
  "postcss-prune-var": "~1.1.2",
35
- "protoblast" : "~0.9.6",
35
+ "protoblast" : "~0.9.8",
36
36
  "semver" : "~7.7.2",
37
37
  "socket.io" : "~4.7.5",
38
38
  "@11ways/socket.io-stream" : "~0.9.2",
@@ -42,8 +42,15 @@
42
42
  },
43
43
  "files": [
44
44
  "lib/",
45
- "index.js"
45
+ "index.js",
46
+ "testing.js",
47
+ "testing/"
46
48
  ],
49
+ "exports": {
50
+ ".": "./lib/bootstrap.js",
51
+ "./testing": "./testing.js",
52
+ "./testing/browser": "./testing/browser.js"
53
+ },
47
54
  "optionalDependencies": {
48
55
  "janeway" : "~0.4.6",
49
56
  "less" : "~4.2.0",
@@ -56,8 +63,8 @@
56
63
  "devDependencies": {
57
64
  "codecov" : "~3.8.1",
58
65
  "istanbul-lib-instrument" : "~6.0.1",
59
- "mocha" : "~10.2.0",
60
- "mongo-unit" : "~3.3.0",
66
+ "mocha" : "^11.7.5",
67
+ "mongo-unit" : "^3.4.0",
61
68
  "nyc" : "^15.1.0",
62
69
  "puppeteer" : "~21.3.6",
63
70
  "source-map" : "~0.7.3"
@@ -72,4 +79,4 @@
72
79
  "engines": {
73
80
  "node" : ">=16.20.1"
74
81
  }
75
- }
82
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Browser Helper Entry Point
3
+ *
4
+ * This is the entry point for the Alchemy browser testing helper.
5
+ * Import via: require('alchemymvc/testing/browser')
6
+ *
7
+ * @author Jelle De Loecker <jelle@elevenways.be>
8
+ * @since 1.4.1
9
+ * @version 1.4.1
10
+ */
11
+ 'use strict';
12
+
13
+ const libpath = require('path');
14
+
15
+ // Load Protoblast first (modifies native prototypes, same as Alchemy does)
16
+ const Blast = require('protoblast')(true);
17
+
18
+ // The testing lib path
19
+ const testingLibPath = libpath.resolve(__dirname, '..', 'lib', 'testing');
20
+
21
+ // Use Blast.require to load the browser module
22
+ const BrowserHelper = Blast.require('browser', {
23
+ pwd: testingLibPath,
24
+ client: false,
25
+ });
26
+
27
+ module.exports = BrowserHelper;
package/testing.js ADDED
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Test Harness Entry Point
3
+ *
4
+ * This is the entry point for the Alchemy test harness.
5
+ * Import via: require('alchemymvc/testing')
6
+ *
7
+ * @author Jelle De Loecker <jelle@elevenways.be>
8
+ * @since 1.4.1
9
+ * @version 1.4.1
10
+ */
11
+ 'use strict';
12
+
13
+ const libpath = require('path');
14
+
15
+ // Load Protoblast first (modifies native prototypes, same as Alchemy does)
16
+ // The return value is the Blast instance
17
+ const Blast = require('protoblast')(true);
18
+
19
+ // The testing lib path
20
+ const testingLibPath = libpath.resolve(__dirname, 'lib', 'testing');
21
+
22
+ // Use Blast.require to load the testing modules
23
+ // This ensures they have access to Blast, Classes, and other Protoblast globals
24
+ const TestHarness = Blast.require('harness', {
25
+ pwd: testingLibPath,
26
+ client: false,
27
+ });
28
+
29
+ const BrowserHelper = Blast.require('browser', {
30
+ pwd: testingLibPath,
31
+ client: false,
32
+ });
33
+
34
+ // Make BrowserHelper available as a property of TestHarness
35
+ TestHarness.BrowserHelper = BrowserHelper;
36
+
37
+ module.exports = TestHarness;