@mat3ra/esse 2024.4.19-0 → 2024.6.4-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/js/schema/methods_category/physical/qm/wf/enum_options.json +1 -0
- package/dist/js/schema/methods_category/physical/qm/wf/psp.json +1 -0
- package/dist/js/schema/methods_directory/physical/psp/file.json +1 -0
- package/dist/js/schema/methods_directory/physical/psp/file_data_item.json +1 -0
- package/dist/js/schema/methods_directory/physical/psp.json +2 -0
- package/dist/js/schemas.json +1 -1
- package/dist/js/scripts/compileTs.js +12 -21
- package/dist/js/types.d.ts +5 -5
- package/dist/js/types.js +2 -2
- package/package.json +2 -18
- package/schema/methods_category/physical/qm/wf/enum_options.json +1 -0
- package/schema/methods_category/physical/qm/wf/enum_options.yml +1 -0
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault =
|
|
3
|
-
(
|
|
4
|
-
|
|
5
|
-
return mod && mod.__esModule ? mod : { default: mod };
|
|
6
|
-
};
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
7
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
6
|
const fs_1 = __importDefault(require("fs"));
|
|
9
7
|
const json_schema_to_typescript_1 = require("json-schema-to-typescript");
|
|
@@ -49,11 +47,7 @@ const filesystem_1 = require("../utils/filesystem");
|
|
|
49
47
|
function cleanSchema(schema) {
|
|
50
48
|
let firstRun = true;
|
|
51
49
|
return (0, schemaUtils_1.mapObjectDeep)(schema, (object) => {
|
|
52
|
-
if (
|
|
53
|
-
typeof object === "object" &&
|
|
54
|
-
(object === null || object === void 0 ? void 0 : object.title) &&
|
|
55
|
-
!firstRun
|
|
56
|
-
) {
|
|
50
|
+
if (typeof object === "object" && (object === null || object === void 0 ? void 0 : object.title) && !firstRun) {
|
|
57
51
|
firstRun = false;
|
|
58
52
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
53
|
const { title, $schema, ...restObject } = object;
|
|
@@ -65,7 +59,8 @@ function cleanSchema(schema) {
|
|
|
65
59
|
async function compileTS(schemaPath, savePath) {
|
|
66
60
|
try {
|
|
67
61
|
await fs_1.default.promises.unlink(savePath);
|
|
68
|
-
}
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
69
64
|
console.log("File with types not exists");
|
|
70
65
|
}
|
|
71
66
|
await (0, filesystem_1.walkDir)(schemaPath, async (filePath) => {
|
|
@@ -73,16 +68,12 @@ async function compileTS(schemaPath, savePath) {
|
|
|
73
68
|
const schema = cleanSchema(JSON.parse(data));
|
|
74
69
|
console.log(`Compiling Typescript: ${filePath}`);
|
|
75
70
|
// @ts-ignore
|
|
76
|
-
const compiledSchema = await (0, json_schema_to_typescript_1.compile)(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
enableConstEnums: false,
|
|
83
|
-
bannerComment: `/** Schema ${filePath} */`,
|
|
84
|
-
},
|
|
85
|
-
);
|
|
71
|
+
const compiledSchema = await (0, json_schema_to_typescript_1.compile)(schema, schema.title || "", {
|
|
72
|
+
unreachableDefinitions: true,
|
|
73
|
+
additionalProperties: false,
|
|
74
|
+
enableConstEnums: false,
|
|
75
|
+
bannerComment: `/** Schema ${filePath} */`,
|
|
76
|
+
});
|
|
86
77
|
await fs_1.default.promises.appendFile(savePath, `${compiledSchema} \n`, { flag: "a+" });
|
|
87
78
|
});
|
|
88
79
|
}
|
package/dist/js/types.d.ts
CHANGED
|
@@ -10839,7 +10839,7 @@ export interface PseudopotentialCategorySchema {
|
|
|
10839
10839
|
* machine-readable identifier
|
|
10840
10840
|
*/
|
|
10841
10841
|
slug: string;
|
|
10842
|
-
} | string) & ("us" | "nc" | "paw" | "coulomb");
|
|
10842
|
+
} | string) & ("us" | "nc" | "nc-fr" | "paw" | "coulomb");
|
|
10843
10843
|
/**
|
|
10844
10844
|
* contains either object with slugified entry or slug only as a string
|
|
10845
10845
|
*/
|
|
@@ -12270,7 +12270,7 @@ export interface PseudopotentialFile {
|
|
|
12270
12270
|
* MD5 hash of the pseudopotential file
|
|
12271
12271
|
*/
|
|
12272
12272
|
hash?: string;
|
|
12273
|
-
type: "us" | "nc" | "paw" | "coulomb";
|
|
12273
|
+
type: "us" | "nc" | "nc-fr" | "paw" | "coulomb";
|
|
12274
12274
|
/**
|
|
12275
12275
|
* explains where this came from
|
|
12276
12276
|
*/
|
|
@@ -12341,7 +12341,7 @@ export interface FileDataItem {
|
|
|
12341
12341
|
* MD5 hash of the pseudopotential file
|
|
12342
12342
|
*/
|
|
12343
12343
|
hash?: string;
|
|
12344
|
-
type: "us" | "nc" | "paw" | "coulomb";
|
|
12344
|
+
type: "us" | "nc" | "nc-fr" | "paw" | "coulomb";
|
|
12345
12345
|
/**
|
|
12346
12346
|
* explains where this came from
|
|
12347
12347
|
*/
|
|
@@ -12428,7 +12428,7 @@ export interface UnitMethodPseudopotential {
|
|
|
12428
12428
|
* machine-readable identifier
|
|
12429
12429
|
*/
|
|
12430
12430
|
slug: string;
|
|
12431
|
-
} | string) & ("us" | "nc" | "paw" | "coulomb");
|
|
12431
|
+
} | string) & ("us" | "nc" | "nc-fr" | "paw" | "coulomb");
|
|
12432
12432
|
/**
|
|
12433
12433
|
* contains either object with slugified entry or slug only as a string
|
|
12434
12434
|
*/
|
|
@@ -12480,7 +12480,7 @@ export interface UnitMethodPseudopotential {
|
|
|
12480
12480
|
* MD5 hash of the pseudopotential file
|
|
12481
12481
|
*/
|
|
12482
12482
|
hash?: string;
|
|
12483
|
-
type: "us" | "nc" | "paw" | "coulomb";
|
|
12483
|
+
type: "us" | "nc" | "nc-fr" | "paw" | "coulomb";
|
|
12484
12484
|
/**
|
|
12485
12485
|
* explains where this came from
|
|
12486
12486
|
*/
|
package/dist/js/types.js
CHANGED
|
@@ -9,7 +9,7 @@ var Type;
|
|
|
9
9
|
(function (Type) {
|
|
10
10
|
Type["fromIframeToHost"] = "from-iframe-to-host";
|
|
11
11
|
Type["fromHostToIframe"] = "from-host-to-iframe";
|
|
12
|
-
})(
|
|
12
|
+
})(Type = exports.Type || (exports.Type = {}));
|
|
13
13
|
/**
|
|
14
14
|
* The action to be performed upon receiving the message.
|
|
15
15
|
*/
|
|
@@ -18,4 +18,4 @@ var Action;
|
|
|
18
18
|
Action["setData"] = "set-data";
|
|
19
19
|
Action["getData"] = "get-data";
|
|
20
20
|
Action["info"] = "info";
|
|
21
|
-
})(
|
|
21
|
+
})(Action = exports.Action || (exports.Action = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mat3ra/esse",
|
|
3
|
-
"version": "2024.4
|
|
3
|
+
"version": "2024.6.4-0",
|
|
4
4
|
"description": "Mat3ra's Excellent Source of Schemas and Examples (ESSE) for Digital Materials R&D",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"transpile": "tsc -p tsconfig-transpile.json",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"homepage": "https://github.com/Exabyte-io/esse",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@exabyte-io/eslint-config": "^2023.8.29-1",
|
|
31
|
-
"@mat3ra/tsconfig": "^2024.3
|
|
31
|
+
"@mat3ra/tsconfig": "^2024.6.3-0",
|
|
32
32
|
"@typescript-eslint/eslint-plugin": "^5.9.1",
|
|
33
33
|
"@typescript-eslint/parser": "^5.9.1",
|
|
34
34
|
"chai": "4.3.4",
|
|
@@ -87,22 +87,6 @@
|
|
|
87
87
|
"*.{js,css}": "prettier --write"
|
|
88
88
|
},
|
|
89
89
|
"exports": {
|
|
90
|
-
"./lib/js/schema/*.json": "./dist/js/schema/*.json",
|
|
91
|
-
"./lib/js/example/*": "./dist/js/example/*.js",
|
|
92
|
-
"./lib/js/utils/*": "./dist/js/utils/*.js",
|
|
93
|
-
"./lib/js/esse/*": "./dist/js/esse/*.js",
|
|
94
|
-
"./lib/js/json_include/*": "./dist/js/json_include/*.js",
|
|
95
|
-
"./lib/js/scripts/*": "./dist/js/scripts/*.js",
|
|
96
|
-
"./lib/js/types": "./dist/js/types.ts",
|
|
97
|
-
"./lib/js/schemas.json": "./dist/js/schemas.json",
|
|
98
|
-
"./dist/schema/*.json": "./dist/js/schema/*.json",
|
|
99
|
-
"./dist/example/*": "./dist/js/example/*.js",
|
|
100
|
-
"./dist/utils/*": "./dist/js/utils/*.js",
|
|
101
|
-
"./dist/esse/*": "./dist/js/esse/*.js",
|
|
102
|
-
"./dist/json_include/*": "./dist/js/json_include/*.js",
|
|
103
|
-
"./dist/scripts/*": "./dist/js/scripts/*.js",
|
|
104
|
-
"./dist/types": "./dist/js/types.ts",
|
|
105
|
-
"./dist/schemas.json": "./dist/js/schemas.json",
|
|
106
90
|
"./dist/js/schema/*.json": "./dist/js/schema/*.json",
|
|
107
91
|
"./dist/js/example/*": "./dist/js/example/*.js",
|
|
108
92
|
"./dist/js/utils/*": "./dist/js/utils/*.js",
|