@objectql/platform-node 4.0.2 → 4.0.4
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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +60 -0
- package/dist/driver.js +0 -1
- package/dist/driver.js.map +1 -1
- package/dist/plugin.d.ts +2 -2
- package/jest.config.js +3 -1
- package/package.json +4 -4
- package/src/driver.ts +1 -1
- package/src/plugin.ts +2 -2
- package/test/__mocks__/@objectstack/core.ts +6 -0
- package/test/__mocks__/@objectstack/objectql.ts +59 -0
- package/test/__mocks__/@objectstack/runtime.ts +8 -8
- package/tsconfig.tsbuildinfo +1 -1
- package/test/validation.test.ts +0 -785
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# @objectql/platform-node
|
|
2
2
|
|
|
3
|
+
## 4.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- **Patch Release v4.0.4**
|
|
8
|
+
|
|
9
|
+
This patch release includes bug fixes, driver improvements, and enhanced test coverage:
|
|
10
|
+
|
|
11
|
+
### Driver Improvements
|
|
12
|
+
- **MongoDB Driver**: Fixed bulk operations, transaction support, and type safety improvements
|
|
13
|
+
- **FileSystem Driver**: Fixed TCK test compatibility with dataDir parameter
|
|
14
|
+
- **SQL Driver**: Enhanced TCK test compatibility and fixed test failures
|
|
15
|
+
- **Redis Driver**: Improved TCK test configuration and dependencies
|
|
16
|
+
- **Driver Utils**: Added shared utilities package for cross-driver functionality
|
|
17
|
+
|
|
18
|
+
### Testing & Quality
|
|
19
|
+
- Added comprehensive TCK (Technology Compatibility Kit) compliance tests for all drivers
|
|
20
|
+
- Expanded TCK test suite to 30+ comprehensive tests
|
|
21
|
+
- Enhanced test infrastructure with better error handling
|
|
22
|
+
- Added --passWithNoTests flag for packages without tests
|
|
23
|
+
|
|
24
|
+
### Type Safety
|
|
25
|
+
- Improved type safety in MongoDB driver update methods
|
|
26
|
+
- Better handling of atomic operators in MongoDB driver
|
|
27
|
+
- Enhanced type definitions across driver layer
|
|
28
|
+
|
|
29
|
+
### Documentation
|
|
30
|
+
- Added comprehensive driver documentation
|
|
31
|
+
- Enhanced official documentation with Phase 2 implementation summaries
|
|
32
|
+
- Improved protocol layer documentation
|
|
33
|
+
|
|
34
|
+
### Infrastructure
|
|
35
|
+
- Standardized driver layer implementation
|
|
36
|
+
- Enhanced protocol layer with better abstraction
|
|
37
|
+
- Improved GitHub Actions workflow configurations
|
|
38
|
+
- Better CI/CD pipeline stability
|
|
39
|
+
|
|
40
|
+
This release maintains full backward compatibility with v4.0.3.
|
|
41
|
+
|
|
42
|
+
- Updated dependencies
|
|
43
|
+
- @objectql/core@4.0.4
|
|
44
|
+
- @objectql/types@4.0.4
|
|
45
|
+
|
|
46
|
+
## 4.0.3
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- **Patch Release v4.0.3**
|
|
51
|
+
|
|
52
|
+
This patch release includes infrastructure improvements and development experience enhancements:
|
|
53
|
+
- Refactored dev server setup for improved configuration handling
|
|
54
|
+
- Enhanced example scripts and development workflow
|
|
55
|
+
- Updated build and test infrastructure
|
|
56
|
+
- Improved documentation and developer tools
|
|
57
|
+
- Bug fixes and stability improvements
|
|
58
|
+
|
|
59
|
+
- Updated dependencies
|
|
60
|
+
- @objectql/core@4.0.3
|
|
61
|
+
- @objectql/types@4.0.3
|
|
62
|
+
|
|
3
63
|
## 4.0.2
|
|
4
64
|
|
|
5
65
|
### Patch Changes
|
package/dist/driver.js
CHANGED
|
@@ -47,7 +47,6 @@ function createDriverFromConnection(connection) {
|
|
|
47
47
|
throw new Error(`Unsupported connection protocol: ${connection}`);
|
|
48
48
|
}
|
|
49
49
|
try {
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
51
50
|
const pkg = require(driverPackage);
|
|
52
51
|
const DriverClass = pkg[driverClass];
|
|
53
52
|
if (!D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AAE,CAAC;QACzC,aAAa,GAAG,sBAAsB,CAAC;QACvC,WAAW,GAAG,WAAW,CAAC;QAC1B,YAAY,GAAG;YACX,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,UAAU;SACzB,CAAC;IACN,CAAC;SACI,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,oCAAoC,UAAU,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,IAAI,CAAC;QAED,MAAM,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;QACnC,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC;QACrC,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,GAAG,WAAW,iBAAiB,aAAa,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,IAAI,WAAW,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,yBAAyB,aAAa,oCAAoC,aAAa,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACpI,CAAC;AACL,CAAC"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
type PluginDefinition =
|
|
8
|
+
import { System } from '@objectstack/spec';
|
|
9
|
+
type PluginDefinition = System.PluginDefinition;
|
|
10
10
|
export declare function loadPlugin(packageName: string): PluginDefinition;
|
|
11
11
|
export {};
|
package/jest.config.js
CHANGED
|
@@ -11,9 +11,11 @@ module.exports = {
|
|
|
11
11
|
testEnvironment: 'node',
|
|
12
12
|
testMatch: ['**/test/**/*.test.ts'],
|
|
13
13
|
moduleNameMapper: {
|
|
14
|
-
'^@objectql/runtime$': '<rootDir>/../../objectstack/runtime/src',
|
|
15
14
|
'^@objectstack/runtime$': '<rootDir>/test/__mocks__/@objectstack/runtime.ts',
|
|
15
|
+
'^@objectstack/core$': '<rootDir>/test/__mocks__/@objectstack/core.ts',
|
|
16
|
+
'^@objectstack/objectql$': '<rootDir>/test/__mocks__/@objectstack/objectql.ts',
|
|
16
17
|
'^@objectql/(.*)$': '<rootDir>/../$1/src',
|
|
18
|
+
'^(.*)\\.js$': '$1',
|
|
17
19
|
},
|
|
18
20
|
transform: {
|
|
19
21
|
'^.+\\.ts$': ['ts-jest', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@objectql/platform-node",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Node.js platform utilities for ObjectQL - File system integration, YAML loading, and plugin management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"objectql",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"main": "dist/index.js",
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@objectstack/spec": "^0.
|
|
19
|
+
"@objectstack/spec": "^0.8.2",
|
|
20
20
|
"fast-glob": "^3.3.2",
|
|
21
21
|
"js-yaml": "^4.1.1",
|
|
22
|
-
"@objectql/
|
|
23
|
-
"@objectql/
|
|
22
|
+
"@objectql/core": "4.0.4",
|
|
23
|
+
"@objectql/types": "4.0.4"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"typescript": "^5.3.0"
|
package/src/driver.ts
CHANGED
|
@@ -49,7 +49,7 @@ export function createDriverFromConnection(connection: string): Driver {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
try {
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
const pkg = require(driverPackage);
|
|
54
54
|
const DriverClass = pkg[driverClass];
|
|
55
55
|
if (!DriverClass) {
|
package/src/plugin.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
type PluginDefinition =
|
|
9
|
+
import { System } from '@objectstack/spec';
|
|
10
|
+
type PluginDefinition = System.PluginDefinition;
|
|
11
11
|
|
|
12
12
|
export function loadPlugin(packageName: string): PluginDefinition {
|
|
13
13
|
let mod: any;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock for @objectstack/objectql
|
|
3
|
+
* Provides minimal mock implementations for ObjectQL and SchemaRegistry
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export class ObjectQL {
|
|
7
|
+
constructor() {}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export class SchemaRegistry {
|
|
11
|
+
// Named 'metadata' to match what app.ts expects in unregisterPackage
|
|
12
|
+
private static metadata = new Map<string, Map<string, any>>();
|
|
13
|
+
|
|
14
|
+
constructor() {}
|
|
15
|
+
|
|
16
|
+
static registerItem(type: string, item: any, idField: string = 'id'): void {
|
|
17
|
+
if (!SchemaRegistry.metadata.has(type)) {
|
|
18
|
+
SchemaRegistry.metadata.set(type, new Map());
|
|
19
|
+
}
|
|
20
|
+
const typeMap = SchemaRegistry.metadata.get(type)!;
|
|
21
|
+
const id = item[idField];
|
|
22
|
+
typeMap.set(id, item);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static getItem(type: string, id: string): any {
|
|
26
|
+
const typeMap = SchemaRegistry.metadata.get(type);
|
|
27
|
+
return typeMap ? typeMap.get(id) : undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static listItems(type: string): any[] {
|
|
31
|
+
const typeMap = SchemaRegistry.metadata.get(type);
|
|
32
|
+
return typeMap ? Array.from(typeMap.values()) : [];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static unregisterPackage(packageName: string): void {
|
|
36
|
+
for (const typeMap of SchemaRegistry.metadata.values()) {
|
|
37
|
+
const toDelete: string[] = [];
|
|
38
|
+
for (const [id, item] of typeMap.entries()) {
|
|
39
|
+
if (item.package === packageName || item.packageName === packageName) {
|
|
40
|
+
toDelete.push(id);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
toDelete.forEach(id => typeMap.delete(id));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static clear(): void {
|
|
48
|
+
SchemaRegistry.metadata.clear();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
register(schema: any): void {}
|
|
52
|
+
get(name: string): any { return null; }
|
|
53
|
+
list(): any[] { return []; }
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ObjectStackProtocolImplementation {
|
|
57
|
+
name: string;
|
|
58
|
+
handle(request: any): Promise<any>;
|
|
59
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Mock for @
|
|
2
|
+
* Mock for @objectstack/runtime
|
|
3
3
|
* This mock is needed because the npm package has issues with Jest
|
|
4
4
|
* and we want to focus on testing ObjectQL's logic, not the kernel integration.
|
|
5
5
|
*
|
|
@@ -80,7 +80,7 @@ class MockActionManager {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export class
|
|
83
|
+
export class ObjectKernel {
|
|
84
84
|
public ql: unknown = null;
|
|
85
85
|
public metadata: MockMetadataRegistry;
|
|
86
86
|
public hooks: MockHookManager;
|
|
@@ -198,16 +198,16 @@ export class ObjectStackKernel {
|
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
export class
|
|
201
|
+
export class ObjectStackProtocolImplementation {}
|
|
202
202
|
|
|
203
|
-
export interface
|
|
204
|
-
engine:
|
|
203
|
+
export interface PluginContext {
|
|
204
|
+
engine: ObjectKernel;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
export interface
|
|
207
|
+
export interface ObjectQLPlugin {
|
|
208
208
|
name: string;
|
|
209
|
-
install?: (ctx:
|
|
210
|
-
onStart?: (ctx:
|
|
209
|
+
install?: (ctx: PluginContext) => void | Promise<void>;
|
|
210
|
+
onStart?: (ctx: PluginContext) => void | Promise<void>;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
// Export MetadataRegistry
|