Skip to content

Commit 1961a1b

Browse files
authored
Merge pull request #58 from Exabyte-io/update/SOF-6668
SOF-6668: Typescript
2 parents 379c198 + 3d55a40 commit 1961a1b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2368
-5751
lines changed

.babelrc

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
}
1010
],
1111
"@babel/preset-react",
12+
"@babel/preset-typescript"
1213
],
1314
"plugins": [
1415
"@babel/plugin-proposal-class-properties"

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.eslintrc.json

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
11
{
2-
"extends": ["@exabyte-io/eslint-config"]
2+
"extends": ["@exabyte-io/eslint-config"],
3+
"overrides": [
4+
{
5+
"files": [
6+
"*.ts",
7+
"*.tsx"
8+
],
9+
"extends": [
10+
"@exabyte-io/eslint-config",
11+
"eslint:recommended",
12+
"plugin:@typescript-eslint/eslint-recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
15+
"plugin:import/typescript"
16+
],
17+
"parser": "@typescript-eslint/parser",
18+
"rules": {
19+
"@typescript-eslint/ban-ts-comment": "off",
20+
"import/no-absolute-path": "off",
21+
"import/extensions": "off",
22+
"react/forbid-prop-types": "off",
23+
"react/jsx-filename-extension": "off",
24+
"react/require-default-props": "off",
25+
"no-use-before-define": "off",
26+
"no-shadow": "off",
27+
"one-var": "off",
28+
"max-classes-per-file": "off",
29+
"@typescript-eslint/no-use-before-define": ["error"]
30+
},
31+
"plugins": ["@typescript-eslint"]
32+
}
33+
]
334
}
435

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ node_modules/
55
.nyc_output/
66
.idea/
77
*.DS_Store
8+
src/types.ts
9+
.vscode/

.mocharc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extension": ["ts", "js"],
3+
"spec": "tests/**/*.tests.*",
4+
"require": "ts-node/register"
5+
}

compileTS.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* This script should be run with ts-node before transpile step as TS interfaces is required to transpile step
3+
*/
4+
import { compileTS } from "./src/bin/compileTS";
5+
import { esseSchema } from "./src/JSONSchemasInterface";
6+
7+
compileTS(esseSchema, `./src/types.ts`);

package-lock.json

+898-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+27-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
"version": "0.0.0",
44
"description": "COre DEfinitions in JS for Mat3ra.com (Exabyte.io)",
55
"scripts": {
6-
"test": "nyc --reporter=text mocha --recursive --bail --require @babel/register/lib --require tests/setup.js tests",
6+
"test": "mocha",
77
"lint": "eslint src tests && prettier --write src tests",
88
"lint:fix": "eslint --fix --cache src tests && prettier --write src tests",
9-
"transpile": "babel --out-dir dist src",
10-
"postinstall": "npm run transpile",
9+
"transpile": "tsc",
10+
"postinstall": "npm run compileTS && npm run transpile",
1111
"prettier": "prettier --check src tests",
12-
"prepare": "husky install"
12+
"prepare": "husky install",
13+
"compileTS": "ts-node ./compileTS.ts"
1314
},
1415
"repository": {
1516
"type": "git",
@@ -35,7 +36,10 @@
3536
"files": [
3637
"/dist",
3738
"/src",
38-
".babelrc"
39+
".babelrc",
40+
"modules.d.ts",
41+
"compileTS.ts",
42+
"tsconfig.json"
3943
],
4044
"author": "Exabyte Inc.",
4145
"bugs": {
@@ -44,7 +48,6 @@
4448
"license": "Apache-2.0",
4549
"homepage": "https://github.com/Exabyte-io/code.js",
4650
"dependencies": {
47-
"json-schema-deref-sync": "0.14.0",
4851
"@babel/cli": "7.16.0",
4952
"@babel/core": "7.16.0",
5053
"@babel/eslint-parser": "7.16.3",
@@ -53,22 +56,38 @@
5356
"@babel/preset-react": "7.16.7",
5457
"@babel/register": "^7.16.0",
5558
"@babel/runtime-corejs3": "7.16.8",
56-
"@exabyte-io/esse.js": "2023.8.25-1",
59+
"@exabyte-io/esse.js": "2023.8.30-0",
60+
"@types/chai": "^4.3.5",
61+
"@types/crypto-js": "^4.1.1",
62+
"@types/js-yaml": "^4.0.5",
63+
"@types/json-schema": "^7.0.12",
64+
"@types/mocha": "^10.0.1",
65+
"@types/node": "^20.4.2",
66+
"@types/react-jsonschema-form": "^1.7.8",
67+
"@types/underscore": "^1.11.6",
5768
"ajv": "4.1.7",
5869
"crypto-js": "^4.1.1",
5970
"js-yaml": "^4.1.0",
71+
"json-schema": "^0.4.0",
72+
"json-schema-deref-sync": "0.14.0",
6073
"json-schema-merge-allof": "^0.8.1",
6174
"json-schema-to-typescript": "^13.0.2",
6275
"lodash": "^4.17.21",
6376
"mathjs": "^3.9.0",
6477
"mixwith": "^0.1.1",
6578
"nunjucks": "^3.2.4",
79+
"react-jsonschema-form": "^1.8.1",
80+
"ts-node": "^10.9.1",
81+
"typescript": "^4.5.5",
6682
"underscore": "^1.13.3",
6783
"underscore.string": "^3.3.4",
6884
"uuid": "8.3.2"
6985
},
7086
"devDependencies": {
87+
"@babel/preset-typescript": "^7.22.5",
7188
"@exabyte-io/eslint-config": "^2022.11.17-0",
89+
"@typescript-eslint/eslint-plugin": "^5.56.0",
90+
"@typescript-eslint/parser": "^5.56.0",
7291
"chai": "^4.3.4",
7392
"eslint": "7.32.0",
7493
"eslint-config-airbnb": "19.0.2",
@@ -79,6 +98,7 @@
7998
"eslint-plugin-prettier": "^4.2.1",
8099
"eslint-plugin-react": "7.30.0",
81100
"eslint-plugin-simple-import-sort": "7.0.0",
101+
"eslint-import-resolver-exports": "^1.0.0-beta.2",
82102
"husky": "^7.0.4",
83103
"lint-staged": "^12.1.2",
84104
"mocha": "^9.1.3",

src/JSONSchemasInterface.js

-132
This file was deleted.

0 commit comments

Comments
 (0)