corba.js 0.1.1 → 0.1.5

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 (127) hide show
  1. package/README.md +24 -13
  2. package/package.json +16 -12
  3. package/lib/idl/idl.cjs +0 -2732
  4. package/lib/idl/idl.cjs.map +0 -1
  5. package/lib/idl/src/idl/idl-lexer.d.ts +0 -19
  6. package/lib/idl/src/idl/idl-node.d.ts +0 -101
  7. package/lib/idl/src/idl/idl-parser.d.ts +0 -3
  8. package/lib/idl/src/idl/idl.d.ts +0 -1
  9. package/lib/idl/src/idl/util.d.ts +0 -25
  10. package/lib/idl/src/idl/write-interface.d.ts +0 -2
  11. package/lib/idl/src/idl/write-skeleton.d.ts +0 -2
  12. package/lib/idl/src/idl/write-stub.d.ts +0 -2
  13. package/lib/idl/src/idl/write-value.d.ts +0 -2
  14. package/lib/idl/src/idl/write-valueimpl.d.ts +0 -2
  15. package/lib/idl/src/idl/write-valuetype.d.ts +0 -2
  16. package/lib/idl/src/index.d.ts +0 -5
  17. package/lib/idl/src/net/browser.d.ts +0 -7
  18. package/lib/idl/src/net/index.d.ts +0 -3
  19. package/lib/idl/src/net/tcp.d.ts +0 -11
  20. package/lib/idl/src/net/tls.d.ts +0 -24
  21. package/lib/idl/src/net/ws.d.ts +0 -42
  22. package/lib/idl/src/orb/asn1.d.ts +0 -48
  23. package/lib/idl/src/orb/connection.d.ts +0 -24
  24. package/lib/idl/src/orb/giop.d.ts +0 -273
  25. package/lib/idl/src/orb/index.d.ts +0 -3
  26. package/lib/idl/src/orb/ior.d.ts +0 -89
  27. package/lib/idl/src/orb/orb.d.ts +0 -143
  28. package/lib/idl/src/orb/protocol.d.ts +0 -6
  29. package/lib/idl/src/orb/uint8map.d.ts +0 -14
  30. package/lib/idl/src/orb/url.d.ts +0 -55
  31. package/lib/idl/test/access.spec.d.ts +0 -1
  32. package/lib/idl/test/attribute.spec.d.ts +0 -1
  33. package/lib/idl/test/basics.spec.d.ts +0 -1
  34. package/lib/idl/test/disconnect.spec.d.ts +0 -1
  35. package/lib/idl/test/eventtarget.spec.d.ts +0 -1
  36. package/lib/idl/test/fake.d.ts +0 -31
  37. package/lib/idl/test/giop.spec.d.ts +0 -1
  38. package/lib/idl/test/idl/idl.spec.d.ts +0 -1
  39. package/lib/idl/test/idl_module.spec.d.ts +0 -1
  40. package/lib/idl/test/initialreferences.spec.d.ts +0 -1
  41. package/lib/idl/test/net/tls.spec.d.ts +0 -1
  42. package/lib/idl/test/net/ws.spec.d.ts +0 -1
  43. package/lib/idl/test/net/wss.spec.d.ts +0 -1
  44. package/lib/idl/test/object_by_reference.spec.d.ts +0 -1
  45. package/lib/idl/test/orb/asn1.spec.d.ts +0 -1
  46. package/lib/idl/test/orb/url.spec.d.ts +0 -1
  47. package/lib/idl/test/stub.spec.d.ts +0 -1
  48. package/lib/idl/test/util.d.ts +0 -5
  49. package/lib/idl/test/valuetype.spec.d.ts +0 -1
  50. package/lib/src/idl/idl-lexer.d.ts +0 -19
  51. package/lib/src/idl/idl-lexer.js +0 -234
  52. package/lib/src/idl/idl-lexer.js.map +0 -1
  53. package/lib/src/idl/idl-node.d.ts +0 -101
  54. package/lib/src/idl/idl-node.js +0 -212
  55. package/lib/src/idl/idl-node.js.map +0 -1
  56. package/lib/src/idl/idl-parser.d.ts +0 -3
  57. package/lib/src/idl/idl-parser.js +0 -1084
  58. package/lib/src/idl/idl-parser.js.map +0 -1
  59. package/lib/src/idl/idl.d.ts +0 -1
  60. package/lib/src/idl/idl.js +0 -180
  61. package/lib/src/idl/idl.js.map +0 -1
  62. package/lib/src/idl/util.d.ts +0 -25
  63. package/lib/src/idl/util.js +0 -239
  64. package/lib/src/idl/util.js.map +0 -1
  65. package/lib/src/idl/write-interface.d.ts +0 -2
  66. package/lib/src/idl/write-interface.js +0 -111
  67. package/lib/src/idl/write-interface.js.map +0 -1
  68. package/lib/src/idl/write-skeleton.d.ts +0 -2
  69. package/lib/src/idl/write-skeleton.js +0 -116
  70. package/lib/src/idl/write-skeleton.js.map +0 -1
  71. package/lib/src/idl/write-stub.d.ts +0 -2
  72. package/lib/src/idl/write-stub.js +0 -116
  73. package/lib/src/idl/write-stub.js.map +0 -1
  74. package/lib/src/idl/write-value.d.ts +0 -2
  75. package/lib/src/idl/write-value.js +0 -205
  76. package/lib/src/idl/write-value.js.map +0 -1
  77. package/lib/src/idl/write-valueimpl.d.ts +0 -2
  78. package/lib/src/idl/write-valueimpl.js +0 -158
  79. package/lib/src/idl/write-valueimpl.js.map +0 -1
  80. package/lib/src/idl/write-valuetype.d.ts +0 -2
  81. package/lib/src/idl/write-valuetype.js +0 -98
  82. package/lib/src/idl/write-valuetype.js.map +0 -1
  83. package/lib/src/index.d.ts +0 -5
  84. package/lib/src/index.js +0 -6
  85. package/lib/src/index.js.map +0 -1
  86. package/lib/src/net/browser.d.ts +0 -7
  87. package/lib/src/net/browser.js +0 -54
  88. package/lib/src/net/browser.js.map +0 -1
  89. package/lib/src/net/index.d.ts +0 -3
  90. package/lib/src/net/index.js +0 -4
  91. package/lib/src/net/index.js.map +0 -1
  92. package/lib/src/net/tcp.d.ts +0 -11
  93. package/lib/src/net/tcp.js +0 -66
  94. package/lib/src/net/tcp.js.map +0 -1
  95. package/lib/src/net/tls.d.ts +0 -24
  96. package/lib/src/net/tls.js +0 -69
  97. package/lib/src/net/tls.js.map +0 -1
  98. package/lib/src/net/ws.d.ts +0 -42
  99. package/lib/src/net/ws.js +0 -158
  100. package/lib/src/net/ws.js.map +0 -1
  101. package/lib/src/orb/asn1.d.ts +0 -48
  102. package/lib/src/orb/asn1.js +0 -60
  103. package/lib/src/orb/asn1.js.map +0 -1
  104. package/lib/src/orb/connection.d.ts +0 -24
  105. package/lib/src/orb/connection.js +0 -19
  106. package/lib/src/orb/connection.js.map +0 -1
  107. package/lib/src/orb/giop.d.ts +0 -273
  108. package/lib/src/orb/giop.js +0 -1160
  109. package/lib/src/orb/giop.js.map +0 -1
  110. package/lib/src/orb/index.d.ts +0 -3
  111. package/lib/src/orb/index.js +0 -4
  112. package/lib/src/orb/index.js.map +0 -1
  113. package/lib/src/orb/ior.d.ts +0 -89
  114. package/lib/src/orb/ior.js +0 -110
  115. package/lib/src/orb/ior.js.map +0 -1
  116. package/lib/src/orb/orb.d.ts +0 -143
  117. package/lib/src/orb/orb.js +0 -693
  118. package/lib/src/orb/orb.js.map +0 -1
  119. package/lib/src/orb/protocol.d.ts +0 -6
  120. package/lib/src/orb/protocol.js +0 -2
  121. package/lib/src/orb/protocol.js.map +0 -1
  122. package/lib/src/orb/uint8map.d.ts +0 -14
  123. package/lib/src/orb/uint8map.js +0 -48
  124. package/lib/src/orb/uint8map.js.map +0 -1
  125. package/lib/src/orb/url.d.ts +0 -55
  126. package/lib/src/orb/url.js +0 -252
  127. package/lib/src/orb/url.js.map +0 -1
