@objectql/create 4.0.5 → 4.1.0
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 +1 -1
- package/templates/enterprise/CHANGELOG.md +10 -0
- package/templates/enterprise/__mocks__/@objectstack/core.js +55 -0
- package/templates/enterprise/__mocks__/@objectstack/runtime.js +55 -0
- package/templates/enterprise/jest.config.js +1 -0
- package/templates/enterprise/jest.setup.js +3 -0
- package/templates/enterprise/package.json +1 -1
- package/templates/hello-world/CHANGELOG.md +8 -0
- package/templates/hello-world/package.json +1 -1
- package/templates/starter/CHANGELOG.md +10 -0
- package/templates/starter/__mocks__/@objectstack/core.js +55 -0
- package/templates/starter/__mocks__/@objectstack/runtime.js +55 -0
- package/templates/starter/jest.config.js +1 -0
- package/templates/starter/jest.setup.js +3 -0
- package/templates/starter/package.json +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Mock for @objectstack/core
|
|
2
|
+
// Used to bypass ESM/import.meta issues in Jest
|
|
3
|
+
|
|
4
|
+
const mockLogger = {
|
|
5
|
+
info: jest.fn(),
|
|
6
|
+
error: jest.fn(),
|
|
7
|
+
warn: jest.fn(),
|
|
8
|
+
debug: jest.fn(),
|
|
9
|
+
log: jest.fn(),
|
|
10
|
+
child: () => mockLogger
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function DummyKernel(...args) {
|
|
14
|
+
const self = this || {};
|
|
15
|
+
self.args = args;
|
|
16
|
+
self.logger = mockLogger;
|
|
17
|
+
self.kernel = {};
|
|
18
|
+
self.bootstrap = jest.fn().mockResolvedValue(undefined);
|
|
19
|
+
self.start = jest.fn().mockResolvedValue(undefined);
|
|
20
|
+
self.use = jest.fn();
|
|
21
|
+
self.getEntry = jest.fn().mockReturnValue({});
|
|
22
|
+
|
|
23
|
+
return self;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Add prototype methods for class inheritance compatibility
|
|
27
|
+
DummyKernel.prototype.bootstrap = jest.fn().mockResolvedValue(undefined);
|
|
28
|
+
DummyKernel.prototype.start = jest.fn().mockResolvedValue(undefined);
|
|
29
|
+
DummyKernel.prototype.use = jest.fn();
|
|
30
|
+
|
|
31
|
+
const proxy = new Proxy({}, {
|
|
32
|
+
get: function(target, prop) {
|
|
33
|
+
if (prop === '__esModule') {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Explicit exports
|
|
38
|
+
if (prop === 'createLogger') {
|
|
39
|
+
return () => mockLogger;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (prop === 'ObjectKernel' || prop === 'ObjectStack') {
|
|
43
|
+
return DummyKernel;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// For other exports, return a generic mock or DummyKernel if it looks like a class
|
|
47
|
+
if (typeof prop === 'string' && /^[A-Z]/.test(prop)) {
|
|
48
|
+
return DummyKernel;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return jest.fn();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
module.exports = proxy;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Mock for @objectstack/core
|
|
2
|
+
// Used to bypass ESM/import.meta issues in Jest
|
|
3
|
+
|
|
4
|
+
const mockLogger = {
|
|
5
|
+
info: jest.fn(),
|
|
6
|
+
error: jest.fn(),
|
|
7
|
+
warn: jest.fn(),
|
|
8
|
+
debug: jest.fn(),
|
|
9
|
+
log: jest.fn(),
|
|
10
|
+
child: () => mockLogger
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function DummyKernel(...args) {
|
|
14
|
+
const self = this || {};
|
|
15
|
+
self.args = args;
|
|
16
|
+
self.logger = mockLogger;
|
|
17
|
+
self.kernel = {};
|
|
18
|
+
self.bootstrap = jest.fn().mockResolvedValue(undefined);
|
|
19
|
+
self.start = jest.fn().mockResolvedValue(undefined);
|
|
20
|
+
self.use = jest.fn();
|
|
21
|
+
self.getEntry = jest.fn().mockReturnValue({});
|
|
22
|
+
|
|
23
|
+
return self;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Add prototype methods for class inheritance compatibility
|
|
27
|
+
DummyKernel.prototype.bootstrap = jest.fn().mockResolvedValue(undefined);
|
|
28
|
+
DummyKernel.prototype.start = jest.fn().mockResolvedValue(undefined);
|
|
29
|
+
DummyKernel.prototype.use = jest.fn();
|
|
30
|
+
|
|
31
|
+
const proxy = new Proxy({}, {
|
|
32
|
+
get: function(target, prop) {
|
|
33
|
+
if (prop === '__esModule') {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Explicit exports
|
|
38
|
+
if (prop === 'createLogger') {
|
|
39
|
+
return () => mockLogger;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (prop === 'ObjectKernel' || prop === 'ObjectStack') {
|
|
43
|
+
return DummyKernel;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// For other exports, return a generic mock or DummyKernel if it looks like a class
|
|
47
|
+
if (typeof prop === 'string' && /^[A-Z]/.test(prop)) {
|
|
48
|
+
return DummyKernel;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return jest.fn();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
module.exports = proxy;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Mock for @objectstack/core
|
|
2
|
+
// Used to bypass ESM/import.meta issues in Jest
|
|
3
|
+
|
|
4
|
+
const mockLogger = {
|
|
5
|
+
info: jest.fn(),
|
|
6
|
+
error: jest.fn(),
|
|
7
|
+
warn: jest.fn(),
|
|
8
|
+
debug: jest.fn(),
|
|
9
|
+
log: jest.fn(),
|
|
10
|
+
child: () => mockLogger
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function DummyKernel(...args) {
|
|
14
|
+
const self = this || {};
|
|
15
|
+
self.args = args;
|
|
16
|
+
self.logger = mockLogger;
|
|
17
|
+
self.kernel = {};
|
|
18
|
+
self.bootstrap = jest.fn().mockResolvedValue(undefined);
|
|
19
|
+
self.start = jest.fn().mockResolvedValue(undefined);
|
|
20
|
+
self.use = jest.fn();
|
|
21
|
+
self.getEntry = jest.fn().mockReturnValue({});
|
|
22
|
+
|
|
23
|
+
return self;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Add prototype methods for class inheritance compatibility
|
|
27
|
+
DummyKernel.prototype.bootstrap = jest.fn().mockResolvedValue(undefined);
|
|
28
|
+
DummyKernel.prototype.start = jest.fn().mockResolvedValue(undefined);
|
|
29
|
+
DummyKernel.prototype.use = jest.fn();
|
|
30
|
+
|
|
31
|
+
const proxy = new Proxy({}, {
|
|
32
|
+
get: function(target, prop) {
|
|
33
|
+
if (prop === '__esModule') {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Explicit exports
|
|
38
|
+
if (prop === 'createLogger') {
|
|
39
|
+
return () => mockLogger;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (prop === 'ObjectKernel' || prop === 'ObjectStack') {
|
|
43
|
+
return DummyKernel;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// For other exports, return a generic mock or DummyKernel if it looks like a class
|
|
47
|
+
if (typeof prop === 'string' && /^[A-Z]/.test(prop)) {
|
|
48
|
+
return DummyKernel;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return jest.fn();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
module.exports = proxy;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Mock for @objectstack/core
|
|
2
|
+
// Used to bypass ESM/import.meta issues in Jest
|
|
3
|
+
|
|
4
|
+
const mockLogger = {
|
|
5
|
+
info: jest.fn(),
|
|
6
|
+
error: jest.fn(),
|
|
7
|
+
warn: jest.fn(),
|
|
8
|
+
debug: jest.fn(),
|
|
9
|
+
log: jest.fn(),
|
|
10
|
+
child: () => mockLogger
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function DummyKernel(...args) {
|
|
14
|
+
const self = this || {};
|
|
15
|
+
self.args = args;
|
|
16
|
+
self.logger = mockLogger;
|
|
17
|
+
self.kernel = {};
|
|
18
|
+
self.bootstrap = jest.fn().mockResolvedValue(undefined);
|
|
19
|
+
self.start = jest.fn().mockResolvedValue(undefined);
|
|
20
|
+
self.use = jest.fn();
|
|
21
|
+
self.getEntry = jest.fn().mockReturnValue({});
|
|
22
|
+
|
|
23
|
+
return self;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Add prototype methods for class inheritance compatibility
|
|
27
|
+
DummyKernel.prototype.bootstrap = jest.fn().mockResolvedValue(undefined);
|
|
28
|
+
DummyKernel.prototype.start = jest.fn().mockResolvedValue(undefined);
|
|
29
|
+
DummyKernel.prototype.use = jest.fn();
|
|
30
|
+
|
|
31
|
+
const proxy = new Proxy({}, {
|
|
32
|
+
get: function(target, prop) {
|
|
33
|
+
if (prop === '__esModule') {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Explicit exports
|
|
38
|
+
if (prop === 'createLogger') {
|
|
39
|
+
return () => mockLogger;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (prop === 'ObjectKernel' || prop === 'ObjectStack') {
|
|
43
|
+
return DummyKernel;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// For other exports, return a generic mock or DummyKernel if it looks like a class
|
|
47
|
+
if (typeof prop === 'string' && /^[A-Z]/.test(prop)) {
|
|
48
|
+
return DummyKernel;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return jest.fn();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
module.exports = proxy;
|