Skip to content

Commit 1645233

Browse files
authored
Merge pull request #83 from Exabyte-io/feature/SOF-7709
update: use utils package
2 parents 06b902c + a03adce commit 1645233

File tree

7 files changed

+228
-397
lines changed

7 files changed

+228
-397
lines changed

.github/workflows/cicd.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
strategy:
1818
matrix:
1919
node-version:
20-
- 14.x
2120
- 20.x
2221

2322
steps:
@@ -57,4 +56,3 @@ jobs:
5756
with:
5857
npm-token: ${{ secrets.NPM_TOKEN }}
5958
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
60-

dist/js/context/ContextProvider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports.ContextProviderName = void 0;
1515
* to next one, for example data about material to track when it is changed.
1616
* @notes Should hold static data only (see `setData` method), no classes or functions
1717
*/
18-
const utils_1 = require("@mat3ra/code/dist/js/utils");
18+
const utils_1 = require("@mat3ra/utils");
1919
const lodash_1 = __importDefault(require("lodash"));
2020
// TODO: separate application-specific CPs
2121
var ContextProviderName;
@@ -90,7 +90,7 @@ class ContextProvider {
9090
return this.isEdited ? this.data : this.defaultData;
9191
}
9292
setData(data) {
93-
this.data = (0, utils_1.deepClone)(data);
93+
this.data = utils_1.Utils.clone.deepClone(data);
9494
}
9595
// override in children
9696
// eslint-disable-next-line class-methods-use-this

dist/js/templateMixin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
55
Object.defineProperty(exports, "__esModule", { value: true });
66
exports.templateMixin = templateMixin;
77
exports.templateStaticMixin = templateStaticMixin;
8-
const utils_1 = require("@mat3ra/code/dist/js/utils");
8+
const utils_1 = require("@mat3ra/utils");
99
const JSONSchemasInterface_1 = __importDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
1010
const nunjucks_1 = __importDefault(require("nunjucks"));
1111
const ContextProviderRegistryContainer_1 = __importDefault(require("./context/ContextProviderRegistryContainer"));
@@ -73,7 +73,7 @@ function templateMixin(item) {
7373
_cleanRenderingContext(object) {
7474
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7575
const { job, ...clone } = object;
76-
return (0, utils_1.deepClone)(clone);
76+
return utils_1.Utils.clone.deepClone(clone);
7777
},
7878
/*
7979
* @summary Initializes context provider class instances. `providerContext` is used to pass the data about any

package-lock.json

Lines changed: 218 additions & 386 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@
7272
},
7373
"peerDependencies": {
7474
"@exabyte-io/application-flavors.js": "*",
75+
"@mat3ra/utils": "*",
7576
"@mat3ra/code": "*",
7677
"@mat3ra/esse": "*",
7778
"@mat3ra/made": "*"
7879
},
7980
"engines": {
80-
"node": ">=12.0.0"
81+
"node": ">=20.0.0"
8182
},
8283
"lint-staged": {
8384
"*.js": "eslint --cache --fix",

src/js/context/ContextProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* to next one, for example data about material to track when it is changed.
1010
* @notes Should hold static data only (see `setData` method), no classes or functions
1111
*/
12-
import { deepClone } from "@mat3ra/code/dist/js/utils";
12+
import { Utils } from "@mat3ra/utils";
1313
import lodash from "lodash";
1414

1515
export interface ContextProviderInstance {
@@ -131,7 +131,7 @@ export default class ContextProvider {
131131
}
132132

133133
setData(data: object) {
134-
this.data = deepClone(data);
134+
this.data = Utils.clone.deepClone(data);
135135
}
136136

137137
// override in children

src/js/templateMixin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
22
import type { NamedInMemoryEntity } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
3-
import { deepClone } from "@mat3ra/code/dist/js/utils";
3+
import { Utils } from "@mat3ra/utils";
44
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
55
import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
66
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
@@ -121,7 +121,7 @@ export function templateMixin(item: TemplateBase) {
121121
_cleanRenderingContext(object: Record<string, unknown>) {
122122
// eslint-disable-next-line @typescript-eslint/no-unused-vars
123123
const { job, ...clone } = object;
124-
return deepClone(clone);
124+
return Utils.clone.deepClone(clone);
125125
},
126126

127127
/*

0 commit comments

Comments
 (0)