node-opcua-generator 2.65.0 → 2.68.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/dist/generate_extension_object_code.js +1 -1
- package/dist/generator.js +3 -3
- package/dist/utils/index.js +5 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/line_file.js +2 -2
- package/dist/utils/normalize_require_file.js +2 -2
- package/dist/utils/normalize_require_file.js.map +1 -1
- package/package.json +26 -26
- package/source/generate_extension_object_code.ts +1 -1
- package/source/generator.ts +3 -3
- package/source/utils/line_file.ts +2 -2
- package/source/utils/normalize_require_file.ts +2 -2
|
@@ -125,7 +125,7 @@ function writeStructuredTypeWithSchema(structuredType) {
|
|
|
125
125
|
}
|
|
126
126
|
function generate(filename, generatedTypescriptFilename) {
|
|
127
127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
-
const content = yield readFile(filename, "
|
|
128
|
+
const content = yield readFile(filename, "utf-8");
|
|
129
129
|
const idProvider = {
|
|
130
130
|
getDataTypeAndEncodingId(name) {
|
|
131
131
|
const dataType = node_opcua_constants_1.DataTypeIds[name] || 0;
|
package/dist/generator.js
CHANGED
|
@@ -32,7 +32,7 @@ const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
|
|
|
32
32
|
* @static
|
|
33
33
|
*/
|
|
34
34
|
function compileTScriptCode(typescriptFilename) {
|
|
35
|
-
const content = fs.readFileSync(typescriptFilename, "
|
|
35
|
+
const content = fs.readFileSync(typescriptFilename, "utf-8");
|
|
36
36
|
const compilerOptions = {
|
|
37
37
|
module: ts.ModuleKind.CommonJS,
|
|
38
38
|
target: ts.ScriptTarget.ES2016,
|
|
@@ -46,8 +46,8 @@ function compileTScriptCode(typescriptFilename) {
|
|
|
46
46
|
const res1 = ts.transpileModule(content, { compilerOptions, moduleName: "myModule2" });
|
|
47
47
|
const javascriptFilename = typescriptFilename.replace(/\.ts$/, ".js");
|
|
48
48
|
const sourceMapFilename = typescriptFilename.replace(/\.ts$/, ".js.map");
|
|
49
|
-
fs.writeFileSync(javascriptFilename, res1.outputText, "
|
|
50
|
-
fs.writeFileSync(sourceMapFilename, res1.sourceMapText, "
|
|
49
|
+
fs.writeFileSync(javascriptFilename, res1.outputText, "utf-8");
|
|
50
|
+
fs.writeFileSync(sourceMapFilename, res1.sourceMapText, "utf-8");
|
|
51
51
|
return res1.outputText;
|
|
52
52
|
}
|
|
53
53
|
exports.verbose = false;
|
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/utils/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2DAAyC"}
|
package/dist/utils/line_file.js
CHANGED
|
@@ -15,11 +15,11 @@ class LineFile1 extends node_opcua_utils_1.LineFile {
|
|
|
15
15
|
this.write(" */");
|
|
16
16
|
}
|
|
17
17
|
save(filename) {
|
|
18
|
-
(0, fs_1.writeFileSync)(filename, this.toString(), "
|
|
18
|
+
(0, fs_1.writeFileSync)(filename, this.toString(), "utf-8");
|
|
19
19
|
}
|
|
20
20
|
saveFormat(filename, formatter) {
|
|
21
21
|
const code = formatter(this.toString());
|
|
22
|
-
(0, fs_1.writeFileSync)(filename, code, "
|
|
22
|
+
(0, fs_1.writeFileSync)(filename, code, "utf-8");
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
exports.LineFile1 = LineFile1;
|
|
@@ -15,11 +15,11 @@ const path = require("path");
|
|
|
15
15
|
function normalize_require_file(baseFolder, fullPathToFile) {
|
|
16
16
|
let localFile = path.relative(baseFolder, fullPathToFile).replace(/\\/g, "/");
|
|
17
17
|
// append ./ if necessary
|
|
18
|
-
if (localFile.
|
|
18
|
+
if (localFile.substring(0, 1) !== ".") {
|
|
19
19
|
localFile = "./" + localFile;
|
|
20
20
|
}
|
|
21
21
|
// remove extension
|
|
22
|
-
localFile = localFile.
|
|
22
|
+
localFile = localFile.substring(0, localFile.length - path.extname(localFile).length);
|
|
23
23
|
return localFile;
|
|
24
24
|
}
|
|
25
25
|
exports.normalize_require_file = normalize_require_file;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize_require_file.js","sourceRoot":"","sources":["../../source/utils/normalize_require_file.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wHAAwH;AACxH;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CAAC,UAAkB,EAAE,cAAsB;IAC7E,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9E,yBAAyB;IACzB,IAAI,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"normalize_require_file.js","sourceRoot":"","sources":["../../source/utils/normalize_require_file.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wHAAwH;AACxH;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CAAC,UAAkB,EAAE,cAAsB;IAC7E,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9E,yBAAyB;IACzB,IAAI,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,EAAE;QACnC,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;KAChC;IACD,mBAAmB;IACnB,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACtF,OAAO,SAAS,CAAC;AACrB,CAAC;AATD,wDASC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-generator",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.68.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -generator",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,38 +8,38 @@
|
|
|
8
8
|
"build": "tsc -b",
|
|
9
9
|
"lint": "eslint source test",
|
|
10
10
|
"format": "prettier --write source test",
|
|
11
|
-
"clean": "
|
|
11
|
+
"clean": "npx rimraf dist *.tsbuildinfo",
|
|
12
12
|
"test": "mocha"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"chalk": "4.1.2",
|
|
16
|
-
"node-opcua-assert": "2.
|
|
17
|
-
"node-opcua-basic-types": "2.
|
|
18
|
-
"node-opcua-buffer-utils": "2.
|
|
19
|
-
"node-opcua-constants": "2.
|
|
20
|
-
"node-opcua-data-model": "2.
|
|
21
|
-
"node-opcua-data-value": "2.
|
|
22
|
-
"node-opcua-date-time": "2.
|
|
23
|
-
"node-opcua-debug": "2.
|
|
24
|
-
"node-opcua-enum": "2.
|
|
25
|
-
"node-opcua-factory": "2.
|
|
26
|
-
"node-opcua-guid": "2.
|
|
27
|
-
"node-opcua-nodeid": "2.
|
|
28
|
-
"node-opcua-numeric-range": "2.
|
|
29
|
-
"node-opcua-schemas": "2.
|
|
30
|
-
"node-opcua-status-code": "2.
|
|
31
|
-
"node-opcua-utils": "2.
|
|
32
|
-
"node-opcua-variant": "2.
|
|
33
|
-
"node-opcua-xml2json": "2.
|
|
16
|
+
"node-opcua-assert": "2.66.0",
|
|
17
|
+
"node-opcua-basic-types": "2.68.0",
|
|
18
|
+
"node-opcua-buffer-utils": "2.67.0",
|
|
19
|
+
"node-opcua-constants": "2.67.0",
|
|
20
|
+
"node-opcua-data-model": "2.68.0",
|
|
21
|
+
"node-opcua-data-value": "2.68.0",
|
|
22
|
+
"node-opcua-date-time": "2.68.0",
|
|
23
|
+
"node-opcua-debug": "2.68.0",
|
|
24
|
+
"node-opcua-enum": "2.67.0",
|
|
25
|
+
"node-opcua-factory": "2.68.0",
|
|
26
|
+
"node-opcua-guid": "2.66.0",
|
|
27
|
+
"node-opcua-nodeid": "2.68.0",
|
|
28
|
+
"node-opcua-numeric-range": "2.68.0",
|
|
29
|
+
"node-opcua-schemas": "2.68.0",
|
|
30
|
+
"node-opcua-status-code": "2.67.0",
|
|
31
|
+
"node-opcua-utils": "2.67.0",
|
|
32
|
+
"node-opcua-variant": "2.68.0",
|
|
33
|
+
"node-opcua-xml2json": "2.68.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"node-opcua-binary-stream": "2.
|
|
37
|
-
"node-opcua-extension-object": "2.
|
|
38
|
-
"node-opcua-packet-analyzer": "2.
|
|
39
|
-
"prettier": "^2.
|
|
36
|
+
"node-opcua-binary-stream": "2.67.0",
|
|
37
|
+
"node-opcua-extension-object": "2.68.0",
|
|
38
|
+
"node-opcua-packet-analyzer": "2.68.0",
|
|
39
|
+
"prettier": "^2.6.1",
|
|
40
40
|
"should": "^13.2.3",
|
|
41
41
|
"source-map-support": "^0.5.21",
|
|
42
|
-
"typescript": "4.6.
|
|
42
|
+
"typescript": "4.6.3"
|
|
43
43
|
},
|
|
44
44
|
"author": "Etienne Rossignon",
|
|
45
45
|
"license": "MIT",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"internet of things"
|
|
57
57
|
],
|
|
58
58
|
"homepage": "http://node-opcua.github.io/",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "363b466440d0910acddd0cde2c37792ce4724d76"
|
|
60
60
|
}
|
|
@@ -139,7 +139,7 @@ function writeStructuredTypeWithSchema(structuredType: StructuredTypeSchema) {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
export async function generate(filename: string, generatedTypescriptFilename: string): Promise<void> {
|
|
142
|
-
const content = await readFile(filename, "
|
|
142
|
+
const content = await readFile(filename, "utf-8");
|
|
143
143
|
|
|
144
144
|
const idProvider: MapDataTypeAndEncodingIdProvider = {
|
|
145
145
|
getDataTypeAndEncodingId(name: string): DataTypeAndEncodingId | null {
|
package/source/generator.ts
CHANGED
|
@@ -27,7 +27,7 @@ const doDebug = checkDebugFlag(__filename);
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
function compileTScriptCode(typescriptFilename: string): string {
|
|
30
|
-
const content = fs.readFileSync(typescriptFilename, "
|
|
30
|
+
const content = fs.readFileSync(typescriptFilename, "utf-8");
|
|
31
31
|
|
|
32
32
|
const compilerOptions = {
|
|
33
33
|
module: ts.ModuleKind.CommonJS,
|
|
@@ -48,8 +48,8 @@ function compileTScriptCode(typescriptFilename: string): string {
|
|
|
48
48
|
const javascriptFilename = typescriptFilename.replace(/\.ts$/, ".js");
|
|
49
49
|
const sourceMapFilename = typescriptFilename.replace(/\.ts$/, ".js.map");
|
|
50
50
|
|
|
51
|
-
fs.writeFileSync(javascriptFilename, res1.outputText, "
|
|
52
|
-
fs.writeFileSync(sourceMapFilename, res1.sourceMapText!, "
|
|
51
|
+
fs.writeFileSync(javascriptFilename, res1.outputText, "utf-8");
|
|
52
|
+
fs.writeFileSync(sourceMapFilename, res1.sourceMapText!, "utf-8");
|
|
53
53
|
|
|
54
54
|
return res1.outputText;
|
|
55
55
|
}
|
|
@@ -13,11 +13,11 @@ export class LineFile1 extends LineFile {
|
|
|
13
13
|
this.write(" */");
|
|
14
14
|
}
|
|
15
15
|
public save(filename: string): void {
|
|
16
|
-
writeFileSync(filename, this.toString(), "
|
|
16
|
+
writeFileSync(filename, this.toString(), "utf-8");
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
public saveFormat(filename: string, formatter: (code: string) => string): void {
|
|
20
20
|
const code = formatter(this.toString());
|
|
21
|
-
writeFileSync(filename, code, "
|
|
21
|
+
writeFileSync(filename, code, "utf-8");
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -12,10 +12,10 @@ import * as path from "path";
|
|
|
12
12
|
export function normalize_require_file(baseFolder: string, fullPathToFile: string): string {
|
|
13
13
|
let localFile = path.relative(baseFolder, fullPathToFile).replace(/\\/g, "/");
|
|
14
14
|
// append ./ if necessary
|
|
15
|
-
if (localFile.
|
|
15
|
+
if (localFile.substring(0, 1) !== ".") {
|
|
16
16
|
localFile = "./" + localFile;
|
|
17
17
|
}
|
|
18
18
|
// remove extension
|
|
19
|
-
localFile = localFile.
|
|
19
|
+
localFile = localFile.substring(0, localFile.length - path.extname(localFile).length);
|
|
20
20
|
return localFile;
|
|
21
21
|
}
|