From cee3e503cff44ca6e0a4bfcfd93a28dcb1ecd43d Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Mon, 17 Nov 2025 16:52:51 -0800 Subject: [PATCH 1/8] update: mat3ra namespace --- .gitignore | 1 + package.json | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a02ca45..4021c69 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ __pycache__/ *.egg-info/ .coverage htmlcov/ +.python-version diff --git a/package.json b/package.json index 389611a..71fc87e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@exabyte-io/prode.js", + "name": "@mat3ra/prode", "version": "0.0.0", "description": "PROperty DEfinitions", "scripts": { @@ -18,7 +18,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/Exabyte-io/prode.js.git" + "url": "https://github.com/Exabyte-io/prode.git" }, "main": "dist/js/index.js", "files": [ @@ -29,10 +29,10 @@ ], "author": "Exabyte Inc.", "bugs": { - "url": "https://github.com/Exabyte-io/prode.js/issues" + "url": "https://github.com/Exabyte-io/prode/issues" }, "license": "Apache-2.0", - "homepage": "https://github.com/Exabyte-io/prode.js", + "homepage": "https://github.com/Exabyte-io/prode", "dependencies": { "@types/highcharts": "^5.0.44", "lodash": "^4.17.21" From dcc8abcfae0b992184cf3cb248eca3a7ee9de7fd Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Mon, 17 Nov 2025 16:53:45 -0800 Subject: [PATCH 2/8] chore: package lock --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1164ba9..a5ee00a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@exabyte-io/prode.js", + "name": "@mat3ra/prode", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@exabyte-io/prode.js", + "name": "@mat3ra/prode", "version": "0.0.0", "license": "Apache-2.0", "dependencies": { From 35785266ed24417a45c2ffa9cece9c210bf081b1 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 18 Nov 2025 18:25:10 -0800 Subject: [PATCH 3/8] update: export from index and types --- src/js/index.ts | 18 +++++++++++++++++- src/js/types.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/js/types.ts diff --git a/src/js/index.ts b/src/js/index.ts index c2e07b2..9b17b42 100644 --- a/src/js/index.ts +++ b/src/js/index.ts @@ -1,3 +1,19 @@ -// Add exports here export { default as PropertyFactory } from "./PropertyFactory"; export { PropertyName, PropertyType } from "./settings"; +export { default as Property } from "./Property"; +export { default as MetaProperty } from "./MetaProperty"; +export { default as PseudopotentialMetaProperty } from "./meta_properties/PseudopotentialMetaProperty"; +export { default as FinalStructureProperty } from "./properties/non-scalar/FinalStructureProperty"; +export { default as BandGapsProperty } from "./properties/non-scalar/BandGapsProperty"; +export { default as IsRelaxedProperty } from "./properties/non-scalar/IsRelaxedProperty"; +export { default as PressureProperty } from "./properties/scalar/PressureProperty"; +export { default as ReactionEnergyBarrierProperty } from "./properties/scalar/ReactionEnergyBarrierProperty"; +export { default as SurfaceEnergyProperty } from "./properties/scalar/SurfaceEnergyProperty"; +export { default as TotalEnergyProperty } from "./properties/scalar/TotalEnergyProperty"; +export { default as BandStructureProperty } from "./properties/non-scalar/BandStructureProperty"; +export { default as ChargeDensityProfileProperty } from "./properties/non-scalar/ChargeDensityProfileProperty"; +export { default as PotentialProfileProperty } from "./properties/non-scalar/PotentialProfileProperty"; +export { default as ReactionEnergyProfileProperty } from "./properties/non-scalar/ReactionEnergyProfileProperty"; +export { protoPropertyHolderMixin } from "./holders/mixins/ProtoPropertyHolderMixin"; +export { propertyHolderMixin } from "./holders/mixins/PropertyHolderMixin"; +export { metaPropertyHolderMixin } from "./holders/mixins/MetaPropertyHolderMixin"; diff --git a/src/js/types.ts b/src/js/types.ts new file mode 100644 index 0000000..e3ddea8 --- /dev/null +++ b/src/js/types.ts @@ -0,0 +1,28 @@ +export type { PropertySchemaJSON, PropertyRowValue } from "./Property"; +export type { + PropertyHolderSourceSchema, + PropertyHolderMixin, + PropertyInMemoryEntity, +} from "./holders/mixins/PropertyHolderMixin"; +export type { + ProtoPropertyHolderMixin, + ProtoPropertyInMemoryEntity, +} from "./holders/mixins/ProtoPropertyHolderMixin"; +export type { ProtoPropertySchemaJSON } from "./holders/mixins/ProtoPropertyHolderMixin"; +export type { + MetaPropertyHolderMixin, + MetaPropertyInMemoryEntity, +} from "./holders/mixins/MetaPropertyHolderMixin"; +export type { MetaPropertySchemaJSON } from "./holders/mixins/MetaPropertyHolderMixin"; +export type { default as AtomicForcesProperty } from "./properties/tensor/AtomicForcesProperty"; +export type { default as MagneticMomentsProperty } from "./properties/tensor/MagneticMomentsProperty"; +export type { default as StressTensorProperty } from "./properties/tensor/StressTensorProperty"; +export type { default as AveragePotentialProfileProperty } from "./properties/non-scalar/AveragePotentialProfileProperty"; +export type { default as BandStructureProperty } from "./properties/non-scalar/BandStructureProperty"; +export type { default as ChargeDensityProfileProperty } from "./properties/non-scalar/ChargeDensityProfileProperty"; +export type { default as DensityOfStatesProperty } from "./properties/non-scalar/DensityOfStatesProperty"; +export type { default as DielectricTensorProperty } from "./properties/non-scalar/DielectricTensorProperty"; +export type { default as PhononDispersionsProperty } from "./properties/non-scalar/PhononDispersionsProperty"; +export type { default as PhononDOSProperty } from "./properties/non-scalar/PhononDOSProperty"; +export type { default as PotentialProfileProperty } from "./properties/non-scalar/PotentialProfileProperty"; +export type { default as ReactionEnergyProfileProperty } from "./properties/non-scalar/ReactionEnergyProfileProperty"; From 9b8c2a498e37ff9e7747823be79fcd6080bcf03c Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 18 Nov 2025 18:26:28 -0800 Subject: [PATCH 4/8] chore: add dist --- .husky/pre-commit | 2 ++ dist/js/index.d.ts | 17 +++++++++++++++++ dist/js/index.js | 37 +++++++++++++++++++++++++++++++++++-- dist/js/types.d.ts | 18 ++++++++++++++++++ dist/js/types.js | 2 ++ 5 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 dist/js/types.d.ts create mode 100644 dist/js/types.js diff --git a/.husky/pre-commit b/.husky/pre-commit index 36af219..76031ec 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,3 +2,5 @@ . "$(dirname "$0")/_/husky.sh" npx lint-staged +npm run transpile +git add dist/ diff --git a/dist/js/index.d.ts b/dist/js/index.d.ts index 5cd4766..9b17b42 100644 --- a/dist/js/index.d.ts +++ b/dist/js/index.d.ts @@ -1,2 +1,19 @@ export { default as PropertyFactory } from "./PropertyFactory"; export { PropertyName, PropertyType } from "./settings"; +export { default as Property } from "./Property"; +export { default as MetaProperty } from "./MetaProperty"; +export { default as PseudopotentialMetaProperty } from "./meta_properties/PseudopotentialMetaProperty"; +export { default as FinalStructureProperty } from "./properties/non-scalar/FinalStructureProperty"; +export { default as BandGapsProperty } from "./properties/non-scalar/BandGapsProperty"; +export { default as IsRelaxedProperty } from "./properties/non-scalar/IsRelaxedProperty"; +export { default as PressureProperty } from "./properties/scalar/PressureProperty"; +export { default as ReactionEnergyBarrierProperty } from "./properties/scalar/ReactionEnergyBarrierProperty"; +export { default as SurfaceEnergyProperty } from "./properties/scalar/SurfaceEnergyProperty"; +export { default as TotalEnergyProperty } from "./properties/scalar/TotalEnergyProperty"; +export { default as BandStructureProperty } from "./properties/non-scalar/BandStructureProperty"; +export { default as ChargeDensityProfileProperty } from "./properties/non-scalar/ChargeDensityProfileProperty"; +export { default as PotentialProfileProperty } from "./properties/non-scalar/PotentialProfileProperty"; +export { default as ReactionEnergyProfileProperty } from "./properties/non-scalar/ReactionEnergyProfileProperty"; +export { protoPropertyHolderMixin } from "./holders/mixins/ProtoPropertyHolderMixin"; +export { propertyHolderMixin } from "./holders/mixins/PropertyHolderMixin"; +export { metaPropertyHolderMixin } from "./holders/mixins/MetaPropertyHolderMixin"; diff --git a/dist/js/index.js b/dist/js/index.js index 29156c4..8234746 100644 --- a/dist/js/index.js +++ b/dist/js/index.js @@ -3,10 +3,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.PropertyType = exports.PropertyName = exports.PropertyFactory = void 0; -// Add exports here +exports.metaPropertyHolderMixin = exports.propertyHolderMixin = exports.protoPropertyHolderMixin = exports.ReactionEnergyProfileProperty = exports.PotentialProfileProperty = exports.ChargeDensityProfileProperty = exports.BandStructureProperty = exports.TotalEnergyProperty = exports.SurfaceEnergyProperty = exports.ReactionEnergyBarrierProperty = exports.PressureProperty = exports.IsRelaxedProperty = exports.BandGapsProperty = exports.FinalStructureProperty = exports.PseudopotentialMetaProperty = exports.MetaProperty = exports.Property = exports.PropertyType = exports.PropertyName = exports.PropertyFactory = void 0; var PropertyFactory_1 = require("./PropertyFactory"); Object.defineProperty(exports, "PropertyFactory", { enumerable: true, get: function () { return __importDefault(PropertyFactory_1).default; } }); var settings_1 = require("./settings"); Object.defineProperty(exports, "PropertyName", { enumerable: true, get: function () { return settings_1.PropertyName; } }); Object.defineProperty(exports, "PropertyType", { enumerable: true, get: function () { return settings_1.PropertyType; } }); +var Property_1 = require("./Property"); +Object.defineProperty(exports, "Property", { enumerable: true, get: function () { return __importDefault(Property_1).default; } }); +var MetaProperty_1 = require("./MetaProperty"); +Object.defineProperty(exports, "MetaProperty", { enumerable: true, get: function () { return __importDefault(MetaProperty_1).default; } }); +var PseudopotentialMetaProperty_1 = require("./meta_properties/PseudopotentialMetaProperty"); +Object.defineProperty(exports, "PseudopotentialMetaProperty", { enumerable: true, get: function () { return __importDefault(PseudopotentialMetaProperty_1).default; } }); +var FinalStructureProperty_1 = require("./properties/non-scalar/FinalStructureProperty"); +Object.defineProperty(exports, "FinalStructureProperty", { enumerable: true, get: function () { return __importDefault(FinalStructureProperty_1).default; } }); +var BandGapsProperty_1 = require("./properties/non-scalar/BandGapsProperty"); +Object.defineProperty(exports, "BandGapsProperty", { enumerable: true, get: function () { return __importDefault(BandGapsProperty_1).default; } }); +var IsRelaxedProperty_1 = require("./properties/non-scalar/IsRelaxedProperty"); +Object.defineProperty(exports, "IsRelaxedProperty", { enumerable: true, get: function () { return __importDefault(IsRelaxedProperty_1).default; } }); +var PressureProperty_1 = require("./properties/scalar/PressureProperty"); +Object.defineProperty(exports, "PressureProperty", { enumerable: true, get: function () { return __importDefault(PressureProperty_1).default; } }); +var ReactionEnergyBarrierProperty_1 = require("./properties/scalar/ReactionEnergyBarrierProperty"); +Object.defineProperty(exports, "ReactionEnergyBarrierProperty", { enumerable: true, get: function () { return __importDefault(ReactionEnergyBarrierProperty_1).default; } }); +var SurfaceEnergyProperty_1 = require("./properties/scalar/SurfaceEnergyProperty"); +Object.defineProperty(exports, "SurfaceEnergyProperty", { enumerable: true, get: function () { return __importDefault(SurfaceEnergyProperty_1).default; } }); +var TotalEnergyProperty_1 = require("./properties/scalar/TotalEnergyProperty"); +Object.defineProperty(exports, "TotalEnergyProperty", { enumerable: true, get: function () { return __importDefault(TotalEnergyProperty_1).default; } }); +var BandStructureProperty_1 = require("./properties/non-scalar/BandStructureProperty"); +Object.defineProperty(exports, "BandStructureProperty", { enumerable: true, get: function () { return __importDefault(BandStructureProperty_1).default; } }); +var ChargeDensityProfileProperty_1 = require("./properties/non-scalar/ChargeDensityProfileProperty"); +Object.defineProperty(exports, "ChargeDensityProfileProperty", { enumerable: true, get: function () { return __importDefault(ChargeDensityProfileProperty_1).default; } }); +var PotentialProfileProperty_1 = require("./properties/non-scalar/PotentialProfileProperty"); +Object.defineProperty(exports, "PotentialProfileProperty", { enumerable: true, get: function () { return __importDefault(PotentialProfileProperty_1).default; } }); +var ReactionEnergyProfileProperty_1 = require("./properties/non-scalar/ReactionEnergyProfileProperty"); +Object.defineProperty(exports, "ReactionEnergyProfileProperty", { enumerable: true, get: function () { return __importDefault(ReactionEnergyProfileProperty_1).default; } }); +var ProtoPropertyHolderMixin_1 = require("./holders/mixins/ProtoPropertyHolderMixin"); +Object.defineProperty(exports, "protoPropertyHolderMixin", { enumerable: true, get: function () { return ProtoPropertyHolderMixin_1.protoPropertyHolderMixin; } }); +var PropertyHolderMixin_1 = require("./holders/mixins/PropertyHolderMixin"); +Object.defineProperty(exports, "propertyHolderMixin", { enumerable: true, get: function () { return PropertyHolderMixin_1.propertyHolderMixin; } }); +var MetaPropertyHolderMixin_1 = require("./holders/mixins/MetaPropertyHolderMixin"); +Object.defineProperty(exports, "metaPropertyHolderMixin", { enumerable: true, get: function () { return MetaPropertyHolderMixin_1.metaPropertyHolderMixin; } }); diff --git a/dist/js/types.d.ts b/dist/js/types.d.ts new file mode 100644 index 0000000..a12d701 --- /dev/null +++ b/dist/js/types.d.ts @@ -0,0 +1,18 @@ +export type { PropertySchemaJSON, PropertyRowValue } from "./Property"; +export type { PropertyHolderSourceSchema, PropertyHolderMixin, PropertyInMemoryEntity, } from "./holders/mixins/PropertyHolderMixin"; +export type { ProtoPropertyHolderMixin, ProtoPropertyInMemoryEntity, } from "./holders/mixins/ProtoPropertyHolderMixin"; +export type { ProtoPropertySchemaJSON } from "./holders/mixins/ProtoPropertyHolderMixin"; +export type { MetaPropertyHolderMixin, MetaPropertyInMemoryEntity, } from "./holders/mixins/MetaPropertyHolderMixin"; +export type { MetaPropertySchemaJSON } from "./holders/mixins/MetaPropertyHolderMixin"; +export type { default as AtomicForcesProperty } from "./properties/tensor/AtomicForcesProperty"; +export type { default as MagneticMomentsProperty } from "./properties/tensor/MagneticMomentsProperty"; +export type { default as StressTensorProperty } from "./properties/tensor/StressTensorProperty"; +export type { default as AveragePotentialProfileProperty } from "./properties/non-scalar/AveragePotentialProfileProperty"; +export type { default as BandStructureProperty } from "./properties/non-scalar/BandStructureProperty"; +export type { default as ChargeDensityProfileProperty } from "./properties/non-scalar/ChargeDensityProfileProperty"; +export type { default as DensityOfStatesProperty } from "./properties/non-scalar/DensityOfStatesProperty"; +export type { default as DielectricTensorProperty } from "./properties/non-scalar/DielectricTensorProperty"; +export type { default as PhononDispersionsProperty } from "./properties/non-scalar/PhononDispersionsProperty"; +export type { default as PhononDOSProperty } from "./properties/non-scalar/PhononDOSProperty"; +export type { default as PotentialProfileProperty } from "./properties/non-scalar/PotentialProfileProperty"; +export type { default as ReactionEnergyProfileProperty } from "./properties/non-scalar/ReactionEnergyProfileProperty"; diff --git a/dist/js/types.js b/dist/js/types.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/dist/js/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); From a050e92c9ac1f326a7cfab1bf3e76fc1f4728b9c Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 18 Nov 2025 19:18:56 -0800 Subject: [PATCH 5/8] update: correct types export --- dist/js/index.d.ts | 1 + dist/js/index.js | 15 +++++++++++++++ dist/js/types.d.ts | 4 ---- package.json | 1 + src/js/index.ts | 2 ++ src/js/types.ts | 4 ---- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/dist/js/index.d.ts b/dist/js/index.d.ts index 9b17b42..2751bd9 100644 --- a/dist/js/index.d.ts +++ b/dist/js/index.d.ts @@ -17,3 +17,4 @@ export { default as ReactionEnergyProfileProperty } from "./properties/non-scala export { protoPropertyHolderMixin } from "./holders/mixins/ProtoPropertyHolderMixin"; export { propertyHolderMixin } from "./holders/mixins/PropertyHolderMixin"; export { metaPropertyHolderMixin } from "./holders/mixins/MetaPropertyHolderMixin"; +export * from "./types"; diff --git a/dist/js/index.js b/dist/js/index.js index 8234746..5e675a0 100644 --- a/dist/js/index.js +++ b/dist/js/index.js @@ -1,4 +1,18 @@ "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -43,3 +57,4 @@ var PropertyHolderMixin_1 = require("./holders/mixins/PropertyHolderMixin"); Object.defineProperty(exports, "propertyHolderMixin", { enumerable: true, get: function () { return PropertyHolderMixin_1.propertyHolderMixin; } }); var MetaPropertyHolderMixin_1 = require("./holders/mixins/MetaPropertyHolderMixin"); Object.defineProperty(exports, "metaPropertyHolderMixin", { enumerable: true, get: function () { return MetaPropertyHolderMixin_1.metaPropertyHolderMixin; } }); +__exportStar(require("./types"), exports); diff --git a/dist/js/types.d.ts b/dist/js/types.d.ts index a12d701..898d76d 100644 --- a/dist/js/types.d.ts +++ b/dist/js/types.d.ts @@ -8,11 +8,7 @@ export type { default as AtomicForcesProperty } from "./properties/tensor/Atomic export type { default as MagneticMomentsProperty } from "./properties/tensor/MagneticMomentsProperty"; export type { default as StressTensorProperty } from "./properties/tensor/StressTensorProperty"; export type { default as AveragePotentialProfileProperty } from "./properties/non-scalar/AveragePotentialProfileProperty"; -export type { default as BandStructureProperty } from "./properties/non-scalar/BandStructureProperty"; -export type { default as ChargeDensityProfileProperty } from "./properties/non-scalar/ChargeDensityProfileProperty"; export type { default as DensityOfStatesProperty } from "./properties/non-scalar/DensityOfStatesProperty"; export type { default as DielectricTensorProperty } from "./properties/non-scalar/DielectricTensorProperty"; export type { default as PhononDispersionsProperty } from "./properties/non-scalar/PhononDispersionsProperty"; export type { default as PhononDOSProperty } from "./properties/non-scalar/PhononDOSProperty"; -export type { default as PotentialProfileProperty } from "./properties/non-scalar/PotentialProfileProperty"; -export type { default as ReactionEnergyProfileProperty } from "./properties/non-scalar/ReactionEnergyProfileProperty"; diff --git a/package.json b/package.json index 71fc87e..2402706 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "url": "https://github.com/Exabyte-io/prode.git" }, "main": "dist/js/index.js", + "types": "dist/js/index.d.ts", "files": [ "/dist", "/src/js", diff --git a/src/js/index.ts b/src/js/index.ts index 9b17b42..a36a295 100644 --- a/src/js/index.ts +++ b/src/js/index.ts @@ -17,3 +17,5 @@ export { default as ReactionEnergyProfileProperty } from "./properties/non-scala export { protoPropertyHolderMixin } from "./holders/mixins/ProtoPropertyHolderMixin"; export { propertyHolderMixin } from "./holders/mixins/PropertyHolderMixin"; export { metaPropertyHolderMixin } from "./holders/mixins/MetaPropertyHolderMixin"; + +export * from "./types"; diff --git a/src/js/types.ts b/src/js/types.ts index e3ddea8..1de32fc 100644 --- a/src/js/types.ts +++ b/src/js/types.ts @@ -18,11 +18,7 @@ export type { default as AtomicForcesProperty } from "./properties/tensor/Atomic export type { default as MagneticMomentsProperty } from "./properties/tensor/MagneticMomentsProperty"; export type { default as StressTensorProperty } from "./properties/tensor/StressTensorProperty"; export type { default as AveragePotentialProfileProperty } from "./properties/non-scalar/AveragePotentialProfileProperty"; -export type { default as BandStructureProperty } from "./properties/non-scalar/BandStructureProperty"; -export type { default as ChargeDensityProfileProperty } from "./properties/non-scalar/ChargeDensityProfileProperty"; export type { default as DensityOfStatesProperty } from "./properties/non-scalar/DensityOfStatesProperty"; export type { default as DielectricTensorProperty } from "./properties/non-scalar/DielectricTensorProperty"; export type { default as PhononDispersionsProperty } from "./properties/non-scalar/PhononDispersionsProperty"; export type { default as PhononDOSProperty } from "./properties/non-scalar/PhononDOSProperty"; -export type { default as PotentialProfileProperty } from "./properties/non-scalar/PotentialProfileProperty"; -export type { default as ReactionEnergyProfileProperty } from "./properties/non-scalar/ReactionEnergyProfileProperty"; From 7f8d6baac342ddb673baf400a29a1f4af8ddeff3 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Tue, 18 Nov 2025 19:34:46 -0800 Subject: [PATCH 6/8] update: export type --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2402706..c4b8127 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "url": "https://github.com/Exabyte-io/prode.git" }, "main": "dist/js/index.js", - "types": "dist/js/index.d.ts", + "types": "dist/js/types.d.ts", "files": [ "/dist", "/src/js", From 9c8b851f852f691b6aec735ad00e4c8683816752 Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Wed, 19 Nov 2025 09:44:29 -0800 Subject: [PATCH 7/8] update: add exports --- package.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c4b8127..c339bf7 100644 --- a/package.json +++ b/package.json @@ -21,13 +21,23 @@ "url": "https://github.com/Exabyte-io/prode.git" }, "main": "dist/js/index.js", - "types": "dist/js/types.d.ts", + "types": "dist/js/index.d.ts", "files": [ "/dist", "/src/js", ".babelrc", "tsconfig.json" ], + "exports": { + ".": { + "types": "./dist/js/index.d.ts", + "default": "./dist/js/index.js" + }, + "./types": { + "types": "./dist/js/types.d.ts", + "default": "./dist/js/types.js" + } + }, "author": "Exabyte Inc.", "bugs": { "url": "https://github.com/Exabyte-io/prode/issues" From 05bbc3d314824742a3a708b1221252fd63adebfb Mon Sep 17 00:00:00 2001 From: VsevolodX Date: Wed, 19 Nov 2025 15:02:04 -0800 Subject: [PATCH 8/8] chore: increase tests coverage --- .nycrc | 2 ++ tests/js/properties/convergence_ionic.test.ts | 20 +++++++++++++ tests/js/properties/hubbard_u.test.ts | 27 ++++++++++++++++++ tests/js/properties/phonon_dos.test.ts | 28 +++++++++++++++++++ .../atomic_constraints.test.ts | 23 +++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 tests/js/properties/convergence_ionic.test.ts create mode 100644 tests/js/properties/hubbard_u.test.ts create mode 100644 tests/js/properties/phonon_dos.test.ts create mode 100644 tests/js/proto_properties/atomic_constraints.test.ts diff --git a/.nycrc b/.nycrc index 67d8da8..ac73507 100644 --- a/.nycrc +++ b/.nycrc @@ -8,6 +8,8 @@ "exclude": [ "tests/**/*", "src/js/generated/**/*", + "dist/**/*", + "build/**/*", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts" diff --git a/tests/js/properties/convergence_ionic.test.ts b/tests/js/properties/convergence_ionic.test.ts new file mode 100644 index 0000000..e529e1b --- /dev/null +++ b/tests/js/properties/convergence_ionic.test.ts @@ -0,0 +1,20 @@ +import type { ConvergenceIonicPropertySchema } from "@mat3ra/esse/dist/js/types"; +import { expect } from "chai"; + +import ConvergenceIonicProperty from "../../../src/js/properties/non-scalar/convergence/ConvergenceIonicProperty"; +import { PropertyName, PropertyType } from "../../../src/js/settings"; + +describe("ConvergenceIonicProperty", () => { + it("should create a convergence ionic property", () => { + const config: Omit = { + units: "eV", + data: [{ energy: -100.5 }, { energy: -100.6 }], + }; + + const property = new ConvergenceIonicProperty(config); + + expect(property).to.be.instanceOf(ConvergenceIonicProperty); + expect(ConvergenceIonicProperty.propertyType).equal(PropertyType.non_scalar); + expect(ConvergenceIonicProperty.propertyName).equal(PropertyName.convergence_ionic); + }); +}); diff --git a/tests/js/properties/hubbard_u.test.ts b/tests/js/properties/hubbard_u.test.ts new file mode 100644 index 0000000..ae6bfe7 --- /dev/null +++ b/tests/js/properties/hubbard_u.test.ts @@ -0,0 +1,27 @@ +import type { HubbardUParametersPropertySchema } from "@mat3ra/esse/dist/js/types"; +import { expect } from "chai"; + +import HubbardUProperty from "../../../src/js/properties/non-scalar/HubbardUProperty"; +import { PropertyName, PropertyType } from "../../../src/js/settings"; + +describe("HubbardUProperty", () => { + it("should create a hubbard u property with correct constructor, propertyType, and propertyName", () => { + const config: Omit = { + units: "eV", + values: [ + { + id: 0, + atomicSpecies: "Fe", + orbitalName: "3d", + value: 4.0, + }, + ], + }; + + const hubbardUProperty = new HubbardUProperty(config); + + expect(hubbardUProperty).to.be.instanceOf(HubbardUProperty); + expect(HubbardUProperty.propertyType).equal(PropertyType.non_scalar); + expect(HubbardUProperty.propertyName).equal(PropertyName.hubbard_u); + }); +}); diff --git a/tests/js/properties/phonon_dos.test.ts b/tests/js/properties/phonon_dos.test.ts new file mode 100644 index 0000000..c76263b --- /dev/null +++ b/tests/js/properties/phonon_dos.test.ts @@ -0,0 +1,28 @@ +import type { PhononDensityOfStatesPropertySchema } from "@mat3ra/esse/dist/js/types"; +import { expect } from "chai"; + +import PhononDOSProperty from "../../../src/js/properties/non-scalar/PhononDOSProperty"; +import { PropertyName, PropertyType } from "../../../src/js/settings"; + +describe("PhononDOSProperty", () => { + it("should create a phonon dos property with correct constructor, propertyType, and propertyName", () => { + const config: Omit = { + xAxis: { + label: "frequency" as const, + units: "cm-1", + }, + yAxis: { + label: "Phonon DOS" as const, + units: "states/cm-1", + }, + xDataArray: [0.0, 100.0, 200.0, 300.0], + yDataSeries: [[0.1, 0.2, 0.3, 0.4] as [number, ...number[]]], + }; + + const phononDOSProperty = new PhononDOSProperty(config); + + expect(phononDOSProperty).to.be.instanceOf(PhononDOSProperty); + expect(PhononDOSProperty.propertyType).equal(PropertyType.non_scalar); + expect(PhononDOSProperty.propertyName).equal(PropertyName.phonon_dos); + }); +}); diff --git a/tests/js/proto_properties/atomic_constraints.test.ts b/tests/js/proto_properties/atomic_constraints.test.ts new file mode 100644 index 0000000..61f971c --- /dev/null +++ b/tests/js/proto_properties/atomic_constraints.test.ts @@ -0,0 +1,23 @@ +import type { AtomicConstraintsPropertySchema } from "@mat3ra/esse/dist/js/types"; +import { expect } from "chai"; + +import AtomicConstraintsProperty from "../../../src/js/proto_properties/AtomicConstraintsProperty"; +import { PropertyName } from "../../../src/js/settings"; + +describe("AtomicConstraintsProperty", () => { + it("should create an atomic constraints property with correct constructor and propertyName", () => { + const config: Omit = { + values: [ + { + id: 0, + value: [true, true, false], + }, + ], + }; + + const atomicConstraintsProperty = new AtomicConstraintsProperty(config); + + expect(atomicConstraintsProperty).to.be.instanceOf(AtomicConstraintsProperty); + expect(AtomicConstraintsProperty.propertyName).equal(PropertyName.atomic_constraints); + }); +});