package/README.md CHANGED
@@ -229,23 +229,22 @@ and deserialize them based on their IDL description:
229
229
  For each valuetype the IDL compiler will generate three variants
230
230
 
231
231
  * _value.ts: the valuetypes as TypeScript interfaces with only the attributes
232
- * _valuetype.ts: the values types as TypeScript interface with attributes and methods
233
- * _valueimpl.ts: the value types as classes with constructors, which can be initialized from JSON data
234
-
235
- The last one will be used by the ORB to convert the received JSON data
236
- into an object.
232
+ * _valuetype.ts: the valuestypes as TypeScript interface with attributes and methods
237
233
 
238
234
  Unlike a pure JSON exchange, corba.js will also instantiate a user specified
239
235
  class to represent the transmitted data, so that the object has methods we
240
236
  can call.
241
237
 
242
- Ie. the Rectangle class contains a method which needs to be implemented to
243
- be able to instantiate it:
238
+ Ie. for this the Rectangle class will need a special constructor:
244
239
 
245
240
  ```javascript
246
- export class Rectangle extends valueimpl.Rectangle {
247
- constructor(rectangle: Partial<valueimpl.Rectangle>) {
248
- super(rectangle)
241
+ import { GIOPDecoder } from "corba.js"
242
+ import * as value from "../myapp_value"
243
+ import * as valuetype from "../myapp_valuetype"
244
+
245
+ export class Rectangle implements valuetype.Rectangle {
246
+ constructor(init?: Partial<value.Rectangle> | GIOPDecoder) {
247
+ value.initRectangle(this, init)
249
248
  }
250
249
  contains(p: Point): boolean {
251
250
  return this.origin.x <= p.x && p.x <= this.origin.x + this.size.width &&
@@ -254,12 +253,12 @@ be able to instantiate it:
254
253
  }
255
254
  ```
