node-opcua-generator 2.67.0 → 2.69.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.
|
@@ -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/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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-generator",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.69.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -generator",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -14,32 +14,32 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"chalk": "4.1.2",
|
|
16
16
|
"node-opcua-assert": "2.66.0",
|
|
17
|
-
"node-opcua-basic-types": "2.
|
|
18
|
-
"node-opcua-buffer-utils": "2.
|
|
17
|
+
"node-opcua-basic-types": "2.69.0",
|
|
18
|
+
"node-opcua-buffer-utils": "2.69.0",
|
|
19
19
|
"node-opcua-constants": "2.67.0",
|
|
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.
|
|
20
|
+
"node-opcua-data-model": "2.69.0",
|
|
21
|
+
"node-opcua-data-value": "2.69.0",
|
|
22
|
+
"node-opcua-date-time": "2.69.0",
|
|
23
|
+
"node-opcua-debug": "2.69.0",
|
|
24
|
+
"node-opcua-enum": "2.69.0",
|
|
25
|
+
"node-opcua-factory": "2.69.0",
|
|
26
26
|
"node-opcua-guid": "2.66.0",
|
|
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.
|
|
27
|
+
"node-opcua-nodeid": "2.69.0",
|
|
28
|
+
"node-opcua-numeric-range": "2.69.0",
|
|
29
|
+
"node-opcua-schemas": "2.69.0",
|
|
30
|
+
"node-opcua-status-code": "2.69.0",
|
|
31
|
+
"node-opcua-utils": "2.69.0",
|
|
32
|
+
"node-opcua-variant": "2.69.0",
|
|
33
|
+
"node-opcua-xml2json": "2.69.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.6.
|
|
36
|
+
"node-opcua-binary-stream": "2.69.0",
|
|
37
|
+
"node-opcua-extension-object": "2.69.0",
|
|
38
|
+
"node-opcua-packet-analyzer": "2.69.0",
|
|
39
|
+
"prettier": "^2.6.2",
|
|
40
40
|
"should": "^13.2.3",
|
|
41
41
|
"source-map-support": "^0.5.21",
|
|
42
|
-
"typescript": "4.
|
|
42
|
+
"typescript": "4.7.2"
|
|
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": "6c88d05e8c82ce4bc9c8af9f0a8eb6136f31d2ce"
|
|
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
|
}
|