node-opcua-generator 2.183.0 → 2.184.1
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/factory_code_generator.d.ts +1 -0
- package/dist/factory_code_generator.d.ts.map +1 -0
- package/dist/factory_code_generator.js +67 -76
- package/dist/factory_code_generator.js.map +1 -1
- package/dist/generate_extension_object_code.d.ts +1 -0
- package/dist/generate_extension_object_code.d.ts.map +1 -0
- package/dist/generate_extension_object_code.js +33 -39
- package/dist/generate_extension_object_code.js.map +1 -1
- package/dist/generator.d.ts +1 -0
- package/dist/generator.d.ts.map +1 -0
- package/dist/generator.js +52 -60
- package/dist/generator.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -9
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +2 -18
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/line_file.d.ts +1 -0
- package/dist/utils/line_file.d.ts.map +1 -0
- package/dist/utils/line_file.js +5 -9
- package/dist/utils/line_file.js.map +1 -1
- package/dist/utils/normalize_require_file.d.ts +1 -0
- package/dist/utils/normalize_require_file.d.ts.map +1 -0
- package/dist/utils/normalize_require_file.js +4 -10
- package/dist/utils/normalize_require_file.js.map +1 -1
- package/dist/utils/write_func.d.ts +1 -0
- package/dist/utils/write_func.d.ts.map +1 -0
- package/dist/utils/write_func.js +1 -5
- package/dist/utils/write_func.js.map +1 -1
- package/package.json +22 -21
- package/source/factory_code_generator.ts +1 -1
- package/source/generator.ts +10 -8
- package/dist/opcua_code_generator.d.ts +0 -1
- package/dist/opcua_code_generator.js +0 -15
- package/dist/opcua_code_generator.js.map +0 -1
- package/source/opcua_code_generator.ts +0 -15
package/dist/utils/write_func.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeWrite = void 0;
|
|
4
|
-
const makeWrite = (f) => {
|
|
1
|
+
export const makeWrite = (f) => {
|
|
5
2
|
const _f = (...args) => f.write(...args);
|
|
6
3
|
_f.indent = () => {
|
|
7
4
|
/** */
|
|
@@ -11,5 +8,4 @@ const makeWrite = (f) => {
|
|
|
11
8
|
};
|
|
12
9
|
return _f;
|
|
13
10
|
};
|
|
14
|
-
exports.makeWrite = makeWrite;
|
|
15
11
|
//# sourceMappingURL=write_func.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write_func.js","sourceRoot":"","sources":["../../source/utils/write_func.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"write_func.js","sourceRoot":"","sources":["../../source/utils/write_func.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAY,EAAa,EAAE;IACjD,MAAM,EAAE,GAAc,CAAC,GAAG,IAAc,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC9D,EAAE,CAAC,MAAM,GAAG,GAAG,EAAE;QACb,MAAM;IACV,CAAC,CAAC;IACF,EAAE,CAAC,GAAG,GAAG,GAAG,EAAE;QACV,MAAM;IACV,CAAC,CAAC;IACF,OAAO,EAAE,CAAC;AACd,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-generator",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.184.1",
|
|
4
5
|
"description": "pure nodejs OPCUA SDK - module generator",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
@@ -17,27 +18,27 @@
|
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
20
|
"chalk": "4.1.2",
|
|
20
|
-
"node-opcua-assert": "2.
|
|
21
|
-
"node-opcua-basic-types": "2.
|
|
22
|
-
"node-opcua-binary-stream": "2.
|
|
23
|
-
"node-opcua-constants": "2.
|
|
24
|
-
"node-opcua-data-model": "2.
|
|
25
|
-
"node-opcua-data-value": "2.
|
|
26
|
-
"node-opcua-debug": "2.
|
|
27
|
-
"node-opcua-enum": "2.
|
|
28
|
-
"node-opcua-extension-object": "2.
|
|
29
|
-
"node-opcua-factory": "2.
|
|
30
|
-
"node-opcua-nodeid": "2.
|
|
31
|
-
"node-opcua-numeric-range": "2.
|
|
32
|
-
"node-opcua-schemas": "2.
|
|
33
|
-
"node-opcua-status-code": "2.
|
|
34
|
-
"node-opcua-utils": "2.
|
|
35
|
-
"node-opcua-variant": "2.
|
|
36
|
-
"typescript": "5.9.3"
|
|
21
|
+
"node-opcua-assert": "2.184.0",
|
|
22
|
+
"node-opcua-basic-types": "2.184.1",
|
|
23
|
+
"node-opcua-binary-stream": "2.184.1",
|
|
24
|
+
"node-opcua-constants": "2.184.0",
|
|
25
|
+
"node-opcua-data-model": "2.184.1",
|
|
26
|
+
"node-opcua-data-value": "2.184.1",
|
|
27
|
+
"node-opcua-debug": "2.184.0",
|
|
28
|
+
"node-opcua-enum": "2.184.1",
|
|
29
|
+
"node-opcua-extension-object": "2.184.1",
|
|
30
|
+
"node-opcua-factory": "2.184.1",
|
|
31
|
+
"node-opcua-nodeid": "2.184.1",
|
|
32
|
+
"node-opcua-numeric-range": "2.184.1",
|
|
33
|
+
"node-opcua-schemas": "2.184.1",
|
|
34
|
+
"node-opcua-status-code": "2.184.1",
|
|
35
|
+
"node-opcua-utils": "2.184.1",
|
|
36
|
+
"node-opcua-variant": "2.184.1",
|
|
37
|
+
"typescript-5": "npm:typescript@5.9.3"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"node-opcua-packet-analyzer": "2.
|
|
40
|
-
"node-opcua-test-helpers": "2.
|
|
40
|
+
"node-opcua-packet-analyzer": "2.184.1",
|
|
41
|
+
"node-opcua-test-helpers": "2.184.0"
|
|
41
42
|
},
|
|
42
43
|
"author": "Etienne Rossignon",
|
|
43
44
|
"license": "MIT",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"internet of things"
|
|
55
56
|
],
|
|
56
57
|
"homepage": "http://node-opcua.github.io/",
|
|
57
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "29af4e8ac45f585e7b0d8cff9c799b4f0f2f0985",
|
|
58
59
|
"files": [
|
|
59
60
|
"dist",
|
|
60
61
|
"source"
|
|
@@ -69,7 +69,7 @@ function get_class_folder(_schemaName: string, optionalFolder?: string): string
|
|
|
69
69
|
}
|
|
70
70
|
folder = optionalFolder;
|
|
71
71
|
} else {
|
|
72
|
-
folder = exports.folder_for_generated_file;
|
|
72
|
+
folder = "."; // was exports.folder_for_generated_file, a CommonJS leftover; this branch always throws next
|
|
73
73
|
throw new Error("get_class_javascript_filename : DEPRECATED ");
|
|
74
74
|
}
|
|
75
75
|
return folder;
|
package/source/generator.ts
CHANGED
|
@@ -8,17 +8,16 @@ import fs from "node:fs";
|
|
|
8
8
|
const { mkdir } = fs.promises;
|
|
9
9
|
|
|
10
10
|
import path from "node:path";
|
|
11
|
+
import { pathToFileURL } from "node:url";
|
|
11
12
|
import { assert } from "node-opcua-assert";
|
|
12
13
|
import { checkDebugFlag, make_debugLog } from "node-opcua-debug";
|
|
13
14
|
import type { ConstructorFunc } from "node-opcua-factory";
|
|
14
|
-
|
|
15
|
+
// the classic compiler API, which TypeScript 7 no longer exposes: an aliased 5.x copy
|
|
16
|
+
import ts from "typescript-5";
|
|
15
17
|
|
|
16
18
|
import { get_class_TScript_filename, produce_TScript_code } from "./factory_code_generator.js";
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
// cannot be used while this package emits CommonJS (TS1470), so the ESM migration
|
|
20
|
-
// has this single line to change rather than several scattered uses.
|
|
21
|
-
const here = __dirname;
|
|
20
|
+
const here = import.meta.dirname;
|
|
22
21
|
|
|
23
22
|
const debugLog = make_debugLog("generator");
|
|
24
23
|
const doDebug = checkDebugFlag("generator");
|
|
@@ -133,7 +132,10 @@ export async function generateCode(schemaName: string, localSchemaFile: string,
|
|
|
133
132
|
const generatedSourceIsOutdated = !generatedSourceExists || codeGeneratorIsNewer || schemaFileIsNewer;
|
|
134
133
|
|
|
135
134
|
if (generatedSourceIsOutdated) {
|
|
136
|
-
|
|
135
|
+
// a file URL, not the path: an absolute Windows path starts "C:", which the ESM
|
|
136
|
+
// loader reads as a URL scheme and rejects with ERR_UNSUPPORTED_ESM_URL_SCHEME. POSIX
|
|
137
|
+
// paths start with "/" and happen to resolve, which is why CI never saw this.
|
|
138
|
+
const module = await import(pathToFileURL(localSchemaFile).href);
|
|
137
139
|
const schema = module[`${schemaName}_Schema`];
|
|
138
140
|
|
|
139
141
|
if (!schema) {
|
|
@@ -142,7 +144,7 @@ export async function generateCode(schemaName: string, localSchemaFile: string,
|
|
|
142
144
|
|
|
143
145
|
// c8 ignore next
|
|
144
146
|
doDebug && debugLog(" generated_source_is_outdated ", schemaName, " to ", generatedTypescriptSource);
|
|
145
|
-
if (
|
|
147
|
+
if (verbose) {
|
|
146
148
|
console.log(" generating ", schemaName, " in ", generatedTypescriptSource);
|
|
147
149
|
}
|
|
148
150
|
const localSchemaFile1 = path.join("../schemas", `${schemaName}_schema`);
|
|
@@ -178,7 +180,7 @@ export async function registerObject(schema: string, generateCodeFolder?: string
|
|
|
178
180
|
|
|
179
181
|
const schemaName = `${schema}_Schema`;
|
|
180
182
|
const schemaFile = path.join(folderHint, `${schema}_schema.ts`);
|
|
181
|
-
const module = await import(schemaFile);
|
|
183
|
+
const module = await import(pathToFileURL(schemaFile).href);
|
|
182
184
|
if (!module) {
|
|
183
185
|
throw new Error(`cannot find ${schemaFile}`);
|
|
184
186
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/* c8 ignore start */
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opcua-generator
|
|
6
|
-
*/
|
|
7
|
-
const generator_js_1 = require("./generator.js");
|
|
8
|
-
console.log(process.argv);
|
|
9
|
-
async function main() {
|
|
10
|
-
const className = "LocalizedText";
|
|
11
|
-
(0, generator_js_1.generateTypeScriptCodeFromSchema)(className);
|
|
12
|
-
}
|
|
13
|
-
main().then().catch();
|
|
14
|
-
/* c8 ignore stop */
|
|
15
|
-
//# sourceMappingURL=opcua_code_generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"opcua_code_generator.js","sourceRoot":"","sources":["../source/opcua_code_generator.ts"],"names":[],"mappings":";;AAAA,qBAAqB;AACrB;;GAEG;AACH,iDAAkE;AAElE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B,KAAK,UAAU,IAAI;IACf,MAAM,SAAS,GAAG,eAAe,CAAC;IAClC,IAAA,+CAAgC,EAAC,SAAS,CAAC,CAAC;AAChD,CAAC;AAED,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC;AACtB,oBAAoB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* c8 ignore start */
|
|
2
|
-
/**
|
|
3
|
-
* @module node-opcua-generator
|
|
4
|
-
*/
|
|
5
|
-
import { generateTypeScriptCodeFromSchema } from "./generator.js";
|
|
6
|
-
|
|
7
|
-
console.log(process.argv);
|
|
8
|
-
|
|
9
|
-
async function main() {
|
|
10
|
-
const className = "LocalizedText";
|
|
11
|
-
generateTypeScriptCodeFromSchema(className);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
main().then().catch();
|
|
15
|
-
/* c8 ignore stop */
|