256
255
 
257
- After the valuetypes have been registered in the ORB on client and server
256
+ After the valuetype implementations have been registered in the ORB on client and server
258
257
  side
259
258
 
260
259
  ```javascript
261
- ORB.registerValueType("Point", valueimpl.Point)
262
- ORB.registerValueType("Size", valueimpl.Size)
260
+ ORB.registerValueType("Point", Point)
261
+ ORB.registerValueType("Size", Size)
263
262
  ORB.registerValueType("Rectangle", Rectangle)
264
263
  ```
265
264
 
@@ -300,3 +299,15 @@ corba.js does not implement the CORBA network protocol (GIOP/IIOP).
300
299
 
301
300
  As corba.js is intended to ease the implementation of WebApps, it uses
302
301
  JSON to be lightweight and efficient with some inspiration from JSON-RPC and EJSON.
302
+
303
+ ## Development
304
+
305
+ All build stages are setup to run in watch mode for performance reasons.
306
+
307
+ * I ususally run `npm dev:build` in Visual Studio Code's terminal window to
308
+ be able to jump from compiler errors directly into the source code.
309
+
310
+ * `npm dev:test` runs all tests in watch mode.
311
+
312
+ * `npm dev:test --file=lib/test/valuetype.spec.js` runs a single test file
313
+ in watch mode.
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "corba.js",
3
- "version": "0.1.1",
3
+ "version": "0.1.5",
4
4
  "description": "Object Request Broker (ORB) and Interface Definition Language (IDL) compiler",
5
5
  "author": "Mark-André Hopf <mhopf@mark13.org>",
