dev: dismissed js transpilation of libs

Massimo Melina committed Jan 7, 2023 at 19:49 UTC 8fa0b232951d70dbacd543cadd9c7a99d09069a0
24 files changed +35 -112
admin/package.json
-1
@@ -17,7 +17,6 @@
17 "@mui/lab": "^5.0.0-alpha.94",
18 "@mui/material": "^5.10.0",
19 "@mui/x-data-grid": "^5.15.1",
20 - "js-sha512": "^0.8.0",
20 "react": "^18.2.0",
21 "react-dom": "^18.2.0",
22 "react-router-dom": "^6.2.1",
admin/src/dialog.ts
+1 -1
@@ -23,7 +23,7 @@ import { newDialog, closeDialog, dialogsDefaults, DialogOptions } from '@hfs/sha
23 import { Form, FormProps } from '@hfs/mui-grid-form'
24 import { useBreakpoint } from './misc'
25 import { Flex } from '@hfs/frontend/src/components'
26 -export * from '@hfs/shared/lib/dialogs'
26 +export * from '@hfs/shared/dialogs'
27
28 dialogsDefaults.Container = function Container(d:DialogOptions) {
29 useEffect(()=>{
admin/src/index.ts
+1 -1
@@ -3,7 +3,7 @@
3 import { createElement as h, StrictMode } from 'react'
4 import { createRoot } from 'react-dom/client'
5 import './index.css'
6 -import '@hfs/shared/src/min-crypto-polyfill'
6 +import '@hfs/shared/min-crypto-polyfill'
7 import App from './App'
8
9 createRoot(document.getElementById('root')!)
frontend/package.json
-1
@@ -10,7 +10,6 @@
10 },
11 "dependencies": {
12 "@hfs/shared": "*",
13 - "js-sha512": "^0.8.0",
13 "lodash": "^4.17.21",
14 "react": "^18.2.0",
15 "react-dom": "^18.2.0",
frontend/src/dialog.ts
+2 -2
@@ -2,8 +2,8 @@
2
3 import { createElement as h, ReactElement, ReactNode, useEffect, useRef } from 'react'
4 import './dialog.css'
5 -import { newDialog, closeDialog } from '@hfs/shared/lib/dialogs'
6 -export * from '@hfs/shared/lib/dialogs'
5 +import { newDialog, closeDialog } from '@hfs/shared/dialogs'
6 +export * from '@hfs/shared/dialogs'
7
8 interface PromptOptions { def?:string, type?:string }
9 export async function promptDialog(msg: string, { def, type }:PromptOptions={}) : Promise<string | null> {
frontend/src/index.ts
+1 -1
@@ -3,7 +3,7 @@
3 import { createElement as h, StrictMode } from 'react'
4 import { createRoot } from 'react-dom/client'
5 import './index.scss'
6 -import '@hfs/shared/src/min-crypto-polyfill'
6 +import '@hfs/shared/min-crypto-polyfill'
7 import App from './App'
8
9 createRoot(document.getElementById('root')!)
frontend/src/menu.ts
+1 -1
@@ -10,7 +10,7 @@ import { showOptions } from './options'
10 import showUserPanel from './UserPanel'
11 import { useNavigate } from 'react-router-dom'
12 import _ from 'lodash'
13 -import { closeDialog } from '@hfs/shared/lib/dialogs'
13 +import { closeDialog } from '@hfs/shared/dialogs'
14
15 export function MenuPanel() {
16 const { showFilter, remoteSearch, stopSearch, stoppedSearch, patternFilter, selected } = useSnapState()
mui-grid-form/SelectField.ts renamed
+1 -1
@@ -1,5 +1,5 @@
1 import { createElement as h } from 'react'
2 -import { FieldProps } from './Form'
2 +import { FieldProps } from '.'
3 import { FormControl, FormControlLabel, FormLabel, MenuItem, Radio, RadioGroup, TextField } from '@mui/material'
4 import { SxProps } from '@mui/system'
5
mui-grid-form/StringField.ts renamed
+1 -1
@@ -1,5 +1,5 @@
1 import { createElement as h, useEffect, useRef, useState } from 'react'
2 -import { FieldProps } from './Form'
2 +import { FieldProps } from '.'
3 import { InputAdornment, TextField } from '@mui/material'
4
5 export function StringField({ value, onChange, min, max, required, getApi, typing, start, end, ...props }: FieldProps<string>) {
mui-grid-form/StringStringField.ts renamed
+1 -1
@@ -3,7 +3,7 @@
3 import { createElement as h, useRef } from 'react'
4 import { Grid, IconButton } from '@mui/material'
5 import { Add, Delete } from '@mui/icons-material'
6 -import { FieldProps, StringField } from './Form'
6 +import { FieldProps, StringField } from '.'
7
8 export function StringStringField({ value, onChange, keyLabel='key', valueLabel='value', keyWidth=5, valueWidth=5, actionsWidth=1 }: FieldProps<Record<string,string>> & { keyLabel:string }) {
9 const refNew = useRef()
mui-grid-form/index.ts renamed
+1 -1
@@ -16,7 +16,7 @@ import {
16 import { Box, BoxProps, Button, Grid } from '@mui/material'
17 import { Save } from '@mui/icons-material'
18 import { LoadingButton } from '@mui/lab'
19 -import _ from 'lodash'
19 +import * as _ from 'lodash'
20 import { StringField } from './StringField'
21 import { GridProps } from '@mui/material/Grid/Grid'
22 export * from './SelectField'
mui-grid-form/misc-fields.ts renamed
+1 -1
@@ -1,6 +1,6 @@
1 import { createElement as h, useEffect, useState } from 'react'
2 import { StringField } from './StringField'
3 -import { FieldProps } from './Form'
3 +import { FieldProps } from '.'
4 import {
5 Box,
6 Checkbox,
mui-grid-form/package.json
+5 -8
@@ -1,18 +1,15 @@
1 {
2 "name": "@hfs/mui-grid-form",
3 - "main": "./lib/Form.js",
4 - "types": "./lib/Form.d.ts",
5 - "scripts": {
6 - "build": "tsc"
7 - },
3 + "main": "index.ts",
4 "dependencies": {
5 "@mui/icons-material": "*",
6 "@mui/lab": "*",
11 - "@mui/material": "*"
7 + "@mui/material": "*",
8 + "lodash": "*"
9 },
10 "devDependencies": {
11 + "@types/lodash": "*",
12 "react": "*",
15 - "react-dom": "*",
16 - "typescript": "*"
13 + "react-dom": "*"
14 }
15 }
mui-grid-form/tsconfig.json deleted
-30
@@ -1,30 +0,0 @@
1 -{
2 - "compilerOptions": {
3 - "target": "es2017",
4 - "lib": [
5 - "dom",
6 - "dom.iterable",
7 - "esnext"
8 - ],
9 - "allowJs": true,
10 - "skipLibCheck": true,
11 - "allowSyntheticDefaultImports": true,
12 - "strict": true,
13 - "forceConsistentCasingInFileNames": true,
14 - "module": "esnext",
15 - "moduleResolution": "node",
16 - "resolveJsonModule": true,
17 - "isolatedModules": true,
18 - "outDir": "lib",
19 - "declaration": true
20 - },
21 - "exclude": [
22 - "node_modules",
23 - "lib-esm",
24 - "lib",
25 - "**/*.spec*"
26 - ],
27 - "include": [
28 - "src"
29 - ]
30 -}
package-lock.json
+14 -16
@@ -79,7 +79,6 @@
79 "@mui/material": "^5.10.0",
80 "@mui/x-data-grid": "^5.15.1",
81 "immer": "^9.0.15",
82 - "js-sha512": "^0.8.0",
82 "react": "^18.2.0",
83 "react-dom": "^18.2.0",
84 "react-router-dom": "^6.2.1",
@@ -102,7 +101,6 @@
101 "name": "@hfs/frontend",
102 "dependencies": {
103 "@hfs/shared": "*",
105 - "js-sha512": "^0.8.0",
104 "lodash": "^4.17.21",
105 "react": "^18.2.0",
106 "react-dom": "^18.2.0",
@@ -128,12 +126,13 @@
126 "dependencies": {
127 "@mui/icons-material": "*",
128 "@mui/lab": "*",
131 - "@mui/material": "*"
129 + "@mui/material": "*",
130 + "lodash": "*"
131 },
132 "devDependencies": {
133 + "@types/lodash": "*",
134 "react": "*",
135 - "react-dom": "*",
136 - "typescript": "*"
135 + "react-dom": "*"
136 }
137 },
138 "node_modules/@ampproject/remapping": {
@@ -6113,6 +6112,7 @@
6112 "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz",
6113 "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==",
6114 "dev": true,
6115 + "peer": true,
6116 "bin": {
6117 "tsc": "bin/tsc",
6118 "tsserver": "bin/tsserver"
@@ -6674,13 +6674,12 @@
6674 "shared": {
6675 "name": "@hfs/shared",
6676 "dependencies": {
6677 + "js-sha512": "^0.8.0",
6678 "tssrp6a": "^3.0.0"
6679 },
6680 "devDependencies": {
6681 "react": "*",
6681 - "react-dom": "*",
6682 - "sass": "*",
6683 - "typescript": "*"
6682 + "react-dom": "*"
6683 }
6684 }
6685 },
@@ -7302,7 +7301,6 @@
7301 "@types/react-virtualized-auto-sizer": "^1.0.1",
7302 "@types/react-window": "^1.8.5",
7303 "immer": "^9.0.15",
7305 - "js-sha512": "^0.8.0",
7304 "react": "^18.2.0",
7305 "react-dom": "^18.2.0",
7306 "react-router-dom": "^6.2.1",
@@ -7323,7 +7321,6 @@
7321 "@types/react": "^18.0.15",
7322 "@types/react-dom": "^18.0.6",
7323 "cross-env": "^7.0.3",
7326 - "js-sha512": "^0.8.0",
7324 "lodash": "^4.17.21",
7325 "react": "^18.2.0",
7326 "react-dom": "^18.2.0",
@@ -7343,19 +7340,19 @@
7340 "@mui/icons-material": "*",
7341 "@mui/lab": "*",
7342 "@mui/material": "*",
7343 + "@types/lodash": "*",
7344 + "lodash": "*",
7345 "react": "*",
7347 - "react-dom": "*",
7348 - "typescript": "*"
7346 + "react-dom": "*"
7347 }
7348 },
7349 "@hfs/shared": {
7350 "version": "file:shared",
7351 "requires": {
7352 + "js-sha512": "^0.8.0",
7353 "react": "*",
7354 "react-dom": "*",
7356 - "sass": "*",
7357 - "tssrp6a": "^3.0.0",
7358 - "typescript": "*"
7355 + "tssrp6a": "^3.0.0"
7356 }
7357 },
7358 "@jridgewell/gen-mapping": {
@@ -11213,7 +11210,8 @@
11210 "version": "4.8.2",
11211 "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz",
11212 "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==",
11216 - "dev": true
11213 + "dev": true,
11214 + "peer": true
11215 },
11216 "undefsafe": {
11217 "version": "2.0.5",
package.json
+1 -5
@@ -13,16 +13,12 @@
13 "scripts": {
14 "watch-server": "cross-env DEV=1 nodemon --ignore tests/ --watch src -e ts,tsx --exec ts-node src",
15 "watch-server-proxied": "cross-env FRONTEND_PROXY=3005 ADMIN_PROXY=3006 npm run watch-server",
16 - "watch-shared": "cd shared && tsc --watch",
17 - "watch-form": "cd mui-grid-form && tsc --watch",
16 "start-frontend": "npm run start --workspace=frontend",
17 "start-admin": "npm run start --workspace=admin",
20 - "build-all": "npm audit --omit=dev && rm -rf dist && npm i && npm run build-shared && npm run build-server && npm run build-form && npm run build-frontend && npm run build-admin && echo COMPLETED",
18 + "build-all": "npm audit --omit=dev && rm -rf dist && npm i && npm run build-server && npm run build-frontend && npm run build-admin && echo COMPLETED",
19 "build-server": "rm -rf dist/src dist/plugins && tsc --target es2018 && touch package.json && cp -v -r package.json README* LICENSE* plugins dist && find dist -name .DS_Store -delete",
20 "build-frontend": "npm run build --workspace=frontend",
21 "build-admin": "npm run build --workspace=admin",
24 - "build-shared": "npm run build --workspace=shared",
25 - "build-form": "npm run build --workspace=mui-grid-form",
22 "server-for-test": "node dist/src --cwd . --config tests",
23 "server-for-test-dev": "cross-env DEV=1 nodemon --ignore tests/ --watch src -e ts,tsx --exec ts-node src -- --cwd . --config tests",
24 "test": "mocha -r ts-node/register 'tests/**/*.ts'",
shared/dialogs.ts renamed
shared/index.ts renamed
shared/min-crypto-polyfill.js renamed
shared/package.json
+3 -9
@@ -1,18 +1,12 @@
1 {
2 "name": "@hfs/shared",
3 - "main": "./lib/index.js",
4 - "types": "./lib/index.d.ts",
5 - "scripts": {
6 - "test": "test",
7 - "build": "tsc && sass src/:lib/"
8 - },
3 + "main": "index.ts",
4 "dependencies": {
5 + "js-sha512": "^0.8.0",
6 "tssrp6a": "^3.0.0"
7 },
8 "devDependencies": {
9 "react": "*",
14 - "react-dom": "*",
15 - "typescript": "*",
16 - "sass": "*"
10 + "react-dom": "*"
11 }
12 }
shared/react.ts renamed
shared/srp.ts renamed
shared/tsconfig.json deleted
-30
@@ -1,30 +0,0 @@
1 -{
2 - "compilerOptions": {
3 - "target": "es2017",
4 - "lib": [
5 - "dom",
6 - "dom.iterable",
7 - "esnext"
8 - ],
9 - "allowJs": true,
10 - "skipLibCheck": true,
11 - "allowSyntheticDefaultImports": true,
12 - "strict": true,
13 - "forceConsistentCasingInFileNames": true,
14 - "module": "esnext",
15 - "moduleResolution": "node",
16 - "resolveJsonModule": true,
17 - "isolatedModules": true,
18 - "outDir": "lib",
19 - "declaration": true
20 - },
21 - "exclude": [
22 - "node_modules",
23 - "lib-esm",
24 - "lib",
25 - "**/*.spec*"
26 - ],
27 - "include": [
28 - "src"
29 - ]
30 -}
tests/test.ts
+1 -1
@@ -2,7 +2,7 @@ import axios from 'axios'
2 import { wrapper } from 'axios-cookiejar-support'
3 import { CookieJar } from 'tough-cookie'
4 import { Done } from 'mocha'
5 -import { srpSequence } from '@hfs/shared/src/srp'
5 +import { srpSequence } from '@hfs/shared/srp'
6 /*
7 import { PORT, srv } from '../src'
8