@objectql/create 4.0.6 → 4.2.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/runtime.js +55 -0
- package/templates/enterprise/jest.setup.js +1 -0
- package/templates/enterprise/package.json +2 -5
- 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/runtime.js +55 -0
- package/templates/starter/jest.setup.js +1 -0
- package/templates/starter/package.json +2 -5
- package/templates/starter/tsconfig.json +1 -1
- package/templates/enterprise/jest.config.js +0 -33
- package/templates/starter/jest.config.js +0 -33
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@objectql/example-enterprise-erp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "ObjectQL Enterprise Example - CRM & HR Demo",
|
|
5
5
|
"private": true,
|
|
6
6
|
"keywords": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"start": "ts-node src/index.ts",
|
|
29
29
|
"codegen": "objectql types -s src -o src/types",
|
|
30
30
|
"build": "tsc && rsync -a --include '*/' --include '*.yml' --exclude '*' src/ dist/",
|
|
31
|
-
"test": "
|
|
31
|
+
"test": "vitest run"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@objectql/core": "workspace:*",
|
|
@@ -43,10 +43,7 @@
|
|
|
43
43
|
"@objectql/driver-sql": "workspace:*",
|
|
44
44
|
"@objectql/platform-node": "workspace:*",
|
|
45
45
|
"@objectql/types": "workspace:*",
|
|
46
|
-
"@types/jest": "^30.0.0",
|
|
47
46
|
"@types/node": "^20.0.0",
|
|
48
|
-
"jest": "^30.2.0",
|
|
49
|
-
"ts-jest": "^29.4.6",
|
|
50
47
|
"typescript": "^5.3.0"
|
|
51
48
|
}
|
|
52
49
|
}
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@objectql/example-project-tracker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "ObjectQL Basic Example Project",
|
|
5
5
|
"private": true,
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"codegen": "objectql types -s src -o src/types",
|
|
31
31
|
"build": "tsc && rsync -a --include '*/' --include '*.yml' --exclude '*' src/ dist/",
|
|
32
32
|
"repl": "objectql repl",
|
|
33
|
-
"test": "
|
|
33
|
+
"test": "vitest run"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@objectql/core": "workspace:*",
|
|
@@ -45,10 +45,7 @@
|
|
|
45
45
|
"@objectql/driver-sql": "workspace:*",
|
|
46
46
|
"@objectql/platform-node": "workspace:*",
|
|
47
47
|
"@objectql/types": "workspace:*",
|
|
48
|
-
"@types/jest": "^30.0.0",
|
|
49
48
|
"@types/node": "^20.0.0",
|
|
50
|
-
"jest": "^30.2.0",
|
|
51
|
-
"ts-jest": "^29.4.6",
|
|
52
49
|
"typescript": "^5.3.0"
|
|
53
50
|
}
|
|
54
51
|
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectQL
|
|
3
|
-
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
preset: 'ts-jest',
|
|
11
|
-
testEnvironment: 'node',
|
|
12
|
-
testMatch: ['**/__tests__/**/*.test.ts'],
|
|
13
|
-
moduleNameMapper: {
|
|
14
|
-
},
|
|
15
|
-
transform: {
|
|
16
|
-
'^.+\\.(t|j)sx?$': ['ts-jest', {
|
|
17
|
-
isolatedModules: true,
|
|
18
|
-
tsconfig: {
|
|
19
|
-
esModuleInterop: true,
|
|
20
|
-
allowSyntheticDefaultImports: true,
|
|
21
|
-
allowJs: true,
|
|
22
|
-
}
|
|
23
|
-
}],
|
|
24
|
-
},
|
|
25
|
-
transformIgnorePatterns: [
|
|
26
|
-
"/node_modules/(?!(@objectstack|.pnpm))"
|
|
27
|
-
],
|
|
28
|
-
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
|
29
|
-
collectCoverageFrom: [
|
|
30
|
-
'src/**/*.ts',
|
|
31
|
-
'!src/**/*.d.ts',
|
|
32
|
-
],
|
|
33
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectQL
|
|
3
|
-
* Copyright (c) 2026-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
preset: 'ts-jest',
|
|
11
|
-
testEnvironment: 'node',
|
|
12
|
-
testMatch: ['**/__tests__/**/*.test.ts'],
|
|
13
|
-
moduleNameMapper: {
|
|
14
|
-
},
|
|
15
|
-
transform: {
|
|
16
|
-
'^.+\\.(t|j)sx?$': ['ts-jest', {
|
|
17
|
-
isolatedModules: true,
|
|
18
|
-
tsconfig: {
|
|
19
|
-
esModuleInterop: true,
|
|
20
|
-
allowSyntheticDefaultImports: true,
|
|
21
|
-
allowJs: true,
|
|
22
|
-
}
|
|
23
|
-
}],
|
|
24
|
-
},
|
|
25
|
-
transformIgnorePatterns: [
|
|
26
|
-
"/node_modules/(?!(@objectstack|.pnpm))"
|
|
27
|
-
],
|
|
28
|
-
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
|
29
|
-
collectCoverageFrom: [
|
|
30
|
-
'src/**/*.ts',
|
|
31
|
-
'!src/**/*.d.ts',
|
|
32
|
-
],
|
|
33
|
-
};
|