6
6
  "license": "AGPL-3.0",
7
7
  "type": "module",
8
+ "engines" : {
9
+ "npm" : ">=8.1.2",
10
+ "node" : ">=16.10.0"
11
+ },
8
12
  "exports": {
9
13
  ".": {
10
14
  "import": "./lib/src/orb/index.js",
@@ -33,14 +37,14 @@
33
37
  "build:idl:compile": "bin/corba-idl --ts-all --output-directory test/generated test/*.idl",
34
38
  "build:src:compile": "ttsc",
35
39
  "test": "npm run build && NODE_EXTRA_CA_CERTS=test/x509/root/certs/root.cert.pem node --enable-source-maps ./node_modules/.bin/mocha --exit 'lib/test/**/*.spec.js'",
36
- "test:watch": "npm run build:idl:build && npm run build:idl:compile && ttsc --watch & NODE_EXTRA_CA_CERTS=test/x509/root/certs/root.cert.pem node --enable-source-maps ./node_modules/.bin/mocha --parallel --watch 'lib/test/**/*.spec.js'",
40
+ "dev:build": "npm run build:idl:build && npm run build:idl:compile && ttsc --watch",
41
+ "dev:test": "export NODE_EXTRA_CA_CERTS=test/x509/root/certs/root.cert.pem ; if test -z \"$npm_config_file\" ; then node --enable-source-maps ./node_modules/.bin/mocha --parallel --watch 'lib/test/**/*.spec.js' ; else node --enable-source-maps ./node_modules/.bin/mocha --parallel --watch $npm_config_file; fi",
37
42
  "omni:runs": "npm run omni:copy && ssh 192.168.1.105 'cd test-omni && make runs'",
38
43
  "omni:runc": "npm run omni:copy && ssh 192.168.1.105 'cd test-omni && make runc'",
39
44
  "omni:copy": "scp test/peer/omni/* test/giop.idl 192.168.1.105:test-omni/",
40
45
  "mico:runs": "npm run mico:copy && ssh 192.168.1.105 'cd test-mico && make runs'",
41
46
  "mico:runc": "npm run mico:copy && ssh 192.168.1.105 'cd test-mico && make runc'",
42
47
  "mico:copy": "scp test/peer/mico/* 192.168.1.105:test-mico/",
43
- "dev:compiler": "ttsc --watch",
44
48
 
45
49
  "update": "npx npm-check-updates -u && npm install"
46
50
  },
@@ -48,21 +52,21 @@
48
52
  "@rollup/plugin-commonjs": "^21.0.1",
49
53
  "@rollup/plugin-node-resolve": "^13.1.3",
50
54
  "@types/chai": "^4.3.0",
51
- "@types/chai-as-promised": "^7.1.4",
52
- "@types/mocha": "^9.0.0",
55
+ "@types/chai-as-promised": "^7.1.5",
56
+ "@types/mocha": "^9.1.0",
53
57
  "@types/mocha-each": "^2.0.0",
54
- "@types/node": "^17.0.8",
55
- "@types/websocket": "^1.0.4",
58
+ "@types/node": "^17.0.17",
59
+ "@types/websocket": "^1.0.5",
56
60
  "@zerollup/ts-transform-paths": "^1.7.18",
57
61
  "@zoltu/typescript-transformer-append-js-extension": "^1.0.1",
58
- "chai": "^4.3.4",
62
+ "chai": "^4.3.6",
59
63
  "chai-as-promised": "^7.1.1",
60
- "mocha": "^9.1.3",
64
+ "mocha": "^9.2.0",
61
65
  "mocha-each": "^2.0.1",
62
- "rollup": "^2.63.0",
63
- "rollup-plugin-typescript2": "^0.31.1",
66
+ "rollup": "^2.67.2",
67
+ "rollup-plugin-typescript2": "^0.31.2",
64
68
  "ttypescript": "^1.5.13",
65
- "typescript": "^4.5.4",
69
+ "typescript": "^4.5.5",
66
70
  "websocket": "^1.0.34"
67
71
  }
68
72
  }