@stanterprise/protobuf 0.0.13 → 0.0.14
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -8
- package/dist/index.mjs.map +1 -1
- package/dist/lib/index.d.ts +2 -7
- package/dist/lib/index.d.ts.map +1 -1
- package/lib/index.ts +44 -17
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -14,14 +14,34 @@ import {
|
|
|
14
14
|
} from "./chunk-VBR2HXFF.mjs";
|
|
15
15
|
|
|
16
16
|
// lib/index.ts
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
17
|
+
function isPlainObject(value) {
|
|
18
|
+
if (value === null || typeof value !== "object") {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const proto = Object.getPrototypeOf(value);
|
|
22
|
+
return proto === Object.prototype || proto === null;
|
|
23
|
+
}
|
|
24
|
+
function deepMerge(target, ...sources) {
|
|
25
|
+
for (const source of sources) {
|
|
26
|
+
for (const key of Object.keys(source)) {
|
|
27
|
+
const sourceValue = source[key];
|
|
28
|
+
if (isPlainObject(sourceValue)) {
|
|
29
|
+
const targetValue = target[key];
|
|
30
|
+
if (!isPlainObject(targetValue)) {
|
|
31
|
+
target[key] = {};
|
|
32
|
+
}
|
|
33
|
+
deepMerge(
|
|
34
|
+
target[key],
|
|
35
|
+
sourceValue
|
|
36
|
+
);
|
|
37
|
+
} else {
|
|
38
|
+
target[key] = sourceValue;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return target;
|
|
43
|
+
}
|
|
44
|
+
var testsystem6 = deepMerge({}, testsystem, testsystem2, testsystem3, testsystem4, testsystem5);
|
|
25
45
|
export {
|
|
26
46
|
testsystem as common,
|
|
27
47
|
testsystem4 as events,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/index.ts"],"sourcesContent":["// AUTO-COPIED FROM scripts/static-lib-index.ts\n// DO NOT EDIT GENERATED lib/index.ts DIRECTLY\n// scripts/static-lib-index.ts\n// Source of truth for protobuf barrel exports (copied to lib/index.ts after generation)\n// Update when adding new testsystem packages.\n//\n// NOTE: Import paths in this file are relative to lib/ and won't resolve from scripts/\n// This is intentional - the file is copied to lib/index.ts during generation where paths work correctly.\n//\n// This file provides a clean, organized export structure for the generated protobuf code:\n// - Individual module exports (common, testCase, testSuite, events, observer, google)\n// - Unified testsystem namespace combining all modules\n// - Proper TypeScript types without complex runtime merging\n//\n// See NAMESPACE_ORGANIZATION.md for detailed usage documentation.\n\n// Re-export all generated modules with clean namespace structure\nexport * as google from './google/protobuf/timestamp';\nexport { testsystem as common } from './testsystem/v1/common/common';\nexport { testsystem as testCase } from './testsystem/v1/entities/test_case';\nexport { testsystem as testSuite } from './testsystem/v1/entities/test_suite';\nexport { testsystem as events } from './testsystem/v1/events/events';\nexport { testsystem as observer } from './testsystem/v1/observer/observer';\n\n//
|
|
1
|
+
{"version":3,"sources":["../lib/index.ts"],"sourcesContent":["// AUTO-COPIED FROM scripts/static-lib-index.ts\n// DO NOT EDIT GENERATED lib/index.ts DIRECTLY\n// scripts/static-lib-index.ts\n// Source of truth for protobuf barrel exports (copied to lib/index.ts after generation)\n// Update when adding new testsystem packages.\n//\n// NOTE: Import paths in this file are relative to lib/ and won't resolve from scripts/\n// This is intentional - the file is copied to lib/index.ts during generation where paths work correctly.\n//\n// This file provides a clean, organized export structure for the generated protobuf code:\n// - Individual module exports (common, testCase, testSuite, events, observer, google)\n// - Unified testsystem namespace combining all modules\n// - Proper TypeScript types without complex runtime merging\n//\n// See NAMESPACE_ORGANIZATION.md for detailed usage documentation.\n\n// Re-export all generated modules with clean namespace structure\nexport * as google from './google/protobuf/timestamp';\nexport { testsystem as common } from './testsystem/v1/common/common';\nexport { testsystem as testCase } from './testsystem/v1/entities/test_case';\nexport { testsystem as testSuite } from './testsystem/v1/entities/test_suite';\nexport { testsystem as events } from './testsystem/v1/events/events';\nexport { testsystem as observer } from './testsystem/v1/observer/observer';\n\n// Import all namespace modules\nimport { testsystem as commonNS } from './testsystem/v1/common/common';\nimport { testsystem as testCaseNS } from './testsystem/v1/entities/test_case';\nimport { testsystem as testSuiteNS } from './testsystem/v1/entities/test_suite';\nimport { testsystem as eventsNS } from './testsystem/v1/events/events';\nimport { testsystem as observerNS } from './testsystem/v1/observer/observer';\n\n// Deep merge helper for nested namespaces\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\nfunction deepMerge(\n target: Record<string, unknown>,\n ...sources: Record<string, unknown>[]\n): Record<string, unknown> {\n for (const source of sources) {\n for (const key of Object.keys(source)) {\n const sourceValue = source[key];\n\n if (isPlainObject(sourceValue)) {\n const targetValue = target[key];\n\n if (!isPlainObject(targetValue)) {\n target[key] = {};\n }\n\n deepMerge(\n target[key] as Record<string, unknown>,\n sourceValue as Record<string, unknown>\n );\n } else {\n // For non-plain objects (including functions, class instances, arrays, etc.),\n // copy the value by reference instead of deep merging.\n target[key] = sourceValue;\n }\n }\n }\n return target;\n}\n\n// Runtime merged namespace with proper deep merging for nested v1.entities, v1.events, etc.\nexport const testsystem = deepMerge({}, commonNS, testCaseNS, testSuiteNS, eventsNS, observerNS);\n\n// Export type for the merged namespace\nexport type testsystem = typeof testsystem;\n"],"mappings":";;;;;;;;;;;;;;;;AAgCA,SAAS,cAAc,OAAkD;AACvE,MAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAC/C,WAAO;AAAA,EACT;AACA,QAAM,QAAQ,OAAO,eAAe,KAAK;AACzC,SAAO,UAAU,OAAO,aAAa,UAAU;AACjD;AAEA,SAAS,UACP,WACG,SACsB;AACzB,aAAW,UAAU,SAAS;AAC5B,eAAW,OAAO,OAAO,KAAK,MAAM,GAAG;AACrC,YAAM,cAAc,OAAO,GAAG;AAE9B,UAAI,cAAc,WAAW,GAAG;AAC9B,cAAM,cAAc,OAAO,GAAG;AAE9B,YAAI,CAAC,cAAc,WAAW,GAAG;AAC/B,iBAAO,GAAG,IAAI,CAAC;AAAA,QACjB;AAEA;AAAA,UACE,OAAO,GAAG;AAAA,UACV;AAAA,QACF;AAAA,MACF,OAAO;AAGL,eAAO,GAAG,IAAI;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAGO,IAAMA,cAAa,UAAU,CAAC,GAAG,YAAUA,aAAYA,aAAaA,aAAUA,WAAU;","names":["testsystem"]}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -4,11 +4,6 @@ export { testsystem as testCase } from './testsystem/v1/entities/test_case';
|
|
|
4
4
|
export { testsystem as testSuite } from './testsystem/v1/entities/test_suite';
|
|
5
5
|
export { testsystem as events } from './testsystem/v1/events/events';
|
|
6
6
|
export { testsystem as observer } from './testsystem/v1/observer/observer';
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
import { testsystem as testCaseNS } from './testsystem/v1/entities/test_case';
|
|
10
|
-
import { testsystem as testSuiteNS } from './testsystem/v1/entities/test_suite';
|
|
11
|
-
import { testsystem as eventsNS } from './testsystem/v1/events/events';
|
|
12
|
-
import { testsystem as observerNS } from './testsystem/v1/observer/observer';
|
|
13
|
-
export declare const testsystem: testsystem;
|
|
7
|
+
export declare const testsystem: Record<string, unknown>;
|
|
8
|
+
export type testsystem = typeof testsystem;
|
|
14
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,IAAI,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,IAAI,QAAQ,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,IAAI,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,IAAI,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAgD3E,eAAO,MAAM,UAAU,yBAAyE,CAAC;AAGjG,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC"}
|
package/lib/index.ts
CHANGED
|
@@ -22,26 +22,53 @@ export { testsystem as testSuite } from './testsystem/v1/entities/test_suite';
|
|
|
22
22
|
export { testsystem as events } from './testsystem/v1/events/events';
|
|
23
23
|
export { testsystem as observer } from './testsystem/v1/observer/observer';
|
|
24
24
|
|
|
25
|
-
//
|
|
26
|
-
export type testsystem = typeof commonNS &
|
|
27
|
-
typeof testCaseNS &
|
|
28
|
-
typeof testSuiteNS &
|
|
29
|
-
typeof eventsNS &
|
|
30
|
-
typeof observerNS;
|
|
31
|
-
|
|
32
|
-
// Runtime merged namespace for backwards compatibility
|
|
33
|
-
// Uses Object.assign instead of complex recursive merging
|
|
25
|
+
// Import all namespace modules
|
|
34
26
|
import { testsystem as commonNS } from './testsystem/v1/common/common';
|
|
35
27
|
import { testsystem as testCaseNS } from './testsystem/v1/entities/test_case';
|
|
36
28
|
import { testsystem as testSuiteNS } from './testsystem/v1/entities/test_suite';
|
|
37
29
|
import { testsystem as eventsNS } from './testsystem/v1/events/events';
|
|
38
30
|
import { testsystem as observerNS } from './testsystem/v1/observer/observer';
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
// Deep merge helper for nested namespaces
|
|
33
|
+
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
34
|
+
if (value === null || typeof value !== 'object') {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
const proto = Object.getPrototypeOf(value);
|
|
38
|
+
return proto === Object.prototype || proto === null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function deepMerge(
|
|
42
|
+
target: Record<string, unknown>,
|
|
43
|
+
...sources: Record<string, unknown>[]
|
|
44
|
+
): Record<string, unknown> {
|
|
45
|
+
for (const source of sources) {
|
|
46
|
+
for (const key of Object.keys(source)) {
|
|
47
|
+
const sourceValue = source[key];
|
|
48
|
+
|
|
49
|
+
if (isPlainObject(sourceValue)) {
|
|
50
|
+
const targetValue = target[key];
|
|
51
|
+
|
|
52
|
+
if (!isPlainObject(targetValue)) {
|
|
53
|
+
target[key] = {};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
deepMerge(
|
|
57
|
+
target[key] as Record<string, unknown>,
|
|
58
|
+
sourceValue as Record<string, unknown>
|
|
59
|
+
);
|
|
60
|
+
} else {
|
|
61
|
+
// For non-plain objects (including functions, class instances, arrays, etc.),
|
|
62
|
+
// copy the value by reference instead of deep merging.
|
|
63
|
+
target[key] = sourceValue;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return target;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Runtime merged namespace with proper deep merging for nested v1.entities, v1.events, etc.
|
|
71
|
+
export const testsystem = deepMerge({}, commonNS, testCaseNS, testSuiteNS, eventsNS, observerNS);
|
|
72
|
+
|
|
73
|
+
// Export type for the merged namespace
|
|
74
|
+
export type testsystem = typeof testsystem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stanterprise/protobuf",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Generated Protobuf code",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -53,7 +53,9 @@
|
|
|
53
53
|
"generate": "node scripts/generate.js",
|
|
54
54
|
"lint": "eslint . --ext .ts --max-warnings=0",
|
|
55
55
|
"format": "prettier --write .",
|
|
56
|
-
"lint:fix": "eslint . --ext .ts --fix"
|
|
56
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
57
|
+
"verify": "node verify-exports.mjs",
|
|
58
|
+
"test": "npm run verify"
|
|
57
59
|
},
|
|
58
60
|
"repository": {
|
|
59
61
|
"type": "git",
|